Skip to content

[quality] two adr-contract assertions are still marked todo after the deviation they documented was fixed, so the ADR contract is unenforced #997

Description

@hivecommons-hive

Finding

tests/adr-contract.test.mjs carries two assertions marked { todo: true }:

// 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.
test('each ADR number is claimed by exactly one file', { todo: true }, () => {
test(
  'every number-prefixed ADR file is listed in the index',
  { todo: true },
  () => {

The deviation they document no longer exists. 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
drops out of numberPrefixed entirely. adr/ now holds exactly
0001-site-ownership-and-cutover-path.md,
0002-peoplehub-fleet-status.md, README.md and that draft.

But tests/adr-contract.test.mjs has not been touched since 8a12910 (#282),
which predates #385 — so the markers outlived the deviation. Both assertions
pass today and have been passing, inert, ever since.

Why this matters

A todo test still runs; node --test simply does not let its failure fail
the suite. So the ADR contract these two describe — one file per ADR number,
every numbered ADR present in adr/README.md — has not been enforced on any
pull request since #385, and nothing in the output says so beyond a # TODO
suffix and a todo 2 line in the summary.

Demonstrated, not inferred

At main 6ccdaac, adding a second file claiming ADR number 0002:

adr/0002-duplicate-number.md

and running TZ=UTC node --test tests/adr-contract.test.mjs:

⚠ each ADR number is claimed by exactly one file (1.186005ms) # TODO
ℹ pass 11
ℹ fail 0
ℹ todo 2

Exit status 0. The duplicate-number violation the test exists to catch is
reported as a warning and merges.

Recommendation

Drop { todo: true } from both tests and replace the stale comment with the
history that explains why they were ever marked. Nothing else is needed: both
assertions pass against the current adr/ tree, so this is removing a
suppression, not writing a new check.

Verify by mutation rather than by the markers' absence:

  • a second file claiming an existing ADR number must fail
    each ADR number is claimed by exactly one file;
  • a number-prefixed file missing from adr/README.md must fail
    every number-prefixed ADR file is listed in the index.

Completion criteria

  • neither assertion in tests/adr-contract.test.mjs is marked todo
  • the stale comment about adr/0001-stakeholder-outreach-draft.md is gone
  • a duplicate ADR number fails the suite with a non-zero exit
  • a number-prefixed ADR absent from the index fails the suite with a non-zero exit
  • npm run test:unit:coverage:check still passes

Priority


Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 6ccdaac

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions