Skip to content

fix(#1305): a SEQUANT_MUTATION marker containing } now round-trips - #1465

Merged
admarble merged 4 commits into
mainfrom
feature/1305-fix-qa-a-sequant-mutation-marker-whose-text-contai
Oct 16, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1305-fix-qa-a-sequant-mutation-marker-whose-text-contai

Conversation

@admarble

@admarble admarble commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A SEQUANT_MUTATION marker whose ac, mutation or failedTest contains } used to parse to nothing, because the regex stopped at the first }. A mutation such as regex changed to /x{9}/ dropped the marker from QA §6i and from the exec carry-over, which floored the verdict.

  • Parser: MUTATION_MARKER_REGEX now matches lazily to the first } --> and never crosses into the next <!-- SEQUANT_MUTATION: opener. Braces and HTML comments inside values are safe, and a marker whose JSON spans lines still parses (the issue's Non-Goal: every existing marker must still parse). An unterminated marker can't swallow the next one.
  • Writer: renderMutationMarker escapes only --> and <!-- inside a value (as --\u003e and \u003c!--), so a rendered value can neither end the comment early nor look like the next marker. Every other character renders as before, including the > separators in failedTest.
  • Tests: round-trip cases through both entry points (parseMutationMarkers, parseMutationMarkersFromExecOutput), with braces in each field and --> in mutation. There are also cases for literal > rendering, multi-line markers and an unterminated marker. The property test generator now includes { and }, and its test-local formatter is renderMutationMarker.

Runner fix after QA (AC_NOT_MET, round 1)

The first QA round found two regressions in the exec commit, and both are fixed in e296399:

  1. Escaping every > rewrote each rendered marker's failedTest separators and broke batch-executor.test.ts (the fix(run): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table #1297 state-summary test).
  2. The single-line [^\n]*? regex dropped markers whose JSON spans lines.

The narrower escape and the tempered regex fix both.

Runner fix after QA (AC_NOT_MET, round 2)

The round-1 guard (?!<!--) dropped markers whose values hold an HTML comment, including PR #1035's real AC-4 marker (failedTest names <!-- guards:count -->). c954b26 tempers on the marker opener instead and escapes <!-- on render. New tests cover a <!-- in a value, the marker opener in a value, and #1035's marker verbatim.

Corpus check (runner): parseMutationMarkers on main and on this branch, over the 150 PR bodies gh pr list --state all --search 'SEQUANT_MUTATION in:body' returns: 142 unchanged, 8 gain markers (#989, #1085, #1205, #1207, #1225, #1240, #1291, #1357), 0 lose one.

AC mapping

AC Status Evidence
AC-1 Met npx vitest run src/lib/workflow/mutation-marker.test.ts: 26/26 pass. Mutation recorded below
AC-2 Met mutation-marker.property.test.ts: the generator's filter no longer excludes }, and the boundary case round-trips removed } brace {x} --> end

Targeted run by the runner: mutation-marker.test.ts, mutation-marker.property.test.ts and batch-executor.test.ts gave 181/181 passed. Full-suite evidence is CI's.

Mutation verification

Mutation-verified: AC-1 — restored the old [^}]+ regex; mutation-marker.test.ts > mutation-marker > renderMutationMarker round-trip (#1305) > mutation holds a regex quantifier: round-trips through both entry points failed (with 4 more cases in the same block); restored.

Also checked:

  • Replacing the tempered body with the single-line [^\n]*? fails exactly still parses a marker whose JSON spans lines.
  • Tempering on bare <!-- fails exactly parses a hand-written marker holding an HTML comment (PR #1035).
  • Dropping the <!-- render escape fails exactly mutation holds the marker opener: round-trips through both entry points.

Fixes #1305


🤖 Generated with Claude Code

…sing

QA (AC_NOT_MET): escaping every > rewrote each rendered marker's failedTest separators and broke the #1297 state-summary test; the single-line regex dropped markers whose JSON spans lines, which the issue's Non-Goal keeps parsing. Escape only the > of a --> inside a value, and match lazily to the first } --> without crossing another <!--.

Entire-Checkpoint: 3da69c1f546e
@admarble admarble changed the title fix(#1305): a SEQUANT_MUTATION marker whose text contains "}" parses to nothing — renderMutationMarker and the parser do not round-trip fix(#1305): a SEQUANT_MUTATION marker containing } now round-trips Oct 16, 2026
… <!-- on render

QA round 2: the (?!<!--) guard dropped markers whose values hold an HTML comment, including PR #1035's AC-4 marker. Temper on the marker opener instead, and escape <!-- in rendered values so they round-trip. Corpus of 150 PR bodies vs main: 8 gain markers, 0 lose.

Entire-Checkpoint: efad8e95472e
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.

fix(qa): a SEQUANT_MUTATION marker whose text contains "}" parses to nothing — renderMutationMarker and the parser do not round-trip

1 participant