Repository navigation
Closed
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p0Drop everything: a security hole, data loss, or a broken release.type: testCoverage, harness or proof work with no behaviour change.
Milestone
Description
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 bysourceKey(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 main5f5178cf85a529fa6207a269b369afceb0b0af41, replacing the private join keysourceKey(domain, …)withsourceKey("private", …)atpackages/ui-server/src/brain/reference-source.ts:486(every private domain shares one in-flight operation) left all 61 tests inreference-source.test.tsandreference-tools.test.tspassing. 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:- 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.
- 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
- Any behaviour change in
reference-source.ts. If a test exposes a real defect, file it separately under Epic: shared reference source and governed worktrees #2390. - Native or app-level proof; the service-level doubles are the right layer here.
Acceptance criteria
- Test 1 fails when every private domain shares one join key (the mutation above), and passes on the unmodified tree.
- Test 2 fails when operation completion is serialized behind the oldest active operation, and passes on the unmodified tree.
- 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.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.priority: p0Drop everything: a security hole, data loss, or a broken release.type: testCoverage, harness or proof work with no behaviour change.
Activity
schlessera commentedon Oct 24, 2026
Claimed (claim token
bk2858-044-a98a). Branch:test/2858-private-domain-concurrency-044. Tests only, inpackages/ui-server/tests/reference-source.test.ts, plus one sentence in the acquisition decision record.