04-api-replay-deployment.md 2.4 KB

Review 4 — SDK, Capabilities, Effective Safety Contract, Replay, Profile, systemd

Date: 2026-08-18 Round: HTH Host serial transaction ownership, Safe/Resume, event ordering, release evidence closure Round 4

Python SDK

Capability-driven builder remains the supported path. Prod2U convenience stays separate from the generic client. subscribe_events asserts non-zero strictly increasing event_id and surfaces delivery_gap as DataGap when requested. Wheel matrix (3.11/3.12/3.13, fresh venv, wheel only) must be re-run on the final commit; this review does not invent a pass.

Effective Safety Contract

safety.BuildEffectiveSafetyContract(profile, config) is the unique merge: per-actuator range, resolution, finite, SET_ALL-encodable, complete Safe frame, capability SafetyDefault, capability hash, Doctor, Mock/Replay. Startup fail-closes if the contract is invalid. Config override of Fan/PTC/door changes runtime Safe frame, capability defaults, and capability hash together.

Replay admin and provenance

Observe StepReplay is deprecated and denied unless replay.allow_observe_step. ControlService StepReplay is the admin path (Linux control socket group). Replay streams use live monotonic event_id. Provenance fields source_event_id, source_device_id, source_daemon_instance_id, source_capture_id are not overwritten with the current replay daemon identity.

Profile fail-closed

Load rejects: duplicate JSON keys, trailing JSON, unknown fields (strict), ID/alias collisions including later IDs matching earlier aliases, duplicate TEMP source_index, overlapping/negative/OOB SET_ALL offsets, UART not 115200 8N1 none, CRC-16/CCITT-FALSE parameters, missing SHA-256 hex, UNSPECIFIED kind/unit/control/feedback, non-finite numbers, resolution ≤ 0, negative slew, safety out of range, extra JSON object. When the real host-contract.json / golden-vectors.json files are reachable from the profile path, their SHA must match the embedded evidence hashes.

systemd

UDS observe/control split, Type=notify, pathname and abstract NOTIFY_SOCKET, READY/WATCHDOG/STOPPING, no TCP listen, sysusers/tmpfiles, observer cannot mutate the socket directory remain the deployment contract. PID 1 = systemd is proven only by the QEMU VM gate in Review 5.

Verdict

API/replay/profile direction: PASS. Do not treat Python matrix, systemd VM, or ARM64 smoke as PASS in this file; those are Run Manifest rows.