Review fix (ds-review-bot on #623): matching baselines with differing
seedLength still resolve different policies — overrideOf folds own switches
past the boundary, so a stored seedLength: 1 marks event 0 as subsumed seed
history while a live seedLength: 0 lets the same event tighten the session;
adoption retained the stored header and a restart silently restored the
wide baseline. When either side carries a baseline, the seed boundary is
part of the policy identity and a mismatch rejects as an id collision.
Red-first in the shared coordinator contract (both backends).
Review fixes (ds-review-bot on #623):
- Persistence adoption compares the immutable policy baselines: onCreated's
ownerless claim and adoptLivePrefix retain the STORED header, so a
same-id live session with a conflicting baseline now rejects as a
collision instead of appending under read-only and resuming under the
stored danger-full-access.
- resolve() resolves the session override BEFORE applying an explicit
approved mode: the one-shot grant no longer bypasses the unconditional
durable-header validation.
- The approval narrator attributes positionally over the session's OWN
events (past the seed boundary): a fork child whose baseline delta has
no own override narrates 'inherited from the delegating session' instead
of misattributing a stale seed-carried switch to the user or the
operator.
Red-first: baseline-conflict adoption in the shared coordinator contract
(both backends), resolve-with-explicit-mode validation, and the fork-child
narration attribution case.
CI per-file coverage flagged the new sandboxMode/approvalPolicy branches:
invalid-type cases in both session header validation tables, and a shared
persistence-contract case pinning that both backends round-trip the
baselines verbatim and keep absent fields ABSENT (presence is the signal
the policy owners branch on).
Review fix (ds-review-bot critical #2 on #623): the first-turn event stamp
had a durability hole no turn anchoring can close — an idle SessionStart-
style injection persists a complete one-shot turn before any prompt turn
opens, so a crash in that window left a resumable-looking child with no
inherited policy, falling back to a possibly wider deployment default.
The captured overrides now ride the child's creation meta into its
immutable SessionHeader (sandboxMode/approvalPolicy, neutral strings at the
session boundary — the delegationDepth precedent), durable from the moment
the session exists: no listener ordering can starve the baseline and no
crash window can lose it. overrideOf(session) on both policy services
resolves fold(events past header.seedLength) ?? header baseline, validating
against the closed vocabulary on read; stampOverride and the prompt-submit
listener machinery are deleted. The header field rides both persistence
backends (JSONL header line; SQLite sessions columns, SCHEMA_VERSION 11 —
pre-release, no migration). pty-local reads through overrideOf so PTY
spawns see the baseline too.
Red-first: header-durability-before-any-turn test (the injection crash
window shape), baseline/seed-boundary/closed-vocabulary contract tests in
both service suites; the real-wall suite (race, veto, fork stale-seed,
grandchild) re-anchored on header assertions and green. The Agent Note's
Alternatives now records the superseded event-stamping iteration with the
review evidence; bilingual docs updated.
Master removed the stdio demo (#702c8cc30) — accept the deletion; this
branch's packChunks passthrough survives in acp-demo (auto-merged), and
cli-demo/tui-demo arrived from master without one (the follow-up snapshot
PR decides which demos expose the switch). Generated catalogs regenerated
over merged sources; the hand-written session.md durability paragraph
re-weaves this branch's lossless-encoding wording with master's invariant-
companion sentence.