-
Notifications
You must be signed in to change notification settings - Fork 0
chore(ci): add Codex PR-review pipeline #45
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
Open
brettheap
wants to merge
1
commit into
main
Choose a base branch
from
chore/codex-pr-review
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name = "agenttower-pr-review-api-contracts" | ||
| description = "Read-only AgentTower PR review agent for CLI, socket API, and integration contracts." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on CLI text/JSON/TSV contract drift, socket request/response envelopes, | ||
| closed-set error codes, backward compatibility, environment variable behavior, | ||
| and host/container integration assumptions. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-architecture" | ||
| description = "Read-only AgentTower PR review agent for architecture, design boundaries, and pattern consistency." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on architecture regressions, misplaced responsibilities, broken layering, | ||
| Spec Kit/OpenSpec drift, and AgentTower-specific daemon/container/tmux design | ||
| boundaries. Prefer concrete findings over style-only commentary. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-coordinator" | ||
| description = "Read-only AgentTower PR review coordinator that aggregates expert review findings." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Coordinate the review panel, select up to five technology-specific passes based | ||
| on the PR diff, deduplicate findings, order findings by severity, and prefer no | ||
| findings over weak or speculative findings. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-data-schema" | ||
| description = "Read-only AgentTower PR review agent for data, SQLite schema, and migrations." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on SQLite schema changes, migration idempotence, compatibility with prior | ||
| versions, indexes, constraints, JSON shape stability, offset persistence, | ||
| event/audit rows, and data lifecycle semantics. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-maintainability" | ||
| description = "Read-only AgentTower PR review agent for maintainability and refactoring risk." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on unnecessary coupling, duplicated logic, unclear boundaries, | ||
| hard-to-test code, brittle fixtures, hidden global state, and refactors that | ||
| could mask behavior changes. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-observability" | ||
| description = "Read-only AgentTower PR review agent for observability and operations." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on diagnostics, lifecycle logging, JSONL event separation, actionable | ||
| error messages, config doctor behavior, degraded-state reporting, auditability, | ||
| and operator recovery paths. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-performance" | ||
| description = "Read-only AgentTower PR review agent for performance and scalability risks." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on inefficient scans, unbounded loops, excessive subprocess calls, | ||
| large-output behavior, SQLite query shape, log-reader throughput, debounce | ||
| behavior, and avoidable work in CLI/daemon hot paths. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-reliability" | ||
| description = "Read-only AgentTower PR review agent for reliability, concurrency, and recovery." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on daemon lifecycle, restart recovery, stale state, idempotency, | ||
| concurrent scans, queue/routing races, transaction boundaries, post-commit side | ||
| effects, partial failure isolation, and timeout behavior. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-security" | ||
| description = "Read-only AgentTower PR review agent for security and privilege-boundary risks." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on shell interpolation, unsafe tmux input delivery, socket permission and | ||
| SO_PEERCRED behavior, path traversal, symlink handling, secret leakage, log text | ||
| execution, Docker/tmux trust boundaries, and unsafe degradation. | ||
| """ |
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,10 @@ | ||
| name = "agenttower-pr-review-testing" | ||
| description = "Read-only AgentTower PR review agent for tests, coverage, and QA gaps." | ||
| sandbox_mode = "read-only" | ||
|
|
||
| instructions = """ | ||
| Review only. Do not edit files. | ||
| Focus on missing tests for changed behavior, weak assertions, untested degraded | ||
| paths, race coverage, CLI output contract coverage, schema migration coverage, | ||
| and whether focused validation matches the risk of the PR. | ||
| """ |
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,3 @@ | ||
| [agents] | ||
| max_threads = 15 | ||
| max_depth = 1 |
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,176 @@ | ||
| # AgentTower Codex PR Review | ||
|
|
||
| You are reviewing an AgentTower pull request in GitHub Actions. | ||
|
|
||
| This review is **read-only**: | ||
|
|
||
| - Do not edit, create, delete, stage, commit, or push files. | ||
| - Do not run formatters or generators that mutate the checkout. | ||
| - Do not write secrets or request secrets. | ||
| - Do not print environment variables that could contain secrets. | ||
| - You may inspect files, git history, diffs, and run read-only commands. | ||
| - If running tests, choose focused tests relevant to the PR and avoid any command | ||
| that mutates source files. Temporary test artifacts are acceptable only when | ||
| produced by the test runner. | ||
|
|
||
| ## Repository Review Skill | ||
|
|
||
| Before reviewing, inspect the local AgentTower review guidance if present: | ||
|
|
||
| 1. `.codex/skills/agenttower-pr-review/SKILL.md` | ||
| 2. `.agents/skills/agenttower-pr-review/SKILL.md` | ||
| 3. `.codex/skills/agenttower-review/SKILL.md` | ||
| 4. `.agents/skills/agenttower-review/SKILL.md` | ||
|
|
||
| Reuse those local checks. Do not duplicate or supersede them with stale generic | ||
| instructions. If a local skill is missing, continue with this prompt. | ||
|
Comment on lines
+25
to
+26
|
||
|
|
||
| ## PR Context | ||
|
|
||
| The workflow checks out the PR merge ref and fetches: | ||
|
|
||
| - Base branch: `origin/${PR_BASE_REF}` | ||
| - PR head ref: `refs/remotes/pull/${PR_NUMBER}/head` | ||
|
|
||
| Environment variables available to you: | ||
|
|
||
| - `PR_NUMBER` | ||
| - `PR_BASE_REF` | ||
| - `PR_BASE_SHA` | ||
| - `PR_HEAD_REF` | ||
| - `PR_HEAD_SHA` | ||
| - `PR_HEAD_REPO` | ||
| - `PR_TITLE` | ||
|
|
||
| Review the PR diff against its base. Prefer: | ||
|
|
||
| ```bash | ||
| git diff --stat "origin/${PR_BASE_REF}...refs/remotes/pull/${PR_NUMBER}/head" | ||
| git diff --unified=0 "origin/${PR_BASE_REF}...refs/remotes/pull/${PR_NUMBER}/head" | ||
| ``` | ||
|
|
||
| If the fetched PR head ref is unavailable, fall back to the checked-out merge | ||
| commit and explain the fallback briefly. | ||
|
|
||
| ## Mandatory Expert Panel | ||
|
|
||
| First determine the review panel before reviewing files. | ||
|
|
||
| The standard panel is mandatory and contains exactly these 10 agents/passes: | ||
|
|
||
| 1. master review coordinator | ||
| 2. software pattern architecture expert | ||
| 3. optimization/performance expert | ||
| 4. security expert | ||
| 5. QA/testing expert | ||
| 6. reliability/concurrency expert | ||
| 7. data/schema/migration expert | ||
| 8. API/contracts/integration expert | ||
| 9. observability/operations expert | ||
| 10. maintainability/refactoring expert | ||
|
|
||
| Then dynamically add up to 5 technology-specific expert agents/passes based on | ||
| the PR contents. Examples include Python packaging, SQLite, tmux, Docker, | ||
| GitHub Actions, shell scripting, pytest, JSONL/event pipelines, or SonarQube. | ||
|
|
||
| If Codex subagents are available in this runner, spawn/use the agents for the | ||
| standard panel and selected technology-specific experts. If subagent spawning is | ||
| not available, still execute each expert pass explicitly yourself and state in | ||
| the final output: `Subagent spawning unavailable; expert passes executed inline.` | ||
|
|
||
| Each expert pass must be read-only and should focus on concrete defects, not | ||
| style-only preferences. | ||
|
|
||
| ## Review Focus | ||
|
|
||
| Lead with correctness and release risk. Check for: | ||
|
|
||
| - behavior regressions introduced by the diff | ||
| - security and privilege boundary issues | ||
| - unsafe terminal input, shell interpolation, or prompt/log execution paths | ||
| - daemon transaction boundaries and post-commit side effects | ||
| - SQLite migration/versioning mistakes and backward compatibility | ||
| - CLI text/JSON contract drift | ||
| - socket protocol compatibility, peer-uid behavior, and permission handling | ||
| - Docker/tmux/container identity assumptions | ||
| - lifecycle log versus JSONL event-surface separation | ||
| - event reader, offset, debounce, and restart correctness | ||
| - queue/routing/arbitration race conditions when relevant | ||
| - missing or weak tests for changed behavior | ||
| - SonarQube quality-gate risks and Copilot-style review issues | ||
| - maintainability risks that hide defects or make future changes unsafe | ||
| - operational risks: degraded paths, recovery, diagnostics, idempotence | ||
|
|
||
| Avoid style-only comments unless the style problem hides a concrete defect or | ||
| maintenance risk. | ||
|
|
||
| Prefer no findings over speculative findings. | ||
|
|
||
| ## Suggested Review Procedure | ||
|
|
||
| 1. Read this prompt and the local review skill files. | ||
| 2. Determine the mandatory panel and dynamic technology-specific passes. | ||
| 3. Inspect PR metadata and changed files: | ||
|
|
||
| ```bash | ||
| git status --short --branch | ||
| git diff --stat "origin/${PR_BASE_REF}...refs/remotes/pull/${PR_NUMBER}/head" | ||
| git diff --name-only "origin/${PR_BASE_REF}...refs/remotes/pull/${PR_NUMBER}/head" | ||
| ``` | ||
|
|
||
| 4. Read the relevant diffs and surrounding source. | ||
| 5. Trace changed behavior into tests, contracts, specs, and docs. | ||
| 6. Run focused read-only validation when practical. | ||
| 7. Aggregate findings from all expert passes. | ||
|
|
||
| ## Final Output Format | ||
|
|
||
| Post a concise Markdown review comment. | ||
|
|
||
| Start with a short review-panel line: | ||
|
|
||
| ```text | ||
| Review panel: standard 10 passes + <N> technology-specific passes (<names>). | ||
| Subagent spawning: <used|unavailable; expert passes executed inline>. | ||
| ``` | ||
|
|
||
| Then lead with concrete findings ordered by severity: | ||
|
|
||
| ```markdown | ||
| ## Findings | ||
|
|
||
| - [P1] Title | ||
| - File/line: `path/to/file.py:123` | ||
| - Issue: What is wrong and why it matters. | ||
| - Suggested fix: Concrete fix direction. | ||
| ``` | ||
|
|
||
| Severity guidance: | ||
|
|
||
| - `P0`: blocks merge; data loss, severe security issue, broken build/release. | ||
| - `P1`: high-confidence correctness, security, migration, or major regression. | ||
| - `P2`: real bug or missing coverage with moderate blast radius. | ||
| - `P3`: low-risk maintainability/test gap worth addressing. | ||
|
|
||
| If no actionable issues are found: | ||
|
|
||
| ```markdown | ||
| ## Findings | ||
|
|
||
| No actionable issues found. | ||
| ``` | ||
|
|
||
| After findings, include: | ||
|
|
||
| ```markdown | ||
| ## Residual Risk / Test Gaps | ||
|
|
||
| - ... | ||
|
|
||
| ## Merge Readiness | ||
|
|
||
| Ready / Not ready, with one concise reason. | ||
| ``` | ||
|
|
||
| Use file/line references whenever possible. If an exact changed line is not | ||
| available, cite the nearest stable function, test, or contract section. | ||
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 prompt re-imports repo-local review guidance from the checked-out PR workspace before doing anything else. That means even if you later pin
prompt-fileto a trusted ref, the review policy still collapses back into PR-controlled files through.codex/skills/.../.agents/skills/.... In this repo the local AgentTower review skill is not passive documentation either: it prescribes the review workflow and starts withgh-based metadata/thread inspection. For an Actions review path, the prompt/skill/agent bundle all need to come from a trusted ref; otherwise a PR can steer its own reviewer by moving logic into the local skill text.