fix: ProjectMind V2 hardening β stable identity, visibility enforcement, dry-run retrieval - #19
Merged
Merged
Conversation
β¦orcement Phase 1 β Stable Project Identity: - Add project_id to config; generate stable UUID on init, persist to .agent-memory/config.json - openProject() reconciles config project_id with DB row; tolerates moved/renamed repos - Add getProjectById() and updateProjectRoot() to repository - Tests: repo move preserves memory visibility, subdirectory resolves same identity Phase 2 β Shared Visibility Gate: - Create src/core/memory-visibility.ts with isAgentVisibleMemory() + selectAgentVisibleMemories() - selectAgentVisibleMemories() fixes supersession: old hidden only if superseder is visible - MCP listMemoriesReadOnly() now applies visibility gate (was: raw status/type filter) - All agent-facing paths (retrieve, preflight, MCP) use same gate Phase 5/6 β Non-mutating Retrieval + Enforceable Preflight: - retrieveMemories() accepts dryRun: true; skips markMemoriesRetrieved + event write - explain-retrieval always passes dryRun: true - preflight --enforce sets exit code (block=2, warn=1, allow=0) - agentmem run -- <cmd>: preflight gates command execution, records result event Phase 8 β Candidate Metadata Preservation: - Candidate paths/tags preserved on approval from existing.metadata Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
hemang-doshi
force-pushed
the
fix/projectmind-v2-hardening
branch
from
June 28, 2026 19:45
a95d085 to
76dfd2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProjectMind hardening pass fixing critical architecture issues identified in the V2 audit.
Changes
Stable Project Identity
project_idpersisted to.agent-memory/config.jsonon init (stable UUID, not path-derived)openProject()reconciles configproject_idwith DB row; updates root on moveShared Visibility Gate
src/core/memory-visibility.tsβ single source of truthlistMemoriesReadOnly()now applies visibility gateNon-Mutating Explain/Dry-Run
retrieveMemories({ dryRun: true })skipsmarkMemoriesRetrieved+ eventexplain-retrievalalways passesdryRun: trueEnforceable Preflight + agentmem run
preflight --enforcesets exit codes (block=2, warn=1)agentmem run -- <cmd>: preflight-gated command executionCandidate Metadata Preservation
Docs
snapshot.mdrewritten for V2 with honest limitationsNew Tests
tests/project-identity.test.ts(3 tests: init, move, subdirectory)Verification