Skip to content

About this article

  • Audience: Operators running soak batches, harness validation, and Phantom gates for transit safety workloads
  • Goal: After reading, you can select scenarios from the mass-transit matrix, run batch soaks, and interpret PASS, INCOMPLETE, and FAIL against precomp authority
  • Type: How-to

Summary

Ghost Protocol validates transit safety workloads through a scenario matrix exercised by the v3 orchestrator, live MCP harness, and Phantom readiness modules. RF-DETR precomp remains authoritative—cloud escalation applies only on justified clips. Use this guide to pick scenarios for crowding, falls, unattended objects, and fleet self-heal without guessing expected outcomes.

Prerequisites

  • Phantom proxy: export PHANTOM_PROXY=https://<phantom-proxy>:8788
  • SSH to shadows with YOUR_DEVICE_PASSWORD
  • Repo at [repo-root] with tools/v3_shadow_orchestrator.py
  • API quick reference for pre-soak health probes

1. Scenario matrix overview

Nine core scenarios cover baseline operation, failure injection, recovery, and advanced modules:

ScenarioPurposeTypical outcome
normal_short / normalBaseline live operationPASS — chunks growing, temp safe, track_id present
recovery_after_stallPost-encoder-stall recoveryPASS after restart + prune + re-probe
encoder_stall_simSimulate encoder silent streakFAIL/INCOMPLETE when stall rate exceeds soak threshold
disk_criticalStorage CRITICAL injectionFAIL pre-prune; improves after KEEP=30 prune
tracker_enabledLayer2 tracker + host assignerPASS — track_id in MQTT ~9–12 Hz
contract-fail-lowhzLow MQTT contract rateFAIL contract verify
playback + justifiedPlayback-ready + MP4 pullPASS — justified 60s chunks, linear PTS
layer3_depthMonocular depth + spatial fusionPASS when depth model active and x/y/z present
video_understandingGemini + Video Intel on clipsPASS when proxy cloud modules succeed
hermes-meshPeer discovery and cross-A2APASS — mesh active, peer ack after activation

Density variants (low/med/high crowding) map to the same gates with different actor briefs—precomp count accuracy must stay at or above 80% on harness repeats.

2. Pre-flight health checks

Before a batch, confirm storage and encoder state—use --prune-first when storage_health is CRITICAL:

bash
curl -s "$PHANTOM_PROXY/fleet/health" | jq .
curl -s -X POST "$PHANTOM_PROXY/tools/call?target=<device-ip>" \
  -H "Content-Type: application/json" \
  -d '{"tool":"get_recording_status","arguments":{}}' | jq '.storage_health, .recent_chunks'

Prune when needed, then restart the app via proxy or oakctl before stall or recovery scenarios.

3. Run a batch soak

Start with dry-run to validate scenario names and matrix wiring:

bash
cd [repo-root]
python3 tools/v3_shadow_orchestrator.py \
  --batch --matrix --dry-run \
  --scenarios normal_short,recovery_after_stall,encoder_stall_sim,disk_critical \
  --visual --update-handoff

Run the live batch with TAP and prune-first:

bash
python3 tools/v3_shadow_orchestrator.py \
  --shadow <device-ip> \
  --batch \
  --scenarios normal_short,recovery_after_stall,encoder_stall_sim,disk_critical,video_understanding \
  --prune-first --visual --tap --update-handoff --hermes \
  --batch-id mass-transit-$(date +%s)

For layer3 promote gates, add --layer layer3_depth and include promote_gate in --scenarios. Video understanding requires justified clips and proxy cloud credentials—see Video understanding.

4. Live MCP harness

Run the in-container harness for precomp authority validation across all scenarios:

bash
# On device via MCP or orchestrator invoke
python3 /app/test_harness.py --mode live-mcp --scenario all --repeats 3

Target at or above 80% count accuracy on RF-DETR precomp across the nine scenarios. Harness complements orchestrator soaks—it does not replace proxy TAP or visual checkpoints.

5. Interpret results and grade

ResultMeaning
PASSEncoder and thermal samples within thresholds; justified chunks present
INCOMPLETESoak ended without final gate marker; probes may still pass
FAILEncoder silent or failure rate above 25%; contract or storage blocking

Per-run artifacts under test-results/v3-runs/:

ArtifactContents
tap.logProxy calls, MQTT steps, watcher events
checkpoints/*.jpg + *.jsonSnapshots and metrics at phase boundaries
summary.jsonScenario verdict with temp, hz, storage
SMOKE_REPORTConsolidated gate narrative

Production letter grades use bash cost-sentinel/scripts/grade-production-soak.sh (A ≥ 90, production ≥ 85 with zero critical findings). Phantom playbooks h265_stall and disk_critical trigger self-heal when stall or disk scenarios fail—see Phantom Vision.

6. Cross-scenario dependencies

  • Prune before stall recovery on tight storage — historical CRITICAL storage blocks encoder recovery scenarios
  • Precomp before cloud — run video_understanding only after justified chunks pass
  • Hermes before cross-A2A — confirm mesh active on both shadows before federation scenarios
  • Layer2 before layer3 — tracker must be stable before depth fusion promote

Next steps

Operator depth

Live fleet state and harness evidence live in private operator handoff (not published) (private).