Skip to content

ui-server: a chat two owner logins used by voice can no longer be deleted by either login #4138

Closed

Description

@schlessera

Part of #3234. Refs #3963, #3962.

Context

Each owner sign-in creates its own principal. Retained account history allows two owner logins to continue one chat by voice, but deletion still aggregates exact principal IDs from dialogue ownership, voice epochs and typed-session ownership, then refuses multiple IDs (resolveChat, packages/ui-server/src/ws/chat-lifecycle.ts:78-119). The real-SQLite case sharing the history gives no authority over another login's conversation or epoch (packages/ui-server/tests/dialogue-account-ownership.test.ts:216-230) pins that refusal. On inspected main 49b6e7c48ca9f7f6c4bfff90790c28a536ba66e0, this remains a consequence of the existing policy, not a regression introduced by #3963.

The existing account-evidence helpers are principalAccount (packages/ui-server/src/middleware/account-partition.ts:95-98) and sameAccount (packages/ui-server/src/middleware/account-partition.ts:136-142). They distinguish current authorization from a historical record's durable account evidence.

Decision

Maintainer, 2026-11-17: option B, recorded ruling. Any currently authorized owner login may explicitly delete a chat when every deletion-relevant ownership record is verified as belonging to that same owner account. This narrowly amends exact-principal deletion admission. Shared history/read access alone is never authority.

Unknown, corrupt, contradictory or mixed-account evidence refuses only the affected chat. A pruned historical login is recognized only through valid durable evidence tied to that exact ownership record. A current principal row may establish a legacy record's account; an absent row without durable evidence may not. Revoked historical attribution is not a current credential. Agent, ambient and system records gain no account-wide exception, and live conversation/epoch controls remain exact-principal.

Exact-principal-only deletion was rejected because it strands shared chats. Creator-only deletion was rejected because a missing first login still strands them and requires another durable creator model.

Out of scope

Changing retained-history read policy (#3962/#3963), cross-account deletion, agent/ambient/system deletion authority, broadening live voice/epoch control, guessing/backfilling ownership from read access or the current caller, reassigning original attribution, changing retention/store extent, or weakening busy/generation/replay guards. Operation handles and read-only receipt lookup remain bound to their initiating principal; this ruling does not grant cross-login access to another operation's receipt or retry key.

Scope

Amend the deletion decision and implement the same-owner-account exception consistently at review/admission/commit boundaries. Inspect every ownership source resolveChat consumes, including dialogue_owners, conversation_epochs, chat_session_owners and provisional safety/history ownership. Use verified current rows or content-free durable account evidence bound to those records; include any minimal evidence persistence needed for future pruning. Any legacy backfill must use verified existing evidence, preserving unknowns and original principal IDs. Keep stored account evidence separate from the caller's live authorization.

Acceptance criteria

  • Append the dated ruling and rejected alternatives to docs/decisions/chat-history-deletion.md; update the approved-policy references and documented HTTP admission semantics in the same delivery.
  • Either of two current owner logins can independently admit deletion of a chat whose ownership records all prove the same owner account, including when another historical owner login has been pruned but its records retain valid durable evidence.
  • Revoked, expired, pruned, agent, system or unauthorized ambient callers are refused. A caller is checked from current authority at admission and across asynchronous/commit boundaries; stored evidence never authorizes a caller.
  • Every relevant ownership record must prove the same account. Missing evidence, mixed accounts, contradictory live/stored evidence, corrupt markers or a pruned legacy principal without durable evidence refuse before retirement. No record is reassigned or inferred from shared read access.
  • Existing exact-principal live-conversation/epoch controls, busy refusal, stable operation identity, stale generation/backend review, irreversible retirement/replay fences, per-store completion and principal-bound receipt lookup continue to hold. An unrelated chat remains usable after a local refusal.

Verification

Extend the real-SQLite account/deletion tests through actual deletion admission and commit, retaining the existing independent assertions for live-epoch isolation. Prove both allowed logins, durable evidence after pruning and all refusal cases above; exercise revocation and ownership changes between review/admission/commit, stale retries, replay/restore fences and per-store partial results. A mutation removing the account/evidence check must fail the named negative assertion; restore it and rerun the affected server tests and both keyless provider-history guards. The existing committed refusal test is baseline evidence, not proof of the new behavior.

Contract impact

Changes the documented chat-deletion admission policy with the maintainer ruling above. Update docs/http-api.md (explicit chat deletion), docs/integration-contract/http.md or its index reference, and any actual changed supported schema in the same CONTRACT: commit; supply the required minor changeset under the contract-versioning policy. Existing request/receipt shapes are retained unless an additional reviewed additive change is required. No wider authority or release schedule is implied.

2026-11-17 decision processing: selected B, specified the authority/legacy-evidence boundary and implementation criteria, and removed the unresolved A/B/C branch. No runtime change or deletion was performed.

Activity

  1. added
    type: fix
    area: ui-server
    priority: p2
    needs: decision
    type: feat
    and removed
    type: fix
    on Nov 17, 2026
  2. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-17): Option B: any currently authorized owner login may explicitly delete a chat when every deletion-relevant ownership record is verified as belonging to that same owner account. This is a narrow amendment to the exact-principal deletion rule; shared read access alone never grants deletion authority.

    Use the current principal row or valid durable account evidence bound to each historical record. Pruned historical logins may be recognized only from that verified durable evidence; missing, contradictory, corrupt or mixed-account evidence continues to refuse within the affected chat. A revoked, expired or pruned caller gains no authority from stored account evidence. Preserve original principal attribution, current authorization checks across asynchronous boundaries, exact live-conversation/epoch controls, busy refusal, permanent generation/replay fences and truthful per-store outcomes. Agent, ambient and system records do not gain an account-wide exception.

    Record the amendment in docs/decisions/chat-history-deletion.md and update the documented HTTP admission contract with the implementation. The body now contains the selected scope, legacy-evidence boundary and checkable acceptance criteria. Exact-principal-only deletion was rejected because it strands shared chats; creator-only deletion was rejected because a missing original login still strands them.

    Remove needs: decision and add agent-ready. No deletion is performed and no release commitment is added by this ruling.

  3. added
    agent-ready
    contract
    security
    and removed
    needs: decision
    on Nov 17, 2026
  4. added this to the 0.45.0 milestone on Nov 17, 2026
  5. self-assigned this
    on Nov 17, 2026
  6. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-b2581101. Branch: feat/4138-same-account-chat-deletion.

    path collisions on docs/http-api.md with #3622 and #4002; closure-only otherwise

  7. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Merged in #4168 as d2b0a814b through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

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-servercontractpriority: p2securitytype: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions