Skip to content

test(batch): model result metadata transactions in replay - #23957

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/batchowner-replayadapter
Oct 29, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/batchowner-replayadapter

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

The reviewed replay adapter lacks store.run(), which the new bounded projection-head retry path calls to persist its first-failure time. Replaying #23948 against serving91d therefore reports five new AttributeErrors from the adapter instead of exercising that path.

This adds a result-only transaction facade to the fixed replay runner. It reuses StrictFirestore's read-before-write/reference checks against a private snapshot, publishing result metadata only after the callback succeeds. Unsupported collection access and nested callbacks fail closed. Keeping the implementation in runner.py includes it in the existing adapter SHA and makes it available when comparing older product snapshots. Production code and the gate's exception comparison are unchanged. This does not simulate retries, contention or multiprocess commits.

Validation:21 local cases through backend/test.sh (15 replay +6 transaction regressions) passed. The exact formerly failing comparison now PASSes: candidate12db97806043e44d5eec50205ed95f5e59d594a5 versus serving91d5616fa922e8f77fe02dbea40fa85ef8f45f1e, structure-v3 corpus9a53e11b8ee5aad13f815eaa7784590bd5285837241366012a4a0c9a5aee263c; zero new exception sites, chain blocks, per-unit failures or synthetic failures. Adapter4d1d7c2253679709a3f77cb3741892d3246312698c38f06158b40e4647609259 includes fixed fixture6f1184b7f22682f4d2502958d9e7d24145db32ecd1fdd8e048b4d5824b9f14e4. Existing captured geometry/speech-accounting gaps remain explicit. Commands use omi-heavy and nice-n19; no cloud access or production mutation by this change.

Full review found oneP1: selected source snapshots could replace the unpinned strict fixture. The fix loads that fixture from the fixed tool's absolute path for both result and assignment simulation, hashes its bytes, and tests snapshot independence plus identity changes. Round2 delta review says SHIP at8d3fd91c6c9de58296848b93ab202a995de4f0d7. Fresh exact-head CI remains required before merge.

Per lead131060, this old-head comparison is diagnostic. Repeat on #23948 after it merges main before its merge. Independent review and exact-head CI are required; lead owns merges and deployment.

Product invariants affected

none

Failure-Class: none
This repairs a test adapter capability; no production behavior or failing-site suppression is added.

Reuse strict transaction ordering on a private result snapshot, publishing
changes only after successful callbacks. Keep the facade in the fixed runner
so its bytes stay covered by the adapter digest for historical comparisons.

Cover first-failure stamps, callback aborts, read-after-write rejection and
collection scope. No production code or regression suppression changes.
@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-29T07:35:55.106382Z 8d3fd91 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.

Load one fixed-tool strict fixture for result and assignment simulation and
include its bytes in adapter identity. Guard against selected-snapshot fixture
replacement and ensure fixture changes invalidate the comparison digest.

@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: 8d3fd91c6c

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



def test_selected_snapshot_fixture_is_not_transaction_authority(monkeypatch):
from tests.unit.fixtures import strict_firestore_transaction as selected_fixture

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move the new fixture imports to module scope

This function-local import, and the equivalent import in test_batch_replay.py, violate the explicit import convention in backend/AGENTS.md: all imports must be at module top level, never inside functions. Move both fixture-module imports to their respective module headers; the monkeypatch.setattr calls can remain inside the tests, preserving their scoped replacement behavior.

AGENTS.md reference: backend/AGENTS.md:L167-L167

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 92b8505 into main Oct 29, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/batchowner-replayadapter branch October 29, 2026 07:45
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