|
| 1 | +# Conformance fixtures — canonical home |
| 2 | + |
| 3 | +These are the canonical Malleable HTML File conformance fixtures (spec §11). They are |
| 4 | +the published arbiter of exact bytes: a conforming client must reproduce each fixture's |
| 5 | +`snapshot.html` and `document.html` byte-for-byte from its `input.html`. |
| 6 | + |
| 7 | +This directory is the single source of truth. The two client repos (hyperclayjs, clayjs) |
| 8 | +keep a **checked-in copy** under `conformance/fixtures/` so their own CI can run the byte |
| 9 | +gate without this workspace. Do not hand-edit those copies — edit here, then sync. |
| 10 | + |
| 11 | +## Layout |
| 12 | + |
| 13 | +``` |
| 14 | +fixtures/ |
| 15 | + manifest.json the fixture list both client suites iterate |
| 16 | + <name>/ |
| 17 | + input.html the source document |
| 18 | + snapshot.html expected bytes after algorithm steps 1-6 |
| 19 | + document.html expected bytes after steps 7-8 |
| 20 | +``` |
| 21 | + |
| 22 | +`snapshot.html` / `document.html` are exact bytes: no trimming, no whitespace collapse, |
| 23 | +no line-ending tolerance. LF only (each client's `.gitattributes` forces `eol=lf` so a |
| 24 | +CRLF checkout cannot fail the compare on a non-bug). |
| 25 | + |
| 26 | +## Syncing down to the clients |
| 27 | + |
| 28 | +From this repo: |
| 29 | + |
| 30 | +``` |
| 31 | +npm run sync-fixtures # mirror canonical -> hyperclayjs + clayjs copies |
| 32 | +npm run check-fixtures # verify each client copy matches canonical (CI/pre-release guard) |
| 33 | +``` |
| 34 | + |
| 35 | +`check-fixtures` exits non-zero on any drift. Per-repo CI does not run it (no access to |
| 36 | +this workspace); it runs `test:conformance` against the committed copy. |
| 37 | + |
| 38 | +## Regenerating goldens |
| 39 | + |
| 40 | +The goldens are browser-serialization output, so they are generated **in a client** (which |
| 41 | +has the browser and the snapshot module), then promoted back up here. Do this only when a |
| 42 | +fixture's `input.html`/setup or the snapshot algorithm changes on purpose. |
| 43 | + |
| 44 | +1. Edit `input.html` / `manifest.json` here; `npm run sync-fixtures` to push down. |
| 45 | + (Imperative setup lives in each client's `conformance/setups.js`, kept identical by hand.) |
| 46 | +2. In **each** client: `npm run conformance:update` to regenerate its goldens. |
| 47 | +3. Cross-verify the two clients are byte-identical — this is the real conformance check: |
| 48 | + `diff -rq hyperclayjs/conformance/fixtures clayjs/conformance/fixtures` must be empty. |
| 49 | +4. Promote up: `cp -R hyperclayjs/conformance/fixtures/. malleablehtmlfile/fixtures/` |
| 50 | + then `npm run check-fixtures` to confirm both clients now match canonical. |
| 51 | + |
| 52 | +The browser is pinned (Playwright Chromium, version-locked in each client's `package.json`) |
| 53 | +so regeneration is reproducible across machines and CI. |
0 commit comments