5.8 KiB
Task 19 — Re-point the verification contract
Agent: verification-engineer · Model: Codex Depends on: 15, 16 ·
Parallel with: 18 Worktree:
.agents/scripts/worktree.sh start 19 verify-repoint
Goal
All 42 assertions pin the same user-visible facts against the new architecture. Coverage does not fall.
You are the only role permitted to remove an assertion, and every removal needs a written reason.
The three kinds
| Kind | Example | What to do |
|---|---|---|
| Content presence | data-phase="plan" |
re-point at dist/full-guide/index.html; the token should survive rendering. If it does not, a component dropped content — stop and report |
| Implementation detail | const phases, renderTree, from './catalog.js' |
obsolete as written, but each pins a feature. Replace with an output-level assertion of that feature. Never drop |
| Asset version | app.js?v=20260904-vote-widget |
Astro hashes assets — assert the built HTML references a hashed asset |
Steps
pnpm run build, then re-pointread()calls atdist/.- Work through all 42 in order. For each: does the fact it pins still exist? Yes → re-point. No → content was lost; escalate.
- Add rendered-text snapshot assertions for all ten routes so this class of regression is caught structurally, not by string luck.
- Confirm
check-tokens.mjsand the extendedaudit-ui.mjsare inpnpm run verify.
Done when
grep -c 'throw new Error' scripts/verify.mjs≥ theorigin/mainbaseline- Every removal has a one-line reason in this file
- Snapshot assertions cover all ten routes
pnpm run gategreen, and it fails when you deliberately delete a paragraph from a component (prove the net works, then revert)
Do not
Do not weaken an assertion to make it pass. If it cannot pass, something is broken — that is the assertion doing its job.
Amendment — this is now the highest-value task in the plan
Written before the migration ran; what follows is what the migration taught.
Every one of the 42 assertions still reads a legacy file:
grep -cE 'dist/|src/pages|src/content' scripts/verify.mjs returns 0. Nothing
in the gate looks at what the Astro pages render. Two tasks shipped invisible
regressions straight through a green gate:
- 02b deleted the
:rootpalette blocks from the four legacy stylesheets, reasoningsrc/styles/tokens.cssis the single source of truth. It is — for Astro pages. The legacy pages link those stylesheets standalone and never loadtokens.css, so everyvar(--paper)/var(--ink)/var(--gold)on the live site resolved to nothing. Eight pages, colourless. Gate green. - 15d attempt 1 built
/full-guide/by importingfull-guide/index.html?rawandset:html-ing the<main>out of it. Zerodata-language-contentattributes, zero.ptreads: Portuguese gone from the largest page on a bilingual site. Gate green. Taggedrejected/15d-attempt-1.
The gate is doing its job — it is a legacy-content contract. Your job is to make it an output contract too. Until you land, "gate green" means nothing about the new site.
Three checks to build in, each of which caught a real regression
-
Bilingual coverage of the built HTML. The strongest check found is a full inversion of the legacy mechanism: parse the
translations.ptobject out ofapp.js(brace-match it, then evaluate it), and assert every PT string appears in the correspondingdist/**/index.html. Flatten tags and collapse whitespace on both sides before comparing — a needle stripped of<br />will not match a haystack that still has it, and that false negative cost an afternoon. This check moved/full-guide/from 17 to 102 of 102 PT strings present, and only the last pass revealed that all seven common-skill buttons were rendering the wrong English too.translations.ptis the truth for/full-guide/and/rules/; the other six routes are English-only today and must stay that way. -
Every
var()resolves. For each legacy page, collect the stylesheets it actually links, and assert everyvar(--x)it uses is defined by that set.--scoreis the only legitimate miss —app.js:289sets it inline. This is the check that would have caught 02b in seconds. -
Built-CSS diff against
main. Build, then enumerate every colour and size declaration indist/_astro/*.cssthat exists onmainand not on the branch. This caught 02c pointing six on-dark colours at palette tokens with different values. Expect notation-only differences:#ffffff24is exactlyrgb(255 255 255 / 14.1176%), and32px/48pxnow resolve through--step-32/--step-48.
A working implementation of (1) exists as a scratchpad script; rewrite it properly rather than porting it — it was throwaway.
On the assertion count
Baseline is 42 and the gate enforces it. Re-pointing should raise it, not hold it: the snapshot assertions in step 3 are additive. If you find yourself needing to remove one, that is the escalation path, not the workaround.
Screenshots
playwright is now a devDependency (c2a046d) and
.agents/scripts/visual-regression.mjs runs. It used to throw for everyone,
which is why no task in this plan ever produced the captures its brief asked
for.