Skip to content

Refine typed Rust lifecycle API - #1255

Open
Gudge (MGudgin) wants to merge 1 commit into
user/gudge/rust-sdk-direct-transportfrom
user/gudge/rust-sdk-operation-api
Open

Gudge (MGudgin) wants to merge 1 commit into
user/gudge/rust-sdk-direct-transportfrom
user/gudge/rust-sdk-operation-api

Conversation

@MGudgin

@MGudgin Gudge (MGudgin) commented Sep 23, 2026

Copy link
Copy Markdown
Member

📖 Description

This PR refines the direct typed Rust lifecycle transport into an
operation-centric public API under mxc_sdk::sandbox.

Details

  • Add sandbox::{provision,start,exec,stop,deprovision} and matching
    validate_* functions.
  • Introduce an opaque SandboxId and keep sandbox identity separate from
    policy and operation options.
  • Split provision, exec, and lifecycle request shapes so invalid combinations
    are not representable through one broad request type.
  • Return operation-specific result types instead of a shared optional-result
    structure.
  • Reject empty and embedded-NUL sandbox identities at the public boundary.

This is PR 2 of 3 in the state-aware operation API stack.

🔗 References

🔍 Validation

  • cargo fmt --all -- --check
  • All-feature mxc_engine and mxc-sdk tests passed.
  • Public API compile-shape and behavior tests passed.
  • mxc-sdk Rustdoc tests passed.
  • Changed-crate clippy passed with --no-deps -D warnings.
  • git diff --check

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

This PR refines the direct typed Rust lifecycle surface around explicit
sandbox operations while preserving the exact JSON compatibility lane.

Details

* Group typed provision, start, exec, stop, and deprovision calls under
  `mxc_sdk::sandbox`.
* Add an opaque `SandboxId` and pass identity separately from typed policy.
* Move experimental authorization and telemetry preference into
  `OperationOptions`.
* Return distinct `ProvisionResult`, `LifecycleResult`, and
  `ValidationResult` types.
* Add explicit validation entry points instead of mixing dry-run outcomes
  into successful operation results.

Tests

* `cargo fmt --all -- --check`
* `cargo test -p mxc_engine --all-features`
* `cargo test -p mxc-sdk --all-features`
* `cargo test -p mxc-sdk --doc --all-features`
* `cargo clippy -p mxc_engine -p mxc-sdk --all-targets --all-features
  --no-deps -- -D warnings`
* `git diff --check`

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1d91874d-feea-4a33-b183-67d506ae61b5
Generated-with: gpt-5.6-sol
@MGudgin
Gudge (MGudgin) requested a review from a team as a code owner September 23, 2026 22:23
@azure-pipelines

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

This branch has not been deployed

No deployments
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