01-scope-architecture.md 2.5 KB

Review 1 — Scope and architecture

Date: 2026-08-18 Round: HTH Host serial transaction ownership, Safe/Resume, event ordering, release evidence closure Round 4 HEAD: recorded in the unique Run Manifest after the host-only commit (this file does not override that manifest).

Scope

No RL, NN, MPC, PID, data platform, Web frontend, Kubernetes, cloud services, new CPLD features, or new UART commands were added. Process shape remains one hthd per serial controller: Actor + Serial Worker + Observe/Control UDS + Python SDK + capture/replay. Public API grew only additively: DeliveryGap, Event.action_result, Event.port_generation, SUPERSEDED dispatch/reject reasons, ControlService StepReplay, heartbeat/watchdog snapshot fields, and timing capability fields.

Single serial authority

Device Actor is the only object that allocates job_id. Serial Worker executes jobs whose identity includes job_id, port_generation, device_epoch, kind, origin, started_at, and deadline. CurrentInflight is compare-and-cleared only on a full match. Stale results do not call endInflight(), do not kickPendingSerial(), and do not mutate lease/epoch/snapshot/baseline/control mode. Open success increments Port Generation. Close/Drop/Reconnect permanently invalidate the old generation. Worker Context is a sibling of Actor Context (not cancelled when draining starts) so Shutdown Safe can still be the next physical SET_ALL. Job Context is derived from Worker Context, not context.Background().

Findings this round

  • Slow-subscriber gaps no longer consume a global Event ID. Gap metadata is attached to the next real event as delivery_gap.
  • Pending Resume is an explicit object. Validation does not enter RESUME_PENDING; the mode stays SAFE until the Resume SET_ALL is actually dispatched.
  • kickPendingSerial() returns immediately while draining. Unstarted ordinary applies are SUPERSEDED_BY_SHUTDOWN / NOT_DELIVERED.
  • Effective Safety Contract is the unique merge of profile + config override. Startup fail-closes if it is invalid. Doctor/Capabilities/Safe SET_ALL use that entry.
  • Ordinary pending control is latest-wins (one pending action per lease/device). Safe/Resume/Shutdown Safe are not superseded by ordinary applies.

Verdict

Architecture direction: PASS. No blocking ownership or scope items. Software safety acceptance is not decided in this file; see Review 5 and the Run Manifest. Hardware validation: NOT RUN. Real actuator validation: NOT RUN.