Skip to content

ui-react: trust settings loses the receipt check or trusts the browser clock after an interrupted save #4432

Open

Description

@schlessera

Out of scope

Changing trust enforcement, replaying an interrupted save, or reporting an unknown outcome as successful.

Context

Parent epic: #3597. Follow-up from the final triage of review round 3 of #4425 at 60e9d32f6. This is deferred follow-up work, with no release commitment.

At main a3395c4b2, a read with mutationAllowed !== true calls invalidatePrivate(false) (load, packages/ui-react/src/components/settings/trust-settings-section.tsx:77-111, call at line 91), which converts the pending edit into a draft and drops its operation, and so its receipt request ID, including after a save was dispatched (invalidatePrivate, packages/ui-react/src/components/settings/trust-settings-section.tsx:66-72, line 68). Restoring authority then cannot check that save. Browser time classifies a prepared receipt as expired: settle compares next.review.expiresAt < Date.now() (settle, packages/ui-react/src/components/settings/trust-settings-section.tsx:192-205, line 195) and commit does the same before dispatch (commit, packages/ui-react/src/components/settings/trust-settings-section.tsx:206-217, line 209), both leading to expiredReview's “Nothing was published” (expiredReview, packages/ui-react/src/components/settings/trust-settings-section.tsx:188-191). A prepared receipt only proves that publication had not happened when the host read it. The host enforces expiry with its own clock (commit, packages/ui-server/src/brain/trust-settings.ts:338; request_expired checks at lines 345 and 364, publication fence at line 377), so a browser clock ahead of the host can display “Nothing was published” while the dispatched request can still commit. The receipt read is readCurrent and read (readCurrent, packages/ui-server/src/brain/trust-settings.ts:199-212); it returns the stored expiresAt but no host-side expiry verdict.

Scope

Retain a safe path to check the receipt after readable authority loss. Require host evidence before declaring that a dispatched save did not publish. Consider an additive receipt field if the existing contract cannot express that evidence.

Acceptance criteria

  • A readable downgrade during committing, uncertain, or receipt-lost later offers “Check save receipt” when owner authority returns.
  • A browser clock ahead of the host leaves a dispatched save uncertain until host evidence establishes its outcome.
  • No interrupted save is replayed or reported successful without a proved receipt.
  • T13 and T07 browser cases cover these transitions with failing-first and mutation receipts.

Verification

Run real browser transition tests and any affected server receipt tests. Record the named failures before the fix and with the relevant guard mutated.

Contract impact

Potential additive receipt field; if needed, use a CONTRACT: commit, update the integration contract, and add a minor changeset. No breaking change is authorized.

2026-11-23 triage at main a3395c4: repaired the drifted line citations by named anchor (the originals pointed at the #4425 review head) and recorded the host-clock expiry checks. Replaced non-manifest type: bug with type: fix; changed priority: p3 to priority: p2, because this restores promised behaviour (honest publication proof, #3597's definition of done) and needs no further driving use case, matching sibling #4436. An additive receipt field is permitted without a ruling; a breaking one is not.

Activity

  1. added
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    area: ui-reactReact chat/files/voice components, stores, WebSocket transport.
    priority: p3Someday. Needs a driving use case before it starts.
    on Nov 21, 2026
  2. added
    type: fixSomething is broken and must behave the way it is documented.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    and removed
    priority: p3Someday. Needs a driving use case before it starts.
    on Nov 23, 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-reactReact chat/files/voice components, stores, WebSocket transport.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.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