test/canonical-urls.test.js: one stale URL anywhere reports three more failures that name the wrong cause #2030

Closed
opened 2026-11-18 20:38:04 +00:00 by jaylouisw · 0 comments
Owner

Measured on origin/main (05ed9322), Node 26, with one stale URL planted in a file the probes never touch:

$ printf 'Clone from https://github.com/Jaylouisw/packetforge.git instead.\n' > docs/__unrelated_stale.md
$ node test/canonical-urls.test.js
  \u2717 no file points at the old repository (1 problems)
  \u2717 and the tree is clean again once the probe is removed
  \u2717 and the README is restored
  \u2717 and the tree is clean again once the probe is removed
48 passed, 4 failed

One stale URL is one problem, and it is the first line: correct, with its file and line printed under it. The other three are collateral. Three assertions end with ok(check().ok, ...):

  • test/canonical-urls.test.js:69 and :184 - "and the tree is clean again once the probe is removed"
  • test/canonical-urls.test.js:103 - "and the README is restored"

check().ok is the whole tree, not the probe. So a pre-existing stale URL makes the suite claim the probe cleanup left residue, and claim the README was not restored - while the assertion two lines below, and the README is restored byte for byte, passes on the same run. The label contradicts the test next to it.

This is not hypothetical: PR #1980 (docs/plans/changelog-discipline.md:36 quotes github.com/Jaylouisw/packetforge as the changelog footer's evidence) is red on all three Node legs at 48 passed, 4 failed, which reads as a broken cleanup rather than as one line of prose the checker refuses. Triage cost, not a guard.

Wanted: the post-probe assertions assert what their names say - nothing is reported for the probe path, and no E_NO_CANONICAL_CLONE / E_BADGE_NO_WORKFLOW problem remains - while the suite keeps its whole-tree guard at :47, which is where a stale URL should be reported once, with its file and line. A regression case should plant a stale URL outside the probe paths and pin that it is reported once and does not accuse the probes.

**Measured on `origin/main` (05ed9322), Node 26, with one stale URL planted in a file the probes never touch:** ``` $ printf 'Clone from https://github.com/Jaylouisw/packetforge.git instead.\n' > docs/__unrelated_stale.md $ node test/canonical-urls.test.js \u2717 no file points at the old repository (1 problems) \u2717 and the tree is clean again once the probe is removed \u2717 and the README is restored \u2717 and the tree is clean again once the probe is removed 48 passed, 4 failed ``` One stale URL is one problem, and it is the first line: correct, with its file and line printed under it. The other three are collateral. Three assertions end with `ok(check().ok, ...)`: - `test/canonical-urls.test.js:69` and `:184` - "and the tree is clean again once the probe is removed" - `test/canonical-urls.test.js:103` - "and the README is restored" `check().ok` is the whole tree, not the probe. So a pre-existing stale URL makes the suite claim the probe cleanup left residue, and claim the README was not restored - while the assertion two lines below, `and the README is restored byte for byte`, passes on the same run. The label contradicts the test next to it. This is not hypothetical: PR #1980 (`docs/plans/changelog-discipline.md:36` quotes `github.com/Jaylouisw/packetforge` as the changelog footer's evidence) is red on all three Node legs at `48 passed, 4 failed`, which reads as a broken cleanup rather than as one line of prose the checker refuses. Triage cost, not a guard. **Wanted:** the post-probe assertions assert what their names say - nothing is reported for the probe path, and no `E_NO_CANONICAL_CLONE` / `E_BADGE_NO_WORKFLOW` problem remains - while the suite keeps its whole-tree guard at `:47`, which is where a stale URL should be reported once, with its file and line. A regression case should plant a stale URL outside the probe paths and pin that it is reported once and does not accuse the probes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#2030
No description provided.