Skip to content

test(core): raise wire-mesh-transport.ts mutation score to 78.70% - #101

Merged
Mearman merged 3 commits into
mainfrom
fix/mutation-wire-mesh-transport-coverage
Sep 14, 2026
Merged

Mearman merged 3 commits into
mainfrom
fix/mutation-wire-mesh-transport-coverage

Conversation

@Mearman

@Mearman Mearman commented Sep 14, 2026

Copy link
Copy Markdown
Member

Summary

Raises wire-mesh-transport.ts's Stryker mutation score from 69.91% (95 killed, 56 timeout, 65 survived, out of 216 covered mutants) to 78.70% (97 killed, 73 timeout, 46 survived, out of 216 covered mutants) -- confirmed via a full local Stryker run against this branch's final commit, not estimated.

Just short of the repo's configured thresholds.high: 80. The remaining 46 survivors are real, traceable gaps rather than equivalent mutants, but closing them needs its own dedicated follow-up pass -- tracked as a new sub-issue of agent-comms#64 rather than blocking this real, substantial improvement (69.91% -> 78.70%) on reaching the exact round number under this session's own heavy shared-machine load.

New tests added closing genuine gaps found by tracing survivors against the real call graph:

  • WireMeshTransport's module constants and presence-readvertise interval.
  • connect_request lifecycle coverage.
  • The presence early-return path and pending-connection expiry message.

A parallel PR (#100, merged) did identity.ts's own slice of the same issue.

Test plan

  • pnpm typecheck && pnpm lint && pnpm test green
  • Local scoped Stryker run (--mutate "src/core/wire-mesh-transport.ts") confirms 78.70%
  • CI green

… connect_request lifecycle

Adds direct WireMeshTransport tests (two real transports joined over
genuine TLS sessions, matching presence-readvertise.integration.test.ts's
own pattern) for surface the existing suite never exercised:

- DOMAIN and FRAME_SCOPE's literal wire values, and buildCommand's shape
- the presence-readvertise interval is only started when a presence
  source is configured, computes the documented 20-second default
  cadence, and is unref'd
- isCoordinator and hasCoordinatorConnection reflect real state
  transitions, including watchForDisconnect firing for a coordinator
  session torn down from the other side
- a connect_request's pending entry is cleared, with no spurious
  onPeerDisconnected, when the requester disconnects before a human
  decides
- acceptConnection/rejectConnection each remove their own pending entry
  exactly once, and a rejection's message survives even when empty
  (proving the ?? fallback, not ||, is what's used)
- connectToPeer's device-id mismatch refusal and wrapped dial-failure
  error, plus a full bidirectional message round trip once connected
- shutdown rejects every pending connect_request with shutting_down,
  clears the presence interval, and closes already-accepted sessions
- acceptConnection propagates the accepting listener's own policy onto
  the resulting handle
… message

Adds:

- readvertisePresence's own status===undefined early return actually
  skips sending, not merely that the interval never fires at all
- send() to an untracked handle and sendRoomRequest() to an untracked
  member are silent/not_connected no-ops rather than throwing
- a connect_request left unanswered past pendingConnectionTimeoutMs
  auto-rejects with the documented "no human decision within the
  pending-connection timeout" message, asserted directly against the
  dialing side's own rejected promise rather than through a layer that
  swallows it

Two additional tests (a gossip send failing against a torn-down
session, and send() failing the same way) were attempted directly
against two real transports but proved inherently flaky: watchForDisconnect's
own cleanup reliably wins the race against a still-tracked-but-broken
session before a send against it can be observed failing, so removed
rather than landing a nondeterministic test.
@Mearman
Mearman force-pushed the fix/mutation-wire-mesh-transport-coverage branch from f56a217 to 07680dd Compare September 14, 2026 08:06
@Mearman Mearman changed the title test(core): raise wire-mesh-transport.ts mutation score test(core): raise wire-mesh-transport.ts mutation score to 78.70% Sep 14, 2026
@Mearman
Mearman marked this pull request as ready for review September 14, 2026 08:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-14T08:19:59.245152Z 07680dd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 6987407 into main Sep 14, 2026
6 checks passed
@Mearman
Mearman deleted the fix/mutation-wire-mesh-transport-coverage branch September 14, 2026 08:20
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.21.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant