Repository navigation
test: pin the validator's symlinked-directory gate - #1273
Merged
Merged
Conversation
#1242 made listArchitecturePages() fail closed on a symlinked directory under docs/architectures/, and validate-architectures.mjs reports the resulting irregular entries. That arm is pinned only inside the library: the one symlink test at validator level uses a page-named link, which reaches the same irregular loop through the page-extension arm. Filtering that loop to page-named entries leaves architecture-pages.test.mjs and validate-architectures.test.mjs at 51/51 pass while a symlinked directory of pages publishes every page beneath it ungated. Region coverage cannot see the hole, because the page-named case already executes the loop body. Drives the validator itself over a symlinked directory: non-zero exit, the finding reported at the link's own path, and no page beneath the link named -- reported, never followed. The complement case pins that a link resolving to neither a page nor a directory still passes. Closes #1272 Signed-off-by: quality <quality@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 keep the |
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
Pins
scripts/validate-architectures.mjs's handling of a symlinked directory underdocs/architectures/— the arm#1242added one day ago and that no test at validatorlevel reaches.
listArchitecturePages()fails closed on such a link because@docusaurus/plugin-content-docsglobs docs with fast-glob's defaultfollowSymbolicLinks: true, so every page beneath the link ships at/architectures/<link>/...without reaching the active-content gate.tests/architecture-pages.test.mjs:147pins that inside the library; the validator's ownsymlink test (
tests/validate-architectures.test.mjs:340) uses a page-named link,which reaches the same
irregularloop through the page-extension arm and thereforeholds it open whatever the directory arm does.
The mutation is the proof, not an illustration
Filtering the validator's
irregularloop to page-named entries —— leaves
tests/architecture-pages.test.mjsandtests/validate-architectures.test.mjsat 51/51 pass, while the hole #1242 closed reopens end to end. With this PR the first
new test fails on it. Region coverage cannot see the mutation either way: the page-named
case already executes the loop body, so the file stays at 100.00% lines / 100.00%
regions.
Files and functions claimed
tests/validate-architectures.test.mjs— two appended tests only. Disjoint from everyopen hold-gated PR: fix(security): treat a slashless http: value as a remote authority #1249 (
tests/svg-active-content.test.mjs), fix(security): reject remote image destinations in imported MDX pages #1255(
tests/mdx-active-content.test.mjs), fix(security): reduce a script-capable image destination to alt text #1264(
tests/architecture-content-clean-markdown.test.mjs), test(coverage): ratchet the per-file harness region floor 93 -> 97 #1250 (package.json,tests/coverage-gate-thresholds.test.mjs), test: pin sourceBoundaryOffsets short-segment guard and multi-boundary sort #1252, test: pin the uri-safety classifier's own contract #1262, test(e2e): drive the contributor membership filter in a browser #1266, test: pin each e2e data overlay's effect on the validator that gates its file #1269. No productionfile is touched.
Two tests, both at validator level:
with the message the validator carries, and no page beneath the link is named —
reported, never followed;
future tightening to "every symlink is an error" cannot start failing checkouts that
publish nothing through the link without a test objecting.
Verification
TZ=UTC node --test tests/validate-architectures.test.mjs— 31/31 pass.npm run test:unit:coverage:check— exit0;src files 100.00 | 100.00,harness files 100.00 | 99.19,all files 99.65 | 96.13. Node v26.10.0, TZ=UTC,locally at
365e11f.npx prettier --check tests/validate-architectures.test.mjs— clean.Related Issue
Closes #1272
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88