feat(review): frontload PR context into the prompt - #22
Conversation
|
Codex review pass — 7 findings, all addressed in 6f3eaa4: Injection (real). A PR body, diff hunk, or CI log containing Artifact boundary. Null as a claim. A files or checks payload missing a field rendered Test strength. The containment assertion now covers names; the degradation loop asserts each endpoint's specific missing-data sentence rather than just exit 0; the diff assertions check the body, not only the heading. Separately, running the step against this PR found a bug Codex could not see statically: Note on validation: the |
There was a problem hiding this comment.
Review
Blocking Issues
.github/workflows/claude-pr-review.yml:309—gh pr diffdoes not accept--allow-escape-sequences. Verified against theghon anubuntu-latestrunner:unknown flag: --allow-escape-sequences, exit 1. The flag belongs togh apiand is not persistent, so it does not carry togh pr diff. With2>/dev/nullswallowing the error, the Full diff block silently degrades toCould not read the diff; run gh pr diff.on every run — the central block this PR adds never renders. Thegh apiuses at L245 and L285 are correct.
Action Required
- Replace
--allow-escape-sequenceson L309 with--color never(or drop it), and confirm the block renders its body rather than the fallback sentence. tests/context-step-test.sh:102asserts the stub was called with that flag, so the suite is green on the broken invocation and will go red on the fix. Moverequire_escape_flagoff thepr diffbranch (keeping it on the twogh apibranches) and update the comment at L179.
There was a problem hiding this comment.
Prior cycle's blocking issue is resolved: fetch_raw tries --allow-escape-sequences and falls back to the bare call, so the raw fetches land on both gh generations. Confirmed on this runner that gh pr diff --help lists no such flag, which is the fallback path. The stub now rejects unknown flags per GH_VERSION and asserts the diff body reaches the context on 2.96 and 2.97 rather than asserting the flag. The compare probe, the quoted-span handling in compound, the prompt's missing-block line, and shell: bash are all in. One non-blocking note inline.
|
Codex branch review — 9 findings, all addressed in 90f372a and d3cffe6. Delimiter neutralisation was incomplete. Two reads were rendering failures as claims. A failed
A single CI log line could evict the diff. Test gaps: the truncation test only grew the last block, so "the diff survives" merely confirmed fixture ordering; it now grows an earlier block (a 900 KB single log line) and the threads block. The On the UTF-16 accounting: I did not verify that mechanism, so I did not size the caps against it — 300 KB total is far under any plausible limit either way, and the largest PR reviewed across the org in a week renders about 150 KB. Verified live against github-workflows#22 (112 KB), dlthubworker#168 (70 KB) and monopoly#1647 (93 KB). 143 assertions passing. |
A week of tool-usage artifacts showed the reviewer spending 19.5 Bash calls and 5.2 permission denials per run fetching the diff, CI status, its own last-reviewed SHA, and the PR conversation — none of which it can reach under the allowlist and
fetch-depth: 1. All four now come frontloaded,rgis allowed, and the artifact carries closed-vocabulary command labels so the next pass can read artifacts instead of replaying reviews.Also fixes two things the frontloading needed:
actions: read/issues: readon the job (both reads would have 403'd silently) and--allow-escape-sequenceson the job-log fetch (without itghwrites zero bytes).