Repository navigation
Description
Actual resolution (2026-08-04) — ACCEPTED / CLOSED / FROZEN
This issue's plan was executed exactly as specified below, contract-first. Only the tracking status ("PLANNED / UNSTARTED") went stale while execution proceeded in PR #92; reconciled by PR #100.
execution:
a0_0_contract:
status: completed
commit: 71800fce8d6c0c7a7dc513950271dcd116149a63
ordering: preceded_implementation # the FIRST commit of PR #92,
# "Freezes the design before any
# implementation" — a single
# contract-only document
normative_source: docs/q-deck/a0-candidate-state.md
a0_implementation:
status: completed
corrective_rounds: 8 # forward-only; no amend/rebase/
# squash/force-push between heads
accepted_head: 52627c33f0c3b58e9ce68e0573fc67f0566d5c87
pr: 92
merge_commit: f1ac458731e23da2c48ca3ef84f44992727f76fe
residuals:
status: tracked_separately # "Post-A0 hardening before A2"
reopens_a0: falseThe original body below is preserved unchanged as the historical planned contract. It is not rewritten to pretend it always knew the future.
Status
PLANNED / UNSTARTED. This is the first post-R1 Alpha slice.
Frozen predecessor
- R1 accepted implementation head:
e2e046af10e13aa961aa54974912dd50787b196c - R1 merge commit / current
mainstarting point:eead3b775cf0d5d1ea567b6eb496a555637c1f95 e2e046a..eead3b7contains only the merge commit and no file delta.
A0 work must start in a fresh branch and fresh child worktree from exact merge commit eead3b775cf0d5d1ea567b6eb496a555637c1f95. Never reuse an R1 implementation or review worktree.
Goal
Prove minimal candidate-state continuity across one accepted Command:
sealed parent run A
+ exact canonical candidate state produced by A
+ accepted command B
-> fresh child worktree materialized from A's verified candidate state
-> child run B sees that state and may extend it
R1 proved provider-session continuity only. A0 must add candidate-state continuity without reopening a sealed run, trusting a mutable live worktree, or making the ledger an alternate canonical authority.
A0.0: freeze the contract before implementation
The first commit must define the representation and authority model. At minimum it must answer:
- What exact object is the candidate state: canonical patch, bundle/archive, tree object, or another deterministic representation?
- Which canonical event references it, and which digest covers its bytes and identity metadata?
- What base committed revision does it apply to?
- How is repository identity bound?
- How is cumulative ancestry represented for A -> B -> C without replaying unrelated mutable state?
- What is the fail-closed behavior for missing, tampered, conflicting, or non-applicable candidate state?
- What remains deliberately outside A0?
No implementation should precede this contract commit.
Required invariants
Canonical authority
- Candidate state must be digest-bound by the parent's canonical record.
- Ledger rows, worktree records, paths, branch names, and mutable repository state are projections/conveniences, never candidate-state authority.
- Exact parent
RunId, conversation, repository identity, base revision, and candidate-state digest must be bound together. - A sealed parent's candidate receipt is immutable.
Fresh materialization
- Every child gets a newly created, independently attested worktree.
- Never reopen or mutate the parent's worktree for the child.
- Materialize the committed base, then apply only the verified candidate state.
- The source repository and its checked-out branch remain untouched.
- Existing
o7-worktreeownership/attestation rules remain in force; a serialized record or path alone never authorizes use or deletion.
Command lineage
- The child canonical record must bind the exact parent candidate-state digest it consumed.
- A child may consume candidate state only from its exact accepted parent lineage.
- Same-conversation but wrong-parent, wrong-repo, stale-tail, copied receipt, altered base revision, or altered patch/archive must fail closed before provider invocation.
Determinism and safety
- Re-materializing the same verified parent candidate state must produce the same initial child tree.
- Candidate application failure must not invoke the provider.
- Crash/retry behavior must preserve R1's dispatch-boundary and at-most-once guarantees.
- Cleanup/recovery must never delete a worktree unless existing ownership and filesystem identity checks independently prove it is ours.
Minimal end-to-end acceptance case
- Start from a committed fixture repository.
- Parent run A changes an existing file and creates a new file.
- A seals with a canonical candidate-state receipt.
- Submit command B against A.
- B is executed in a fresh child worktree.
- Before provider execution, prove B's initial tree contains A's exact two changes.
- B adds a third change and seals.
- The original repository checkout remains byte-identical to its starting state.
- A's worktree and B's worktree have distinct paths and filesystem identities.
- Canonical replay proves which candidate digest B consumed.
Required negative/adversarial cases
- missing candidate receipt;
- receipt referenced by event but artifact missing;
- altered candidate bytes;
- copied candidate from another run;
- rewritten receipt metadata with wrong parent/run/conversation;
- wrong repository identity;
- wrong base revision;
- patch/archive that does not apply cleanly;
- path traversal, symlink, submodule, mode-bit, binary-file, rename, and deletion cases according to the frozen representation contract;
- mutable parent worktree changed after sealing;
- source repository changed after parent sealing;
- concurrent same-key retries;
- crash after child worktree creation but before durable dispatch boundary;
- crash after durable dispatch boundary.
Every invalid/non-applicable case must fail before provider invocation and must not mutate the source repository, parent record, or command binding beyond the documented recoverable state.
Explicit non-goals
- No command queue or multi-agent orchestration.
- No merge/commit/push of candidate state into the user's branch.
- No automatic conflict resolution.
- No distributed or multi-host lease protocol.
- No UI beyond the minimum needed to expose truthful state.
- No force-redrive or operator resolution for R1 ambiguous outcomes.
- No general workflow DSL.
Work protocol
- Agent fix(judge): unblock non-root/CI runs + sts-stub regression fixture & tests #2 owns implementation.
- Agent noop #1 performs independent exact-head re-gates only.
- Forward-only additive commits; no amend/rebase/squash/force-push.
- Draft PR, left unmerged until exact-head
ACCEPTED / CLOSED / FROZEN. - Preserve R1 regressions and exact-head CI discipline.
Stop condition
A0 stops after one accepted Command demonstrably consumes and extends its exact parent's verified candidate state in a fresh worktree. Broader local-alpha UX and multi-command productization are subsequent slices, not reasons to inflate A0.
Activity
PhysShell commentedon Aug 2, 2026
A0.0 contract inputs from A1 drafting (#95) and the OTP-lens review
Design input only — nothing here expands A0 scope. All three items are answers-in-progress to questions A0.0 already owns (§A0.0 items 1, 2, 6), surfaced while drafting the A1 contracts (#95).
1. Candidate sealing boundary (normative here, consumed by A1)
The sealing boundary is part of the definition of canonical candidate state, so it must be normative in A0.0 — not in A1, which would otherwise define when the very capability it claims to consume becomes valid.
Quiescence is defined by revoked write authority, not by process death:
The epoch formulation is deliberate: the invariant holds because old authority is no longer valid under the advanced epoch — not because an implementation enumerated every capability ever issued and hunted down live holders. Process termination and descendant absence are proof mechanisms or additional guards, never the definition: a detached descendant can keep writing after every known process has exited, and a live process can be provably incapable of writing. PIDs and process trees are observations, not authority — the same rule already applied to serialized worktree paths.
A1 (#95 §3) consumes this as a capability:
2. Result identity vs transport representation
Whatever physical form A0.0 chooses (patch, archive, bundle, tree object), it is transport. Two distinct identities must exist and must never share a field:
The mandatory bindings are enumerated deliberately — #91 already requires exact parent RunId, conversation, repository identity, base revision, and candidate digest to be bound together, and they must be listed, not hidden behind a word like "binding". (If A0.0 chooses a different exact name for the conversation binding, use that name.)
accepted_command_idis deliberately absent: the parent's candidate exists before any child command does; command-to-receipt binding belongs to the consumption protocol.Materialization verifies both levels, fail-closed at every step:
A transport that applies cleanly but does not reproduce the recorded tree digest is an integrity failure, not a near-miss. This makes the patch-vs-archive-vs-bundle decision a transport question rather than a truth question, and closes the tool-version / rename-heuristic / line-ending class from the adversarial matrix by construction: identity proves the value, not the instruction.
3. A0-local identity distinction (deliberately narrow)
A0.0 defines only the identities its own protocol needs:
Principle:
The full logical-lineage taxonomy (root_goal / task / campaign / round vs run / attempt / provider invocation) is deliberately not frozen here — it belongs to A1 (#95) and the A2 reducer freeze. A0 must only avoid conflating state identity with materialization attempt.
Generated by Claude Code