Skip to content

test: pin the unit gate's harness ceiling to the note it rests on - #1463

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-unit-gate-residual-parity
Oct 14, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-unit-gate-residual-parity

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

One file: tests/coverage-gate-thresholds.test.mjs, the unit lane's counterpart
to tests/e2e-coverage-gate.test.mjs.

1. The record it carries had gone stale. Re-measured at eff33b5 with
TZ=UTC node tests/tools/coverage-report.mjs, run twice — on node v22.23.3
(the major ci.yml pins) and on node v26.10.0 — with both runs agreeing to
the region:

row was recorded now recorded
all files 99.65% / 96.14% (58948/59153, 9515/9897) 99.67% / 96.14% (65688/65903, 10511/10933)
src files 100.00% / 100.00% (9233/9233, 2777/2777) 100.00% / 100.00% (9650/9650, 2792/2792)
harness files 100.00% / 99.63% (5352/5352, 1870/1877) 100.00% / 99.64% (5717/5717, 1947/1954)

(The all files counts are measured with this PR applied, so they already
include the test it adds.) The cited node version moves from v22.21.1 to
v22.23.3, which is what tests/e2e-coverage-gate.test.mjs already names.

No floor changes. Every entry in FLOORS is untouched and still clears its
measurement, and npm run test:unit:coverage:check exits 0 on both runtimes.

2. The one number that had already gone wrong is now derived, not restated.
The comment above --check-harness-file-regions said
tests/tools/e2e-coverage-report.mjs has "6 uncovered regions"; that file's own
residual note (lines 60-61) says 7, and the harness row measures 1947/1954. Seven
is right — the per-file row lists six lines (243, 634, 803, 814, 1038, 1117),
and line 243's map.resolvedSources ?? flattened.sources ?? [] is the
two-region chain the note calls out.

That note hands this file a job — "tests/coverage-gate-thresholds.test.mjs
records that ceiling beside --check-harness-file-regions so the floor is never
set above it" — and nothing executed it. This PR does: it parses
Together they are N regions, which caps this file at P% regions out of the
note (tolerating the // line wrap) and asserts
--check-harness-file-regions <= Math.floor(P). The same drift-by-omission
class is already closed by tests/docs-threshold-parity.test.mjs for the
contributor docs and tests/audit-gate.test.mjs for the advisory allowlist.

The assertion was shown to go red rather than pass vacuously: with the floor
temporarily raised to 99 it fails with
--check-harness-file-regions is floored at 99, above the 98.57% ceiling …,
and a note that no longer matches the sentence fails by name instead of leaving
the floor with nothing behind it.

Verification

  • node --test tests/coverage-gate-thresholds.test.mjs → 12 pass, 0 fail.
  • npm run test:unit:coverage:check → exit 0, on node v22.23.3 and v26.10.0.
  • npx prettier --check tests/coverage-gate-thresholds.test.mjs → clean.

Scope / overlap

Touches tests/coverage-gate-thresholds.test.mjs only. Disjoint from the open
hold-gated PRs: #1449 and #1445 refresh tests/e2e-coverage-gate.test.mjs and
the e2e spec tree, #1437 edits collectE2ECoverage's uncoveredRegions list in
tests/tools/e2e-coverage-report.mjs (lines 882-903) — this PR only reads
that file's header comment and changes nothing in it — and #1454 adds
tests/swc-native-binding-contract.test.mjs.

Related Issue

Refs #1411 (needs-human: #1411's own subject — a stale Test workflow
registration, which is repo Actions state and not a file — cannot be fixed by
any PR). This finding was filed as its own issue and the hive folded it into
#1411 as the ci.yml tracker; the folded body is the comment dated
2026-10-14T13:12Z. Nothing in this PR addresses #1411's original subject, so it
must not close it.


Filed by quality agent (hold-gated mode). Human review required.

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

The unit lane's threshold record in tests/coverage-gate-thresholds.test.mjs
had drifted from the suite it describes, and one clause of it contradicted
the file it cites: it called e2e-coverage-report.mjs's residual 6 uncovered
regions where that file's own note says 7, and the measured harness row is
1947/1954.

Refresh the three measured rows and the node versions, and stop restating
the residual count in prose: read the count and the ceiling back out of
tests/tools/e2e-coverage-report.mjs and assert that
--check-harness-file-regions stays at or below that ceiling. That is the
job the note already assigned this file, and nothing executed it.

No floor changes. Measured at eff33b5 on node v22.23.3 and v26.10.0, both
runs agreeing to the region.

Signed-off-by: quality <quality@hive.kubestellar.io>
@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 keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 973f8f4 Oct 14, 2026
8 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-unit-gate-residual-parity branch October 16, 2026 01:00
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.

1 participant