Skip to content

fix(run)!: no label adds the test phase to a phase list the user or detection chose — remove the UI-label insertion in determinePhasesForIssue (closes #1631) #1649

Closed

Description

@admarble

Epic: graph-2026-11-simplify (F-10 cluster of #1501) Tier: mechanical Execution: sequant_run Blocked by: #1645

Problem

D-1 removes /test's label auto-add; the /test skill stays. determinePhasesForIssue (src/lib/workflow/phase-mapper.ts:200-208) appends test whenever an issue carries a UI label, including on an explicit --phases list: sequant run 930 --phases spec ran spec then test on matcha-maps (#1631), and #857 was the same block. --phases spec,test or --phases spec,exec,test,qa stays the way to ask for the phase. Founding doc P-6.

Decisions

ID Decision Rejected
T-1 Delete the insertion block. --testgen and --security-review adjustments in the same function stay: the user passed those flags gating the block on explicit --phases only (#1631's first ask; D-1 removes the add)
T-2 detectPhasesFromLabels (auto-detect mode, opt-in through run.autoDetectPhases) keeps choosing the UI workflow removing label detection (not named by D-1)

Prior fixes / producers

Acceptance Criteria

  • AC-1: For an issue labelled frontend, an explicit ["spec"] stays ["spec"], an explicit ["spec","exec","qa"] stays without test, and --testgen still inserts testgen. Evidence: npx vitest run src/lib/workflow/phase-mapper.test.ts -t "label does not add test" → ≥ 3 passed, 0 failed
  • AC-2: Auto-detect mode still picks the UI workflow for a UI label. Evidence: npx vitest run src/lib/workflow/phase-mapper.test.ts -t "detectPhasesFromLabels" → 0 failed (constraint)
  • AC-3: The changelog records the change. Evidence: awk '/^## \[Unreleased\]/,/^## \[[0-9]/' CHANGELOG.md | grep -c '#1631' → ≥ 1
  • AC-4: No skill-directory edits. Evidence: git diff --name-only $(git merge-base origin/main HEAD)..HEAD | grep -cE '^(plugin/|\.claude/skills/|templates/skills/)' → 0 (constraint)

May touch

src/lib/workflow/phase-mapper.ts and phase-mapper.test.ts, docs/reference/run-command.md (phase-detection paragraph only), CHANGELOG.

Non-Goals

  • The /test skill and --phases ...,test.
  • Auto-detect mode.

Done when

A UI label never adds test to a phase list; the user asks for it by name.

Activity

  1. added
    graph-2026-11-simplify
    on Nov 7, 2026
  2. admarble commented on Nov 8, 2026

    @admarble
    ContributorAuthor

    Runner context (graph-2026-11-simplify W1, 2026-11-07). Read this before planning.

    • Founding doc: docs/internal/graph-2026-11-simplify/PROJECT-DISCUSSION.md on main (7337cdd39). Invariants I-1 to I-7 bind this issue. I-1: no edits under plugin/, .claude/skills/ or templates/skills/. The freeze lifted on 2026-11-06, but I-1 stays this graph's scope.
    • Exec phase and qa phase, both: run the full suite at most once, in the foreground, with timeout, after a WIP commit. Run targeted npx vitest run <file> for everything else. Every MCP or CLI phase has a 30-minute wall.
    • Each AC's Evidence: command is run verbatim by QA and by the runner. Run them yourself before reporting done; don't reason them done.
    • Gate tests ship with the Mutation-verified: record in the PR body (CLAUDE.md). Use sequant mutation begin | check | render where it fits.
    • Changelog: PR feat(#1351): improve(release): changelog fragments instead of a shared [Unreleased] block — 121/192 main commits touch CHANGELOG.md #1370 (changelog fragments under changelog.d/) is open and active. If it has merged on main when you start, follow changelog.d/README.md instead of editing CHANGELOG.md, and say in the PR body that the changelog AC needs rewording. The runner rewords it on the issue; don't skip the entry.
    • This issue: remove only the insertion block in determinePhasesForIssue (phase-mapper.ts:200-208). detectPhasesFromLabels and the --testgen/--security-review adjustments stay (T-1, T-2). If hasUILabels has no caller left, delete it; knip's advisory counts unused exports.
  3. admarble commented on Nov 8, 2026

    @admarble
    ContributorAuthor

    Complexity: Simple (4 ACs, 3 directories)

    AC Quality Check

    All four ACs carry a command-shaped Evidence:. Vacuity check on base: AC-1's -t "label does not add test" matches 0 tests today, so vitest finds no tests and it fails today. That is the intended gate, and the ≥ 3 passed threshold makes it a real one. AC-2 and AC-4 are constraints that pass today by design. AC-3 greps #1631 in [Unreleased], which has no match today, so it fails until the entry lands.

    Scope Assessment

    Non-Goals: present (/test skill, --phases ...,test, auto-detect mode). Verdict: ✅ SCOPE_OK (1 feature, 4 AC, src/lib/workflow, docs/reference, CHANGELOG).

    Acceptance Criteria

    • AC-1: Unit Test. Given a frontend-labelled issue → determinePhasesForIssue(["spec"], ["frontend"], {}) returns ["spec"]; ["spec","exec","qa"] returns unchanged; with testgen: true it inserts testgen after spec. New describe("label does not add test") with ≥3 cases.
    • AC-2: Unit Test (constraint). The existing detectPhasesFromLabels "UI labels" case (phase-mapper.test.ts:73) still returns ["spec","exec","test","qa"].
    • AC-3: Manual. A #1631 line under ### Changed (or ### Fixed) in [Unreleased], marked breaking per the ! title.
    • AC-4: Constraint. No diff under plugin/, .claude/skills/, templates/skills/.

    Implementation Plan

    1. Delete the block at src/lib/workflow/phase-mapper.ts:200-208, along with its comment.
    2. hasUILabels then has no non-test caller (whole-repo grep: only the block and phase-mapper.test.ts:119-131). Delete it and its describe("hasUILabels exact matching (AC-5)"). Update the import in the test. If the registry import becomes unused, remove it.
    3. Add describe("label does not add test") with the 3 cases from AC-1. Mutation-verify it with sequant mutation begin | check | render: restore the block, confirm the test fails, restore, and record Mutation-verified: in the PR body.
    4. Run targeted npx vitest run src/lib/workflow/phase-mapper.test.ts src/commands/run.test.ts. The run.test.ts hits (lines 342, 489, 525, 2544-2567) come from parseRecommendedWorkflow and detectPhasesFromLabels paths, not from this block. Confirm none go through determinePhasesForIssue with a UI label.
    5. Docs: docs/reference/run-command.md:84 says test is "auto-added for ui/frontend/admin/web/browser-labeled issues". Reword it to "added by auto-detect mode (run.autoDetectPhases) or by naming it in --phases". The same line-81 pattern for security-review is true and stays.
    6. CHANGELOG [Unreleased] entry citing run: --phases does not suppress the UI-label test phase (determinePhasesForIssue adds it to an explicit list) #1631 and feat(assess): fence chat output; Considered: block restores why-not flag reasoning #857. changelog.d/ does not exist on main and feat(#1351): improve(release): changelog fragments instead of a shared [Unreleased] block — 121/192 main commits touch CHANGELOG.md #1370 is still open, so edit CHANGELOG.md.

    Design Review

    1. Where does this belong? determinePhasesForIssue is the single post-resolution adjuster. The fix is deleting from it.
    2. Simplest approach: delete the block. Rejected: gating on explicit --phases (run: --phases does not suppress the UI-label test phase (determinePhasesForIssue adds it to an explicit list) #1631's first ask), because D-1 removes the add and the gate would keep dead logic.
    3. Pattern / re-patch count: git log -S hasUILabels shows 1 introducing commit (14b811922, refactor(run): split 3,459-line monolith into focused modules #318). Prior symptom issues are feat(assess): fence chat output; Considered: block restores why-not flag reasoning #857 and run: --phases does not suppress the UI-label test phase (determinePhasesForIssue adds it to an explicit list) #1631, a workaround then this fix. That makes 2 symptom reports, 0 prior code fixes, so this is the first fix and it fixes the class (the block is gone for every caller).
    4. Reviewer challenge: "Do batch-executor.ts:3319 and skills-preflight.ts:183 change?" Both consume the function, so both follow. Preflight no longer expects test for UI-labelled issues, which is the correct direction. Check skills-preflight.ts:113-130 for comments that describe the insertion.
    5. Producers/consumers: producers of a phase list are detectPhasesFromLabels, parseRecommendedWorkflow, determinePhasesForIssue and config-resolver. Only determinePhasesForIssue changes. Consumers are batch-executor, skills-preflight and run-compat. No new producer, so no parity test is needed.

    Feature Quality Planning

    All standard checks pass. Notable: it's a breaking behaviour change (hence !). Users who relied on UI labels adding test must pass --phases ...,test or use auto-detect.

    Open Questions

    1. tracker: graph-2026-11-simplify — sequant 3.0 cut to the measured shape: D-1 removals, a halt on a repeated AC_NOT_MET, the ready gate's claim dropped, chain and multi-issue marked experimental, production-reaching Evidence handed to a person, the downstream pin, the release #1645 (blocker) is still OPEN. Recommendation: exec should wait for it to merge. The code change here is independent, so there's no merge conflict risk, but D-1 and this issue are meant to land together.
    2. The docs/reference/run-command.md:84 row sits in a phase table, not the "phase-detection paragraph" the issue's May-touch names. Recommendation: edit that row, since it is the only wrong statement. Impact if skipped: docs keep claiming auto-add.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: one deletion plus tests. AC-1 declares unit-test evidence, but this is a bug fix with a single targeted test, so testgen is skipped.

    Label Review

    Current: graph-2026-11-simplify. Recommended: add planned only. Quality Loop: won't auto-enable.

  4. added
    planned
    on Nov 8, 2026
  5. admarble commented on Nov 8, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 4/4 met

    Gaps:

    • After removing the UI-label insertion, /assess minimal-flags shorthand and its docs page still assume the label adds test, so displayed commands for ui-labelled issues now drop the test phase (skill edit blocked by I-1) — unresolved: needs filing
    • Required test CI check had not completed at review time
    • Stale docs page. docs/features/assess-minimal-flags.md:19, :25 and :30 still say UI-labelled issues "automatically get the test phase inserted before qa". Its example says npx sequant run 499 -Q runs spec → exec → test → qa. After this change that command runs spec → exec → qa. The page is under docs/features/, which publishes to the site. It is outside this issue's "May touch" list.
    • The /assess skill relies on the removed behaviour. .claude/skills/assess/SKILL.md:440 (mirrored in plugin/ and templates/) tells /assess to drop --phases for UI-labelled issues because "determinePhasesForIssue auto-adds test from the ui label". So /assess will now print commands that silently skip test, while its assess:phases= marker still lists test. I-1 forbids skill edits in this graph, so the fix has to be a separate issue.

    Reviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-sonnet-5-5).

  6. added a commit that references this issue on Nov 8, 2026
  7. admarble commented on Nov 8, 2026

    @admarble
    ContributorAuthor

    Runner, W1: QA AC_MET_BUT_NOT_A_PLUS. All four ACs re-run by the runner pass. The stale docs page is fixed on the PR (05e9a7a5b). Deferred, not fixed: .claude/skills/assess/SKILL.md:440 still omits --phases for UI-labelled issues on the assumption that the label adds test. It's skill text outside this graph's I-1 scope and is a candidate for OQ-7 in the founding doc; the owner decides whether it joins. PR #1659 is waiting for CI and the owner's merge.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    graph-2026-11-simplifyplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions