Skip to content

Gateway-Edge Hybrid Rules Engine: settings, motion score, decision-core wiring - #1

Merged
dmichael-fastly merged 6 commits into
mainfrom
feat/rules-engine-gateway-edge
Aug 2, 2026
Merged

dmichael-fastly merged 6 commits into
mainfrom
feat/rules-engine-gateway-edge

Conversation

@dmichael-fastly

Copy link
Copy Markdown
Owner

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 at docs/superpowers/plans/2026-07-27-rules-engine-gateway-edge-plan.md:

  • Edge (Rust): new garden_state settings (motion_sensitivity, human_auto_disarm_minutes, rain_suppression_enabled, auto_disarm_until) exposed on GET /api/state and writable via a new admin-gated POST /api/settings.
  • Pi camera daemon: exposes the per-camera motion score it already computes over a new GET /motion_score?device=<did> route.
  • Pi gateway: extends the existing local_precheck/resolve_motion fail-closed decision core with an auto-disarm window, a rain-suppression toggle, and a camera-motion veto; sources the evidence JPEG from camera_daemon when 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 ci green (gen-check, css-check, build-check, Rust + Python tests, gitleaks)
  • Updated the pinned safety-invariant suite (tests/test_safety_properties.py) and the simulator e2e harness (tests/test_sim_e2e.py) for the new Gateway/local_precheck/resolve_motion signatures — both found mid-implementation, not in the original plan.

@dmichael-fastly
dmichael-fastly merged commit 2e281e8 into main Aug 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant