Skip to content

feat(#569): /qa relaxes md-only diffs from pending CI build matrix - #588

Merged
admarble merged 2 commits into
mainfrom
feature/569-qa-markdown-only-ci-relaxed
May 7, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/569-qa-markdown-only-ci-relaxed

Conversation

@admarble

@admarble admarble commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New qa.markdownOnlyCiRelaxed: boolean (default true) and qa.markdownOnlySafeCiPatterns: string[] (default ["build (*)", "Plugin Structure Validation"]) settings. When the diff touches only .md files (with denylist for package.json/-lock.json, yarn.lock, pnpm-lock.yaml, tsconfig*.json, *.config.{js,ts,mjs,cjs}, .github/workflows/**), pending CI checks matching the safe-pattern allowlist are reclassified as informational and no longer force NEEDS_VERIFICATION. Failed checks always gate; pending checks outside the allowlist (validate-skills, Hooks Validation, etc.) still gate.
  • New src/lib/qa/markdown-only-ci.ts with detectMarkdownOnlyDiff() and filterRelaxablePending() (anchored single-* glob matcher with regex-escaped patterns). 28 unit tests cover detection edges, glob anchoring, metachar escaping, the empty-allowlist case, and the AC-5 end-to-end fixture (md-only diff + mocked CI mixed pass/pending → gating-pending=0 ⇒ READY_FOR_MERGE path; flag-off → strict gating preserved).
  • qa/SKILL.md ### CI Status section adds a "Markdown-Only Diff Relaxation" subsection with the inline npx tsx -e invocation, configurable settings table, build-file denylist, and a literal transparency-note template ("Markdown-only diff detected — pending build-matrix checks treated as informational. Relaxed: <names>."). Mirrored byte-identically across .claude/skills/, skills/, templates/skills/.

AC coverage

  • AC-1: Detection by file extension + denylist
  • AC-2: Verdict logic — pending build-matrix relaxed; non-allowlisted pending still gate
  • AC-3: Output transparency note when relaxation triggers
  • AC-4: Configurable qa.markdownOnlyCiRelaxed flag (default true); false restores strict behavior. Strengthened with markdownOnlySafeCiPatterns array (resolves AC-2's "etc." open-endedness AND /assess's portability concern about hardcoded CI step names)
  • AC-5: Synthetic-diff + mocked-CI test fixture asserting both verdict paths
  • AC-6: 3-mirror SKILL.md sync verified byte-identical with diff -q

Test plan

  • npm run build clean (verified locally)
  • npm run lint clean (verified locally)
  • npx vitest run src/lib/qa/markdown-only-ci.test.ts src/lib/qa-settings.test.ts → 38/38 pass (verified locally)
  • CI build matrix on this PR is itself the first real-world test of the relaxation logic — once merged, future md-only PRs (e.g., the next CHANGELOG-only or skill-prose PR) should produce gating: [] and proceed to READY_FOR_MERGE without waiting on build (20.x) / build (22.x) / Plugin Structure Validation
  • Verbatim /fullsolve 562 fixture (4-file md-only diff + 5 success / 3 pending CI checks) was dogfood-tested inline during /qa — pipeline outputs gating: [] ⇒ READY_FOR_MERGE path

Notes for reviewers

  • The denylist in detectMarkdownOnlyDiff() (NON_MARKDOWN_BUILD_FILES set + tsconfig* regex + *.config.* regex) is currently redundant under the .md-only first loop — only the .github/workflows/ startsWith check is reachable for .md files. Behavior is correct; the redundancy mirrors the AC's exclusion list defensively. Optional follow-up cleanup, not a blocker.

Closes #569

When `git diff origin/main...HEAD --name-only` shows only `.md` files,
pending CI checks matching `qa.markdownOnlySafeCiPatterns` (default
`["build (*)", "Plugin Structure Validation"]`) are reclassified as
informational and no longer force `NEEDS_VERIFICATION`. Failed checks
always gate; pending checks outside the allowlist (e.g.
`validate-skills`, `Hooks Validation`) still gate.

- New `qa.markdownOnlyCiRelaxed: boolean` (default `true`) and
  `qa.markdownOnlySafeCiPatterns: string[]` settings, wired through
  the `QASettings` interface, Zod schema, defaults, and allowed-keys
  Set in `src/lib/settings.ts`. Settings reference doc updated.
- New `src/lib/qa/markdown-only-ci.ts` exporting
  `detectMarkdownOnlyDiff()` (path predicate, denylists `package.json`,
  `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `tsconfig*.json`,
  `*.config.{js,ts,mjs,cjs}`, `.github/workflows/**`) and
  `filterRelaxablePending()` (anchored single-`*` glob matcher with
  regex-escaped patterns).
- `qa-settings.test.ts` extended for the two new fields; new
  `markdown-only-ci.test.ts` covers AC-1 (detection), AC-2 (filter),
  and AC-5 (end-to-end synthetic-diff fixture, both flag-on and
  flag-off paths).
- `qa/SKILL.md` `### CI Status` section gains a "Markdown-Only Diff
  Relaxation" subsection with an inline `npx tsx` invocation of the
  helpers, the configurable settings table, the build-file denylist,
  and a literal transparency-note template. Mirrored across
  `.claude/skills/qa/`, `skills/qa/`, `templates/skills/qa/` (verified
  byte-identical with `diff -q`).

Closes #569
- detectMarkdownOnlyDiff(): drop unreachable denylist branches
  (NON_MARKDOWN_BUILD_FILES set, tsconfig regex, *.config.* regex)
  that the .md-only first loop already eliminates. Inline the
  .github/workflows/ check (the one branch that IS reachable for
  .md files) into the single remaining loop. Per CLAUDE.md "no
  defensive code for scenarios that can't happen".
- Add edge-case test: .github/workflows/<name>.md must disqualify
  even though it ends in .md (workflow READMEs affect CI).
- Add verbatim /fullsolve 562 reproduction as a permanent test
  fixture in markdown-only-ci.test.ts (4-file md-only diff + 8 CI
  checks: 5 success / 3 pending matching safe-pattern allowlist).
  Per feedback_motivating_example_regression.md.
- Update qa/SKILL.md "CI Status Mapping" table: PENDING/QUEUED/
  IN_PROGRESS rows now footnote that the relaxation block below
  may reclassify them as informational on md-only diffs. Mirrored
  byte-identically across all three qa/SKILL.md files.
- Add __tests__/integration/qa-markdown-only-ci-snippet.integration
  .test.ts: executes the documented `npx tsx -e` invocation from
  SKILL.md literally via execSync with synthetic env vars, asserts
  JSON output shape and values for positive/negative/empty cases,
  plus a drift guard that the SKILL.md prose still references the
  documented env-var names. Catches future shell-quoting / env-var
  rename / schema drift at test-time, not post-merge.
- Verified: full vitest suite (2857/2857 pass across 119 files);
  npm run build clean; npm run lint clean.

Refs #569
@admarble

admarble commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Gap-fix addendum (commit d0fd687)

Addresses 5 gaps surfaced during the orchestrator's post-QA self-critique:

# Gap Resolution
A Verbatim /fullsolve 562 fixture wasn't a permanent test New it("matches the verbatim /fullsolve 562 reproduction from the issue body") in markdown-only-ci.test.ts — exact 4-file md-only diff + 8 CI checks (5 success / 3 pending) from the issue's Origin section
B Hadn't run full vitest suite after extending QASettings Full suite verified: 2857/2857 pass across 119 files
C SKILL.md "CI Status Mapping" table still read PENDING → NEEDS_VERIFICATION flatly Added footnote on the three pending-state rows pointing to the "Markdown-Only Diff Relaxation" subsection. Mirrored across 3 qa/SKILL.md files
D npx tsx -e snippet only manually-tested, not prompt-driven end-to-end New __tests__/integration/qa-markdown-only-ci-snippet.integration.test.ts runs the SKILL.md bash invocation literally via execSync for positive/negative/empty cases + a drift guard that asserts SKILL.md prose still references the documented env-var names
E detectMarkdownOnlyDiff() denylist contained unreachable defensive branches Removed NON_MARKDOWN_BUILD_FILES set, tsconfig* regex, *.config.* regex (all unreachable under the .md-only first loop). Inlined the .github/workflows/ check (the one reachable branch). Net: -36 lines / +5 lines including a new edge-case test for .github/workflows/<name>.md (workflow READMEs must still disqualify)

Net delta: +201 / -39 across 6 files (5 modified + 1 new integration test).

npm run build clean · npm run lint clean · 30/30 helper unit tests · 4/4 SKILL.md snippet integration tests · 2857/2857 full suite.

@admarble
admarble merged commit 509152d into main May 7, 2026
8 checks passed
@admarble
admarble deleted the feature/569-qa-markdown-only-ci-relaxed branch May 7, 2026 00:11
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): markdown-only diffs shouldn't gate verdict on pending CI build matrix

1 participant