Skip to content

perf(model): converge late execution success projection - #765

Merged
yyjeqhc merged 5 commits into
mainfrom
model/late-execution-shell-compaction
Sep 28, 2026
Merged

yyjeqhc merged 5 commits into
mainfrom
model/late-execution-shell-compaction

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • move existing process/script/Skill/structured-validation success compaction to the shared late model-facing projection boundary
  • keep Workflow Session, ActionAudit and model-ergonomics consumers on canonical pre-projection execution truth
  • compact proven synchronous terminal run_shell success while retaining runtime-selected shell/cwd/SSH context and meaningful output
  • keep pending, failure, timeout, outcome-unknown, Job/recovery and recovered-terminal paths rich
  • tighten the sparse run_shell output schema so impossible lifecycle/recovery fragments cannot appear in the sparse success branch

Projection convergence

The existing success shapes for:

  • run_process
  • run_script
  • run_skill_resource
  • project_validate
  • cargo_fmt
  • cargo_check
  • cargo_test
  • go_test

remain model-facing equivalent. Their compaction now runs only after canonical Session/evidence consumers and pre-projection telemetry/audit capture.

Normal Job handoff remains:

{
  "execution_state": "pending",
  "continuation": { "... exact existing fallback continuation ..." }
}

No retry/redispatch/authority/Runner protocol semantics change.

run_shell terminal success

Compaction requires proven:

  • outer success
  • execution_state=completed
  • command started + completed + ok
  • exit_code=0
  • trustworthy terminal
  • promoted_to_job=false
  • no Job/observation/continuation/recovery ambiguity
  • canonical executor=agent and execution_source=run_shell

The sparse result removes lifecycle/Job/timing bookkeeping but retains:

  • command_summary
  • cwd
  • selected shell
  • ssh_resource, when any
  • non-empty stdout/stderr
  • truncation/loss evidence
  • expectation / input-normalization / context/control/collaboration sidecars

Representative real fixture:

run_shell terminal success: 851 -> 431 bytes

Recovered terminal snapshots remain rich.

Audit / telemetry

Late projection no longer forces ActionAudit/model ergonomics to infer execution state from an already-sparse model result.

The review follow-up 8fafd7b9 review(model): preserve compact execution evidence additionally keeps privacy-safe validation evidence that ActionAudit had before this refactor:

  • warning/error counts
  • test detected/run/pass/fail/zero-test counts
  • explicit require-tests / no-run facts
  • bounded test-count assertion verdict
  • source freshness classification
  • bounded failure/recovery classification

It never persists raw command/script/stdout/stderr, diagnostic bodies, or source-fence identity.

Validation

Reviewed on special after rebase onto current origin/main 7301186b98527cb4ebc0191f6033474e9abf7c20.

  • cargo test -p webcodex-tool-runtime-contracts canonical_execution_audit_projection_tests -- --nocapture — 3 passed
  • cargo test -p webcodex execution_projection -- --nocapture — 6 passed
  • cargo test -p webcodex-tool-contracts — 250 passed
  • cargo test -p webcodex long_run_shell_fast_terminal_returns_ordinary_result_without_visible_job -- --nocapture — 1 passed, 851 -> 431 bytes
  • cargo test -p webcodex run_shell_recovered_terminal_snapshot_stays_rich_after_projection -- --nocapture — 1 passed
  • cargo test -p webcodex api_execution_compaction_preserves_canonical_action_audit_and_telemetry -- --nocapture — 1 passed
  • cargo test -p webcodex http_mcp_execution_compaction_keeps_sparse_serialization -- --nocapture — 1 passed
  • cargo fmt --all -- --check
  • git diff --check

Commits

  1. a8ae875f refactor(model): converge execution success projection
  2. cc0a9ea5 perf(model): compact run_shell terminal success
  3. 4421f822 fix(model): tighten run_shell sparse schema
  4. 8fafd7b9 review(model): preserve compact execution evidence

Validation-success evidence deduplication is intentionally left for a focused follow-up: it changes semantic proof presentation (test counts, zero-test assertions, diagnostics and source-state evidence) rather than execution lifecycle projection.

@yyjeqhc
yyjeqhc merged commit 2532c29 into main Sep 28, 2026
13 checks passed
@yyjeqhc
yyjeqhc deleted the model/late-execution-shell-compaction branch September 28, 2026 15:50
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