Skip to content

feat(#271): expectedContent breakpoint assertions + loud snapping (phase 1) - #278

Merged
debugmcpdev merged 1 commit into
mainfrom
feat/271-bp-addressing-phase1
Aug 8, 2026
Merged

feat(#271): expectedContent breakpoint assertions + loud snapping (phase 1)#278
debugmcpdev merged 1 commit into
mainfrom
feat/271-bp-addressing-phase1

Conversation

@debugmcpdev

@debugmcpdev debugmcpdev commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of #271 (agent-native breakpoint addressing): a checksum on breakpoint intent, and honest reporting when adapters move breakpoints.

  • expectedContent assertionset_breakpoint optionally 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.
  • Loud snapping — when the adapter binds to a different line than requested, the response reports requested line N, bound to line M: `<content>` in message/warning, with requestedLine alongside the bound line. Async relocations (breakpoint events) preserve requestedLine, so drift stays visible in list_breakpoints (snapped flag included).
  • DEBUG_MCP_BP_ADDRESSING flag (line | assert | content, default content) — 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). line mode 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.
  • Plumbing honesty fixes along the way: the session layer's setBreakpoint now 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; both setBreakpoint layers moved to options-object signatures.
  • Mock adapter snap simulation (snap / snap-event fixture 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

  • New unit suites: flag parsing/predicates, pure resolver (trim/CRLF/context formatting), expectedContent gating, loud snapping, schema/instructions gating, session-layer contract (33 new tests)
  • New e2e (mock adapter): expectedContent mismatch/match, live snap, async snap-event relocation via list_breakpoints
  • Full suites green: 2869 unit / 21 integration / 48 e2e smoke; lint clean; tsc --noEmit clean

🤖 Generated with Claude Code

…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

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.02913% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/skill-content.ts 92.85% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@debugmcpdev
debugmcpdev merged commit c222d9e into main Aug 8, 2026
10 checks passed
@debugmcpdev
debugmcpdev deleted the feat/271-bp-addressing-phase1 branch August 8, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants