Appearance
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]withtools/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:
| Scenario | Purpose | Typical outcome |
|---|---|---|
normal_short / normal | Baseline live operation | PASS — chunks growing, temp safe, track_id present |
recovery_after_stall | Post-encoder-stall recovery | PASS after restart + prune + re-probe |
encoder_stall_sim | Simulate encoder silent streak | FAIL/INCOMPLETE when stall rate exceeds soak threshold |
disk_critical | Storage CRITICAL injection | FAIL pre-prune; improves after KEEP=30 prune |
tracker_enabled | Layer2 tracker + host assigner | PASS — track_id in MQTT ~9–12 Hz |
contract-fail-lowhz | Low MQTT contract rate | FAIL contract verify |
playback + justified | Playback-ready + MP4 pull | PASS — justified 60s chunks, linear PTS |
layer3_depth | Monocular depth + spatial fusion | PASS when depth model active and x/y/z present |
video_understanding | Gemini + Video Intel on clips | PASS when proxy cloud modules succeed |
hermes-mesh | Peer discovery and cross-A2A | PASS — 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-handoffRun 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 3Target 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
| Result | Meaning |
|---|---|
| PASS | Encoder and thermal samples within thresholds; justified chunks present |
| INCOMPLETE | Soak ended without final gate marker; probes may still pass |
| FAIL | Encoder silent or failure rate above 25%; contract or storage blocking |
Per-run artifacts under test-results/v3-runs/:
| Artifact | Contents |
|---|---|
tap.log | Proxy calls, MQTT steps, watcher events |
checkpoints/*.jpg + *.json | Snapshots and metrics at phase boundaries |
summary.json | Scenario verdict with temp, hz, storage |
SMOKE_REPORT | Consolidated 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_understandingonly 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
- API quick reference — health and recording probes before batches
- Soaks & automation — full orchestrator flags and matrix modes
- Video understanding — cloud analysis on justified clips
- Troubleshooting — stall, storage, and contract failures
Operator depth
Live fleet state and harness evidence live in private operator handoff (not published) (private).