Skip to content

test(pusher): replay content-free record-path session traces - #24106

Merged
Git-on-my-level merged 2 commits into
mainfrom
retro/record-traces
Oct 30, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
retro/record-traces

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a content-free replay corpus for the pusher record path (seal, sticky upload failure, producer tokens, batch admission barrier) and a runner that drives each trace through the real routers.pusher websocket handler.

Batch shadow re-runs recognition on stored audio and never exercises this path. Both 10-29/30 live batch stops and the current unsealed no-transcript backlog were on it, so a record-path change had no pre-deploy replay. This gives one: add a trace per incident, in the PR that fixes it.

  • backend/testing/record_traces/traces/*.json: record-trace/1 fixtures (row seed, websocket sessions as 103/101/104 frames with an upload outcome, expected end state). Durations and protocol shape only: no audio, IDs or user content.
  • backend/tests/unit/test_record_traces.py: replays each trace with the existing strict-Firestore and recording fakes. Finalize-only traces run with AUDIO_DURABLE_OUTBOX_ENABLED both off and on. Traces with audio run legacy-only, and the corpus check refuses durable-plus-audio until an outbox fake exists, so a durable replay can never pass without exercising custody. It asserts sealed, upload_failed, open_tokens and whether require_record_audio_barrier would admit the row.
  • Seven goldens pin main a05342f:
    • a reconnect that finalizes with no new audio (unsealed-rca path 1), with and without an earlier audio session;
    • the batch_sync_v1 owner;
    • a legacy owner that is never sealed;
    • an exhausted upload followed by a clean reconnect;
    • one session that uploads audio and finalizes;
    • a drained-pod producer token that blocks the seal, marked known_gap for the sealsweep fix (fix: recover unsealed no-job batch captures with digest-gated backfill #24104) to flip.
  • Finding pinned by the exhausted-upload trace: the failed session's producer token stays on the row. This is harmless for admission because record_upload_failed is sticky, but a dead-token sweeper must keep requiring record_upload_failed == false.

Test-only: no runtime code, flags or deploy.

Test plan

  • cd backend && python -m pytest tests/unit/test_record_traces.py -q: 11 passed locally (7 traces × their modes, plus the corpus shape check).
  • Bounded pre-push gate passed.

Archive listing and tail durability are proved at admission against storage and are not modeled here.

🤖 Generated with Claude Code

Batch shadow re-runs recognition on stored audio and never exercises the
pusher record path (seal, sticky upload failure, producer tokens, admission
barrier), where the 10-29/30 live batch stops and the unsealed no-transcript
backlog came from. Add a record-trace/1 corpus and a runner that drives each
trace through the real pusher handler with strict Firestore fakes, once per
durable mode. Six goldens pin current main, including the drained-pod token
gap (known_gap, flipped by the fix) and that an exhausted upload leaves its
producer token on the row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T09:50:05.803647Z 0a70823 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…na r1)

The durable outbox commits audio to storage the runner does not fake, so a
durable audio replay could pass without exercising custody. Refuse that
combination in the corpus check, run audio traces in legacy mode, and add a
finalize-only batch_live_v1 trace that runs in both modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 56265ae into main Oct 30, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the retro/record-traces branch October 30, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant