Skip to content

Memory project keys collide for same-named repos; conventions leak across projects #179

Closed

Description

@currentbits

Problem

Canonical memory project keys are repo-root BASENAMES (memory-server/src/project-key.js:49-58), with a basename fallback on git failure. Two distinct repos with the same folder name (~/work/app and ~/oss/app) share one memory scope, and the boot migration has already merged historical rows irreversibly (documented in docs/ISSUES.md:36 with "revisit if multi-root collisions bite").

Impact

Same-folder-name repos are a common layout; agents in one repo silently read and write the other repo's conventions and knowledge. Cross-contamination of the memory store is worse than no memory, and strict project scoping (the current rule) leaks rows into both projects' recall.

Fix direction

Disambiguate colliding keys (e.g. app vs app-2 by path hash suffix) with a migration that splits merged rows only where attribution is unambiguous, and surface the collision in Settings so the user can rename a project's memory scope.

Activity

  1. added
    bug
    plan:todo
    on Aug 16, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Deep-dive finding + fix direction: canonical key is the repo basename (project-key.js), and the boot-time normalizeProjectKeys migration already merged historical rows irreversibly; pruned worktree paths keep a frozen bogus key. Fix per the scoping literature: key projects by hash of canonical path + git remote URL, with a one-time migration that re-keys rows (keep the old key as an alias for lookup). Also note the app and agents can compute different keys for the same repo when the project path is not a git repo (basename fallback).

  3. added
    plan:doing
    and removed
    plan:todo
    on Oct 10, 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

    bugplan:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions