Skip to content

feat(#551): /qa Section 6c — detection-pattern verification for skill regex/grep/awk changes - #572

Merged
admarble merged 3 commits into
mainfrom
feature/551-feat-qa-require-detection-pattern-verification-for
May 4, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/551-feat-qa-require-detection-pattern-verification-for

Conversation

@admarble

@admarble admarble commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds /qa Section 6c "Detection Pattern Verification" — a new gate that triggers when a PR adds or modifies grep/awk/jq/sed commands or regex literals inside skill markdown (.claude/skills/, templates/skills/, skills/). Closes the gap exposed by PR #547, where 3 silent regex/awk/jq detection bugs shipped through /qa because Section 6a only verified command syntax, not whether patterns matched their intended corpus.

For each detected pattern, QA must (a) identify the intended corpus from surrounding skill prose, (b) sample ≥5 real instances, (c) execute the pattern against each, and (d) record match/no-match counts in a Pattern / Corpus / Samples / Expected / Actual / Status table. Snippets quoted in the issue body as motivating examples — blockquotes, fenced blocks under non-Setup headings, and **Verify:** / **Verbatim:** / **Example:** / **AC verification:**-prefixed lines — are treated as mandatory test fixtures.

Verdict gate is stricter than Section 6a: Failed → AC_NOT_MET (silent detection failures are worse than wrong CLI flags because the pipeline reports success). The verbatim Adversarial re-read of core logic — list anything the structured pipeline didn't surface checkbox is added to both Simple Fix Mode and Standard QA Output Verification checklists.

Pre-PR AC Verification

AC Status Evidence
AC-1 — Trigger detector for skill regex/grep/awk/jq/sed ✅ MET .claude/skills/qa/SKILL.md Section 6c Step 1 (lines 1735–1763); detector matches .claude/skills/**/*.md, templates/skills/**/*.md, skills/**/*.md
AC-2 — Identify corpus, sample ≥5, execute, record table ✅ MET Step 2 corpus mapping table + Step 3 execution recipe with required output table (Pattern/Corpus/Samples/Expected/Actual/Status)
AC-3 — Motivating-example snippets as mandatory fixtures ✅ MET Step 4 fixture verification recipe; explicitly enumerates blockquotes, fenced blocks (excluding Setup/Install), and **Verify:**/**Verbatim:**/**Example:**/**AC verification:** prefixes
AC-4 — Verdict gate Failed → AC_NOT_MET ✅ MET Section 7 verdict algorithm: new IF detection_pattern_status == "Failed": → AC_NOT_MET branch; CRITICAL note added; gate is stricter than Section 6a's AC_MET_BUT_NOT_A_PLUS
AC-5 — Adversarial re-read checkbox in both checklists ✅ MET Verbatim line [ ] Adversarial re-read of core logic — list anything the structured pipeline didn't surface added to Simple Fix Mode (line 2356) and Standard QA (line 2383)
AC-6 — 3-dir sync ✅ MET npx tsx scripts/check-skill-sync.ts reports synced qa/SKILL.md — 3/3 match; md5 byte-identical across .claude/skills/, templates/skills/, skills/
AC-7 — CHANGELOG [Unreleased] entry ✅ MET CHANGELOG.md [Unreleased] / ### Added entry referencing #551 with full description of the gate and stricter verdict

Self-Dogfood (Phase 5 of spec plan)

Ran the new Section 6c procedure against this PR's own diff before requesting QA:

Detector and fixture extraction both produce the AC-claimed result on this PR's own input.

Quality Plan Alignment

N/A — Issue #551 spec plan was prose-only (no automated tests apply per the issue's Motivation: "Prompt-only skill changes (regex/grep/awk/jq inside SKILL.md) have no automated test coverage").

Test plan

  • npm run build — TypeScript compiles
  • npm run lint — ESLint clean (0 warnings)
  • npx tsx scripts/check-skill-sync.ts — qa/SKILL.md — 3/3 match
  • npx vitest run __tests__/settings-schema.test.ts — sanity test passes (30/30)
  • Self-dogfood Step 1 detector against this PR's diff
  • Self-dogfood Step 4 fixture extraction against issue feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551 body
  • Reviewer: confirm Section 6c is positioned correctly between 6b and 7
  • Reviewer: confirm verdict algorithm cascade (Failed → AC_NOT_MET) is stricter than skill_verification == "Failed" → AC_MET_BUT_NOT_A_PLUS
  • Reviewer: confirm adversarial re-read line is verbatim in both checklists

Closes #551

…ex/grep/awk/jq/sed changes (#551)

Adds a new /qa Section 6c "Detection Pattern Verification" that triggers when a
PR adds or modifies grep/awk/jq/sed commands or regex literals inside skill
markdown (.claude/skills/, templates/skills/, skills/). For each detected
pattern, QA must:

  1. Identify the intended corpus from surrounding skill prose
  2. Sample ≥5 real instances from that corpus
  3. Execute the pattern against each
  4. Record match/no-match counts in an output table

Snippets quoted in the issue body as motivating examples (blockquotes, fenced
code blocks under non-Setup headings, **Verify:**/**Verbatim:**/**Example:**/
**AC verification:** prefixed lines) are treated as mandatory test fixtures.

Verdict gate is stricter than Section 6a: Failed → AC_NOT_MET (silent
detection failures are worse than wrong CLI flags because the pipeline
reports success). The verdict algorithm and CRITICAL notes in Section 7
are updated accordingly.

Adds the verbatim "Adversarial re-read of core logic — list anything the
structured pipeline didn't surface" checkbox to both Simple Fix Mode and
Standard QA Output Verification checklists.

Synced byte-identically across all 3 skill directories.

Closes the gap exposed by PR #547 / issue #529, where 3 silent regex/awk/jq
detection bugs shipped through /qa because Section 6a only verified command
syntax, not whether patterns matched their intended corpus.
admarble added 2 commits May 3, 2026 17:51
…fficient Samples rung, gh api recipes

Three calibration fixes surfaced by adversarial review of PR #572 before merge:

1. Unify Step 1 detection regex
   Old: \bgrep -[A-Za-z]+ | \bawk [\x27"] | \bjq [\x27"] | \bsed [\x27"]
   New: \b(grep|awk|jq|sed) [-\x27"]
   Old form required a flag after grep but a quote after awk/jq/sed, so it
   missed jq -r ".field", sed -n "...", awk -v VAR=val "..." — the most
   common modifier-flag forms in this codebase. Unified rule covers both
   shapes in one expression. Manual-review fallback prose updated to list
   the long-tail shapes (bare grep "x", non-anchored character classes).

2. Add Insufficient Samples status rung
   AC-2 mandates >=5 samples per pattern. Old status table had only Passed
   / Failed / Skipped / Not Required, so a reviewer with 3 matching samples
   would default to Passed and silently violate the threshold. New rung:
     - Step 5 status table + SPARSE-CORPUS RULE
     - Section 6c verdict gating table -> AC_MET_BUT_NOT_A_PLUS
     - Section 7 algorithm: ELSE IF detection_pattern_status ==
       "Insufficient Samples" -> AC_MET_BUT_NOT_A_PLUS
     - detection_pattern_status value list updated
     - Step 3 warning escalated from advisory to actionable
     - Output template Verification Status enum updated

3. Replace gh search recipes with gh api
   gh search issues "SEQUANT_PHASE spec" relied on GitHub's full-text index
   covering HTML-comment markers, which is not reliable. gh search issues
   "assess:action" parsed ":" as a search qualifier and returned empty.
   Step 2 corpus table and Step 3 example now use:
     gh api "repos/{owner}/{repo}/issues/comments?per_page=100" --paginate
       -q '.[] | select(.body | contains("...")) | .body'
   which returns raw JSON regardless of search index coverage. Added a
   "Why gh api over gh search issues" rationale block.

3-dir sync verified by SHA-256 (94c7cc4cc19c0af89d1c3686cb9301f99fdf224adee2c6d7e43d7b6dcd8851c1).
Self-application: new regex catches 42 pattern additions in this PR's diff
and correctly rejects substring false positives (awkward, my_grep_call).
…equire-detection-pattern-verification-for

# Conflicts:
#	CHANGELOG.md
@admarble
admarble merged commit cb77c8e into main May 4, 2026
8 checks passed
@admarble
admarble deleted the feature/551-feat-qa-require-detection-pattern-verification-for branch May 4, 2026 02:15
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.

feat(qa): require detection-pattern verification for skill regex/grep/awk changes

1 participant