musememory 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,199 @@
1
+ # Agent Reference
2
+
3
+ > **Audience**: AI coding agents. Human-readable narrative lives in
4
+ > [`user-guide.md`](./user-guide.md) and the [README](../README.md); this file
5
+ > is the exact contract — commands, flags, file layout, lifecycle states and
6
+ > failure semantics — with no prose padding.
7
+ >
8
+ > **Machine-readable companions**:
9
+ > - [`mcp-tool-matrix.json`](./mcp-tool-matrix.json) — the full list of registered MCP tools.
10
+ > - [`../claims.json`](../claims.json) — every countable claim, generated from `src/`.
11
+ > - `https://harshsinghmp.github.io/musememory/llms.txt` — the site, for agents.
12
+ > - `https://harshsinghmp.github.io/musememory/llms-full.txt` — the site as plain text.
13
+
14
+ ---
15
+
16
+ ## 1. Install
17
+
18
+ ```bash
19
+ npx musememory connect # wire every detected coding agent over MCP
20
+ ```
21
+
22
+ Requirements: Node.js >= 18 or Bun >= 1.2. No account, no API key, no
23
+ configuration file, no background daemon. The package installs a single
24
+ executable, `memory` (alias `musememory`).
25
+
26
+ Equivalent explicit install:
27
+
28
+ ```bash
29
+ npm install -g musememory # or: bun add -g musememory
30
+ ```
31
+
32
+ ## 2. Where state lives
33
+
34
+ | Path | Scope | Contents |
35
+ | --- | --- | --- |
36
+ | `.memory/` | project | `memory.db` (SQLite, WAL + FTS5), `memories/*.yaml`, `CURRENT.md`, `USER.md`, `observations.jsonl`, `audit.jsonl`, `sources.json`, `claims.json`, `sync_pool/`, `mesh_links.json` |
37
+ | `~/.memory/` | global | Same layout. Project scope wins on conflict. |
38
+
39
+ Both are plain files. There is no server, no port, and no service to keep
40
+ alive. Delete the directory to delete the memory.
41
+
42
+ ## 3. Mandatory session protocol
43
+
44
+ An agent integrating Muse must follow this order.
45
+
46
+ 1. **First turn of any session** — call `get_context`. It returns the `USER.md`
47
+ persona profile, the `CURRENT.md` active constraints, and the top-K ranked
48
+ memories relevant to the task, under one token budget.
49
+ 2. **Before editing** — if a hard constraint, invariant or open loop is
50
+ established or changed, record it with `memory_capture --type constraint` or
51
+ `memory_current set`.
52
+ 3. **After a fix or a decision** — call `memory_capture`. Capture is the
53
+ mechanism that makes the next session cheaper than this one.
54
+ 4. **When knowledge is replaced** — call `memory_supersede`, never `delete`.
55
+ Superseding keeps lineage; deleting loses the audit trail.
56
+
57
+ `muse_context` is the higher-fidelity variant of `get_context`: it fuses
58
+ constraints, ranked memories, negative lessons and code anchors, and is what
59
+ task-shaped profiles (`coding`, `debugging`, `review`, `architecture`) expose.
60
+
61
+ ## 4. CLI
62
+
63
+ ```
64
+ memory <command> [arguments] [options]
65
+ ```
66
+
67
+ Full matrix: [`cli-reference.md`](./cli-reference.md).
68
+
69
+ ### Commands an agent uses most
70
+
71
+ | Command | Purpose |
72
+ | --- | --- |
73
+ | `memory context [query] --token-budget N` | Top-ranked context for prompt injection. |
74
+ | `memory search <query> --limit N` | Ranked multi-factor search with a score breakdown. |
75
+ | `memory capture "<text>" --project P` | Persist a memory. Vibeguard-scanned and citation-verified. |
76
+ | `memory propose "<text>" --project P` | Propose a candidate (does not auto-confirm). |
77
+ | `memory confirm <id>` | Promote a candidate to confirmed. |
78
+ | `memory supersede <old_id> --with <new_id>` | Replace outdated knowledge, preserving lineage. |
79
+ | `memory current get` / `memory current set "<text>" --project P` | Read/write active constraints. |
80
+ | `memory link <id> --related <id1,id2>` | Bidirectional relation between entries. |
81
+ | `memory audit [--operation OP] [--entry-id ID]` | Query the append-only audit ledger. |
82
+ | `memory doctor` | Full ecosystem health diagnostic. |
83
+ | `memory harvest "<text>" --project P` | Distil a turn into a fix/decision unit. |
84
+ | `memory verify <id> --strict` | Run an entry's verification command, or the full integrity gate. |
85
+
86
+ ### Global flags that change behaviour
87
+
88
+ | Flag | Effect |
89
+ | --- | --- |
90
+ | `--project <name>` | Scopes a write to a project. Required by `capture`, `propose`, `harvest`. |
91
+ | `--token-budget <n>` | Hard ceiling on returned tokens. The engine never exceeds it. |
92
+ | `--limit <n>` | Maximum candidates. Clamped by the engine, not by the caller. |
93
+ | `--global` | Operates on `~/.memory/` instead of `.memory/`. |
94
+ | `--dry-run` | Required default for destructive operations; nothing is written. |
95
+ | `--harness <name>` | Opt-in for harness-specific config paths (e.g. `claude` → `~/.claude*`). Without it, those paths are reported as skipped and nothing is written. |
96
+
97
+ ## 5. MCP
98
+
99
+ The server speaks MCP over stdio. Protocol versions accepted:
100
+ `2024-11-05`, `2025-06-18`.
101
+
102
+ `claims.json` records the live totals; read them rather than trusting prose:
103
+
104
+ | Claim | Source of truth |
105
+ | --- | --- |
106
+ | Registered tools | `docs/mcp-tool-matrix.json` |
107
+ | Profiles | `src/orchestrator/profiles.ts` |
108
+ | Agent platforms auto-wired | `src/agents/registry.ts` |
109
+ | Import formats | `src/migrator/detect.ts` |
110
+ | Credential rule families | `src/secrets.ts` |
111
+
112
+ ### Profiles
113
+
114
+ Tools are exposed through task-focused profiles so an agent is never handed
115
+ the whole surface. Select with `MUSE_MCP_PROFILE` or the server's `profile`
116
+ argument.
117
+
118
+ | Profile | Use it for |
119
+ | --- | --- |
120
+ | `core` | Minimal footprint: context injection and rapid capture. |
121
+ | `coding` | Active development, code anchors, contextual fusion. |
122
+ | `debugging` | Bug diagnosis, error resolution, observations, negative lessons. |
123
+ | `review` | Code review, architectural audit, conflict verification. |
124
+ | `architecture` | System design, promotions, entity wiki, tree indexing. |
125
+ | `maintenance` | Repository health, deduplication, archival sweeps. |
126
+ | `full` | Everything. |
127
+
128
+ `muse_profile_list` returns the live profile→tool mapping.
129
+
130
+ ### Tools that are mandatory, optional, and forbidden
131
+
132
+ | Kind | Tools |
133
+ | --- | --- |
134
+ | Must call on session start | `get_context` |
135
+ | Use when state changes | `memory_capture`, `memory_current`, `memory_supersede`, `memory_confirm` |
136
+ | Use for investigation | `search`, `memory_tree_search`, `muse_why`, `muse_code_impact` |
137
+ | Use for governance | `memory_audit`, `memory_verify_strict`, `memory_drift_audit` |
138
+ | Never available to a model | Anything that writes outside the store. There is no shell-execution tool. `memory verify` runs a **template-gated** command: only `bun test <relative test file>`, `bunx tsc --noEmit`, and `node --check <relative path>` are permitted, and nothing is executed outside those shapes. Refusals are audit-logged as `verify_refused`. |
139
+
140
+ ## 6. Memory lifecycle
141
+
142
+ ```
143
+ propose → candidate → confirmed → superseded
144
+ ↘ stale → archived
145
+ ↘ rejected
146
+ ↘ conflicted (kept-both, resolved by supersede/historical/reject)
147
+ ↘ deleted (tombstone; restorable with `memory restore`)
148
+ ```
149
+
150
+ - `confirmed` is the only state served by default.
151
+ - `stale` entries decay; per-type half-lives are trust-tiered.
152
+ - `deleted` is a tombstone (`deleted_at`, `deleted_by`), excluded from every
153
+ read path, restorable, and replayable from `audit.jsonl`.
154
+ - `conflicted` keeps both sides. Resolution verbs: `supersede`, `historical`,
155
+ `reject`, `keep_both`.
156
+
157
+ ## 7. Trust gates
158
+
159
+ | Gate | When | Behaviour on violation |
160
+ | --- | --- | --- |
161
+ | Secret scan (Vibeguard) | every write | The write is **refused** and the rule name is reported. Nothing is stored. |
162
+ | Citation verification | every write with a code anchor | The write is **refused** under the default `fail_fast` policy if the cited file/symbol does not exist. Drift is flagged and stamped. |
163
+ | Freshness gate | every recall | Memories whose anchors drifted are **withheld** and reported via `withheld_memories` + `freshness_notice`. They are never silently served. `include_drifted: true` returns them with a `⚠ FRESHNESS` provenance warning. |
164
+ | Ingest sanitisation | import / harvest | Injected `<memory-context>` blocks and base64 payloads are stripped before the text is considered. |
165
+
166
+ ## 8. Failure semantics
167
+
168
+ | Condition | Result |
169
+ | --- | --- |
170
+ | Secret detected | Write refused. Non-zero exit. Rule name only — never the value. |
171
+ | Citation does not resolve | Write refused (`fail_fast`) or stamped as drifted (`warn` policy). |
172
+ | `memory.db` schema version ahead of the binary | The read is refused; run `memory upgrade`. |
173
+ | SQLite lock held longer than the busy timeout | The operation fails loudly. It does not silently skip the write. |
174
+ | Store circuit breaker open (5 consecutive failures) | Degraded mode: reads fall back, writes are refused, and the state is reported. `memory doctor` shows it. |
175
+ | Unknown MCP tool name | Tool-not-found error. Tool names are exact. |
176
+
177
+ ## 9. Constraints on the agent
178
+
179
+ - **No shell execution from memory.** A stored memory can never cause an
180
+ arbitrary command to run. `memory verify` is template-gated.
181
+ - **Paths are contained.** Wiki, PageIndex, pool and mesh paths are resolved
182
+ with `resolveWithin` (strict containment). `resolveExternal` is an explicit
183
+ opt-out for intentionally external directories.
184
+ - **No network by default.** Semantic embeddings are opt-in and require an
185
+ explicitly configured endpoint. Everything else runs in-process.
186
+ - **Writes are auditable.** Every write appends to `audit.jsonl` and the
187
+ tamper-evident hash chain.
188
+
189
+ ## 10. Verifying the installation
190
+
191
+ ```bash
192
+ memory doctor # storage, schemas, secrets, agent wiring
193
+ memory health # 5-pillar health gate, letter grade
194
+ memory stats # counts by status and type
195
+ memory context --query "how does auth work" --budget 2000
196
+ ```
197
+
198
+ A healthy install reports: SQLite reachable, schema version current, no
199
+ secrets in the store, and the expected agents wired.
@@ -0,0 +1,263 @@
1
+ # CLI & MCP Reference
2
+
3
+ > **Generated file** — produced by `scripts/generate-cli-reference.ts` from `src/cli.ts` and `src/mcp.ts`. Do not hand-edit: regenerate it after any CLI or MCP change (`bun run scripts/generate-cli-reference.ts`).
4
+
5
+ This is the complete machine-facing surface. For narrative guidance see [`agent-reference.md`](./agent-reference.md); for the human walkthrough see [`user-guide.md`](./user-guide.md).
6
+
7
+ ## Command line
8
+
9
+ ```bash
10
+ memory <command> [arguments] [options] # alias: musememory
11
+ ```
12
+
13
+ ```
14
+ Muse Memory (memory / musememory) -- Autonomous Persistent Memory for AI Agents & Agency Networks
15
+
16
+ Usage:
17
+ memory <command> [arguments] [options]
18
+
19
+ Core Memory Lifecycle Commands:
20
+ install [dir] Run interactive onboarding wizard & auto-wire installed agents
21
+ upgrade / update [--check] Auto-fetch latest release, self-heal, and sync agent platforms
22
+ doctor [dir] Run comprehensive ecosystem health diagnostic
23
+ uninstall [agent] [--purge] Disconnect agents and optionally purge .memory data
24
+ init [dir] Initialize .memory/ in workspace or current dir
25
+ capture <text> --project P Capture new memory unit with Vibeguard secret inspection
26
+ propose <text> --project P Propose a candidate memory entry
27
+ confirm <id> Promote candidate or stale memory to confirmed status
28
+ supersede <old_id> --with <new_id> Replace outdated knowledge with confirmed target
29
+ link <id> --related <id,...> Link related memories bidirectionally
30
+ mark-stale <id> [--reason R] Deprecate decaying knowledge
31
+ reject <id> Reject candidate entry
32
+ delete <id> [--reason R] Tombstone entry (soft delete), log audit, restorable
33
+ restore <id> [--replay [--apply]] Restore a tombstoned entry; --replay rebuilds content from audit.jsonl
34
+ list / ls [--status S] [--type T] [--project P] List memory entries with multi-field filtering
35
+ stats Display total memory counts and status/type distribution
36
+ stale [--days N] List entries exceeding staleness policy
37
+ consolidate [--project P] [--dry-run] Cluster confirmed memories into scene rollups
38
+ optimize [--dry-run] [--project P] [--force] Prune test noise, junk, duplicates & vacuum SQLite DB
39
+ trace <id> [--depth N] Walk causal graph pathways from an entry (default depth 5)
40
+ loops Prioritized open-loop report: git state, stale candidates, constraints
41
+ nudge Proactive attention list: overdue/due-soon entries, stale-by-policy, open loops
42
+ routine run <name> Execute a routine's steps from .memory/routines.yaml
43
+ routine install [name] Print crontab line(s) for routines (user installs; no system mutation)
44
+ distill [--min-count N] [--dry-run] Distill recurring fix patterns into .agents/skills/ folders
45
+ verify <id> [--timeout S] [--strict] Execute test_command or run full strict integrity gate
46
+ briefing [--limit N] Executive summary of active and stale memories
47
+
48
+ Evidence, Provenance & Cognitive Governance:
49
+ source [add|list|show] Manage external documentation and URLs in provenance Source Ledger
50
+ claim [record|list|show] Record verifiable claims with confidence tags ([RAW], [FETCH], [SEARCH], [INFER])
51
+ freeze --task <task> [--run-id R] Capture immutable execution snapshot with file inventory & sha-256 hashes
52
+ prompt [list|show|run <name>] Manage and run structured prompt templates with live context injection
53
+ rollup --period week|month|quarter Multi-scale temporal compounding & HOT.md working cache generation
54
+ loop [record|status|clear] Gauntlet iteration ledger & plateau/regression detector
55
+
56
+ Context & Retrieval Commands:
57
+ context [query] [--limit N] [--token-budget N] [--depth L1|L2|L3] [--tier 0|1|2] Top-ranked prompt context
58
+ search <query> [--limit N] [--token-budget N] [--hybrid] [--tree] Scored token retrieval (hybrid: vector+BM25, tree: hierarchical reasoning)
59
+ reindex Rebuild the local vector index (.memory/index.json) for hybrid search
60
+ embed [status|build|reindex] Manage semantic embeddings (llama.cpp / OpenAI-compatible endpoint; opt-in)
61
+ recall [query] Search active/confirmed memories with filters
62
+ search-transcript <query> [file.jsonl] [--window N] Full-text transcript search with bookends
63
+
64
+ Wiki & Entity Knowledge Compounding:
65
+ wiki [compile|list|show] Compile memories into structured Obsidian-compatible markdown wiki pages
66
+ extract-entities [--dry-run] Extract named entities (persons, products, orgs, files, concepts) from memories
67
+ entities [list|show|related] Inspect extracted knowledge graph entities and co-occurrences
68
+
69
+ Persona, Settings & Constraints Commands:
70
+ settings [get|set|reset|export|import] Manage unified global and project configuration
71
+ user [get|init|set] [--global] Manage USER.md persona & working preferences
72
+ current [get|set] Manage CURRENT.md active project constraints
73
+ core [tier] [--set T|--remove|--show] Manage CORE.md permanent partitions (identity|directives|conventions|context)
74
+
75
+ Ecosystem, Migration & Connectivity:
76
+ connect [agent|all] [--force] [--with-hooks] [--harness H]
77
+ Auto-wire MCP into detected coding agents; --with-hooks also installs
78
+ the lifecycle hook pack (SessionStart/PostToolUse/Stop) into .agents/hooks.json;
79
+ --harness claude is the explicit opt-in for harness-specific paths like ~/.claude
80
+ agents / detect-agents Scan workstation for detected coding agent platforms
81
+ detect Scan machine for external memory formats to migrate
82
+ migrate [--from P] [--all] Ingest external memories with state preservation & secret scrubbing
83
+ learn / sync-chats [--confirm] Auto-discover and harvest memories from all agent chats across machine
84
+ harvest <file|text> --project P Distill conversation transcripts into structured memory units
85
+ harvest-auto [--from <glob>] [--project P] Harvest inbox transcripts as candidates and archive them
86
+ hook install --git Install the harvester as a git pre-commit hook (never clobbers)
87
+ import-transcript <file.jsonl> Universal JSONL transcript ingestion with session binding
88
+ export [--out file.json] Export portable JSON memory snapshot
89
+ import <file.json> Import portable JSON memory snapshot
90
+ validate [--dry-run] Validate YAML schemas and referential integrity
91
+ graph [status|index] Inspect or index CodeGraph/Graphify AST provider symbols
92
+ ui / dashboard [--port 2222] Launch embedded visual knowledge graph UI
93
+ daemon [--port N] Real-time agency hub (SSE event stream + publish API, default port 7878)
94
+ sync [status|broadcast|ingest|pool] Cross-agent knowledge sync & P2P gossip mesh
95
+ mesh [query|check|link|unlink|propagate] Multi-repo & monorepo cross-project mesh
96
+ health Run unified 5-pillar architectural health evaluation
97
+ reconcile [--prune] [--stale] Reconcile orphaned & drifted code anchors across memories
98
+ benchmark [--iterations N] Run microsecond speed, quality & token economy benchmark suite
99
+ code-impact <file> [--symbol] Synthesize code callers, ADRs, negative warnings & risk score
100
+ pr-context [--base B] [--out] Generate memory-verified PR description from git diff
101
+ mcp Run stdio MCP server for agent platforms
102
+
103
+ Version Control (R23):
104
+ branch <id> --path <path> [--label L] Tag a memory with semantic dotted-path addressing
105
+ checkout <path|id> Retrieve memory by mem_path or entry id
106
+ blame <id> Show access history & staleness metadata for a memory
107
+ ls-branches [--project P] List all branch references
108
+ ```
109
+
110
+ ## MCP tools
111
+
112
+ **115 tools** are registered, exposed through **7 task-focused profiles** (`core`, `coding`, `debugging`, `review`, `architecture`, `maintenance`, `full`). The authoritative machine-readable list is [`mcp-tool-matrix.json`](./mcp-tool-matrix.json).
113
+
114
+ Select a profile with the `MUSE_MCP_PROFILE` environment variable. Call `muse_profile_list` for the live mapping.
115
+
116
+ ### Context & recall
117
+
118
+ | Tool | Required parameters | Description |
119
+ | --- | --- | --- |
120
+ | `memory_read` | `id` | Read a full memory entry by id |
121
+ | `get_context` | `query` | MANDATORY ON SESSION START: Fetch Top-K relevant memories, active user profile (USER.md), and active hard constraints (CURRENT.md) for prompt injection. MUST be called on the first turn of any task or session. |
122
+ | `search` | `query` | Ranked search over memory entries |
123
+ | `memory_recall` | `query` | Recall active and confirmed memories for a query, with verification levels and related graph links |
124
+ | `memory_get_user_profile` | `content` | Read the active user profile and preferences (USER.md) |
125
+ | `memory_search_transcripts` | `query`, `transcript` | Full-text search over conversation transcripts (.jsonl or text) with conversation bookends (start/end) and context window |
126
+ | `memory_tree_search` | `query` | Hierarchical tree-indexed reasoning search across partitioned memory shards |
127
+ | `memory_wiki_get` | `slug` | Read a compiled wiki page (concept, entity, index, or log) |
128
+ | `memory_wiki_search` | `id` | List compiled wiki pages with optional filtering |
129
+ | `memory_entities_get` | `id` | Get detailed information about an extracted entity and its relationships |
130
+ | `memory_entities_search` | `content`, `project` | List extracted entities by type or project |
131
+ | `memory_code_intel_status` | `query` | Inspect registered code intelligence providers and their workspace availability status |
132
+ | `memory_code_intel_symbols` | `query` | Resolve symbols (functions, classes, types) across active code intelligence providers with fallback |
133
+ | `memory_code_intel_blast_radius` | `target` | Calculate ripple effect and blast radius of modifying a symbol or file |
134
+ | `memory_ranked_retrieval` | `query` | Multi-factor ranked retrieval fusing symbol matching, BM25, graph overlap, blast radius, recency, utility ROI, and negative warnings |
135
+ | `muse_context` | `memory_id` | FLAGSHIP UNIFIED CONTEXT ORCHESTRATOR: Single-call fusion of active constraints, ranked memories, code anchors, and negative lessons under a strict token budget with actionable next steps. |
136
+ | `muse_code_for_memory` | `memory_id` | Bidirectional lookup: Given a memory ID, return all anchored code references, files, and symbols |
137
+ | `muse_memory_for_code` | `file_path` | Bidirectional lookup: Given a file path or symbol, return all associated memories, architectural decisions, bug fixes, constraints, and negative lessons |
138
+
139
+ ### Capture & lifecycle
140
+
141
+ | Tool | Required parameters | Description |
142
+ | --- | --- | --- |
143
+ | `memory_capture` | `content` | Create a new memory entry with inline secret scan (refuses probable secrets). When type='constraint', automatically appends to CURRENT.md. |
144
+ | `memory_current` | `action` | Read or append active working constraints and hard invariants in CURRENT.md for the active project |
145
+ | `memory_get_constraints` | `query` | Read the active working constraints and hard invariants recorded in CURRENT.md for the active project |
146
+ | `memory_set_constraints` | `query` | Append a working constraint or hard invariant to CURRENT.md for the active project |
147
+ | `memory_harvest` | `id` | Distill conversation/text into structured outcome, fix, decision, and failure memories |
148
+ | `memory_confirm` | `id` | Promote a candidate, disputed, or stale entry to confirmed |
149
+ | `memory_supersede` | `id` | Mark old memory entry superseded by new confirmed memory entry |
150
+ | `memory_lifecycle` | `verb`, `id` | T-084: Five-verb canonical memory lifecycle mutation (change, end, correct, revert, forget) |
151
+ | `memory_link` | `id`, `related` | Two-way link related memory entries |
152
+ | `memory_mark_stale` | `id` | Mark a memory entry stale |
153
+ | `memory_reject` | `id` | Reject a memory entry |
154
+ | `memory_delete` | `id` | Soft-delete a memory entry by single point ID (tombstone, reversible via memory_restore). Dry-run by default unless confirm: true or dry_run: false. |
155
+ | `memory_restore` | `id` | Restore a tombstoned memory entry by ID. Fails on an unknown or never-deleted entry. Set replay=true to rebuild the content from the audit ledger when the row is gone, and apply=true to write it back |
156
+ | `memory_audit` | `transcript` | Query the append-only audit trail of memory operations |
157
+ | `memory_import_transcript` | `transcript` | Ingest a JSONL transcript or raw log into structured outcome and fix memories |
158
+ | `memory_export` | `entries` | Export memory snapshot for agency team synchronization |
159
+ | `memory_import` | `entries` | Import memory snapshot entries into the store |
160
+ | `confirm_fix` | `id` | Confirm a disputed entry as fixed (disputed -> confirmed) |
161
+ | `record_session` | `project` | Record a session start entry |
162
+ | `memory_checkpoint` | `content` | Record a real-time progress checkpoint or task handoff to CURRENT.md to prevent loss on interruption |
163
+ | `memory_validate` | `content` | Validate the memory store for schema violations, secrets, broken links, and integrity |
164
+ | `memory_set_user_profile` | `content` | Update the user profile and preferences (USER.md) with inline secret scanning |
165
+ | `memory_core` | `id` | Read or edit permanent core memory partitions (CORE.md) with tiers: identity, directives, conventions, context |
166
+ | `memory_consolidate` | `id` | Cluster confirmed memories into scene rollup entries (architecture summaries linked to members); idempotent |
167
+ | `memory_trace` | `id` | Walk causal pathways (supersedes/superseded_by + related links) from a memory entry as a cycle-safe tree |
168
+ | `memory_loops` | `id` | Read-only prioritized open-loop report: uncommitted git changes, unmerged branches, stale candidates, disputed entries, and CURRENT.md constraints |
169
+ | `memory_distill` | `id` | Distill recurring confirmed fix patterns into .agents/skills/<slug>/SKILL.md folders (never overwrites existing skills) |
170
+ | `memory_distill_route` | `id` | Multi-channel knowledge distillation router: triages memories across system (rules/fixes), content (architecture concepts), and health (contradictions/staleness) lanes with deduplication |
171
+ | `memory_verify` | `id` | Verification oracle: execute a fix entry's test_command; exit 0 promotes candidates to confirmed and stamps independently-verified |
172
+ | `memory_settings_get` | `settings` | Read unified global or project configuration settings |
173
+ | `memory_settings_set` | `settings` | Update unified global or project configuration settings |
174
+ | `memory_compress` | `text` | Compress formatted prompt context losslessly, stripping header whitespace and boilerplate while preserving all architectural facts. |
175
+ | `memory_source_add` | `url`, `title` | Record external documentation, research paper, RFC, or URL into the provenance Source Ledger |
176
+ | `memory_source_list` | `claim` | List recorded external sources in the Source Ledger |
177
+ | `memory_claim_record` | `claim` | Record an evidence-backed claim into the Claim Ledger connected to sources and confidence tags ([RAW], [FETCH], [SEARCH], [INFER]) |
178
+ | `memory_claim_list` | `task` | List recorded claims in the Claim Ledger |
179
+ | `memory_freeze_run` | `task` | Capture an immutable execution snapshot (active task, file inventory, git SHA, CURRENT constraints, memory SHA-256 hashes) in .memory/runs/<run-id>/ |
180
+ | `memory_freeze_list` | `name` | List recorded frozen execution snapshots in .memory/runs/ |
181
+ | `memory_prompt_list` | `name` | List available structured prompt templates in .memory/prompts/ |
182
+ | `memory_prompt_get` | `name` | Get prompt template by name |
183
+ | `memory_prompt_run` | `name` | Render prompt template with variable substitution and live memory context injection |
184
+ | `memory_rollup` | `period` | Multi-scale temporal compounding: aggregate atomic memories into weekly, monthly, or quarterly synthesis wiki pages and update HOT.md cache |
185
+ | `memory_loop_record` | `iteration_index`, `critic_verdict`, `largest_fix_identified`, `test_results` | Record an iteration round in the multi-agent Gauntlet Iteration Ledger (.memory/iterations.jsonl) |
186
+ | `memory_loop_status` | `memory_id`, `success` | Inspect multi-round iteration status, plateau warnings, and regression signals |
187
+ | `memory_verify_strict` | `memory_id`, `success` | Execute Strict Integrity & Health Gate: audits zero secrets, referential link integrity, wikilinks, orphaned candidates, and claim sources |
188
+ | `memory_feedback` | `memory_id`, `success` | Record application outcome for a memory (success, failure, or regression) to train utility and calculate memory ROI |
189
+ | `memory_resolve_conflict` | `winning_id`, `losing_id`, `strategy`, `reason` | Resolve a contradiction between two memories using a deterministic strategy (supersede, historical, reject, or keep_both) |
190
+ | `memory_roi` | `raw`, `source`, `project` | Calculate memory utility, reuse success rates, and return-on-investment across the store |
191
+ | `memory_observe` | `raw`, `source`, `project` | Ingest an ephemeral raw observation (tool output, test error, build log, review feedback) to .memory/observations.jsonl |
192
+ | `memory_distill_observations` | `project` | Distill unprocessed raw observations into structured candidate memories and negative lessons |
193
+ | `memory_negative_capture` | `title`, `failed_approach`, `failure_reason`, `project` | Record a first-class negative memory (DO_NOT_USE, FAILED_APPROACH, BUG_PRONE_PATTERN) to prevent recurring mistakes |
194
+ | `memory_enrich` | `id` | Enrich an existing memory entry with code intelligence symbol evidence |
195
+ | `memory_compaction_check` | `used_tokens` | Evaluate context usage against the 70% threshold and prompt if compaction is needed |
196
+ | `memory_compact_handoff` | `high_level_goal`, `current_architecture`, `completed_tasks`, `open_tasks`, `next_concrete_task` | Lock the 5 mandatory invariants and write an interruption-proof session handoff to CURRENT.md before context reset |
197
+ | `memory_harvest_turn` | `text`, `project` | Continuous conversational harvester: automatically extract architectural decisions, fixes, and negative lessons from turn text |
198
+ | `memory_evaluate_promotion` | `id` | Evaluate a memory entry for promotion along the ladder: LOCAL -> PROJECT -> GLOBAL (5x success rule, zero regressions, zero conflicts, generalization) |
199
+ | `memory_promote` | `id` | Execute promotion of a memory entry (LOCAL -> PROJECT or PROJECT -> GLOBAL) with generalization and audit logging. Can optionally stage in pending tier for session-end flush. |
200
+ | `memory_flush_pending` | `id` | Two-tier promotion protocol (T-107): Flushes staged pending promotions at session close or manual trigger, executing promotion for qualifying entries. |
201
+ | `memory_curate` | `id` | Curator protocol (T-106): appends empirical evidence or application outcomes to an existing memory. Deterministic promotion rules evaluate eligibility and trigger promotion when criteria are satisfied. |
202
+ | `memory_generalize` | `content` | Test and preview generalization of memory content: scrubs project-specific paths and extracts universal principles |
203
+ | `memory_archive` | `id`, `tier`, `reason` | Transition a memory entry to cold, dormant, or archived tier with reason |
204
+ | `memory_rehydrate` | `id` | Restore an archived, dormant, or cold memory back to active/confirmed status upon relevance |
205
+ | `memory_lifecycle_status` | `memory_id`, `file_path` | Inspect store-wide memory lifecycle metrics: counts across active, cold, dormant, archived, scopes, and promotion readiness |
206
+
207
+ ### Code anchors, drift & decisions
208
+
209
+ | Tool | Required parameters | Description |
210
+ | --- | --- | --- |
211
+ | `memory_pageindex_index` | `content`, `project` | Build a PageIndex-style hierarchical tree index from document/text for reasoning-based retrieval |
212
+ | `memory_pageindex_search` | `query` | Search a PageIndex tree index with reasoning-based retrieval |
213
+ | `memory_pageindex_import` | `query`, `project` | Import PageIndex search results/insights as memory entries |
214
+ | `memory_disconnect_pageindex` | `settings` | Disconnect PageIndex MCP tools and remove associated indexes |
215
+ | `memory_drift` | `text` | Scan the local Git workspace for modified or deleted code files and AST symbols referenced by memories. Flags drifted memories for re-verification or supersession. |
216
+ | `memory_anchor_create` | `memory_id`, `file_path` | Create and attach a line-independent structural code anchor to a memory entry (repository, file, module, symbol, route, test) |
217
+ | `memory_anchor_verify` | `memory_id` | Verify all code anchors attached to a memory entry against the live codebase to detect drift or orphaned references |
218
+ | `memory_anchor_audit` | `memory_id` | Run repository-wide audit of all code anchors across all memories: reports integrity score, valid, drifted, and orphaned counts |
219
+ | `memory_adr_record` | `title`, `context_and_drivers`, `decision`, `consequences` | Record a first-class Architecture Decision Record (ADR) as an active, queryable memory with drivers, decision, consequences, options, and code anchors |
220
+ | `memory_adr_list` | `target` | List all Architecture Decision Records (ADRs) recorded in the memory store, optionally filtered by status |
221
+ | `memory_drift_audit` | `target` | Run bidirectional documentation <-> code drift audit: verifies if documented decisions are implemented in code and flags missing/stale/conflicting code or docs |
222
+ | `muse_why` | `target` | Autonomous Engineering Cognition: Explain WHY code was designed or modified the way it is by tracing historical bug fixes, ADRs, trade-offs, and invariants |
223
+ | `muse_bug_clusters` | `packet` | Analyze and cluster recurring bug fixes, negative lessons, and failures into architectural fragility hotspots with root-cause hypotheses |
224
+ | `muse_tech_debt` | `packet` | Scan repository and memory store for technical debt indicators (TODO/FIXME/HACK, unsafe 'as any' casts, drifted code anchors) and generate refactoring priorities |
225
+ | `muse_health` | `packet` | Unified 5-Pillar Project Health Gate: audit memory store integrity, code anchor validity, documentation drift, anti-pattern sentry, and technical debt with overall grade (A-F) and pass/fail gate status |
226
+ | `muse_code_impact` | `file_path` | Evaluates comprehensive code and memory impact before editing: callers, test suites, ADRs, negative warnings, active constraints, and composite risk level |
227
+ | `muse_pr_context` | — | Generates rich GitHub PR descriptions from git diff linking touched code anchors, respected ADRs, tested invariants, and composite risk assessment |
228
+ | `muse_reconcile_anchors` | — | Interactively audits, prunes, or updates drifted and orphaned code anchors across memories when code is refactored or deleted |
229
+
230
+ ### Knowledge compounding
231
+
232
+ | Tool | Required parameters | Description |
233
+ | --- | --- | --- |
234
+ | `memory_wiki_compile` | `id` | Compile confirmed memories into structured wiki markdown pages |
235
+
236
+ ### Sync, mesh & team
237
+
238
+ | Tool | Required parameters | Description |
239
+ | --- | --- | --- |
240
+ | `muse_sync_broadcast` | `packet` | Exports a portable, signed SyncPacket containing confirmed memories, active constraints, and supersessions for P2P gossip sync across peer agents |
241
+ | `muse_sync_ingest` | `packet` | Ingests a peer agent's SyncPacket with Vibeguard secret inspection, deduplication, and contradiction resolution |
242
+ | `muse_sync_status` | `path` | Inspects peer synchronization status, known peer agents, vector clocks, and pending outgoing knowledge |
243
+ | `muse_sync_pool` | `path` | Performs two-way P2P gossip synchronization with an in-process filesystem shared pool folder |
244
+ | `muse_mesh_status` | `path` | Inspects multi-repo and monorepo cross-project mesh topology, workspace type, and discovered package stores |
245
+ | `muse_mesh_query` | `path` | Queries memories across the entire monorepo or multi-repo cross-project mesh with origin package provenance |
246
+ | `muse_mesh_audit` | `path` | Audits monorepo cross-package dependency contracts, entrypoint exports, and cross-repo code anchors |
247
+ | `muse_mesh_link` | `path` | Explicitly links or unlinks an external repository or package directory path into the project mesh |
248
+
249
+ ### Onboarding & environment
250
+
251
+ | Tool | Required parameters | Description |
252
+ | --- | --- | --- |
253
+ | `memory_detect_providers` | `entries` | Scan the machine and local workspace for existing external memory systems (24+ providers) |
254
+ | `memory_detect_agents` | `entries` | Scan the machine for installed coding agents (Claude Code, Cursor, Hermes, OpenCode, OpenClaw, Codex, etc.) |
255
+ | `memory_connect` | `entries` | Auto-wire Muse Memory MCP into installed coding agents or a specified agent |
256
+ | `memory_migrate` | `entries` | Auto-detect and migrate memories from external providers preserving active/superseded state |
257
+ | `graph_status` | `query` | Check the status of the project graph provider (e.g. codegraph) |
258
+ | `graph_index` | `query` | Index AST symbols from the project's CodeGraph/Graphify provider and cache in .memory/ |
259
+ | `muse_profile_list` | `title`, `context_and_drivers`, `decision`, `consequences` | List all available task-focused MCP profiles (core, coding, debugging, review, architecture, maintenance, full) and their exposed tools |
260
+
261
+ ---
262
+
263
+ Counts in this file are generated from the same source as [`claims.json`](../claims.json): 115 tools, 7 profiles, 30 import formats, 8 credential rule families.
@@ -0,0 +1,121 @@
1
+ {
2
+ "$comment": "Generated by scripts/generate-claims.ts — the authoritative MCP tool list.",
3
+ "count": 115,
4
+ "tools": [
5
+ "confirm_fix",
6
+ "get_context",
7
+ "graph_index",
8
+ "graph_status",
9
+ "memory_adr_list",
10
+ "memory_adr_record",
11
+ "memory_anchor_audit",
12
+ "memory_anchor_create",
13
+ "memory_anchor_verify",
14
+ "memory_archive",
15
+ "memory_audit",
16
+ "memory_capture",
17
+ "memory_checkpoint",
18
+ "memory_claim_list",
19
+ "memory_claim_record",
20
+ "memory_code_intel_blast_radius",
21
+ "memory_code_intel_status",
22
+ "memory_code_intel_symbols",
23
+ "memory_compact_handoff",
24
+ "memory_compaction_check",
25
+ "memory_compress",
26
+ "memory_confirm",
27
+ "memory_connect",
28
+ "memory_consolidate",
29
+ "memory_core",
30
+ "memory_curate",
31
+ "memory_current",
32
+ "memory_delete",
33
+ "memory_detect_agents",
34
+ "memory_detect_providers",
35
+ "memory_disconnect_pageindex",
36
+ "memory_distill",
37
+ "memory_distill_observations",
38
+ "memory_distill_route",
39
+ "memory_drift",
40
+ "memory_drift_audit",
41
+ "memory_enrich",
42
+ "memory_entities_get",
43
+ "memory_entities_search",
44
+ "memory_evaluate_promotion",
45
+ "memory_export",
46
+ "memory_feedback",
47
+ "memory_flush_pending",
48
+ "memory_freeze_list",
49
+ "memory_freeze_run",
50
+ "memory_generalize",
51
+ "memory_get_constraints",
52
+ "memory_get_user_profile",
53
+ "memory_harvest",
54
+ "memory_harvest_turn",
55
+ "memory_import",
56
+ "memory_import_transcript",
57
+ "memory_lifecycle",
58
+ "memory_lifecycle_status",
59
+ "memory_link",
60
+ "memory_loop_record",
61
+ "memory_loop_status",
62
+ "memory_loops",
63
+ "memory_mark_stale",
64
+ "memory_migrate",
65
+ "memory_negative_capture",
66
+ "memory_observe",
67
+ "memory_pageindex_import",
68
+ "memory_pageindex_index",
69
+ "memory_pageindex_search",
70
+ "memory_promote",
71
+ "memory_prompt_get",
72
+ "memory_prompt_list",
73
+ "memory_prompt_run",
74
+ "memory_ranked_retrieval",
75
+ "memory_read",
76
+ "memory_recall",
77
+ "memory_rehydrate",
78
+ "memory_reject",
79
+ "memory_resolve_conflict",
80
+ "memory_restore",
81
+ "memory_roi",
82
+ "memory_rollup",
83
+ "memory_search_transcripts",
84
+ "memory_set_constraints",
85
+ "memory_set_user_profile",
86
+ "memory_settings_get",
87
+ "memory_settings_set",
88
+ "memory_source_add",
89
+ "memory_source_list",
90
+ "memory_supersede",
91
+ "memory_trace",
92
+ "memory_tree_search",
93
+ "memory_validate",
94
+ "memory_verify",
95
+ "memory_verify_strict",
96
+ "memory_wiki_compile",
97
+ "memory_wiki_get",
98
+ "memory_wiki_search",
99
+ "muse_bug_clusters",
100
+ "muse_code_for_memory",
101
+ "muse_code_impact",
102
+ "muse_context",
103
+ "muse_health",
104
+ "muse_memory_for_code",
105
+ "muse_mesh_audit",
106
+ "muse_mesh_link",
107
+ "muse_mesh_query",
108
+ "muse_mesh_status",
109
+ "muse_pr_context",
110
+ "muse_profile_list",
111
+ "muse_reconcile_anchors",
112
+ "muse_sync_broadcast",
113
+ "muse_sync_ingest",
114
+ "muse_sync_pool",
115
+ "muse_sync_status",
116
+ "muse_tech_debt",
117
+ "muse_why",
118
+ "record_session",
119
+ "search"
120
+ ]
121
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musememory",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Autonomous, self-organizing cognitive memory system for AI agents and agency networks",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -15,12 +15,19 @@
15
15
  "site:build": "bun run --cwd apps/website build",
16
16
  "site:preview": "bun run --cwd apps/website preview",
17
17
  "site:showreel": "bun run --cwd apps/website scripts/build-showreel.ts",
18
+ "site:brand": "bun run --cwd apps/website brand",
19
+ "site:audit:a11y": "bun run --cwd apps/website scripts/audit-a11y.ts",
20
+ "site:audit:visual": "bun run --cwd apps/website scripts/audit-visual.ts",
18
21
  "build:gif": "bun run --cwd apps/website scripts/build-readme-gif.ts",
22
+ "claims:generate": "bun scripts/generate-claims.ts && bun scripts/generate-cli-reference.ts",
23
+ "claims:check": "bun scripts/generate-claims.ts --check",
24
+ "docs:check": "bun scripts/check-doc-links.ts",
19
25
  "test": "bun test",
20
26
  "typecheck": "tsc --noEmit",
21
27
  "validate": "bun run dist/index.js validate --dry-run",
22
28
  "start": "bun run dist/index.js mcp",
23
- "prepublishOnly": "bun run build && bun test"
29
+ "prepublishOnly": "bun run build && bun test",
30
+ "site:qa": "bun run --cwd apps/website scripts/qa-gate.ts"
24
31
  },
25
32
  "bin": {
26
33
  "memory": "dist/index.js",
@@ -31,6 +38,10 @@
31
38
  "skills",
32
39
  ".agents",
33
40
  "schema.json",
41
+ "claims.json",
42
+ "docs/agent-reference.md",
43
+ "docs/cli-reference.md",
44
+ "docs/mcp-tool-matrix.json",
34
45
  "README.md",
35
46
  "LICENSE",
36
47
  "package.json"
package/schema.json CHANGED
@@ -93,6 +93,7 @@
93
93
  "additionalProperties": false
94
94
  },
95
95
  "fingerprint": { "type": "string" },
96
+ "stale_embedder": { "type": "boolean" },
96
97
  "temporal_mode": { "type": "string", "enum": ["current", "historical", "timeless"] },
97
98
  "quality": { "type": "string", "enum": ["LOW", "MEDIUM", "HIGH", "VERIFIED", "CONFLICTED", "STALE"] },
98
99
  "utility": {