Skip to content

test: enforce the adr/ number and index contract again - #998

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/adr-contract-stale-todo
Oct 3, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/adr-contract-stale-todo

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

tests/adr-contract.test.mjs marks two assertions { todo: true }, with a
comment citing a real deviation:

// Known deviation, tracked separately: adr/0001-stakeholder-outreach-draft.md
// takes the 0001 prefix without being ADR 0001, so the directory holds two
// files claiming that number and one of them is absent from the index.

That deviation was fixed. 3906846 ("adr: resolve duplicate 0001 number and
index missing draft", #385) renamed the draft to
adr/stakeholder-outreach-draft-for-0001.md, which has no number prefix and so
leaves numberPrefixed entirely. But this test file has not been touched since
8a12910 (#282), which predates #385 — so the markers outlived the deviation
they documented, and both assertions have been passing and inert ever since.

A todo test still runs; node --test simply does not let its failure fail
the 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 any
pull request since #385.

Both assertions pass against the current adr/ tree unchanged, so this removes
a 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 from
each ADR number is claimed by exactly one file and from
every number-prefixed ADR file is listed in the index, and the stale comment
above the first is rewritten. No assertion body changes. No production code, no
workflow, no other test file.

Verification at de8406d

The markers' absence is not evidence on its own, so both are checked by
mutation against the real adr/ tree:

mutation before (main 6ccdaac) after
add adr/0002-duplicate-number.md exit 0, fail 0, todo 2; shown only as ⚠ … # TODO exit 1, ✖ each ADR number is claimed by exactly one file
add adr/0009-unindexed.md exit 0 exit 1, ✖ every number-prefixed ADR file is listed in the index
  • TZ=UTC node --test tests/adr-contract.test.mjs on the clean tree —
    pass 13, fail 0, todo 0 (was pass 11, fail 0, todo 2).
  • npm run test:unit:coverage:check — exit 0; src files unchanged at
    100.00 | 100.00 | 8351/8351 lines | 2395/2395 regions, all-files
    99.37 | 95.02 against gates of 99 and 94. No # TODO line remains anywhere
    in 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.mjs and its two
test files; #996 is confined to tests/tools/coverage-report.mjs,
tests/coverage-report-source-files.test.mjs and package.json. None of them
touches tests/adr-contract.test.mjs, and git merge-tree --write-tree
reports no conflict with pull/989/head, pull/991/head or pull/996/head.
#992's reserved ground (parseArgs()/main() in the e2e reporter) is
untouched 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

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>
@hivecommons-hive hivecommons-hive Bot added the hold label Oct 3, 2026
@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.

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] two adr-contract assertions are still marked todo after the deviation they documented was fixed, so the ADR contract is unenforced

1 participant