Repository navigation
test(owners): assert the gate's remaining error branches and clear its coverage-floor entry - #292
Conversation
…s coverage-floor entry The three reachable dead ranges — a nested key before any top-level key (reported under `(none)`), an unparseable OWNERS_ALIASES line, and a quoted whitespace-only label that survives parsing — now each have an assertion. The fourth, `\`key\` must be a list`, could never run: parseOwners only ever builds a map for `options` and rejects nested keys under a list at parse time, so every people key reaches checkOwners as an array. The guard is removed rather than kept behind an unreachable-branch allowance. owners-file.test.mjs leaves TEST_HELPER_BASELINE; the ratchet otherwise fails on the unlowered entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Reviewed (correctness) — verified at 43cb3ef: 13/13 owners tests pass; the ratchet passes at head and fails exactly as described (0 dead ranges left, baseline allows 4) with the entry restored. No blocking findings.
One advisory on the "cannot execute" claim for the removed must be a list guard (scripts/owners-file.test.mjs:142): it is reachable, just not through a well-formed file. doc is a plain {} (:57), so a top-level __proto__: key makes doc[current] resolve to Object.prototype, and a nested approvers: x line writes through it (:90), after which doc.approvers is the string "x" and the people loop iterates its characters. Gate outcome is unchanged — the file is already rejected via duplicate top-level key (:68) — so this is not a regression worth a guard; the comment at :142 is just slightly stronger than the code. If anyone wants to close it properly later, Object.create(null) for doc is the one-line fix (pre-existing, out of scope here).
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
Burns
scripts/owners-file.test.mjsout of the branch-coverage ratchet (TEST_HELPER_BASELINEinscripts/coverage-floor.test.mjs, allowance 4 → entry deleted). No page or redirect is touched.Why these four and not arithmetic:
nested key … under \(none)`,OWNERS_ALIASESunparseable line, and`labels` has an empty entryare real error paths of the gate's own parser that nothing asserted. The labels one is only reachable through a *quoted* whitespace-only item (- " "), becausescalar` trims before it strips quotes — worth pinning, since an unquoted blank item is caught earlier by a different rule and a reader could reasonably assume the later rule is redundant.\key` must be a listcannot execute:parseOwnersbuilds a map only foroptionsand rejects nested keys under a list at parse time, so every people key reachescheckOwners` as an array. The ratchet exists precisely to flush such guards out, so it is removed instead of being carried as an allowance.The ratchet fails on the unlowered entry without the baseline change (
0 dead ranges left, baseline allows 4), and the three new assertions each fail if their branch is removed.Checks run locally
node --test scripts/*.test.mjs(792 pass, includingcoverage-floor.test.mjs)scripts/check-links.sh --external-warn(not run — no page/link change)scripts/check-links.test.sh(not run — no checker change)scripts/check-redirects.test.sh(not run — no redirect change)scripts/check-redirects.sh(not run — no redirect change)Checklist
git commit -s)Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88