memtrace 0.7.25 → 0.8.1

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.
Files changed (64) hide show
  1. package/README.md +209 -287
  2. package/install.js +9 -6
  3. package/installer/package.json +1 -1
  4. package/installer/skills/commands/memtrace-api-topology.md +31 -34
  5. package/installer/skills/commands/memtrace-cochange.md +64 -33
  6. package/installer/skills/commands/memtrace-daily.md +73 -0
  7. package/installer/skills/commands/memtrace-decision-recall.md +91 -0
  8. package/installer/skills/commands/memtrace-evolution.md +121 -88
  9. package/installer/skills/commands/memtrace-fleet-publish-intent.md +18 -2
  10. package/installer/skills/commands/memtrace-fleet-record-episode.md +23 -2
  11. package/installer/skills/commands/memtrace-fleet-resolve.md +24 -1
  12. package/installer/skills/commands/memtrace-graph.md +59 -41
  13. package/installer/skills/commands/memtrace-impact.md +67 -19
  14. package/installer/skills/commands/memtrace-index.md +20 -3
  15. package/installer/skills/commands/memtrace-intent-verification.md +81 -0
  16. package/installer/skills/commands/memtrace-preflight.md +85 -0
  17. package/installer/skills/commands/memtrace-provenance.md +90 -0
  18. package/installer/skills/commands/memtrace-quality.md +49 -32
  19. package/installer/skills/commands/memtrace-relationships.md +73 -30
  20. package/installer/skills/commands/memtrace-search.md +86 -61
  21. package/installer/skills/workflows/memtrace-change-impact-analysis.md +32 -12
  22. package/installer/skills/workflows/memtrace-code-review.md +17 -11
  23. package/installer/skills/workflows/memtrace-codebase-exploration.md +41 -5
  24. package/installer/skills/workflows/memtrace-continuous-memory.md +54 -56
  25. package/installer/skills/workflows/memtrace-decision-memory.md +139 -0
  26. package/installer/skills/workflows/memtrace-episode-replay.md +87 -63
  27. package/installer/skills/workflows/memtrace-first.md +63 -7
  28. package/installer/skills/workflows/memtrace-fleet-coordination.md +21 -1
  29. package/installer/skills/workflows/memtrace-fleet-first.md +35 -5
  30. package/installer/skills/workflows/memtrace-incident-investigation.md +113 -55
  31. package/installer/skills/workflows/memtrace-refactoring-guide.md +31 -11
  32. package/installer/skills/workflows/memtrace-session-continuity.md +63 -49
  33. package/installer/skills/workflows/memtrace-style-fingerprint.md +27 -4
  34. package/package.json +7 -7
  35. package/skills/commands/memtrace-api-topology.md +31 -34
  36. package/skills/commands/memtrace-cochange.md +64 -33
  37. package/skills/commands/memtrace-daily.md +73 -0
  38. package/skills/commands/memtrace-decision-recall.md +91 -0
  39. package/skills/commands/memtrace-evolution.md +121 -88
  40. package/skills/commands/memtrace-fleet-publish-intent.md +18 -2
  41. package/skills/commands/memtrace-fleet-record-episode.md +23 -2
  42. package/skills/commands/memtrace-fleet-resolve.md +24 -1
  43. package/skills/commands/memtrace-graph.md +59 -41
  44. package/skills/commands/memtrace-impact.md +67 -19
  45. package/skills/commands/memtrace-index.md +20 -3
  46. package/skills/commands/memtrace-intent-verification.md +81 -0
  47. package/skills/commands/memtrace-preflight.md +85 -0
  48. package/skills/commands/memtrace-provenance.md +90 -0
  49. package/skills/commands/memtrace-quality.md +49 -32
  50. package/skills/commands/memtrace-relationships.md +73 -30
  51. package/skills/commands/memtrace-search.md +86 -61
  52. package/skills/workflows/memtrace-change-impact-analysis.md +32 -12
  53. package/skills/workflows/memtrace-code-review.md +17 -11
  54. package/skills/workflows/memtrace-codebase-exploration.md +41 -5
  55. package/skills/workflows/memtrace-continuous-memory.md +54 -56
  56. package/skills/workflows/memtrace-decision-memory.md +139 -0
  57. package/skills/workflows/memtrace-episode-replay.md +87 -63
  58. package/skills/workflows/memtrace-first.md +63 -7
  59. package/skills/workflows/memtrace-fleet-coordination.md +21 -1
  60. package/skills/workflows/memtrace-fleet-first.md +35 -5
  61. package/skills/workflows/memtrace-incident-investigation.md +113 -55
  62. package/skills/workflows/memtrace-refactoring-guide.md +31 -11
  63. package/skills/workflows/memtrace-session-continuity.md +63 -49
  64. package/skills/workflows/memtrace-style-fingerprint.md +27 -4
package/install.js CHANGED
@@ -114,15 +114,18 @@ function platformPackageName(key) {
114
114
  }
115
115
 
116
116
  // npm only restores the executable bit for files declared in the platform
117
- // package's `bin` map (`memtrace`). `memcore-server` is shipped alongside it
118
- // WITHOUT a bin entry, so if the published tarball carries mode 644 (the
119
- // v0.6.16/v0.6.17 releases did GitHub's artifact transfer strips modes),
120
- // `memtrace start` fails to spawn the sidecar with EACCES. Re-assert the bit
121
- // on every resolution so broken installs self-repair on the next run.
117
+ // package's `bin` map (`memtrace`). The sidecars — `memcore-server` (code graph)
118
+ // and, when bundled, `memcortex-daemon` + `memcortex-mcp` (Cortex decision
119
+ // memory) ship alongside it WITHOUT a bin entry, so if the published tarball
120
+ // carries mode 644 (the v0.6.16/v0.6.17 releases did GitHub's artifact
121
+ // transfer strips modes), `memtrace start` fails to spawn the sidecar with
122
+ // EACCES. Re-assert the bit on every resolution so broken installs self-repair
123
+ // on the next run. Names not present in a given release are skipped (existsSync),
124
+ // so listing the Cortex sidecars here is safe before they are bundled.
122
125
  function ensureExecutableBits(binaryPath) {
123
126
  if (os.platform() === "win32") return;
124
127
  const dir = path.dirname(binaryPath);
125
- for (const name of ["memtrace", "memcore-server"]) {
128
+ for (const name of ["memtrace", "memcore-server", "memcortex-daemon", "memcortex-mcp"]) {
126
129
  const candidate = path.join(dir, name);
127
130
  try {
128
131
  if (fs.existsSync(candidate)) fs.chmodSync(candidate, 0o755);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memtrace-skills",
3
- "version": "0.7.25",
3
+ "version": "0.8.1",
4
4
  "description": "Memtrace skills for AI coding agents — codebase exploration, temporal evolution, impact analysis, and more.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,65 +1,62 @@
1
1
  ---
2
2
  name: memtrace-api-topology
3
- description: "Always use for API endpoint, HTTP route, fetch/client call, REST surface, service dependency, cross-repo dependency, or API topology questions in source code. Do not use Grep, Glob, rg, find, or manual file search for routes or HTTP calls; Memtrace maps endpoints and call edges from the indexed AST graph."
3
+ description: "Map API endpoints, outbound HTTP calls, and cross-repo service topology in indexed source code. Use when the user asks about API endpoints, HTTP routes, fetch/client calls, REST surface, service dependencies, cross-repo dependencies, or API topology. Do not use Grep, Glob, rg, find, or manual file search for routes or HTTP calls; Memtrace maps endpoints and call edges from the indexed AST graph."
4
4
  allowed-tools:
5
5
  - mcp__memtrace__get_api_topology
6
6
  - mcp__memtrace__find_api_endpoints
7
7
  - mcp__memtrace__find_api_calls
8
8
  - mcp__memtrace__get_symbol_context
9
9
  - mcp__memtrace__link_repositories
10
+ metadata:
11
+ author: "Syncable <support@syncable.dev>"
12
+ version: "1.0.0"
13
+ category: development
10
14
  user-invocable: true
11
15
  ---
12
16
 
13
17
  ## Overview
14
18
 
15
- Map the HTTP API surface of a codebase exposed endpoints, outbound HTTP calls, and cross-repo service-to-service dependency graphs. Supports auto-detection for Express, Encore, NestJS, Axum, FastAPI, Flask, Gin, Spring Boot, and more.
19
+ Map HTTP API surface — endpoints, outbound calls, cross-repo topology.
16
20
 
17
21
  ## Quick Reference
18
22
 
19
- | Tool | Purpose |
20
- |------|---------|
21
- | `find_api_endpoints` | All exposed HTTP endpoints (GET /users, POST /orders, etc.) |
22
- | `find_api_calls` | All outbound HTTP calls (fetch, axios, reqwest, etc.) |
23
- | `get_api_topology` | Cross-repo call graph: which service calls which endpoint |
24
- | `link_repositories` | Manually link repos for cross-repo edge detection |
25
-
26
- > **Parameter types:** MCP parameters are strictly typed. Numbers (`limit`, `depth`, `min_size`, `last_n`, etc.) must be JSON numbers — not strings. Use `limit: 20`, never `limit: "20"`. Passing a string yields `MCP error -32602: invalid type: string, expected usize`.
23
+ | Tool | Required | Key optional |
24
+ |------|----------|--------------|
25
+ | `find_api_endpoints` | `repo_id` | `method`, `path_contains`, `limit`, `branch` |
26
+ | `find_api_calls` | `repo_id` | `method`, `path_contains`, `limit`, `branch` |
27
+ | `get_api_topology` | | `repo_id`, `min_confidence`, `include_external` |
27
28
 
29
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
28
30
 
29
31
  ## Steps
30
32
 
31
- ### 1. Discover endpoints
32
-
33
- Use `find_api_endpoints`:
34
- - `repo_id` — required
35
- - Returns: method, path, handler function, framework detected
36
-
37
- ### 2. Discover outbound calls
33
+ ### 1–3. Endpoints, calls, topology
38
34
 
39
- Use `find_api_calls`:
40
- - `repo_id` required
41
- - Returns: target URL/path, HTTP method, calling function, library used (fetch, axios, reqwest, etc.)
35
+ ```json
36
+ { "repo_id": "memdb" }
37
+ { "repo_id": "memdb", "method": "GET", "path_contains": "/users" }
38
+ { "min_confidence": 0.7 }
39
+ ```
42
40
 
43
- ### 3. Map service topology
41
+ ### 4. Deep-dive an endpoint handler
44
42
 
45
- Use `get_api_topology` to see the cross-repo HTTP call graph:
46
- - Which services call which endpoints
47
- - Confidence scores for each detected link
48
- - Service-to-service dependency direction
43
+ Use handler **symbol name** not symbol ID:
49
44
 
50
- **Prerequisite:** Multiple repos must be indexed. If cross-repo links aren't appearing, use `link_repositories` to explicitly connect them.
45
+ ```json
46
+ { "repo_id": "memdb", "symbol": "handleGetUsers" }
47
+ ```
51
48
 
52
- ### 4. Deep-dive into an endpoint
49
+ ## Output
53
50
 
54
- For any specific endpoint, use `get_symbol_context` with the endpoint's symbol ID to see:
55
- - Which internal functions handle the request
56
- - Which processes (execution flows) include this endpoint
57
- - Which external services call this endpoint
51
+ | Result | Carries |
52
+ |--------|---------|
53
+ | Endpoint entry (`find_api_endpoints`) | HTTP method, route path, handler symbol name (feed to `get_symbol_context` as `symbol`) |
54
+ | Call entry (`find_api_calls`) | HTTP method, target path, calling symbol |
55
+ | Topology edge (`get_api_topology`) | caller repo → handler repo, confidence 0.0–1.0 (edges below `min_confidence` dropped) |
58
56
 
59
57
  ## Common Mistakes
60
58
 
61
59
  | Mistake | Reality |
62
60
  |---------|---------|
63
- | Expecting cross-repo links with only one repo indexed | Index ALL related services first; cross-repo HTTP edges are linked automatically after indexing |
64
- | Missing endpoints from custom frameworks | Memtrace auto-detects major frameworks; for custom routers, the endpoints may appear as regular functions |
65
- | Not using `link_repositories` | If auto-linking missed a connection, use this to manually establish cross-repo edges |
61
+ | `get_symbol_context(symbol_id=...)` | Use **`symbol`** (name) + `repo_id` |
62
+ | Cross-repo links with one repo indexed | Index all services; use `link_repositories` if needed |
@@ -1,66 +1,93 @@
1
1
  ---
2
2
  name: memtrace-cochange
3
- description: "Always use for historical coupling, co-change, what changes with this, hidden dependency, or what else needs to move questions for source code. Do not use git log, git diff, Grep, or manual file search to correlate changes; Memtrace queries co-change and temporal graph data directly."
3
+ description: "Find files that historically co-change with a target symbol or file, ranked by co-occurrence across git episodes. Use when the user asks about historical coupling, co-change, what changes with this, hidden dependencies, or what else needs to move for source code. Do not use git log, git diff, Grep, or manual file search to correlate changes; Memtrace queries co-change and temporal graph data directly."
4
4
  allowed-tools:
5
5
  - mcp__memtrace__get_cochange_context
6
6
  - mcp__memtrace__find_symbol
7
7
  - mcp__memtrace__get_impact
8
+ - mcp__memtrace__replay_history
9
+ metadata:
10
+ author: "Syncable <support@syncable.dev>"
11
+ version: "1.0.0"
12
+ category: development
8
13
  user-invocable: true
9
14
  ---
10
15
 
11
16
  ## Overview
12
17
 
13
- Find symbols that historically co-change with a target symbol — ranked by co-occurrence frequency across all episodes. This surfaces **behavioral coupling** that the static call graph cannot see.
18
+ Find **files** that historically co-change with a target symbol or file path — ranked by co-occurrence frequency across git episodes. Surfaces **behavioral coupling** the static call graph cannot see.
14
19
 
15
20
  `get_impact` answers "who calls this?" (structural).
16
- `get_cochange_context` answers "what always moves when this moves?" (historical).
17
-
18
- They are complementary. A symbol with no direct callers can still have strong cochange partners if it's always modified alongside another in every commit.
21
+ `get_cochange_context` answers "what files always move when this moves?" (historical, file-level).
22
+
23
+ They are complementary. A file with no call-graph edges to the target can still be a strong cochange partner if it's always modified alongside it in every commit.
24
+
25
+ > **Parameter types:** Numbers (`limit`, `window_days`, etc.) must be JSON numbers — not strings.
26
+
27
+ ## Required parameters
28
+
29
+ | Parameter | Required | Default | Notes |
30
+ |---|---|---|---|
31
+ | `repo_id` | yes | — | |
32
+ | `target` | yes | — | Symbol name **or** file path substring — **not** `symbol` |
33
+ | `limit` | no | **10** | Max cochanged files returned |
34
+ | `window_days` | no | **30** | Lookback from `as_of` |
35
+ | `as_of` | no | now | Window anchor |
36
+ | `branch` | no | any branch | |
37
+
38
+ ```json
39
+ {
40
+ "repo_id": "memdb",
41
+ "target": "execute",
42
+ "limit": 10,
43
+ "window_days": 30
44
+ }
45
+ ```
19
46
 
20
- > **Parameter types:** MCP parameters are strictly typed. Numbers (`limit`, `depth`, `min_size`, `last_n`, etc.) must be JSON numbers — not strings. Use `limit: 20`, never `limit: "20"`. Passing a string yields `MCP error -32602: invalid type: string, expected usize`.
47
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
48
+
49
+ ## Output
50
+
51
+ ```json
52
+ {
53
+ "cochanged_files": [
54
+ {
55
+ "file_path": "src/order/types.rs",
56
+ "cochange_count": 8,
57
+ "last_cochanged_at": "2026-04-13T10:43:00Z"
58
+ }
59
+ ],
60
+ "target_files": ["src/order/service.rs"]
61
+ }
62
+ ```
21
63
 
64
+ There is **no** `cochanges[]` with symbol names — results are **file-level**.
22
65
 
23
66
  ## Steps
24
67
 
25
- ### 1. Identify the target symbol
68
+ ### 1. Identify the target
26
69
 
27
- Use `find_symbol` if you need the exact name. The tool matches by `name` field.
70
+ Use `find_symbol` if needed. Pass the symbol **`name`** or a **`file_path`** as `target`.
28
71
 
29
72
  ### 2. Call `get_cochange_context`
30
73
 
31
- ```
32
- get_cochange_context(
33
- repo_id: "...",
34
- symbol: "execute", // exact symbol name
35
- limit: 20 // default 20, increase for broader view
36
- )
37
- ```
74
+ See required parameters above.
38
75
 
39
76
  ### 3. Interpret results
40
77
 
41
- The response contains `cochanges[]`, each with:
42
- - `name` — symbol name
43
- - `kind` — Function / Method / Class / Struct
44
- - `file_path` — where it lives
45
- - `cochange_count` — how many episodes it shared with the target
46
-
47
- ```
48
- High cochange_count = strong historical coupling
49
- → If you modify the target, you will likely need to touch this too
50
- → Or it may be the real root cause you should investigate first
51
- ```
78
+ High `cochange_count` on a file → strong historical coupling. When you modify the target, review those files too — even without direct call-graph edges.
52
79
 
53
80
  ### 4. Cross-reference with call graph
54
81
 
55
- For the top cochange partners, optionally run `get_impact` to see if the coupling is also structural:
82
+ For symbols in cochanged files, optionally run `get_impact(target=...)`:
56
83
 
57
84
  | Structural coupling | Historical coupling | Interpretation |
58
85
  |---|---|---|
59
- | Yes | Yes | Core architectural dependency — highest risk |
60
- | No | Yes | Hidden coupling — only visible through history |
61
- | Yes | No | Called frequently but changed independently — lower risk |
86
+ | Yes | Yes | Core dependency — highest risk |
87
+ | No | Yes | Hidden coupling — history-only |
88
+ | Yes | No | Called often but changed independently |
62
89
 
63
- ## When to Use
90
+ ## Use Cases
64
91
 
65
92
  - **Before modifying a symbol** — get blast awareness beyond what `get_impact` shows
66
93
  - **Incident investigation** — when `get_impact` doesn't explain the blast radius, check cochange history
@@ -72,5 +99,9 @@ For the top cochange partners, optionally run `get_impact` to see if the couplin
72
99
  | Mistake | Reality |
73
100
  |---------|---------|
74
101
  | Only using `get_impact` for blast radius | Structural coupling misses behavioral coupling — always pair with cochange |
75
- | Ignoring low-`in_degree` cochange partners | A rarely-called utility with high cochange_count is a strong coupling signal |
76
- | Using cochange as a dependency map | It's not a dependency graph — it's a change correlation. Two symbols can cochange without any direct relationship. |
102
+ | Ignoring cochanged files with no call-graph edges | A rarely-called file with high `cochange_count` is a strong coupling signal |
103
+ | Using cochange as a dependency map | It's a change correlation, not a dependency graph — files can cochange without any direct relationship |
104
+ | Passing `symbol:` | Required param is **`target`** |
105
+ | Expecting `cochanges[]` with symbol names | Response is **`cochanged_files[]`** (file paths) |
106
+ | Using `limit: 20` as default | API default is **10** |
107
+ | Empty results with 0 git episodes | Run `replay_history` during indexing to populate co-change data |
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: memtrace-daily
3
+ description: "Orient at the start of a coding session, review what recently changed in a repository, and self-audit after completing work. Use when the user wants the daily briefing (what changed in the last 24h with complexity deltas), hotspots (complexity × churn refactor priorities), or a session review (clean/review/risky verdicts per editing session). For catching up after time away or resuming a prior session, use memtrace-session-continuity; daily is the last-24h briefing + hotspots + self-audit. Do not reconstruct recent activity from git log; Memtrace diffs the graph at save granularity."
4
+ allowed-tools:
5
+ - mcp__memtrace__get_daily_briefing
6
+ - mcp__memtrace__find_hotspots
7
+ - mcp__memtrace__review_agent_sessions
8
+ - mcp__memtrace__preflight_check
9
+ metadata:
10
+ author: "Syncable <support@syncable.dev>"
11
+ version: "1.0.0"
12
+ category: development
13
+ user-invocable: true
14
+ ---
15
+
16
+ ## Overview
17
+
18
+ Session bookends: orient before you start, audit before you finish. All
19
+ three tools read the bi-temporal version history — every save is a change
20
+ event with complexity deltas, so "what happened" includes "did it make the
21
+ code better or worse".
22
+
23
+ ## Quick Reference
24
+
25
+ | Tool | Purpose |
26
+ |------|---------|
27
+ | `get_daily_briefing` | Last 24h diffed at graph level: changed functions with complexity deltas, new functions, new endpoints, per-module distribution |
28
+ | `find_hotspots` | Functions ranked by complexity × recent changes — the ordered refactor priority list |
29
+ | `review_agent_sessions` | Editing sessions clustered by actor, judged clean / review / risky |
30
+
31
+ > **Parameter types:** MCP parameters are strictly typed. Numbers
32
+
33
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
34
+ > (`window_hours`, `window_days`, `top_n`) must be JSON numbers.
35
+
36
+ ## Steps
37
+
38
+ ### 1. Orient at session start
39
+
40
+ `get_daily_briefing` with `repo_id`. Read the summary first:
41
+ - `net_cyclomatic_delta` positive → recent work added complexity; check
42
+ whether your task touches the same area before piling on.
43
+ - `changed` rows with large positive deltas → recently-destabilised code;
44
+ prefer `preflight_check` before editing anything in that list.
45
+
46
+ ### 2. When the task is refactoring or cleanup
47
+
48
+ `find_hotspots` — work the list top-down. A hotspot you simplify pays off
49
+ on every future change; a complex-but-untouched function can wait.
50
+
51
+ ### 3. Self-audit before declaring work done
52
+
53
+ `review_agent_sessions` and find YOUR session (newest, your agent id):
54
+ - `clean` — done; state the verdict in your summary.
55
+ - `review` — re-read your top_changes rows; justify each complexity
56
+ increase or simplify it.
57
+ - `risky` — do not hand off yet. You added >30 net cyclomatic or touched
58
+ a >50-complexity function; extract helpers / flatten nesting first,
59
+ then re-run the review.
60
+
61
+ ## The standard a session should meet
62
+
63
+ Net complexity delta ≤ 0 unless the task genuinely required new branching
64
+ (new feature with new cases). "I left the code simpler than I found it"
65
+ is verifiable here — verify it.
66
+
67
+ ## Output
68
+
69
+ | Tool | Returns |
70
+ |------|---------|
71
+ | `get_daily_briefing` | summary with `net_cyclomatic_delta`; `changed` rows (function + complexity delta); new functions, new endpoints, per-module distribution |
72
+ | `find_hotspots` | ranked list of functions scored by complexity × recent changes |
73
+ | `review_agent_sessions` | per-session verdict (`clean` / `review` / `risky`) with `top_changes` rows and net cyclomatic delta |
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: memtrace-decision-recall
3
+ description: "Recall ranked decisions, bans, and conventions from Cortex decision memory by free-text query. Use when the user asks what was decided, what was chosen or rejected, whether there's a convention/ban/policy on something, or before re-picking a library, pattern, or approach that may already be settled. Do not reconstruct past decisions from git log or guesswork. To verify whether a known decision held, use memtrace-intent-verification; for symbol-scoped decision lineage/contracts, use memtrace-provenance."
4
+ allowed-tools:
5
+ - mcp__memtrace__recall_decision
6
+ - mcp__memtrace__verify_intent
7
+ - mcp__memtrace__get_arc
8
+ metadata:
9
+ author: "Syncable <support@syncable.dev>"
10
+ version: "1.0.0"
11
+ category: development
12
+ ---
13
+
14
+ ## Overview
15
+
16
+ `recall_decision` is the **free-text entry point** to decision memory. Given a query,
17
+ it returns the statistically-ranked set of decisions/conversations that bear on it —
18
+ including **bans** ("never use X", "don't do Y"), which are recorded as decisions.
19
+ Use it before re-litigating a settled choice or contradicting a convention.
20
+
21
+ This is the one decision-memory tool that takes plain text. The ranked decisions it
22
+ returns carry the `decision_id`s the other tools (`verify_intent`, `get_arc`) need.
23
+
24
+ Full parameter spec for every Memtrace tool: `references/mcp-parameters.md` (bundled at the memtrace-skills plugin root).
25
+
26
+ ## Quick Reference
27
+
28
+ | Tool | Purpose |
29
+ |------|---------|
30
+ | `recall_decision` | Ranked decisions/bans for a free-text query (the entry point) |
31
+ | `verify_intent` | Given a returned `decision_id` — did it still hold? (see `memtrace-intent-verification`) |
32
+ | `get_arc` | Given a returned `decision_id` — what implemented it? (see `memtrace-intent-verification`) |
33
+
34
+ > **Honesty contract:** an empty or unknown query returns an explicit **CannotProve**,
35
+ > never a fabricated decision. CannotProve means "no recorded decision on this" — it is
36
+ > *unknown*, not *approved*. Don't treat it as a green light.
37
+
38
+ ## Steps
39
+
40
+ ### 1. Query in the user's own terms
41
+
42
+ `recall_decision(query)` — `query` is free text. Use the noun phrase of the thing in
43
+ question: a library (`"redis vs in-memory cache"`), a pattern (`"error handling
44
+ strategy"`), a subsystem (`"auth tokens"`), or the exact thing you're about to do.
45
+
46
+ ### 2. Read the ranked result
47
+
48
+ Results come back ranked (lexical + semantic lanes, RRF-fused) with an `id`, a
49
+ `kind`, and a score per hit. **`decision`-kind hits are ranked first**; lower-ranked
50
+ `conversation` hits are supporting context (the verbatim turns around the decision).
51
+ For anything you mean to chain (step 4), use a hit whose `kind` is `decision` — its
52
+ `id` is the `decision_id` the other tools require.
53
+
54
+ ### 3. Act on what's there
55
+
56
+ | Result | Action |
57
+ |---|---|
58
+ | A matching decision | Honor it. Quote it back to the user before doing anything that contradicts it. |
59
+ | A **ban** ("never/don't …") | Do **not** reintroduce the banned approach without explicit user sign-off. |
60
+ | Several competing/old hits | Run `verify_intent(decision_id)` on the top one to see if it still holds before relying on it. |
61
+ | **CannotProve** | No recorded decision. Don't invent one — fall back to `memtrace-first` and/or ask the user. |
62
+
63
+ ### 4. Chain into the id-based tools when you need more
64
+
65
+ The `id` of a `kind: "decision"` hit feeds `verify_intent` (did it hold?) and
66
+ `get_arc` (what implemented it?). Don't pass a `conversation` hit's id — those tools
67
+ require a Decision node and will honestly return CannotProve. See
68
+ `memtrace-intent-verification`.
69
+
70
+ ## Decision Points
71
+
72
+ | Situation | Action |
73
+ |-----------|--------|
74
+ | About to choose a library/pattern/approach | `recall_decision` FIRST — you may be undoing a deliberate choice or ban |
75
+ | User asks "did we decide X?" / "what's our convention on Y?" | `recall_decision("X" / "Y")` |
76
+ | You suspect a "don't do this" rule exists | `recall_decision` — bans are decisions and will surface |
77
+ | Recall returns a decision you're about to contradict | Surface it to the user verbatim; don't silently override |
78
+ | Recall returns CannotProve | Treat as unknown, not approval; do not fabricate a rationale |
79
+
80
+ ## Output
81
+
82
+ `recall_decision` returns ranked hits — `kind: "decision"` first, `conversation` hits below as supporting context — or an explicit **CannotProve**:
83
+
84
+ ```json
85
+ [
86
+ { "id": "…", "kind": "decision", "score": 0.91 },
87
+ { "id": "…", "kind": "conversation", "score": 0.44 }
88
+ ]
89
+ ```
90
+
91
+ Only a `decision`-kind hit's `id` is a `decision_id` usable with `verify_intent` / `get_arc`. An empty or unknown query returns CannotProve, never fabricated hits.