Skip to content

Commit ac071e7

Browse files
committed
feat(agent): AspectTagger auto-populates goal.aspects via dotted_key() when empty
In process_goal, when a caller submits a goal with no aspects, run the lightweight RuleBasedTagger and map the resulting Aspect variants through dotted_key(). Caller-supplied aspects are trusted (no overwrite). Result is published to state.metadata["aspects"] in the canonical dotted form, ready for gnn_augment_tactics and primary_domain to consume. https://claude.ai/code/session_01YPqu7gti4azBach6ZvpRFJ
1 parent 55b1132 commit ac071e7

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/rust/agent/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,18 @@ impl AgentCore {
382382
// (gnn_augment_tactics) can pass them to Julia's /gnn/rank as
383383
// domain_hints, activating the closed-loop weight-guided scoring
384384
// from accumulated PROVER_DOMAIN_WEIGHTS.
385-
if let Ok(v) = serde_json::to_value(&goal.aspects) {
385+
// If the caller supplied no aspects, run the lightweight rule-based tagger
386+
// and map results to canonical dotted keys before publishing.
387+
let aspects: Vec<String> = if goal.aspects.is_empty() {
388+
let tagger = crate::aspect::RuleBasedTagger::new();
389+
crate::aspect::AspectTagger::tag(&tagger, &goal.goal.id, &goal.goal.target)
390+
.into_iter()
391+
.map(|a| a.dotted_key())
392+
.collect()
393+
} else {
394+
goal.aspects.clone()
395+
};
396+
if let Ok(v) = serde_json::to_value(&aspects) {
386397
metadata.insert("aspects".to_string(), v);
387398
}
388399

0 commit comments

Comments
 (0)