Skip to content

ui-server: no test proves concurrent private reference requests stay in their own domains or progress independently #2858

Closed

Description

@schlessera

Part of #2390.

Context

#2390's definition of done requires: "Tests prove the two-operation default, same-domain single-flight behavior, independent parallel progress, cancellation/interrupted cleanup and crash recovery without private-activity disclosure." The final acceptance audit (#2751) found two parts of that criterion with no test that can fail.

  • Cross-domain private requests never join. join (packages/ui-server/src/brain/reference-source.ts:245-270) keys an operation by sourceKey(domain, repository, revision) (packages/ui-server/src/brain/reference-source.ts:79), so two principals requesting the same private repository at once should run two operations in two views. The only private-domain test, "private source needs a live covering grant and stays inside its principal's domain" (packages/ui-server/tests/reference-source.test.ts:90-104), issues the two requests one after the other, so the first operation has already finished before the second starts. On main 5f5178cf85a529fa6207a269b369afceb0b0af41, replacing the private join key sourceKey(domain, …) with sourceKey("private", …) at packages/ui-server/src/brain/reference-source.ts:486 (every private domain shares one in-flight operation) left all 61 tests in reference-source.test.ts and reference-tools.test.ts passing. Under that mutation, a second principal joins the first principal's in-flight private operation: the activity disclosure, and potential authority crossing, the criterion excludes.
  • Independent parallel progress. "at most two acquisitions run host-wide" (packages/ui-server/tests/reference-source.test.ts:208-224) proves two operations are active at once, but both wait on one shared gate. No test shows that one admitted operation finishes while the other is still stalled.

Scope

  • Tests in packages/ui-server/tests/reference-source.test.ts, using its existing pool and transport doubles:
    1. Two principals with grants covering the same private repository request it concurrently, while the first fetch is still in flight. Assert two fetches, two distinct views, each lease in its own principal's view, and that neither request settles from the other's operation.
    2. Two admitted acquisitions of different sources, with independent gates: releasing only the second lets it complete and publish while the first is still running. The first then completes too.
  • A mutation receipt for each test, recorded in the PR.

Out of scope

Acceptance criteria

  1. Test 1 fails when every private domain shares one join key (the mutation above), and passes on the unmodified tree.
  2. Test 2 fails when operation completion is serialized behind the oldest active operation, and passes on the unmodified tree.
  3. Both receipts are in the PR body.

Verification

bun run test packages/ui-server/tests/reference-source.test.ts, the two mutation receipts, and bun run check:pr --base origin/main. Keyless and offline.

Contract impact

None. Tests only.

Activity

  1. added this to the 0.44.0 milestone on Oct 24, 2026
  2. added
    type: test
    area: ui-server
    priority: p0
    agent-ready
    on Oct 24, 2026
  3. self-assigned this
    on Oct 24, 2026
  4. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim token bk2858-044-a98a). Branch: test/2858-private-domain-concurrency-044. Tests only, in packages/ui-server/tests/reference-source.test.ts, plus one sentence in the acquisition decision record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-serverpriority: p0type: test

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions