Skip to content

Commit 5fdff1c

Browse files
hyperpolymathclaude
andcommitted
feat(gnn): activate closed-loop scoring at agent → tactic-suggestion seam
Phase 3 (final piece) of the GNN feedback loop: connect the call site where AgentCore.process_goal calls into provers/mod.rs::gnn_augment_tactics. After this commit, the loop is fully closed end-to-end with no manual wiring: StatisticsTracker → /training/update → PROVER_DOMAIN_WEIGHTS ↓ AgenticGoal.aspects → state.metadata["aspects"] → domain_hints in /gnn/rank ↓ weight-modulated premise scoring - agent/mod.rs::process_goal: write goal.aspects into state.metadata under the "aspects" key alongside the existing coprocessor witness data - provers/mod.rs::gnn_augment_tactics: read state.metadata["aspects"] and pass to gnn.rank_premises_with_aspects (falls back to empty for non-agent invocations like REPL — same behaviour as before) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent abd2215 commit 5fdff1c

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/rust/agent/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,13 @@ impl AgentCore {
377377
metadata.insert(format!("coprocessor.{}", pre.aspect), v);
378378
}
379379
}
380+
// Publish the goal's aspects so downstream neural ranking
381+
// (gnn_augment_tactics) can pass them to Julia's /gnn/rank as
382+
// domain_hints, activating the closed-loop weight-guided scoring
383+
// from accumulated PROVER_DOMAIN_WEIGHTS.
384+
if let Ok(v) = serde_json::to_value(&goal.aspects) {
385+
metadata.insert("aspects".to_string(), v);
386+
}
380387

381388
// Step 5: Get tactic suggestions (neural guidance), using the
382389
// context-enriched initial state so the suggestion model sees the

src/rust/provers/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,16 @@ pub(crate) async fn gnn_augment_tactics(
13991399
use_attention: true,
14001400
});
14011401

1402-
let result = gnn.rank_premises(&graph).await;
1402+
// Extract goal aspects from state metadata (written by AgentCore::process_goal)
1403+
// so Julia's /gnn/rank can apply per-domain weights from prior outcomes.
1404+
// When metadata has no "aspects" key (e.g. direct REPL invocation), aspects
1405+
// is empty and behaviour is identical to the no-hint path.
1406+
let aspects: Vec<String> = state
1407+
.metadata
1408+
.get("aspects")
1409+
.and_then(|v| serde_json::from_value(v.clone()).ok())
1410+
.unwrap_or_default();
1411+
let result = gnn.rank_premises_with_aspects(&graph, &aspects).await;
14031412
// Prepend apply tactics for top premises (in score order, before heuristic hints)
14041413
let mut gnn_tactics: Vec<Tactic> = result
14051414
.ranked_premises

0 commit comments

Comments
 (0)