Commit 874beaf
authored
feat: tell it when it's wrong, and see what it knows (#40)
Two things a person needs from a memory that learns on its own: a way to
see what it holds, and a way to correct it. Neither existed — the first
time memory kept a stale preference or a dropped project, the only
recourse was editing SurrealDB by hand.
**what-do-you-know** renders what memory actually holds, grouped by type,
with confidence — and surfaces the self-reinforcement tally where it is
non-zero, which is the "this may be me talking to myself" signal from the
provenance work. --about <topic> answers the same question on one subject.
**graph correct** records corrections as evidence rather than deletion. A
person saying "that's wrong" is the highest-authority signal the system
can receive, so it enters as contradiction at User provenance and the
posterior moves accordingly; before/after confidence and evidence weight
are both shown. --forget still deletes, but prints what will go and
requires confirmation, gated daemon-side so no client can skip it.
Subtle correctness point, caught during implementation: contradiction must
NOT touch last_reinforced. Reusing the reinforce path would have reset the
decay anchor, so telling the system a memory was wrong would have made it
MORE visible — an edge stored at 0.6 and decayed to 0.3 would return at
0.545. crud::contradict_relationship writes counts and mean while leaving
the anchor alone, so corrections are monotone. The extraction path has the
same latent wart; noted for a follow-up.
Ambiguity is refused rather than guessed: an entity with several live
edges lists them with confidence and exits without changing anything, and
an unknown name suggests the closest stored ones. Damaging the wrong
memory is worse than doing nothing.
MCP gains recall_overview (read-only) — an agent asking "what do I know"
is the same question. No correction tool, deliberately: a model calling it
would be recording its own judgement at the user's authority, which is the
loudest version of the failure provenance weighting exists to prevent.
Also: config show now prints [capture], [serve] and [extraction], which it
silently omitted.
728 tests, clippy -D warnings clean.1 parent 9d5cf23 commit 874beaf
21 files changed
Lines changed: 3716 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
131 | 145 | | |
132 | 146 | | |
133 | 147 | | |
| |||
302 | 316 | | |
303 | 317 | | |
304 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
305 | 333 | | |
306 | 334 | | |
307 | 335 | | |
| |||
315 | 343 | | |
316 | 344 | | |
317 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
318 | 367 | | |
319 | 368 | | |
320 | 369 | | |
| |||
367 | 416 | | |
368 | 417 | | |
369 | 418 | | |
370 | | - | |
| 419 | + | |
371 | 420 | | |
372 | 421 | | |
373 | 422 | | |
374 | 423 | | |
375 | 424 | | |
376 | 425 | | |
377 | 426 | | |
| 427 | + | |
378 | 428 | | |
379 | 429 | | |
380 | 430 | | |
| |||
387 | 437 | | |
388 | 438 | | |
389 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
390 | 445 | | |
391 | 446 | | |
392 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
81 | 140 | | |
82 | 141 | | |
83 | 142 | | |
| |||
0 commit comments