Repository navigation
Description
Context
Found by the #3148 source audit (audit comment, row S10 and AC2), checked at public main e09ae24b9cdc6322586f75a13493212e7ac22cdb. This is a source finding, not a reproduced new failure.
Native case 18 ends four turns with await journal.finish(...) and never asserts the turn's final state: scripts/native-proof/reference-pool.native.ts:646 (turn-18-edit), :669 (turn-18-read), :686 (turn-18-swap) and :755 (turn-18-tools).
finish runs one last observe() inside try … finally (finish(turnId: string), packages/ui-server/src/brain/turn-journal.ts:514-530). Inside observe, a worktree capture that throws does five things: it drops that root, records fail(turnId), calls the holder's stop inside a try {} catch {}, and carries on without rethrowing (// Each managed worktree is observed through its own checkpoints, packages/ui-server/src/brain/turn-journal.ts:319-333). The finally then writes ended_at and keeps state='partial', and finish resolves normally. Only a failure of the brain capture makes finish reject.
This is the documented product rule: a failed worktree observation stops its holding turn and leaves it partial (managed worktrees: Journal and scope). A checkpoint refusal reaches that path whenever the whole-pool observation keeps changing: poolCheckpoint refuses with unavailable (checkpoint, packages/ui-sdk/src/server/native-reference-pool.ts:798-810).
Three consequences for the fixture:
- A partial final turn leaves case 18 green. The fixture's
stopcallbackerror => { throw error; }(scripts/native-proof/reference-pool.native.ts:620) cannot fail it, because the journal swallows that throw. expect(rows("turn-18-read"), "REFERENCE_WORKTREE_NATIVE_READS_NOT_JOURNALED").toEqual([])(:670) passes vacuously, because a failed capture records no rows.summary(turnId)(packages/ui-server/src/brain/turn-journal.ts:251-263) exposesstate: "partial". Its failure reason distinguishes onlyjournal_unavailablefromjournal_capacity, so it cannot attribute the refusal to the changing-observation class.
Existing unit coverage proves the partial rule for a mid-turn observe with a poolDelta fault ("a worktree capture that fails leaves its holding turn partial…", packages/ui-server/tests/reference-worktree-journal.test.ts:91-109). Nothing covers the final observation inside finish, or the pool's unavailable checkpoint refusal.
Retained evidence from #3129 diagnostic run 40913746561, quoted there: one exhausted observation was placed during final journal capture in an invocation that stayed green. That fits this gap, but the public record does not identify the turn. Historical writer and reclamation attribution remains INCONCLUSIVE; this issue does not change that. #3129 and #2819 are distinct.
Decisions (maintainer, 2026-11-02)
Fixture policy B: a truthful partial final worktree observation may be accepted only when attributable diagnostics prove the specifically permitted changing-observation refusal. Reject strict A as the only permitted policy; do not select fresh-identity replay A-prime. Unconditional acceptance of partial turns remains forbidden.
Diagnostic surface B: expose the precise structured cause through the supported journal summary/details API as well as internal diagnostics. Reject internal-only exposure: operators and clients should be able to explain the partial result too. Use additive optional data, retain existing states and generic failure classes, and preserve unknown/legacy behavior.
This authorizes bounded product diagnostic propagation and a narrowly qualified proof path. It does not change the product's stop/drop-root/partial/ended behavior, relabel partial as complete, permit unknown causes or authorize retries. Missing rows are never evidence that a failed observation saw no changes.
Scope
- Preserve an attributable changing-observation discriminator from the real reference-pool refusal through transport, capture and journal storage. Do not infer it from generic unavailable or matching human-readable messages.
- Expose it as an additive optional supported journal-summary diagnostic carried consistently by summary updates and details, with bounded logical identity/phase/time attribution. Keep credentials, content and physical host paths out of this metadata.
- Update case 18 after all four finish calls and before dependent assertions to require complete final capture or a narrowly qualified partial with an explicit truthful receipt. Repair the vacuous empty-row read oracle without removing separately claimed invariants.
- Record the policy/surface choices, qualification boundary and rejected alternatives in docs/decisions/managed-worktrees.md and relevant CI proof guidance, and update the authoritative contract and API report in the implementation.
Out of scope
- Changes to product stop/drop-root/partial behavior, accounting, charges, ownership, observation safety or offline guards beyond the scoped diagnostic metadata.
- Unconditional acceptance of a partial turn or reporting a qualified partial as complete final observation.
- Any retry, replay, settle loop, sleep, sync or deadline increase.
- Pool cases 1–17, the separately filed tool-release finding, the reviewed removal, and native-proof: case 17 compares aggregate charge across background reclamation #2819.
- Any new claim about historical writer ownership, reclamation or the original ui-sdk: case 18 worktree release assessment refuses changing whole-pool observation #3129 failure's cause.
Acceptance criteria
- Structured cause: the specific changing refusal survives the actual pool transport/capture/journal path with exact turn/worktree/final-observation attribution. Generic unavailable, capacity, unrelated storage errors and unknown/missing reasons cannot masquerade as changing. Preserve multiple-cause honesty: an allowed reason cannot hide another disqualifying failure.
- Public diagnostic: add optional typed data to the supported journal summary, with details carrying the same facts. Update runtime schemas, wire/history/HTTP projections as applicable, the API report and authoritative docs. Absent legacy, unavailable or expired detail is unknown, never evidence that the permitted cause occurred. Retain the cause with the journal across finish/restart under its existing lifetime; do not invent retrospective attribution.
- U1: in the existing directory-backed reference-pool-double harness, edit a covered worktree and inject a once-only structured poolCheckpoint changing refusal immediately before finish. Assert finish resolves, summary stays partial with journal_unavailable, ended_at is set, the root is dropped, facts show partial and no rows come from the failed capture. The new diagnostic identifies that exact cause and final observation. Removing fail() must fail REFERENCE_WORKTREE_FINAL_CAPTURE_PARTIAL, with a restored pass.
- F1: after each of turn-18-edit/read/swap/tools finishes, classify the final state before dependent row assertions. Accept complete, or partial only with the retained structured changing-refusal evidence for that exact final observation and an explicit qualified-partial receipt. Missing/unattributed/wrong-phase/wrong-turn/wrong-worktree/other-cause partials must fail the named policy assertion. The receipt never claims complete final observation.
- Non-vacuous proof: the read oracle must positively establish its claimed read-only behavior rather than pass because failed capture produced an empty row set. Retain positive evidence for all separately asserted edit/read/tool invariants. If the allowed partial leaves a claimed invariant unproved, it is not a passing witness for that invariant.
- Causal controls: deterministic tests accept the permitted structured cause and reject generic unavailable with identical prose, capacity/other faults, missing/legacy diagnostics, wrong attribution and mixed causes. Removing diagnostic propagation or broadening acceptance to any partial must fail the intended named assertion; restore and retain both receipts.
- Runtime safety: preserve all product stop/partial/ownership/accounting behavior and native/offline guards, existing case-18 assertions, and the no-retry/no-deadline-increase boundaries. Public diagnostic data changes no provider-facing conversation history.
- Record the selected policies and explicit limits in managed-worktree/CI proof guidance in this implementation. Update contract docs and an additive minor changeset. Retain historical attribution as INCONCLUSIVE; no diagnostic sample is a failure-rate estimate.
Verification
Prove the selected fixture policy and diagnostic propagation deterministically in a directory-backed harness, including public schema/projection/retained-after-restart controls and failing-first/restored mutations. Use the existing worktree-journal tests and focused diagnostic/proof harness tests; no live service is needed.
Any native invocation still requires separate, bounded, independently reviewed authorization. This decision review does not run or authorize one by default. Run focused preflight with bun run check:pr --base origin/main before a PR and preserve all selected proof requirements.
Contract impact
Additive supported journal-summary/details diagnostic and corresponding typed/runtime-schema/wire/HTTP documentation changes, with old fields and meanings preserved. Carry contract, use a CONTRACT-prefixed implementation commit, update the relevant authoritative integration-contract components and API report in that commit, and provide a minor changeset. Optional absence means unknown; do not retype an existing failure code/state or imply complete observation. The proof-policy ruling authorizes only the narrow B acceptance with explicit partial receipts; no release milestone is selected here.
Ownership and decision status
Part of #2963: this repairs a weak final-observation/read oracle. The product diagnostic is the bounded prerequisite for the chosen oracle, not a general observability redesign. #3129 and #2819 retain their separate scopes and historical attribution.
Both decisions are resolved. Remove needs: decision and add agent-ready because no other needs label remains. Implementation, public diagnostic delivery, decision-record updates and actual proof remain open.
2026-11-02 decision review: consolidated B fixture policy and B public diagnostics into a bounded implementation brief, replacing the original strict-only/test-only assumptions and requiring retained attribution, non-vacuous invariants and explicit qualified-partial receipts. No implementation, native invocation, proof completion, historical attribution or release commitment is claimed.
Activity
schlessera commentedon Nov 2, 2026
Decision (maintainer, 2026-11-02): Selected B: accept a truthful partial final worktree observation only when attributable diagnostics prove the specifically permitted changing-observation refusal. Do not accept unknown/generic partials, relabel partial as complete or use absent rows as proof that a failed observation saw no changes. Fresh-identity replay/retries are not selected.
This expands the original test-only issue to the product cause diagnostics B requires. Preserve the existing stop/drop-root/partial/ended behavior and all accounting, ownership and offline guards. Qualify the exact turn/worktree/final observation using a structured cause from the real refusal path, not generic unavailable or prose matching. Existing edit/read/tool assertions must remain non-vacuous, and the proof receipt must disclose any accepted partial.
The body now reflects B rather than strict-only criteria. One design choice remains: keep the precise cause in internal journal/proof diagnostics, or also expose it as an additive supported journal-summary/detail field. Retain needs: decision pending that choice; no native invocation or implementation is authorized by this tracker update.
[-]native-proof: case 18 never asserts that a turn's final worktree observation completed[/-][+]native-proof: qualify final-observation partials with public structured diagnostics[/+]schlessera commentedon Nov 2, 2026
Decision (maintainer, 2026-11-02): Selected B for diagnostic exposure: publish the precise structured cause through the supported journal summary/details API, not only internal proof diagnostics.
This completes the earlier B fixture ruling. Only a positively attributable changing-observation refusal may qualify for partial acceptance. Keep the result partial, reject unknown/unrelated/mixed disqualifying causes, and do not use missing rows as proof that a failed observation saw no changes. Retain cause/turn/worktree/final-observation provenance through the real refusal path and journal lifetime; legacy absence remains unknown.
Product stop/drop-root/partial behavior, ownership/accounting/offline controls and no-retry boundaries remain. The original test-only/no-production-change constraint is replaced only for this bounded public diagnostic prerequisite. Existing independently claimed read/edit/tool invariants still need positive evidence, and a qualified-partial receipt must not claim complete final capture.
The body now contains the selected policy, additive public surface, negative/mutation controls and required managed-worktree/CI decision-record updates. Carry contract, same-commit authoritative docs/API-report updates, a CONTRACT-prefixed implementation commit and an additive minor changeset. No native invocation or release commitment is granted by this tracker action.
Remove needs: decision and add agent-ready; no other needs label remains. The issue remains open for diagnostic and oracle implementation/proof under #2963.