session file history#67
Conversation
Tracks reads, zooms, edits, writes, deletes, and moves per session. Returns newest-first via the session_history command. Registered as aft_session tool in the OpenCode plugin. 7 command handlers instrumented at validate_path. 50-entry cap per session with consecutive-same-op dedup. All 966 tests pass. Pi plugin needs a session.ts tool registered in its tool map to surface the same functionality.
Runs git status --porcelain before scanning the directory and annotates each file with its two-character status code ( M, ??, A , D , etc.). Shows as a prefix in the formatted table output. 933 tests pass (1 pre-existing PTY timing flake).
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
collect_git_statuses naively split at character index 3, breaking on rename entries (R old -> new) and quoted filenames (A "file with spaces"). The fix: - Detects rename/copy lines by checking for arrow ( -> ) and takes the target path as the last segment - Strips surrounding quotes from porcelain v1 output All 966 tests pass.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
trim_matches("") only strips surrounding quotes but leaves C-style
escape sequences (\t, \", \\, \n, \NNN) intact inside the path,
causing hashmap lookup failures for files with tabs, quotes, or other
special characters.
Added unescape_porcelain_path() that handles all git quote-c-style(3)
escape sequences: \a, \b, \t, \n, \v, \f, \r, \", \\, and
\NNN octal escapes for arbitrary bytes.
All 966 tests pass.
|
Fixed the P2 unescaping issue — added unescape_porcelain_path() that handles all git quote-c-style(3) escape sequences (\a, \b, \t, \n, \v, \f, \r, \", \\, and \NNN octal). Re-trigger cubic please. |
There was a problem hiding this comment.
2 issues found across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
P2 issues from cubic review: 1. Outline porcelain parser: gate rename/copy path extraction on the status code (starts with 'R'/'C') instead of substring search for " -> ", which would misparse filenames literally containing that pattern. 2. SessionHistory: add LRU eviction when sessions exceed MAX_SESSIONS (100) and expose close_session() for explicit cleanup. Previously each new session ID grew the HashMap unboundedly. All 966 tests pass.
Workspace bumps + Pi URL parity for aft_outline / aft_zoom. aft-bridge: - New module: url-fetch.ts (moved from opencode-plugin/src/shared/), re-exports fetchUrlToTempFile, cleanupUrlCache, _isPrivateIpv4 so both OpenCode and Pi share one DNS-pinned, SSRF-guarded URL fetcher. - Add undici dependency (used by url-fetch). opencode-plugin: - Imports fetchUrlToTempFile + cleanupUrlCache from @cortexkit/aft-bridge. - Delete src/shared/url-fetch.ts (now in aft-bridge). - url-fetch test imports updated. pi-plugin (closes ctx_note cortexkit#67): - aft_outline now accepts URL targets (http://, https://). String target gets URL-prefix detection before stat() / multi-file fan-out. - aft_zoom gains optional 'url' parameter, mutually exclusive with 'filePath'. Multi-symbol zoom routes through the cached fetched copy. - Renderers updated to handle filePath | url | undefined targets. Quality gate: - 669/2 skip/0 fail OpenCode tests - 369/0 fail Pi tests - typecheck clean - biome lint clean
|
Hi @SK-DEV-AI, could you explain the reasoning behind these 2 features? I'm not seeing a benefit for agents in neither of them. (also it would be better if you don't combine separate features in a single PR for the future PRs, thanks) |
Two additions to the existing tool surface, plus durability fixes for both.
Session file history — tracks reads/zooms/edits/writes/deletes/moves per session, newest-first. 50-entry cap per session with consecutive-same-op dedup. Session count capped at 100 with LRU eviction. aft_session tool exposed in the OpenCode plugin.
Git-aware outline — aft_outline --files now annotates each file with its git status (two-char prefix: M, ??, A, D, etc.). Runs git status --porcelain once per directory. Full C-style unescape for special-char filenames. Rename/copy detection gated on status code, not substring.
966 tests pass.