Committed-Range Closeout & the Two-Turn Gate Protocol
Agents Remember 2.9.1
Closeout now verifies everything a task transports — not just what sits dirty in the working tree — closing the phantom-drift hole that merge-consolidation and pre-committed flows hit (#83). The lifecycle also gains the two-turn gate protocol so gate reports are never swallowed by approval prompts.
Highlights
- The closeout worklist covers the unverified committed range: paths changed between the last verified commit and the work branch HEAD, scoped by the recorded base so synced-in parallel work and previous closeouts never re-gate.
- Two-tier responsibility: already-onboarded artifacts (sidecars, route overviews, entity fingerprints) gate on every transported change regardless of author; committed-range paths without onboarding are reported as the non-blocking
unonboardedlist instead of forcing whole-repository onboarding. - Memory-side honesty: body gates baseline against the last verified memory commit instead of memory HEAD, so sidecar work committed before closeout classifies correctly (and early-committed new sidecars stop false-flagging as stale).
- Bounded tool payloads: lists that scale with transported history are exposed as count + capped sample (
PATH_SAMPLE_LIMIT= 30). - Two-turn gate protocol in the
l-01-session-job-lifecycleandc-12-closeoutskills: every gate is a report turn (full relay ending with a prose approval question) followed by an action turn — no question widget, mutating tool call, or permission prompt may ride the report turn.
Onboarding And Memory
worktree_closeout_preview/applystamp verification metadata to the existing HEAD when the tree is clean, so pre-committed work needs no artificial dirty state.- Preview and apply payloads surface
unonboarded(count + sample) for the commit-approval relay;changed_code_paths, the metadata-refresh view, the sidecar body gate, andrefreshed_onboardingadopt the bounded count + sample shape (blockingmissing/unsupportedlists stay full). - Gate error messages cap their path joins, so large consolidations cannot flood tool responses.
Upgrade Notes
- Closeout gate behavior widens: tasks carrying committed-but-unverified changes (merges, multi-slice series, cherry-picks) will now see those paths gated and stamped. Previously they passed silently — that was the bug.
- Consumers reading
changed_code_pathsor the body-gate lists from closeout payloads should expect{count, sample}objects instead of bare lists.