fix(recording): command-driven Start/Stop (§7) + header fields + plan honesty#473
Merged
Juliusolsson05 merged 1 commit intoJul 7, 2026
Conversation
… honesty
A plan-vs-code audit found the shipped feature drifted from
docs/rendering/session-recording-plan-2026-07.md §7: recording was
auto-only (every session written from launch — a disk-burial trap), and
the record-session:start/stop handlers + Start/Stop command the plan
specified as the PRIMARY control were never built. Fixed here:
- Recording is now COMMAND-DRIVEN and opt-in. The manager records a
session only after startRecording() is called; observe() ignores
events for sessions the user never started. AGENT_CODE_SESSION_RECORD
is downgraded to an OPTIONAL auto-start power flag (off by default),
so a normal day never silently fills GBs.
- record-session:start / :stop / :is-recording ipcMain handlers (gated
on the capability = dev-debug), preload start/stop/isRecording, and a
"Toggle Session Recording" command that starts/stops the focused pane
and labels itself from live recorder state. Gate split: capability
(command available) = dev-debug; auto-start = the env flag.
- §3 header fields the audit flagged as missing: meta.json now carries
kind:'session-recording' + redaction:'none', and provider/cwd are
filled from session:started (providerSessionId stays best-effort).
- §4: the queue drop-oldest path now writes a __truncated{reason:
'queue-drop'} tombstone at the gap position (was counter-only; the
comment claiming an inline marker was inaccurate).
- Plan §0b "As-built reconciliation": records the intentional deviations
(folder-per-recording, command-driven) and the one real limitation
(replay is reducer-faithful, NOT the React fold — so the fold-glue bug
class #469 is capturable in the recording but not yet in replay; needs
the fold extracted from the React hook, converging with #394). No
silent drift between plan and code.
9 recorder tests (incl. on-demand + auto-record power-flag cases);
full unit suite 427; both gates clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6 tasks
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.
A plan-vs-code audit (four-lens) found the merged Session Recording feature drifted from its own plan §7. Fixes here:
The big one — recording is now command-driven, not auto. The first build auto-recorded every session from launch (a GB-burial trap) and never built the
record-session:start/stophandlers + Start/Stop command the plan specified as the primary control. Now: nothing records until you run Toggle Session Recording on a pane;AGENT_CODE_SESSION_RECORD=1is an optional auto-start power flag (off by default). Gate split: capability (command shows) = dev-debug; auto-start = the env flag.Also from the audit:
meta.jsonnow haskind+redaction, and provider/cwd fill fromsession:started.__truncated{reason:'queue-drop'}line at the gap (was counter-only; comment was wrong).9 recorder tests; full unit suite 427; both gates clean.
Usage after merge:
AGENT_CODE_DEV_DEBUG=1 npm run dev, then run Toggle Session Recording on the pane you want to capture. Attach Recording Note marks a tick live.🤖 Generated with Claude Code