Skip to content

Move lifecycle routing to executor arguments - #1256

Merged
Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/rust-sdk-operation-cli
Sep 27, 2026
Merged

Gudge (MGudgin) merged 1 commit into
mainfrom
user/gudge/rust-sdk-operation-cli

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

This PR moves state-aware lifecycle routing out of direct executor JSON and
into explicit wxc-exec command-line arguments. Raw exact SDK and FFI APIs
continue to use their registered phase-bearing JSON contracts.

Details

  • Add --operation provision|start|exec|stop|deprovision to wxc-exec.
  • Add --sandbox-id for non-provision lifecycle operations.
  • Preserve exact phase-specific validation by overlaying CLI routing onto a
    source-preserving temporary document before normalization.
  • Reject caller-supplied phase and sandboxId fields instead of silently
    overriding command-line routing.
  • Keep the Node lifecycle SDK on its current mxc_ffi transport and document
    the direct executor CLI as a separate ingress path.
  • Update executor E2E helpers to pass routing through CLI arguments.

Tests

  • Rust formatting passed.
  • All-target/all-feature check and clippy passed for affected Rust crates.
  • wxc_common tests passed (910 unit tests plus additional suites).
  • wxc tests passed (64).
  • mxc_engine tests passed (150).
  • mxc-sdk tests passed (54, with 4 backend-dependent ignores).
  • State-aware executor E2E suites passed, including the prior CI failure.
  • macOS-target lint passed with warnings denied.
  • git diff --check
Microsoft Reviewers: Open in CodeFlow

@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 23, 2026 22:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@MGudgin
Gudge (MGudgin) dismissed Jeff Whiteside (jsidewhite)’s stale review September 24, 2026 15:46

The merge-base changed after approval.

@MGudgin
Gudge (MGudgin) requested review from a team and a balanced review from Copilot September 24, 2026 15:46
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from e959d2c to bb436f7 Compare September 24, 2026 15:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Existing tests now panic, early lifecycle decode errors violate the response protocol, and the worked SDK example documents the wrong wire shape.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Moves state-aware lifecycle routing from executor JSON into explicit CLI arguments while preserving exact contract parsing.

Changes:

  • Adds --operation and --sandbox-id lifecycle arguments.
  • Injects CLI routing into source-preserving JSON before exact parsing.
  • Updates executor tests and lifecycle documentation.
File Description
src/​testing/​wxc_e2e_tests/​src/​lib.rs Converts lifecycle test requests to CLI routing.
src/​core/​wxc/​src/​main.rs Adds lifecycle CLI arguments and dispatch.
src/​core/​wxc_common/​src/​splice.rs Splices routing fields into JSON.
src/​core/​wxc_common/​src/​config_parser.rs Parses CLI-routed lifecycle requests through exact contracts.
docs/​state-aware-lifecycle/​mxc-state-aware-sandbox-api.md Documents the executor transport.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/core/wxc/src/main.rs Resolved
Comment thread src/testing/wxc_e2e_tests/src/lib.rs Resolved
Copilot AI review requested due to automatic review settings September 24, 2026 17:02
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from bb436f7 to e8eaab9 Compare September 24, 2026 17:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Lifecycle parse errors can corrupt the JSON-only stdout contract, duplicate diagnostics, and conflict with documented error routing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
Resolved since last review (3)

Comment thread src/core/wxc/src/main.rs Resolved
Copilot AI review requested due to automatic review settings September 24, 2026 17:34
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from e8eaab9 to b4505c5 Compare September 24, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Lifecycle debug logging can contaminate stdout, and source failures produce inaccurate audit classifications.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (3)

Comment thread src/core/wxc/src/main.rs Resolved
Copilot AI review requested due to automatic review settings September 24, 2026 18:09
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from b4505c5 to 44a02bf Compare September 24, 2026 18:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Lifecycle input and parse rejections omit the known phase from ConfigRejected records.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
Resolved since last review (2)

Comment thread src/core/wxc/src/main.rs Resolved
Comment thread src/core/wxc/src/main.rs Resolved
Copilot AI review requested due to automatic review settings September 24, 2026 18:36
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from 44a02bf to d9191e3 Compare September 24, 2026 18:36
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from 90bcc52 to 02941b8 Compare September 25, 2026 19:44
Copilot AI review requested due to automatic review settings September 25, 2026 20:06
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from 02941b8 to d48077c Compare September 25, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Lifecycle routing currently accepts and silently ignores the delete-only --containername argument.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (1)

Comment thread src/core/wxc/src/main.rs Resolved
Copilot AI review requested due to automatic review settings September 25, 2026 20:18
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from d48077c to da4af50 Compare September 25, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It changes lifecycle protocol routing, parser behavior, and diagnostic semantics across multiple public ingress paths.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 26, 2026 22:03
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from da4af50 to c3ed23d Compare September 26, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Existing PowerShell lifecycle E2E helpers still use the removed phase-bearing executor JSON path and will fail.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread src/core/wxc/src/main.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The E2E helper can mask invalid provision payloads, and several canonical guides still document the obsolete executor contract.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread src/testing/wxc_e2e_tests/src/lib.rs Resolved
Copilot AI review requested due to automatic review settings September 26, 2026 23:17
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from 1e3a8b1 to 4ed4c52 Compare September 26, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The routing, validation, diagnostics, tests, and documentation are consistent with the stated transport change.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (1)

Base automatically changed from user/gudge/rust-sdk-operation-api to main September 27, 2026 18:26
This PR changes direct `wxc-exec` state-aware transport so lifecycle operation
and existing sandbox identity are passed as command-line arguments while raw
exact SDK and FFI APIs retain their phase-bearing JSON contracts.

Details

* Add `--operation provision|start|exec|stop|deprovision` and require
  `--sandbox-id` for operations on an existing sandbox.
* Preserve exact phase-specific parsing by overlaying CLI routing onto a
  source-preserving temporary document before normalization.
* Reject caller-supplied `phase` and `sandboxId` fields and emit actionable
  migration guidance for valid or malformed phase-bearing executor JSON.
* Reject delete and maintenance routing options, including `--containername`,
  when lifecycle routing is selected.
* Route lifecycle failures and debug diagnostics away from stdout so it remains
  exclusively a JSON envelope or exec workload stream.
* Distinguish malformed encoded or file content from unavailable input sources
  and retain the selected lifecycle phase on `ConfigRejected` records.
* Place mandatory routing and configuration arguments before caller-supplied
  options and trailing workload commands.
* Preserve invalid provision `sandboxId` fields in E2E payloads so exact
  contract validation rejects them.
* Keep Node on `mxc_ffi` and consistently distinguish SDK/FFI envelopes from
  direct executor payloads in canonical lifecycle documentation.

Tests

* `cargo fmt --all -- --check`
* `cargo check -p wxc_e2e_tests --all-targets`
* `cargo clippy -p wxc_e2e_tests --all-targets -- -D warnings`
* `cargo test -p wxc_common` (912 passed).
* `cargo test -p wxc` (68 passed).
* `cargo test -p wxc_e2e_tests --lib` (2 passed).
* `cargo test -p wxc cli_rejects_lifecycle_operation_with_utility_modes`
  (1 passed).
* Full workspace Clippy with all targets and features.
* `git diff --check`

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1d91874d-feea-4a33-b183-67d506ae61b5
Copilot-Session: 33217f7b-dc7d-4da0-af5f-018fef64013c
Generated-with: gpt-5.6-sol
@MGudgin
Gudge (MGudgin) force-pushed the user/gudge/rust-sdk-operation-cli branch from 4ed4c52 to 64893fb Compare September 27, 2026 18:26
@MGudgin
Gudge (MGudgin) merged commit 7159426 into main Sep 27, 2026
30 checks passed
@MGudgin
Gudge (MGudgin) deleted the user/gudge/rust-sdk-operation-cli branch September 27, 2026 21:05
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.

4 participants