feat(11-C2): per-Play span socket listener #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/11-phase-c2-span-socket"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase C2 of #11. Mirror of Phase B (#16, merged) on the Rust side: this listener consumes the JSONL events the SDK writes and turns them into
Play.spansrows on disk.Module:
engine/span_socket.rsSpanListener::new(play_sid, domain).bind()/tmp/spans-{play_sid}.sock. Must complete before the Python subprocess is spawned (Phase C3 enforces this) soaccept()doesn't race the Pythonconnect()..run(listener)JoinHandle<()>for the executor to await on subprocess exit.play_socket_path(sid)HERO_FLOW_SPAN_SOCKwithout depending onSpanListenerinternals.Behavioural details
span_start— a duplicate event for the samespan_id(flaky reconnect) updates the existing row rather than appending.span_startwith initial tags + laterspan_tagevents accumulate via JSON merge.SpanStatus→Failed— Python/Rust contract drift surfaces visibly; never silently maps toOk.play_get/play_set— known O(events) storage churn. Acceptable for C2 simplicity; can buffer if profiling shows it as a hotspot.Tests
13 total: 8 unit + 5 integration.
SpanListener::with_socket_path(cfg(test)-only) so parallel test runs don't collide on/tmp/spans-*.sockwhen OSIS hands every fresh tempdir database the same first SID.What this PR is NOT
play_startrouting (C4).Phase plan (#11)
hero_tracing.pySDK (#16, merged)play_startroutingTest plan
cargo test -p hero_logic --lib span_socket— 13/13 passcargo test --workspace --lib— 23 total, all greencargo build --workspaceclean🤖 Generated with Claude Code