Repository navigation
Description
Epic: graph-2026-10-freeze-b Tier: mechanical Execution: sequant_run
Found: 2026-10-04, runner of #1289 (PR #1303). A hand-written mutation marker whose mutation text contained a regex quantifier (/\$[0-9]{9}/) parsed to [].
Problem. MUTATION_MARKER_REGEX (src/lib/workflow/mutation-marker.ts:28) is /<!-- SEQUANT_MUTATION: (\{[^}]+\}) -->/g. It stops the JSON at the first }. So any field containing } makes the marker disappear silently, and that is common in a mutation description of a regex or code change. renderMutationMarker is documented as "the inverse of the parser", but it isn't:
renderMutationMarker({ac:"AC-2", mutation:"regex changed to /x{9}/", failedTest:"a.test.ts > d > c"})
→ <!-- SEQUANT_MUTATION: {"ac":"AC-2","mutation":"regex changed to /x{9}/",…} -->
parseMutationMarkers(that) → []
parseMutationMarkersFromExecOutput(that) → []
The failure is silent at both ends. #1297's carry-over drops the marker, so the PR body has no marker. §6i then reads the gate-test AC as unrecorded and floors the verdict, even though exec did the mutation work.
Freeze check (2026-10-16): /qa §6i calls parseMutationMarkers through npx tsx; it doesn't embed the regex. The fix needs no skill edit.
Acceptance Criteria
- AC-1: A marker whose
ac,mutationorfailedTestcontains}(or-->-free text with braces) round-trips:parseMutationMarkers(renderMutationMarker(m))returnsm, through both the PR-body and exec-output entry points. Evidence:npx vitest run src/lib/workflow/mutation-marker.test.tswith a brace-bearing case, mutation-verified by restoring the[^}]+regex - AC-2: The property-based round-trip test (if present) generates field text that includes
{and}. Evidence: the same test file
Prior fixes / producers
- Producers of the marker: exec's final output,
renderMutationMarker(fix(run): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table #1297), and hand-written markers from runners. Consumers:parseMutationMarkers(QA §6i, PR-body precheck) andparseMutationMarkersFromExecOutput(fix(run): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table #1297 carry-over). All of them go through the one regex, so this is one change at the owner. git log -S MUTATION_MARKER_REGEX: introduced by feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 (PR feat(#939): mutation-verification becomes a parseable /qa §6i gate #949), never changed.
May touch
src/lib/workflow/mutation-marker.ts, src/lib/workflow/mutation-marker.test.ts, CHANGELOG.md.
Non-Goals
- The marker's JSON fields or the
<!-- SEQUANT_MUTATION: … -->wrapper (every existing marker must still parse). - The
~~~-seed property-test flake (pre-existing, separate). - Any edit under
plugin/,.claude/skills/ortemplates/skills/(plugin freeze).
Activity
admarble commentedon Oct 8, 2026
Start here (good first issue)
In plain terms: Sequant writes a small JSON record into PR descriptions (an HTML comment starting
<!-- SEQUANT_MUTATION:). The code that reads it back stops at the first}character. So if the text inside contains a}, for example a regex like/x{9}/, the whole record silently disappears. The task is to make writing and reading agree.Where to look:
src/lib/workflow/mutation-marker.ts, about 180 lines. The regex at line 28 is the bug, andrenderMutationMarkeris the writer.src/lib/workflow/mutation-marker.test.tsandmutation-marker.property.test.tsare the tests to extend.Setup and check:
npm install # Node 22.13 or newer npx vitest run src/lib/workflow/mutation-markerA good first step: add a failing test with the example in the issue body (
renderMutationMarker→parseMutationMarkersreturns[]), then fix the parser until it passes. The markers never contain-->inside a value, which is a useful boundary to match on.Size: one source file and its tests. Comment here if you pick it up, and ask anything.
docs(contributing): Node 22.13 floor to match package.json engines; p…
admarble commentedon Oct 16, 2026
Runner context (graph-2026-10-freeze-b, tracker #1452), for the exec and qa phases:
npm test/npx vitest runwith no file filter). Six phase agents run at once and the MCP phase wall is 30 minutes (graph doc I-5). Full-suite evidence comes from CI. Run only the targeted test files, in the foreground, undertimeout 600, after a WIP commit. Do not userun_in_backgroundor Monitor.plugin/,.claude/skills/ortemplates/skills/(plugin freeze, I-1).admarble commentedon Oct 16, 2026
Complexity: Simple (2 ACs, 1 directory)
AC Quality Check
Both ACs have an
Evidence:clause on one line. Two notes:npx vitest run src/lib/workflow/mutation-marker.test.tswith a brace case) is not vacuous: it fails on today's[^}]+regex. The first AC-1 mutation check must fail the new case before the fix.mutation-marker.property.test.ts. It is a different file from the one AC-2's evidence names ("the same test file"). Read AC-2 as that file.Scope Assessment
Non-Goals: present (wrapper and JSON fields unchanged,
~~~flake, noplugin/or skill edits).Verdict: ✅ SCOPE_OK (1 source file, 2 test files, CHANGELOG)
Acceptance Criteria
AC-1: brace-bearing fields round-trip through both entry points
Verification: Unit Test
Scenario: Given a marker whose
mutationisregex changed to /x{9}/→ WhenrenderMutationMarkeroutput goes throughparseMutationMarkersandparseMutationMarkersFromExecOutput→ Then each returns the original marker. Add cases for}inacand infailedTest.Assumptions: Existing markers (flat JSON, one line,
-->terminator) still parse.AC-2: property test generates
{and}Verification: Unit Test
Scenario: Given the property generator no longer filters out
}→ When it runs → Then parse(render(x)) equals x for all x.Assumptions: The backtick and newline filters stay. Inline-code stripping and the one-line grammar still need them.
Implementation Plan
Phase 1: parser and writer (
src/lib/workflow/mutation-marker.ts)/<!-- SEQUANT_MUTATION: (\{[^\n]*?\}) -->/g.JSON.parseplus the zod schema still decide validity.renderMutationMarkerescapes>as>(JSON.stringify(...).replace(/>/g, "\\u003e")). A value containing-->or} -->then cannot end the comment early or truncate the match. This is also the correct HTML-comment behaviour. The JSON decodes to the same string, so the round trip is exact.{[^}]+}family… payload must stay flat"). Keep the flat-payload point and drop the claim that}is unsafe.Phase 2: tests
mutation-marker.test.ts: add the issue's example, plus}in each field and a-->inmutation, through both entry points.mutation-marker.property.test.ts: importrenderMutationMarkerin place of the localformatcopy, and drop}from the generator filter. Replace the "known lossy input" boundary test with a positive case.CHANGELOG.md: one Fixed line.[^}]+, confirm the new case inmutation-marker.test.tsfails, restore. UsefailedTestinsrc/lib/workflow/mutation-marker.test.ts > <describe> > <case>form.Design Review
mutation-marker.ts. It already owns the grammar. QA §6i reaches it throughnpx tsx, so no skill edit is needed (freeze-safe, as the issue says).-->plus escaping>on render. Rejected: a brace-balancing scanner (more code, no benefit once-->cannot occur in rendered values). Rejected: base64 payload (breaks every existing marker, a Non-Goal).{[^}]+}family is shared withSEQUANT_SPECandSEQUANT_PHASE.git log -S MUTATION_MARKER_REGEXshows feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 only, with no earlier fix, so this is not a repeat patch. The same flaw exists in the sibling markers' regexes, but their values are enums and not free text. That is a possible follow-up, not in scope here.-->?" Those are ambiguous by construction and out of scope. Only markers produced byrenderMutationMarkerare guaranteed.renderMutationMarker, hand-written markers, and the test-localformatin the property test. Consumers areparseMutationMarkersandparseMutationMarkersFromExecOutput, both through the one regex. Step 5 collapses the test-local producer intorenderMutationMarker.Feature Quality Planning
All standard checks pass. Notable:
grep -rn SEQUANT_MUTATION src scriptsduring exec. Skill prose may carry its own regex (the freeze check says §6i does not).Open Questions
>escape be in scope? Recommendation: yes. It makes the lazy match safe for renderer output. If wrong, the cost is one extra line.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Small bug fix with a unit test. Testgen is skipped (bug label, test is specified above). Runner context: no full suite; run only the two marker test files.
Label Review
Current: bug, good first issue, graph-2026-10-freeze-b. Recommended: add
planned. No change otherwise.admarble commentedon Oct 16, 2026
QA Verdict: AC_NOT_MET
AC coverage: 2/2 met
Gaps:
fix(#1305): escape only --> on render and keep multi-line markers par…
admarble commentedon Oct 16, 2026
QA Verdict: AC_NOT_MET
AC coverage: 1/2 met
Gaps:
(?!<!--)guard drops valid markers whose values contain<!--(AC-1 failure and Non-Goal regression above).fix(#1305): stop only at the next SEQUANT_MUTATION marker, and escape…
admarble commentedon Oct 16, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 2/2 met
fix(#1305): a SEQUANT_MUTATION marker containing } now round-trips (#…