M-0: Promote check-single-writer-hudstate.sh to behavioral probe (R-004) #95

Open
opened 2026-05-12 19:36:41 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:36:41 +00:00 (Migrated from github.com)

Goal

Promote check-single-writer-hudstate.sh from grep-only to a behavioral harness probe that asserts exactly one HUD-state event reaches the bus client. Grep kept as defense in depth. Mitigates R-004.

Scope

  • New HudStateSingleWriterProbe debug binary
  • Probe emits HUD state from two paths; harness asserts exactly one event reaches the bus
  • scripts/check-single-writer-hudstate.sh becomes a thin wrapper around the probe
  • Grep gate retained alongside

Files

  • scripts/check-single-writer-hudstate.sh (rewrite)
  • packages/Harness/Sources/Harness/Probes/HudStateSingleWriterProbe.swift (new)

Acceptance

  • Behavioral probe green on current develop (HUD currently has single writer or expected dual writer documented)
  • Probe fails when artificial second writer added (negative test)
  • Existing grep gate still green

Test

Negative test: inject a second emit → probe must fail. Positive: clean state → probe green.

Parent epic

#4

Source

.planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.1 (M-0.6)
.planning/architecture/REVIEW-MIGRATION-RISK.md R-004

## Goal Promote check-single-writer-hudstate.sh from grep-only to a behavioral harness probe that asserts exactly one HUD-state event reaches the bus client. Grep kept as defense in depth. Mitigates R-004. ## Scope - New `HudStateSingleWriterProbe` debug binary - Probe emits HUD state from two paths; harness asserts exactly one event reaches the bus - `scripts/check-single-writer-hudstate.sh` becomes a thin wrapper around the probe - Grep gate retained alongside ## Files - `scripts/check-single-writer-hudstate.sh` (rewrite) - `packages/Harness/Sources/Harness/Probes/HudStateSingleWriterProbe.swift` (new) ## Acceptance - [ ] Behavioral probe green on current develop (HUD currently has single writer or expected dual writer documented) - [ ] Probe fails when artificial second writer added (negative test) - [ ] Existing grep gate still green ## Test Negative test: inject a second emit → probe must fail. Positive: clean state → probe green. ## Parent epic #4 ## Source `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.1 (M-0.6) `.planning/architecture/REVIEW-MIGRATION-RISK.md` R-004
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#95