v0.6.0: inline post-compaction recovery instead of a pointer (#9)#19
Merged
Conversation
session-onboard.sh's source=compact path previously printed only a pointer
("your buffer survived at <path>, read it"), costing the model a tool call
it might not make right where post-compaction recall is weakest. Now inlines
the last 30 lines of the current session's buffer directly into the
SessionStart block (fenced), including any trailing compaction-boundary
marker, which lands there naturally since no captured action can occur
between PreCompact stamping it and this SessionStart firing. The full-file
pointer is kept for sessions longer than the window. Bounded output: each
buffer line is length-clamped at capture time, so a fixed line count keeps
this bounded regardless of session length. startup/resume/clear are
unaffected - only compact inlines buffer content.
Verified: full 150-assertion suite (7 new) plus shellcheck under both
Homebrew and an apt-get install shellcheck Ubuntu container.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4iokjvAbBLgrRJYwCVtqb
…reak) Two findings from an independent review pass on the v0.6.0 diff: 1. CONFIRMED: the new inline-tail feature's "bounded in bytes" claim was false - a Bash record's description and an Edit/Write/NotebookEdit record's file_path are never length-clamped in session-capture.sh (only command and the other free-text fields are). An unusually long one of either would inline verbatim despite the 30-line cap. Rather than clamp every capture-side field, the inline-tail block now caps each line to 300 chars itself via awk - the bound is enforced where the claim is made, not assumed from upstream. 2. PLAUSIBLE: tl_clean_ctrl (used to sanitize trigger/reason before stamping) only stripped control characters, not backticks - a run of 3+ backticks in one of those fields could break the new markdown fence. Not reachable today (both are fixed enum strings from the harness), but cheap to close at the source: tl_clean_ctrl now strips backticks too, matching the jq-side clean def's existing behavior for capture-side fields. Verified: full 154-assertion suite (4 new) plus shellcheck under both Homebrew and an apt-get install shellcheck Ubuntu container. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4iokjvAbBLgrRJYwCVtqb
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.
Summary
session-onboard.sh'ssource=compactpath now inlines the last 30 lines of the current session's buffer directly into the SessionStart block instead of only printing a pointer.startup/resume/clearsources are unaffected — onlycompactinlines content.Test plan
tests/run.sh: 150/150 passing (143 + 7 new: inline captured action + boundary marker on compact, no-inline on startup/resume, bounded-tail excludes/includes checks)shellcheck -s sh hooks/*.sh tests/*.sh: clean under Homebrew AND an apt-installed Ubuntu containerCo-Authored-By: Claude Opus 5 noreply@anthropic.com