Repository navigation
test: enforce the adr/ number and index contract again - #998
Merged
Merged
Conversation
tests/adr-contract.test.mjs marks two assertions { todo: true }, citing
adr/0001-stakeholder-outreach-draft.md taking the 0001 prefix without
being ADR 0001. 3906846 (#385) resolved that by renaming the draft to
adr/stakeholder-outreach-draft-for-0001.md, which has no number prefix
and so leaves numberPrefixed entirely -- but this file has not been
touched since 8a12910 (#282), which predates it, so the markers
outlived the deviation.
A todo test still runs; node --test simply does not let its failure
fail the suite. Adding a second file claiming ADR 0002 left the suite
at exit 0 with 'fail 0, todo 2', the violation reported only as a
warning. Both assertions pass against the current adr/ tree, so this
removes a suppression rather than adding a check.
Closes #997
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 automatically remove the |
This was referenced Oct 3, 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
tests/adr-contract.test.mjsmarks two assertions{ todo: true }, with acomment citing a real deviation:
That deviation was fixed.
3906846("adr: resolve duplicate 0001 number andindex missing draft", #385) renamed the draft to
adr/stakeholder-outreach-draft-for-0001.md, which has no number prefix and soleaves
numberPrefixedentirely. But this test file has not been touched since8a12910(#282), which predates #385 — so the markers outlived the deviationthey documented, and both assertions have been passing and inert ever since.
A
todotest still runs;node --testsimply does not let its failure failthe suite. The contract these two describe — one file per ADR number, every
numbered ADR listed in
adr/README.md— has therefore not been enforced on anypull request since #385.
Both assertions pass against the current
adr/tree unchanged, so this removesa suppression rather than adding a check. The comment is replaced with the
history that explains why the markers were ever there, so the next reader does
not re-add them.
Files and functions claimed
Only
tests/adr-contract.test.mjs: the{ todo: true }option is dropped fromeach ADR number is claimed by exactly one fileand fromevery number-prefixed ADR file is listed in the index, and the stale commentabove the first is rewritten. No assertion body changes. No production code, no
workflow, no other test file.
Verification at
de8406dThe markers' absence is not evidence on its own, so both are checked by
mutation against the real
adr/tree:main6ccdaac)adr/0002-duplicate-number.md0,fail 0,todo 2; shown only as⚠ … # TODO1,✖ each ADR number is claimed by exactly one fileadr/0009-unindexed.md01,✖ every number-prefixed ADR file is listed in the indexTZ=UTC node --test tests/adr-contract.test.mjson the clean tree —pass 13, fail 0, todo 0(waspass 11, fail 0, todo 2).npm run test:unit:coverage:check— exit0;src filesunchanged at100.00 | 100.00 | 8351/8351 lines | 2395/2395 regions, all-files99.37 | 95.02against gates of 99 and 94. No# TODOline remains anywherein the suite output.
npx prettier --check tests/adr-contract.test.mjs— clean.Disjoint from #989, #991 and #996
#989 and #991 are confined to
tests/tools/e2e-coverage-report.mjsand its twotest files; #996 is confined to
tests/tools/coverage-report.mjs,tests/coverage-report-source-files.test.mjsandpackage.json. None of themtouches
tests/adr-contract.test.mjs, andgit merge-tree --write-treereports no conflict with
pull/989/head,pull/991/headorpull/996/head.#992's reserved ground (
parseArgs()/main()in the e2e reporter) isuntouched here.
Related Issue
Closes #997
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88