test(core): detach handler, evaluate default-frame, adoption edges + threshold ratchet - #417
Merged
Conversation
…on, and child-session adoption edges - server: detach_from_process dispatch was entirely untested — success payload, failure propagation, session-state McpError mapping to a stopped payload, rethrow of unrelated errors, missing sessionId - session-manager: evaluateExpression's default-frame resolution — the not-paused guard, missing thread id, top-frame anchoring via stackTrace, empty stacks, and stack-trace failures - child-session-manager: the child-safe policy (grandchild reverse-start suppression and passthrough), adoption catch arms for failing configuration requests, post-attach initialized replay (new mock knob), the js-debug threadId-0 double-pause quirk, threads-failure tolerance, death-latch re-entry, and shutdown surviving a throwing child Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Measured after the sprint: statements 92.9, branches 83.0 (was 90.0/80.4 against a lone statements:80 threshold — 10 points of dead slack that guarded nothing). Margins absorb platform-specific branches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes out the coverage-expansion sprint (after the source-map-derive rewrite and the adapter pack). Three cohesive core gaps plus the threshold ratchet.
server.ts: the
detach_from_processhandler had zero testsThe entire handler body (~40 lines, the largest single uncovered block in server.ts) was untested. Added dispatch tests: success payload shape,
success:falsepropagation,terminateProcessdefaulting, the session-stateMcpErrorcatch mapping to{success:false, state:'stopped'}, rethrow of unrelated errors, and the missing-sessionId guard.session-manager:
evaluateExpressiondefault-frame resolutionThe dense uncovered cluster was the frameId-omitted path. New suite pins: the not-paused guard, missing current-thread failure, top-frame anchoring via a
stackTracerequest (asserting the evaluate call carries the derived frameId), empty-stack failure, and stack-trace-rejection wrapping.child-session-manager: adoption edges
handleReverseRequestwrapper that acknowledges-and-stops grandchildstartDebuggingrequests while passing unhandled requests through — asserted via the policy the mocked child captures.setExceptionBreakpoints/setBreakpoints/configurationDonedon't abort adoption.handlePostAttachInit: a post-attachinitializedreplays stored breakpoints (new mock knob, mirroringemitStoppedAfterAttach).threadId === 0double-pause quirk;threads-failure tolerance; death-latch re-entrancy (error followed by close); shutdown surviving a child whose ownshutdown()throws.Threshold ratchet
vitest.config.tscoverage thresholds move fromstatements: 80(10+ points of dead slack — nothing was regression-guarded) tostatements: 90, branches: 80, against measured post-sprint levels of 92.9 / 83.0 (margins absorb platform-specific branches).Sprint result (full coverage run on this branch)
Every sprint target is off the deficit leaderboard: source-map-derive (was #1 at 8%) now 98.5%; the mock adapter (65%) and the go/rust/python adapters and child-session-manager no longer chart. The remaining top entries are the deliberately out-of-scope scatter (server.ts 91%, session-manager-operations 93%, dap-proxy-worker 91%).
Full
npm testgreen,npm run lintclean.🤖 Generated with Claude Code