Skip to content

🌱 test(checker): pin every default keyword to the excuse that declares it - #420

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-default-keywords-self-detect
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-default-keywords-self-detect

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

The nightly Stryker rest shard (run 40821869628, head 562f1c4) reports src/defaults.ts at 55.8% mutation score: 87 survivors, all of them StringLiteral → "" on individual keywords (84) or ArrayDeclaration → [] on a keyword list (3). Every one survives for the same reason: the existing "every default keyword scored in isolation yields confidence >= floor" test iterates result.matches, so a keyword that no longer matches anything contributes zero iterations and passes silently — only the aggregate scored > 0 guards the whole table.

This adds one test that pins each default keyword to the excuse that declares it (check(kw) must include a match whose excuse.pattern is that excuse's) and asserts no excuse ships an empty or blank keyword list. All 121 keywords already satisfy this on main, 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 lint clean.

No CHANGELOG entry: test-only change (changelog-guard scopes to shipped src/**/*.ts).


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 35f3735 into main Oct 30, 2026
16 of 17 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-default-keywords-self-detect branch October 30, 2026 14:14
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#420ee7c17a` sha256:ff39d2f9328c1edf99e6a18825c1eafa1947e6ab377085aa27e24eaa23218c32 — download from the dashboard or `hivectl review evidence #420`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants