Skip to content

test(utils): pin matchesLabelPattern's suffix/overlap arm and commandLines' fence-close boundary - #514

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-mutation-survivors-utils
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-mutation-survivors-utils

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/utils/labelMatch.test.ts, __tests__/utils/command.test.ts. No src/, dist/, docs/ or eslint.config.mjs change — disjoint from #510 (src/utils/auth.ts, dist/index.js), #511 (docs/contributing.md) and #512 (__tests__/label/remove.test.ts, eslint.config.mjs).

A single-operator mutation probe over seven src/utils modules on main @ 88241f4 (details on #513) left two mutants alive against their full vitest related set:

  • src/utils/labelMatch.ts:23 || → && — 62 files / 1213 tests pass. Adds to the negative table *-rebase vs needs-approve and needs-*-rebase vs needs-rebase-now (matching prefix, wrong suffix), plus an overlap case: do-not-merge/*/hold must not match do-not-merge/hold but does match do-not-merge//hold. matchesLabelPattern backs mergeGate.ts:20,25 (tide.labels / tide.missing_labels).
  • src/utils/command.ts:92 afterBlockBoundary = true → false — 54 files / 1094 tests pass. Adds: an indented /approve directly after a closing ``` or ~~~ fence (no blank line) is hidden, the unindented control is still seen. The body starts with a visible text line so the case depends on the fence-close reset itself, not on the initial state.

Verification (this branch, local)

  • npx vitest run __tests__/utils/labelMatch.test.ts __tests__/utils/command.test.ts: 91 passed
  • same, with the labelMatch.ts:23 mutant applied: 3 failed; with the command.ts:92 mutant applied: 1 failed (mutants reverted, not committed)
  • npx eslint on both files: clean

Related Issue

Fixes #513


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

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

…Lines' fence-close boundary

Two single-operator mutants of src/utils survived the full related test
set: flipping the || at labelMatch.ts:23 to && (62 files, 1213 tests)
and the afterBlockBoundary reset at command.ts:92 to false (54 files,
1094 tests). Neither arm had a case that reaches it.

- labelMatch: a matching prefix with a mismatched suffix, and anchored
  ends that would have to share characters (do-not-merge/*/hold must
  not match do-not-merge/hold).
- command: an indented line directly after a closing fence is indented
  code, as the comment at command.ts:104 already says.

Fixes #513

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 19, 2026 02:18
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 19, 2026
@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. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

@mrbobbytables mrbobbytables left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.

The negative wildcard cases distinguish suffix mismatch/overlap, and fence-close cases distinguish indented hidden commands from visible commands. Changes are isolated to assertions.

Verified successful build-test, e2e-coverage and DCO results on head 9f43b62. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.

@mrbobbytables mrbobbytables added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind labels Oct 21, 2026
@mrbobbytables
mrbobbytables merged commit d1c3680 into main Oct 21, 2026
18 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-mutation-survivors-utils branch October 26, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] mutation survivors in src/utils: labelMatch.ts:23 suffix/overlap arm and command.ts:92 fence-close boundary are not pinned by any test

1 participant