Repository navigation
🌱 test(checker): pin every default keyword to the excuse that declares it - #420
Conversation
The existing floor test iterates result.matches, so a default keyword that stops matching contributes zero iterations and passes silently. Assert each keyword detects its own excuse and that no excuse ships an empty keyword list. 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.
Read scoreExcuse in src/checker.ts:59-103 against this test: a keyword checked alone always hits its own excuse because containsKeyword(normalized, kwNorm) compares identical normalized strings (checker.ts:85), and the only way a non-blank keyword fails is normalizeText(kw) === '' (checker.ts:79), which is exactly the dead-keyword case the test should catch. The 15 pattern values in src/defaults.ts are unique, so matches.find(m => m.excuse?.pattern === excuse.pattern) is unambiguous. Looks correct to me; test-only, no shipped code touched.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Test Improvement
The nightly Stryker
restshard (run 40821869628, head 562f1c4) reportssrc/defaults.tsat 55.8% mutation score: 87 survivors, all of themStringLiteral → ""on individual keywords (84) orArrayDeclaration → []on a keyword list (3). Every one survives for the same reason: the existing "every default keyword scored in isolation yields confidence >= floor" test iteratesresult.matches, so a keyword that no longer matches anything contributes zero iterations and passes silently — only the aggregatescored > 0guards the whole table.This adds one test that pins each default keyword to the excuse that declares it (
check(kw)must include a match whoseexcuse.patternis that excuse's) and asserts no excuse ships an empty or blank keyword list. All 121 keywords already satisfy this onmain, so no shipped code changes.Verified locally by hand-applying three representative mutants (
'idle' → '','ci passes' → '',keywords: [] on "out of my scope / role"): each fails the new test by name while the rest of the suite stays green. 437 tests pass on the unmutated tree;npm run lintclean.No CHANGELOG entry: test-only change (
changelog-guardscopes to shippedsrc/**/*.ts).Filed by quality agent (ACMM L4/L6 — full mode)
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88