fix(modules): two lint preferred fixes that did not hold (fuzz fix-idempotent) #311

Merged
abiwab merged 1 commit from fix/lint-preferred-fixes into dev/1.6 2026-11-29 11:15:50 +01:00
Owner

The two pre-existing fix-idempotent violations found by the 50k fuzz sessions of #308. @gram-lang/modules/lint exists only on dev/1.6: no changeset.

  • REFERENCE_TO_INGREDIENT (@flour ^&flour): the fix inserted @ right after a glued element sigil, and the parser reads ^@ as fallback text, so ^@&flour was still a reference and the diagnostic came back. No fix is offered when @ # ~ ^ & is glued before the &.
  • MERGED_STEP_LINE (".\n##\n[e]"): opensBlock() only parsed the flagged line (## parses alone), but after the blank line the rest of the step follows it in the new block: ## then a bare [e], a parse error. It now parses the flagged line with the rest of its step.

Tests: unit tests in lint-document.test.ts and merged-step-line.test.ts, both minimized inputs added to fuzz/regressions/ (all four fail without the fix). modules / language-server / cli tests, typecheck, lint green; bun run fuzz --iterations 50000 --seed 1234567 (the seed that found the second one): 0 signature.

The two pre-existing `fix-idempotent` violations found by the 50k fuzz sessions of #308. `@gram-lang/modules/lint` exists only on `dev/1.6`: no changeset. - **`REFERENCE_TO_INGREDIENT`** (`@flour ^&flour`): the fix inserted `@` right after a glued element sigil, and the parser reads `^@` as fallback text, so `^@&flour` was still a reference and the diagnostic came back. No fix is offered when `@ # ~ ^ &` is glued before the `&`. - **`MERGED_STEP_LINE`** (`".\n##\n[e]"`): `opensBlock()` only parsed the flagged line (`##` parses alone), but after the blank line the rest of the step follows it in the new block: `##` then a bare `[e]`, a parse error. It now parses the flagged line with the rest of its step. Tests: unit tests in `lint-document.test.ts` and `merged-step-line.test.ts`, both minimized inputs added to `fuzz/regressions/` (all four fail without the fix). modules / language-server / cli tests, typecheck, lint green; `bun run fuzz --iterations 50000 --seed 1234567` (the seed that found the second one): 0 signature.
fix(modules): keep the REFERENCE_TO_INGREDIENT and MERGED_STEP_LINE preferred fixes from failing
All checks were successful
CI / Build & Test (pull_request) Successful in 5m35s
edaa11e805
abiwab merged commit d221c77cfe into dev/1.6 2026-11-29 11:15:50 +01:00
Sign in to join this conversation.
No description provided.