Repository navigation
Description
Context
Final review of #4270 at 11f56e98dc42129cadb8622cb7680d5e64e6830a deferred active-turn recovery after an out-of-band trust edit. When governance.md trusted_sources differs from SQLite, live reads throw stale_revision. At main a3395c4b2 the live projection is freshProjection, which throws when the verified disk rules differ from the durable projection (freshProjection, packages/ui-server/src/brain/trust-settings.ts:148-159); observePolicy also throws on a changed generation or anchored-verification refusal (observePolicy, packages/ui-server/src/brain/trust-settings.ts:124-146). The only automatic refresh is live.refresh at turn preparation (packages/ui-server/src/ws/session-run/backend-entry.ts:180); active turns only subscribe for invalidation (packages/ui-server/src/brain/turn-egress.ts:395). Turn startup, Settings and policy-proposal publication refresh the projection, but a hand edit or sync during an active turn can leave every admission read refusing, including model relays and unrelated destinations, until another refresh or turn start. This fails closed and recovers on the next turn.
Previously blocked by #3609 (closed as completed 2026-11-21); no open dependency remains.
Scope
Automatically reconcile a stable valid out-of-band policy generation during an active turn, keeping exact removal fences while restricting only affected uncertain operations.
Out of scope
New trust forms, broadening rules, owner-authority changes, rewriting historical decisions, root continuity, clearing taint, or adding policy text to provider history.
Acceptance criteria
- A real hand edit or sync of trusted_sources during an active turn fences admissions until a stable anchored observation and durable projection agree.
- The active host then recovers automatically without Settings reads, a new turn, restart or manual action.
- Removing a source rule still terminates its active source instance exactly; unrelated valid source instances and model relays recover without borrowing the removed rule.
- Invalid/unreadable policy retains last-valid rules plus an error, while changed verification never admits old rules.
- Lock waiting is abortable and bounded; unchanged per-chunk reads stay cheap and do not parse/read the full file.
- Two-reader/publication and real transfer tests cover the recovery and removal races with a restored failing mutation.
Verification
Use keyless offline real policy files, independent writers and sockets; assert exact receipts, no dispatch during uncertainty, automatic healthy-peer recovery, and unchanged provider history.
Contract impact
Recover existing fail-closed enforcement more narrowly; no new permission. Update the trust/refresh text in docs/integration-contract/package-api.md and a changeset for any observable refusal/recovery behavior. Maintainer final triage deferred this finding at p2 to 0.45.0.
2026-11-23 triage at main a3395c4: re-verified that active turns still never refresh (only turn preparation does) and refreshed the drifted trust-settings citation by anchor; #3609 is closed, so the blocker line is now historical. Scope, criteria and p2/0.45.0 unchanged.
Activity
schlessera commentedon Nov 21, 2026
Unblocked: #3609 is closed, so
scripts/sync-project.tsis removing theblockedlabel.