Skip to content

🌱 test(checker): pin normalisation and scoring rules the symmetric stemmer hides - #412

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-checker-mutants
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-checker-mutants

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds a describe('normalisation and scoring rules') block under check and two generatePromptBlock cases in src/checker.test.ts.

Why

The nightly advisory mutation run on main (562f1c4, run 40821869628, rest shard) leaves src/checker.ts at 83.13% with 27 surviving mutants. The behaviour-bearing ones are the stemmer's doubled-consonant / silent-e guards (L33, L35), normalizeText's curly-double-quote and whitespace-run folding (L40), the filler-gap collapse in reduceText (L47), regex-metacharacter escaping in containsKeyword (L55), filler-only hit counting (L85), the matchedText tie-break (L86), the confidence sort (L116) and the fixed instruction text in generatePromptBlock (L138, L147–L161).

They survive because text and keyword go through the same stemmer: a rule that maps both sides to the same wrong stem still matches. Each new case picks a pair where the two sides take different paths (committed → committ → commit vs. keyword commit; ad vs. add; us vs. use), or where only one side is normalised (ASCII "done" pattern vs. curly text, out \t\n of scope, fix the bug later vs. keyword fix bug later, e.g. vs. eg), and asserts the outcome exactly.

Re-running Stryker on src/checker.ts alone with this branch (running only dist/checker.test.js): 93.12% (149 killed, 11 survived). Of the 11, five (isStopWord / STOP_WORDS, L10–16) are killed by the cli/learner suites in the full nightly run, and the remaining six are equivalent mutants: the ^ anchors on L22/L23 (the stemmer is only ever applied to a whole [a-z]+ token), the .trim() in normalizeText (every caller re-trims or matches with lookarounds), the unused fields of the matched: false result (L92) and the options?.onEvent guard (L118, the mutant's TypeError is swallowed by the inner try).

No shipped code changes; test-only, so no CHANGELOG.md entry.


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

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

…emmer hides

The nightly advisory Stryker run leaves 27 mutants alive in checker.ts.
Because text and keyword are reduced by the same stemmer, most rules only
become observable where the two sides take different paths to a stem
(commit/committed, add/ad, use/us), or where normalisation differs between
pattern and text (curly double quotes, whitespace runs, filler-word gaps,
regex metacharacters in a keyword). Each new case takes one such pair and
asserts the outcome, plus the tie-break for matchedText, per-keyword hit
counting for filler-only keywords, sort order across excuses, and the
exact instruction text generatePromptBlock emits around the table.

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 29, 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 clubanderson 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 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 29, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 3f40212 into main Oct 29, 2026
16 of 17 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-checker-mutants branch October 29, 2026 06:01
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#412f7cd200` sha256:63354059be0134124d9c1e531ea5a2fa962b3d8cb0d57d07838a52a4f0beac50 — download from the dashboard or `hivectl review evidence #412`.

@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 29, 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants