You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ui-server: receipt schema admission skips oldest-first reclamation and loses the capacity cause #4449
Part of #4426 (follow-ups from #4278). Deferred from the review of PR #4447, which introduced it.
Context
ensureCodeReceiptTables (packages/ui-server/src/brain/journal-accounting.ts:262-279) returns false for JournalCapacityError. captureCheckout (packages/ui-server/src/brain/turn-journal.ts:335) calls it outside retain() (:451-457), and throws JournalStorageUnavailable("checkout_receipt_schema_not_admitted"). A journal near its cap that has reclaimable ended turns therefore refuses the first checkout capture, and the turn records journal_unavailable instead of journal_capacity. It heals when another write triggers reclamation.
Scope
Schema admission in captureCheckout, and the accounting function's refusal signalling. Keep a pinned-WAL refusal unclassified, as SCHEMA_ADMISSION_REFUSAL_DOES_NOT_INVENT_A_CAPACITY_CAUSE requires.
Acceptance criteria
A capacity refusal of schema admission collects the oldest ended turn and retries, until the schema is admitted or nothing is left to reclaim.
When nothing is left to reclaim, the turn's cause is journal_capacity.
A non-capacity refusal still reads journal_unavailable.
A test with a cap below the schema allowance and one reclaimable turn admits the tables in the same capture, with a mutation receipt.
Activity