Fix: generate.js failed to run — AST catalogue block inserted three times - #28
Merged
Merged
Conversation
…imes
The T-A10-01 migration script was not idempotent and was run more than
once, so scripts/generate.js carried three copies of the Agentic Skills
catalogue block and three `const AST_IDS` declarations. Duplicate keys in
an object literal are legal; a duplicate `const` is not, so the file threw
SyntaxError: Identifier 'AST_IDS' has already been declared
on every invocation. CI did not catch it because the workflow runs
validate.js and stats:check, neither of which loads generate.js.
Collapses the three blocks into one AST01-AST10 catalogue and the three
declarations into one. Regenerating produces byte-identical output for all
51 entries and docs/data.js, which confirms the duplicates were inert
beyond the syntax error.
Also corrects the file header, which still described 41 entries and a
DSGAI21 upper bound.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
emmanuelgjr
added a commit
that referenced
this pull request
Aug 28, 2026
…#30) * CI: run the generator and assert its output matches what is committed generate.js sat broken on main for several commits (#28) and nothing caught it, because no job ran it: the Content Validation workflow runs validate.js and stats:check, neither of which loads the generator. A file that produces every entry in data/entries/ and both webapp data bundles had no coverage at all. Adds a "Generator reproducibility" job that runs generate.js and then asserts `git diff --exit-code` over data/entries, docs/data.js and docs/incidents.js. That catches three things the previous jobs could not: the generator failing to load, a hand-edit to a generated file, and a source change that was never regenerated. Also brings the path filters up to date — they still listed three source directories, so nothing under ast-top10/ triggered validation, and a change to generate.js itself triggered nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * CI: let validate.yml trigger on changes to itself Without this the workflow cannot verify its own edits — the new Generator reproducibility job did not run on the PR that added it, because .github/ was not in the path filters. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
scripts/generate.jsthrows on every invocation onmain:The T-A10-01 migration script was not idempotent and was run more than once, leaving three copies of the Agentic Skills catalogue block and three
const AST_IDSdeclarations. Duplicate keys in an object literal are legal, so the catalogue itself was still correct — but a duplicateconstis not, so the generator would not load at all.CI did not catch it: the workflow runs
validate.jsandstats:check, neither of which loadsgenerate.js.Fix
Collapses the three blocks into one
AST01–AST10catalogue and the three declarations into one.Regenerating afterwards produces byte-identical output for all 51 entries and
docs/data.js— confirming the duplicates were inert beyond the syntax error, and that nothing generated while the file was broken is wrong.Also corrects the file header, which still described "41 entries" and a
DSGAI21upper bound.Verification
node --check scripts/generate.js— cleannode scripts/generate.js— runs; 51 entries,docs/data.js,docs/incidents.jsall writtengit diffafter regeneration — emptyvalidate.js— 0 errors, 283 passedstats:check— green🤖 Generated with Claude Code