feat(#271): expectedContent breakpoint assertions + loud snapping (phase 1) - #278
Merged
Conversation
…ind DEBUG_MCP_BP_ADDRESSING Phase 1 of agent-native breakpoint addressing: - set_breakpoint expectedContent: hard-error before setting when the target line's trimmed content doesn't match; error carries expected/actual plus surrounding context lines - Loud snapping: adapter-moved breakpoints report 'requested line N, bound to line M' in message/warning with requestedLine alongside line; async relocations surface via list_breakpoints (requestedLine preserved) - DEBUG_MCP_BP_ADDRESSING=line|assert|content gates runtime behavior, tool schema, server instructions, and workflow prompt together (default: content); line mode stays byte-identical to pre-#271 behavior - setBreakpoint refactored to an options object; the session layer returns {breakpoint, warning} so live-sync failures reach the tool response - LineReader cache is mtime-validated (stale content would break assertions after an edit); new getFileLines - Mock adapter simulates snapping (snap / snap-event fixtures) for hermetic e2e coverage Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 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.
Summary
Phase 1 of #271 (agent-native breakpoint addressing): a checksum on breakpoint intent, and honest reporting when adapters move breakpoints.
expectedContentassertion —set_breakpointoptionally takes the exact text expected on the target line (whitespace-trimmed). On mismatch the breakpoint is not set; the error shows expected vs actual plus the surrounding lines with a>marker, so an off-by-one line number becomes an immediate, self-explanatory failure instead of confusing session behavior later.requested line N, bound to line M: `<content>`inmessage/warning, withrequestedLinealongside the boundline. Async relocations (breakpoint events) preserverequestedLine, so drift stays visible inlist_breakpoints(snappedflag included).DEBUG_MCP_BP_ADDRESSINGflag (line|assert|content, defaultcontent) — gates runtime behavior, the tool schema, the server instructions, and the workflow prompt together, so a restricted server exposes no trace of the features (params sent anyway are hard-errored naming the env value).linemode is byte-identical to pre-[FEATURE] Agent-native breakpoint addressing: expectedContent assertion, statement anchors, function breakpoints #271 behavior — this enables controlled comparisons of agent debugging behavior across tool contracts.setBreakpointnow returns{ breakpoint, warning }so live-sync failures reach the tool response (previously discarded);LineReader's cache is mtime-validated so mid-session edits are seen immediately; bothsetBreakpointlayers moved to options-object signatures.snap/snap-eventfixture names) for hermetic e2e coverage of both the synchronous and event-driven snap paths.Phase 2 (statement anchors + restart re-resolution) follows in a separate PR.
Testing
list_breakpointstsc --noEmitclean🤖 Generated with Claude Code