odab-note 0.1.0__tar.gz
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.
- odab_note-0.1.0/.github/FUNDING.yml +1 -0
- odab_note-0.1.0/.gitignore +14 -0
- odab_note-0.1.0/PKG-INFO +339 -0
- odab_note-0.1.0/README.md +329 -0
- odab_note-0.1.0/SKILL.md +110 -0
- odab_note-0.1.0/docs/01_/352/270/260/355/232/215/PRD.md +54 -0
- odab_note-0.1.0/docs/01_/352/270/260/355/232/215/tier_matrix.md +47 -0
- odab_note-0.1.0/docs/02_/354/204/244/352/263/204/WBS.md +61 -0
- odab_note-0.1.0/docs/founder_operating_philosophy.md +43 -0
- odab_note-0.1.0/pyproject.toml +24 -0
- odab_note-0.1.0/src/odab_note/__init__.py +1 -0
- odab_note-0.1.0/src/odab_note/cli.py +193 -0
- odab_note-0.1.0/src/odab_note/database.py +298 -0
- odab_note-0.1.0/src/odab_note/server.py +218 -0
- odab_note-0.1.0/tests/buggy_script.py +8 -0
- odab_note-0.1.0/tests/test_mcp.py +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: hacker3699-max
|
odab_note-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: odab-note
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Wrong-answer vaccine system for AI agents — learns error patterns and prevents repeated mistakes via MCP
|
|
5
|
+
Author-email: Logan Lee <logan@logans.company>
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: click>=8.0.0
|
|
8
|
+
Requires-Dist: mcp>=0.1.0
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# OdabNote — Wrong-Answer Vaccine System for AI Agents
|
|
12
|
+
|
|
13
|
+
[](https://github.com/sponsors/hacker3699-max)
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
|
|
16
|
+
> **Teach AI agents to never repeat the same coding mistake twice.**
|
|
17
|
+
|
|
18
|
+
OdabNote is a local MCP (Model Context Protocol) server that captures error patterns, stores verified solutions, and automatically matches future errors against its database — acting as an immune system for AI coding agents.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Why OdabNote?
|
|
23
|
+
|
|
24
|
+
AI coding agents (Claude Code, Codex, Cursor, Gemini, etc.) repeatedly make the same mistakes across sessions. They forget what went wrong last time. OdabNote solves this by:
|
|
25
|
+
|
|
26
|
+
1. **Recording** error patterns with their verified fixes
|
|
27
|
+
2. **Matching** new errors against the database in real-time
|
|
28
|
+
3. **Preventing** the same mistake from happening again
|
|
29
|
+
4. **Tracking** which AI models make which mistakes (model-specific blacklists)
|
|
30
|
+
5. **Decaying** outdated patterns so the knowledge stays fresh
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### Prerequisites
|
|
37
|
+
|
|
38
|
+
- Python 3.10+
|
|
39
|
+
- pip
|
|
40
|
+
|
|
41
|
+
### Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git clone https://github.com/hacker3699-max/OdabNote.git
|
|
45
|
+
cd OdabNote
|
|
46
|
+
python3 -m venv .venv
|
|
47
|
+
.venv/bin/pip install -e .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Verify Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
.venv/bin/odab --help
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Expected output:
|
|
57
|
+
```
|
|
58
|
+
Usage: odab [OPTIONS] COMMAND [ARGS]...
|
|
59
|
+
|
|
60
|
+
OdabNote CLI - Manage wrong-answer notes for AI Agents.
|
|
61
|
+
|
|
62
|
+
Commands:
|
|
63
|
+
add Add a new wrong-answer note manually (auto-verified).
|
|
64
|
+
approve Approve a wrong-answer note (Veto Pass).
|
|
65
|
+
decay Manually apply time-decay to decrease weights of obsolete notes.
|
|
66
|
+
delete Delete a wrong-answer note.
|
|
67
|
+
graph Visualize relations and conflicts of wrong-answer notes.
|
|
68
|
+
link Link two notes with relation (triggers or conflict).
|
|
69
|
+
list List all wrong-answer notes.
|
|
70
|
+
resolve Interactively resolve conflict between Note A and Note B.
|
|
71
|
+
run-server Run the OdabNote MCP server.
|
|
72
|
+
show Show details of a specific wrong-answer note.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Usage Guide
|
|
78
|
+
|
|
79
|
+
### How It Works (Natural Language)
|
|
80
|
+
|
|
81
|
+
You don't need to type CLI commands. Just talk to your AI agent in natural language.
|
|
82
|
+
|
|
83
|
+
**Step 1 — Agent makes a mistake. You say: `오답 넣어` or `odab pull`**
|
|
84
|
+
|
|
85
|
+
> You asked the agent to modify `config.yaml`, but it created a new `config_new.yaml` instead.
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
You: Why did you create a new file? I said modify the existing one. odab pull
|
|
89
|
+
|
|
90
|
+
Agent: ✅ Recorded (ID: 13, Model: claude-opus-4.6)
|
|
91
|
+
Keyword: Created_New_File_Instead_Modifying
|
|
92
|
+
Mistake: User asked to modify existing file but agent created a new file instead
|
|
93
|
+
Fix: When user says 'modify', always edit the existing file in place.
|
|
94
|
+
Never create a new file unless explicitly asked.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Step 2 — Not happy with the note? Say: `오답 수정` or `odab fix`**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
You: odab fix I meant you should always back up config files before editing them
|
|
101
|
+
|
|
102
|
+
Agent: 📝 Revised note (ID: 13)
|
|
103
|
+
Keyword: Config_File_Backup_First
|
|
104
|
+
Mistake: Modified config file without creating a backup first
|
|
105
|
+
Fix: Always create a backup copy before modifying any config file
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Step 3 — Want to remove it entirely? Say: `오답 삭제` or `odab del`**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
You: odab del
|
|
112
|
+
|
|
113
|
+
Agent: 🗑️ Deleted note (ID: 13)
|
|
114
|
+
Keyword: Config_File_Backup_First
|
|
115
|
+
Was: Modified config file without creating a backup first
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**That's it.** Three phrases to remember:
|
|
119
|
+
|
|
120
|
+
| Korean | English | What it does |
|
|
121
|
+
|--------|---------|-------------|
|
|
122
|
+
| `오답 넣어` | `odab pull` | Record the last mistake |
|
|
123
|
+
| `오답 수정` | `odab fix` | Revise the note |
|
|
124
|
+
| `오답 삭제` | `odab del` | Delete the note |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### CLI Reference
|
|
129
|
+
|
|
130
|
+
#### 1. Record a Mistake
|
|
131
|
+
|
|
132
|
+
When you encounter an error and fix it, record it:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
odab add \
|
|
136
|
+
-k "ZeroDivisionPrevention" \
|
|
137
|
+
-e "ZeroDivisionError: division by zero" \
|
|
138
|
+
-f "Check if denominator == 0 before dividing and return a safe default value" \
|
|
139
|
+
-m "all"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
| Flag | Description |
|
|
143
|
+
|------|-------------|
|
|
144
|
+
| `-k` | Keyword name for this mistake (unique identifier) |
|
|
145
|
+
| `-e` | Error pattern (supports regex) |
|
|
146
|
+
| `-f` | The correct fix / solution |
|
|
147
|
+
| `-m` | Target model (`all`, `gemini-3.5-flash`, `claude-3.5-sonnet`, etc.) |
|
|
148
|
+
|
|
149
|
+
### 2. List All Mistakes
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
odab list
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
ID | Keyword | Model | Count | Verified | Error Pattern
|
|
157
|
+
-----------------------------------------------------------------------------------------------
|
|
158
|
+
1 | ZeroDivisionPrev... | all | 1 | Yes | ZeroDivisionError: division by...
|
|
159
|
+
2 | Surface_Only_Fix | gemini-3.5-flash | 1 | Yes | Fixed surface only, left old refs...
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 3. View Details
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
odab show 1
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 4. Visualize Relations
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
odab graph
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
[ Odab-Note Dependency & Conflict Graph 🕸️ ]
|
|
176
|
+
|
|
177
|
+
● [ID: 1] ZeroDivisionPrevention (Count: 1, Verified: ✓)
|
|
178
|
+
└── (No active relations)
|
|
179
|
+
|
|
180
|
+
● [ID: 2] Surface_Only_Fix (Count: 1, Verified: ✓)
|
|
181
|
+
└── 🔗 [Triggers] -> [ID: 3] No_Full_Audit_Before_Done
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 5. Link Related Mistakes
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
odab link 2 3 --type triggers
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 6. Resolve Conflicts
|
|
191
|
+
|
|
192
|
+
When two notes contradict each other:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
odab resolve 1 2 --solution-c "Merged solution that combines both approaches"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 7. Apply Time Decay
|
|
199
|
+
|
|
200
|
+
Decrease weight of notes not triggered in N days:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
odab decay --days 30
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## MCP Server Integration
|
|
209
|
+
|
|
210
|
+
### For Gemini (Antigravity)
|
|
211
|
+
|
|
212
|
+
Add to `~/.gemini/antigravity/mcp_config.json`:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"odab-note": {
|
|
217
|
+
"command": "/path/to/OdabNote/.venv/bin/python",
|
|
218
|
+
"args": ["-m", "odab_note.server"],
|
|
219
|
+
"env": {
|
|
220
|
+
"PYTHONPATH": "/path/to/OdabNote/src"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### For Claude Code / Cursor / Cline
|
|
227
|
+
|
|
228
|
+
Add to your MCP settings (e.g. `.cursor/mcp.json` or `claude_desktop_config.json`):
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"mcpServers": {
|
|
233
|
+
"odab-note": {
|
|
234
|
+
"command": "/path/to/OdabNote/.venv/bin/python",
|
|
235
|
+
"args": ["-m", "odab_note.server"],
|
|
236
|
+
"env": {
|
|
237
|
+
"PYTHONPATH": "/path/to/OdabNote/src"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Available MCP Tools
|
|
245
|
+
|
|
246
|
+
| Tool | Description |
|
|
247
|
+
|------|-------------|
|
|
248
|
+
| `query_notes(keywords)` | Search past mistakes by keyword before starting work |
|
|
249
|
+
| `match_error_trace(error_trace, target_model)` | Match a stack trace against the database to find a known fix |
|
|
250
|
+
| `record_mistake(keyword, error_pattern, solution, target_model)` | Record a new mistake with its solution |
|
|
251
|
+
| `propose_conflict_resolution(note_id_a, note_id_b, proposed_solution_c)` | Propose resolution for conflicting notes |
|
|
252
|
+
| `resolve_conflict_merge(keep_id, delete_id, merged_solution, merged_keyword)` | Execute a conflict merge |
|
|
253
|
+
| `register_skill(name, cmd, desc)` | Save a verified workflow command for reuse |
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Testing
|
|
258
|
+
|
|
259
|
+
### Run the E2E Verification Script
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
cd OdabNote
|
|
263
|
+
.venv/bin/python tests/test_mcp.py
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Expected output:
|
|
267
|
+
```
|
|
268
|
+
🔍 [TEST 1] Query Notes with keyword 'SMC'...
|
|
269
|
+
Result:
|
|
270
|
+
Found 2 wrong-answer notes:
|
|
271
|
+
...
|
|
272
|
+
|
|
273
|
+
🔍 [TEST 2] Match Error Trace for SMC Timeout...
|
|
274
|
+
Result:
|
|
275
|
+
Found 1 matching wrong-answer notes:
|
|
276
|
+
...
|
|
277
|
+
|
|
278
|
+
🔍 [TEST 3] Match ZeroDivisionError Trace...
|
|
279
|
+
Result:
|
|
280
|
+
Found 1 matching wrong-answer notes:
|
|
281
|
+
- Target Keyword: ZeroDivisionPrevention
|
|
282
|
+
- Correct Solution: Check if denominator == 0 before dividing...
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Manual End-to-End Test
|
|
286
|
+
|
|
287
|
+
1. **Create a bug:**
|
|
288
|
+
```bash
|
|
289
|
+
echo 'print(1/0)' > /tmp/bad.py
|
|
290
|
+
python3 /tmp/bad.py # ZeroDivisionError
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
2. **Record it:**
|
|
294
|
+
```bash
|
|
295
|
+
odab add -k "DivByZero" -e "ZeroDivisionError" -f "Guard with if x != 0" -m "all"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
3. **Verify it matches:**
|
|
299
|
+
```bash
|
|
300
|
+
.venv/bin/python -c "
|
|
301
|
+
from odab_note.server import match_error_trace
|
|
302
|
+
print(match_error_trace('ZeroDivisionError: division by zero'))
|
|
303
|
+
"
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
4. **Confirm the vaccine is prescribed** — the output should show the fix you recorded.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Project Structure
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
OdabNote/
|
|
314
|
+
├── src/odab_note/
|
|
315
|
+
│ ├── __init__.py
|
|
316
|
+
│ ├── server.py # FastMCP server with 6 tools
|
|
317
|
+
│ ├── database.py # SQLite DB with regex matching, decay, relations
|
|
318
|
+
│ └── cli.py # Click CLI with 10 subcommands
|
|
319
|
+
├── tests/
|
|
320
|
+
│ ├── test_mcp.py # E2E MCP tool verification
|
|
321
|
+
│ └── buggy_script.py # Intentional bug for testing
|
|
322
|
+
├── docs/ # PRD, philosophy, tier matrix
|
|
323
|
+
├── SKILL.md # Agent instruction file (for Claude Code, Codex, etc.)
|
|
324
|
+
├── pyproject.toml
|
|
325
|
+
└── README.md
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Database Location
|
|
329
|
+
|
|
330
|
+
The SQLite database is stored at:
|
|
331
|
+
```
|
|
332
|
+
~/.gemini/antigravity/odab_note.db
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## License
|
|
338
|
+
|
|
339
|
+
© Logan's Company. All rights reserved.
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# OdabNote — Wrong-Answer Vaccine System for AI Agents
|
|
2
|
+
|
|
3
|
+
[](https://github.com/sponsors/hacker3699-max)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
> **Teach AI agents to never repeat the same coding mistake twice.**
|
|
7
|
+
|
|
8
|
+
OdabNote is a local MCP (Model Context Protocol) server that captures error patterns, stores verified solutions, and automatically matches future errors against its database — acting as an immune system for AI coding agents.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Why OdabNote?
|
|
13
|
+
|
|
14
|
+
AI coding agents (Claude Code, Codex, Cursor, Gemini, etc.) repeatedly make the same mistakes across sessions. They forget what went wrong last time. OdabNote solves this by:
|
|
15
|
+
|
|
16
|
+
1. **Recording** error patterns with their verified fixes
|
|
17
|
+
2. **Matching** new errors against the database in real-time
|
|
18
|
+
3. **Preventing** the same mistake from happening again
|
|
19
|
+
4. **Tracking** which AI models make which mistakes (model-specific blacklists)
|
|
20
|
+
5. **Decaying** outdated patterns so the knowledge stays fresh
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
### Prerequisites
|
|
27
|
+
|
|
28
|
+
- Python 3.10+
|
|
29
|
+
- pip
|
|
30
|
+
|
|
31
|
+
### Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/hacker3699-max/OdabNote.git
|
|
35
|
+
cd OdabNote
|
|
36
|
+
python3 -m venv .venv
|
|
37
|
+
.venv/bin/pip install -e .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Verify Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
.venv/bin/odab --help
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Expected output:
|
|
47
|
+
```
|
|
48
|
+
Usage: odab [OPTIONS] COMMAND [ARGS]...
|
|
49
|
+
|
|
50
|
+
OdabNote CLI - Manage wrong-answer notes for AI Agents.
|
|
51
|
+
|
|
52
|
+
Commands:
|
|
53
|
+
add Add a new wrong-answer note manually (auto-verified).
|
|
54
|
+
approve Approve a wrong-answer note (Veto Pass).
|
|
55
|
+
decay Manually apply time-decay to decrease weights of obsolete notes.
|
|
56
|
+
delete Delete a wrong-answer note.
|
|
57
|
+
graph Visualize relations and conflicts of wrong-answer notes.
|
|
58
|
+
link Link two notes with relation (triggers or conflict).
|
|
59
|
+
list List all wrong-answer notes.
|
|
60
|
+
resolve Interactively resolve conflict between Note A and Note B.
|
|
61
|
+
run-server Run the OdabNote MCP server.
|
|
62
|
+
show Show details of a specific wrong-answer note.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Usage Guide
|
|
68
|
+
|
|
69
|
+
### How It Works (Natural Language)
|
|
70
|
+
|
|
71
|
+
You don't need to type CLI commands. Just talk to your AI agent in natural language.
|
|
72
|
+
|
|
73
|
+
**Step 1 — Agent makes a mistake. You say: `오답 넣어` or `odab pull`**
|
|
74
|
+
|
|
75
|
+
> You asked the agent to modify `config.yaml`, but it created a new `config_new.yaml` instead.
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
You: Why did you create a new file? I said modify the existing one. odab pull
|
|
79
|
+
|
|
80
|
+
Agent: ✅ Recorded (ID: 13, Model: claude-opus-4.6)
|
|
81
|
+
Keyword: Created_New_File_Instead_Modifying
|
|
82
|
+
Mistake: User asked to modify existing file but agent created a new file instead
|
|
83
|
+
Fix: When user says 'modify', always edit the existing file in place.
|
|
84
|
+
Never create a new file unless explicitly asked.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Step 2 — Not happy with the note? Say: `오답 수정` or `odab fix`**
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
You: odab fix I meant you should always back up config files before editing them
|
|
91
|
+
|
|
92
|
+
Agent: 📝 Revised note (ID: 13)
|
|
93
|
+
Keyword: Config_File_Backup_First
|
|
94
|
+
Mistake: Modified config file without creating a backup first
|
|
95
|
+
Fix: Always create a backup copy before modifying any config file
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Step 3 — Want to remove it entirely? Say: `오답 삭제` or `odab del`**
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
You: odab del
|
|
102
|
+
|
|
103
|
+
Agent: 🗑️ Deleted note (ID: 13)
|
|
104
|
+
Keyword: Config_File_Backup_First
|
|
105
|
+
Was: Modified config file without creating a backup first
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**That's it.** Three phrases to remember:
|
|
109
|
+
|
|
110
|
+
| Korean | English | What it does |
|
|
111
|
+
|--------|---------|-------------|
|
|
112
|
+
| `오답 넣어` | `odab pull` | Record the last mistake |
|
|
113
|
+
| `오답 수정` | `odab fix` | Revise the note |
|
|
114
|
+
| `오답 삭제` | `odab del` | Delete the note |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### CLI Reference
|
|
119
|
+
|
|
120
|
+
#### 1. Record a Mistake
|
|
121
|
+
|
|
122
|
+
When you encounter an error and fix it, record it:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
odab add \
|
|
126
|
+
-k "ZeroDivisionPrevention" \
|
|
127
|
+
-e "ZeroDivisionError: division by zero" \
|
|
128
|
+
-f "Check if denominator == 0 before dividing and return a safe default value" \
|
|
129
|
+
-m "all"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| Flag | Description |
|
|
133
|
+
|------|-------------|
|
|
134
|
+
| `-k` | Keyword name for this mistake (unique identifier) |
|
|
135
|
+
| `-e` | Error pattern (supports regex) |
|
|
136
|
+
| `-f` | The correct fix / solution |
|
|
137
|
+
| `-m` | Target model (`all`, `gemini-3.5-flash`, `claude-3.5-sonnet`, etc.) |
|
|
138
|
+
|
|
139
|
+
### 2. List All Mistakes
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
odab list
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
ID | Keyword | Model | Count | Verified | Error Pattern
|
|
147
|
+
-----------------------------------------------------------------------------------------------
|
|
148
|
+
1 | ZeroDivisionPrev... | all | 1 | Yes | ZeroDivisionError: division by...
|
|
149
|
+
2 | Surface_Only_Fix | gemini-3.5-flash | 1 | Yes | Fixed surface only, left old refs...
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. View Details
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
odab show 1
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 4. Visualize Relations
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
odab graph
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
[ Odab-Note Dependency & Conflict Graph 🕸️ ]
|
|
166
|
+
|
|
167
|
+
● [ID: 1] ZeroDivisionPrevention (Count: 1, Verified: ✓)
|
|
168
|
+
└── (No active relations)
|
|
169
|
+
|
|
170
|
+
● [ID: 2] Surface_Only_Fix (Count: 1, Verified: ✓)
|
|
171
|
+
└── 🔗 [Triggers] -> [ID: 3] No_Full_Audit_Before_Done
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 5. Link Related Mistakes
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
odab link 2 3 --type triggers
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 6. Resolve Conflicts
|
|
181
|
+
|
|
182
|
+
When two notes contradict each other:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
odab resolve 1 2 --solution-c "Merged solution that combines both approaches"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 7. Apply Time Decay
|
|
189
|
+
|
|
190
|
+
Decrease weight of notes not triggered in N days:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
odab decay --days 30
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## MCP Server Integration
|
|
199
|
+
|
|
200
|
+
### For Gemini (Antigravity)
|
|
201
|
+
|
|
202
|
+
Add to `~/.gemini/antigravity/mcp_config.json`:
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"odab-note": {
|
|
207
|
+
"command": "/path/to/OdabNote/.venv/bin/python",
|
|
208
|
+
"args": ["-m", "odab_note.server"],
|
|
209
|
+
"env": {
|
|
210
|
+
"PYTHONPATH": "/path/to/OdabNote/src"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### For Claude Code / Cursor / Cline
|
|
217
|
+
|
|
218
|
+
Add to your MCP settings (e.g. `.cursor/mcp.json` or `claude_desktop_config.json`):
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"mcpServers": {
|
|
223
|
+
"odab-note": {
|
|
224
|
+
"command": "/path/to/OdabNote/.venv/bin/python",
|
|
225
|
+
"args": ["-m", "odab_note.server"],
|
|
226
|
+
"env": {
|
|
227
|
+
"PYTHONPATH": "/path/to/OdabNote/src"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Available MCP Tools
|
|
235
|
+
|
|
236
|
+
| Tool | Description |
|
|
237
|
+
|------|-------------|
|
|
238
|
+
| `query_notes(keywords)` | Search past mistakes by keyword before starting work |
|
|
239
|
+
| `match_error_trace(error_trace, target_model)` | Match a stack trace against the database to find a known fix |
|
|
240
|
+
| `record_mistake(keyword, error_pattern, solution, target_model)` | Record a new mistake with its solution |
|
|
241
|
+
| `propose_conflict_resolution(note_id_a, note_id_b, proposed_solution_c)` | Propose resolution for conflicting notes |
|
|
242
|
+
| `resolve_conflict_merge(keep_id, delete_id, merged_solution, merged_keyword)` | Execute a conflict merge |
|
|
243
|
+
| `register_skill(name, cmd, desc)` | Save a verified workflow command for reuse |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Testing
|
|
248
|
+
|
|
249
|
+
### Run the E2E Verification Script
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
cd OdabNote
|
|
253
|
+
.venv/bin/python tests/test_mcp.py
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Expected output:
|
|
257
|
+
```
|
|
258
|
+
🔍 [TEST 1] Query Notes with keyword 'SMC'...
|
|
259
|
+
Result:
|
|
260
|
+
Found 2 wrong-answer notes:
|
|
261
|
+
...
|
|
262
|
+
|
|
263
|
+
🔍 [TEST 2] Match Error Trace for SMC Timeout...
|
|
264
|
+
Result:
|
|
265
|
+
Found 1 matching wrong-answer notes:
|
|
266
|
+
...
|
|
267
|
+
|
|
268
|
+
🔍 [TEST 3] Match ZeroDivisionError Trace...
|
|
269
|
+
Result:
|
|
270
|
+
Found 1 matching wrong-answer notes:
|
|
271
|
+
- Target Keyword: ZeroDivisionPrevention
|
|
272
|
+
- Correct Solution: Check if denominator == 0 before dividing...
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Manual End-to-End Test
|
|
276
|
+
|
|
277
|
+
1. **Create a bug:**
|
|
278
|
+
```bash
|
|
279
|
+
echo 'print(1/0)' > /tmp/bad.py
|
|
280
|
+
python3 /tmp/bad.py # ZeroDivisionError
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
2. **Record it:**
|
|
284
|
+
```bash
|
|
285
|
+
odab add -k "DivByZero" -e "ZeroDivisionError" -f "Guard with if x != 0" -m "all"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
3. **Verify it matches:**
|
|
289
|
+
```bash
|
|
290
|
+
.venv/bin/python -c "
|
|
291
|
+
from odab_note.server import match_error_trace
|
|
292
|
+
print(match_error_trace('ZeroDivisionError: division by zero'))
|
|
293
|
+
"
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
4. **Confirm the vaccine is prescribed** — the output should show the fix you recorded.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Project Structure
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
OdabNote/
|
|
304
|
+
├── src/odab_note/
|
|
305
|
+
│ ├── __init__.py
|
|
306
|
+
│ ├── server.py # FastMCP server with 6 tools
|
|
307
|
+
│ ├── database.py # SQLite DB with regex matching, decay, relations
|
|
308
|
+
│ └── cli.py # Click CLI with 10 subcommands
|
|
309
|
+
├── tests/
|
|
310
|
+
│ ├── test_mcp.py # E2E MCP tool verification
|
|
311
|
+
│ └── buggy_script.py # Intentional bug for testing
|
|
312
|
+
├── docs/ # PRD, philosophy, tier matrix
|
|
313
|
+
├── SKILL.md # Agent instruction file (for Claude Code, Codex, etc.)
|
|
314
|
+
├── pyproject.toml
|
|
315
|
+
└── README.md
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Database Location
|
|
319
|
+
|
|
320
|
+
The SQLite database is stored at:
|
|
321
|
+
```
|
|
322
|
+
~/.gemini/antigravity/odab_note.db
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
© Logan's Company. All rights reserved.
|