Evaluate whether you know enough to act on a goal, or need to learn more.
Goal to review: $ARGUMENTS
route(action: "review_goal",
goal_id: "<id>",
signal: {
"retrieved_nodes": [{"node_id": "abc", "confidence": 0.8, "similarity": 0.85}],
"outcomes": [{"action_id": "fix-auth", "status": "success", "confidence": 0.9}],
"contradictions": 0,
"knowledge_gaps": ["How does the rate limiter interact with auth?"],
"supporting_evidence_count": 5,
"coverage_estimate": 0.7
},
apply_decision: true
)
Returns: decision (act/learn/escalate), coverage_score, uncertainty_score, risk_score, rationale, applied_review, transition (if apply_decision was true), evaluation.
act — coverage adequate, proceed with execution
learn — gaps exist, gather more info, then re-review
escalate — critically low coverage or high risk, mark blocked, get external help
If apply_decision: true, the goal auto-transitions: act -> active, learn -> proposed, escalate -> blocked.
Pass options to customize evaluation thresholds:
route(action: "review_goal",
goal_id: "<id>",
signal: { ... },
options: {
"top_k": 10,
"min_context_nodes": 3,
"freshness_half_life_hours": 48,
"graph_support_target": 0.6,
"weights": {"coverage": 0.4, "confidence": 0.3, "freshness": 0.2, "support": 0.1},
"thresholds": {"act": 0.7, "learn": 0.4}
}
)
top_k — how many top nodes to consider for scoring
min_context_nodes — minimum linked nodes needed for adequate coverage
freshness_half_life_hours — decay rate for old evidence
graph_support_target — target ratio of supporting edges
weights — custom scoring dimension weights
thresholds — custom decision boundaries (above act threshold = act, below learn threshold = escalate)
Build the signal from REAL retrieval data — never fabricate:
Always retrieve first — run retrieve(action: "context", ...) before building the signal
retrieved_nodes — from actual results (include node_id, confidence, similarity)
outcomes — from actual learn(action: "from_outcome", ...) calls
contradictions — count contradicts edges found during inspection
knowledge_gaps — questions the graph couldn't answer
supporting_evidence_count — number of supports edges found
coverage_estimate — your honest assessment (0.0-1.0)
For quick coverage assessment without a goal:
retrieve(action: "coverage", query: "auth middleware token validation", limit: 10, expansion_hops: 1)
Returns coverage score, decision (act/learn/escalate), relevant nodes, and confidence stats. Use this when you want a fast coverage check without creating or linking to a goal.
`retrieve(action: "coverage")` vs `route(action: "review_goal")`:
retrieve(action: "coverage") | route(action: "review_goal") | |
|---|---|---|
| Requires goal | No | Yes |
| Requires signal | No (auto-retrieves) | Yes (you build the signal) |
| State transitions | None | Optional (apply_decision) |
| Use when | Quick pre-action check | Formal goal-driven review |
retrieve -> build signal -> route(action: "review_goal") -> if act, proceed; if learn, gather more; if escalate, block.
After a learn decision: retrieve more -> store findings -> re-review -> eventually reach act or escalate.
After learn(action: "from_outcome", status: "failure"): re-review the goal to reassess coverage with the new negative signal.
route(action: "review_goal", goal_id: "<id>", signal: { ... }, options: {"thresholds": {"act": 0.85, "learn": 0.5}})
Signal fabrication — building signals from made-up data instead of real retrieval
Review theater — calling review_goal but ignoring the act/learn/escalate decision
Skipping review before high-stakes actions