Repository navigation
Description
Outcome
A fail-closed guard contains a failure to what that failure actually puts at risk. It recovers by itself whenever recovery needs no judgment, and it runs restricted or degraded instead of refusing whenever the threat model allows. A single turn, file, record or cleanup failure never makes the whole host unusable, or unbootable, until a restart or a manual repair.
Why
A hosted instance refused every turn in every chat after one turn's safety-recording write failed. The guard had latched the whole brain, and the only recovery was a hand-run script that needed no judgment (#3810, #3812). An audit of the other guards found the same pattern in several places, listed in the tasks below.
Principle (maintainer ruling, 2026-11-09)
- Narrowest scope. Restrict the turn, chat, record or allowance whose state is uncertain, not the brain or the process.
- Restrict before refusing. Where a restricted policy (tainted mode, read-only, degraded health) satisfies the threat model, use it. Refuse only when the restriction itself cannot be enforced.
- Recover automatically when no judgment is needed. Keep conservative charges and permanent gap facts, but keep reconciling until the uncertainty resolves. Never stop at a fixed retry count and wait for a restart.
- Boot. A recoverable historical record (a corrupt object, a bad intent, an interrupted cleanup) is quarantined and marked, and the host boots. It boots restricted if it must, and never refuses to serve.
- Diagnosable. Every latch, give-up or quarantine records its cause durably, logs one structured line, and is visible to the owner.
The principle never weakens a security property. An unknown never becomes clean, and an uncertain charge is never released early.
Decision record
docs/decisions/proportionate-containment.md (#3814) states the rule, what it does not change, the checklist every guard PR answers, and the two boot gates #3817 traced and retained.
Tasks
The native sub-issue list is the progress.
- ui-server: contain a safety-recording failure to what it puts at risk and recover automatically #3812: contain safety-recording failures and recover automatically (p0)
- ui-server: a latched safety recorder keeps no cause, mislabels errors as capacity, and has no recovery path #3810: keep the cause of a safety latch, label it honestly, add owner recovery (p1)
- docs: record the proportionate-containment rule for fail-closed guards #3814: a decision record for the principle, plus agent guidance
- backends, ui-server: keep reconciling uncertain worker, checkpoint and compute charges instead of giving up until restart #3815: runtime give-ups that keep capacity or budget charged until restart (p1)
- ui-server, ui-sdk: a single failed release, index write or corrupt record must not take the host down #3816: rare single failures that take the host down (p1)
- ui-server: boot degraded instead of refusing over a secondary backend, a warning setting or a recoverable gate #3817: boot-time checks that refuse instead of degrading (p2)
- backends: retain a retry owner for Pi post-launch refusal cleanup #3821: a retry owner for Pi post-launch refusal cleanup (found during backends, ui-server: keep reconciling uncertain worker, checkpoint and compute charges instead of giving up until restart #3815)
- ui-server: keep retrying a managed worktree's failed checkpoint release after its turn ends #3825: keep retrying a managed worktree's failed checkpoint release after its turn ends (found during backends, ui-server: keep reconciling uncertain worker, checkpoint and compute charges instead of giving up until restart #3815)
- ui-sdk, ui-server: classify unrecoverable staging refusals as recovery, and show unresolved journal records to the owner #3826: classify unrecoverable staging refusals as recovery and show unresolved journal records (found during ui-server, ui-sdk: a single failed release, index write or corrupt record must not take the host down #3816)
- backend-claude: a launch whose own cleanup is unconfirmed keeps its reservation with no retry owner #3489: a retry owner for a Claude launch whose own cleanup is unconfirmed (the Claude counterpart of backends: retain a retry owner for Pi post-launch refusal cleanup #3821)
Out of scope
- Authentication guards. The public unauthenticated boot refusal and the login throttling were judged proportionate.
- Changes to budgets, limits or taint semantics.
- The two boot refusals the decision record retains after tracing in ui-server: boot degraded instead of refusing over a secondary backend, a warning setting or a recoverable gate #3817: a failed protected-file quarantine and an interrupted operational restore.
Definition of done
- Every sub-issue is closed.
- No guard in the tasks above stops reconciling at a fixed retry count, refuses every chat for one chat's failure, or refuses boot over a recoverable historical record, except the two retained boot gates.
- Each changed guard's PR answers the decision record's checklist, and has a test showing a failure in one scope leaves another scope usable.
- Each latch, give-up, quarantine or restricted boot records its cause durably and is visible to the owner (principle 5).
- The decision record and agent guidance match what shipped.
2026-11-10 triage: added the decision record pointer, the later children, the retained boot gates as an exclusion, and a definition of done.
Activity
schlessera commentedon Nov 10, 2026
2026-11-10 triage at main
3aadc8df5, and epic state.Labels.
type: epicis not a manifest label. Replaced it with the meta labelepic, so project sync keeps this out of Ready, and withtype: fix: every coding child restores promised behaviour. Addedarea: ui-sdk,area: backendsandarea: ui-react, which #3815, #3816, #3821 and #3810 touch. Keptpriority: p0as set at filing. It matches the manifest's urgency: one failed write left a hosted instance refusing every turn in every chat (#3812, also p0).Body. Added a pointer to the decision record, the children filed since (#3821, #3825, #3826), the two boot gates the record retains (as an exclusion), and a definition of done.
Breakdown. Attached #3489. It gives a reservation with no retry owner a recovery path, which is principle 3. It is the Claude counterpart of #3821. Its 2026-11-08 ruling chose five retries and a terminal "charged until restart". #3815 has since removed that give-up from the shared reconciler, so #3489's policy text needs reconciling before it is picked up.
schlessera commentedon Nov 11, 2026
Every task under this epic has merged, all on 0.45.0:
Two follow-ups stay open outside this epic: #3962 (a chat whose first login was pruned, needs a decision) and #3963 (continuing a chat by voice from another device).