Skip to content

test: pin the validator's symlinked-directory gate - #1273

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/validate-architectures-symlinked-dir
Oct 10, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/validate-architectures-symlinked-dir

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Pins scripts/validate-architectures.mjs's handling of a symlinked directory under
docs/architectures/ — the arm #1242 added one day ago and that no test at validator
level reaches.

listArchitecturePages() fails closed on such a link because
@docusaurus/plugin-content-docs globs docs with fast-glob's default
followSymbolicLinks: true, so every page beneath the link ships at
/architectures/<link>/... without reaching the active-content gate.
tests/architecture-pages.test.mjs:147 pins that inside the library; the validator's own
symlink test (tests/validate-architectures.test.mjs:340) uses a page-named link,
which reaches the same irregular loop through the page-extension arm and therefore
holds it open whatever the directory arm does.

The mutation is the proof, not an illustration

Filtering the validator's irregular loop to page-named entries —

for (const page of irregular) {
  if (!/\.mdx?$/.test(page)) continue;

— leaves tests/architecture-pages.test.mjs and tests/validate-architectures.test.mjs
at 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

Two tests, both at validator level:

  1. a symlinked directory of pages exits non-zero and is reported at the link's own path
    with the message the validator carries, and no page beneath the link is named —
    reported, never followed;
  2. the complement — a link resolving to neither a page nor a directory still passes, so a
    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 — exit 0; 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

#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>
@hivecommons-hive

Copy link
Copy Markdown
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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 99ab7b0 Oct 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the validator's symlinked-directory gate is pinned only inside architecture-pages.mjs

1 participant