Commit Graph

3 Commits

Author SHA1 Message Date
caoqianming 63683a24c8 Implement operation-system engine MVP (P3)
Adds the segment supervisor + per-segment state machine driving
Idle → Checking → Executing → Confirming → Completed (plus Blocked /
Faulted / ManualAckRequired), interlock evaluator, action-kind step
executor, control + runtime HTTP handlers, and WebSocket runtime push
via AppEvent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 08:39:14 +08:00
caoqianming a33c013da5 Add operation-system config schema and CRUD API
Land design doc §12 P1 + P2: ops business tables plus station/segment
configuration endpoints. The engine (P3) consumes these as its inputs.

- Migration: six ops tables (station, station_signal, process_segment,
  segment_step, segment_interlock, segment_resource) plus event attribution
  columns (subject_type, subject_id).
- model.rs: FromRow structs and string-backed enum helpers
  (StationType, StationSignalRole, SegmentMode, ActionKind, OnTimeout,
  InterlockAppliesTo, RuleKind).
- service: station CRUD with signal-binding upsert; segment CRUD with
  nested step/interlock CRUD and transactional resource replacement.
- handler: 13 endpoints covering design doc §9.1 config routes with
  validator-based input checks and enum allowlists.
- router: wires the new routes; smoke tests cover station and segment
  collection routes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 08:17:34 +08:00
caoqianming 3cc13ccf1e feat(ops): add operation-system app skeleton 2026-04-16 12:59:31 +08:00