C7: Dispatch guardrails (caps + logged verdicts) #28

Closed
opened 2026-10-28 11:08:21 +00:00 by jacisjake · 0 comments
jacisjake commented 2026-10-28 11:08:21 +00:00 (Migrated from github.com)

Epic: #21. Depends on: #22, #23, #24, #25, #26

Goal

Confirm the dispatch path cannot bypass the project's guardrail rules: every Jev mode/divergence call goes through the flock wrapper (cap, timeout, flight log), conspiracy invites are capped, and every classification that changes behavior is logged with its probabilities.

Acceptance criteria — falsifiable tests

  1. TestDispatchCallsGoThroughFlock — Given the dispatch code path, then every Jev SystemOne invocation is reached only via a Flock method (ClassifyMode/ClassifyDivergence); assert by unit-testing that Flock.ClassifyMode acquires the f.sem semaphore and writes a flight-log Event with Prob. Red now (methods may not exist yet in C1 if reordered — this is the final integration check), green after.
  2. TestConspiracyInviteCap — a 2-crow nest with invited:5 fires ≤2 prompts (min of nest size and cap); with MaxCrowsInFlight set to 1, a conspiracy invites at most 1 crow concurrently. Red now, green after.
  3. Integration TestDispatchGuardrailsEndToEnd — scripted fake Jev + mock brain: conspiracy request → multiple claims accepted → restatement nudge → no crow exceeds the cap in flight at once (count concurrent asks with an atomic peak), all decisions present in ReadEvents. Red now, green after.

Test command

go test -race -run 'TestDispatch|TestConspiracyInviteCap' .

Blockers / unknowns

Final task: sequence after C1–C6 land so it can assert on real wiring.

Epic: #21. Depends on: #22, #23, #24, #25, #26 ## Goal Confirm the dispatch path cannot bypass the project's guardrail rules: every Jev mode/divergence call goes through the flock wrapper (cap, timeout, flight log), conspiracy invites are capped, and every classification that changes behavior is logged with its probabilities. ## Acceptance criteria — falsifiable tests 1. `TestDispatchCallsGoThroughFlock` — Given the dispatch code path, then every Jev `SystemOne` invocation is reached only via a `Flock` method (`ClassifyMode`/`ClassifyDivergence`); assert by unit-testing that `Flock.ClassifyMode` acquires the `f.sem` semaphore and writes a flight-log Event with `Prob`. Red now (methods may not exist yet in C1 if reordered — this is the final integration check), green after. 2. `TestConspiracyInviteCap` — a 2-crow nest with `invited:5` fires ≤2 prompts (min of nest size and cap); with `MaxCrowsInFlight` set to 1, a conspiracy invites at most 1 crow concurrently. Red now, green after. 3. Integration `TestDispatchGuardrailsEndToEnd` — scripted fake Jev + mock brain: conspiracy request → multiple claims accepted → restatement nudge → no crow exceeds the cap in flight at once (count concurrent asks with an atomic peak), all decisions present in `ReadEvents`. Red now, green after. ## Test command `go test -race -run 'TestDispatch|TestConspiracyInviteCap' .` ## Blockers / unknowns Final task: sequence after C1–C6 land so it can assert on real wiring.
Sign in to join this conversation.