Context
The root-cause lane behind #13190 (which reconciles the symptom). Surfaced while deciding the #13190 archive policy (V-B-A'd this session).
The Problem (V-B-A'd at dev)
FM auto-memory is checkout-path-keyed — removeAgentRepo's own docstring (ai/services/fleet/removeAgentRepo.mjs L28-29) states it directly: "the Fleet Manager's auto-memory is checkout-path-keyed — so deleting a path orphans memory keyed on it." The fragility: rows orphan on any path change, not just removal. The empirical ~1281-orphan precedent that motivated #13190 came from a path change, not an agent removal — which is the tell that the key itself is wrong, not just the removal flow.
Checkout-path is an unstable key: it changes on managed-root migration, repo-slug change, or any re-provisioning. agentId (the Fleet Manager agent identity, already the canonical key in MemoryService — metadata.agentIdentity + the AUTHORED_BY edge) is stable across all of those.
The Fix
Re-key auto-memory from checkout-path to agentId:
- Write path: key new auto-memory rows by
agentId (derive once at write, not the volatile path).
- Migration: map existing checkout-path-keyed rows →
agentId (the checkout→agentId derivation already exists via deriveAgentRepoPath / inspectAgentRepo), re-key in place.
- Result: a path change no longer orphans anything; #13190's reconcile becomes a thin safety net rather than a load-bearing cleanup.
Acceptance Criteria
Out of Scope
- The #13190 archive-on-removal reconcile (the symptom lane — ARCHIVE policy decided: set
archivedAt + orphanedByRepoRemoval).
- The
archiveMemoriesForCheckoutPath MC primitive (a #13190 dependency).
Related
- Root-cause of: #13190 (symptom reconcile). Touches:
removeAgentRepo (#13187), the FM remove facade (#13338), MemoryService (the keying). MC-owned (the keying + migration are Memory-Core decisions).
Live latest-open sweep: gh issue list --search "auto-memory re-key / keying" → only #13190 (the symptom) at 2026-06-21T20:59; no root-cause re-key issue.
Origin Session ID: 80932414-00dc-4d2e-96e6-d0bcf1529733
Retrieval Hint: query_raw_memories("FM auto-memory re-key checkout-path agentId root cause orphan path-change stable key #13190 symptom")
Context
The root-cause lane behind #13190 (which reconciles the symptom). Surfaced while deciding the #13190 archive policy (V-B-A'd this session).
The Problem (V-B-A'd at dev)
FM auto-memory is checkout-path-keyed —
removeAgentRepo's own docstring (ai/services/fleet/removeAgentRepo.mjsL28-29) states it directly: "the Fleet Manager's auto-memory is checkout-path-keyed — so deleting a path orphans memory keyed on it." The fragility: rows orphan on any path change, not just removal. The empirical ~1281-orphan precedent that motivated #13190 came from a path change, not an agent removal — which is the tell that the key itself is wrong, not just the removal flow.Checkout-path is an unstable key: it changes on managed-root migration, repo-slug change, or any re-provisioning.
agentId(the Fleet Manager agent identity, already the canonical key in MemoryService —metadata.agentIdentity+ theAUTHORED_BYedge) is stable across all of those.The Fix
Re-key auto-memory from checkout-path to
agentId:agentId(derive once at write, not the volatile path).agentId(the checkout→agentId derivation already exists viaderiveAgentRepoPath/inspectAgentRepo), re-key in place.Acceptance Criteria
agentId, not checkout-path.agentId(idempotent; archived rows preserved).Out of Scope
archivedAt+orphanedByRepoRemoval).archiveMemoriesForCheckoutPathMC primitive (a #13190 dependency).Related
removeAgentRepo(#13187), the FM remove facade (#13338),MemoryService(the keying). MC-owned (the keying + migration are Memory-Core decisions).Live latest-open sweep:
gh issue list --search "auto-memory re-key / keying"→ only #13190 (the symptom) at 2026-06-21T20:59; no root-cause re-key issue.Origin Session ID: 80932414-00dc-4d2e-96e6-d0bcf1529733
Retrieval Hint: query_raw_memories("FM auto-memory re-key checkout-path agentId root cause orphan path-change stable key #13190 symptom")