Skip to content

ui-server: host-side brain reads for a running turn ignore a later isolation refusal #4496

Open

Description

@schlessera

Part of #4426. Found in the second independent review of PR #4490, which fixes #4486 and #4487. Line numbers refer to that PR's head 84af09212.

Context

The hosted brain_read_base MCP bridge checks the principal's authority and then reads live Markdown directly (readBrainBase, packages/ui-server/src/ws/bridge-capabilities/application.ts:47-50). The autonomous bridge does the same. A turn admitted while the private-state alias check passed keeps getting fresh note content after a later check fails or finds an exposure. main behaves the same way. The rulings on #4487 gate admission, not turns that are already running.

Scope

Ruled (maintainer, 2026-11-23): option 1. Each host-side live brain read for a running turn checks the latest completed isolation verdict, with no new scan per read. This covers the hosted brain_read_base bridge and the autonomous bridge. A confirmed exposure (private_state_in_brain, database_in_brain) refuses the read immediately. private_state_unverified refuses the read with its named cause. The next verified check restores reads without a restart.

Out of scope

Acceptance criteria

  • A shared verdict holder records the latest completed status or admission check, and both bridges read it before every live read.
  • A failing-first test flips the verdict mid-turn, for both the hosted and the autonomous bridge: the next live read is refused with the named cause for each of the three reasons, and a later verified check restores reads.
  • No alias scan runs on the read path (asserted by a test that counts scans).
  • The PR answers the proportionate-containment checklist.

Decision record

Ruled 2026-11-23: option 1, as recommended.

Question: when a later alias check stops verifying (private_state_unverified) or finds an exposure (private_state_in_brain, database_in_brain) while a turn is running, does that turn lose host-side live brain reads?

Pointers at main 356fa7d76: readBrainBase: in packages/ui-server/src/ws/bridge-capabilities/application.ts:47-50 and bridge.readBrainBase in packages/ui-server/src/inbox/autonomous-turn.ts:348-352. Both check principal authority only. The verdict comes from operationalStateRefusal (packages/ui-server/src/brain/operational-state.ts:141); private_state_unverified and its admission check arrive with PR #4490 (#4487).

Options:

  1. Gate each host-side live read on the latest completed verdict. No new scan per read: the read checks the result of the last status or admission check. Consequence: a running turn stops getting fresh note content once any later check fails, so an unknown never stays clean for that turn. Needs a shared, current verdict that the PR deliberately does not cache today, and a turn can fail mid-run.
  2. Re-run the alias check on each live read. Consequence: the most current answer, but it adds a full alias scan to every bridge read on the turn's path, against the host-overhead work (Epic: a hosted turn's host overhead is measured span by span and cut to what its guarantees need #4278).
  3. Don't revoke running turns. Record in docs/decisions/proportionate-containment.md (or the operational-state decision) that a verdict change applies from the next admission, with the turn's hard timeout as the bound. Consequence: no code change beyond a test that pins the behaviour, but a running turn keeps reading during an exposure.

Recommendation (not a ruling): option 1, with a confirmed exposure refusing immediately and private_state_unverified refusing the read with its named cause. It restricts the narrowest uncertain thing (the next read) and recovers on the next verified check, as the containment rule asks.

Completion evidence: a dated maintainer ruling on this issue; then fold it into the acceptance criteria and remove needs: decision.

Verification

A failing-first test in packages/ui-server/tests/ that flips the verdict mid-turn for both the hosted and the autonomous bridge, plus a mutation receipt; bun run check:pr --base origin/main; recorded independent review (core package).

Contract impact

A refused read may surface a new refusal reason to the bridge tool; if so, update docs/integration-contract.md and prefix CONTRACT:.

Blocked by #4487

2026-11-23 triage at main 356fa7d: citations hold on main (readBrainBase, autonomous bridge); the scope asks for a ruling, so the question and options are written out and needs: decision added; blocked on #4487, which introduces private_state_unverified; type: bug replaced by type: fix.

2026-11-23: recorded the maintainer ruling (option 1) in Scope and the acceptance criteria. needs: decision is removed.

Activity

  1. added
    area: ui-server
    priority: p2
    on Nov 23, 2026
  2. added
    type: fix
    blocked
    needs: decision
    and removed on Nov 23, 2026
  3. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-23): option 1. Gate each host-side live read on the latest completed verdict. An exposure refuses the read immediately, and unverified refuses it with its named cause. The body now carries the ruling.

  4. added
    agent-ready
    and removed
    needs: decision
    on Nov 23, 2026
  5. schlessera commented on Nov 23, 2026

    @schlessera
    OwnerAuthor

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

  6. 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