Skip to content

ui-server: gate repository trust consumers on healthy owner policy evidence #4403

Open

Description

@schlessera

Context

Part of #3598. Found during final independent review of #4273 at f650b157440494998a3d0357d2258ec4f8aae871, advancing #3613. Required consumer condition for #3615.

resolveReferenceOwners (packages/ui-server/src/brain/reference-owner-resolution.ts:51-94) records owner bindings with state: "available" (return at lines 91-92) while Settings retains last-valid rules after invalid, unreadable or symlink policy bytes. It also records policyError: "policy_unavailable". This follows #4270's deliberate last-valid policy interpretation. No trust consumer exists yet: the evidence is only persisted with reference reads (packages/ui-server/src/brain/reference-read.ts:122, packages/ui-server/src/brain/reference-read-writes.ts:37), and current reads remain trusted: false workspace input. A future consumer that checks only state could incorrectly exempt a read whose current policy could not be verified.

Blocked by #3615

The consumer this gate applies to is built by #3615, whose body already carries this condition and names this issue. If #3615's implementing PR satisfies every criterion below with the named mutation receipts, it completes this issue too; otherwise this lands directly after it.

Scope

Gate every future repository trust consumer on both qualified owner evidence and an explicitly healthy current policy. Preserve historical bindings and the last-valid Settings interpretation; an error must not become permission through an incomplete consumer check.

Out of scope

Changing the producer's last-valid Settings interpretation or the ReferenceOwnerResolution shape; rewriting historical bindings; the repository-rule admission itself (#3615); recipient, write or private-access authority.

Acceptance criteria

  • Repository source trust requires policyError === null as well as state === "available", valid bindings and all other ui-server: apply repository rules to verified immutable input and expose trustworthy review targets #3615 provenance/explicit-untrusted conditions. Missing or unrecognized error state is restrictive.
  • Invalid, unreadable and symlink policy cases with retained bindings stay untrusted at the actual consumer/admission boundary, while otherwise authorized reads remain usable as workspace input.
  • A subsequent verified valid policy can recover on a fresh read without changing a rule or restarting the host; historical evidence remains unchanged.
  • Enumerate the consumer call sites and prove each cannot infer permission from state alone. Add failing-first and restored mutation receipts: removing the error gate must admit an invalid-policy case and fail the named assertion.
  • Preserve independent private access, recipient/write permission, byte/deny controls and append-only provider history. Run the applicable keyless consumer and real runtime proof, plus contribution preflight.

Verification

Keyless offline ui-server tests at the consumer/admission boundary using real policy files (invalid, unreadable, symlink, then a fresh valid write), plus the real runtime proof #3615 names. Record the failing-first and gate-removal mutation receipts.

Contract impact

The producer's internal evidence shape need not change. Any public trust/admission semantic or schema change follows #3615's existing CONTRACT, API-report and release requirements.

2026-11-23 triage at main a3395c4: verified the producer anchor and that no consumer reads ownerResolution yet; declared the dependency on #3615 (which builds the consumer) and added out-of-scope and verification sections. Criteria unchanged.

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-server
    priority: p2
    security
    on Nov 21, 2026
  2. added this to the 0.45.0 milestone on Nov 21, 2026
  3. added
    blocked
    agent-ready
    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-sdkarea: ui-serverblockedpriority: p2securitytype: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions