Skip to content

v0.6.0: inline post-compaction recovery instead of a pointer (#9)#19

Merged
jsirish merged 2 commits into
mainfrom
jsirish/v0.6.0-inline-compact-recovery
Jul 6, 2026
Merged

v0.6.0: inline post-compaction recovery instead of a pointer (#9)#19
jsirish merged 2 commits into
mainfrom
jsirish/v0.6.0-inline-compact-recovery

Conversation

@jsirish

@jsirish jsirish commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Closes issue [P2] Inline post-compaction recovery content instead of a pointer #9 (P2, from docs/AUDIT-v0.4.0.md): session-onboard.sh's source=compact path now inlines the last 30 lines of the current session's buffer directly into the SessionStart block instead of only printing a pointer.
  • Saves the model a tool call it might otherwise skip, right where post-compaction recall is weakest. The full-file pointer is kept for sessions longer than the window.
  • Bounded output: buffer lines are already length-clamped at capture time, so a fixed line count bounds the inlined block's size regardless of session length.
  • startup/resume/clear sources are unaffected — only compact inlines 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 container
  • Manual smoke test confirming the actual inline output shape (see PR description context)

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

jsirish and others added 2 commits July 6, 2026 14:06
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
@jsirish
jsirish merged commit 2ee5f04 into main Jul 6, 2026
1 check passed
@jsirish
jsirish deleted the jsirish/v0.6.0-inline-compact-recovery branch July 6, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant