Skip to content

ci: automated release gate (tests, byte budget, real-browser inscription path) - #5

Merged
jerryfane merged 1 commit into
mainfrom
ci/release-gate
Sep 9, 2026
Merged

jerryfane merged 1 commit into
mainfrom
ci/release-gate

Conversation

@jerryfane

Copy link
Copy Markdown
Owner

Answers "can the release gate be automated": mostly yes. This adds the checks a machine can run, and states plainly the ones it cannot.

What runs

node scripts/gate.mjs, also wired to CI on push and pull request:

Stage What it proves
unit tests (source) behaviour of the readable code
minify pinned config, recorded in the release record
unit tests (minified artifact) the thing that actually ships still behaves — a minifier that breaks it fails here
byte budget artifact must not exceed the 3,911 B live inscription body
browser smoke real Chromium loads the library through /content/<id> against a stub ord server
release record commit, source/artifact bytes, sha256, minifier version+flags, dependency inscription IDs

The browser stage asserts what a unit test cannot: the recursive <script src="/content/<id>"> load defines OrdJS, a 1 MiB image round-trips byte-exactly through real fetch/btoa, the empty sat makes no /content/null request at the network level, and the decoder inscription is fetched lazily and exactly once across two concurrent calls.

Current output

pass  unit tests (source)
pass  minify
pass  unit tests (minified artifact)
pass  byte budget (3004 <= 3911)
pass  browser smoke (minified artifact)

Release record for the current head: 3,004 B artifact, sha256 080e80c2…7918e7bb, minifier bun 1.3.14 build --no-bundle --minify-syntax --minify-whitespace --target=browser, dependency inscription a9f6a9b0…308566i0.

Verified the gate actually fails

Two mutants against the current source. Wrapping the class in an IIFE so it never reaches the global scope: 3 stages fail, including the browser stage with the class undefined. Raising the base64 chunk size to 256 KiB: the 1 MiB round-trip fails in both the suite and the browser. A gate that cannot fail is decoration.

What is still manual

Printed by the gate itself, so it cannot be forgotten: a real ord server with the sat index enabled and disabled, Firefox and WebKit, and a commit/reveal fee dry-run at the chosen rate. CI cannot honestly cover those.

Nothing here is inscribed — package.json, scripts/, CI and tests are repository-only. The released artifact remains a minified src/content/OrdJS.js.

- scripts/gate.mjs: tests, pinned minification, tests against the minified
  artifact, byte budget against the live inscription body, browser smoke,
  and a printed release record (bytes, sha256, dependency inscription IDs)
- scripts/browser-smoke.mjs: real Chromium loading the library through
  /content/<id> against a stub ord server, asserting the 1 MiB round-trip,
  the empty-sat path making no /content/null request, and the decoder
  inscription loading lazily exactly once
- package.json/.gitignore: dev-only tooling, nothing inscribed
- CI runs the same gate on push and pull request
@jerryfane
jerryfane merged commit 7c022de into main Sep 9, 2026
1 check passed
@jerryfane
jerryfane deleted the ci/release-gate branch September 9, 2026 07:21
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