Skip to content

refactor(tool-runtime): consolidate empty execution stream projection - #1246

Merged
yyjeqhc merged 1 commit into
mainfrom
refactor/execution-stream-projection-20261021
Oct 21, 2026
Merged

yyjeqhc merged 1 commit into
mainfrom
refactor/execution-stream-projection-20261021

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Four execution projection paths independently maintained the same rules for omitting empty stdout/stderr tails, zero line counts and false truncation flags. A private sparsify_empty_execution_streams function now owns those exact rules for terminal validation, pending validation, structured execution and shell success.

The caller-specific terminal proofs, pending checks, failure handling, recovery metadata and ordering remain in place. Null/malformed values, nonempty output and output-loss evidence are preserved. There are no schema, authority, persistence, continuation or tool-surface changes, additional allocations, generics or dispatch abstractions.

This is deliberately a small structural cleanup: 35 production Rust lines removed, with four independently maintained implementations reduced to one. Its benefit is preventing stream-projection drift; it does not attempt to unify semantically different execution responses.

Metric Before After Net change
ToolRuntime production Rust (estimated separation) 92,729 92,694 -35
ToolRuntime test Rust (including estimated inline tests) 164,632 164,632 0
ToolRuntime Rust total 257,361 257,326 -35
Repository Git-tracked Rust total 928,714 928,679 -35

Counts use exact PR merge base bc63e43505f0162153950bc9ee43c3f6458b4294, physical source lines including blanks/comments, and all tracked .rs files. Test separation includes 145,402 lines in dedicated test files plus an estimated 19,230 lines in explicit cfg(test)/cfg(all(test, ...)) item spans. Partition counts are estimates; totals and deltas are exact. This branch is independent of #1245 and edits a different file.

Validation:

  • cargo test --locked -p webcodex --lib tool_runtime::result_projection: 25 passed, 0 failed, 0 ignored, covering execution/pending/failure projections, shell exceptional-state preservation and validation output schemas.
  • cargo fmt --all -- --check and git diff --check: passed.
  • Expanding the four helper calls in a temporary source comparison yields the exact original Rust token stream, excluding comments/whitespace. Existing tests are unchanged.

Risk is limited to the final model projection; canonical evidence recording and execution are untouched. Windows/Linux and optional feature configurations were not run locally. No deployment, release, service restart or merge is included.

@yyjeqhc
yyjeqhc merged commit 20ef779 into main Oct 21, 2026
18 checks passed
@yyjeqhc
yyjeqhc deleted the refactor/execution-stream-projection-20261021 branch October 21, 2026 11:17
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