Repository navigation
fix(session): add step-provenance lifecycle and call-identity tracking (#1177-#1185, #1190) - #1217
Merged
Merged
Conversation
#1177-#1185, #1190) - Introduce pure step-provenance engine (captureStepOrigin, compareStepOriginAndLanding, meaningfulStepStopDescription, buildSnapshotFrameKey, hasUnresolvedCallerUnwind, stepOutReenteredOriginFrame) so step answers compare origin vs landing stacks and StopSnapshot keys changedVariables on live caller identity rather than name|file|depth alone (#1180, #1182, #1183, #1184). - Revert session.state back to PAUSED when a DAP step request is rejected (DapResponseError) and surface adapter policy refusal guidance (DotnetAdapterPolicy.explainRequestFailure for 0x80004005) (#1179). - Report terminal step completions honestly (stepSessionEnded) and hoist exitCode onto terminal step tool responses (#1177). - Track session.inFlightStep across grace timeouts and surface step-specific pending copy on both step tools and wait_for_stop (#1178). - Surface pausedFrameNote on paused stop landings while deduplicating snapshot.note (#1181). - Add AdapterPolicy.describeStepInFilter for .NET (enableStepFiltering) and Rust (std/core/alloc step-avoid), split Dart repeatWhileOnOriginLine exhaustion copy by outcome (#1190), and update cross-language docs and changelog (#1185).
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Preserve observed stops during terminal races, scope delayed refusals to the current request, and keep provenance and variable diffs within a thread and resolved caller chain. Add regression coverage for late responses, terminal events, thread switches, unresolved unwinds, and step-filter policies.
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.
📋 Description
Introduces a unified, pure step-provenance and call-identity layer (
src/session/execution/step-provenance.ts) wired across step execution, stop landings, and stop snapshots to resolve a 10-issue cluster in stepping lifecycle, stop provenance, and variable-diff accuracy across adapters:#1177): Replaces"Step completed as session exited."with explicitErrorMessages.stepSessionEndedcopy ("The step did not pause. The program ran to completion (exit code N).", signal, or adapter exit) and hoistsexitCodeonto terminalstep_over/step_into/step_outtool responses.#1178): RewritesErrorMessages.stepStillRunningfor step semantics (instead ofcontinue_executionboilerplate), trackssession.inFlightStepacrosssession-storeandsession-manager-core, and surfaces the pending step inwait_for_stop(ErrorMessages.waitForStopPending).#1179): CatchesDapResponseErrorinExecutionController.executeStep, revertssession.stateback toPAUSED(clearinginFlightStepso subsequent inspection and execution tools continue working), and extendsDotnetAdapterPolicy.explainRequestFailureto translatenetcoredbg0x80004005top-levelstepOut/nextrefusals into actionable guidance.#1180): CapturesStepOriginfrom one unfilteredstackTraceread before sending any step command (reproducing#672keep-top-frame filtering in memory with zero extra DAP round trips) and compares it againstreason: 'step'landings viacompareStepOriginAndLanding— disclosingstep_outre-entry at the same depth (e.g.[11, 21].map(key)),step_outmulti-frame unwinds,step_intoadvancing without entering a callee, and disjoint stack switches (e.g. Ruby fiber switches), while normalizing COBOL(PERFORM ...)caller suffixes and allowingstep_intobar(foo())return-into-sibling transitions.#1181): SurfacesStackTraceResult.pausedFrameNoteondescribeStopLocationwhile paused (e.g. Python generatorStopIterationunwinds) and deduplicatessnapshot.noteviastripLandingNotesFromAnchorNote.#1182): Preserves non-boilerplate adapterstopped.descriptiontext onreason: 'step'stops (such as COBOLPERFORMstep summaries) while filtering generic echoes ("Paused","Paused on step","step").StopSnapshot.changedVariables(#1183): Replaces the shallowname|file|depthsnapshot diff key withbuildSnapshotFrameKey(incorporating the live caller chainname@file:line), plusstepOutReenteredOriginFrameandhasUnresolvedCallerUnwindguards (catching raw hex /@symbolcaller frames such as MinGWg++epilogue stops) so distinct invocations emit fulllocalsrather than false variable diffs.#1184): AddsAdapterPolicy.describeStepInFilterin@debugmcp/sharedand implements.NET(enableStepFiltering: truedefault +dapLaunchArgs: { enableStepFiltering: false }opt-out) and Rust (CodeLLDBdefaultstd/core/allocstep-avoid, includingDrop::drop) hints whenstep_intoenters no callee.#1185,#1190): Splits DartrepeatWhileOnOriginLineexhaustion messages by actual outcome (callerOnSameLine,locationUnknown, andstepRepeatedThenEnded), adds a cross-language stepping matrix todocs/KNOWN_ISSUES.mdanddocs/tool-reference.md, updates per-language guides, and addschangelog.d/1179-step-provenance.fixed.md.Fixes #1177
Fixes #1178
Fixes #1179
Fixes #1180
Fixes #1181
Fixes #1182
Fixes #1183
Fixes #1184
Fixes #1185
Fixes #1190
🔄 Type of Change
✅ Checklist
🧪 Testing
Verified the full Dev-Loop Gate, static PR checks, and live self-dogfooding through
mcp-debugger:pnpm run lint pnpm run typecheck:all pnpm run check:docs pnpm run changelog:check pnpm run clean && pnpm run build pnpm run test:unit pnpm run test:integration434test files passed (9,529passed,7skipped,0failed), including23new pure specs intests/core/unit/session/execution/step-provenance.test.tsand expanded coverage acrosssession-manager-dap.test.ts,stop-snapshot.test.ts,stop-location.test.ts,session-manager-wait-for-stop.test.ts,server-control-tools.test.ts,adapter-policy-dotnet.test.ts, anderror-messages.test.ts.47test files passed (243passed,1skipped,0failed).2026-07-28era) and verifiedstep_intono-entry notes,[11, 21].map(key)step_outre-entry disclosures + fullsnapshot.locals(instead of boguschangedVariables), and terminalstep_overexitCode: 0hoisting end-to-end.Test Configuration:
win32 x64)v24.14.1🔗 Related Issues
vitest/tsxemitting false stale-build notes)__vite_ssr_import_*synthetic bindings floodingget_local_variables/snapshot.locals).husky/pre-pushexceeding GitHub's 10-minute SSHgit-receive-packidle timeout on Windows)Reviewer: @debugmcp