Skip to content

spike(GMT-1715): preserve the atomics oracle in the repo - #3408

Draft
dreamwasp wants to merge 1 commit into
mainfrom
cass-atomics-oracle
Draft

spike(GMT-1715): preserve the atomics oracle in the repo#3408
dreamwasp wants to merge 1 commit into
mainfrom
cass-atomics-oracle

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Overview

Spike infrastructure, not for merge. Preserves the atomics oracle in version
control, because it currently exists only in a local notes vault with no remote.

The provenance problem this fixes: dist/gamut-source.bundle.mjs is the only
surviving executable copy
of the Gamut prop config + Core theme. It cannot be
regenerated — Panda isn't installed in this repo, and gamut-styles/dist now ships
zero .js files under the tightened exports map. So dist/atomics.css
(707,557 B / 7,650 rules) was re-checkable but not re-derivable, and the only copy
of its input was unversioned on one laptop.

Several claims in the 1.0 planning docs are measured against these bytes. This makes
them citable from a PR.

It works in the library, with no install

cd spikes/gamut-atomics-poc && node verify.mjs      # exit 0

Verified in a clean worktree before committing. 1,275 prop×value pairs agree
declaration for declaration, and the check is loudprocess.exitCode = 1 on
divergence, which is more than most of our spikes manage.

Two things reviewers will reasonably object to

1. It commits ~1.3 MB of generated artifacts. Deliberate, and named in the commit
message. The alternative is that an irreplaceable input to several planning decisions
lives in one unversioned directory.

file size why
dist/gamut-source.bundle.mjs 262 kB irreplaceable input
dist/atomics.css 708 kB the byte-exact oracle
dist/atomics-base.css 116 kB base-tier oracle
dist/atomics-manifest.json 244 kB prop×value manifest

2. It uses --no-verify, and the reason is load-bearing. The pre-commit hook runs
nx format:write over staged files, which would reformat the oracle and destroy the
byte-identity it exists to prove.
spikes/gamut-atomics-poc/dist is added to
.prettierignore in the same commit. (The hook also can't run in a worktree without
node_modules, which is how this was authored so the tsdown branch stayed untouched.)

PR Checklist

  • Related to designs: n/a
  • Related to JIRA ticket: GMT-1715
  • Version plan added/updated (or not needed) — not needed, spike
  • I have run this code to verify it works
  • This PR includes unit tests — verify.mjs is the assertion and exits non-zero
    on divergence
  • This PR includes testing instructions
  • Alpha package passing e2e in consumer repos — n/a, nothing consumes this

Testing Instructions

cd spikes/gamut-atomics-poc
node verify.mjs                 # expect exit 0, 1275 pairs agreeing
shasum -a 256 dist/atomics.css  # expect 2e7b89b130fdc54f…

To confirm the formatter really would break it, run npx prettier --check dist/atomics.css.

Known limitations

  • gamut-atomics-poc itself can no longer regenerate its own bundle — it reads the
    prebuilt one. Re-deriving from live packages/gamut-styles/src is the obvious
    follow-up and is not done here.
  • Nothing in the library consumes these atomics yet. This is a reference artifact.

Stacked on this: #3409 — the Gamut-owned emitter measured against it.

Related: #3402 · #3405 · #3406 · #3407

`gamut-atomics-poc` lived only in a local notes vault with no remote, and
`dist/gamut-source.bundle.mjs` is the ONLY surviving executable copy of the Gamut
prop config + Core theme. It cannot be regenerated: Panda is not installed here, and
`gamut-styles/dist` now ships zero `.js` files under the tightened exports map.

So `dist/atomics.css` (707,557 B / 7,650 rules) was re-checkable but not
re-derivable, and the only copy of its input was unversioned. This makes the oracle
citable from a PR instead of from a path on one laptop.

Verified in-repo before committing: `node verify.mjs` exits 0 with NO install.
1,275 prop×value pairs agree declaration for declaration, and the check is loud
(`process.exitCode = 1` on divergence).

Generated artifacts are committed deliberately:
  dist/gamut-source.bundle.mjs  262 kB  irreplaceable input
  dist/atomics.css              708 kB  the byte-exact oracle
  dist/atomics-base.css         116 kB  base-tier oracle
  dist/atomics-manifest.json    244 kB  prop x value manifest

Two notes on how this landed:

- `--no-verify` was required, and the reason matters. The pre-commit hook runs
  `nx format:write` over staged files, which would REFORMAT the oracle and destroy
  the byte-identity it exists to prove. `spikes/gamut-atomics-poc/dist` is therefore
  added to `.prettierignore` in this commit.
- The hook also cannot run in a git worktree without node_modules, which is how this
  was authored so the tsdown branch stayed untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@nx-cloud

nx-cloud Bot commented Aug 11, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit a386a0c


☁️ Nx Cloud last updated this comment at 2026-08-11 14:31:25 UTC

@github-actions

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 72.5.2-alpha.0131bc.0 npm diff
@codecademy/gamut-icons 9.57.12-alpha.0131bc.0 npm diff
@codecademy/gamut-illustrations 0.58.17-alpha.0131bc.0 npm diff
@codecademy/gamut-kit 3.0.15-alpha.0131bc.0 npm diff
@codecademy/gamut-patterns 0.10.36-alpha.0131bc.0 npm diff
@codecademy/gamut-styles 20.1.1-alpha.0131bc.0 npm diff
@codecademy/gamut-tests 6.0.7-alpha.0131bc.0 npm diff
@codecademy/variance 0.26.2-alpha.0131bc.0 npm diff
eslint-plugin-gamut 2.4.4-alpha.0131bc.0 npm diff

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.

2 participants