Skip to content

feat(#937): structured gap findings — finite taxonomy replacing the lossy prose-scrape gap channel - #954

Merged
admarble merged 3 commits into
mainfrom
feature/937-feat-qa-loop-ready-structured-gap-findings-fin
Aug 21, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/937-feat-qa-loop-ready-structured-gap-findings-fin

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

Replaces the single-regex gap channel between /qa, /loop, and sequant ready with a finite six-category taxonomy carrying required evidence, emitted as a <!-- SEQUANT_QA_GAPS: {...} --> marker and unioned (never replacing) with the legacy prose scrape.

  • GapFinding schema (run-log-schema.ts): requirement_gap/dependency_gap/test_gap/repository_gap/risk_gap/execution_gap, required evidence, recommendedAction of fix_now/document/pause_for_human.
  • /qa's Simple Fix and Standard templates (all three skill dirs, byte-synced) emit the marker via new §6j; parseQaSummary parses it and unions with the prose scrape so an unclassifiable finding is never dropped (AC-5).
  • /loop, ready-gate.ts, and batch-executor.ts exclude document/pause_for_human findings from the fix loop (selectFixableGaps) — the structural fix for the fix(lint): exclude gitignored scripts/dev from the widened lint/typecheck scope #930 regression class, where a loop chased a finding QA itself had framed as non-blocking. /loop's dead ### Required Fixes extraction (a heading no QA template ever emitted) is replaced with marker parsing.
  • ReadyGapItem gains the taxonomy fields; sequant ready now persists its final gap report (with marker) as an issue comment on any terminal state carrying a QA verdict — closing the terminal-scrollback hole under ac policy.

Pre-PR AC Verification

AC Description Status Evidence
AC-1 GapFinding schema, six categories, required evidence, exported ✅ Implemented src/lib/workflow/run-log-schema.ts; run-log-schema.test.ts GapFindingSchema (#937) — all 6 categories + missing-evidence rejection
AC-2 QA templates emit marker; parseQaSummary prefers it, unions with prose ✅ Implemented skills/qa/SKILL.md §6j + both templates (3 dirs synced); phase-executor.test.ts — §6d-class finding absent from **Issues:** survives via the marker; malformed-marker and dedup cases covered
AC-3 /loop consumes fix_now, excludes document; dead grep removed ✅ Implemented selectFixableGaps (phase-executor.ts) wired into ready-gate.ts fixableGaps and batch-executor.ts:1610 failedAcs; loop/SKILL.md marker-based extraction replaces the ### Required Fixes sed. ready-gate.test.ts "#937 AC-3 structured gap filtering", batch-executor.test.ts buildLoopContext #937 tests
AC-4 sequant ready posts final report w/ marker on terminal states w/ verdict; ReadyGapItem carries schema fields ✅ Implemented RunReadyGateOptions.postReport, wired in ready.ts and batch-executor.ts's run --ready-gate path; ready-gate.test.ts "#937 AC-4 postReport" (4 tests) + ready.test.ts wiring test
AC-5 Unclassifiable/marker-less gap → unchanged prose behavior, no drop ✅ Implemented Union-not-replace dedup in parseQaSummary; phase-executor.test.ts "#937 AC-5" + existing marker-less fixtures unchanged
AC-6 Existing consumers regression-covered ✅ Implemented Full suite green: 269 files / 5549 passed / 1 expected-fail / 2 skipped

Design decisions (flagged in /spec, applied as recommended)

  • Union, not replace in parseQaSummary — resolves the AC-2/AC-5 tension the issue itself flagged.
  • Post the ready comment on every terminal state carrying a QA verdict, both policies (not ac-only) — MAX_ITERATIONS/TOKEN_BUDGET are exactly the states whose gap list must survive the terminal. This was an open human-decision question in the issue; applied the /spec recommendation.
  • Marker payload is {"findings":[...]} (not a bare array) and uses a lazy [\s\S]*?--> regex, since the array-of-objects payload can't reuse the flat {[^}]+} family (SEQUANT_SPEC/SEQUANT_PHASE/SEQUANT_MUTATION).

Test plan

  • npm run build — clean
  • npm run lint — clean
  • npm run lint:skill-sync / lint:skill-gates / lint:skill-calls — clean
  • Full suite: npm test — 269 files, 5549 passed, 1 expected fail, 2 skipped
  • Manual: one live dogfood issue (AC-4's manual-verification clause) — left for post-merge dogfooding per /spec

Closes #937

Replace the lossy prose-scrape gap channel between /qa, /loop, and
`sequant ready` with a finite six-category taxonomy carrying required
evidence, emitted as a SEQUANT_QA_GAPS marker and consumed by every
existing gap consumer.

- GapFinding schema (run-log-schema.ts): six categories, required
  evidence, recommendedAction of fix_now/document/pause_for_human.
- qa-gaps-marker.ts parses the marker; parseQaSummary unions marker
  findings with the legacy prose scrape (never replaces), so an
  unclassifiable finding is never dropped.
- /qa's Simple Fix and Standard templates (all three skill dirs) emit
  the marker via new §6j.
- /loop and ready-gate.ts/batch-executor.ts exclude document/
  pause_for_human findings from the fix loop (selectFixableGaps) — the
  structural fix for the #930 regression class. /loop's dead
  `### Required Fixes` extraction (a heading no QA template ever
  emitted) is replaced with marker parsing.
- ReadyGapItem gains the taxonomy fields; sequant ready persists its
  final gap report (with marker) as an issue comment on any terminal
  state carrying a QA verdict, closing the terminal-scrollback hole.

Closes #937
…arker

/loop's shell-side marker extraction (grep -oE + sed) had no fenced-code-
block awareness, unlike every TS-side parser for the durable-marker family
(parseQaGapsMarker, parseMutationMarkers, parsePhaseMarkers), which all call
stripMarkdownCode first. A marker quoted inside a code fence — e.g. this
skill's own "QA Log Example" — would be mistaken for a real one.

Replace the grep/sed + node-JSON.parse two-step with a single node -e that
strips fenced/inline code (mirroring stripMarkdownCode's regexes) before
matching, and picks the LAST marker if more than one survives (latest-wins,
matching parseQaGapsMarker's semantics). Verified against 6 samples,
including the fence-quoted marker and a stress case with both a fenced fake
marker and a real trailing one.

Follow-up from #937 QA (PR #954).
@admarble

Copy link
Copy Markdown
Contributor Author

Fixed the fenced-code-block gap found in QA:

  • /loop's shell-side SEQUANT_QA_GAPS extraction now mirrors stripMarkdownCode (strip fenced + inline code before matching, latest-marker-wins) instead of a bare grep/sed that couldn't tell a real marker from one quoted inside a code fence. Verified against 6 samples including the fence-quoted case and a fence+real-trailing-marker stress test.
  • Also merged origin/main to pick up feat(ci): run the tautology detector in CI — advisory, measured (#940) #955 (CI tautology-detector job) and resolved a trivial CHANGELOG.md adjacency conflict (both PRs added an entry under ### Added).
  • Full suite re-verified post-merge: 270 files, 5554 passed, 0 failures.

The other QA finding (AC-4's "manual verification on one live dogfood issue") is unchanged — it's not something a code fix can close; it needs this PR merged and exercised on a real issue.

@admarble
admarble merged commit e70de1c into main Aug 21, 2026
9 checks passed
@admarble
admarble deleted the feature/937-feat-qa-loop-ready-structured-gap-findings-fin branch August 21, 2026 12:57
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/loop/ready): structured gap findings — finite taxonomy with required evidence, replacing the lossy prose-scrape gap channel

1 participant