test: repair architecture catalog fixture and cover the sourceUrl, id and asset rules from #334 - #398
Merged
Conversation
… asset rules PR #334 added mandatory sourceUrl, id-slug and asset-containment rules to scripts/validate-architectures.mjs without updating the test fixtures. The validRecord fixture has no sourceUrl, so 'accepts a valid catalog' and 'accepts records without an assets array' both fail, leaving npm run test:unit red on main and the ci.yml 'Validate repository' check red on every open PR. Add sourceUrl to the fixture and cover the three rules #334 introduced: sourceUrl absent / http: / javascript: / unparseable / non-string, a non-slug id, and assets outside the prefix, escaping it via .., or not a string. Closes #397 Signed-off-by: kubestellar-hive[bot] <kubestellar-hive@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
3 tasks
mrbobbytables
approved these changes
Sep 21, 2026
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.
Test Improvement
npm run test:unitis red onmain..github/workflows/ci.ymlruns it on everypull_request, so the "Validate repository" check is failing on every open PR,not just one.
dc5fe09 (#334) added three mandatory rules to
scripts/validate-architectures.mjs—
sourceUrlmust be anhttps:URL,idmust be a lowercase slug, and everyasset must resolve inside
static/img/architectures/— without updating the testfixtures. The
validRecordfixture has nosourceUrl, so the two tests thatassert
status === 0fail.This PR touches
tests/validate-architectures.test.mjsonly. No production code.Changes
sourceUrlto thevalidRecordfixture, repairingaccepts a valid catalogand
accepts records without an assets array.sourceUrlrule fix: validate architecture catalog sourceUrl scheme and asset containment (scripts/validate-architectures.mjs) #334 introduced: absent,http:,javascript:,unparseable, and non-string.
idslug rule with a rejected id...traversal, and non-string.Verification
Clean
npm ci, node v26.8.2, at60ddab0:npx prettier --check tests/validate-architectures.test.mjspasses.The reported percentage for
scripts/validate-architectures.mjsstays at90.74% / 29.41%: these tests drive the validator through
runScriptWithFixtures,which spawns a subprocess, and
node --testcoverage discards subprocess data.That attribution gap is #224 (PR #227/#225 territory), not something this PR claims
to fix — the branches are genuinely exercised, just not counted.
Overlap with open PRs
Open PR #212 also edits
tests/validate-architectures.test.mjs, but only appendsMDX-active-content tests at end of file, and those tests reuse the same unfixed
validRecord— merging #212 alone will not turn CI green, and it will inherit thefix from here. This PR inserts its tests before
rejects assets missing from static/, above #212's append point, so the two should not conflict textually.No other open PR touches this file.
Related Issue
Closes #397
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5