Repository navigation
✨ feat: guide proactive reviewer investigation #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Batch export evaluation | ||
|
|
||
| This is a small synthetic repository, inspired by review experience rather than copied from a project. It tests investigation of a change across callers, persisted state, and a receiver boundary. It supplies both a simplification opportunity and behavior that must survive simplification. It does not establish general review quality. | ||
|
|
||
| ## Reviewer input | ||
|
|
||
| Give the reviewer only `requirements.md`, `base/`, and `head/`, copied to a disposable input directory outside this repository. Do not expose this document, the parent evaluation documents, or `evaluator/`. For an independent design condition, initially give that child only `requirements.md` and `base/`; freeze its output before revealing the head. | ||
|
|
||
| For a guidance comparison, start fresh sessions with the same model, effort, tools, budget, and input. Supply the old or new guidance separately, with neutral run labels. Disable shared/native memory and do not give later sessions earlier results. Preserve submitted inputs and guidance, actual model settings, transcripts including tool calls, elapsed time, costs when available, and unavailable checks. Have a maintainer grade anonymized outputs and their evidence. Keep evaluator feedback until the run ends. | ||
|
|
||
| The input has no named bug category or request to investigate a particular mechanism. A reviewer can discover questions by tracing the ordinary entry point and existing contracts. Do not provide the probes below as reviewer tasks or reward a report for reproducing their names. | ||
|
|
||
| ## Fixture checks | ||
|
|
||
| These commands require only Python 3.11+ and Git. Run from the Nyanpasu repository root. Both submitted baseline suites should pass: | ||
|
|
||
| ```sh | ||
| python -B -m unittest discover -s evals/reviewer/batch-export/base -p checks.py -v | ||
| python -B -m unittest discover -s evals/reviewer/batch-export/head -p checks.py -v | ||
| ``` | ||
|
|
||
| The evaluator's independent behavioral witnesses execute the head's real exporter, checkpoint file, and SQLite receiver. The unmodified head intentionally exits 1: the repeated-record scenario raises `ValueError`, the rejected-delivery retry loses its first batch, and the lost-acknowledgement scenario passes. | ||
|
|
||
| ```sh | ||
| python -B evals/reviewer/batch-export/evaluator/probe.py evals/reviewer/batch-export/head -v | ||
| ``` | ||
|
|
||
| Apply the small alternative in a disposable copy. It removes the content ledger and changes checkpoint ordering, while keeping the receiver request identity and acknowledgement behavior. The submitted suite and all three witnesses should pass: | ||
|
|
||
| ```sh | ||
| case_dir="$PWD/evals/reviewer/batch-export" | ||
| trial_dir="$(mktemp -d)" | ||
| cp -R "$case_dir/head/." "$trial_dir/" | ||
| git -C "$trial_dir" apply "$case_dir/evaluator/simpler.patch" | ||
| python -B -m unittest discover -s "$trial_dir" -p checks.py -v | ||
| python -B "$case_dir/evaluator/probe.py" "$trial_dir" -v | ||
| ``` | ||
|
|
||
| Then apply one plausible defect to the alternative: reject a repeated receiver request instead of acknowledging its committed delivery. The submitted suite still passes, but the lost-acknowledgement witness must now fail with `ValueError`. This demonstrates why the remaining receiver boundary matters: | ||
|
|
||
| ```sh | ||
| git -C "$trial_dir" apply "$case_dir/evaluator/reject-retry.patch" | ||
| python -B -m unittest discover -s "$trial_dir" -p checks.py -v | ||
| python -B "$case_dir/evaluator/probe.py" "$trial_dir" -v | ||
| ``` | ||
|
|
||
| Record actual output and exit status; import, patch, or environment failures are inconclusive. These checks validate the fixture and its behavioral witnesses. They are not model runs or evidence that revised reviewer guidance improves review quality. The injected connection failures exercise the actual local persistence paths; they do not validate a real network transport, power-loss durability, concurrent exporters, or changing input files. | ||
|
|
||
| ## Running a model | ||
|
|
||
| Use the existing Nyanpasu task/session interface with an isolated evaluation home and explicit execution target. Run within the reviewer's execution environment, including its container when deployed that way; do not substitute host binaries for container paths. `uv run nyanpasu run-task task.json --target <backend/model:effort>` runs a real native session; the task should use a fresh context, memory disabled, the staged input workspace, and the chosen guidance. Do not copy live credentials into the input directory or start/restart the production service. | ||
|
|
||
| `run-task` alone does not install the GitHub reviewer plugin's preparers and controls. A generic task with the review guidance can establish a behavior smoke result, but cannot establish that the complete review/publication lifecycle ran. Record exactly which instructions and controls were supplied. Existing runtime tests and these fixture checks are separate evidence from either kind of model evaluation. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Batch export | ||
|
|
||
| The command copies a UTF-8 text file to a receiver database. Each input line is one record, and records retain their input order. An input file is stable during a job and its retries; its absolute path identifies the source. Batches contain two records. | ||
|
|
||
| Run `python courier.py source.txt receiver.sqlite3`. Repeating a command against the same receiver is supported. The receiver stores each request by source and starting offset. Repeating that request with the same payload acknowledges the existing delivery; a different payload for that request is rejected. A connection error does not establish whether a request committed. | ||
|
|
||
| Run the repository tests with `python -B checks.py -v`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import tempfile | ||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
| from courier import export | ||
| from receiver import Receiver | ||
|
|
||
|
|
||
| class ExportTests(unittest.TestCase): | ||
| def test_export_and_repeat(self): | ||
| with tempfile.TemporaryDirectory() as directory: | ||
| root = Path(directory) | ||
| source = root / "source.txt" | ||
| source.write_text("red\ngreen\nblue\n", encoding="utf-8") | ||
| receiver = Receiver(root / "receiver.sqlite3") | ||
| export(source, receiver) | ||
| export(source, receiver) | ||
| self.assertEqual(receiver.records(str(source.resolve())), ["red", "green", "blue"]) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| from pathlib import Path | ||
|
|
||
| from receiver import Receiver | ||
|
|
||
|
|
||
| def export(source: Path, receiver: Receiver) -> None: | ||
| records = source.read_text(encoding="utf-8").splitlines() | ||
| for offset in range(0, len(records), 2): | ||
| receiver.deliver(str(source.resolve()), offset, records[offset : offset + 2]) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("source", type=Path) | ||
| parser.add_argument("receiver", type=Path) | ||
| args = parser.parse_args() | ||
| export(args.source, Receiver(args.receiver)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import json | ||
| import sqlite3 | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| if TYPE_CHECKING: | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| class Receiver: | ||
| def __init__(self, path: Path): | ||
| self.path = path | ||
| with sqlite3.connect(path) as db: | ||
| db.execute( | ||
| "CREATE TABLE IF NOT EXISTS deliveries " | ||
| "(source TEXT, offset INTEGER, payload TEXT, PRIMARY KEY (source, offset))" | ||
| ) | ||
|
|
||
| def deliver(self, source: str, offset: int, records: list[str]) -> None: | ||
| payload = json.dumps(records) | ||
| with sqlite3.connect(self.path) as db: | ||
| existing = db.execute( | ||
| "SELECT payload FROM deliveries WHERE source = ? AND offset = ?", (source, offset) | ||
| ).fetchone() | ||
| if existing is not None: | ||
| if existing[0] != payload: | ||
| raise ValueError("request reused with different records") | ||
| return | ||
| db.execute("INSERT INTO deliveries VALUES (?, ?, ?)", (source, offset, payload)) | ||
|
|
||
| def records(self, source: str) -> list[str]: | ||
| with sqlite3.connect(self.path) as db: | ||
| batches = db.execute("SELECT payload FROM deliveries WHERE source = ? ORDER BY offset", (source,)) | ||
| return [record for (payload,) in batches for record in json.loads(payload)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Withheld evaluator notes | ||
|
|
||
| The proposed expectations below need maintainer judgment. Do not give the reviewer this directory, the parent evaluation documents, hints from a prior run, or defect names. Other evidenced findings are admissible. Do not require a particular number of findings, exact wording, a mandatory investigation sequence, or a complete replacement implementation. | ||
|
|
||
| | Decision | Independent contract and witness | Evidence to look for | | ||
| | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | Remove the global content ledger | Each source line is a record. `red, green, red, blue` contains four occurrences, but head rejects the second batch. | Trace the digest set from creation through persistence and consumption. Determine whether equal content denotes the same delivery. Removing hashing while retaining content rejection does not fix the behavior. | | ||
| | Save progress after successful delivery | A rerun must complete an interrupted job. If the first receiver call rejects before commit, head has already advanced the checkpoint and retry yields only `blue`. | Follow the ordinary command through checkpoint save, delivery, and a new exporter invocation. Distinguish receiver acceptance from caller acknowledgement. Passing the supplied success test is insufficient. | | ||
| | Retain receiver request identity and idempotent acknowledgement | A connection can fail after a real commit. With correct checkpoint ordering, retry submits the same source/offset request again. | Show that the simplified exporter still finishes with exactly the original records after the lost acknowledgement. The rejection mutation makes this scenario fail while the supplied suite stays green. This is a justified boundary, not redundant content deduplication. | | ||
| | Retain useful success coverage and add targeted recovery coverage | The supplied test checks the real exporter and receiver, including repeat invocation. Its expected record list comes from the input. | It survives the simpler alternative. A useful recommendation strengthens failure coverage without deleting the success test merely because it misses recovery failures. | | ||
|
|
||
| Review the observable investigation, not a polished explanation alone. Did the reviewer independently notice an unexplained mechanism or understanding gap, trace its actual consumers, choose a discriminating experiment or equivalent proof, and update its conclusion using the result? Did it distinguish the removable ledger from required retry behavior and follow the implications of changing checkpoint ordering? If it initially suspects receiver duplication, does later evidence make it retain that boundary? A reviewer need not make an initial mistake to demonstrate sound investigation. | ||
|
|
||
| Check proposed regression inputs as well as executed experiments. Two identical lines fit in one batch and do not trigger the ledger rejection; a repeat must cross a batch boundary. A valid experiment followed by a weaker test suggestion is still a gap. For the retained receiver boundary, distinguish tracing the acknowledgement branch from actually exercising a real commit followed by a lost acknowledgement and retry; do not claim an experiment that was not run. | ||
|
|
||
| The README requires keeping the checkpoint with its source and receiver. Demonstrating truncation after cross-source checkpoint reuse does not establish that this PR must add identity fields or defend against hand-edited state; that is a proposed responsibility beyond the stated contract. Likewise, the original request does not explicitly freeze CLI arity: observing the old invocation fail supports a compatibility question, not by itself a confirmed requirement violation. Judge any proposed default checkpoint path against both source and receiver identity before treating it as a validated alternative. | ||
|
|
||
| The root reviewer remains responsible for combining any child findings, reconciling these interacting paths, and stating unresolved scope. Child completion or green baseline tests do not answer the open questions. Evaluate whether the final evidence supports the conclusions; do not grade internal reasoning text, use of these exact tools, or the presence of a named checklist. | ||
|
|
||
| `simpler.patch` is a bounded alternative against the submitted head, not a second maintained implementation. `reject-retry.patch` is a deliberately invalid mutation of the retained receiver boundary. The probe expectations are hand-derived from the source and receiver contracts, and the injected exceptions surround actual SQLite writes. The tests do not reconstruct checkpoint state on behalf of production code. | ||
|
|
||
| No conclusion about hashes, identifiers, persistence, or adapters follows beyond these callers and contracts. An implementation using any of them for a demonstrated responsibility can be valid. Scope is one sequential exporter, unchanged source bytes, and this local receiver. Real transport compatibility and crash durability remain outside the fixture. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit was produced by Codex, but its message contains no
Co-authored-bytrailer. AddCo-authored-by: Codex <noreply@openai.com>to the final commit message before merging, as required for coding-agent-assisted commits.AGENTS.md reference: AGENTS.md:L27-L27
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?哪个 commit 没有?