Repository navigation
Description
Context
These checks refuse to boot the whole server over something that a degraded mode would cover. Some were deliberate choices, so they are lower priority. Items 1–2 were verified on main 4b8db90de. Items 3–4 were traced during implementation on 2026-11-10; their existing full-app boot refusals are necessary for the reasons below.
- Any unresolvable configured backend refuses boot (
packages/ui-server/src/app.ts:425-432,assertBackendResolvableatpackages/ui-server/src/agent/backend.ts:307,probeBackendRuntimesat:412). This was deliberate (ui-server: know which Claude Code binary ran, and refuse to boot without one #211), so that health never reads healthy while every turn fails. That is sound for the only or default backend. For a secondary backend it removes the backends that work. - An invalid token mint date refuses boot (
packages/ui-server/src/agent/subscription.ts:46-60, caught bycreateSubscriptionMonitoratpackages/ui-server/src/agent/subscription.ts:149-162). This was deliberate (backends: warn before the Claude subscription token expires, and show a rejected one as a re-login instruction #254): a silently ignored date would switch the expiry warning off. But it is a warning setting. - A failed protected-file quarantine move blocks boot (
packages/ui-server/src/brain/governed-manifest.ts:195,:225;packages/ui-server/src/brain/host-execution.ts:100). - An interrupted operational restore leaves a boot gate (
packages/ui-server/src/inbox/recovery-gate.ts:4,packages/ui-server/src/inbox/snapshot.ts:428,:463; checked atpackages/ui-server/src/app.ts:532). Restore is an operator action, so this matters least.
Out of scope
- Executing with a version-incompatible backend.
- Evaluating agent-created configuration while quarantine has failed.
- Dispatching inbox work from a partially restored state.
Scope
- Backends: refuse boot only when no usable backend remains, or the default backend is unusable. Otherwise mark the failed backend unavailable, report degraded health, and keep the others.
- Mint date: report "expiry unknown: invalid mint date" prominently in owner status and logs, and keep serving.
- Quarantine failure and interrupted restore: boot into a restricted mode with authenticated diagnostics and the recovery operation, keeping every execution or dispatch that the failure makes unsafe refused.
Acceptance criteria
- With a working default backend and an unresolvable secondary one, the server boots, health reports degraded with the reason, and turns on the default backend run. Test fails on the current tree.
- An invalid mint date boots, and owner status shows the warning as unknown, with the reason. Tested.
- After tracing items 3 and 4: each boots restricted, with the unsafe operation still refused, or is documented with a citation as needing the boot refusal.
- The decision records for ui-server: know which Claude Code binary ran, and refuse to boot without one #211 and backends: warn before the Claude subscription token expires, and show a rejected one as a re-login instruction #254, where present, are updated to state the narrowed rule.
Verification
Unit and integration tests in packages/ui-server/tests; bun run check:pr --base origin/main.
Contract impact
Possibly additive: a degraded-health state and a status field. Check docs/integration-contract/http.md for the /api/health shape and mark the commit CONTRACT: if it changes.
Historical gate trace (2026-11-10)
The acceptance criterion explicitly permits a documented boot refusal after tracing. Both historical cases require that branch for the current full app:
- Quarantine failure means an executable protected input remains in the brain.
reconcileExistingrefuses before installing its writer gate (packages/ui-server/src/brain/host-execution.ts:100-113); normal startup next prepares the boundary and evaluates the brain CLI. A strict turn profile or read-only UI does not prevent that earlier evaluation. The failed paths and errors remain in the manifest, and repairing the quarantine destination lets the next reconciliation retry the move. Serving diagnostics safely would require a separate path that never evaluates the brain, rather than removing this check. - Pending restore covers the complete operational database, not just inbox dispatch. Resume requires the same snapshot checksum/root and an unchanged logical database (
restoreInboxSnapshot,packages/ui-server/src/inbox/snapshot.ts:428-445). Normal authenticated serving writes to that database and would invalidate resume; historical dialogue authority is invalidated only in the final restore transaction (const recovered,packages/ui-server/src/inbox/snapshot.ts:463-480). The supported localbrain-ui-inbox restorecommand resumes the same snapshot without starting the app. The pending record does not retain the snapshot bytes, so startup cannot reconstruct them automatically.
The durable design record is docs/decisions/proportionate-containment.md, section “The two historical boot gates traced in #3817”. No unsafe execution, dispatch, or version-incompatible backend is permitted by the implementation. Citation locations above refer to the implementation candidate; original behavior remains described in Context.
Activity
schlessera commentedon Nov 10, 2026
Claiming #3817 under claim token
3817-degraded-20261110in the dedicated branchfix/ui-server-degraded-boot. Readiness and the cited boot checks verified. The collision scan reports shared downstream proof closures; the epic also has concurrent app.ts work in #3816, which will be preserved during rebase. Scope: secondary-backend containment, explicit unknown subscription expiry, and tracing the two historical recovery gates before narrowing them.schlessera commentedon Nov 10, 2026
Readiness trace completed: items 3 and 4 use the acceptance criterion’s documented-refusal option. Quarantine must finish before the normal boot path evaluates the brain CLI; pending restore requires an unchanged complete database and has not yet invalidated historical dialogue authority. The issue body now contains the source evidence and recovery path. Secondary-backend exclusion and explicit unknown expiry are implemented with failing-first and restored-mutation receipts.
fix(ui-server): keep an excluded backend's auth and search routes unl…
CONTRACT: fix(ui-server): contain secondary backend boot failures (#3822