test: cover the adr/ decision-record contract (tests/adr-contract.test.mjs) - #282
Open
kubestellar-hive[bot] wants to merge 1 commit into
Open
kubestellar-hive[bot] wants to merge 1 commit into
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Adds tests/adr-contract.test.mjs, asserting that adr/README.md's index table and the adr/NNNN-*.md files agree: indexed links resolve and are named for their number, index numbers are unique, index Status and Title match each record's header and heading, every record declares a parseable Date and an allowed Status, each record heads itself with its own number, and relative links between ADR files resolve. Two assertions are marked todo because main already violates them: the supporting outreach draft takes the 0001- prefix without being ADR 0001, so two files claim that number and one is absent from the index. Closes #280 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 |
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
Adds
tests/adr-contract.test.mjs— the first test that readsadr/at all. It asserts the contract betweenadr/README.md's index table and theadr/NNNN-*.mdrecords:- **Status**:header; index Title matches its H1- **Date**:and a Status in {Proposed, Accepted, Rejected, Superseded, Deprecated}0002-*.md)./-link between files inadr/resolvesHeader assertions apply to files that head themselves as an ADR or are linked from the index, so supporting drafts filed alongside a record are not held to the ADR header block.
Two assertions are
{ todo: true }mainalready violates them:adr/0001-stakeholder-outreach-draft.mdtakes the0001-prefix without being ADR 0001, so two files claim number 0001 and one is absent from the index.each ADR number is claimed by exactly one fileandevery number-prefixed ADR file is listed in the indexare therefore marked todo — the suite stays green, the deviation is recorded in the test file, and the fix is filed as #281 with the exact remediation. Dropping the{ todo: true }flags is a one-line-each change once #281 lands; that is a docs rename, outside this lane.Verification
npm run test:unit: 68 tests, 66 pass, 0 fail, 2 todo (was 55 pass / 0 fail).adr/README.mdrestored,git diff --statclean.npx prettier --checkclean.Coverage evidence
npm run test:unit -- --experimental-test-coverage, local clone ofcncf/endusersat parent revision00b44dfafternpm ci, 2026-09-18. Baseline: 55 tests,adr/read by no test (grep -rn adr tests/empty). This is a content-contract suite, so it adds noscripts/line coverage.Disjointness
Claims exactly one new file,
tests/adr-contract.test.mjs, and theadr/content cluster. No other open PR touchesadr/as a test subject: the open data-contract test PRs coverdata/milestones.json(#235),data/projects-born.json(#239),data/community-roster.json(#241),data/members.json/awards.json(#253),data/community-people.json(#257),data/architectures(#260),blog/frontmatter (#270),docusaurus.config.js/sidebars.js(#275) andpackage.json/CI wiring (#278). #167 edits ADR content (status/prose) but changes no filename and no index structure; the assertions here are parity assertions, which hold across that edit.Related Issue
Closes #280
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5