Skip to content

test(batch): gate projection changes with structure and boundary replay - #23943

Merged
Git-on-my-level merged 9 commits into
mainfrom
lane/replay
Oct 29, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
lane/replay

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Problem and change

Batch projection fixes have needed another production ramp to encounter deterministic unit-shape failures. Add a fixed offline adapter and make batch-replay REF=<sha> BASE=<sha> CORPUS=<path> OUTPUT=<path> so the lead can compare immutable product revisions before deploying.

The adapter runs the real owner walk, VAD span validator, partition/build, assignment transaction planner against StrictFirestore targets, source-audio slicing against synthetic PCM, and follow-up claims with real fakeredis Lua across copied executor Contexts. It blocks outbound sockets, gRPC channels, and cloud client construction. Bridge/summary external effects are fake leaves.

Capture allowlist and limits

Read-only ro-prod capture selects numeric durations/VAD sample counts; owner/unit/content/conversation/predecessor/watermark/sibling identities; lane, state, attempts, retry presence, recovery state; and target lifecycle/route/privacy flags. It never requests whole speech_spans or manifest.references arrays: Firestore cannot mask element subfields, so requesting them could read nested text or paths. The exact RPC field projections are in backend/testing/batch_replay/capture.py, the README and each corpus. Geometry slots remain null; only synthetic inputs supply geometry. IDs are HMAC-SHA256 with a fresh private corpus salt. No transcript, audio, names, emails, URIs, or error messages are persisted. Corpus/salt stay mode 0600 under a 0700 scratch directory, outside Git.

Live capture contains 2,000 units. All 2,000 lack decoded durations, VAD span arrays and manifest geometry in Firestore. Lead ruling a76a1a explicitly forbids artifact export/decryption and accepts Firestore chain/state/assignment structures plus labelled synthetic geometry. The normal gate always adds the incident fixture and a duration-quantile boundary matrix (EOF minus/exact/plus one sample, invalid VAD overrun, first/last valid slices and invalid source/capture slices). Invalid shapes must be rejected. Reports name coverage_scope=firestore-structure+synthetic-boundaries and retain all missing captured geometry in coverage_limits. Optional strict captured-geometry mode fails those gaps. This PASS cannot claim replay of captured audio/VAD geometry. The follow-up corpus includes one-hop redirect-target lifecycle states. Delete private corpus/salt after the program (David ruling a5c4f6); lead owns that handoff. Tracked in anx card:batch-replay-gate-20261029. No production deploy or data mutation is part of this PR.

Validation

Gate fails new exception sites, regressions on previously exercised units, newly blocked units, synthetic oracle/incident failures, or missing structural coverage. Fixing a head can expose a known downstream conflict on an already-blocked baseline unit; that is recorded separately, while new classes/sites always fail. No .github/ change. Lead owns merges/deploys; one Luna review round is required.

Review fixes

The first Luna review requested a tighter read boundary and dispatch/verdict fidelity. Capture now excludes whole geometry arrays at the RPC mask and never inspects them in sanitization. Unknown outcomes, terminal-empty results without proof, and unknown lanes block replay as coverage gaps. Both main-corpus and incident boundary lists are checked explicitly, independently of exception flattening. Quantiles retain observed duration frequency, and per-unit exception counters catch repeated failures at an existing site. Targeted regressions cover all six review findings; round two is limited to this delta.

Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T04:42:19.743498Z 935f6a7 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c88ffbd506

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +36 to +39
newly_reached = {
unit: sites
for unit, sites in changed_units.items()
if unit in old_blocked and not set(sites).intersection(new_exceptions)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve regressions in independently exercised validation stages

When a baseline unit is assignment-blocked, this exemption also suppresses new vad and source_audio failures at previously known sites. However, runner.py runs those validations for every unit before walking any owner chain, so those stages were already exercised even for blocked units. For example, if the baseline has a source-audio error on another unit and the candidate introduces that same error on a blocked unit whose source validation previously succeeded, compare() returns regression: false. Restrict the exemption to stages actually made unreachable by the baseline chain block, or record stage-level reachability before classifying failures as newly reached.

Useful? React with 👍 / 👎.

Comment on lines +305 to +306
# Descending query is reversed so each chain retains commit order.
units.reverse()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Order captured owner chains by their log sequence

When committed_at timestamps tie or arrive out of order across workers, reversing the timestamp-ordered query does not restore predecessor order. The production merger records caller-supplied now as committed_at, while log_sequence and previous_segment_id establish transactional chain order. The runner anchors its watermark to the predecessor of the first listed unit, so a misordered corpus can start in the middle of an owner chain and never exercise its earlier sampled units. Those identical blocks on candidate and baseline are then accepted by the differential gate. Use the captured sequence or predecessor links to order each sampled owner chain before choosing its starting watermark.

Useful? React with 👍 / 👎.

Comment on lines +500 to +504
'exceptions': dict(sorted(exceptions.items())),
'unit_issues': {key: sorted(value) for key, value in sorted(issues.items())},
'chain_blocks': blocks,
'persisted': len(log.persist_order),
'coverage': dict(sorted(coverage.items())),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare per-unit dispositions to detect newly quarantined results

If a candidate starts quarantining previously successful units, the replay can still report PASS: Session.persist() counts quarantined receipts as persisted and advances the watermark, while the pending check treats any projection receipt as unblocked. Production assign_parts() catches eligible SyncAssignmentConflict exceptions and persists that disposition without an error/retry log, so the exception collector does not detect it either. This report omits receipt states and assigned conversation IDs, leaving compare() unable to distinguish successful assignment from a newly held, unassigned result—even for the healthy synthetic incident units. Include per-unit dispositions in the reports and fail unexpected transitions from successful assignment to quarantine or supersession, while preserving explicitly expected discarded-target quarantines.

Useful? React with 👍 / 👎.

Compare immutable candidate and baseline code using the real projection walk,
assignment planner, VAD/source slice validators, and cross-Context claims.
Capture only field-masked structural metadata; fail incomplete corpora closed.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Luna round 2 returned SHIP at 935f6a71509177058c2f7dd68e5ca818687fd92b after the delta addressed the first-round findings. The 14 targeted regression tests pass, and the corrected adapter passes the serving-SHA structure-plus-synthetic replay.

One nonblocking P2 remains: rows already rejected for unknown structural evidence skip some geometry-gap counters. The gate still fails closed on the structural gap, and the current 2,000-unit corpus has no such unknown rows, so this does not change its verdict. Follow-up replay-rejected-row-coverage is tracked inside the capture/transcription initiative, owner batchowner, next action by 2026-10-30T04:45Z, and handed to the rollout lead. No third review round is being started.

The gate does not claim captured audio/VAD geometry or Firestore contention coverage. Capture's final RPC mask excludes whole geometry arrays, and the receipt explicitly names the approved Firestore-structure plus synthetic-boundary scope.

@Git-on-my-level
Git-on-my-level merged commit fde7178 into main Oct 29, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/replay branch October 29, 2026 04:55
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