Skip to content

fix(qa): broaden §10a user_facing regex to match scoped conventional commits #610

Closed

Description

@admarble

Problem

The CHANGELOG gate wired into /qa §7 verdict algorithm by #585 / PR #601 cannot fire on scoped conventional-commit projects — including sequant itself.

templates/skills/qa/SKILL.md:2328:

user_facing=$(git log main..HEAD --oneline | grep -iE '^[a-f0-9]+ (feat|fix|perf|refactor|docs):' | wc -l | xargs || true)

This regex matches only unscoped form (feat:, fix:). Sequant uses scoped form (feat(#NNN):, fix(area)!:) on 26/26 recent commits audited during PR #601 QA. So user_facing=0 → changelog_required=false → §7 branch short-circuits → gate effectively never fires.

Net effect: PR #601 correctly wires the gate, but it cannot deliver the value cited in the original /fullsolve 575 motivation because sequant's own commits aren't detected.

Acceptance Criteria

  • AC-1: user_facing regex broadened to match scoped + optional ! forms: (feat|fix|perf|refactor|docs)(\\([^)]*\\))?!?:. Verify: Manual — read regex; test against real commit log shows ≥1 match on this repo's recent history.
  • AC-2: Mirrored across all three qa/SKILL.md files (templates/, .claude/, skills/). Verify: Manual — diff all three pairs produces empty output.
  • AC-3: §10a caveat tightened. Current text at line 2312 says "Projects without conventional commits silently skip this gate." Update to specify the form constraints — e.g. "Detection requires conventional-commit prefixes matching `(feat|fix|perf|refactor|docs)(...)?!?:`. Other formats silently skip (failsafe-off)." Verify: Manual — read updated paragraph.
  • AC-4: Dogfood — after edit, run git log main..HEAD --oneline | grep -iE '<new-regex>' against a feature branch with scoped commits (e.g., this issue's own branch) and confirm ≥1 match. Verify: Manual — paste output in PR body.
  • AC-5: Regression — verify the gate still no-ops when (a) CHANGELOG.md absent and (b) commits are non-conventional (chore, ci, test). Verify: Manual — trace each scenario through §10a → §7.

Implementation Plan

  1. Edit user_facing= regex at line 2328 in all three qa/SKILL.md copies.
  2. Update §10a caveat paragraph at line 2312 in all three copies.
  3. Run node scripts/check-skill-sync.ts (or diff) to confirm zero divergence.
  4. Add [Unreleased] CHANGELOG entry under `### Fixed`.

Why this is a follow-up, not part of #585

PR #601 was correctly scoped to "wire the gate into §7". The QA verdict was AC_MET_BUT_NOT_A_PLUS — all five ACs literally pass; AC-3 explicitly accepts no-op behavior on undetected prefixes. Expanding scope mid-PR would have violated the spec contract. The regex broadening is a separate detection-layer concern with its own AC and dogfood test plan.

Risk Assessment

  • Likely failure mode: False positives on non-user-facing scoped forms — none exist; feat(test): is still a feature, fix(ci): is still a fix. Conventional-commit semantics treat scope as orthogonal to type.
  • Not tested: Skill prompt content is LLM-interpreted; no executable unit test. Mitigated by AC-4's real-corpus dogfood.

Related

Activity

  1. added
    bug
    qa
    on May 9, 2026
  2. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    → PROCEED — Bug fix with clear ACs (5), well-scoped to a regex broaden across 3 mirrored qa/SKILL.md files.

    Workflow: exec → qa

    npx sequant run 610 --phases exec,qa
    

    ⚠ Touches qa/SKILL.md — confirm sync across all 3 mirror dirs (templates/, .claude/, skills/) per CLAUDE.md memory.

  3. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    Plan for #610 — Broaden §10a user_facing regex

    (Plan originally drafted on duplicate issue #612 — transferred here. #612 closed as duplicate.)

    Acceptance Criteria

    • AC-1: §10a regex updated to ^[a-f0-9]+ (feat|fix|perf|refactor|docs)(\([^)]*\))?!?: — accepts unscoped, scoped, breaking, and scoped-breaking forms. Verification: Manual Test (shell) — 8 positive cases.
    • AC-2: Regex still rejects chore:, test:, ci:, build(deps):, style:, wip:. Verification: Manual Test (shell) — 6 negative cases.
    • AC-3: §10a "Caveat — conventional-commit dependency" paragraph rewritten to enumerate prefix list + optional scope + ! marker. Verification: Inline diff review.
    • AC-4: All three qa/SKILL.md mirrors byte-identical after edits. Verification: diff exit code 0 on each pair.
    • AC-5: Regression — unscoped feat: still matches; merged dd6027b feat(#585): now detected (vs 0 hits with old regex). Verification: Manual Test (shell) — dogfood against origin/main.

    Implementation Plan

    Phase 1 — Edit (3 mirrored SKILL.md files):

    1. templates/skills/qa/SKILL.md — line 2328 regex + line 2312 caveat
    2. .claude/skills/qa/SKILL.md — same two edits
    3. skills/qa/SKILL.md — same two edits

    Phase 2 — CHANGELOG:
    4. Append bullet under [Unreleased] / ### Changed documenting the regex broadening and dogfood gap closure.

    Phase 3 — Verification + ship:
    5. Mirror sync: diff all 3 pairs → expect empty.
    6. Shell verification (verbatim from issue body of #612): 8 positive, 6 negative, dogfood against origin/main.
    7. Commit + push + open PR.

    Sibling-site Scan

    Pattern (feat|fix|perf|refactor|docs): appears in 3 sites only — all line 2328 of the three qa/SKILL.md mirrors. user_facing symbol same 3 sites. No other detection logic to broaden.

    Design Review

    1. Where: §10a detection block in qa/SKILL.md, in place. No layer change.
    2. Simplest: Append (\([^)]*\))?!? to the type group; rewrite one caveat paragraph. ~14 lines total.
    3. Pattern: Three-mirror sync (templates/, .claude/, skills/).
    4. Reviewer challenge: "Why not include chore:?" — out of scope; conventional-commit semantics class chore: as non-user-facing. AC-5 backward-compat requires unscoped feat: to still match.

    Recommended Workflow

    Phases: spec → exec → qa
    Quality Loop: disabled
    Reasoning: Markdown-only diff, no UI surface, no executable test path. Simple Fix Mode in QA.

  4. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    /exec Progress Update — #610

    AC Coverage Summary

    AC Description Status Evidence
    AC-1 Regex updated to `(feat fix perf
    AC-2 Still rejects chore:/test:/ci:/build:/style: ✅ Verified 6/6 negative cases reject (shell test)
    AC-3 §10a Caveat paragraph rewritten ✅ Implemented All 3 SKILL.md mirrors line 2312 — enumerates prefix list + scope + !
    AC-4 All 3 mirrors byte-identical ✅ Verified diff exit 0 on each pair
    AC-5 Regression — unscoped works; merged #585 detected ✅ Verified OLD regex 0 hits; NEW finds dd6027b feat(#585): against origin/main~5..origin/main

    Coverage: 5/5 ACs met

    Files Changed

    File Lines Change
    .claude/skills/qa/SKILL.md +2/-2 regex + caveat
    skills/qa/SKILL.md +2/-2 regex + caveat (mirror)
    templates/skills/qa/SKILL.md +2/-2 regex + caveat (mirror)
    CHANGELOG.md +1/-0 [Unreleased] / ### Changed entry

    Total: 4 files, +7/-6.

    Quality Plan Alignment

    N/A — no quality plan generated for this issue (markdown-only diff, simple-fix scope).

    Test/Build/Lint Results

    Self-Evaluation

    • Worked as expected: Yes — all 14 shell verification cases pass (8 positive + 6 negative). Dogfood confirms the gap closure.
    • Test coverage confidence: High for the regex itself (verified against verbatim test fixtures from issue body); low for end-to-end §7 verdict integration (no executable test path for SKILL.md prose).
    • Weakest part: Caveat rewording is a judgment call — alternative wordings could be tighter. The regex is mechanically correct.
    • Honest assessment: The fix is small, mechanical, and dogfoodable. Three risks worth flagging: (1) any future re-statement of the prefix list elsewhere in skills will need to match this pattern; (2) the regex now accepts arbitrarily nested scopes via [^)]*, which is permissive but matches conventional-commit semantics; (3) once this merges, sequant's own PRs will start triggering the §7 gate when they lack [Unreleased] entries — desired but worth flagging in case anyone has open PRs that would suddenly become AC_MET_BUT_NOT_A_PLUS.

    PR Status

    Documentation Reminder

    CHANGELOG entry added under [Unreleased] / ### Changed. No README/docs/ updates needed (skill prompt change, internal mechanism).

    Next Steps

    1. CI completes
    2. /qa review
  5. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #610 (Simple Fix)

    Size Gate

    Check Value
    Diff size (3-dot) 4 files, +7/-6
    package.json changed No
    package-lock.json changed No (3-dot diff is .md only; 2-dot shows stale-branch artifact only — would auto-resolve at merge)
    Security-sensitive paths No
    Decision Inline checks

    AC Coverage

    AC Description Status Notes
    AC-1 Regex updated to (feat|fix|perf|refactor|docs)(\([^)]*\))?!?: accepting unscoped/scoped/breaking/scoped-breaking MET Verified 8/8 positives match: feat:, feat(#585):, fix(area)!:, docs(#574):, fix(#592):, perf(api)!:, refactor:, docs!:. All 3 mirrors line 2328 updated.
    AC-2 Still rejects non-user-facing prefixes MET Verified 6/6 negatives reject: chore:, test:, ci:, build(deps):, style:, wip: — confirms type list unchanged, only suffix made optional.
    AC-3 §10a Caveat paragraph rewritten to enumerate prefix list + scope + ! MET Line 2312 reads: "Detection requires conventional-commit prefixes — feat, fix, perf, refactor, docs, with optional scope ((...)) and breaking marker (!)…". Reader can predict gate triggering without reading the regex.
    AC-4 All 3 SKILL.md mirrors byte-identical MET diff exit 0 between .claude/skills/qa/SKILL.md, skills/qa/SKILL.md, templates/skills/qa/SKILL.md.
    AC-5 Regression — unscoped still works; merged dd6027b feat(#585): now detected MET Against origin/main~5..origin/main: OLD regex returns 0 hits; NEW regex finds dd6027b feat(#585): (and adjacent eb11fa7 fix(#596):). Backward compat for unscoped feat: confirmed via positive test.

    Coverage: 5/5 ACs fully met


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK (no TS/JS files changed)
    Deleted tests 0 OK
    Files changed (3-dot) 4 OK
    Lines added +7 -
    Lines deleted -6 -
    Security patterns 0 OK

    CI Status

    Check State Conclusion
    typecheck COMPLETED SUCCESS
    validate-skills COMPLETED SUCCESS
    validate-plugin COMPLETED SUCCESS
    Plugin Structure Validation COMPLETED SUCCESS
    Hooks Validation COMPLETED SUCCESS
    Setup Directory Creation COMPLETED SUCCESS
    build (20.x) IN_PROGRESS (markdown-only diff — informational per qa.markdownOnlyCiRelaxed)
    build (22.x) IN_PROGRESS (markdown-only diff — informational per qa.markdownOnlyCiRelaxed)

    CI Summary: 6 passed, 2 pending (build matrix). Per markdown-only CI relaxation (#569), pending build (*) checks on .md-only diffs are informational and do NOT force NEEDS_VERIFICATION. 3-dot diff confirmed .md-only.


    Code Review

    Strengths:

    • Surgical change: single regex segment broadened, single caveat paragraph rewritten. No structural changes to §10a or §7 flow control.
    • Backward compatible: unscoped form (feat:) still matches per AC-5.
    • Pattern unification: optional scope (\([^)]*\))? and optional ! are both standard regex idioms — no exotic constructs.
    • All 3 mirrors stay byte-identical (verified via diff).
    • CHANGELOG entry under [Unreleased] / ### Changed includes issue ref (#610) and clearly documents the prefix list change.
    • Self-dogfood: this PR's own commit fc5d5c2 fix(#610): is detected by the new regex; CHANGELOG entry exists; §10a (now self-applied) does NOT demote — clean closure.

    Issues:

    • None blocking.

    Notes:


    Sibling-site Considered

    • Pattern (feat|fix|perf|refactor|docs): searched across .claude/, skills/, templates/, src/, scripts/, docs/ — appears in 3 sites only, all line 2328 of the 3 SKILL.md mirrors. All updated.
    • user_facing symbol same 3 sites. No additional detection logic to broaden.
    • CHANGELOG line 12 prose describes the old prefix list (historical, intentional — see "Notes" above).

    Test Coverage Analysis

    N/A — markdown-only diff. Skill prompt is LLM-interpreted at runtime; no executable code path. Verification is shell-based (run in /exec and re-confirmed in QA): 8 positives, 6 negatives, 5 edge cases, dogfood vs origin/main.


    Anti-Pattern Detection

    No code patterns to scan. CHANGELOG growth: +1 line under existing [Unreleased] / ### Changed — appropriate format.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix(#610): commit detected by NEW regex — dogfood ✓)
    [Unreleased] entry ✅ Present under ### Changed
    Entry format ✅ Includes (#610); action verb "broadened"/"updated"

    Result: CHANGELOG requirements met. Dogfood: §10a (now in this PR) self-applies cleanly — no AC_MET_BUT_NOT_A_PLUS demotion from the gate this PR ships.


    Skill Command Verification

    Skill files changed: 3 (qa/SKILL.md mirrors)

    Pattern Verification Status
    git log main..HEAD --oneline Standard git command, no flags changed ✅ OK
    grep -iE '<new regex>' Tested against real corpus (origin/main~5..origin/main) — finds expected commits ✅ OK
    Caveat paragraph No commands; documentation prose only ✅ N/A

    Verification Status: Passed


    Self-Evaluation

    • Verified working: Yes — ran all 14 shell test cases plus 5 edge cases plus dogfood against origin/main. The new regex behaves exactly as specified and self-applies cleanly to this PR.
    • Test efficacy: Medium — verification is shell-based one-shot, not part of an automated test suite. A future regression in §10a regex would not be caught by npm test (skill prompts have no executable test path). This is a structural limitation of skill-prompt-as-code, not a defect of this PR.
    • Likely failure mode: Behavior change exposure — once merged, any open sequant PR with a scoped conventional commit AND missing [Unreleased] entry will suddenly demote from READY_FOR_MERGE to AC_MET_BUT_NOT_A_PLUS. Audited current open PRs (feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552, bug(skills): potential silent misroute when unqualified Skill("security-review") added — mirrors #562 #568, none others on §10a path): all have CHANGELOG entries or non-user-facing prefixes. Low blast radius.
    • Verdict confidence: High. Mechanical change, dogfooded, three-mirror sync verified, no structural impact.

    Verdict: READY_FOR_MERGE

    All 5 ACs met literally. Self-dogfood passes (this PR's own commit triggers the new gate; its CHANGELOG entry satisfies it). CI green on the 6 completed checks; pending build matrix is informational on .md-only diff. No follow-up gaps surface from sibling-site scan or adversarial re-read.

    Documentation

    • CHANGELOG entry added under [Unreleased] / ### Changed with issue ref (#610)
    • §10a Caveat prose updated in all 3 mirrors
    • N/A — no README/docs/ changes needed (skill prompt internal mechanism)

    Next Steps

    1. Merge once build (20.x) and build (22.x) complete (informational — markdown-only diff).
    2. Post-merge: any newly-opened sequant PR with scoped conventional commits will now correctly trigger §10a if missing [Unreleased] entries.
  6. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #610 (originally invoked as /fullsolve 612 — pivoted to #610 as duplicate; #612 closed)
    Status: READY_FOR_MERGE

    Summary

    Phase Iterations Status
    Spec 1/1 Complete
    Exec 1/1 Complete — commit fc5d5c2
    Test 0/0 Skipped (no UI labels)
    QA 1/2 Complete — READY_FOR_MERGE
    PR — #613 (OPEN, MERGEABLE)

    AC Coverage: 5/5 MET

    AC Status
    AC-1: Regex broadened to scoped/breaking variants ✅ MET
    AC-2: Still rejects non-user-facing prefixes ✅ MET
    AC-3: §10a Caveat paragraph rewritten ✅ MET
    AC-4: All 3 SKILL.md mirrors byte-identical ✅ MET
    AC-5: Regression — unscoped works; merged #585 detected ✅ MET

    Quality Metrics

    • CI: 6/8 SUCCESS, 2 build matrix in progress (informational on .md-only diff per qa.markdownOnlyCiRelaxed)
    • Files changed: 4
    • Diff: +7 / -6
    • Type issues: 0 (no TS/JS files changed)
    • Deleted tests: 0
    • Mirror sync: ✅ byte-identical
    • Dogfood: ✅ NEW regex detects this PR's own fix(#610): commit; OLD regex returned 0 against same range

    Risk Assessment (from QA)

    Iterations

    • Test loop: 0 (no UI; skipped)
    • QA loop: 0 (verdict on first pass: READY_FOR_MERGE)

    Process Notes

    PR: #613

    Ready for human merge once build matrix completes (informational).

  7. added a commit that references this issue on May 9, 2026
  8. admarble commented on May 9, 2026

    @admarble
    ContributorAuthor

    Adversarial Re-Read — Gap Found and Fixed

    User prompt "any gaps?" surfaced a real sibling-site I missed in the original /spec sibling-scan.

    The Gap

    §7 verdict algorithm prose at line 2056 was a duplicate spec of §10a's detection regex, still describing the OLD unscoped prefix list:

    - changelog_required = true IFF Section 10a's `CHANGELOG.md` exists AND
      `git log main..HEAD` contains a user-facing conventional-commit prefix
      (`feat:|fix:|perf:|refactor:|docs:`); false otherwise   ← STALE post-fc5d5c2
    

    After fc5d5c2 broadened §10a's regex to accept scoped/breaking variants, §7's prose became stale. A reader following §7 to the letter would conclude scoped commits don't trigger changelog_required — contradicting §10a's actual code.

    Why the original sibling-scan missed it

    /spec and structured /qa searched for the regex literal (feat|fix|perf|refactor|docs): and found 3 hits at line 2328 (the actual code). It did NOT search for prose descriptions of the prefix list — different syntax, same semantics.

    Fix (commit 13ffe9e)

    Replaced the inline prefix-list duplicate with a pointer to §10a as single source of truth:

    - - changelog_required = true IFF Section 10a's `CHANGELOG.md` exists AND
    -   `git log main..HEAD` contains a user-facing conventional-commit prefix
    -   (`feat:|fix:|perf:|refactor:|docs:`); false otherwise
    + - changelog_required = true IFF Section 10a's `CHANGELOG.md` exists AND
    +   Section 10a's `user_facing` count is >0 (single source of truth — see §10a
    +   for the conventional-commit detection regex, which accepts unscoped, scoped,
    +   and breaking variants of `feat`/`fix`/`perf`/`refactor`/`docs`); false otherwise

    This applies the same pattern as the original fix: eliminate the drift surface by pointing the spec at the code, not duplicating it.

    Verification

    • Mirror sync: ✅ all 3 SKILL.md byte-identical post-edit
    • Stale prefix-list references in algorithm sections: ✅ none remain
    • Verdict still READY_FOR_MERGE — no AC change, structural improvement only

    Process Lesson

    Saving memory feedback_sibling_scan_includes_prose — when broadening a regex/spec, sibling-site scan must search for prose descriptions, not just the code literal.

    PR #613: updated with 13ffe9e on top of fc5d5c2. Verdict unchanged.

  9. added a commit that references this issue on May 9, 2026
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

    bugqa

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions