feat(engine): add available_backends() host-capability probe API - #753
Merged
Huzaifa Danish (huzaifa-d) merged 1 commit intoAug 5, 2026
Conversation
Add mxc_engine::probe with the read-only available_backends() API from the backend-support-probe plan (PR #717, Phase 2). Reports only the containment backends the current host can run, each with its effective isolation tier when it has a tier ladder. - AvailableBackend { backend, tier: Option<String> } serializes to camelCase JSON with tier omitted (never null) when the backend has no tier ladder. - available_backends() has per-platform arms reusing the landed detectors: macOS -> seatbelt; Linux -> bubblewrap/lxc; Windows -> processcontainer (with effective tier) + windows_sandbox + wslc (feature-gated). Empty Vec is a normal result, not an error. - select_tier() is a pure precedence fn (base-container -> appcontainer-bfs -> appcontainer-dacl floor), unit-testable without a real host or the tier2_bfs feature. - Re-exported from mxc_engine and the public mxc-sdk. - 8 unit tests: serde shape (tier omitted vs present), host + unconditional wire-name drift guards, canonical-tier drift guard, Windows processcontainer-always-with-tier, tier precedence, non-Windows processcontainer absence. Stacked on the host-detector port (PR #725); the standalone detectors it reuses land there. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Huzaifa Danish (huzaifa-d)
merged commit Aug 5, 2026
46b2274
into
user/modanish/port-host-detectors-to-rust
1 check passed
Huzaifa Danish (huzaifa-d)
deleted the
user/modanish/available-backends-probe-api
branch
August 5, 2026 18:25
8 tasks
Contributor
Author
|
Folded into #725. This PR''s commits became an ancestor of its base branch ( |
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.
📖 Description
Phase 2 of the backend-support-probe plan (design doc in #717): add the read-only
available_backends()host-capability probe API.available_backends() -> Vec<AvailableBackend>reports only the containment backends the current host can actually run, so a caller can pick a backend at startup without attempting an execution. It is deliberately separate fromplatform_support()(§7.1): that answers the narrower "which backends canmxc-sdkitself launch?" question, whereas this answers the broader host-capability question and additionally reports each backend''s effective isolation tier.What''s included (new
mxc_engine::probemodule, re-exported frommxc_engineand the publicmxc-sdk):AvailableBackend { backend: String, tier: Option<String> }— serializes to camelCase JSON ({"backend":"seatbelt"}/{"backend":"processcontainer","tier":"appcontainer-dacl"});tieris omitted (nevernull) when the backend has no tier ladder.backendis a canonicalContainmentwire name;tieris a canonicalIsolationTier::as_str()string.available_backends()— per-platform arms reusing the detectors from feat(engine): Rust host-backend detectors + available_backends() probe #725: macOS →seatbelt; Linux →bubblewrap/lxc; Windows →processcontainer(with effective tier) +windows_sandbox+wslc(feature-gated). An emptyVecis a normal result (unsupported platform, or Linux with neitherbwrapnorlxc), not an error.select_tier()— a pure precedence fn (base-container→appcontainer-bfs→appcontainer-daclfloor), split from the host detectors so it''s unit-testable without a real Windows host or thetier2_bfsfeature.The named
tieris a ceiling, not a guarantee: a real request can still land on a weaker tier when policy forces it (e.g.deniedPathson a host without native deny support). The probe performs none of those policy-dependent checks.Stacking / scope:
user/modanish/port-host-detectors-to-rust) — this reuses thelxc/windows_sandboxdetectors that land there. Review/merge feat(engine): Rust host-backend detectors + available_backends() probe #725 first; the diff here is just the probe module + two re-export lines.isolation_session,microvm,hyperlight) and the side-effect-free TypeScript-projection transport are out of scope, tracked as the §6 follow-ups.🔗 References
Related to #717 (design doc / plan this implements Phase 2 of).
🔍 Validation
cargo fmt --all -- --check— cleancargo clippy --all-targets -- -D warnings— clean onx86_64-pc-windows-msvcandx86_64-unknown-linux-gnu, and under featureswslcandtier2_bfscargo test -p mxc_engine— 25 passed (incl. 8 new probe tests: serde shape with tier omitted vs present, host + unconditional wire-name drift guards, canonical-tier drift guard, Windows processcontainer-always-with-tier, tier precedence across all combos, non-Windows processcontainer absence).mxc-sdksuites pass.Reviewed by an independent adversarial pass and against the repo Rust conventions; the unconditional wire-name drift test and the exotic-target
#[cfg]gate came out of that review.✅ Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see docs/pull-requests.md)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow