Repository navigation
feat(code-reviewer): add boundary review for env/credential/spawn changes - #219
Merged
Merged
Conversation
…nges The skill reviewed diffs entirely within the repo and routed by line/file count, so a small change at an env-var, credential, spawn, or network boundary got the lightest path and its cross-repo blast radius went unseen. Add a Boundary Relevance scan that flags such diffs, forces the orchestrated path regardless of size, and activates a Boundary & External Contract specialist that reads external consumers' contracts. Fetch linked issues in PR Mode to catch scope drift, add an executed mutation check that fails a fix whose deletion leaves tests green, and repair the verdict rule so a single-agent boundary finding can request changes and APPROVE is unavailable until the boundary checks have run. Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
Round-1 boundary review had five gaps: the executed mutation check lived only in the Phase 2A inline path while boundary diffs route to Phase 2B, so the one deterministic seam check sat on a path boundary PRs never take; the verdict bullets let the Comment cap suppress a verified blocker and demanded issue/mutation checks that a boundary PR without a linked issue or a non-fix PR could not satisfy; issue lookup ran bare `gh issue view` with no --repo; later routing prose contradicted the boundary override; and the flag tripped on broad lexical hits with no semantic gate. Give the mutation protocol one authoritative home in the Functionality lens (with mixed-hunk mechanics and cleanup), replace the verdict with an ordered tree that never caps a verified blocker and states check applicability, make issue lookup derive and pass owner/repo, rename the phase headings so the override has no contradiction, and split the classifier into hard constructs plus semantically-confirmed lexical hints. Add a prompt-contract test that fails if the Phase 2B Functionality briefing loses the mutation instruction. Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
…tory The no-URL issue-lookup path prescribed `gh pr view --json headRepository,baseRepository`, but `baseRepository` does not exist on current gh (exits 1) and `headRepository` is the fork, not the target, for cross-repo PRs — so the mandatory linked-issue scope-drift lookup could not derive its repo in PR-number mode. Add `url` to the step-1 call and parse owner/repo from the canonical PR URL, which resolves identically for URL and bare-number inputs and always names the true target. Re-anchor the prompt-contract test on semantic invariants instead of vocabulary: assert the production-only revert direction (a swap to test-only reversal now trips a negative check) and drop the capitalization-pinned RED literal so a benign RED->fails reword no longer false-fails. Co-authored-by: Will Pfleger <[email protected]> Signed-off-by: Will Pfleger <[email protected]>
wpfleger96
pushed a commit
that referenced
this pull request
Aug 12, 2026
🤖 I have created a release *beep* *boop* --- ## [0.76.0](v0.75.6...v0.76.0) (2026-08-12) ### Features * **code-reviewer:** add boundary review for env/credential/spawn changes ([#219](#219)) ([5608301](5608301)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: wpfleger-release-bot[bot] <282999489+wpfleger-release-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.
Problem
The
code-reviewerskill classified review effort purely by line and file count and analyzed each diff entirely within the repository. A small change at an env-var, credential, spawn/exec, or network boundary therefore got the lightest path, and the contracts of the external binaries and services that consume those values — the actual blast radius — were never examined. That is the failure mode behind the bad approval on block/buzz#3398: a 68-line diff at the agent-spawn seam passed review with four misses that repo-local, size-routed analysis could not surface.What the patched skill does
Boundary Relevance scan (
SKILL.md). A two-tier diff scan setsboundary_relevant. Tier 1 — hard runtime-boundary constructs (env::,process.env,Command::new/.spawn(, auth-header construction, credential assignment) — sets the flag directly. Tier 2 — broad lexical hits (password,endpoint,https://, bareexec) — sets it only after a one-line semantic confirmation that the value actually crosses a process/auth/network boundary at runtime, so lexical coincidence doesn't gate a verdict. Anyboundary_relevantdiff routes to the Phase 2B orchestrated path regardless of size.Boundary & External Contractspecialist (references/subagent-template.md). A fifth Phase 2Bopusagent whose lens is explicitly outside the repo: which binaries/services consume the touched values, what their env/API contracts require (read from their docs/source), what behavior each value activates downstream, and whether paired values (key + base URL) travel together.Linked-issue scope-drift check (
SKILL.md, PR Mode). Step 1 derives the PR'sowner/repo, parses closing references (bareFixes/Closes/Resolves #Nagainst the target repo; qualifiedowner/repo#Nand full issue URLs keep their explicit repo), and runsgh issue view <N> --repo <owner/repo>. Implementation scope vs. issue scope is a 🟡 finding minimum, 🔴 when the drift widens a security/credential/auth surface. A failed lookup is a named blocker to the check, not silent continuation.Executed mutation check (
references/subagent-template.md, Functionality & Testing lens). For fix PRs, the Functionality specialist reverts only the production hunks in a scratch worktree (preserving added tests when production and test hunks share a file), verifies the reversal, runs the project's full suite, and expects RED. A suite that stays green with the fix removed = 🔴 "untested at its seam". The protocol has one authoritative home; the Phase 2A inline lens references it rather than duplicating it. Inability to execute is a named unmet precondition, never a silent skip.Ordered verdict tree (
SKILL.md). (1) any verified HIGH-confidence 🔴 → REQUEST_CHANGES — a verified blocker is never suppressed by the Comment cap; else (2) any applicable mandatory check not executed (including a needed live probe the reviewer can't run) → Comment naming it, with applicability stated (issue comparison only when a linked issue exists, mutation only for fix PRs); else (3) APPROVE. A single-agent 🔴 at HIGH confidence with orchestrator concurrence can request changes — the old 2-agent bar contradicted the mutually-exclusive lens design. Forward-momentum philosophy stays intact for every non-boundary change.The skill
versionis bumped1.1.1→1.2.0. A prompt-contract test (tests/unit/test_code_reviewer_skill_contract.py) asserts the Phase 2B Functionality briefing carries the mutation instruction, the protocol has a single authoritative home, boundary diffs route to Phase 2B, and the verdict tree never caps a blocker — the existing CI asserts nothing aboutboundary_relevantor mutation behavior.How this catches the #3398 misses
gh issue view+ scope-drift check → 🔴 (widens a credential surface)OPENAI_COMPAT_API_KEYshared across providers with base URL in a separate var the mirror drops*_API_KEYsetsboundary_relevant; Boundary specialist asks whether key + base URL are carried togetherOPENAI_API_KEYunder contracts invisible to full-file readingboundary_relevantforces Phase 2B regardless of size; a single-agent boundary 🔴 can request changes