feat(ce-review): add base: and plan: arguments, extract scope detection (#405)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trevin Chow
2026-03-27 07:59:54 -07:00
committed by GitHub
parent b5dc9b04ca
commit 914f9b0d98
7 changed files with 179 additions and 94 deletions

View File

@@ -173,9 +173,21 @@ describe("ce-review contract", () => {
expect(content).not.toContain("git diff -U10 HEAD")
expect(content).not.toContain("git diff --cached")
// All three scope paths must emit ERROR when BASE is unresolved
const errorMatches = content.match(/echo "ERROR: Unable to resolve/g)
expect(errorMatches?.length).toBe(3) // PR mode, branch mode, standalone mode
// PR mode still has an inline error for unresolved base
expect(content).toContain('echo "ERROR: Unable to resolve PR base branch')
// Branch and standalone modes delegate to resolve-base.sh and check its ERROR: output.
// The script itself emits ERROR: when the base is unresolved.
expect(content).toContain("references/resolve-base.sh")
const resolveScript = await readRepoFile(
"plugins/compound-engineering/skills/ce-review/references/resolve-base.sh",
)
expect(resolveScript).toContain("ERROR:")
// Branch and standalone modes must stop on script error, not fall back
expect(content).toContain(
"If the script outputs an error, stop instead of falling back to `git diff HEAD`",
)
})
test("orchestration callers pass explicit mode flags", async () => {