Skip to content

Commit 4ae2d16

Browse files
authored
Merge pull request #201 from JiusiServe/codex/eval-ci-snapshot-20260927
Freeze archived review replay against live CI reads
2 parents f6b6c85 + f2a8c07 commit 4ae2d16

3 files changed

Lines changed: 37 additions & 0 deletions

File tree

‎eval/dataset/REVIEWBOT_EVAL.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ their pinned historical open snapshot to the installed ReviewBot Direct
4242
pipeline. It requires `POST_MODE=shadow`, `REVIEW_CONTEXT_MODE=no_discussion`,
4343
and `post=False`, and rejects every non-GET GitHub request. ReviewBot's
4444
production rule remains open PRs only (drafts require an explicit request).
45+
The adapter disables live CI-status and branch-rule reads: those results were
46+
not frozen with the historical PRs, so newer ReviewBot releases receive
47+
`ci_evidence.read_status=unavailable` rather than today's post-merge checks.
4548
For a future live open-PR dataset, invoke `run_reviewbot_arm.py` directly
4649
without the replay flag.
4750

‎eval/dataset/reviewbot_archived_replay.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ def historical_pull(pull, *, pr: int, head: str, base: str):
8181
)
8282

8383

84+
def disable_live_ci(github) -> None:
85+
"""Historical CI was not frozen with the PR; never read today's checks.
86+
87+
Installed ReviewBot releases that support a CI snapshot then mark it
88+
unavailable. Older paired wheels do not need these methods, so the same
89+
replay adapter remains compatible with both release generations.
90+
"""
91+
for method in (
92+
"list_commit_statuses", "list_check_runs", "list_required_status_checks",
93+
):
94+
setattr(github, method, None)
95+
96+
8497
def shadow_candidate(body: str, inline_comments: list[dict]) -> str:
8598
"""Include the inline payload that a COMMENT review would publish.
8699
@@ -181,6 +194,7 @@ def list_files(number):
181194

182195
github.get_pull = get_pull
183196
github.list_files = list_files
197+
disable_live_ci(github)
184198
original_inline = publication.inline_review_comments
185199
captured: list[dict] | None = None
186200

‎test/test_reviewbot_eval.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,26 @@ class Pull:
101101
archive.historical_pull(stale, pr=4893, head="a" * 40, base="d" * 40)
102102

103103

104+
def test_archived_replay_cannot_read_live_ci():
105+
class Client:
106+
def list_commit_statuses(self, *_args, **_kwargs):
107+
raise AssertionError("live CI must not be read")
108+
109+
def list_check_runs(self, *_args, **_kwargs):
110+
raise AssertionError("live CI must not be read")
111+
112+
def list_required_status_checks(self, *_args, **_kwargs):
113+
raise AssertionError("live CI must not be read")
114+
115+
client = Client()
116+
archive.disable_live_ci(client)
117+
118+
for method in (
119+
"list_commit_statuses", "list_check_runs", "list_required_status_checks",
120+
):
121+
assert getattr(client, method) is None
122+
123+
104124
def test_shadow_candidate_includes_the_posted_inline_payload():
105125
body = "## Omni ReviewBot review\n\nSummary\n\nSee inline comments below.\n"
106126
comment = {

0 commit comments

Comments
 (0)