Skip to content

feat(debugger,server): typed step-mode parsing, token policy, real timeline pause reasons (#1262, #1263, #1264)#1349

Merged
Timi16 merged 2 commits into
Timi16:mainfrom
chinelo002:feat/debugger-server-remote-1258-1262-1263-1264
May 28, 2026
Merged

feat(debugger,server): typed step-mode parsing, token policy, real timeline pause reasons (#1262, #1263, #1264)#1349
Timi16 merged 2 commits into
Timi16:mainfrom
chinelo002:feat/debugger-server-remote-1258-1262-1263-1264

Conversation

@chinelo002
Copy link
Copy Markdown
Contributor

@chinelo002 chinelo002 commented May 27, 2026

Summary

closes #1262
closes #1263
closes #1264

#1263 — typed step-mode parsing

parse_step_mode is now the single source of truth (-> Result<StepMode>) for both the run and staged flows. Unsupported modes return a clear error instead of silently defaulting to StepInto; aliases i/o/u/b are accepted. Tested (supported, aliases, error path).

#1262 — enforceable token policy

New --require-strong-token flag on the server: a token shorter than 16 chars warns by default, or is rejected at startup when the flag is set. Recommended length is documented in the flag help (≥16, ideally a random 32-byte token). Policy extracted into a testable evaluate_token_policy() with tests for missing / short / acceptable tokens in both modes. Server man page regenerated for the new flag.

#1264 — real pause reasons in exported timeline

Exported timeline pause points now carry the actual classified reason (breakpoint / step_boundary / panic / end_of_execution / user_interrupt) read from engine state, instead of a hardcoded "breakpoint". The reason field is already serialized and stays a plain string, so existing consumers remain tolerant of the value.

Test plan

  • cargo build --all-targets clean.
  • New step_and_token_tests pass (5/5); timeline/library tests unaffected.

Out of scope (follow-up)

  • Remote: add request ids to CLI-visible error messages #1258 (request ids in CLI-visible remote errors) is a larger change — plumbing the protocol message id through the remote error types — so it's left as a focused follow-up rather than bundled here.
  • Pre-existing repo CI note: the Code Coverage and Benchmark jobs fail on every fork PR here regardless of content (token-permission + a --noplot/lib-bench config bug on main); unrelated to this change.

closes #1258

…meline pause reasons (Timi16#1262, Timi16#1263, Timi16#1264)

closes Timi16#1262
closes Timi16#1263
closes Timi16#1264

Timi16#1263 — step-mode parsing is now a single typed function (parse_step_mode ->
Result<StepMode>) used by both the run and staged flows. Unsupported modes
return a clear error ("unsupported step mode '<x>'. Supported: into, over, out,
block.") instead of silently defaulting to StepInto; common aliases (i/o/u/b)
are accepted. Tests cover supported modes, aliases, and the error path.

Timi16#1262 — token-strength policy is now enforceable. New --require-strong-token
flag on the server: a token shorter than 16 chars warns by default, or is
rejected at startup when the flag is set. Recommended length documented in the
flag help (≥16, ideally a random 32-byte token). Logic extracted into a testable
evaluate_token_policy() with tests for missing / short / acceptable tokens under
both modes. (server man page regenerated for the new flag.)

Timi16#1264 — exported timeline pause points now carry the *actual* classified pause
reason (breakpoint / step_boundary / panic / end_of_execution / user_interrupt)
read from engine state, instead of a hardcoded "breakpoint". The reason field is
already serialized in the timeline JSON and remains a plain string, so existing
consumers stay tolerant.

Verified: cargo build --all-targets clean; new step_and_token_tests pass (5/5);
timeline/library tests unaffected.

Note: Timi16#1258 (request ids in CLI-visible remote errors) is a larger change —
plumbing the protocol message id through the remote error types — and is left as
a focused follow-up rather than bundled here.

Co-Authored-By: Claude <noreply@anthropic.com>
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@chinelo002 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…16#1258)

Server-side error responses now carry the client's per-connection request id
("… (request #N)"), so a CLI failure can be correlated with the matching server
log line. Applied centrally in send_request_once via a small, testable
tag_error_with_request_id helper, so every command's remote-error surface gets
the id without per-call-site changes. The id is the request counter (not an
internal server identifier) and is appended only when not already present.

Tests (request_id_tests): id appended to error responses, not duplicated on
re-tag, and non-error responses untouched.

Completes the batch — this PR now closes Timi16#1258, Timi16#1262, Timi16#1263, Timi16#1264.

Co-Authored-By: Claude <noreply@anthropic.com>
@Timi16 Timi16 merged commit 11b56d2 into Timi16:main May 28, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants