EventInsert + EventRecord + record_event now carry the subject_type /
subject_id columns added by the P1 migration. Ops events populate
"segment" / "station" subjects so the timeline can be filtered without
parsing event_type strings. Platform SourceCreated / Updated / Deleted
attribute themselves to subject_type="source". Adds get_events_*_filtered
in core and exposes GET /api/event on ops with event_type /
event_type_prefix / subject_type / subject_id query params, closing
design doc §14 "event 表能按 ops.* 和 subject_type/subject_id 查到全链路事件".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>