Skip to content

test(docs-contract): derive autogenerated sidebar dirs from sidebars.js - #747

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-docs-contract-sidebar-dirs
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-docs-contract-sidebar-dirs

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

tests/docs-contract.test.mjs restated the autogenerated sidebar directories by
hand:

const AUTOGENERATED_SIDEBAR_DIRS = ['architectures', 'community'];

sidebars.js declares a third, resourcesSidebar from docs/resources, so the
test docs in autogenerated sidebar directories declare a title never examined
docs/resources/{index,case-studies,radar-reports}.md. A doc under an
autogenerated sidebar with no frontmatter title falls back to its filename for
the sidebar label, so that regression was invisible to the suite.

This PR derives the list from sidebars.js — the same source
tests/site-config.test.mjs already uses for its directory-existence assertion —
and asserts the derived list is non-empty so a future refactor cannot reduce the
contract to a no-op. Any sidebar added to sidebars.js from now on is covered
automatically.

Verification

Revision b54cf81 (main).

  • Before: deleting title: Resources from docs/resources/index.md leaves
    TZ=UTC node --test tests/docs-contract.test.mjs at 6/6 pass.
  • After: the same mutation fails with actual: [ 'docs/resources/index.md' ].
  • TZ=UTC node --test → 1180 pass / 0 fail / 2 todo.
  • npx prettier --check tests/docs-contract.test.mjs → clean.

Tests only; no production code, no data, no workflow file.

Claimed ground

Files: tests/docs-contract.test.mjs (only). Cluster: the docs-tree /
sidebars.js contract. Disjoint from every open hold-gated PR — none touch
tests/docs-contract.test.mjs or sidebars.js.

Related Issue

Closes #746


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

The sidebar-title contract in tests/docs-contract.test.mjs restated the
autogenerated sidebar directories by hand as ['architectures', 'community'],
but sidebars.js declares a third one, resourcesSidebar, from docs/resources.
The three docs under it were never checked for a frontmatter title, so losing
one would silently degrade the sidebar label to the filename.

Derive the list from sidebars.js, the way tests/site-config.test.mjs already
does for its directory-existence assertion, and assert the derived list is
non-empty so the contract cannot become a no-op.

Signed-off-by: hivecommons-hive[bot] <hivecommons-hive@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 automatically remove the hold label once current policy no longer requires a level hold for "quality". If this is an outreach PR, a human must review it and remove the label.

@mrbobbytables

Copy link
Copy Markdown
Member

Superseded by #750, which consolidates this and 14 other test-only coverage PRs into a single reviewable change (commit cherry-picked unmodified, authorship and DCO preserved).

@mrbobbytables
mrbobbytables deleted the quality/test-docs-contract-sidebar-dirs branch September 28, 2026 14:46
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] docs-contract sidebar-title check skips docs/resources: derive the dir list from sidebars.js

1 participant