refactor(cli): isolate exec lifecycle and failure contracts#1618
Merged
Conversation
limityan
force-pushed
the
yanzhn/cli-exec-lifecycle
branch
2 times, most recently
from
July 18, 2026 13:20
bf1ba32 to
f5d63e4
Compare
Split the exec owner into focused private modules, defer structured terminal publication until settlement and Patch delivery complete, and add deterministic provider, cancellation, resize, and process-timeout contracts.
limityan
force-pushed
the
yanzhn/cli-exec-lifecycle
branch
from
July 18, 2026 13:28
f5d63e4 to
82ffa23
Compare
limityan
marked this pull request as ready for review
July 18, 2026 14:02
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.
Summary
modes::execas the stable facade while separating lifecycle/event settlement, Patch capture/write, and unit contracts into private owner filesProduct and Architecture Boundary
Type: refactor / reliability / test / CI / docs
Production ownership remains inside the existing CLI Exec mode. This PR does not add a user-facing feature, public DTO/event schema, generic executor, timeout/retry option, dependency, extension capability, HarmonyOS work, or Core/Runtime owner migration. It does not change GUI, TUI Chat, Server, Remote, or shared runtime behavior.
The existing
text,json, andstream-jsonsurfaces remain. The behavioral correction is limited to finalization: automation now receives one authoritative terminal and one stableBITFUN_EXITclassification after all requested delivery work is known.Behavior and Risk Controls
Normal execution does not add provider requests, retries, polling, or a second event representation. The longer window is only entered after cancellation is requested; its worst-case latency increases from 1 to 5 seconds to preserve terminal and settlement consistency.
Verification
cargo +1.95.0 fmt --all --check: passedgit diff --check: passednode scripts/check-core-boundaries.mjs: passedcargo +1.95.0 check --locked --workspace: passed (with the same emptysrc/mobile-web/distprerequisite used by CI)cargo +1.95.0 check --locked -p bitfun-cli: passedcargo +1.95.0 test --locked -p bitfun-cli -- --nocapture: passed (234 unit tests and all CLI integration targets, including 14 Exec contracts and 3 PTY/ConPTY process contracts)Reviewer Notes
Checklist