fix(engine): key denyResult decision off eventType, not stage - #9002
Conversation
denyResult mapped decision to "paused" only when stage === "kill_switch", so the budget-cap termination ceiling (stage "budget_cap", eventType "kill_switch") recorded decision "deny" instead of "paused" in the governor ledger. Switch the ternary to check eventType, matching the vocabulary the ledger event already carries.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
1 similar comment
|
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 #9002 +/- ##
==========================================
- Coverage 93.87% 93.87% -0.01%
==========================================
Files 807 807
Lines 80464 80464
Branches 24398 24398
==========================================
- Hits 75538 75534 -4
Misses 3561 3561
- Partials 1365 1369 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 15:55:13 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver 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://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Decision record
🟩 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
Fixes the governor ledger misclassifying the budget-cap termination ceiling as
denyinstead ofpaused.denyResultinpackages/loopover-engine/src/governor/chokepoint.tscomputed the ledger'sdecisionfield by checkingstage === "kill_switch". But the budget-cap termination ceiling reachesdenyResultwithstage: "budget_cap"andeventType: "kill_switch"(seebudget-cap.ts:87-92— the termination dimension is deliberately the most severe verdict,kill_switch). Because the stage label isn't literally"kill_switch", that path recordeddecision: "deny"even though the sameeventTypeis mapped to"paused"on the top-level kill-switch path. The ternary now checkseventTypeinstead ofstage, so any chokepoint stage whose event type iskill_switchconsistently recordsdecision: "paused".Scope
packages/loopover-engine/src/governor/chokepoint.ts— the ternary fixpackages/loopover-engine/test/chokepoint.test.ts— regression assertion on the existing termination-ceiling testValidation
npx turbo run build --filter=@loopover/engine && npx turbo run build --filter=@loopover/mcp && npx turbo run build:tsc build:verify --filter=@loopover/miner— greennpx vitest run --changed=upstream/main --passWithNoTests— 109 files / 1745 tests, all passednpm test— 21981/22002 tests passed (21 skipped); the package's ownchokepoint.test.tssuite (27 tests) passes including the new assertionNotes
This is a two-line, engine-only logic fix — no UI/frontend files were touched, so no screenshot evidence applies.
Closes #8864