test: cover fail-loud guard error paths in build-disciplines#7
Merged
Conversation
Exports the parsing/guard helpers (readTemplate, extractSingleTemplate,
extractAllTemplates, readConstants, substitute, splitSections,
assertNoResidualVocab) and lets generate() accept an optional
injected-sources object, so guard behavior can be exercised with
crafted source strings instead of a fixture repo. Production
behavior (no-arg generate(), still reads the vendored files) is
unchanged and the drift-lock is intact.
Adds the deferred P2C error-path tests: silent-drop of an unhandled
section, unresolved ${...} interpolation, residual DeepAgents
vocabulary, renamed/reordered/missing section headers, and a
mode-template count != 3. Existing happy-path drift-lock tests are
untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
gpxl
force-pushed
the
claude/frosty-mayer-58b024
branch
from
July 8, 2026 13:59
49f7c24 to
5f1be97
Compare
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.
Summary
Deferred error-path guard tests from P2C (#6, already merged as
2ff0c3a).That PR shipped
scripts/build-disciplines.mjswith happy-path drift-lockcoverage only; this adds tests for each fail-loud guard actually throwing:
an unrendered bucket)
${...}interpolation left over after substitutionTo make these testable without a fixture repo, the parsing/guard helpers
(
readTemplate,extractSingleTemplate,extractAllTemplates,readConstants,substitute,splitSections,assertNoResidualVocab)are now exported, and
generate()accepts an optional injected-sourcesobject. Production behavior (no-arg
generate(), still reads the vendoredfiles) is unchanged and the drift-lock is intact.
Note on base branch: the original task assumed this would stack on the
still-open P2C PR (
claude/p2c-generate-disciplines), but that PR merged(squash) into
mainas2ff0c3abefore this branch was pushed, and itsbranch was deleted. This PR targets
maindirectly; the diff contains onlythe new test/export changes described above — the existing happy-path
drift-lock tests are untouched.
Commits
49f7c24test: cover fail-loud guard error paths in build-disciplinesTest plan
npm test— 101 passingnpm run lint— clean (shellcheck; not applicable to this.mjsfile's own gate, but full lint run is clean)node scripts/build-disciplines.mjs --check— in sync🤖 Generated with Claude Code