Skip to content

test(app): pin that a seen-only delivery store logs no store error on the done and forget arms - #663

Merged
jeefy merged 1 commit into
mainfrom
quality/test-webhook-store-optional-outcome
Nov 1, 2026
Merged

jeefy merged 1 commit into
mainfrom
quality/test-webhook-store-optional-outcome

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

receiveWebhook (src/adapters/app/webhook.ts:97,105) settles a claimed delivery through store.done?.(id) and store.forget?.(id), which DeliveryStore declares optional. The existing test "handles a delivery with a store that records neither outcome" asserted only that handled resolved, so a Stryker probe over src/adapters/app/{webhook,dedupe,scope}.ts + src/utils/{octokit,base64,comments}.ts at a192ee1 (187 mutants, 7 survived) showed both OptionalChaining mutants surviving: with the ?. dropped, settle() catches the TypeError and emits delivery store: done failed: store.done is not a function at error level on every successful delivery, and the test still passed.

This PR changes only __tests__/adapters/app/webhook.test.ts: that test now installs a recording sink, drives the done arm (accepted delivery) and the forget arm (unusable installation → 400) against a seen-only store, and asserts no error-level line is logged. Verified locally: 19/19 pass on main's source; applying either mutant fails the test with the exact spurious error line.

The other five survivors were read and judged equivalent, so no test was added for them: new Response(…, { status: 200 }) → {} ×2 (200 is Response's default), comments.ts:57 (comment.body ?? '') → filler string (the marker is never a substring of it), comments.ts:58 debug text (unasserted log text, same class as the documented hold.ts:71 survivor), comments.ts:77 /\[bot\]$/ → /\[bot\]/ (a GitHub login carries [bot] only as a suffix). These files are outside the nightly Stryker set by design (stryker.config.mjs: bounded merge-decision set, --mutate for anything else), so no survivor-table entry in docs/contributing.md applies.

Disjoint from held #658–#662: none of them touch webhook.test.ts or webhook.ts.

Related Issue

None — found by a local mutation probe this session; the fix is one test, so no issue was opened for it.


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

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

… the done and forget arms

receiveWebhook settles a claimed delivery through store.done?.() and
store.forget?.(), which DeliveryStore declares optional. The test that
named this case asserted only that the handled promise resolved, so
dropping either optional call (Stryker OptionalChaining survivors at
webhook.ts:97 and :105) still passed: settle() catches the TypeError
and emits 'delivery store: done failed: store.done is not a function'
at error level on every successful delivery. The test now drives both
arms with a seen-only store and asserts the sink carries no error line.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 November 1, 2026 20:01
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 1, 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

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

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

@jeefy jeefy 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 Nov 1, 2026
@jeefy
jeefy merged commit 19d23da into main Nov 1, 2026
16 checks passed
@jeefy
jeefy deleted the quality/test-webhook-store-optional-outcome branch November 1, 2026 20:10
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.

1 participant