Repository navigation
Description
Context
Found while implementing #3230. The retirement ledger from #3228 resolves a chat's owner only from recorded host ownership: a dialogue owner (created by a live conversation or by adopting a host-only history) or a voice conversation epoch (resolveChat, packages/ui-server/src/ws/chat-lifecycle.ts:77-116). A chat that only ever had typed turns has neither, so POST /api/chat-deletions refuses it as unavailable. That is the approved conservative default ("native-only legacy ownership is never guessed"), but it means most typed chats cannot be deleted today.
Part of #3234.
Decision (maintainer, 2026-11-02, confirmed 2026-11-03): option 1
When an authenticated typed request creates a backend session, record a minimal, content-free owner row (principal, session). New typed chats become deletable by their owner. Legacy chats with no binding keep refusing as unavailable; ownership is never guessed for them. This creation-owner record is its own concept, with semantics distinct from the existing dialogue owner. It must not create, imply or change a dialogue owner, and it must not change dialogue paging or retention for undeleted chats. The deletion decision record documents the difference.
Rejected: option 2, keeping today's behaviour (only chats with voice or host-only history are deletable) and explaining the refusal in #3231's copy.
Scope
Write the owner row on the session-creation path for an authenticated typed request, make resolveChat accept it as positive ownership for deletion, and include it in retirement so deleting the chat removes or fences it like the other host ownership records.
Out of scope
Backfilling or inferring owners for legacy chats. Changing dialogue-owner creation, dialogue paging or retention. New deletion authority for agents, ambient callers without an owner mapping or foreign principals. UI copy (#3231).
Acceptance criteria
- A typed-only chat created after the change can be deleted by its owner through
POST /api/chat-deletions. - A typed-only chat created before the change still refuses as
unavailable. - A foreign principal still refuses without existence leakage, with the same body as an unknown chat.
- The row holds no content (no title, prompt text or excerpt). Writing it does not create a dialogue owner and leaves dialogue paging and retention for undeleted chats byte-identical. A test asserts the dialogue pages of an undeleted typed chat before and after the change.
docs/decisions/chat-history-deletion.mdrecords the creation-owner record, how it differs from the dialogue owner and why legacy chats are not backfilled.docs/plans/chat-history-deletion.mdis updated where it describes owner resolution.- A keyless, file-backed SQLite test proves the first three criteria. Keep a failing-first or restored mutation receipt: removing the creation-time write makes the new-chat deletion refuse, and resolving owners without the row makes the legacy case still refuse.
Verification
bun run test packages/ui-server/tests/chat-deletion.test.ts plus the session-creation and dialogue suites the change touches, typecheck and bun run check:pr --base <epic base>. Record the mutation receipts in the PR.
Contract impact
None on the wire. More chats become deletable, but the POST /api/chat-deletions request, receipt and refusal shapes are unchanged. A migration for the owner row is internal storage. If the change adds a capability flag or a client-visible field, classify it under the integration contract first.
Triage 2026-11-03: folded the maintainer ruling (option 1, content-free creation-owner row, distinct from dialogue owner, documented in the deletion decision record) into the body; replaced the open question.
Blocked by #3461
2026-11-03: PR #3456's ready-candidate runtime_host (run 41622134234) failed on the maintenance-busy automatic-index race filed as #3461. That race exists independently of this change. Under the strict-flake rule the proof is not rerun into green; this issue waits on #3461.
Activity
schlessera commentedon Nov 2, 2026
Decision (maintainer, 2026-11-02): option 1. When an authenticated typed request creates a backend session, record a minimal content-free (principal, session) owner binding. New typed chats then become deletable by their owner through
POST /api/chat-deletions. Legacy chats with no binding still refuse asunavailable, and foreign principals still refuse without revealing whether the chat exists. The binding must not change dialogue paging or retention for undeleted chats. Where it differs from the existing dialogue-owner semantics, document the difference in the deletion design.schlessera commentedon Nov 3, 2026
Claim
claim-3337-7a7d: picking this up on branchfeat/3337-typed-chat-owner-binding, based onepic/3234-chat-deletionatd38eb1eb5. The PR targets the epic branch.Label correction (2026-11-03):
needs: decisionwas re-added at 10:00Z, apparently from the stale 08:52 epic summary. The maintainer ruling already selects option 1, so I restoredagent-readyand removedneeds: decision. Milestone 0.45.0.Path collisions reported (detection, not locks): #3342, #3386, #3404, #3407, #3446 touch
bridge.ts,session-catalog*.tsordocs/plans/chat-history-deletion.md. #3342 also adds a075_migration on another epic branch.schlessera commentedon Nov 3, 2026
Decision (maintainer, 2026-11-03): option 1 is confirmed. When a typed request creates a session, record a minimal content-free owner row
(principal, session). Legacy chats keep refusing asunavailable, and dialogue paging and retention must not change. The record's semantics are distinct from the dialogue owner, and that difference must be documented in the deletion decision record (docs/decisions/chat-history-deletion.md).The body now carries this ruling in place of the open question. Its acceptance criteria add the dialogue-pages invariance test and the decision-record update, and the 2026-11-02 ruling's other criteria are unchanged. Labels already match:
needs: decisionwas removed earlier today, andagent-readystays. This is for the current claimant's information; nothing else changes.schlessera commentedon Nov 3, 2026
Implementation is in #3456, based on
epic/3234-chat-deletionatd38eb1eb5, head3cbdf5a3e, milestone 0.45.0. It is marked ready, and hosted candidate proof is requested.075), so its owner can delete it. Chats that existed before, and native-only sessions first seen on a resume, still refuse asunavailable. Foreign callers get the same answer as for a chat that does not exist.check:prpassed.The issue closes when the epic batch lands on main. The claim stays while the PR is live.
schlessera commentedon Nov 3, 2026
PR #3456's ready-candidate
runtime_hostfailure (run 41622134234) was diagnosed as a maintenance-admission race that exists independently of this change, not a regression. It is filed as #3461. This issue now carriesBlocked by #3461andblocked. Details are on the PR. The implementation stays on PR #3456 at head3cbdf5a3e.schlessera commentedon Nov 3, 2026
Blocker #3461 closed: its fix, #3467, merged to main as
1ea260971. Removingblocked. PR #3456 onepic/3234-chat-deletioncan be refreshed and proved.CONTRACT: feat(ui-server): bind typed chats to their creating owner s…
schlessera commentedon Nov 4, 2026
Epic #3234 batch 3 landed on
mainthrough #3551 as merge commitb9e3c112aa942fad81133848a32baef3e416ac6e(parents2fa67923dand15f40f32c, the squash of #3456). The ready-candidate proof is CI run 41782439539: all 17 selected jobs passed on checkout7695d2f1f, whose tree4167aceaais the landed tree.Delivered:
076_chat_session_owners.sql)unavailablepackages/ui-server/tests/chat-session-owner.test.tsdocs/plans/chat-history-deletion.mdStill open, so this issue stays open: one acceptance criterion requires
docs/decisions/chat-history-deletion.mdto record three things:The landed decision record has none of this; it is described only in the plan doc ("Built (#3337)"). Next action: a docs-only PR that adds this ruling to the decision record and cites the plan section. That PR closes this issue.
docs(decisions): record the typed-chat creation owner and why legacy …
schlessera commentedon Nov 4, 2026
Closed by #3555 (squash
facdca80don main, candidate run 41788256427).docs/decisions/chat-history-deletion.mdnow records three things: the content-free creation-owner record, how it differs from the dialogue owner, and why legacy chats are not backfilled. Milestone 0.45.0.