Repository navigation
Description
Out of scope
Admission thresholds, persisted schema/semantics, wire changes, global journal-drain redesign, alias lookup redesign, provider-history edits, weaker storage settlement budgets, releasing uncertain native writes, and unrelated archives. Preserve the selected membership rule from #3215 rather than inventing a new ownership policy.
Context
A real keyless file-backed SQLite-writer reproduction at main 1619741f291f525d17cde4970a5ada40644117c1 confirms both boundaries miss a fresh provisional reference that has already reserved the canonical archive's session. The original source-reading lead is now reproduced; no product fix is implemented by this triage.
- (
archivePending,packages/ui-server/src/ws/dialogue.ts:295-310) already combines equal IDs or reserved sessions transitively under ui-server: share pending admission across fresh-owner alias binding #3215/fix(ui-server): share pending admission across fresh-owner alias binding #3352. - (
private ownerWrites,packages/ui-server/src/ws/dialogue.ts:339-341) still filters pending references by current ID alone. (async settleOwner,packages/ui-server/src/ws/dialogue.ts:343-355) can therefore report a completed canonical drain while the alias has native writes outstanding. - (
private withholdOwner,packages/ui-server/src/ws/dialogue.ts:356-362) uses the same current-ID-only predicate. Expiring only the canonical drain deadline leaves the newer alias's callbacks publishable after their genuine writes commit. - Real consumers include the storage-failure handling at (
void this.dialogue.settleOwner,packages/ui-server/src/ws/host.ts:448-454) and (void this.host.dialogue.settleOwner,packages/ui-server/src/ws/conversation.ts:1170-1176). This reproduction exercises the journal/catalog boundary; it does not claim a live-provider or end-to-end user incident.
Binding behavior is recorded in docs/decisions/live-conversation.md: owner-scoped callbacks drain before close, genuine failure coverage survives adoption, and unrelated owners stay independent. docs/decisions/sqlite-write-worker.md preserves ordered native writes and ownership through genuine settlement.
Observed reproduction — 2026-11-08
Bun 1.4.4 (38afee6c8), independently installed frozen dependencies, unmodified production source. Six temporary cases ran through bun run test and its ordinary offline guard: 2 pass / 4 fail, 22 assertions, exit 1, 1.254 seconds test phase.
Each case creates a real file-backed UI database, openSqliteWriter with offloop === true, the production session catalog and DialogueJournal. The existing test-only holdUntilReleased procedure holds the real writer. There are two routes: inactive-conversation bind and adoptTurn followed by a real session-info frame.
| Boundary | Equal-ID control | Inactive bind | Adopt turn |
|---|---|---|---|
| Drain before releasing native writer | Remains pending | Resolves early | Resolves early |
| Published pages after only canonical drain expiry and later real settlement | Unrelated sparta only |
Alias ithaca, then sparta |
Two ithaca pages, then sparta |
At each premature drain, the target is troy, the pending reference is ithaca, both reserve session voyage, the native hold is live, and the database contains zero dialogue records. Both cases fail CANONICAL_DRAIN_MUST_WAIT_FOR_FRESH_ALIAS_NATIVE_WRITE (expected false, actual true).
For withholding, the existing storageDeadlineClock.captureLatest() expires only the canonical drain's production budget; the alias and unrelated-owner write deadlines stay unexpired. After releasing the native writer, both aliases publish, failing CANONICAL_WITHHOLD_SUPPRESSES_ALIAS_BUT_PRESERVES_UNRELATED_OWNER. Real records still commit under canonical troy; unrelated sparta publishes. This establishes missed logical withholding, not stopped writes or lost authoritative data. All six fixtures release/join their writer and remove only their owned database directory, including the four failing cases. Complete global timer descriptors are restored.
The linked reproduction comment contains the portable temporary fixture and command. Retain these failing controls as the implementation baseline; no repaired/restored run is claimed.
Scope
Make owner-specific draining, ordered explicit refusals, close and logical withholding cover the same canonical archive membership already enforced by admission, including fresh references whose provisional IDs have not changed. Keep native write/capacity ownership intact until actual settlement and preserve independence of unrelated archives.
Acceptance criteria
- Both inactive-bind and adopt-turn routes retain the native held-writer reproduction. A canonical drain remains pending while an alias write is genuinely outstanding; it settles after release/commit, or reports the existing bounded indeterminate outcome.
- An indeterminate canonical drain withholds every relevant alias callback, including callbacks whose own newer deadline has not expired. Their real writes remain owned and may later commit; they cannot re-enter the withheld live scope.
- Equal IDs, equal reserved sessions and transitive archive membership behave consistently with admission. Unrelated owners can drain and publish independently; no global drain replaces the owner-specific boundary.
- Close ordering and explicitly refused callbacks use the same membership, without deadlocking on the close operation itself or losing retained failure coverage after adoption.
- Native writer and queued ownership are joined on success/failure, with exact persisted canonical rows and no replay/duplicate effects. Existing admission limits, storage budgets and authority remain unchanged.
- Removing the membership correction makes the named drain/withhold assertions fail for these reasons; restoration passes. Cover every matching ID-only membership instance in the file before calling the class repaired.
Verification
Place the attached temporary fixture at tmp/triage-3351.test.ts in an isolated frozen checkout and run bun run test ./tmp/triage-3351.test.ts. For implementation, promote focused runtime regressions into the owning package and run:
bun run test packages/ui-server/tests/dialogue-owner-drain.test.ts packages/ui-server/tests/dialogue-queue-adoption.test.ts packages/ui-server/tests/dialogue-storage.test.ts
bun run typecheck
bun run lint
bun run check:pr --base origin/mainKeep the failing baseline and restored mutation receipts. No provider credentials, external network, paid call, browser or hosted deployment is needed to reproduce this journal boundary.
Contract impact
Internal correctness repair under existing owner-scoped guarantees; no supported schema, wire, CLI or frontmatter change is requested. Published ui-server behavior needs the normal patch changeset. Any newly discovered contract change requires separate classification before implementation.
Triage 2026-11-08: replaced the unconfirmed lead with a real six-cell native-writer receipt and an implementation-ready brief; remove needs: repro. Preserve the maintainer's existing p3 ranking. Standalone: this repairs the shared typed/voice journal ownership boundary, broader than own-chat deletion or one voice interaction; related epics remain references rather than a forced parent.
Activity
[-]ui-server: check whether dialogue drain and withhold miss a fresh-owner alias reference[/-][+]ui-server: canonical dialogue drain and withhold miss fresh-owner aliases[/+]schlessera commentedon Nov 8, 2026
Reproduction — 2026-11-08, main
1619741f291f525d17cde4970a5ada40644117c1.A real file-backed worker reproduces both claimed boundaries on both routes: 2 equal-ID controls pass; 4 fresh-alias assertions fail. The issue body records the exact expected/actual observations, runtime and limits. No production file was changed. Keep this fixture temporary during triage; promote its proof in the eventual fix.
From an isolated checkout with frozen dependencies, save the following as
tmp/triage-3351.test.tsand runbun run test ./tmp/triage-3351.test.ts. Expected on the inspected source: 2 pass, 4 fail at the two named assertions; all six cleanup markers print. This is an observed failing baseline, not a repaired passing suite.