feat(mcp): evaluate when a rented loop should escalate to a human - #5806
Conversation
Closes JSONbored#4806 Implements the support/escalation-path decision logic: given an already-computed loop outcome, health tier, and operator/customer signals, decide whether a loop needs a human and what action to take -- the deterministic core that routes "something's wrong" to a stop-and-review state. Composes with the loop-health evaluator (JSONbored#4808) on the Rent-a-Loop path JSONbored#4778. - new packages/loopover-engine/src/loop-escalation.ts (pure): evaluateEscalation(input) returns shouldEscalate + action (none/notify/human_review/stop) + severity + reasons, by precedence -- a requested stop wins; an errored run or critical health needs a human now; a give-up or customer flag needs a human soon; a soft degradation only notifies. No IO: it decides, the caller wires the action (a stop maps to JSONbored#4809's kill-switch once that lands). - new loopover_evaluate_escalation MCP tool (src/mcp/server.ts); src/loop-escalation.ts is a thin re-export shim over the engine module. - tests cover every trigger and precedence tier plus the no-escalation path, at the engine level and end-to-end through the MCP tool.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5806 +/- ##
=======================================
Coverage 95.11% 95.11%
=======================================
Files 586 587 +1
Lines 46480 46509 +29
Branches 14860 14870 +10
=======================================
+ Hits 44209 44238 +29
Misses 1515 1515
Partials 756 756
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 19:11:11 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Closes #4806
Implements the support/escalation-path decision logic: given an already-computed loop outcome, health tier, and operator/customer signals, decide whether a loop needs a human and what action to take — the deterministic core that routes "something's wrong" to a stop-and-review state. Composes with the loop-health evaluator (#4808) on the Rent-a-Loop path #4778.
packages/loopover-engine/src/loop-escalation.ts(pure):evaluateEscalation(input)returnsshouldEscalate+action(none/notify/human_review/stop) +severity+reasons, by precedence — a requested stop wins; an errored run or critical health needs a human now; a give-up or customer flag needs a human soon; a soft degradation only notifies. No IO: it decides, the caller wires the action (astopmaps to Incident runbook for the kill-switch #4809's kill-switch once that lands).loopover_evaluate_escalationMCP tool (src/mcp/server.ts);src/loop-escalation.tsis a thin re-export shim over the engine module.Scope
Validation
If any required check was skipped, explain why:
Safety
Notes
stopaction names it). The evaluator is independent of that wiring.