Skip to content

ui-server: the alias-check diagnostic misses admission failures and keeps a stale time #4495

Open

Description

@schlessera

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. recordGoverned runs 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, :192 and :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 from operationalState.lastFailure at 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 (at c1f7103a1, :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/status as runtime.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

  1. added
    area: ui-server
    priority: p3
    on Nov 23, 2026
  2. added
    type: fix
    blocked
    agent-ready
    and removed on Nov 23, 2026
  3. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #4487 is closed, so scripts/sync-project.ts is removing the blocked label.

  4. removed
    blocked
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-serverpriority: p3type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions