Skip to content

feat: add domformat package and canonical gallery corpus - #81

Open
alowpoly wants to merge 1 commit into
mainfrom
domformat-package
Open

feat: add domformat package and canonical gallery corpus#81
alowpoly wants to merge 1 commit into
mainfrom
domformat-package

Conversation

@alowpoly

@alowpoly alowpoly commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the private source-only @layoutit/polycss-domformat workspace package with the closed domformat@0 / polycss-3d@0 retained-DOM contract
  • support canonical UTF-8 JSON documents with digest-bound external sibling CSS and image resources; no .dom, archive, gzip, or embedded-package transport
  • add deterministic canonical documents for all 304 current Gallery presets, plus generation, structural verification, fresh-regeneration, and browser-proof tooling
  • keep the private package in workspace tests and builds while excluding it from public versioning and publication
  • share Gallery animation selection and responsive presentation helpers with the corpus producer to prevent drift

Architecture

The package remains producer-neutral and independent of Morph and renderer internals. Producer parsing, preparation, lowering, and product adapters remain outside domformat. No PolyCSS or Morph producer integration is added here.

The exact runtime lifecycle is validate -> construct -> bind -> initialize -> publish -> destroy. Partial lifecycle failures roll back DOM, styles, listeners, observers, object URLs, and host changes; destroy is idempotent.

Package code is MIT. Per-model third-party Gallery licensing and attribution remain recorded in the corpus catalog and are not relicensed as MIT.

The checked Gallery corpus adds approximately 176 MiB: 304 JSON documents, 216 unique external assets, and one shared CSS resource.

Verification

  • pnpm --filter @layoutit/polycss-domformat test:release — 120/120 tests, independent Python and N-version corpora, real Chrome mounts, clean-installed deterministic tarball
  • pnpm gallery:domformat:verify
  • pnpm gallery:domformat:verify:fresh
  • representative retained-DOM/browser proofs across B, U, S, and voxel strategies
  • running-human animation proof — 30/30 canonical ticks within the declared pixel-difference bound
  • pnpm test
  • pnpm build
  • git diff --check

Deterministic package tarball: 79,046 compressed bytes, 31 entries, SHA-256 174c68e76aafd00ffbf72ee5d4a9a167a14baf5761087d54f01dd9d8a74e988f.

Proof boundary

The committed corpus is a Chromium Gallery-strategy snapshot. Browser proof establishes retained-DOM and selected-tick browser equivalence within strict reported bounds; it is not native or universal cross-engine parity. Animated entries capture the Gallery-selected clip at canonical 30 Hz, not every clip in every source model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant