MOTIR-3552 appended an occurrence field to the generator's marker — -- lesson:<ref> content:<hash> embed:<hash> occ:<ref|-> — and moved the generator's own parser (emittedState) with it, keeping occ: optional so the 205 pre-existing markers still read. tests/lessonsMigrationDelivery.test.ts was not moved, and it spells the grammar twice, both times anchoring $ immediately after embed:[0-9a-f]+.
Nothing went red at the time, because the last migration then in the chain had been generated before MOTIR-3552 and carries no occ:. The failure waits for the NEXT generated migration, whichever it is:
AssertionError: curated rows no generated migration inserts: MOTIR-3618 —
run `pnpm lessons:generate-migration` and commit the emitted file.
AssertionError: marker carries no hashes, so drift can never be detected:
-- lesson:MOTIR-3618 content:250191fd3600 embed:1da5264c2639 occ:-
Both are false. The row IS carried and the marker DOES carry both hashes — the reader is stale, and its message sends whoever hits it to re-run a generator that will emit exactly the same bytes again.
Spell the marker grammar ONCE in that file, with occ: optional, mirroring emittedState(), and add a case over synthetic marker lines — with occ:<ref>, with occ:-, and with no occ: at all — so the grammar is asserted independently of whether the committed chain happens to contain one of each yet. That last part is what stops the same class recurring: the two existing assertions only exercise whatever markers are on disk, so a grammar widening can pass them for weeks and fail on the next author's PR.
pnpm vitest run tests/lessonsMigrationDelivery.test.ts is green against a chain containing a marker with occ:.occ: field still parses, and its sourceRef still reads as carried.embed:.tests/lessonsMigrationDelivery.test.ts — the two spellings (the matchAll in the MOTIR-3307 describe, and the hash assertion in the MOTIR-3320 describe).scripts/generate-lessons-migration.ts — emittedState() (the parser that IS current) and marker() (the emitter). It runs main() on import, so a test cannot import it and the grammar is necessarily restated.