Skip to content

ui-server: share pending admission across fresh-owner alias binding #3215

Closed

Description

@schlessera

Context

Found during independent review of #3214 for #3204. This is a pre-existing alias-admission window, separate from idle bookkeeping retirement and #3185 drain ownership. The relevant routing/catalog/storage paths are unchanged from main e09ae24b9cdc6322586f75a13493212e7ac22cdb; reviewed candidate 71cb679fb3c9c0e552ee35b1895465c93a6555ac retains this limitation. No data loss or retained idle entry is established by this finding.

The journal groups admission by the owner object's current ID. Catalog binding mutates objects registered in activeDialogueEpochs, but an inactive conversation bind or adoptTurn's fresh owner lookup can hold another provisional object. Writes submitted before bind acknowledgement carry that provisional ID; the writer later resolves its durable alias to the canonical archive. Thus two pending per-ID budgets can temporarily admit to one archive, by up to one additional per-ID observation/byte budget for the two-ID case. The stable entries still retire correctly when their callbacks settle.

Current source, reverified at inspected main:

  • (DialogueJournal.bind, packages/ui-server/src/ws/dialogue.ts:76-98) reserves the supplied owner's session routing before acknowledgement, including a fresh catalog fallback.
  • (DialogueJournal.adoptTurn, packages/ui-server/src/ws/dialogue.ts:121-130) obtains a fresh owner; (DialogueJournal.backend, packages/ui-server/src/ws/dialogue.ts:140-175) routes session_info through bind and appends before its acknowledgement.
  • (dialogueOwnerForConversation, packages/ui-server/src/ws/session-catalog.ts:274-282) reads fresh owner objects; its (dialogueBind, packages/ui-server/src/ws/session-catalog.ts:305-320) branch mutates only registered active references.
  • (DialogueJournal.append, packages/ui-server/src/ws/dialogue.ts:218-242) groups current object IDs. The current queues keep stable owner-object entries but sum admission only for equal current IDs.
  • (dialogueOwner, packages/ui-server/src/ws/dialogue-storage.ts:37-58) resolves durable aliases; (bindDialogue, packages/ui-server/src/ws/dialogue-storage.ts:169-210) records the merge; (appendDialogue, packages/ui-server/src/ws/dialogue-storage.ts:220-241) resolves the alias for a later queued append.

Out of scope

No retained-text lifetime cap, threshold reduction, persistence/contract change, permission/consent widening, provider-input change, new store/framework, replay or journal-drain redesign. Do not expand #3204/#3214 to redesign alias lookup. No new approval/dependency gate on those deliveries.

Scope

Make pending count and serialized UTF-8 byte admission account for the same canonical archive across both fresh-object routes, including observations submitted before binding acknowledgement. Choose the smallest source-backed identity/accounting correction without changing durable semantics. Keep stable queue retirement, shared failure coverage and exact principal/generation/epoch/adoption fences.

Acceptance criteria

  • Both adoptTurn -> backend(session_info) -> bind and direct inactive-conversation bind cannot admit a separate pending budget for an alias and its canonical target.
  • Cover count and byte budgets with a real file-backed SQLite writer held during binding and queued observations; show the failing admission on the pre-fix source and the corrected refusal.
  • Include an existing target with outstanding writes, a newly bound provisional control and settled-callback controls. Assert exact admitted/persisted counts, serialized bytes, order, no effect replay and zero idle queue entries after settlement.
  • Keep the original thresholds, retained history, failure overlay and scope fences. Show causal mutation and restored passing native proof without unhandled shutdown rejection.

Verification

The review supplied the source-backed path finding; this filing does not claim a new runtime reproduction. Build the native held-writer regression for each route before implementing. Verify applicability on fetched current main and retain exact source/test identities. Duplicate searches for dialogue alias admission, dialogue pending budget and provisional paths found #3204/#3185 and historical durable-dialogue work, but no issue covering this fresh-owner window.

Contract impact

Expected internal transient accounting correction only; no CLI/MCP/wire/frontmatter or persisted semantics change is authorized. Record any actual contract impact before implementation. No release milestone is selected.

2026-11-02 triage at main a84d9bfbcb4e608b504aa0a9feb1144ad9a0b77e: Reverified canonical alias lookup, fresh-owner routes and current equal-ID pending aggregation; refreshed the moved dialogue anchors. The complete brief begins with its real held-writer regression and leaves routine identity/accounting implementation to the worker. Preserve existing voice epic #54 membership; no new runtime reproduction is claimed. Wanted but unscheduled (p2).

Activity

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-serverHono app factory: turn coordinator, auth, session catalog, routes, cron.
    on Oct 31, 2026
  2. added
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 2, 2026
  3. self-assigned this
    on Nov 2, 2026
  4. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claiming (token wi-3215-cdb3). Branch fix/3215-alias-pending-admission, based on epic/54-voice-phase-2 @ a62db8f under the per-epic integration process.

  5. added this to the 0.45.0 milestone on Nov 2, 2026
  6. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    2026-11-02: implementation in #3352, against the voice epic integration branch. This issue closes when that batch lands on main. Citation drift on that base: dialogueOwnerForConversation is now packages/ui-server/src/ws/session-catalog.ts:292-296 and dialogueBind :343-357. The dialogue.ts/dialogue-storage.ts anchors still hold. The neighbouring equal-ID drain and withhold grouping is out of scope here and is filed as #3351 (unreproduced lead). Milestone 0.45.0.

  7. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Delivered to the epic integration branch epic/54-voice-phase-2 as 445d62db5 via #3352, after ready-candidate proof passed against the exact epic base. This issue closes when the epic batch lands on main.

  8. removed their assignment
    on Nov 2, 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-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: p2Wanted, not scheduled. Pulled in when a milestone has room.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions