From a6826823a1c71647d06d1ece8e7357144145c412 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Fri, 6 Nov 2026 19:37:21 -0700 Subject: [PATCH 1/2] Stop prescribing commands that headless harnesses refuse Phase 5 now reads reviews through gh pr view and treats the inline-comment gh api read as optional, since it can be refused even though it only reads. A refusal or an empty result is no longer readable as "no review comments". Phase 3's command-substitution rule now also covers shell variable loops and $-anchored sed/awk, with a single jq-filtered gh call as the replacement. Co-Authored-By: Claude Opus 5.5 --- create-dev-loop.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/create-dev-loop.md b/create-dev-loop.md index 77fc8f7..01b50a6 100644 --- a/create-dev-loop.md +++ b/create-dev-loop.md @@ -280,7 +280,7 @@ Universal rules: - **Rename siblings together.** When renaming a heading or identifier that is part of a parallel pair or series (e.g. `Required X` / `Optional X`, `loadConfig` / `saveConfig`), scan for the siblings and rename them in the same commit. - **Scratch-file handling in a sandboxed harness.** When a step needs a scratch file for inspection or transformation (not a project source file — e.g. redirecting `git show` output for byte-level inspection, or a throwaway helper script), prefer the `Write` tool over `> file` shell redirection, and prefer `python3 -c "import os; os.remove(path)"` over `rm` to clean it up afterward. Some harness sandboxes statically block plain `>` redirection and `rm` outright — even for files the same session just created inside the working directory — while `Write` and `os.remove` are not pattern-matched the same way. Where the scratch file is untracked and sits inside the git working tree — the common case, since the canonical use is a PR or issue body drafted with `Write` and passed to `gh … --body-file` — `git clean -f ` is a third cleanup form that succeeds where a bare `rm ` is blocked, and is a more native fit than shelling out to Python. Preview it with `git clean -n ` first, and name the single path this session itself created — never a bare `git clean -f` or a directory, which would also delete untracked files this run knows nothing about. The same blocking applies to scratch **directory trees** (e.g. an isolated tool-home created to work around a lock-file issue): use `python3 -c "import shutil; shutil.rmtree(path)"` instead of `rm -rf`. Creating such a tree at all may be unavailable — some sandboxes block `mkdir` (and therefore `git clone` into a fresh subdirectory) even for paths *inside* the allowed working directory — so keep scratch work to individual files written into the existing tree rather than a new directory. - **Name every scratch file uniquely per repo and per cycle.** Use `--pr-body.md`, never a generic `pr-body.md` — the harness scratchpad is shared between concurrently running dev loops, so a colliding name is overwritten silently, with no error to notice and another repo's content left in the file. Write the file immediately before the command that consumes it, and treat it as consumed once used rather than as durable state; where a body has to survive a wait, re-verify what was actually published (`gh pr view --json body`) instead of trusting the file. -- **Avoid command substitution in Bash tool calls.** Some harnesses' command classifiers reject `$(...)` outright, so a prescribed `--body "$(cat <<'EOF' ... EOF)"` or `git commit -m "$(cat <<'EOF' ... EOF)"` can fail before ever reaching the shell. Compose long bodies (PR comments, commit messages, issue bodies) with the `Write` tool to a scratch file and pass them by file instead — `--body-file` (`gh pr comment`, `gh issue create`) or `-F` (`git commit`) — as done in Phase 4 step 5 and Phase 6. Likewise prefer separate `grep` invocations over `\|` alternation, which some classifiers flag as an expansion. +- **Avoid command substitution in Bash tool calls.** Some harnesses' command classifiers reject `$(...)` outright, so a prescribed `--body "$(cat <<'EOF' ... EOF)"` or `git commit -m "$(cat <<'EOF' ... EOF)"` can fail before ever reaching the shell. Compose long bodies (PR comments, commit messages, issue bodies) with the `Write` tool to a scratch file and pass them by file instead — `--body-file` (`gh pr comment`, `gh issue create`) or `-F` (`git commit`) — as done in Phase 4 step 5 and Phase 6. Likewise prefer separate `grep` invocations over `\|` alternation, which some classifiers flag as an expansion. The same classifiers can reject **any** shell variable expansion (`for x in ...; do cmd $x; done`) and `$`-anchored `sed`/`awk` programs. Prefer one `gh ... --json -q ''` call over a shell loop of per-item `gh` calls: the filter runs inside `gh`, so the classifier never sees a variable. Write or update tests for every change (and see Stage B in Phase 2 when the *whole cycle* is dedicated to expanding coverage of existing functionality): {{TEST_GUIDANCE}} @@ -418,10 +418,11 @@ Perform a self-review. This step is anchored on external signals ({{EXTERNAL_SIG \`\`\`bash gh pr view --comments -gh api repos/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/pulls//comments \ - --jq '.[] | "File: \(.path)\nLine: \(.line)\nBody: \(.body)\n"' +gh pr view --json reviews \`\`\` +These show conversation comments and each review's state and summary, but not the text or `path:line` anchor of inline review comments. Where the summary names the findings, Phase 6 can work from it. Where the harness allows it, this read fills the gap: `gh api repos/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/pulls//comments --jq '.[] | "\(.path):\(.line) — \(.body)"'`. A command allow-list or attribution hook can refuse it even though it only reads. **A refusal, or an empty `--comments` result, is never evidence that no review comments exist** — check `--json reviews` for a submitted review before concluding there is nothing to address. + If no review yet, use `ScheduleWakeup` (delay 270 s) to check again. After 5 wakeups (~22 min) with no review, proceed anyway. From 65269ff86c46131aadf2af68d364162b42e15e96 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Fri, 6 Nov 2026 19:41:41 -0700 Subject: [PATCH 2/2] Hold the merge when review findings cannot be read Co-Authored-By: Claude Opus 5.5 --- create-dev-loop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-dev-loop.md b/create-dev-loop.md index 01b50a6..d260c20 100644 --- a/create-dev-loop.md +++ b/create-dev-loop.md @@ -421,7 +421,7 @@ gh pr view --comments gh pr view --json reviews \`\`\` -These show conversation comments and each review's state and summary, but not the text or `path:line` anchor of inline review comments. Where the summary names the findings, Phase 6 can work from it. Where the harness allows it, this read fills the gap: `gh api repos/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/pulls//comments --jq '.[] | "\(.path):\(.line) — \(.body)"'`. A command allow-list or attribution hook can refuse it even though it only reads. **A refusal, or an empty `--comments` result, is never evidence that no review comments exist** — check `--json reviews` for a submitted review before concluding there is nothing to address. +These show conversation comments and each review's state and summary, but not the text or `path:line` anchor of inline review comments. Where the summary names the findings, Phase 6 can work from it. Where the harness allows it, this read fills the gap: `gh api repos/{{GITHUB_OWNER}}/{{GITHUB_REPO}}/pulls//comments --jq '.[] | "\(.path):\(.line) — \(.body)"'`. A command allow-list or attribution hook can refuse it even though it only reads. **A refusal, or an empty `--comments` result, is never evidence that no review comments exist** — check `--json reviews` for a submitted review before concluding there is nothing to address. If a review reports findings that can be read in neither its summary nor the inline comments, do not merge: leave the PR open and hand off, naming the review whose findings could not be read. If no review yet, use `ScheduleWakeup` (delay 270 s) to check again. After 5 wakeups (~22 min) with no review, proceed anyway.