feat(native): verify sealed plan provenance and regenerate once on mismatch #1309
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/agentic-os!1309
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/claude/vt77"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #1215. Advances #903.
What this does
Agent Compose seals each policy source's identity, revision, and policy SHA-256 into the repository plan. AOS decoded those fields and made no decision from them, so a plan compiled from policy that had since moved was indistinguishable at launch from one compiled a minute ago.
Native startup now fetches each policy source, verifies the seal, and stops before any worktree exists when one regeneration cannot fix a mismatch.
Decisions worth reviewing
The digest triggers, the revision only reports. This follows the director note on #903 rather than that issue's literal wording. A repository that holds policy also takes ordinary commits, and gating on revision drift would regenerate an already-correct plan at every launch. Revision drift is still reported.
Two commits are checked because two are read. The sealed digest is of the working-tree file, and session worktrees are cut from
origin/main, so that is where a session's own policy comes from. Verifying the worktree base is how "session policy cannot be newer than repository selection" is enforced here, rather than by basing policy-source worktrees on the sealed revision. Basing them on the seal would start every session in a policy-holding repository several commits behind main, and grow without bound, for no benefit once the digest gate passes.The retry budget is exactly one. Regeneration that is unavailable, fails, or still leaves provenance mismatched stops the launch rather than retrying.
Regeneration names the home that owns the plan. It derives
HOMEfrom the plan file it just read, so a session shadow cannot compose into its ownHOMEand leave the canonical plan stale.The fetch is best-effort. A host off the network still launches; the digest comparison stays the gate. Fail-closed applies to verification, not to network reachability.
Tests
plan_provenance_test.gocovers the three failure modes #1215 names, plus the passing control: regeneration unavailable, regeneration failing, regeneration succeeding but still mismatched, a successful regeneration, a missing policy source, a stale policy checkout caught at the worktree base, revision drift reported and not gated, and the JSON deprecation boundary. The stopped-launch cases assert no session worktree was created.The existing native test helper now seals provenance that actually verifies, so every launch test exercises the gate rather than bypassing it.
Not done
docs/is at its 40-doc cap and everynative-*page is at its 120-line cap, so this could not take its own page. The provenance section went intodocs/native-session-start.md, which meant reflowing that page denser to buy the room. Flagged in the issue thread rather than left implied.🤖 Generated with Claude Code