Add test-plan-executor subagent to pr-review - #138
Conversation
Implements the revised plan for issue 136 as a single stage. Adds a read-only `mach10:test-plan-executor` subagent that runs the items in a PR's `## Test plan` checklist when invoked from `/mach10:pr-review`, classifying each as PASS / FAIL / BLOCKED. Failures flow back through the existing F-identifier convention so `pr-review-fix` handles remediation; blocked items appear in a dedicated `## Test plan results` table in the review comment. Three integration touchpoints land alongside the agent: - `pr-create.md` strengthens the test plan template with an HTML guidance block and 3 example bullets. - `pr-pre-merge.md` Step 5d reads the most recent <!-- mach10-review --> comment and skips the test suite when fresh results exist; uses a timezone-safe epoch-second comparison for staleness. - `README.md` notes test plan execution on the pr-review row and disambiguates the new agent from `pr-review-toolkit:pr-test-analyzer` (static coverage analysis vs dynamic execution). CLAUDE.md adds a Test-plan-results section sync entry tracking the cross-file convention between pr-review.md (emit) and pr-pre-merge.md (consume). Plugin version 1.29.0 -> 1.30.0. Co-Authored-By: Claude <noreply@anthropic.com>
PR Review: Add test-plan-executor subagent to pr-reviewThis is an automated review composed from several specialized review agents ( Critical FindingsF1: Destructive-pattern
F2: Placeholder degenerate case targets an obsolete sentinel string after the
Important FindingsF3: Agent is missing a
F4: Procedural-check path can absorb failures as
F5:
F6:
F7: Default 120s timeout misclassification for long suites that do not match the bump regex (per silent-failure-hunter).
F8: Malformed
F9: "Multiple sections" degenerate case silently drops content from non-first sections (per silent-failure-hunter and comment-analyzer).
SuggestionsS1: PR test plan does not name actual fixture PRs, despite the revised plan committing to identifying two (per feature-completeness-checker).
S2: HTML guidance block lifecycle is undefined in
S3: HTML guidance rules contradict the example bullets they ship alongside (per comment-analyzer).
S4: New sync entry undercounts the locations it should track (per comment-analyzer).
S5: README "dynamic vs static" disambiguation undersells the more useful difference (per comment-analyzer).
S6: Add a one-line rationale for the
S7: "P passed, F failed, B blocked" abbreviations are introduced without definition (per comment-analyzer).
S8: BLOCKED reason enum is closed but doesn't cover all paths the rules allow (per silent-failure-hunter).
S9: Output truncation rule is asymmetric in a way that can hide context for BLOCKED items (per silent-failure-hunter).
S10: Step 2 "no test plan section" fallback depends on the downstream Skill honoring the instruction (per silent-failure-hunter).
S11:
Strengths
Reviewed by Claude Opus 4.7 |
Independent Assessment of PR ReviewFor each finding from the prior review, I read the actual code at the cited paths and independently verified whether the issue exists. Findings are classified as Genuine, Nitpick, False positive, or Deferred. Critical FindingsF1: Destructive
F2: Placeholder check targets obsolete sentinel string — Genuine
Important FindingsF3: Missing
F4: Procedural-check path can absorb failures as PASS without evidence — Nitpick
F5:
F6:
F7: 120s timeout misclassification for long suites — Nitpick
F8: Malformed
F9: "Multiple sections" silently drops content from non-first sections — Nitpick
SuggestionsS1: PR test plan does not name actual fixture PRs — Nitpick
S2: HTML guidance block lifecycle is undefined — Nitpick
S3: HTML guidance rules contradict the example bullets — Genuine
S4: New sync entry undercounts locations — Nitpick
S5: README disambiguation undersells input-source difference — Nitpick
S6: Add rationale for
S7: P/F/B abbreviations used without definition — Nitpick
S8: BLOCKED reason enum is closed but doesn't cover all paths — Nitpick
S9: Output truncation rule is asymmetric — Nitpick
S10: Step 2 fallback depends on downstream Skill honoring instruction — Nitpick
S11: "Run suite directly" path doesn't handle no-runner-detected — Nitpick
Tally
Staged Implementation PlanStage 1 (Required): Tighten the destructive-pattern safety filterAddresses F1 and F5.
Stage 2 (Required): Fix placeholder detection alignment with the new templateAddresses F2.
Stage 3 (Required): Harden pr-pre-merge freshness gateAddresses F6 and F8.
Stage 4 (Required): Resolve template rule/example contradictionAddresses S3.
Stage 5 (Optional): Behavioral defensiveness polishAddresses F4, F7, F9, S8, S10.
Stage 6 (Optional): Documentation and clarity polishAddresses F3, S1, S2, S4, S5, S6, S7, S11.
Assessed by Claude Opus 4.7 |
- F1: Tighten rm destructive-pattern regex so subpath targets (/etc, $HOME/.ssh, ~/.config, /*) are matched, and update prose to match. - F2: Replace obsolete <bulleted checklist...> sentinel with a generic angle-bracketed-token detector that covers the new pr-create template placeholders. Add a CLAUDE.md sync entry pairing the convention with both files. - F5: Add a refused-pattern bullet for direct block-device destruction via program flags (dd of=/dev/sd*, mkfs.* /dev/sd*, shred /dev/sd*, parted /dev/sd*) so they no longer bypass the redirect-only filter. - F6: Validate that comment_epoch and branch_epoch are non-empty integers before comparing in pr-pre-merge Step 5d. On failure, treat as stale and surface a parse-failure note. - F8: Require at least one parseable per-item table row beneath the ## Test plan results heading. If the section is malformed, fall through to running the suite directly with an explicit note. - S3: Soften the "one concern per item" rule in the pr-create test plan template guidance so it no longer contradicts the example bullets that pair an action with its expected outcome. Co-Authored-By: Claude <noreply@anthropic.com>
Review fixes applied (commit 146893b)Addressed the six findings the assessment classified as Genuine: F1, F2, F5, F6, F8, S3. Files modified:
Notable decisions:
The fourteen findings the assessment classified as Nitpick (F3, F4, F7, F9, S1, S2, S4, S5, S6, S7, S8, S9, S10, S11) were intentionally not addressed in this batch. |
PR Review: Add test-plan-executor subagent to pr-review (re-review)This is an automated review of PR 138 in its current state after commit 146893b. Findings are aggregated from The previously-fixed findings (F1, F2, F5, F6, F8, S3) were independently verified in the current code and are correctly resolved. Critical FindingsF1: Step 3 merge can poison the Step 5d freshness comparison (per code-reviewer).
F2:
Important FindingsF3:
F4: "Generic angle-bracketed-token detector" sync entry contradicts the agent prose, which enumerates only five tokens (per comment-analyzer and skill-reviewer).
F5: Destructive-pattern claim "Refusal is informative, never silent" overstates what the filter enforces (per silent-failure-hunter).
F6: Severity assignment rule for
SuggestionsS1:
S2: Quoted absolute paths bypass the
S3: Placeholder detector will false-positive on angle-bracketed autolink URLs (per code-reviewer).
S4: Test-plan-results section sync entry undercounts pr-pre-merge.md references (per comment-analyzer).
S5: HTML guidance block in
S6: Capture mechanism for
S7: Stale fall-through asymmetry (no-confirmation vs three-option AskUserQuestion) is undocumented (per silent-failure-hunter).
S8: "Parseable table data row" exclusion rule is under-specified (per silent-failure-hunter).
S9: Malformed-section / parse-failure CLI notes are not surfaced in Step 7's pre-merge report (per silent-failure-hunter).
S10: Destructive-pattern filter omits other realistic risky patterns (per skill-reviewer).
S11:
S12: PR description Test plan section references unnamed fixture PRs and is not executable (per comment-analyzer and the test-plan-executor's own run).
S13: Output Format section omits a concrete example of the aggregate return shape (per skill-reviewer).
S14: Parsed-item list handoff contract is left undefined (per skill-reviewer).
Strengths
Test plan resultsThe
Summary: 0 passed, 0 failed, 9 blocked. This dogfooding outcome is the trigger for S12 -- the PR's own test plan is not executable, so the executor agent cannot validate the executor agent on its introducing PR. Reviewed by Claude Opus 4.7 |
Independent Assessment of PR Re-ReviewFor each finding from the prior re-review, I read the actual code at the cited paths and independently verified whether the issue exists. Findings are classified as Genuine, Nitpick, False positive, or Deferred. Critical FindingsF1: Step 3 merge poisons Step 5d freshness comparison — Genuine
F2:
Important FindingsF3:
F4: Sync entry "generic detector" claim doesn't match agent prose — Nitpick
F5: "Refusal is informative, never silent" overstates the filter — Genuine
F6: Procedural FAIL has no severity rule — Genuine
SuggestionsS1: Heading extraction not anchored — Nitpick
S2: Quoted absolute paths bypass
S3: Placeholder detector false-positive on autolink URLs — Genuine (reclassified from Deferred by user decision; bundled with F4 in Stage 7, which is now Required)
S4: Sync entry undercounts pr-pre-merge.md references — Genuine (consolidated with F3)
S5: HTML guidance block lifecycle undefined — Nitpick
S6: Epoch capture mechanism not pinned — Nitpick
S7: Stale fall-through asymmetry undocumented — Nitpick
S8: "Parseable table data row" rule under-specified — Nitpick
S9: Malformed-section / parse-failure notes not in Step 7 report — Nitpick
S10: Filter omits other risky patterns — Deferred
S11: No pr-test-analyzer disambiguation cue in
S12: PR test plan references unnamed fixture PRs — Deferred
S13: Output Format lacks aggregate-shape example — Nitpick
S14: Parsed-item list handoff contract undefined — Nitpick
Tally (updated after deferred-item disposition)
Reclassified items: S3 moved from Deferred to Genuine; bundled with F4 in Stage 7 (now Required). Staged Implementation PlanStage 1 (Required): Fix Step 5d freshness comparisonAddresses F1.
Stage 2 (Required): Handle
|
|
Deferred findings processed after the re-review:
|
…#136) Fix freshness comparison and gh failure handling in pr-pre-merge Step 5d (F1, F2), accurately describe Test-plan-results consumers in CLAUDE.md sync entry (F3, S4), tighten the test-plan-executor safety claims and severity rules (F5, F6), and harden the destructive-pattern filter and placeholder detector against quoted paths and autolink URLs (S2, S3). Co-Authored-By: Claude <noreply@anthropic.com>
Review fixes: F1, F2, F3, F5, F6, S2, S3, S4Commit: 0e675af Critical
Important
Suggestions
Notable decisions
Verify with |
PR Review: Add test-plan-executor subagent to pr-reviewCritical IssuesF1: Incorrect terminology "allowlist" for what is actually a denylist/blocklist.
F2: Destructive-pattern filter does not block
F3:
Important IssuesF4: The
F5: Epoch validation failure note blames the wrong timestamp source.
F6: Section extraction terminator
F7: Timestamp-only freshness check cannot detect commit rewriting (force-push after review).
F8: No-background-agent sync entry not updated to mention the new Skill pass-through at
SuggestionsS1: Destructive filter doesn't cover
S2: The
S3: The CLAUDE.md test-plan-template placeholder sync entry (line 74) says the regex is
S4: The HTML comment guidance block in
S5: The heading regex
S6: The item regex
S7: The Step 7 report template uses
S8: The test-plan-executor agent has no instruction for what to do when
S9: The
S10: The heading-level termination rule ("same or higher level") combined with the variable heading match (
Strengths
Test plan results
Reviewed by Claude Opus 4.6. This is an automated review -- findings should be verified by a human reviewer. |
Independent Assessment of PR ReviewFor each finding from the review, I read the actual code at the cited paths and independently verified whether the issue exists. I also cross-referenced against prior PR discussion (two prior review cycles with fixes at commits 146893b and 0e675af). Critical FindingsF1: "allowlist" should be "denylist" -- Genuine issue F2: Destructive filter doesn't block F3: Important FindingsF4: null jq result has no explicit branch instruction -- Nitpick (reclassified) F5: Epoch validation failure note blames wrong timestamp source -- Genuine issue F6: Section extraction terminator F7: Timestamp-only freshness check can't detect commit rewriting -- Nitpick (reclassified) F8: No-background-agent sync entry not updated for line 72 -- False positive SuggestionsS1: Missing chmod/chown/kill/truncate in destructive filter -- Nitpick (by design, filter is explicitly "a safety floor, not a ceiling") S2: rm regex example note says "rm -rf pattern" but regex catches any rm -- Genuine issue (minor) -- the example on line 73 should say "rm pattern" rather than "rm -rf pattern" S3: CLAUDE.md sync entry omits "case-insensitive" qualifier -- Genuine issue (minor) -- line 74 should add "(case-insensitive)" after the regex S4: HTML comment guidance in pr-create.md visible in raw PR body -- Nitpick (standard practice, HTML comments are invisible in rendered view) S5: Heading regex optionally matches "Testplan" (no space) -- Genuine issue (minor) -- S6: Item regex doesn't match numbered checklist items -- Nitpick (GitHub checkbox syntax uses S7: P/F/B count placeholders inconsistent with N convention -- Nitpick (P/F/B are intentional mnemonics for Pass/Fail/Blocked) S8: No error handling for gh pr view fetch failure in agent -- Nitpick (parent session already fetches PR data; agent's gh call is a fallback path) S9: No fallback if test-plan-executor agent can't be resolved -- Nitpick (Skill invocation failure would surface naturally as an error) S10: Heading-level termination ambiguity -- Genuine issue (minor) (prose description relies on the implementer tracking the matched heading level) Tally
Staged Implementation PlanStage 1 (Required): Critical and Important genuine fixesAddresses F1, F2, F5, F6.
Stage 2 (Optional): Minor genuine fixesAddresses S2, S3, S5, S10.
Optional: Nitpick improvements (not required for merge)
Assessed by Claude Opus 4.6 |
#136) Co-Authored-By: Claude <noreply@anthropic.com>
|
Addressed review findings F1, F2, F5, F6, S2, S3, S5, S10 in commit 30628cd.
Findings deferred (per the assessment's classification): F3, F4, F7, F8, S1, S4, S6, S7, S8, S9 were judged nitpicks or false positives and were not addressed. |
PR Review: Add test-plan-executor subagent to pr-reviewCritical Issues (1)F1: Section-ending regex inconsistency with heading-acceptance regex in
Important Issues (5)F2: Placeholder detection regex
F3: No error handling instruction for
F4: Epoch comparison in
F5: The jq filter in
F6: The
Suggestions (10)S1: The
S2: Timeout escalation regex
S3:
S4: No explicit routing for "gh exit 0 but jq returned null" between sub-steps 1 and 2 in
S5: Consider adding a sync entry for the severity-classification coupling between
S6: The autolink URL exclusion note in
S7: The
S8:
S9: The HTML comment guidance block in
S10: No error handling specified in
Strengths
Test plan results
This is an automated review. Reviewed by Claude Opus 4.6. |
Independent Assessment of PR ReviewFor each finding from the review, I read the actual code at the referenced locations and independently verified whether the issue exists in the current state of the code (after 3 prior fix cycles: commits 146893b, 0e675af, 30628cd). Per-Finding Classification
Totals: 5 genuine (1 real bug: F1; 4 minor: F3, S5, S7, S10), 2 false positive (F5, F6), 9 nitpick (F2, F4, S1, S2, S3, S4, S6, S8, S9), 0 deferred Staged Implementation PlanStage 1 (Required): Fix section-end regex mismatch -- F1File: Restrict the heading-match regex from Stage 2 (Required): Add gh pr view error handling to agent -- F3File: Add to the Inputs section (after line 21): "If Stage 3 (Optional): Add sync entry for severity classification -- S5File: Add a sync entry documenting the coupling between Stage 4 (Optional): Add all-blocked variant to report template -- S7File: Add a variant to the Step 7 Tests template for the all-blocked case: Stage 5 (Optional): Add executor failure handling to pr-review -- S10File: Add to the Skill invocation instruction (line 72): "If the executor agent fails or returns malformed output, omit the Assessed by Claude Opus 4.6 |
Co-Authored-By: Claude <noreply@anthropic.com>
Review-fix progress (commit
|
Summary
agents/test-plan-executor.md, a read-only subagent that runs each item in a PR's## Test planchecklist, classifies the outcome (PASS / FAIL / BLOCKED), applies a destructive-pattern safety filter, and returns structured findings.commands/pr-review.md(Step 2 Skill bullet to invoke it in parallel; Step 3 owns the canonical## Test plan resultstable format) so FAIL items merge into the existingF<n>finding flow consumable bypr-review-fix.commands/pr-create.mdwith an HTML guidance block plus three example bullets covering specificity, backticked commands, single-concern items, and setup/action/teardown ordering.commands/pr-pre-merge.mdStep 5d to coordinate with the existing<!-- mach10-review -->marker via epoch-second timestamp comparison (fresh: surface prior summary and skip the suite; stale: prompt re-run / accept-stale / run suite directly).CLAUDE.md, disambiguates the executor frompr-review-toolkit:pr-test-analyzerinREADME.md, and bumps the plugin version 1.29.0 -> 1.30.0.Test plan
/mach10:pr-reviewagainst this PR and confirm the executor is invoked, the## Test plan resultstable renders, and any FAIL items receiveF<n>identifiers in the standard findings list.`git --version`), confirm the item is reportedPASSwith the command shown.`false`), confirm the item is reportedFAILwith exit code and a truncated last-30-lines output excerpt, and that it appears as anF<n>finding.`rm -rf /`, confirm it isBLOCKEDwithfiltered for safety: ...and is NOT executed.BLOCKEDwith the perception reason.## Test plansection, confirm the executor surfaces a single suggestion-level note rather than running.pr-reviewrun, run/mach10:pr-pre-mergeand confirm Step 5d surfaces the prior results and skips the auto-detected suite./mach10:pr-pre-merge, and confirm it offers the three-option stalenessAskUserQuestion(re-run pr-review / accept stale / run suite directly).pr-create.mdtemplate by running/mach10:pr-createon a scratch branch and confirming the HTML guidance comment plus example bullets render as expected in the draft body.Fixes #136
Generated with Claude Code