Skip to content

ui-server: a refused checkout capture can lose its checkout-scoped cause #4450

Open

Description

@schlessera

Part of #4426 (follow-ups from #4278). Deferred from the review of PR #4447. Related to #4437, which covers the same single cause slot at startup.

Context

The captureCheckout failure path (packages/ui-server/src/brain/turn-journal.ts:365-375) records the cause in one of two ways:

  • With the receipt tables absent, it writes the single journal.cleanup.lastFailure setting (:369), so a second refused checkout overwrites the first.
  • With the tables present, it writes a turn_journal_code_failures row, and swallows a refusal of that write. On a store that has the tables but not the capacity guards, a pinned WAL refuses both guard admission and the row, and no checkout-scoped cause is stored.

Scope

Cause recording in the captureCheckout failure path only.

Acceptance criteria

  • Two refused checkouts in one server lifetime are both named after the journal reopens.
  • When the failure-row write is refused, an owner-visible cause naming the checkout is still stored.
  • Recording the cause never replaces the original capture error, and never fails the turn by itself.
  • Tests cover the tables-absent and tables-without-guards cases, each with a mutation receipt.

Activity

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    priority: p3Someday. Needs a driving use case before it starts.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext 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.priority: p3Someday. Needs a driving use case before it starts.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions