Skip to content

Same-key supersession and the value-update pass can retire another user's memory under a namespace-wide token #723

Closed

Description

@zlareb1

Company or project name

Loom maintainers

Component

Memory write path (same-key supersession, value-update pass)

Describe what's wrong

Under a namespace-wide token, a write that names its user_id can still retire another user's memory through two paths that read the request's scope rather than the write's user:

  • Same-key supersession under newest_wins: server/memory/app/key_supersession.py, _live_same_key_rows reads request_scope(). A write of key seat for Bob can retire Alice's live seat row.
  • The value-update pass (detect_updates): server/memory/app/value_updates.py, the peer reads (_peers_many, _peers_joined, _peers_codes_first) use request_scope(). A bulk or set_from_messages write for Bob can mark Alice's dated row superseded.

#701 makes the write-time conflict verdict read and judge the write's user's rows only (_writer_scope in server/memory/app/conflicts.py); these two paths need the same scope.

Does it reproduce on the latest release or main?

Found by reading the code on main during review of #701; not yet reproduced against a running server.

How to reproduce

  1. With a namespace-wide token and the namespace's policy newest_wins, memory.set("seat", "Prefers aisle seats", user_id="alice").
  2. memory.set("seat", "Prefers window seats", user_id="bob").
  3. memory.search("seat", user_id="alice"): expected Alice's row; the code suggests it is retired.

For the value-update pass: the same two users, detect_updates on, a dated fact for Alice, then a bulk write for Bob of the same attribute with another value.

Expected behavior

A write that names its user retires only that user's rows, as the conflict verdict does after #701. Another user's row is untouched; a write without a user keeps today's namespace-wide behaviour.

Error message and logs

None: a silent retirement.

Environment

main after #701.

Related issues and pull requests

#701

How this was found

Code review of #701 (AI-assisted, Claude Code); not yet reproduced.

Additional context

Each path needs the writer's scope and a test that fails without it, as #701's tests do for the verdict.

Redaction

  • I removed tokens, keys, passwords and personal or customer data from everything above.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. added a commit that references this issue on Nov 19, 2026
    551f0b3
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions