wire up /score command and debug screen for memory importance

/score snapshots the context and client, releases the agent lock,
runs scoring in background. Only one score task at a time
(scoring_in_flight flag). Results stored on Agent and shown on
the F10 context debug screen with importance scores per memory.

ApiClient derives Clone. ContextState derives Clone.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 22:18:50 -04:00
parent df9b610c7f
commit c01d4a5b08
7 changed files with 64 additions and 4 deletions

View file

@ -89,7 +89,7 @@ pub async fn score_memories(
// Compute per-response divergence
let mut row = Vec::new();
for (resp_idx, (base_lps, without_lps)) in baseline.iter().zip(without.iter()).enumerate() {
for (_resp_idx, (base_lps, without_lps)) in baseline.iter().zip(without.iter()).enumerate() {
// Sum of logprob drops across tokens in this response
// Positive = memory helped (logprob was higher with it)
let divergence: f64 = base_lps.iter().zip(without_lps.iter())