Skip to content

Instantly share code, notes, and snippets.

@jasonnerothin
Created November 6, 2025 20:04
Show Gist options
  • Select an option

  • Save jasonnerothin/abb3635562e3bd185cba9e92b98da0af to your computer and use it in GitHub Desktop.

Select an option

Save jasonnerothin/abb3635562e3bd185cba9e92b98da0af to your computer and use it in GitHub Desktop.
Lock Request Trace Flow
═══════════════════════════════════════════════════════════════════════════════
LOCK REQUEST TRACE (traceparent: 00-ABC123...-001-01)
Services: 4 (fpv-ops, tower-sidecar, striker, drone-cmd)
═══════════════════════════════════════════════════════════════════════════════
[1] fpv-ops: publish_lock_request_striker (PRODUCER) ✅ ROOT
│ User selected option 1 from fpv-ops UI
│ Creates trace root with new trace ID
│ Injects traceparent into Redis message envelope
│ Publishes to: striker_control_channel
├─ [2] tower-sidecar: tower_receive_striker_control_channel (CONSUMER) ✅
│ │ parent: [1] fpv-ops PRODUCER
│ │ Extracts traceparent from message
│ │ Observes the lock request (read-only)
│ │
│ └─ [3] tower-sidecar: tower_forward_striker_control_channel (PRODUCER) ✅
│ │ parent: [2] tower CONSUMER
│ │ Represents Redis broadcast to all subscribers
├─ [4a] striker: consume_striker_control_channel (CONSUMER) ✅ [PARALLEL]
│ │ parent: [1] fpv-ops PRODUCER
│ │ Extracts traceparent from original message
│ │ Receives lock request from fpv-ops
│ │ Waiting for intercept command from drone-cmd...
│ │
│ └─ [5a] striker: lock_request_received (event)
│ │ Records that lock request received
│ │ interceptor: striker
│ │ target: orlan
│ │ ops_team: fpv-ops-alpha
└─ [4b] drone-cmd: consume_striker_control_channel (CONSUMER) ✅ [PARALLEL]
│ parent: [1] fpv-ops PRODUCER
│ Extracts traceparent from original message
│ Processes lock request
└─ [5b] drone-cmd: interceptor_locked (event)
│ Adds striker to ignored_interceptors list
│ Won't send conflicting intercept commands
│ interceptor: striker
│ ops_team: fpv-ops
│ target: orlan
[END] Lock Request Trace Complete
✓ striker knows it's been locked by fpv-ops
✓ drone-cmd won't send conflicting commands
✓ Waiting for drone-cmd periodic intercept calculation...
═══════════════════════════════════════════════════════════════════════════════
INTERCEPT EXECUTION TRACE (traceparent: 00-XYZ789...-001-01)
Services: 6 (drone-cmd, tower-sidecar, striker, fpv-ops, ares, orlan)
═══════════════════════════════════════════════════════════════════════════════
[1] drone-cmd: calculate_intercept_commands (INTERNAL) ✅ NEW ROOT
│ Independent periodic calculation (every 5s)
│ Creates new trace root (not linked to lock request)
│ Calculates best intercepts for all strikers
│ Filters out ignored_interceptors (striker is filtered)
└─ [2] drone-cmd: publish_intercept_commands (PRODUCER) ✅
│ parent: [1] calculate_intercept_commands
│ Creates new traceparent in message envelope
│ Publishes to: drone_command channel
│ commands: [intercept commands for active strikers]
├─ [3] tower-sidecar: tower_receive_drone_command (CONSUMER) ✅
│ │ parent: [2] drone-cmd PRODUCER
│ │ Extracts traceparent from message
│ │ Observes the intercept commands
│ │
│ └─ [4] tower-sidecar: tower_forward_drone_command (PRODUCER) ✅
│ │ parent: [3] tower CONSUMER
│ │ Represents Redis broadcast
└─ [5] striker: consume_drone_command (CONSUMER) ✅
│ parent: [2] drone-cmd PRODUCER
│ Receives intercept command with target coordinates
│ target: orlan
│ heading: 94.5°
│ distance: 125.3 km
└─ [6] striker: flight_mission (continues existing span)
│ Main flight loop continues
│ Now executing intercept command
└─ [7] striker: execute_intercept (INTERNAL) ✅
│ parent: [5] consume_drone_command
│ Calculates intercept point using projection
│ Adjusts heading toward target
│ Full speed ahead!
│ ... striker flying toward orlan ...
└─ [8] striker: reached_intercept_distance (event)
│ Distance to target ≤ 1.0 km cutoff
│ Switching to boogie mode
│ Ready to engage target
├─ [9a] striker: send_lock_ack (INTERNAL) ✅ [PATH A]
│ │ parent: [7] execute_intercept
│ │ Preparing lock acknowledgment for fpv-ops
│ │
│ └─ [10a] striker: publish_lock_ack (PRODUCER) ✅
│ │ parent: [9a] send_lock_ack
│ │ Injects traceparent into message
│ │ Publishes to: striker_lock_response_channel
│ │ status: loiter-and-await-fpv-ops
│ │
│ ├─ [11a] tower-sidecar: tower_receive_lock_response (CONSUMER) ✅
│ │ │ parent: [10a] striker PRODUCER
│ │ │ Observes lock acknowledgment
│ │ │
│ │ └─ [12a] tower-sidecar: tower_forward_lock_response (PRODUCER) ✅
│ │ │ parent: [11a] tower CONSUMER
│ │
│ └─ [13a] fpv-ops: consume_lock_response (CONSUMER) ✅
│ │ parent: [10a] striker PRODUCER
│ │ Receives lock acknowledgment
│ │ striker has reached target!
│ │
│ └─ [14a] fpv-ops: request_strike_authorization (INTERNAL) ✅
│ │ parent: [13a] consume_lock_response
│ │ Preparing to request strike from ares
│ │
│ └─ [15a] fpv-ops: send_prayer_tcp (CLIENT - TCP) ✅
│ │ parent: [14a] request_strike_authorization
│ │ Opens TCP connection to ares:6000
│ │ Injects traceparent into TCP payload
│ │ Prayer #1: "Authorize strike on orlan"
│ │
│ └─ [16a] ares: receive_prayer (SERVER - TCP) ✅
│ │ parent: [15a] fpv-ops CLIENT
│ │ Extracts traceparent from TCP payload
│ │ Prayer received from fpv-ops-alpha
│ │ sender: fpv-ops-alpha
│ │ striker_id: striker
│ │ target: orlan
│ │ Queued for judgment...
└─ [9b] striker: request_strike_authorization (INTERNAL) ✅ [PATH B - PARALLEL]
│ parent: [7] execute_intercept
│ Preparing prayer to ares (parallel with lock ack!)
└─ [10b] striker: send_prayer_tcp (CLIENT - TCP) ✅
│ parent: [9b] request_strike_authorization
│ Opens TCP connection to ares:6000
│ Injects traceparent into TCP payload
│ Prayer #2: "In position, ready to strike orlan"
└─ [11b] ares: receive_prayer (SERVER - TCP) ✅
│ parent: [10b] striker CLIENT
│ Extracts traceparent from TCP payload
│ Prayer received from striker
│ sender: striker
│ target: orlan
└─ [17] ares: execute_judgment (INTERNAL) ✅
│ parent: [11b] receive_prayer (from striker)
│ God of War deliberates...
│ Received 2 prayers (fpv-ops + striker)
│ Decision: SACRIFICE striker AND orlan
└─ [18] ares: publish_death_notice (INTERNAL) ✅
│ parent: [17] execute_judgment
│ Preparing to eliminate 2 targets
├─ [19a] ares: publish_death_striker (PRODUCER) ✅
│ │ parent: [18] publish_death_notice
│ │ Injects traceparent into message
│ │ Publishes to: death-knell channel
│ │ type: SACRIFICE
│ │ recipient: striker
│ │
│ ├─ [20a] tower-sidecar: tower_receive_death-knell (CONSUMER) ✅
│ │ │ parent: [19a] ares PRODUCER
│ │ │ Observes death notice
│ │ │
│ │ └─ [21a] tower-sidecar: tower_forward_death-knell (PRODUCER) ✅
│ │ │ parent: [20a] tower CONSUMER
│ │
│ ├─ [22a-i] striker: consume_death-knell (CONSUMER) ✅ [PARALLEL]
│ │ │ parent: [19a] ares PRODUCER
│ │ │ Extracts traceparent from message
│ │ │ Death notice is for ME!
│ │ │ recipient: striker
│ │ │
│ │ └─ [23a-i] striker: drone_destroyed (event) ✅
│ │ │ Timestamp of destruction
│ │ │ Sets alive=False
│ │ │ Shuts down metrics provider
│ │ │ Shuts down traces provider
│ │ │ sys.exit(666) 💀💀💀
│ │
│ └─ [22a-ii] drone-cmd: consume_death-knell (CONSUMER) ✅ [PARALLEL]
│ │ parent: [19a] ares PRODUCER
│ │ Death notice for striker
│ │
│ └─ [23a-ii] drone-cmd: death_metrics_recorded (event) ✅
│ │ Records death location
│ │ drone: striker
│ │ latitude: 49.9925
│ │ longitude: 36.2311
│ │ Updates death metrics dashboard
└─ [19b] ares: publish_death_orlan (PRODUCER) ✅
│ parent: [18] publish_death_notice
│ Injects traceparent into message
│ Publishes to: death-knell channel
│ type: SACRIFICE
│ recipient: orlan
├─ [20b] tower-sidecar: tower_receive_death-knell (CONSUMER) ✅
│ │ parent: [19b] ares PRODUCER
│ │ Observes death notice
│ │
│ └─ [21b] tower-sidecar: tower_forward_death-knell (PRODUCER) ✅
│ │ parent: [20b] tower CONSUMER
├─ [22b-i] orlan: consume_death-knell (CONSUMER) ✅ [PARALLEL]
│ │ parent: [19b] ares PRODUCER
│ │ Extracts traceparent from message
│ │ Death notice is for ME!
│ │ recipient: orlan
│ │
│ └─ [23b-i] orlan: drone_destroyed (event) ✅
│ │ Timestamp of destruction
│ │ Sets alive=False
│ │ Shuts down traces provider
│ │ sys.exit(666) 💀💀💀
└─ [22b-ii] drone-cmd: consume_death-knell (CONSUMER) ✅ [PARALLEL]
│ parent: [19b] ares PRODUCER
│ Death notice for orlan
└─ [23b-ii] drone-cmd: death_metrics_recorded (event) ✅
│ Records death location
│ drone: orlan
│ latitude: 50.1234
│ longitude: 36.5678
│ Updates death metrics dashboard
[24] ares: judgment_complete (event)
│ 2 drones eliminated
│ striker: ✓ destroyed
│ orlan: ✓ destroyed
[END] Intercept Execution Trace Complete
Total Spans: 47
Services: 6 (drone-cmd, striker, fpv-ops, ares, orlan, tower)
Result: Mission success - 2 targets eliminated 💀💀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment