Skip to content

backends: remove owned native chat history under a retired lifecycle #3229

Closed

Description

@schlessera

Out of scope

Host projection deletion, browser UI, arbitrary path deletion, provider-side forgetting and independent saved/effect/backup erasure.

Context

At source 6fa3ec1305e8b52991252d6a28959a68c56be1c1, AgentBackend, packages/ui-sdk/src/server/backend.ts:708-751, has list/read and read-only roots, no removal capability. restoreArchivedSession, packages/ui-backend-claude/src/transcript-archive.ts:146-173, may restore native history; getPiHistory, packages/ui-backend-pi/src/history.ts:60-112, reads an active branch of a larger native tree. sessionReplay, packages/ui-sdk/src/server/session-replay.ts:19-73, and sessionPromptContext, packages/ui-sdk/src/server/session-prompt-context.ts:21-82, hold additional text outside native roots.

Scope

Add concrete backend-owned native cleanup for Claude and Pi plus their native-adjacent replay/prompt/display metadata. Specify supported/unsupported capability and per-store outcome semantics against the lifecycle ledger; do not make storage roots deletion authority.

Acceptance criteria

  • Remove the complete verified owned live/archive/staged/conflict/subagent/branch tree and metadata, including native-adjacent text. Reject unknown attribution, redirected/replaced/foreign roots and client paths without deleting unrelated files.
  • Drain actual native sessions/workers/readers and fence list/read/resume/archive/restore. A deadline rejection retains original cleanup ownership until genuine settlement and permits no replacement writer.
  • Unsupported capability refuses before retirement. Partial/unknown file outcomes remain retryable under the same operation and cannot report local completion; durable reconciliation survives interruption at each boundary.
  • No native/provider prefix rewrite or continued resume of the deleted identity; fresh chats keep ordinary append-only behavior. Implement the explicit ui: retain complete live dialogue when reopening a chat #3177 preservation exception only inside authorized deletion.

Verification

Run installed native backend runtimes against isolated synthetic Odysseus files, no live store/provider. Seed unique markers across every owned branch/archive/metadata and unrelated controls; prove readable before, absent across native list/read/resume after. Hold archive/restore/read callbacks through retirement, interrupt/restart cleanup, and test replaced/link/hard-link/foreign-root controls. Mutate ownership and final generation gates separately and record exact failing assertions/restoration. Run both existing provider-history guards when their paths change. Mock-only removal predicates are insufficient.

Contract impact

Negotiate an additive optional backend capability with explicit unsupported semantics only after checking actual implementations. Update API report and integration-contract package/wire references for actual public changes in a CONTRACT commit, with minor changeset; apply breaking label/named changeset if shipped retention compatibility changes. The ruling covers authorized local native removal only.

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

Blocked by #3228

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: featA new capability or a change in user-visible behaviour.
    area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.
    area: backendsAgentBackend implementations and the seam they share.
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 1, 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 1, 2026
  3. 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.

  4. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

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

  5. removed
    blockedWaiting on another issue or an upstream dependency. Say which in the body.
    on Nov 2, 2026
  6. self-assigned this
    on Nov 2, 2026
  7. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation (claim token wi-3229-1793633146). Branch feat/3229-remove-native-chat-history from epic/3234-chat-deletion at a62db8f27 (contains #3228). Collision report for the cited files: closure-only overlaps with open drafts (#3054, #3056, #3059, #3069, #3116, #3277, #3279, #3287, #3288, #3290, #3292–#3295, #3297); no direct path collisions.

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

    @schlessera
    OwnerAuthor

    Delivered to the epic integration branch epic/3234-chat-deletion as e2c22ad84 via #3298; ready-candidate proof passed against the exact epic base. This issue closes when the epic batch lands on main.

  10. 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: backendsAgentBackend implementations and the seam they share.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: featA new capability or a change in user-visible behaviour.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions