fix(ce-code-review): replace resolve-base.sh with prose-driven base detection#815
Merged
Merged
Conversation
…etection Branch mode and standalone mode invoked `bash scripts/resolve-base.sh` via a bare relative path. The runtime Bash tool's CWD is the user's project, not the skill directory, so the helper was never found and the agent improvised its way through base detection on every run -- silently, since the spec-mandated "stop on script error" guard wasn't enforced in practice. Rather than fix the call site (PR #812), remove the helper. PR mode already has its own inline fork-safe base resolution (the `PR_BASE_REMOTE` block); branch and standalone modes now share that block via prose plus a default- branch fallback chain (origin/HEAD -> gh repo view -> main/master/develop/ trunk) and the hard "do not fall back to `git diff HEAD`" guard. Net result: -300 lines of script tests, -100 lines of script, +13 lines of prose. The agent does what it was already doing empirically, but now the spec admits it. Fixes #811. Supersedes #812 -- thanks Frank Stallone for the original report and PR.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3027c58447
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Restore local-base fallback in branch/standalone no-PR path so single-branch clones, missing-origin repos, and unfetched defaults don't hard-stop when origin/<base-branch> is unavailable.
6 tasks
Merged
3 tasks
LLMpsycho
pushed a commit
to LLMpsycho/compound-engineering-plugin
that referenced
this pull request
May 11, 2026
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
Fixes #811 by removing the failing helper rather than fixing how it's called. Supersedes #812.
ce-code-reviewbranch mode and standalone mode invokedbash scripts/resolve-base.shvia a bare relative path. At runtime the Bash tool's CWD is the user's project, not the skill directory, so the helper has been silently failing on every invocation — the agent improvised its way through base detection on its own judgment, which is why nobody noticed.What changed
scripts/resolve-base.sh(and its 300-line test file). The helper's most distinctive feature (fork-safe PR-base resolution) wasn't realized at the call sites that actually used it — PR mode has its own inline fork-safe block, and branch/standalone modes never had a real PR-URL to resolve against.PR_BASE_REMOTEblock for fork safety) →origin/HEAD→gh repo view→ common branch names. Compute the merge-base, unshallow on shallow clones, stop hard if nothing resolves.git diff HEAD" — a review without a base would only show uncommitted changes and silently miss all committed work. The contract test in `tests/review-skill-contract.test.ts` now pins this guard phrase per-mode.${CLAUDE_SKILL_DIR}workaround andallowed-toolsgrant that fix(ce-code-review): resolve base helper from skill dir #812 was going to add — both become unnecessary when there's no bundled script to invoke.Net: -429 lines (script + script tests), +13 lines (prose + new guard test).
Why this shape instead of #812
#812 was a correct minimal fix that kept the helper and corrected the call. Discussion in #812 and our review session converged on a different question: does the helper earn its complexity?
Empirically no — users have been hitting "couldn't find resolve-base.sh" errors, the spec said to stop, but the agent improvised and the review still completed with reasonable scope. That's a signal that the deterministic helper wasn't load-bearing in branch/standalone modes. PR mode (which DOES need fork-safe resolution) has its own inline block and is untouched.
The change trades:
allowed-tools+\${CLAUDE_SKILL_DIR}workaround → nothingTest plan
Credit
Thanks to @frankstallone for the original report (#811) and PR (#812). The closing comment on #812 explains the structural choice.