Skip to content

ui-server: the private-state alias check never completes on a stable tree above its bounds #4499

Open

Description

@schlessera

Part of #4426. Found in the second independent review of PR #4490, which fixes #4486 and #4487.

Blocked by #4487

(Same function as PR #4490's retry; the persistent-failure behaviour below is the one that PR's amended ruling settles.)

Context

Line numbers are at main 356fa7d (unchanged at PR #4490's head c1f7103a1, :52-54 and :81-83).

  • hasBrainAlias throws at 200,000 entries or at depth 256 on both walks (packages/ui-server/src/brain/operational-state.ts:52-54 in collect, :81-83 in walk). The bounds date from ui-sdk: run interactive and voice turns in a governed writable worker with read-only protected paths #1649.
  • The private-state collect walk always runs over each recursive private-state directory. The brain walk runs only when that collection found a candidate identity (a file with more than one link, or any mount under the brain; :48, :57, :78).
  • Journal capacity is byte-based (packages/ui-server/src/brain/journal-accounting.ts:125), not a count of objects, so a stable journal can grow past 200,000 entries within its cap. A brain past 200,000 entries hits the bound whenever a candidate identity exists.
  • Under the maintainer's amended ruling on ui-server: the boot alias check fails when the journal scrub quarantines an object mid-walk #4487 (2026-11-23), a check that cannot finish refuses boot, and at admission refuses the turn. A stable brain or journal above the bounds therefore fails every attempt and the host refuses boot every time; the bounded retry only helps with transient changes. That breaks the proportionate containment rule for an honest large host.
  • The check is synchronous and runs on every status() and admission (governedAvailability, packages/ui-server/src/brain/host-boundary.ts:222-229; :455; :587-607), so removing the bounds without changing how it runs would block the event loop on a large tree.

Scope

A verification strategy that finishes on large stable trees within a stated time budget, without giving up a bound against an adversarial tree. This is separate from #4494, which covers scan correctness under renames.

Exclusions: rename correctness (#4494); the diagnostic (#4495); changing which paths are checked (#4498).

Acceptance criteria

  • A stable generated tree above the current entry bound (more than 200,000 entries, in private state and in the brain) verifies, in bounded steps or with a streaming walk, without blocking the event loop beyond a budget the PR states and measures.
  • An over-bound tree with a real alias is still refused (private_state_in_brain).
  • A tree that cannot be verified within whatever limit remains still ends in private_state_unverified, never in a clean result.
  • The test fixture is generated rather than checked in, and the budget is measured once on a representative tree, with the numbers recorded in the PR.

Verification

bun run test on the targeted operational-state test file with failing-first and mutation receipts, plus the recorded timing measurement.

Contract impact

None expected. If the strategy changes a status detail string or adds a reason, update docs/integration-contract/http.md in the same CONTRACT: commit.

2026-11-23 triage at main 356fa7d: re-pointed citations at main, recorded when each walk runs and why a journal can exceed the bound, tied the consequence to the amended #4487 ruling, declared the dependency, added the never-clean criterion, exclusions, verification and contract impact.

Activity

  1. added
    area: ui-server
    priority: p2
    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: p2type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions