# A composed site, small enough to diff by hand This is the output of `compose-site.ts` over the repo's smallest real corpus fixture, captured at the tip of **one-core phase 2 slice S1** (`one-core/phase-2-s1`, branched from `c7f7b90`). It exists so the parallel slices — S2a, S2b, S2c, S3 and S0-pause — can prove "the contract did not move" against a committed artifact instead of each rebuilding a baseline and hoping the two recipes matched. `plans/FACTS.md` § "How to compose a fixture site offline" is the recipe; this directory is one run of it plus the two things the recipe leaves to the reader: the hand-written `site.json`, and a diff that knows what is allowed to change. ## What is here | Path | What | |---|---| | `site.json` | The hand-written `sites/testsite/site.json`. The recipe's only authored input. | | `public/` | 16 files — what a deploy serves. | | `index/` | 7 files — the intermediate index the compose step copies from. | | `compose-diff.sh` | `./compose-diff.sh ` — a normalising diff. | ## How it was produced The corpus is `editor/e2e/fixtures/test-transcripts/one-youtube-channel-with-data` (one channel, one video, one VTT). Nothing here reads or writes the real `transcripts/`. ```sh F=$(mktemp -d) # the corpus root O=$(mktemp -d); mkdir -p $O/public $O/index cp -r editor/e2e/fixtures/test-transcripts/one-youtube-channel-with-data/channels $F/ mkdir -p $F/sites/testsite cp plans/tools/compose-fixture-one-youtube-channel/site.json $F/sites/testsite/site.json echo '{}' > $F/settings.json cd common env TRANSCRIPTS_DIR=$F SITES_DIR=$F/sites \ EXPORT_PUBLIC_DIR=$O/public EXPORT_INDEX_DIR=$O/index \ SETTINGS_FILE=$F/settings.json SITE_ID=testsite \ pnpm exec tsx bin/build-index.ts env TRANSCRIPTS_DIR=$F SITES_DIR=$F/sites \ EXPORT_PUBLIC_DIR=$O/public EXPORT_INDEX_DIR=$O/index \ SETTINGS_FILE=$F/settings.json SITE_ID=testsite \ pnpm exec tsx bin/compose-site.ts cd .. plans/tools/compose-fixture-one-youtube-channel/compose-diff.sh \ plans/tools/compose-fixture-one-youtube-channel/public $O/public plans/tools/compose-fixture-one-youtube-channel/compose-diff.sh \ plans/tools/compose-fixture-one-youtube-channel/index $O/index ``` Both should print `IDENTICAL modulo the build clock`. Anything else is a real change to the wire, and belongs in a commit that says so. **`build-index.ts` writes `$F/index.mdb` and caches a schema version in it.** Compose the fixture into a fresh `$F` each time, or the second run reports `0 built, 1 up to date` and copies nothing. ## What the diff normalises, and why only this - **`"generatedAt": ""`**, in both the compact and the pretty-printed spellings. It appears in `corpus.json`, `site.json`, the five manifests, and the archive zip's `channel.json`. - **The archive zip's own bytes.** A zip's entry mtimes are the build clock, so two runs of the same input differ by a byte or two in the compressed stream — and `archives/manifest.json` records that size. Zips are therefore compared by their unpacked, `generatedAt`-normalised **entries**, which do diff clean, and the `bytes` field is normalised with them. Nothing else is excused. In particular the URL shapes in `corpus.json` — the absolute-with-`siteUrl` form this fixture exercises — are the thing phase 2's `lib/archive/contract.ts` must reproduce, so a diff there is the failure this directory exists to catch. ## The site.json is deliberately minimal but NOT trivial It sets `siteUrl`, which is what makes every manifest pointer in `corpus.json` absolute. A fixture without one would pass a reader that had quietly dropped the origin.