Repository navigation
feat(safety): refuse-hookless requires a hook covering AUTO->FAULT (closes #232) - #238
Merged
CameronBrooks11 merged 1 commit intoJul 30, 2026
Merged
Conversation
The refuse-hookless AUTO gate (#231) previously lifted its refusal when ANY mode_transition_hook was declared. A config declaring only a non-FAULT hook (e.g. AUTO->MANUAL) passed the gate but had no autonomous safe-state path on a fault — so a behavior-tree fault could leave actuators at their last-commanded values. Strengthen the predicate: the gate is satisfied only by a declared hook that actually fires on the AUTO->FAULT transition — `from` matching AUTO (AUTO/"*"/ omitted) AND `to` matching FAULT (FAULT/"*"/omitted), in either the before- or after-transition list. This mirrors the runtime's two-filter hook dispatch (hook_mode_matches(from, prev) && hook_mode_matches(to, next)): a hook covering only AUTO->MANUAL, or an IDLE->FAULT hook that never fires from AUTO, no longer satisfies the gate. Message reworded to name the AUTO->FAULT requirement (keeps the mode_transition_hooks token the integration test asserts); the fail-closed actuating-output enumeration is unchanged. No behavior change for configs whose safe-state hook already covers AUTO->FAULT (incl. the canonical bioreactor-v1 automation/full variants, which use a "*" from). Pure runtime predicate; actuation_gate.cpp stays automation-namespace-free and builds ON and OFF. Closes #232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the refuse-hookless AUTO gate (#231, F3 deferral). Strengthens the gate so it's satisfied only by a safe-state hook that actually fires on the
AUTO->FAULTtransition — not just any declared hook.The gap
evaluate_hookless_auto_gatepreviously lifted its refusal when anymode_transition_hookwas declared. A config declaring only a non-FAULT hook (e.g.AUTO->MANUAL) passed the gate but had no autonomous safe-state path on a fault — a behavior-tree fault could leave actuators at their last-commanded values.The fix
The predicate now requires a declared hook (in either transition list) that covers
AUTO->FAULT:frommatches AUTO (AUTO/"*"/ omitted) ANDtomatches FAULT (FAULT/"*"/ omitted).This exactly mirrors the runtime's two-filter dispatch (
hook_mode_matches(from, prev) && hook_mode_matches(to, next)). A hook covering onlyAUTO->MANUAL, or anIDLE->FAULThook that never fires from AUTO, no longer satisfies the gate.Blast radius: none
automation.yaml+full.yamlusefrom: "*" to: FAULT→ satisfy the stricter gate. Demo unaffected.automation_suite.py,test_scenarios.py) declares ato: FAULThook with wildcardfrom.mixed-bus-dev(anolis-projects, a mock/dev fixture no test loads) would be refused AUTO if it enabled automation with actuators — follow-up there if AUTO is ever needed on it, not bundled here.Verified
Unit 415/415 (7 new
ActuationGateTestcases incl.from: IDLE→refused,from: AUTO→allowed, and one that fails against the old predicate); 16 refuse/auto integration tests (confirms themode_transition_hooksmessage substring holds + AUTO-passing fixtures still enter AUTO); builds bothANOLIS_ENABLE_AUTOMATIONON and OFF; clang-format / clang-tidy / ruff / mypy clean. Adversarially reviewed (dispatch-semantics mirroring) — the review found thefromgap; re-reviewed clean after fix.Closes #232