Skip to content

Centralize stdin payload and control-prefix semantics#74

Merged
t-kalinowski merged 1 commit into
mainfrom
centralize-stdin-control-semantics
May 19, 2026
Merged

Centralize stdin payload and control-prefix semantics#74
t-kalinowski merged 1 commit into
mainfrom
centralize-stdin-control-semantics

Conversation

@t-kalinowski
Copy link
Copy Markdown
Member

@t-kalinowski t-kalinowski commented May 19, 2026

Summary

Centralizes stdin payload preparation, control-prefix splitting, and timeout bundle reuse classification in src/stdin_payload.rs.

This removes duplicated stdin/control logic from worker request handling and response finalization, so Ctrl-C/Ctrl-D semantics and worker stdin newline handling have one source of truth.

User-facing changes

None intended. The repl tool interface is unchanged; this PR preserves and codifies stdin/control edge-case behavior.

Internal changes

  • Added stdin_payload as the shared module for stdin payload construction, control-prefix splitting, and timeout bundle reuse classification.
  • Updated backend driver payload preparation to delegate to the centralized helper.
  • Updated server/response.rs to re-export and use the shared timeout reuse classifier.
  • Kept R-specific newline canonicalization as a backend text-preparation step while sharing payload construction across backends.
  • Added Zod protocol regressions for raw stdin byte preservation and Ctrl-D newline-tail handling.
  • Updated snapshots where test helpers now send exact bare Ctrl-C/Ctrl-D control inputs.

Testing

  • cargo +nightly fmt
  • cargo check
  • cargo build
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test

@t-kalinowski t-kalinowski force-pushed the centralize-stdin-control-semantics branch from 62ab341 to 747eafb Compare May 19, 2026 19:23
@t-kalinowski t-kalinowski merged commit 5fc510b into main May 19, 2026
5 checks passed
@t-kalinowski t-kalinowski deleted the centralize-stdin-control-semantics branch May 19, 2026 20:03
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.

1 participant