kill .claude
This commit is contained in:
parent
929415af3b
commit
ff5be3e792
6 changed files with 0 additions and 0 deletions
46
doc/scoring-persistence-analysis.md
Normal file
46
doc/scoring-persistence-analysis.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# Memory Scoring Persistence — Analysis (2026-04-07)
|
||||
|
||||
## Problem
|
||||
|
||||
Scores computed by `score_memories_incremental` are written to
|
||||
`ConversationEntry::Memory::score` (in-memory, serialized to
|
||||
conversation.log) but never written back to the Store. This means:
|
||||
|
||||
- `Node.last_scored` stays at 0 — every restart re-scores everything
|
||||
- `score_weight()` in `ops.rs:304-313` exists but is never called
|
||||
- Scoring is wasted work on every session start
|
||||
|
||||
## Fix
|
||||
|
||||
In `mind/mod.rs` scoring completion handler (currently ~line 341-352),
|
||||
after writing scores to entries, also persist to Store:
|
||||
|
||||
```rust
|
||||
if let Ok(ref scores) = result {
|
||||
let mut ag = agent.lock().await;
|
||||
// Write to entries (already done)
|
||||
for (key, weight) in scores { ... }
|
||||
|
||||
// NEW: persist to Store
|
||||
let store_arc = Store::cached().await.ok();
|
||||
if let Some(arc) = store_arc {
|
||||
let mut store = arc.lock().await;
|
||||
for (key, weight) in scores {
|
||||
store.score_weight(key, *weight as f32);
|
||||
}
|
||||
store.save().ok();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This calls `score_weight()` which updates `node.weight` and sets
|
||||
`node.last_scored = now()`. The staleness check in
|
||||
`score_memories_incremental` (learn.rs:325) then skips recently-scored
|
||||
nodes on subsequent runs.
|
||||
|
||||
## Files
|
||||
|
||||
- `src/mind/mod.rs:341-352` — scoring completion handler (add Store write)
|
||||
- `src/hippocampus/store/ops.rs:304-313` — `score_weight()` (exists, unused)
|
||||
- `src/subconscious/learn.rs:322-326` — staleness check (already correct)
|
||||
- `src/hippocampus/store/types.rs:219` — `Node.last_scored` field
|
||||
Loading…
Add table
Add a link
Reference in a new issue