Skip to content

ui-server: retire chat identities with permanent replay and restore fences #3228

Closed

Description

@schlessera

Out of scope

Native file removal, public endpoint/UI, new auth authority, expiry and independent content/effect erasure.

Context

At source 6fa3ec1305e8b52991252d6a28959a68c56be1c1, bindDialogue, packages/ui-server/src/ws/dialogue-storage.ts:169-212, merges aliases and provisional owners; saveConversationTask, packages/ui-server/src/ws/conversation-storage.ts:35-71, retains independently consumed identities. restoreInboxSnapshot, packages/ui-server/src/inbox/snapshot.ts:350-433, restores an operational image but cannot know deletions after its recovery point.

Scope

Implement the internal serialized lifecycle/identity ledger and gate shared by subsequent removal owners. Cover native-only and provisional chats, exact authenticated ownership, aliases, generation retirement, permanent minimized replay facts and crash/restart/export/restore. This layer does not advertise completed content deletion.

Acceptance criteria

  • Atomically compare actual owner/backend/generation, refuse unknown ownership and busy effect holders, persist content-free intent and terminal generation before accepting cleanup; never infer authority from history read/title.
  • Admission and writer commits reject retired identities and racing adoption; earlier successful adoption expands the exact set, later adoption refuses. Auth is checked after awaits, including revocation during admission.
  • Minimized fences survive content cascades, process restart and post-deletion backup/restore; consumed task/native/request/revision identities cannot execute again. Unrelated chats/accounting remain intact.
  • Restore preserves surviving fences; demonstrate and disclose text restoration from a pre-deletion image without claiming a no-resurrection guarantee. No external deletion ledger.
  • Busy/unsupported/unauthorized refuse before retirement without existence leakage. Pending/partial/unknown cleanup is durable and idempotent, never a success acknowledgement.

Verification

Use actual file-backed SQLite/write workers and synthetic Odysseus fixtures, no provider/network. Failing-first cases block adoption/commit/auth awaits, retire, then release; assert no late writes or replay and preserved unrelated controls. Mutate post-await generation/auth checks and permanent fence retention separately; named assertions must fail, restore and record receipts. Exercise real snapshot children with exit-code checks and distinct pre/post-deletion images. Later transport/browser layers owe their own runtime proof.

Contract impact

Internal lifecycle does not by itself add HTTP/wire/API. Assess migrations/backup compatibility against current contract; any actual contract change gets same-commit contract docs and CONTRACT prefix, minor changeset for additive surfaces, breaking label/named changeset for a shipped retention break within the recorded ruling. Do not advertise deletion until all selected owners complete.

Policy and ownership

Follow-up to #3180 and its binding ruling. Read docs/decisions/chat-history-deletion.md and docs/plans/chat-history-deletion.md now delivered by #3232. Authenticated owners delete only their own chat with exact principal fences; agent/cross-principal deletion is forbidden. Ambient mode needs explicit owner mapping, otherwise refuse. Independent saved content/effects/provider copies/backups remain and are disclosed. Minimized non-content identity/replay fences are permanent; old-backup restoration is accepted. No outside-image ledger, secure-erasure promise, automatic expiry or routine live cutoff. Busy effects refuse with existing stop/reconcile paths. Priority p2 records wanted, unscheduled work under the approved policy; it does not commit a runtime release.

Dependencies

The policy prerequisite #3180 is completed by merged #3232.

Readiness reconciliation — 2026-11-01

Part of #3234. The approved policy is delivered by #3232; cited product-source files are unchanged between the source-audited 6fa3ec1305e8b52991252d6a28959a68c56be1c1 and actual delivery e0584b7f277f42a18b029e9c0bb6852993cfb946. The implementation/dependency scope has not changed. The implementation brief is complete and no needs label remains. Agent-ready is appropriate; existing open implementation dependencies remain authoritative. This triage does not start implementation, infer urgency or assign a release milestone.

Activity

  1. added
    type: feat
    area: ui-server
    blocked
    on Nov 1, 2026
  2. schlessera commented on Nov 1, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3180 is closed, so scripts/sync-project.ts is removing the blocked label.

  3. added
    priority: p2
    agent-ready
    and removed
    blocked
    on Nov 1, 2026
  4. schlessera commented on Nov 1, 2026

    @schlessera
    OwnerAuthor

    2026-11-01 readiness reconciliation: approved local-deletion policy delivered by #3232; native membership in epic #3234 verified. Priority p2 means wanted and unscheduled, with no runtime release commitment. The implementation brief is complete and no needs label remains. Agent-ready is appropriate; existing open implementation dependencies remain authoritative. Source applicability and the current specification are folded into the body; no implementation started.

  5. self-assigned this
    on Nov 2, 2026
  6. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation (token claim-3228-22683), branch feat/3228-retire-chat-identities.

    Collision report for the cited files (dialogue-storage.ts, conversation-storage.ts, inbox/snapshot.ts): closure-only overlaps with open PRs #3054, #3056, #3059, #3069, #3116, #3277, #3278, #3279; no direct path collision.

  7. added this to the 0.45.0 milestone on Nov 2, 2026
  8. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Delivered by #3284, squash 557b01bc1f7de67e8daaa34d0233c08f1c6a8400 on main (parent abd5fd6c8dd848e370a9c56442f491ceb8c7808d, tree 078a5d442d2e776900e39fe7855bb25f815176da, equal to the confirmed candidate checkout cbbbf94fd960e1330effe9caf28ca37116348b79). Candidate run 41451124471 passed every selected job, including unit, runtime, runtime_host, browser, layout, endurance, pack, captures and verify. Milestone 0.45.0.

    What exists now: migration 073_chat_lifecycle.sql and packages/ui-server/src/ws/chat-lifecycle.ts. retireChat re-reads owner authority in the serialized writer and resolves the exact identity set. Unauthorized, unknown, foreign, stale, unsupported and busy targets are refused before retirement, with no existence leak. A retirement persists permanent, content-free fences and pending per-store intent. Dialogue, conversation and session-keyed writers and readers then refuse the retired identities. Receipts for both adoption orders, revocation during admission, cascades and restart, and post- and pre-retirement backup restores are in the PR, along with eight recorded mutations.

    For the dependants:

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: p2type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions