Repository navigation
Open
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.Context and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.Hono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p3Someday. Needs a driving use case before it starts.Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.Something is broken and must behave the way it is documented.
Description
Part of #4426 (follow-ups from #4278). Found in the sixth review of PR #4362 (#4297).
Context
Startup quarantine replaces an unusable retained receipt with a durable cause, but it has three gaps. All three need a row damaged outside the product, because capture validates every field before the write (captureCodeChanges, packages/ui-server/src/brain/code-change-worker.ts:38-43).
- The predicate (
USABLE_CODE_RECEIPT,packages/ui-server/src/brain/turn-journal.ts:47-50) checks only the top-level types, so a receipt withpaths: [null]or an invalid tree id passes.- The history entry then throws in render (
CodeChanges,packages/ui-react/src/components/chat/code-changes.tsx:44, mounted without an error boundary atturn-journal.tsx:120). - An invalid
tree_afterbecomes the next capture's baseline.
- The history entry then throws in render (
- Quarantine visits ended turns only (
turn-journal.ts:161-162). The previous-endpoint lookup (:312-313),summary(:531), scope facts (:730) anddetails(:1196) read receipts without the guard, so malformed JSON on a turn owned by a live process throws from each. - All quarantine writes are one transaction with no capacity handling (
:166-171). If it hits the journal cap,readyrejects, nothing is quarantined, and the next open retries the same transaction.
Scope
The quarantine predicate, the unguarded readers and the quarantine write. No contract change. Out of scope: capture and restore.
Acceptance criteria
- A retained receipt with a non-object path element, an unknown change kind or an invalid tree id is quarantined with its cause at open.
- A malformed receipt on a turn that has not ended does not throw from
summary,detailsor the next turn's endpoint lookup. The checkout starts from its starting commit's tree, and the damage is recorded once the turn ends. - Quarantine commits per receipt. A capacity refusal leaves the remaining rows for the next open, and
readyresolves. -
CodeChangesrenders a receipt with an unusable path list as an incomplete entry instead of throwing. - Each test is shown failing with its guard removed.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.Context and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.Hono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p3Someday. Needs a driving use case before it starts.Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.Something is broken and must behave the way it is documented.
Activity
schlessera commentedon Nov 21, 2026
Added from the review of PR #4435. Since the boot fix X1, a capacity refusal defers quarantine and
readyresolves, so the damaged receipt stays on an ended turn and its readers still throw.Additional acceptance criteria:
summaryanddetailsfor that ended turn do not throw; the receipt reads as an incomplete entry.expirenever parses a raw receipt, socollectOnecan reclaim capacity from a turn whose receipt is damaged (expire,packages/ui-server/src/brain/turn-journal.ts:574-592;summary,:550;details,:1215).