@jmylchreest/aide-plugin 0.0.38 → 0.0.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmylchreest/aide-plugin",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "aide plugin for OpenCode — multi-agent orchestration, memory, skills, and persistence",
5
5
  "type": "module",
6
6
  "main": "./src/opencode/index.ts",
@@ -60,7 +60,21 @@ What functions are in src/auth.ts?
60
60
  → Returns: all functions, classes, types in that file
61
61
  ```
62
62
 
63
- ### 4. Check Index Status (`mcp__plugin_aide_aide__code_stats`)
63
+ ### 4. File Outline (`mcp__plugin_aide_aide__code_outline`)
64
+
65
+ Get a collapsed structural outline of a file — signatures preserved, bodies replaced with `{ ... }`.
66
+ Uses ~5-15% of the tokens of the full file. **Use this before reading a file** to understand its
67
+ structure, then use `Read` with offset/limit for specific sections.
68
+
69
+ **Example usage:**
70
+
71
+ ```
72
+ Outline src/auth.ts
73
+ → Uses code_outline tool
74
+ → Returns: collapsed view with signatures, line ranges, bodies collapsed
75
+ ```
76
+
77
+ ### 5. Check Index Status (`mcp__plugin_aide_aide__code_stats`)
64
78
 
65
79
  Check if the codebase has been indexed.
66
80
 
@@ -72,6 +86,18 @@ Is the code indexed?
72
86
  → Returns: file count, symbol count, reference count
73
87
  ```
74
88
 
89
+ ### 6. Search Findings (`mcp__plugin_aide_aide__findings_search`)
90
+
91
+ Search static analysis findings (complexity hotspots, secrets, code clones, coupling issues).
92
+
93
+ **Example usage:**
94
+
95
+ ```
96
+ Any complexity issues in src/auth?
97
+ → Uses findings_search tool with query "auth" or file filter
98
+ → Returns: findings with file, line, severity, description
99
+ ```
100
+
75
101
  ## Workflow
76
102
 
77
103
  1. **First, check if codebase is indexed:**
@@ -108,6 +134,20 @@ Is the code indexed?
108
134
  1. Use `code_references` with symbol "authenticateUser"
109
135
  2. Show all call sites grouped by file
110
136
 
137
+ ## What These Tools Cover
138
+
139
+ `code_search` and `code_references` work from the tree-sitter symbol index. They find:
140
+
141
+ - Function, method, class, interface, type definitions by name
142
+ - Symbol signatures (parameter types, return types)
143
+ - Doc comments attached to definitions
144
+ - Call sites for a specific symbol name (via `code_references`)
145
+
146
+ For anything else — patterns inside function bodies, method call chains, string literals,
147
+ SQL queries, imports, variable declarations — use **Grep**, which searches code content directly.
148
+
149
+ In short: `code_search` finds _where things are defined_; Grep finds _patterns in code content_.
150
+
111
151
  ## Notes
112
152
 
113
153
  - Code must be indexed first: `./.aide/bin/aide code index`
@@ -18,6 +18,7 @@ Systematic approach to identifying and fixing bugs.
18
18
  ## Prerequisites
19
19
 
20
20
  Before starting:
21
+
21
22
  - Get the exact error message or unexpected behavior description
22
23
  - Identify the entry point or trigger for the bug
23
24
  - Note any relevant environment details (Node version, OS, etc.)
@@ -36,12 +37,14 @@ node path/to/script.js
36
37
  ```
37
38
 
38
39
  Document:
40
+
39
41
  - Exact error message
40
42
  - Steps to trigger
41
43
  - Expected vs actual behavior
42
44
  - Is it consistent or intermittent?
43
45
 
44
46
  **If cannot reproduce:**
47
+
45
48
  - Check environment differences
46
49
  - Look for race conditions
47
50
  - Check for cached state
@@ -54,6 +57,9 @@ Use tools to find code related to the error:
54
57
  # Search for function mentioned in stack trace
55
58
  mcp__plugin_aide_aide__code_search query="functionName" kind="function"
56
59
 
60
+ # Get a structural overview of the suspect file (signatures + line ranges)
61
+ mcp__plugin_aide_aide__code_outline file="path/to/file.ts"
62
+
57
63
  # Get symbols in suspect file
58
64
  mcp__plugin_aide_aide__code_symbols file="path/to/file.ts"
59
65
 
@@ -65,23 +71,26 @@ Grep for "error message text"
65
71
 
66
72
  Follow the code flow from entry to error:
67
73
 
68
- 1. Start at the entry point (route handler, event listener, etc.)
69
- 2. Trace through each function call
70
- 3. Use `mcp__plugin_aide_aide__code_references` to find callers
71
- 4. Check type definitions with `mcp__plugin_aide_aide__code_search kind="interface"`
74
+ 1. Use `code_outline` on each file in the call chain to understand its structure
75
+ 2. Use `code_references` to find callers of the failing function
76
+ 3. Use `Read` with offset/limit to read specific functions in the execution path
77
+ (use line numbers from the outline)
78
+ 4. Check type definitions with `code_search kind="interface"`
79
+
80
+ Outlines help you identify which functions matter, so you can read just those sections.
72
81
 
73
82
  ### Step 4: Form Hypotheses
74
83
 
75
84
  Based on the error type, consider these causes:
76
85
 
77
- | Symptom | Likely Causes |
78
- |---------|---------------|
79
- | "undefined is not a function" | Variable is null/undefined, wrong import |
80
- | "Cannot read property of undefined" | Missing null check, async timing issue |
81
- | "Type error" | Type mismatch, wrong function signature |
82
- | "Maximum call stack" | Infinite recursion, circular reference |
83
- | "Network error" | Bad URL, CORS, timeout, server down |
84
- | "State not updating" | Mutation instead of new object, missing dependency |
86
+ | Symptom | Likely Causes |
87
+ | ----------------------------------- | -------------------------------------------------- |
88
+ | "undefined is not a function" | Variable is null/undefined, wrong import |
89
+ | "Cannot read property of undefined" | Missing null check, async timing issue |
90
+ | "Type error" | Type mismatch, wrong function signature |
91
+ | "Maximum call stack" | Infinite recursion, circular reference |
92
+ | "Network error" | Bad URL, CORS, timeout, server down |
93
+ | "State not updating" | Mutation instead of new object, missing dependency |
85
94
 
86
95
  ### Step 5: Validate Hypotheses
87
96
 
@@ -99,6 +108,7 @@ npm test -- --grep "test name"
99
108
  ```
100
109
 
101
110
  **Validation checklist:**
111
+
102
112
  - Check variable values at key points
103
113
  - Verify assumptions about input data
104
114
  - Test edge cases (null, empty, boundary values)
@@ -107,11 +117,13 @@ npm test -- --grep "test name"
107
117
  ### Step 6: Apply the Fix
108
118
 
109
119
  **Rules:**
120
+
110
121
  - Change only what's necessary to fix the bug
111
122
  - Don't refactor unrelated code
112
123
  - Match existing code patterns
113
124
 
114
125
  **Common fixes:**
126
+
115
127
  - Add null/undefined check
116
128
  - Fix type annotation
117
129
  - Correct async/await usage
@@ -132,24 +144,26 @@ npm test
132
144
  ```
133
145
 
134
146
  **Verification criteria:**
147
+
135
148
  - Original issue no longer occurs
136
149
  - Related tests still pass
137
150
  - No new errors introduced
138
151
 
139
152
  ## Failure Handling
140
153
 
141
- | Situation | Action |
142
- |-----------|--------|
143
- | Cannot reproduce | Check environment, add logging to narrow down |
144
- | Multiple bugs intertwined | Fix one at a time, verify after each |
145
- | Fix causes new failures | Revert, analyze dependencies, try different approach |
146
- | Root cause is in dependency | Check for updates, file issue, implement workaround |
147
- | Bug is in async code | Add proper await, check Promise chains |
154
+ | Situation | Action |
155
+ | --------------------------- | ---------------------------------------------------- |
156
+ | Cannot reproduce | Check environment, add logging to narrow down |
157
+ | Multiple bugs intertwined | Fix one at a time, verify after each |
158
+ | Fix causes new failures | Revert, analyze dependencies, try different approach |
159
+ | Root cause is in dependency | Check for updates, file issue, implement workaround |
160
+ | Bug is in async code | Add proper await, check Promise chains |
148
161
 
149
162
  ## MCP Tools
150
163
 
164
+ - `mcp__plugin_aide_aide__code_outline` - **Start here.** Get collapsed file skeleton to understand structure before reading
151
165
  - `mcp__plugin_aide_aide__code_search` - Find functions, classes, types involved in the bug
152
- - `mcp__plugin_aide_aide__code_symbols` - Understand file structure
166
+ - `mcp__plugin_aide_aide__code_symbols` - List all symbols in a file
153
167
  - `mcp__plugin_aide_aide__code_references` - Find all callers of a function
154
168
  - `mcp__plugin_aide_aide__memory_search` - Check for related past issues
155
169
 
@@ -159,24 +173,30 @@ npm test
159
173
  ## Debug Report: [Issue Title]
160
174
 
161
175
  ### Problem
176
+
162
177
  [What was happening vs what should happen]
163
178
 
164
179
  ### Reproduction
180
+
165
181
  [Steps to reproduce the issue]
166
182
 
167
183
  ### Root Cause
184
+
168
185
  [Identified cause with file:line reference]
169
186
  [Why the bug occurred]
170
187
 
171
188
  ### Fix Applied
189
+
172
190
  [What was changed and why]
173
191
 
174
192
  ### Verification
193
+
175
194
  - Original issue: FIXED
176
195
  - Related tests: PASS
177
196
  - Full suite: PASS
178
197
 
179
198
  ### Prevention
199
+
180
200
  [Optional: How to prevent similar bugs]
181
201
  ```
182
202
 
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: forget
3
+ description: Soft-delete memories by adding/removing the forget tag, or hard-delete outdated memories
4
+ triggers:
5
+ - forget this
6
+ - forget that
7
+ - forget memory
8
+ - remove memory
9
+ - delete memory
10
+ - outdated memory
11
+ - wrong memory
12
+ - incorrect memory
13
+ - supersede memory
14
+ - obsolete
15
+ - no longer true
16
+ - no longer relevant
17
+ - not true anymore
18
+ - that was wrong
19
+ - disregard
20
+ allowed-tools: Bash(./.aide/bin/aide memory *)
21
+ ---
22
+
23
+ # Forget
24
+
25
+ **Recommended model tier:** balanced (sonnet) - this skill performs straightforward operations
26
+
27
+ Manage outdated, incorrect, or obsolete memories by soft-deleting (tagging with `forget`) or hard-deleting them.
28
+
29
+ ## Key Concepts
30
+
31
+ ### Soft Delete (Preferred)
32
+
33
+ Memories tagged with `forget` are **excluded by default** from search, list, and context injection. They remain in the database and can be recovered.
34
+
35
+ ```bash
36
+ ./.aide/bin/aide memory tag <MEMORY_ID> --add=forget
37
+ ```
38
+
39
+ ### Hard Delete (Permanent)
40
+
41
+ Permanently removes a memory from the database. Use when the memory is clearly wrong or contains sensitive data.
42
+
43
+ ```bash
44
+ ./.aide/bin/aide memory delete <MEMORY_ID>
45
+ ```
46
+
47
+ ### Unforget (Recover)
48
+
49
+ Remove the `forget` tag to restore a soft-deleted memory.
50
+
51
+ ```bash
52
+ ./.aide/bin/aide memory tag <MEMORY_ID> --remove=forget
53
+ ```
54
+
55
+ ## Workflow
56
+
57
+ When the user wants to forget, correct, or supersede a memory:
58
+
59
+ ### Step 1: Find the Memory
60
+
61
+ Search for the memory to identify its ID:
62
+
63
+ ```bash
64
+ # Search by content keywords
65
+ ./.aide/bin/aide memory search "<keywords>" --full --limit=10
66
+
67
+ # If the memory might already be forgotten, include all
68
+ ./.aide/bin/aide memory list --all
69
+ ```
70
+
71
+ ### Step 2: Confirm with User
72
+
73
+ Before deleting or forgetting, show the user what was found and confirm which memories to act on. Display the memory ID, content, and tags.
74
+
75
+ ### Step 3: Apply the Appropriate Action
76
+
77
+ Choose based on the situation:
78
+
79
+ | Situation | Action | Command |
80
+ | ------------------------------------ | --------------------------------------- | -------------------------------------- |
81
+ | Memory is outdated but was once true | Soft delete (forget) | `aide memory tag <ID> --add=forget` |
82
+ | Memory is factually wrong | Hard delete | `aide memory delete <ID>` |
83
+ | Memory is resolved (issue fixed) | Soft delete + optionally add resolution | See "Superseding" below |
84
+ | Memory contains sensitive data | Hard delete | `aide memory delete <ID>` |
85
+ | Memory was accidentally forgotten | Unforget | `aide memory tag <ID> --remove=forget` |
86
+
87
+ ### Step 4: Optionally Add a Replacement
88
+
89
+ If the memory is being superseded (not just deleted), add a new corrected memory **without** the `forget` tag:
90
+
91
+ ```bash
92
+ # 1. Forget the old memory
93
+ ./.aide/bin/aide memory tag <OLD_ID> --add=forget
94
+
95
+ # 2. Add the corrected memory (NO forget tag)
96
+ ./.aide/bin/aide memory add --category=<category> --tags=<relevant,tags> "<corrected content>"
97
+ ```
98
+
99
+ ### Step 5: Verify
100
+
101
+ Confirm the memory is no longer visible in normal searches:
102
+
103
+ ```bash
104
+ # Should NOT appear in normal search
105
+ ./.aide/bin/aide memory search "<keywords>"
106
+
107
+ # Should appear with --all flag
108
+ ./.aide/bin/aide memory list --all
109
+ ```
110
+
111
+ ## Anti-Patterns (AVOID)
112
+
113
+ ### DO NOT add a new memory with the forget tag to "supersede" an old one
114
+
115
+ This is the most common mistake. Adding a new memory tagged `forget` does nothing useful:
116
+
117
+ - The new "superseding" memory is immediately hidden (because it has the `forget` tag)
118
+ - The original incorrect memory remains visible and active
119
+
120
+ **Wrong:**
121
+
122
+ ```bash
123
+ # BAD - creates a hidden memory, leaves the original untouched
124
+ aide memory add --tags="forget,some-topic" "RESOLVED: the old issue is fixed"
125
+ ```
126
+
127
+ **Correct:**
128
+
129
+ ```bash
130
+ # GOOD - forget the original, add a visible replacement
131
+ aide memory tag <ORIGINAL_ID> --add=forget
132
+ aide memory add --tags="some-topic" "RESOLVED: the old issue is fixed"
133
+ ```
134
+
135
+ ### DO NOT guess memory IDs
136
+
137
+ Always search first to find the exact memory ID. Memory IDs are ULIDs (e.g., `01KJ3X7GMQET613WMPT7JT8GYD`).
138
+
139
+ ### DO NOT forget memories without user confirmation
140
+
141
+ Always show the user what will be affected and get confirmation before acting, especially for hard deletes.
142
+
143
+ ## Batch Operations
144
+
145
+ To forget multiple related memories:
146
+
147
+ ```bash
148
+ # Search for all related memories
149
+ ./.aide/bin/aide memory search "<topic>" --full --limit=50
150
+
151
+ # Forget each one (after user confirmation)
152
+ ./.aide/bin/aide memory tag <ID1> --add=forget
153
+ ./.aide/bin/aide memory tag <ID2> --add=forget
154
+ ```
155
+
156
+ To clear ALL memories (destructive, requires explicit user request):
157
+
158
+ ```bash
159
+ ./.aide/bin/aide memory clear
160
+ ```
161
+
162
+ ## Examples
163
+
164
+ ### User says "that thing about ESM imports is wrong"
165
+
166
+ ```bash
167
+ # 1. Find the memory
168
+ ./.aide/bin/aide memory search "ESM imports" --full
169
+
170
+ # 2. Show user and confirm
171
+ # "Found memory 01KJ... about ESM imports requiring .js extensions. Delete this?"
172
+
173
+ # 3. Soft delete
174
+ ./.aide/bin/aide memory tag 01KJ3XVFXBFTKKH1M500N6R5 --add=forget
175
+ ```
176
+
177
+ ### User says "we changed from JWT to sessions, update the memory"
178
+
179
+ ```bash
180
+ # 1. Find the old memory
181
+ ./.aide/bin/aide memory search "JWT auth" --full
182
+
183
+ # 2. Forget the old one
184
+ ./.aide/bin/aide memory tag <OLD_ID> --add=forget
185
+
186
+ # 3. Add the corrected one
187
+ ./.aide/bin/aide memory add --category=decision --tags=auth,sessions,project:myapp "Auth strategy changed from JWT to server-side sessions with Redis store"
188
+ ```
189
+
190
+ ### User says "recover that forgotten memory about testing"
191
+
192
+ ```bash
193
+ # 1. Find forgotten memories
194
+ ./.aide/bin/aide memory list --all
195
+
196
+ # 2. Unforget it
197
+ ./.aide/bin/aide memory tag <ID> --remove=forget
198
+ ```
199
+
200
+ ## Failure Handling
201
+
202
+ If `aide memory tag` fails:
203
+
204
+ 1. **"memory not found"** - The ID may be wrong. Re-search with `--all` flag to include forgotten memories.
205
+ 2. **Panic/crash** - If the tag command panics, fall back to delete + re-add:
206
+ ```bash
207
+ # Workaround: get memory content, delete, re-add with forget tag
208
+ ./.aide/bin/aide memory list --all # Find the memory content
209
+ ./.aide/bin/aide memory delete <ID>
210
+ ./.aide/bin/aide memory add --category=<cat> --tags=<existing-tags>,forget "<content>"
211
+ ```
212
+ 3. **Database locked** - Another process may hold the lock. Wait and retry, or ensure the aide daemon is running (CLI routes through gRPC when daemon is active).
213
+
214
+ ## Verification
215
+
216
+ After forgetting a memory, verify:
217
+
218
+ ```bash
219
+ # Memory should NOT appear here
220
+ ./.aide/bin/aide memory search "<term>"
221
+
222
+ # Memory SHOULD appear here (with forget tag)
223
+ ./.aide/bin/aide memory list --all
224
+ ```
@@ -156,6 +156,16 @@ git worktree list | grep <worktree-path>
156
156
  git branch -a | grep <branch-name>
157
157
  ```
158
158
 
159
+ ## Change Context with Findings
160
+
161
+ When reviewing diffs or preparing commits, use findings tools to understand the quality context of changed code:
162
+
163
+ - `mcp__plugin_aide_aide__findings_search` — Search for known issues (complexity, secrets, clones) in changed files
164
+ - `mcp__plugin_aide_aide__findings_list` — List all findings for a specific file to understand its health
165
+ - `mcp__plugin_aide_aide__findings_stats` — Quick overview of finding counts across the project
166
+
167
+ This helps surface pre-existing issues in files you're touching, and can inform whether a commit should also address nearby problems.
168
+
159
169
  ## Parallel Work Pattern
160
170
 
161
171
  For swarm mode or parallel features:
@@ -51,10 +51,19 @@ Understand what the tests expect:
51
51
  - What edge cases are covered?
52
52
 
53
53
  ```bash
54
- # Read the test file
54
+ # For large test files, get the structure first
55
+ mcp__plugin_aide_aide__code_outline file="path/to/feature.test.ts"
56
+
57
+ # Then read specific test sections with offset/limit
58
+ Read path/to/feature.test.ts offset=<start> limit=<count>
59
+
60
+ # For small test files (<100 lines), reading the full file is fine
55
61
  Read path/to/feature.test.ts
56
62
  ```
57
63
 
64
+ When implementing, use `code_outline` on adjacent/related source files to understand
65
+ their structure before reading them fully. This preserves context for the implementation work.
66
+
58
67
  ### Step 3: Check Design Decisions
59
68
 
60
69
  Use `mcp__plugin_aide_aide__decision_get` with the feature topic to review decisions from DESIGN stage.
@@ -52,25 +52,31 @@ Use the `./.aide/bin/aide memory add` CLI command via Bash:
52
52
  ### Simple preference (global - injected at session start)
53
53
 
54
54
  ```bash
55
- ./.aide/bin/aide memory add --category=learning --tags=preferences,colour,scope:global "User's favourite colour is blue"
55
+ ./.aide/bin/aide memory add --category=learning --tags=preferences,colour,scope:global,source:user "User's favourite colour is blue"
56
56
  ```
57
57
 
58
- ### Technical learning (project-specific)
58
+ ### Technical learning (project-specific, verified)
59
59
 
60
60
  ```bash
61
- ./.aide/bin/aide memory add --category=learning --tags=testing,vitest,project:myapp,session:abc12345 "Vitest requires .js extensions for ESM imports even for .ts files. Configure moduleResolution: NodeNext in tsconfig."
61
+ ./.aide/bin/aide memory add --category=learning --tags=testing,vitest,project:myapp,session:abc12345,source:discovered,verified:true "Vitest requires .js extensions for ESM imports even for .ts files. Configure moduleResolution: NodeNext in tsconfig."
62
62
  ```
63
63
 
64
64
  ### Session summary
65
65
 
66
66
  ```bash
67
- ./.aide/bin/aide memory add --category=session --tags=auth,api,project:myapp,session:abc12345 "Implemented JWT auth with 15min access tokens, 7day refresh tokens in httpOnly cookies. Files: src/auth/jwt.ts, src/middleware/auth.ts, src/routes/auth.ts"
67
+ ./.aide/bin/aide memory add --category=session --tags=auth,api,project:myapp,session:abc12345,source:discovered "Implemented JWT auth with 15min access tokens, 7day refresh tokens in httpOnly cookies. Files: src/auth/jwt.ts, src/middleware/auth.ts, src/routes/auth.ts"
68
68
  ```
69
69
 
70
70
  ### Gotcha (global - applies everywhere)
71
71
 
72
72
  ```bash
73
- ./.aide/bin/aide memory add --category=gotcha --tags=hooks,claude-code,scope:global "Hooks must not write to stderr - Claude Code interprets any stderr as error. Debug logging must go to files only."
73
+ ./.aide/bin/aide memory add --category=gotcha --tags=hooks,claude-code,scope:global,source:discovered,verified:true "Hooks must not write to stderr - Claude Code interprets any stderr as error. Debug logging must go to files only."
74
+ ```
75
+
76
+ ### Unverified external claim
77
+
78
+ ```bash
79
+ ./.aide/bin/aide memory add --category=learning --tags=api,stripe,project:myapp,source:user,verified:false "Stripe webhook signatures use HMAC-SHA256 with the whsec_ prefix."
74
80
  ```
75
81
 
76
82
  ## Instructions
@@ -78,18 +84,90 @@ Use the `./.aide/bin/aide memory add` CLI command via Bash:
78
84
  When the user invokes `/aide:memorise <something>`:
79
85
 
80
86
  1. Parse what they want to remember
81
- 2. Determine the scope:
87
+ 2. **Verify factual claims before storing** (see [Verification Before Storage](#verification-before-storage-anti-poison) below)
88
+ 3. Determine the scope:
82
89
  - **User preference** (colour, style, etc.) → add `scope:global`
83
90
  - **Project-specific learning** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
84
91
  - **Session summary** → add `project:<project-name>,session:${CLAUDE_SESSION_ID:0:8}`
85
- 3. Choose appropriate category and descriptive tags
86
- 4. Format the content concisely but completely
87
- 5. Call `./.aide/bin/aide memory add` via Bash to store it
88
- 6. **Verify success** - check exit code is 0 and output contains the memory ID
89
- 7. Confirm what was stored
92
+ 4. Choose appropriate category and descriptive tags
93
+ 5. **Add provenance tags** (see [Provenance Tags](#provenance-tags) below)
94
+ 6. Format the content concisely but completely
95
+ 7. Call `./.aide/bin/aide memory add` via Bash to store it
96
+ 8. **Verify success** - check exit code is 0 and output contains the memory ID
97
+ 9. Confirm what was stored, including verification outcome
90
98
 
91
99
  Keep content concise - aim for 1-3 sentences unless it's a complex session summary.
92
100
 
101
+ ## Verification Before Storage (Anti-Poison)
102
+
103
+ Memories persist across sessions and influence future behaviour. Storing incorrect information is **worse than storing nothing** — it creates compounding errors. Before storing any memory, verify its claims.
104
+
105
+ ### What to Verify
106
+
107
+ | Claim Type | Verification Method | Example |
108
+ | ------------------------- | ----------------------------------------------------- | ---------------------------------------------- |
109
+ | **File exists** | Use Glob or Read to confirm | "Config is in src/config.ts" |
110
+ | **Function/class exists** | Use Grep or code search | "Use `parseToken()` from auth.ts" |
111
+ | **Function signature** | Read the file, check the actual signature | "parseToken takes a string and returns Claims" |
112
+ | **API behaviour** | Check the implementation or tests | "The /users endpoint requires auth" |
113
+ | **Dependency/version** | Check package.json, go.mod, etc. | "Project uses Vitest v2" |
114
+ | **Build/test command** | Confirm the script exists in package.json or Makefile | "Run `npm run test:e2e` for integration tests" |
115
+
116
+ ### What Does NOT Need Verification
117
+
118
+ - **User preferences** — The user is the authority ("I prefer tabs over spaces")
119
+ - **Session summaries** — Recap of what just happened in the current session
120
+ - **Opinions/decisions** — Architectural choices made by the user ("We chose Postgres")
121
+ - **External facts** — Things not checkable against the codebase ("React 19 uses...")
122
+
123
+ ### Verification Workflow
124
+
125
+ ```
126
+ Is it a codebase claim (file, function, path, command, behaviour)?
127
+ ├── No → Store directly with source:user or source:stated
128
+ └── Yes → Can you verify it right now?
129
+ ├── Yes → Verify it
130
+ │ ├── Correct → Store with verified:true
131
+ │ └── Wrong → Inform user, do NOT store. Offer corrected version.
132
+ └── No (e.g., external service, runtime behaviour)
133
+ → Store with verified:false, note unverified
134
+ ```
135
+
136
+ ### Verification Rules
137
+
138
+ 1. **NEVER store a codebase claim without checking** — If the user says "the auth middleware is in src/middleware/auth.ts", confirm the file exists before memorising.
139
+ 2. **If verification fails, do NOT store** — Tell the user what you found instead and offer to store the corrected version.
140
+ 3. **If you cannot verify** (e.g., claim about runtime behaviour, external API), store it but tag with `verified:false`.
141
+ 4. **Err on the side of not storing** — A missing memory is recoverable; a wrong memory causes future errors.
142
+
143
+ ### Example: Verified vs Rejected
144
+
145
+ **User says:** "Remember that the database schema is defined in db/schema.sql"
146
+
147
+ **Verification steps:**
148
+
149
+ 1. Check: does `db/schema.sql` exist? → Use Glob to search
150
+ 2. If yes → Store with `verified:true`
151
+ 3. If no → "I checked and `db/schema.sql` doesn't exist. I found `database/migrations/` instead. Would you like me to store that instead?"
152
+
153
+ ## Provenance Tags
154
+
155
+ Always include provenance tags to track the origin and verification status of memories:
156
+
157
+ | Tag | Meaning | When to Use |
158
+ | ------------------- | ---------------------------------------- | ------------------------------------------------ |
159
+ | `source:user` | User explicitly stated this | User preferences, direct instructions |
160
+ | `source:discovered` | Agent discovered this by examining code | File paths, function signatures, patterns found |
161
+ | `source:inferred` | Agent inferred this from context | Behaviour deduced from code, not directly stated |
162
+ | `verified:true` | Codebase claim was checked and confirmed | After successful verification |
163
+ | `verified:false` | Claim could not be verified against code | External facts, runtime behaviour |
164
+
165
+ ### Provenance Rules
166
+
167
+ - Every memory MUST have exactly one `source:` tag
168
+ - Codebase claims MUST have a `verified:` tag
169
+ - User preferences and opinions do NOT need `verified:` tags (user is authoritative)
170
+
93
171
  ## Failure Handling
94
172
 
95
173
  If `./.aide/bin/aide memory add` fails: