Commit Graph

4 Commits

Author SHA1 Message Date
caoqianming 532eeaba42 feat(simulate): chaos task for rem/flt signal testing
When SIMULATE_PLC=true, a background task randomly disrupts rem or flt
signals on equipment (rem=false for 5-15s, flt=true for 3-10s) to
exercise fault detection, comm lock, and recovery logic in the engine.
Uses XorShift64 PRNG with no extra dependencies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 10:11:05 +08:00
caoqianming b3f92867bc fix(engine): fix supervisor restart, deduplicate helpers, fix notify race
- engine.rs: replace HashSet<Uuid> with HashMap<Uuid, JoinHandle> in
  supervise(); use is_finished() to detect exited tasks so units that
  are disabled then re-enabled get a new task on next 10s scan
- control/mod.rs: extract shared monitor_value_as_bool (using the more
  complete validator version that includes "yes"); remove duplicate
  copies from engine.rs and validator.rs
- runtime.rs: fix get_or_create_notify TOCTOU by using entry API
  instead of read-drop-write pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 09:08:25 +08:00
caoqianming 628553f2b8 refactor(control): extract pulse command helper to control/command.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 14:31:37 +08:00
caoqianming 97d2f6ebf8 feat(control): add manual equipment pulse commands 2026-03-24 11:16:50 +08:00