Skip to content

fix(autoplan): surface scope-detection counts and stop silent phase skips#2014

Open
genisis0x wants to merge 2 commits into
garrytan:mainfrom
genisis0x:fix/1957-autoplan-scope-diagnostic
Open

fix(autoplan): surface scope-detection counts and stop silent phase skips#2014
genisis0x wants to merge 2 commits into
garrytan:mainfrom
genisis0x:fix/1957-autoplan-scope-diagnostic

Conversation

@genisis0x

Copy link
Copy Markdown
Contributor

Problem

/autoplan Phase 0 decides whether to run Phase 2 (Design Review) and Phase 3.5 (DX Review) by grepping the plan for scope terms and requiring 2+ matches. When a scope lands below the threshold, the phase is dropped silently — the run reports only a yes/no, with no match count, no near-miss warning, and no way to override.

Two failure modes follow:

  1. Silent miss — a plan that is genuinely UI- or developer-facing but phrases terms with hyphens (form-control, api-endpoint), uses synonyms outside the list, or buries them in code fences grep skips, loses two whole review phases and the user never learns why.
  2. Borderline trip — a scope at exactly 2 matches gives no warning; one fewer match on a re-run makes the phase silently disappear.

Fix

In Phase 0 Step 2:

  • Report the match count per scope, not just yes/no, and never skip a phase silently.
  • Treat a below-threshold scope (0-1 matches) that the plan plausibly touches as a near-miss rather than a clean no, naming the known false-negative triggers (hyphenated terms, synonyms, code-fenced terms).
  • Call out the borderline exactly-two case.
  • Offer an override — the user can tell the skill to force a phase regardless of the count.

The Phase 0 output line now carries the counts and the override note.

This is scoped to /autoplan and the change is prose-only in the skill template plus its regenerated SKILL.md; it touches no shared preamble.

Verification

Added test/autoplan-scope-diagnostic.test.ts (gate tier, 6 checks) pinning the count reporting, near-miss flag, borderline flag, override offer, the output-line format, and template/generated parity. All six assertions return 0 occurrences on main, so the test fails before the fix and passes after. bun test test/gen-skill-docs.test.ts test/skill-validation.test.ts — 734 pass, 0 fail.

Closes #1957

…kips

Phase 0 decides whether to run the Design (Phase 2) and DX (Phase 3.5)
reviews by grepping the plan for scope terms with a 2-match threshold.
Below the threshold the phase was dropped silently: the run reported only
a yes/no, with no match count, no near-miss warning, and no way to
override. A plan that is genuinely UI- or developer-facing but phrases
its terms with hyphens (form-control), uses synonyms outside the list,
or buries them in code fences grep skips would lose two whole review
phases without the user ever knowing why. A scope sitting at exactly two
matches is one edit away from silently disappearing on the next run.

Report the match count per scope, flag a below-threshold scope as a
near-miss instead of a clean no, call out the borderline exactly-two
case, and offer an override so the user can force a phase regardless of
the count. The Phase 0 output line now carries the counts and the
override note.

Closes garrytan#1957
@trunk-io

trunk-io Bot commented Jun 15, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/autoplan Phase 0: silent phase-skip when scope detection misses by one term; no diagnostic

1 participant