Repository navigation
Gateway-Edge Hybrid Rules Engine: settings, motion score, decision-core wiring - #1
Merged
Merged
Conversation
Also picks up a cargo-fmt pass over contract_gen.rs (formatting only, triggered by the pre-commit hook).
…ggle + settings sync
…a stray cargo-fmt drift)
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.
Summary
Implements Sections A-D of the Gateway-Edge Hybrid Rules Engine spec (
docs/superpowers/specs/2026-07-27-rules-engine-trigger-design.md), per the plan atdocs/superpowers/plans/2026-07-27-rules-engine-gateway-edge-plan.md:garden_statesettings (motion_sensitivity,human_auto_disarm_minutes,rain_suppression_enabled,auto_disarm_until) exposed onGET /api/stateand writable via a new admin-gatedPOST /api/settings.GET /motion_score?device=<did>route.local_precheck/resolve_motionfail-closed decision core with an auto-disarm window, a rain-suppression toggle, and a camera-motion veto; sources the evidence JPEG fromcamera_daemonwhen the radar node has none of its own (fixing a real gap where a camera-less node could never spray via this path).Explicitly out of scope (per the spec's own sequencing): human/ML detection (Section E, open research item) and the real ESP32 firmware rework to gate the spray on this round-trip (Section F, follow-up plan).
Test plan
cargo test(118 passed) +make build-check(wasm32-wasip1 compiles)python3 -m pytest -q(520 passed, 5 pre-existing skips)make cigreen (gen-check, css-check, build-check, Rust + Python tests, gitleaks)tests/test_safety_properties.py) and the simulator e2e harness (tests/test_sim_e2e.py) for the newGateway/local_precheck/resolve_motionsignatures — both found mid-implementation, not in the original plan.