English
One Real Run Walkthrough
Aligned with repo-docs/walkthroughs/one-real-run.md, this walkthrough traces one complete build and immutable release from YAML inputs to verified edge hosts.
Representative Cases & Rejection Boundaries
| Input / Condition | Action & Result |
|---|---|
| Default empty catalog | Succeeds cleanly; emits home, /search/, /library/, and 404.html without chapter routes |
Consistent catalog, manifest.json, and gallery.sqlite | build:site verifies matching fingerprints and embeds pinned searchDb metadata |
Modifying data/ or domain without re-running build:manifest & build:db | build:site aborts on sourceSha256 or domain mismatch before altering dist/ |
build:manifest without R2 credentials | Online image audit stays marked unverified rather than claiming live availability |
Static output hits 2,000 files on esa or all | Adding the 1 reserved proof file reaches 2,001; pre-upload budget check rejects |
| Workers / ESA CLI exits 0 but verification URL serves stale or foreign proof | Proof check rejects, skips receipt, and leaves production manifest.json unchanged |
Phase 1: Pin Configuration & Manifest (build:config → build:manifest)
pnpm run build:config: Validatessite.config.yamlvia@gallery/platformand synchronizes generated headers, redirects, and deploy templates insidepackages/platform/generated/.pnpm run build:manifest: Parsesdata/meta/*.yamlanddata/text/*.jsoninto an in-memoryGallerymodel, verifiesdb.prefixwithisSafeObjectPrefix, sortsimageKeyslexicographically, computessourceSha256 = galleryFingerprint(gallery), and writesout/manifest.jsonwithdb: null.
Phase 2: Build Pinned SQLite Search DB (build:db)
- Reloads
out/manifest.jsonand verifies livegalleryFingerprintand release version (RELEASE_VERSIONor UTCYYYY-MM-DD). - Initializes
@sqlite.org/sqlite-wasm, appliesPRAGMA page_size=<db.page_size>, createsseries,issues,chapters,pages,lines, and external-contentlines_fts USING fts5(..., tokenize='trigram'), inserts normalizedtext_norminside one transaction, runsINSERT INTO lines_fts(lines_fts) VALUES('rebuild'), creates 4 join indexes, setsPRAGMA journal_mode=DELETE, and compacts withVACUUM. - Writes
out/db/gallery-<version>.sqliteand its 64 KiBchunks.jsonmanifest, then patchesmanifest.db.
Phase 3: Static Site & Supporting Indexes (build:site → build:index → build:sitemap)
- Path Pre-Flight (
redirectOutputPaths): Validates all redirect routes stay strictly insidedist/before touching generated files or cleaning outputs. - Fingerprint Gate: Confirms
manifest.sourceSha256,site.domain, and version alignment, then writessite-config.json,gallery.json, and chaptertext/*.jsontopackages/site/src/generated/. - Astro Static Compilation: Builds one HTML per chapter with
inlineStylesheets: 'always'and the noop image service so pages remain readable with JavaScript disabled. - Static Baselines & SEO: Writes
_headers,_redirects, andedgeone.json(whenfeatures.platform_config: true),.nojekyll, escapedmetaRefreshredirect HTML,/index/series.json, per-series/index/<series>.json,sitemap.xml, and optional<indexnow_key>.txt.
Phase 4: Verification & Atomic Three-Phase Release (check → publish:r2 → release:*)
pnpm run check(DEPLOY_TARGET=all): Checks Web-standard boundaries, zerosharpbinaries, platform config sync, CI policies, README anchor links, SQLite headerpage_size, chapter HTML coverage, and target budgets (ESA<= 1,999/ Workers<= 17,999app files).publish:r2&release:prepare: Uploads missing WebP images, versioned.sqlite/.chunks.json, andmanifest-<version>.jsonto private R2; records previousmanifest.jsonETag inout/release-state.json.deploy:<target>& Proof Polling: Workers and ESA stage temporary copies with unique random deployment proof files, execute pinned CLIs viapnpm --package=... dlx, and poll target HTTPS endpoints (with DNS override + SNI/TLS verification for ESA staging) before recording receipts.release:activate&push:search: Once every target receipt matches(version, fingerprint), updates shared R2manifest.jsonconditionally withIf-Match, then submits newly added URLs to IndexNow.
Continue Reading
- Inspect package responsibilities: Code Map & Contribution Flow
- Dive into subsystem internals: Subsystems & Architecture