Commit 15f6a3d
Strip shell-only
The CI prompt at `.github/codex/prompts/pr_review.md:54` contains a
literal "Command to check: \`grep -n \"pattern\" diff_diff/*.py\`"
directive under Pattern Consistency. The local Responses-API path has
no shell access, so the model would either hallucinate having run grep
or silently skip the pattern-consistency check while still claiming
completeness.
This bug pre-dates PR #404 (the grep directive has been in the prompt
for as long as the local script has existed). PR #404's `9b76cd4`
follow-up addressed shell-access claims inside the Mandate substitution
specifically, but the older, standalone `Command to check:` line was
never neutralized. Reverting #404 didn't introduce this — but neither
does it fix it.
Adds a `_SUBSTITUTIONS` entry that replaces the directive with a
static-context note: "Verify by inspecting the loaded source files (no
shell access in this path; do not claim to have run \`grep\`)".
Also adds `test_strips_shell_grep_directive_from_real_prompt` that
verifies the directive IS in the unadapted CI prompt and IS NOT in the
local-adapted output, with "no shell access" wording in its place.
170 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>grep directive from local-mode adapted prompt1 parent cbe3396 commit 15f6a3d
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
914 | 923 | | |
915 | 924 | | |
916 | 925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
224 | 241 | | |
225 | 242 | | |
226 | 243 | | |
| |||
0 commit comments