T-ENG03: make the webapp data bundles deterministic - #37
Open
emmanuelgjr wants to merge 1 commit into
Open
Conversation
Every docs/*.js bundle carried a `// Generated: <today>` header. Nothing else in the generator output varies between runs, so that one line was the whole reason a regenerate on a different day showed four dirty files — and, since #30, the reason the Generator reproducibility job and the `committed entries match a fresh generation` test could only pass on the day the bundles were last committed. - generate.js: drop the run-date lines; the Source header now reads the version from package.json instead of a hard-coded, stale `v1.5.2`. - generate.test.mjs: assert no bundle header names a run or carries a date. - validate.yml: the reproducibility job now diffs every generated artefact (backlinks.json, backlinks.js, frameworks-registry.js too). - CONTRIBUTING.md: document the build contract — generated files, the determinism requirement, and why the bundles are committed (Pages serves docs/ from main; no deploy workflow exists). Determinism only. No structural, route, layout or logo change (C2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0147wBugcuzLkswKPqgofcke
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was non-deterministic
Only one thing: each of the four
docs/*.jsbundles opened with// Generated: <today's date>. Everything else the generator emits is stable run-to-run (the existinggenerating twice produces byte-identical outputtest already proved that — on the same day).That single line had a bigger consequence than untidy diffs: since #30, the Generator reproducibility CI job and the
committed entries match a fresh generationunit test both diffdocs/data.jsagainst a fresh run. Both could only pass on the day the bundles were last committed. They were green on 2026-08-28 because every merge that day regenerated them; the next push on a later day would have failed onmainwith no code change.Changes
scripts/generate.js— the four// Generated:lines are gone. The// Source:header now reads the version frompackage.json(v4.0.0) instead of a hard-codedv1.5.2that had been stale for three majors.scripts/generate.test.mjs— new test: no bundle header may name a run or carry a date..github/workflows/validate.yml— the reproducibility job now diffs every generated artefact:data/backlinks.json,docs/backlinks.jsanddocs/frameworks-registry.jswere previously outside the check.CONTRIBUTING.md— a "Generated files" section: which files are generated, the determinism requirement, and thenpm run build/npm test/git diff --exit-codeloop.On "prefer generating them in the Pages deploy workflow"
There is no Pages deploy workflow: Pages is configured as
build_type: legacy, sourcemain:/docs(checked viagh api .../pages). Switching to a workflow-based deploy means changing the repository's Pages settings and adding a deploy workflow — a maintainer/infrastructure decision, not a determinism fix — so this PR keeps the bundles committed and says so in CONTRIBUTING. Happy to draft that workflow as a follow-up if wanted.Observed, not changed
node --testruns the suite files in parallel, andgenerate.test.mjsrewritesdata/entries/whileexports.test.mjsreads them. One run in ~6 produced a transientOSCAL component definition carries at least one implemented requirementfailure; the same run passes in isolation and on pristinemain. Pre-existing and out of scope here; noted for a follow-up (serialize the suites or have the exports test snapshot its input).🤖 Generated with Claude Code
https://claude.ai/code/session_0147wBugcuzLkswKPqgofcke