Skip to content

ui-react: resnapshot safety history after capacity subscription loss #4267

Closed

Description

@schlessera

Part of #3596. Confirmed against main c5071f7 during the final combined epic review.

createSafetyClient (packages/ui-react/src/lib/safety-client.ts:51) retries gap, expiry and generation changes, but excludes capacity. When a subscription delta exceeds 100 records, the host drops it with capacity; selected-chat evidence is cleared and never reloaded until reselection or reconnect.

The existing contract (docs/integration-contract/wire.md:3295-3298, plus the bounded history section of docs/plans/reviewable-session-safety.md and docs/decisions/session-safety-reviews.md) requires a fresh snapshot for oversized deltas. This is restoration of existing behavior, with no wire change.

Acceptance criteria:

  • Capacity subscription loss starts a fresh read for the selected target with a new request ID and no cursor.
  • Recovery assembles all snapshot pages and subscribes at the final high-water; stale pages cannot settle the new read and partial evidence cannot restore normal policy.
  • Consecutive capacity refusals permit at most one automatic recovery until valid advancing subscription progress or explicit refresh, reselection or reconnect; snapshot completion and duplicate updates do not rearm the bound.
  • A failing-first client test and restored mutation demonstrate the recovery, retaining existing gap/expiry/generation recovery and terminal refusal behavior.

2026-11-20: independent PR review identified repeated subscribe-capacity refusal as the same recovery defect class; bounded recovery is included in scope.

Activity

  1. added
    type: fix
    area: ui-react
    priority: p2
    agent-ready
    on Nov 20, 2026
  2. schlessera commented on Nov 20, 2026

    @schlessera
    OwnerAuthor

    Claim: safety-review-20261120, branch fix/safety-review-findings-20261120. Dedicated checkout starts at main c5071f7. Failing-first client test confirms SUBSCRIPTION_LOSS_REQUESTS_FRESH_SNAPSHOT receives undefined for capacity (8 pass, 1 fail). Collision inspection reports shared proof closures with concurrent PRs; no ownership takeover is intended. Will repair this with the sibling indicator defect in one small UI fix PR.

  3. self-assigned this
    on Nov 20, 2026
  4. added this to the 0.45.0 milestone on Nov 20, 2026
  5. schlessera commented on Nov 20, 2026

    @schlessera
    OwnerAuthor

    Implemented fresh paginated snapshot recovery for capacity subscription loss, with a new request ID and final subscription watermark. Capacity during an actual page read remains terminal to avoid a retry loop. Failing-first: 8 pass/1 fail at SUBSCRIPTION_LOSS_REQUESTS_FRESH_SNAPSHOT. Removing the fix again gives 11 pass/1 fail at that same assertion; restored focused client run passes all 12. Existing gap/expiry/generation recovery and read-refusal checks are retained. PR and complete qualification follow.

  6. schlessera commented on Nov 20, 2026

    @schlessera
    OwnerAuthor

    Delivered by PR #4269, squash 63bb400b31403ee319926d38e223711a9bf0e7e1 on main, milestone 0.45.0. Failing-first and restored mutation receipts, 28 focused safety tests, 11 pinned browser tests, build, strict typecheck and current-candidate preflight passed. Independent review returned no findings; the clean base merge preserved that review. Candidate run https://github.com/schlessera/brain-kit/actions/runs/44764503535 and automatic-main run https://github.com/schlessera/brain-kit/actions/runs/44767813281 passed. Main qualification audited all nine selected categories and all 17 successful job checkouts at the exact squash, whose parent/tree match the tested candidate. Main attempt 1 had a registry reset before endurance tests; one documented infrastructure retry passed. Operational incident #4272 separately awaits a subsequent inclusive plan for its controller marker; no implementation remains here. Epic #3596 is intentionally open for follow-up review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-reactpriority: p2type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions