Extends ensure_default_templates to also seed the 5 公共段 (前端码车 /
前端放车 / 前端摆渡 / 窑尾摆渡 / 卸砖 / 回车) and their shared resource
declarations (transfer_front / transfer_tail / unload_position /
return_line / robot_arm) so operators have the full skeleton to bind
equipment + signals against.
Engine now runs a station signal-conflict check during the run-halt
phase: any station whose presence and vacancy are both true with Good
quality emits ops.alarm.signal_conflict + segment.fault_locked and
transitions the segment to Faulted. Closes the final P8 alarm type
from design doc §8.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
ensure_kiln_templates idempotently inserts 6 dry-kiln stations and 6
segments (infeed/step/outfeed × 2 kilns) with their canonical step
sequences from §10.1. Equipment and station-signal bindings stay
operator-owned through the CRUD APIs. Startup runs the seed only when
OPS_SEED_TEMPLATES=true|1, so production deployments don't accidentally
mutate config.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spec covers station/segment/step/interlock domain model, segment state
machine (Idle..ManualAckRequired), action templates including persistent
commands, resource lease registry, ops.* event taxonomy, and the AppEvent
WebSocket envelope. Stage plan includes P-1 core cleanup before ops work
begins.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four remaining improvements for the dual-app split:
1. Migrate platform handlers (tag/page/source/point/equipment) to core
2. Add event namespace prefixes (platform.*/feeder.*/ops.*)
3. Register platform routes in ops app
4. Ops business logic (pending requirements)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clean up old web module files that were superseded by the per-app
split architecture. Includes plan documentation for the migration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ops.js: remove unused `formatValue` import
- logs.js: remove `export` from internal-only `appendLog`
- state.js: fix stale comment ({ valueEl, qualityEl } → { dotEl })
- docs: rewrite both plan docs in Chinese; update dual-view-web plan to
reflect actual implementation (sigDotClass dots, loadAllEquipmentCards,
syncEquipmentButtonsForUnit, batch auto buttons in startOps)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Engine now spawns one async task per enabled unit (supervised every 10s)
- wait_phase uses sleep_until + select! for precise timing; 500ms fault-tick
runs inside each phase so fault/comm is still checked promptly
- WS UnitRuntimeChanged pushed only on state transitions, not every tick
- ControlRuntimeStore gains notify_unit/get_or_create_notify for instant
wake-up when handlers change auto_enabled or fault_locked
- UnitRuntime: remove last_tick_at, current_run/stop/distributor_elapsed_sec;
add display_acc_sec (snapshot at transition, avoids mid-cycle jitter)
- accumulated_run_sec now increments by exact run_time_sec*1000 per cycle
- unit.state_changed events no longer written to DB (too frequent)
- Frontend: show display_acc_sec instead of accumulated_run_sec
- styles: event-card flex-shrink:0 fixes text overlap under flex column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>