Repository navigation
Description
Finding
src/issueComment/approve.ts:79 submits the legacy (no-OWNERS) /approve review with event: 'APPROVE', comments: []. Stryker's ArrayDeclaration mutant replaces that list with a non-empty placeholder and survives: both tests that observe the review request (__tests__/issueCommentTest/approve.test.ts lines 122 and 349) assert only toMatchObject({ event: 'APPROVE' }), so a review that would carry a stray inline comment — a request GitHub answers with 422 because the entries lack path/body — passes the suite.
By the repository's own rule in docs/contributing.md ("Add a test when the mutant changes an observable effect (a request made or not made …)") this one is a finding; it is the only behavioural survivor of the run below.
(The first relay of this finding was folded into the unrelated #719 as a comment; this is the same finding on its own issue.)
Evidence
- Unit:
npx vitest run --coverageat 8ff4554 (local): 236 files / 2954 tests, statements 100 % (3077/3077), branches 99.89 % (1903/1905 — the two documented v8 await artefacts), lines 100 %. Not a line-coverage gap. - Mutation (regression-risk re-probe):
git diff --stat 9acb046..8ff4554shows 213 insertions / 213 deletions across the dispatcher/command cluster after its only full Stryker pass at 9acb046, and the later re-probes at 9aa12b8 did not revisit it. Run at 8ff4554, local, Stryker 10 on the repository's default mutation base (perTest, concurrency 12, a probe vitest config that leaves out the suites readingsrc/as text and the bundle harness), mutatingsrc/cronJobs/lgtm.ts,src/issueComment/approve.ts,src/issueComment/trigger.ts,src/issueComment/handleIssueComment.ts,src/issueComment/meow.ts,src/utils/command.ts,src/utils/comments.ts,src/utils/events.ts,src/utils/pulls.ts,src/pullReq/*.ts,src/issues/handleIssues.ts,src/run.ts,src/main.ts: 1171 mutants, 1043 killed, 59 timed out, 69 survived, 94.11 %, 52 min 29 s. - Survivor triage at exact column spans (68 equivalent or text-only):
- 22 log/warning/error-message strings (
lgtm.ts×4,approve.ts×5,meow.ts×6,handlePullReq.ts×3,onPrLgtm.ts×1,comments.ts×1,trigger.ts×2) —meow.ts's image-validation checks (:115,:118,:120,:130) all fall into the samecatchthat posts "The cat API is unavailable right now.", so only the warning text differs. - 17 payload
?.chains (comment?.body,comment?.user,issue?.pull_request,issue?.user,pull_request?.head,pull?.head,comment?.id) on fields already null-checked before the line, plus their?? ''placeholders. trigger.ts:37/41run.status === 'completed' &&→true: an in-progress run hasconclusion: null, so the conclusion test already rejects it.:238current === undefined ||: a named run never equalsundefined.:252count++→count--: the count is only compared with0, and every path that yields0yields it either way.:217'reviewers'→'': the pull-request owner check treats any non-'approvers'role as reviewers-or-approvers, and the type forbids the value.handlePullReq.ts:34/\\s+/→/\\s/(empty entries are filtered),:38runConfig.length === 0early return (Promise.all([])is a no-op),{ required: false }→{}(the default).command.ts:116/123inIndentedCodewrites: the flag is only read together withafterBlockBoundary, which is true on every path where it matters.comments.ts:77/\\[bot\\]$/→ unanchored: a login cannot contain[bot]elsewhere.onPrLgtm.ts:23[]initialiser: overwritten or thrown over before it is read.main.ts:5setPlatform(actionsPlatform()):main.tshas no unit test by design (bundle harness runs it; see [quality] src/main.ts entry point has no unit test (0% statements) #211).
- 22 log/warning/error-message strings (
- Gate check:
src/issueComment/approve.tsis in neither the local nor the scheduled mutation set, so the nightlymutationjob cannot catch a regression here; mutation gate scope is already tracked on [quality] docs/contributing.md phantom-branch section still lists close.ts:37 and reopen.ts:34 (and 1815/1819), which #642 removed #679, so this issue asks only for the test.
Recommendation
In __tests__/issueCommentTest/approve.test.ts, extend the two toMatchObject({ event: 'APPROVE' }) assertions on the POST /pulls/1/reviews body to { event: 'APPROVE', comments: [] }, so a review that would carry inline comments fails the suite.
- both legacy-path APPROVE review assertions pin
comments: []
Priority
- Impact: low (a regression here would surface as a 422 in production, not as a wrong merge decision)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 8ff4554
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity