Replace review.sh with run_agent.py and extract review prompt template#89
Merged
Conversation
Implements a universal Python script to run prompt templates against the auggie coding agent. Resolves template paths, substitutes environment variables (DRAFT_REPO_DIR, DRAFT_BRANCH, DRAFT_BASE_BRANCH, DRAFT_SPEC_FILE), validates auggie auth, and handles output verdicts (approval if no issues found, rejection if FOUND_ISSUES present). Includes comprehensive test coverage for all functionality. Will serve as a reviewer in the review-implementation step of config.yaml.
…_DIR - Replace `"FOUND_ISSUES" in stdout` guard with `stdout.strip()` — review contract treats any non-empty output as rejection, not just sentinel - Require only `DRAFT_REPO_DIR` up front; collect remaining vars from env as optional substitutions — templates may use only a subset of vars - Update approval test to return `""` instead of `"NO_ISSUES"` to match the real approval signal - Update missing-var test to pop `DRAFT_REPO_DIR`, the only mandatory var
…ie PATH
- Delete scripts/review.sh — review issue: old bash script was not removed
when run_agent.py was introduced as its replacement
- Add scripts/review.md with prompt extracted from review.sh — review issue:
run_agent.py requires a template file but the prompt was never migrated out
of the deleted script
- Convert ${VAR} bash syntax to {VAR} brace syntax in review.md — required by
run_agent.py's fill_template substitution logic
- Remove FOUND_ISSUES sentinel contract from review.md output rules — review
issue: run_agent.py forwards all non-empty stdout, no sentinel filtering
- Add shutil.which("auggie") guard before subprocess.run — review issue:
missing PATH check would surface as opaque FileNotFoundError traceback
The test now mocks shutil.which alongside subprocess.run to simulate auggie being available, fixing CI failures when auggie is not installed in the test environment.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Converted the review script from bash to Python for improved maintainability and testability. Extracted the review prompt from the script into a separate
scripts/review.mdtemplate file. The newrun_agent.pyis a universal agent runner that:Test plan