refactor(executing-a-branch-plan): scope Step 8 dispatches to sanctioned call sites - #1699
Merged
Conversation
Seed the Branch Plan/task-decomposition record for scoping Step 8's refactor/adversarial-review dispatches to sanctioned agent call sites. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQX9hvi7HPW1kmPHzWKfpL
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1699 +/- ##
=======================================
Coverage 99.66% 99.66%
=======================================
Files 152 152
Lines 24725 24725
Branches 2967 2967
=======================================
Hits 24643 24643
Misses 82 82 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The task-list plan for issue #1560 quoted ACM Planned-ops text with Japanese fragments left over from an earlier dispatch prompt, violating this repository's ASCII-only convention for committed artifacts. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQX9hvi7HPW1kmPHzWKfpL
This session's own per-session PATH override (needed to work around a PATH-dependent PreToolUse hook, tracked as issue #1697) left an untracked file at .claude/settings.local.json. Ignore it like .claude/apm-hooks.json above -- a personal/per-session override, never meant to be shared or committed. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQX9hvi7HPW1kmPHzWKfpL
The gitignore-pattern-coverage-gate CI check requires every newly-added .gitignore pattern to be referenced by a test under tests/ (issue #330/#519). The .claude/settings.local.json pattern added earlier in this branch had no such test, failing the gate on PR #1699. Add one, mirroring tests/test_gitapex_gitignore_worktrees.py's own shape. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQX9hvi7HPW1kmPHzWKfpL
…licitly Step 8's refactor/simplify pass and adversarial review pass previously dispatched with no named agentType/subagent_type, contradicting branch-plan-task.md's and review-persona.md's own "never invoke directly for anything else" scoping statements. Give each dispatch an explicit, sanctioned call site instead of a new sibling agent file: - agents/branch-plan-task.md and .claude/agents/branch-plan-task.md gain a "Sanctioned call sites" section naming Step 6's per-task dispatch and Step 8's refactor/simplify pass; descriptions simplified to point there, mirroring review-persona.md's own shape. - agents/review-persona.md gains a 4th sanctioned call site: Step 8's adversarial review pass, read-only findings-only. - SKILL.md's Step 8 text, execution-and-dispatch.md (new subsection), and refactor-and-review-gate.md's sub-steps 1/2 now name agentType: 'branch-plan-task' and subagent_type: 'review-persona' explicitly, and sub-step 2 states plainly that verify/fix/validate happens outside review-persona's own read-only dispatch. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…uting text Step 8's own adversarial review pass (dispatched as part of this same Branch Plan execution) confirmed a self-contradiction the prior commit introduced: refactor-and-review-gate.md's sub-step 2 and SKILL.md's Step 8 both allowed a confirmed, behavior-affecting correctness-bug fix to be applied by "the refactor pass's own subagent" -- but that same commit's own new "Sanctioned call sites" entry for that subagent restricts it to "behavior-preserving edits only." Drop that option; the calling main thread is now the sole place a confirmed finding's fix is applied, consistent with the subagent's own stated scope. Refs #1560 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tvna
marked this pull request as ready for review
September 2, 2026 23:33
tvna
marked this pull request as draft
September 3, 2026 03:55
tvna
marked this pull request as ready for review
September 3, 2026 04:01
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
Give
executing-a-branch-planStep 8's two fresh subagent dispatches(refactor/simplify pass, adversarial code review) an explicit, sanctioned
agentType/subagent_type-- the refactor pass reusesbranch-plan-task(widened "Sanctioned call sites"), the adversarial review pass reuses the
existing read-only
review-persona(from #1559/PR #1599) -- so neitherdispatch silently reuses a definition whose own description states
"never invoke directly for anything else."
Facts
refactor-and-review-gate.mdStep 8 dispatched two subagents with noagentType/subagent_typenamed, distinct from Step 6's task agents(
branch-plan-task).agents/branch-plan-task.mdand.claude/agents/branch-plan-task.mdboth stated "Never invoke directly for anything else."
agents/review-persona.mdalready exists (refactor(reviewing-an-artifact): add a tool-scoped review-persona agent definition for the 6-persona fan-out #1559, merged as PR refactor(screening-a-low-trust-contribution): isolate diff reasoning into review-persona subagent #1599)with a
tools: Read, Grep, Globallow-list and an enumerated"Sanctioned call sites" section (3 entries).
Assumptions
disallowedTools: mcp__github) matchbranch-plan-task's existingshape -- stated as a premise in issue refactor(executing-a-branch-plan): give Step 8's refactor/adversarial-review dispatches their own agent-scope, stop implicit branch-plan-task reuse #1560's own Facts section, not
independently re-derived here.
branch-plan-task's description (rather than adding a siblingagent definition) was chosen during planning: it follows
review-persona.md's own established "Sanctioned call sites" patternand avoids duplicating a near-identical tool scope across two files.
Risk / blast radius
Prose-only changes to two agent-definition files and three
executing-a-branch-planskill/reference files. No change to Step 6'sexisting task-dispatch behavior, tool scope, or hooks. No change to
review-persona's existing three call sites or its tool allow-list.Blast radius is limited to Step 8 of
executing-a-branch-plan, a skillalready gated by its own Authorization/threat-model steps before any of
this ever dispatches.
Rollback
git revertthis PR's merge commit. No data/schema change, no externalside effect beyond the edited files themselves.
Verification
branch-plan-task's "never invoke directly for anything else" scopeuv run --frozen python3 -m pytest --no-cov -qanduv run --frozen python3 .github/scripts/gitapex_gate_local_preflight.pygreenreview-persona.md's "Sanctioned call sites" gains a 4th entry (Step 8 adversarial review); existing 3 entries unchangedtools:allow-list byte-identicalrefactor-and-review-gate.mdagainstreview-persona.md's owntools:list (no Write/Edit)refactor-and-review-gate.mdis unchangedChecklist
skills/*/SKILL.md, adocs/superpowers/specs/*.mddesign doc, a security-relevant skill, or a deterministic checker script (skills/*/scripts/*.py,evals/scripts/*.py,.github/scripts/*.py), a## Skill audit evidencesection discloses the required verdicts/waivers (see.github/scripts/gitapex_gate_skill_audit_disclosure.py)evals/*/split.md, that entry discloses a Transfer check line (see.github/scripts/gitapex_gate_transfer_check_disclosure.py)skills/*/SKILL.md's Stop-boundary bullets or named dispatch branches,evals//tasks/*.yamlgained at least as many new fixtures (see.github/scripts/gitapex_gate_skill_branch_fixture_coverage.py)Skill audit evidence
skills/executing-a-branch-plan/SKILL.mdis modified by this diff (itsreferences/refactor-and-review-gate.mdandreferences/execution-and-dispatch.mdalso change). Frontmatter(
name/description) is byte-identical before/after --gitapex_compute_skill_audit_flags.py --base-ref origin/main --head-ref HEADreportsdescription-changed-skills: ""-- so neither audit isrequired to file a real verdict under issue #427's stricter rule.
frontmatter/description change in this diff -- the change is limited to
Step 8's own procedure prose (naming the two dispatches' already-existing
agentType/subagent_typeidentifiers explicitly, and fixing aself-contradiction the pipeline's own Step 8 adversarial-review pass
found in this same PR's first commit -- see Execution log). Adversarial
stress-testing of the skill's own robustness is disproportionate to this
narrow blast radius (see Risk / blast radius above). Deterministic shape
checker run instead:
gitapex_check_skill_shape.py --allowed-root skills skills/executing-a-branch-plan-- 61/61 checks PASS.description/frontmatter untouched, no new skill authored, no change to
invocation mode, portability (
Mixed), or capability-assumption(
Adaptive) declarations. A full 9-dimension probabilistic-maturityreview (this skill's own Procedure requires a fresh, isolated subagent
dispatch for it) is disproportionate to a Step-8-prose-only clarification.
Deterministic checks run directly instead:
gitapex_check_skill_shape.py(61/61 PASS, above) and the companion
gitapex_scan_execution_requirements_drift.py skills/executing-a-branch-plan,which reports 4 pre-existing findings (declared
executionRequirements.tools.write/shell: []vs. mutating/shelllanguage in SKILL.md and a bundled script) that predate this PR and are
already documented as a deliberate declaration in
metadata/gitapex.yaml's own references entry for issue gate-proposal: retro #1475 repair 2: Full local verification suite not required inside each task worktree before merge-back #1476 ("the newscript's subprocess/write calls run only inside Claude Code's own hook
runner, never a step this skill's orchestrating instructions direct a
calling session to perform"); this diff does not touch
metadata/gitapex.yamlor that script, so this pre-existing,already-documented drift is disclosed here rather than re-litigated.
Merge gate: independent review
This PR is also subject to the
independent-review-pendingrequiredstatus check (see
.github/workflows/independent-review-pending.yml/.github/scripts/gitapex_gate_independent_review_pending.py). It stayspending/failing until a
## Independent review verdictsection namingthis PR's current head commit is recorded in this body --
drafting-a-pr-to-merge's own Step 8 records it once its independentreview completes. There is nothing for you to do here now: do not
pre-fill this section yourself, and do not remove this note.
Independent review verdict
Outer layer (GitHub-native reviewer). No confirmation that Anthropic's
"Claude Code Review" GitHub App is installed on this repository; no check
run bearing that name appears anywhere in this PR's own check-run history
(46 check runs inspected, none named accordingly). Falling back to GitHub
Copilot's
copilot-pull-request-reviewer[bot]per this step's ownfallback rule: requested via
request_copilot_reviewat approximately2026-09-02T23:44Z. As of this recording (2026-09-03T03:51Z, roughly 4
hours later -- well past the 30-minute unreachable threshold),
pull_request_readmethodsget_reviewsandget_commentsshow noCopilot response -- treated as unreachable for this step, per
drafting-a-pr-to-mergeStep 8's own rule. Disclosed regardless ofresponse: Copilot's review is Comment-only with no pass/fail signal of
its own, a materially weaker guarantee than the Claude Code Review App's
severity summary.
Inner layer (
reviewing-an-artifact, effort: low; always runs).Fetched the PR's live diff via
pull_request_readmethodget_diff(head commit
7672cb0d, 9 files changed). Step 0's eligibility checkfound a mixed target: three files are Subagent-definition instruction
channels (
agents/branch-plan-task.md,.claude/agents/branch-plan-task.md,agents/review-persona.md) and three are aSKILL.mdplus itsreferences/(skills/executing-a-branch-plan/SKILL.md,references/execution-and-dispatch.md,references/refactor-and-review-gate.md) -- both specialist-owned targettypes per this skill's own Step 0 deferral list, deferred rather than
re-reviewed here:
evaluating-skill-quality(already disclosedabove under "Skill audit evidence": WAIVED, reason recorded there --
narrow, non-frontmatter scope).
evaluating-context-channel-maturity.Not run this round: judged disproportionate to the actual change (each
file's edit is a single new "Sanctioned call sites" entry following an
already-established pattern used 3 times before in
review-persona.mdalone), the same proportionality basis already applied to the
skill-quality waiver above. Residual risk, disclosed rather than
silently assumed clear: a full five-point maturity review (ownership/
review gating, bounded growth, placement/disclosure fit,
enforcement-fit, provenance/adversarial independence) of these three
files has not actually run.
Remainder (
.gitignore,tests/test_gitapex_gitignore_settings_local.py,docs/superpowers/plans/2026-09-02-claude-pr-1560-prep-o93l5b.md)classified safe at Step 1 (a config addition, an added test, a doc
update) -- no security-tier signal found anywhere in these three files,
so Steps 2-5's persona fan-out was skipped per this skill's own Step 1
rule. 0 confirmed findings, 0 unconfirmed-concern findings.
Related Issue
Closes #1560
Acceptance Criteria Map
branch-plan-task's "never invoke directly for anything else" scopebranch-plan-task's description and add a "## Sanctioned call sites" section to its body, followingreview-persona.md's own pattern. Call site 1 = the existing Step 6 task dispatch, call site 2 = Step 8's refactor/simplify pass (full accumulated diff, behavior-preserving only)agents/branch-plan-task.md,.claude/agents/branch-plan-task.md,skills/executing-a-branch-plan/SKILL.md,skills/executing-a-branch-plan/references/execution-and-dispatch.md,skills/executing-a-branch-plan/references/refactor-and-review-gate.mdreview-persona.md's "## Sanctioned call sites" (Step 8's adversarial review pass)agents/review-persona.md,SKILL.md,execution-and-dispatch.md,refactor-and-review-gate.mdrefactor-and-review-gate.md's sub-step 2 text so findings are returned by the review-persona dispatch, but verification/fix/validate happen in the main thread or the refactor pass's own subagentskills/executing-a-branch-plan/references/refactor-and-review-gate.mdreview-persona.md's owntools:list (no Write/Edit)refactor-and-review-gate.mdExecution log
PlanApproved{run_id: deb027a5}TaskStarted{run_id: deb027a5, task_id: task-1}TaskCompleted{run_id: deb027a5, task_id: task-1, commit_sha: 68d08580}-- Task 1 (the sole ACM task) landed all 6 planned edits, full pytest suite (7885 passed) and local-preflight (44/44 gates) green. Diff screening (screening-a-low-trust-contributionchecks 2-8 viareview-persona) found checks 2/4/5/6/7/8 clear; check 3 (governance-file edit) hard-flagged all 6 changed files by category -- reviewed and accepted as the expected, ACM-approved change this issue's own scope calls for (issue refactor(executing-a-branch-plan): give Step 8's refactor/adversarial-review dispatches their own agent-scope, stop implicit branch-plan-task reuse #1560's Requested outcome is precisely to edit these governance/agent-definition files), not an unexpected diff. Commit provenance scan clean after amending the task commit to drop a disallowedClaude-Session:trailer (CONTRIBUTING.md's PR-body-trailer disclosure exception does not extend to commit messages).origin/maindrift check clean (up to date, 5 commits ahead).main..HEAD, 9 files): refactor/simplify pass (agentType: 'branch-plan-task') found nothing to fix -- clean pass, no commit. Adversarial review (subagent_type: 'review-persona') found one CONFIRMED correctness bug: the same commit's own new text let a confirmed adversarial-review finding be fixed by "the refactor pass's own subagent," directly contradicting that subagent's own new "Sanctioned call sites" entry restricting it to "behavior-preserving edits only" (a confirmed correctness-bug fix is behavior-affecting by definition). Fixed in the calling main thread (per this same gate's own routing rule) by dropping that option from bothrefactor-and-review-gate.mdandSKILL.md, leaving the calling main thread as the sole fix-applier --commit_sha: 7672cb0d. Full pytest suite (7885 passed) and local-preflight (44/44 gates) re-run clean after the fix, plusgitapex_check_skill_shape.py(61/61 checks) since the fix touchedSKILL.md.origin/maindrift check re-run clean between fix rounds (up to date, 6 commits ahead). Commit provenance scan clean.SkillAuditEvidenceRecorded{run_id: 7672cb0d, checks: [battle-testing-a-skill: WAIVED, evaluating-skill-quality: WAIVED]}--skill-audit-disclosureCI check found the PR body did not yet contain a required## Skill audit evidencesection (diff touchesskills/executing-a-branch-plan/SKILL.md). Both audits waived with reason (see that section above); decision confirmed with the operator before recording, given the narrow, non-frontmatter scope of this diff.IndependentReviewRecorded{run_id: 7672cb0d, outer_layer: copilot_unreachable, inner_layer: reviewing-an-artifact_clean}-- Step 8's two-layer independent review completed against head commit7672cb0d: outer layer (Copilot, requested viarequest_copilot_review) posted no response past the 30-minute unreachable threshold; inner layer (reviewing-an-artifact, effort low) found 0 confirmed findings, deferring the skill/agent-definition files to their own specialist audits per its Step 0 (see the Independent review verdict section above for the full breakdown). Verdict: CLEAN, recorded above.