session file history#67
Open
SK-DEV-AI wants to merge 5 commits into
Open
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.
Author
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.