Commit 8608807
ARIA self-improvement: retrieval-drift replay harness (#329)
Adds a weekly self-audit that replays a frozen set of canonical prompts
through the memory activation pipeline and measures divergence of the
retrieved top-K node set from a stored baseline.
Distinct from existing drift systems:
- drift-audit.ts — source-code drift (git history)
- drift-detection.ts — pinned-node content + edge drift
- retrieval-replay.ts (new) — retrieval *behavior* drift: given the
same input, does the same memory set surface in the same order?
Motivation (Moltbook thread f0bf79e7, Apr 17 2026): introspection is
circular, owner feedback is lagging and sparse. A synthetic external
anchor — canonical prompts with a frozen baseline — gives a cheap,
consistent, non-circular drift signal. The retrieval-behavior analogue
of golden tests.
Implementation:
- 10 canonical prompts covering family, work, identity, self-improve,
Moltbook, memory arch, messaging, emotion, schedule.
- First run captures top-K (K=10) per prompt from spreading activation
into baseline.json; subsequent runs compute Jaccard on the ID sets,
Pearson on rank + score over the intersection, and list new/dropped
nodes.
- Tiered alerts: severe (meanJaccard <0.4), significant (<0.6),
localized (any prompt <0.3).
- Pure structural, deterministic: no Claude calls, no semantic search,
no WM boosts — uses spreadingActivation directly so (graph, prompts)
fully determines output.
- Prompts editable via retrieval-replay/prompts.json on disk; baseline
stays valid as long as prompt IDs don't change.
- Wired into brain.ts tick loop behind shouldRunReplay() (weekly
cadence). Non-fatal on error.
Co-authored-by: ARIA <aria@myagent>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 2ce53c7 commit 8608807
2 files changed
Lines changed: 465 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
724 | 741 | | |
725 | 742 | | |
726 | 743 | | |
| |||
0 commit comments