04-protocol-state-safety.md 1.2 KB

Q0 Audit 4 - Protocol, Safety Race and Atomic Commit

Result: PASS for implemented focused scope.

  • Registry is 01 SET_ALL, 02 GET_SNAPSHOT, 03 SET_STIMULUS retained/unsupported, 04 SET_PID_TARGET, 06 ACK_NACK and 82 SNAPSHOT_DATA; IDs are unique.
  • Every complete CRC-correct request receives exactly one unified ACK/NACK. Bad header/CRC, partial, timeout and framing-error traffic is silent.
  • Frame RX consumes and CRC-checks lengths through 255 without large payload RAM; embedded A5 5A cannot create a ghost command.
  • SET_ALL validates all 32 values, stages inactive memory, rechecks safety and ACKs only after the safe PWM-boundary output commit.
  • A new 77 C hard lock cancels an in-flight manual vector, returns SAFETY_LOCKED, does not feed the watchdog and cannot restore the cancelled vector after release.
  • New hard fault may make one global safe transition; subsequent valid epochs clamp only fault lanes and resume PID on non-fault lanes. Persistent PID stale performs one safe commit without bank/control-epoch churn.
  • GET locks snapshot banks/port, emits 06 ACK then 82 DATA and unlocks only after the final physical stop bit.

Evidence: Frame RX, Host Command, Core, hard-race Icarus and full-top Host/control Cocotb.