Skip to content

feat(qa): markdown-only diffs shouldn't gate verdict on pending CI build matrix #569

Closed

Description

@admarble

Summary

For diffs that touch only non-source files (markdown, CHANGELOG, JSON config), /qa currently forces NEEDS_VERIFICATION whenever any CI check is pending — even if the pending checks are the build matrix (build (20.x), build (22.x)), which can't possibly fail on a markdown-only change. This wastes wakeup cycles waiting for redundant CI to confirm what typecheck (already green at QA time) has already proven.

Origin: /fullsolve 562 on 2026-05-03. The fix was a 16-line markdown-only diff (3 SKILL.md mirrors + CHANGELOG entry). At QA time, 5/8 CI checks had already passed (typecheck, validate-skills, Hooks Validation, validate-plugin, Setup Directory Creation). The 3 pending checks (build matrix + Plugin Structure Validation) were structurally incapable of failing — the diff had no TypeScript surface. Strict CI rule forced NEEDS_VERIFICATION, requiring a 2-min wakeup cycle to re-verify.

Current Behavior

.claude/skills/qa/SKILL.md Phase 1 / verdict algorithm:

Important: Do NOT give READY_FOR_MERGE if any CI check is still pending. The correct verdict is NEEDS_VERIFICATION...

Applied uniformly regardless of diff type.

Proposed Behavior

When git diff main...HEAD --name-only shows ONLY non-source extensions (.md, .json for CHANGELOG/config — explicitly excluding package.json and tsconfig*.json which DO affect builds), pending build/test CI checks are informational, not verdict-gating. Verdict gates only on:

  • validate-skills (skill structure correctness)
  • Hooks Validation
  • validate-plugin
  • Any explicitly markdown-relevant CI step (lint-markdown if added)

Acceptance Criteria

  • AC-1: Detection. /qa detects markdown-only diffs by file extension. Excluded from "non-source" treatment: package.json, package-lock.json, tsconfig*.json, .github/workflows/**, any *.config.{js,ts}.
  • AC-2: Verdict logic. When all changed files match the markdown-only criteria AND no package.json/tsconfig changes, pending build-matrix checks (build (*), Plugin Structure Validation) do not block READY_FOR_MERGE. Other pending checks (validate-skills, etc.) still gate.
  • AC-3: Output transparency. QA output includes a section noting the downgrade: e.g., "Markdown-only diff detected — pending build-matrix checks treated as informational."
  • AC-4: Configurable. .sequant/settings.json flag qa.markdownOnlyCiRelaxed (default: true). Setting to false restores current strict behavior for paranoid projects.
  • AC-5: Test fixture. Unit test using a synthetic diff with only .md files, mocked CI response with mixed pass/pending, asserts verdict is READY_FOR_MERGE (not NEEDS_VERIFICATION).
  • AC-6: 3-dir sync. .claude/skills/qa/SKILL.md, skills/qa/SKILL.md, templates/skills/qa/SKILL.md updated identically.

Non-Goals

  • Not changing how /qa evaluates failed CI — failures still block. This is only about pending checks.
  • Not auto-detecting all "safe" diff types (e.g., test-only). Markdown is a clear case; test-only has more edge cases (e.g., test infrastructure changes affecting CI).
  • Not changing the SMALL_DIFF size gate. This is a separate axis (file-type, not size).

Risks / Open Questions

  • package.json whitelist edge case. A markdown-only PR that also bumps a dependency in package.json should NOT be downgraded — explicit exclusion above. Verify the detection covers this.
  • Future build steps. If a future CI step runs only on markdown (e.g., lint-markdown, link-check), it must still gate. The whitelist of "safe to ignore" pending checks should be specific (build (*), Plugin Structure Validation) rather than a blanket "ignore all pending."
  • Project portability. The hardcoded check names (build (20.x), etc.) are sequant-specific. Consumer projects have different CI step names. Could read from .sequant/settings.json or detect dynamically by check-step language match.

Complexity

small — ~50-100 LOC + tests. Verdict-algorithm tweak in QA SKILL.md (instruction text) plus a config flag.

Self-Assessed Workflow

spec → exec → qa — config-flag design needs spec discussion (default value, config key naming).

Related

Activity

  1. added
    enhancement
    on May 3, 2026
  2. admarble commented on May 4, 2026

    @admarble
    ContributorAuthor

    Assessment

    → PROCEED — Markdown-only diff CI gate relaxation; config flag design needs spec

    Workflow: spec → exec → qa with -q

    npx sequant run 569 -q
    

    ⚠ Project-portability question on hardcoded CI step names (build (20.x)) — spec should resolve (config? dynamic detection?)
    ⚠ Edits qa/SKILL.md — sequence after #573 if both run (shared file)

  3. admarble commented on May 6, 2026

    @admarble
    ContributorAuthor

    Plan Complete

    AC Checklist

    • AC-1: Detection — detectMarkdownOnlyDiff(files) returns true for .md-only changes; false when package.json, package-lock.json, tsconfig*.json, *.config.{js,ts,mjs,cjs}, or .github/workflows/** is present. (Verify: Unit Test)
    • AC-2: Verdict logic — filterRelaxablePending(pendingChecks, settings.qa.markdownOnlySafeCiPatterns) partitions pending CI into relaxed (matches allowlist globs) and gating (everything else). Markdown-only diff + flag on ⇒ pending_count uses gating.length only. (Verify: Unit Test)
    • AC-3: Output transparency — QA CI Status section emits a labeled note when relaxation triggers: "Markdown-only diff detected — pending build-matrix checks treated as informational. Relaxed: [names]." (Verify: Unit Test / inspection)
    • AC-4: Settings — qa.markdownOnlyCiRelaxed: boolean (default true) AND qa.markdownOnlySafeCiPatterns: string[] (default ["build (*)", "Plugin Structure Validation"]) added to QASettings, Zod schema, defaults, allowed-keys map. (Verify: Unit Test)
    • AC-5: Test fixture — synthetic markdown-only diff + mocked CI response with mixed pass/pending; assert pipeline outputs zero gating-pending checks ⇒ READY_FOR_MERGE path. Flag=false fixture asserts current strict behavior preserved. (Verify: Unit Test)
    • AC-6: 3-dir sync — .claude/skills/qa/SKILL.md, skills/qa/SKILL.md, templates/skills/qa/SKILL.md updated identically. diff -q between any pair returns no output. (Verify: Inspection)

    Implementation Plan

    Phase 1 — Settings + helpers

    1. Extend QASettings (interface, Zod, defaults, allowed-keys) in src/lib/settings.ts with markdownOnlyCiRelaxed and markdownOnlySafeCiPatterns.
    2. New src/lib/qa/markdown-only-ci.ts: detectMarkdownOnlyDiff() + filterRelaxablePending() (pure, ~40 LOC).

    Phase 2 — Tests
    3. Extend src/lib/qa-settings.test.ts for the two new fields.
    4. New src/lib/qa/markdown-only-ci.test.ts covering AC-1/AC-2/AC-5 (positive, denylist, glob behavior, flag-disabled).

    Phase 3 — SKILL.md sync (3 mirrors)
    5. Update QA SKILL.md CI Status section + verdict algorithm; per-level Edits with diff -q verification before commit.

    Phase 4 — Verify
    6. npm run typecheck + targeted vitest runs + 3-mirror diff.

    Key Decisions Resolved from /assess

    • Project portability of CI step names → solved via configurable settings array qa.markdownOnlySafeCiPatterns. Consumer projects override; sequant ships with ["build (*)", "Plugin Structure Validation"] as defaults.
    • AC-2 open-ended language ("Other pending checks ... still gate") → tightened: only patterns explicitly listed in markdownOnlySafeCiPatterns are relaxed; everything else gates by default.

    Open Questions

    1. Glob matcher: inline ≤10 LOC *→.* converter (recommended) vs. picomatch dep. Recommendation: inline.
    2. Should non-pending CI states also be re-bucketed? Recommendation: no; failed checks always gate (matches Non-Goals).

    Workflow

    spec → exec → qa (no /test — no UI surface; no testgen — fixtures are tightly specified inline in AC-5)

    Ready to implement.

  4. added
    planned
    on May 6, 2026
  5. admarble commented on May 6, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Status: READY_FOR_MERGE
    PR: #588 — #588
    Branch: feature/569-qa-markdown-only-ci-relaxed
    Commit: d367767

    Progress Summary

    Phase Iterations Status
    Spec 1/1 Complete
    Exec 1/1 Complete
    Test — Skipped (no UI labels)
    QA 1/2 Complete — verdict READY_FOR_MERGE
    PR 1/1 Created (#588, mergeable)

    AC Coverage

    AC Status Evidence
    AC-1 Detection ✅ MET src/lib/qa/markdown-only-ci.ts detectMarkdownOnlyDiff(); 10 it.each tests cover all denylist categories + case-insensitive matching
    AC-2 Verdict logic ✅ MET filterRelaxablePending() partitions pending into relaxed + gating; SKILL.md Verdict Integration table updated
    AC-3 Transparency ✅ MET SKILL.md emits literal "Markdown-only diff detected — pending build-matrix checks treated as informational. Relaxed: <names>." note
    AC-4 Settings flag ✅ MET qa.markdownOnlyCiRelaxed (default true) + qa.markdownOnlySafeCiPatterns array; tests cover defaults, no-section, flag-false, custom-patterns
    AC-5 Test fixture ✅ MET markdown-only-ci.test.ts AC-5 block asserts both flag-on (gating: [] ⇒ READY_FOR_MERGE) and flag-off (gating > 0 ⇒ NEEDS_VERIFICATION) paths
    AC-6 3-dir sync ✅ MET diff -q between all three qa/SKILL.md mirrors → byte-identical

    Quality Metrics

    • npm run build: ✅ clean
    • npm run lint: ✅ clean (max-warnings 0)
    • Tests: 38/38 helper+settings, 111/111 across scope+QA+integration
    • Type issues (any): 0
    • Deleted tests: 0
    • Verbatim /fullsolve 562 fixture (the issue's motivating example) dogfood-tested inline during /qa: pipeline outputs gating: [] ⇒ READY_FOR_MERGE path ✅

    Key Decisions

    • AC-2 "etc." open-endedness (flagged by spec lint) and /assess's portability concern about hardcoded CI step names both resolved by adding qa.markdownOnlySafeCiPatterns as a configurable settings array. Default ships sequant-specific (["build (*)", "Plugin Structure Validation"]); consumer projects override via .sequant/settings.json.
    • Inline /qa review instead of sub-agent spawning — diff is 628 raw but ~270 unique (mirror duplication inflated total). Per feedback_qa_agent_worktree_verification.md, inline review is more accurate than agents on worktree code under ~600 unique lines.

    Documentation

    • ✅ CHANGELOG entry under [Unreleased] / ### Added
    • ✅ Settings reference table (src/lib/settings.ts:976) updated with both new fields
    • ✅ SKILL.md (3 mirrors) documents new subsection, settings table, transparency-note template

    Risk Assessment

    • Likely failure mode: SKILL.md npx tsx -e invocation depends on the calling model constructing SEQUANT_QA_RELAX_FILES / SEQUANT_QA_RELAX_PENDING env vars correctly (newline-joined). On parse failure, helper safely falls through to enabled: false (strict gating preserved) — conservative failure mode, no false-positive READY_FOR_MERGE.
    • Not tested: Full prompt-driven verdict algorithm in SKILL.md (it's prose, not code); only the deterministic TypeScript surface is unit-tested. Acceptable per existing skill-design contract.

    Optional Follow-Up

    • The detectMarkdownOnlyDiff() denylist's NON_MARKDOWN_BUILD_FILES set + tsconfig* regex + *.config.* regex are currently dead code under the .md-only first loop (only .github/workflows/ is reachable for .md files). Behavior is correct; the redundancy hedges against future predicate broadening but is anti-pattern per CLAUDE.md's "no defensive code for scenarios that can't happen". ~10 LOC + test description tweaks if pursued. Not blocking — note as observation.

    Ready for human review and merge.

  6. added 2 commits that reference this issue on May 6, 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

    enhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions