Repository navigation
Description
Part of #4426. Found in the first independent review of PR #4490, which fixes #4486 and #4487.
Blocked by #4487
(The operationalStateLastFailure diagnostic is introduced by PR #4490; it does not exist on main.)
Context
Line numbers are at PR #4490's head c1f7103a1.
- Admission failures go unrecorded.
recordGovernedruns only at boot and at the worker-host check (packages/ui-server/src/app.ts:1003,:1207). An incomplete alias scan seen only during admission (assertReadable,packages/ui-server/src/brain/governed-turn.ts:120-122, called at:181,:192and:271) refuses the turn but is never retained. - Recurrences keep a stale time. The recorder wrapper (
recordGoverned,packages/ui-server/src/activity/runtime.ts:238-251) skips a failure whose detail matches the one it already holds (:240), and the held value is reloaded fromoperationalState.lastFailureat startup (:95-98). A later recurrence therefore keeps the first timestamp, even across a restart. - The field is documented in
docs/integration-contract/http.md(atc1f7103a1,:1223-1227) as retaining "the last incomplete check across recovery and restart".
Scope
Only the operationalStateLastFailure diagnostic. The availability verdict, the refusal and its code don't change.
Exclusions: the refusal error code reaching the client (#4497); scan correctness (#4494, #4499).
Acceptance criteria
- An incomplete scan seen at admission is recorded and appears in
GET /api/statusasruntime.operationalStateLastFailure. - A failure, then a recovery, then a later failure with the same detail shows the later timestamp, including when a restart falls between them.
- Repeated identical failures with no recovery between them do not issue a durable write per check.
- The diagnostic write never fails a turn or a boot (a test makes the settings write throw and the turn is still refused with its own cause, not the write error).
Verification
bun run test on the targeted files (for example packages/ui-server/tests/activity-runtime.test.ts and an admission test), with failing-first and mutation receipts in the PR.
Contract impact
No shape change. The behaviour now matches the documented meaning of the field; keep the http.md paragraph accurate if its wording names the call sites.
2026-11-23 triage at main 356fa7d: re-pointed citations at PR #4490's current head c1f7103a1, declared the dependency on #4487, added exclusions, the write-amplification and write-failure criteria, verification and contract impact.
Activity
schlessera commentedon Nov 23, 2026
Unblocked: #4487 is closed, so
scripts/sync-project.tsis removing theblockedlabel.