Repository navigation
Conversation
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. |
There was a problem hiding this comment.
🟡 Changes recommended
The design requires previously optional userObjectId and adds nil-GUID rejection without clearly scoping the compatibility impact or aligning the API documentation and fixture plan.
1 open issue
What changed in this PR
Proposes pool discovery and persistent nonsecret routing for the experimental W365 backend, extending #1615 to address #1821. This is a documentation-only proposal; implementation and maintainer approval remain pending.
Changes:
- Define discovery when
poolIdis omitted and direct targeting when supplied. - Specify saved routing for fresh-process lifecycle calls, including storage security and allocation/release recovery.
- Describe the development-contract change and planned validation without changing published contracts or SDK signatures.
| File | Description |
|---|---|
docs/development/architecture/designs/1821-w365-discovery-routing/README.md |
Defines discovery, routing persistence, recovery, and validation plans. |
docs/development/architecture/designs/1821-w365-discovery-routing/api.md |
Documents optional pool selection, request examples, and compatibility expectations. |
Review effort: Balanced
| Provision accepts an optional `w365Agents.provision.poolId`; explicit null, empty, malformed or nil GUIDs remain rejected. | ||
| `userObjectId` remains required and non-nil under existing backend validation. An explicit pool is fetched directly and never replaced. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Branden Bonaby (bbonaby)
left a comment
There was a problem hiding this comment.
thanks!
|
CC: Gudge (@MGudgin) to also take a look |
Gudge (MGudgin)
left a comment
There was a problem hiding this comment.
Summary
Reviewed the two new W365 discovery/routing design documents against the existing #1615 design, W365 clients, native/Node/.NET fixtures and the proposed validation plan at 410f90c95ce9302c32ff7575b1cdd005253909e0.
Requesting changes on two design blockers: preserve CP recovery routing whenever an unsuccessful checkout returns a valid session ID, and define the operation-specific request targets derived from the returned full service URLs. The other ten inline findings are Medium design/validation-plan issues. These are proposed-behavior findings, not claims of reproduced implementation failures or requests to complete implementation in this spec PR.
Verified scope and validation
- The pinned merge-base/head diff adds exactly the two design documents; it changes no published schema, SDK declaration, manifest, backend implementation or CI gate. The disclosed experimental request restrictions are not classified here as published SDK source/binary breaks.
git diff --check 40eebd39ab5e5a02d350169a8c96c28b33ddba7e..410f90c95ce9302c32ff7575b1cdd005253909e0passed.- Runtime tests were not run for this documentation-only proposal. Fixture references in the inline comments are source-inspection evidence, not execution results.
Verified pre-existing - not attributed to this PR
The existing W365 service.rs, data_plane.rs, exec/transport.rs, native w365_lifecycle.rs, Node w365-fixture.ts, .NET MxcLifecycleW365Tests.cs and original #1615 README are byte-identical across the pinned range. They are supporting context, not independent pre-existing findings. The native fixture has four #[test] declarations on both sides. Comments about new fixture seams concern the proposal's validation design, not missing implementation in those unchanged files.
|
|
||
| W365 owns the remote reservation; the caller retains release responsibility. | ||
| The routing cache neither owns the reservation nor proves remote status/readiness. | ||
| After allocation, invalid DP metadata must preserve the allocated ID and CP-only recovery routing for release. |
There was a problem hiding this comment.
High (correctness) - Finding 1: Preserve CP-only routing for every failed checkout with a cleanup ID.
Attribution: introduced_by_change - requiring a saved record adds a new prerequisite for the existing known-session cleanup path.
The recovery rule explicitly covers invalid DP metadata, but checkout can also return HTTP 408 or 500 with a valid session ID. The existing src/mxc-sdk/tests/w365_lifecycle.rs:1067-1101 scenarios retain that ID and release it. With the new mandatory routing lookup, reporting the ID without saving its CP route makes fresh-process deprovision fail before DELETE, even when storage is healthy. This is separate from the documented case where saving any record itself fails.
Fix: Require CP-only routing whenever an unsuccessful checkout returns a valid cleanup ID, not only after invalid DP metadata. Extend the existing 408/500 scenarios to verify release from a fresh process.
There was a problem hiding this comment.
Updated in 097f420: any failed checkout returning a valid cleanup ID must save CP-only recovery routing, including 408/500. The fixture plan now requires fresh-process deprovision for those cases and explicit combined errors if recovery persistence fails.
|
|
||
| Modes and call order remain as in [#1615](../1615-w365a-backend/README.md#execution-and-container-lifecycle-support). | ||
| Provision saves routing; fresh-process start/exec/stop/deprovision load it without | ||
| Graph or endpoint variables. Full URLs drive readiness/exec requests. Stop and |
There was a problem hiding this comment.
High (correctness) - Finding 2: Define how full service URLs become operation targets.
Attribution: introduced_by_change - full service URLs replace hostname inputs, but their operation-specific interpretation is not defined.
The existing client uses distinct targets: checkout /api/pools/{poolId}/sessions?api-version=3.0, readiness /computers/{sessionId}/status?api-version=1.0, and exec /computers/{sessionId}/microsoft.exec?api-version=1.0 (service.rs:180-190, data_plane.rs:98-107, exec/transport.rs:350-355 under src/mxc-sdk/src/backends/w365agents/). The proposal defines authority-only release, but not whether poolUrl/computerUrl are bases, resource URLs or complete endpoints. Replacing a non-root path can discard routing; appending the existing target can duplicate resource segments, and existing queries need defined API-version handling.
Fix: Specify the resulting target for checkout, readiness and exec, with a worked non-root-path/query example and exact fixture assertions. This is a service-contract decision, not a choice of URL library.
There was a problem hiding this comment.
Updated in 991dabf. The spec now defines poolUrl as the full checkout endpoint and computerUrl as the computer resource, with resulting request URL examples, query preservation and explicit API-version rules. Release retains its existing authority-based API 2.0 target. Added exact target assertions to the fixture plan.
| containing the service-provided full CP URL and validated checkout `computerUrl`, never credentials or responses. | ||
|
|
||
| Use locks, atomic writes, owner/link checks and exact identity/destination validation. | ||
| Validate HTTPS destinations and reject embedded credentials, authentication query parameters and fragments. |
There was a problem hiding this comment.
Medium (security) - Finding 3: Define which destinations may receive each bearer token.
Attribution: introduced_by_change - service-returned and saved URLs replace caller-supplied destination hostnames.
HTTPS, absence of userinfo/fragments and exact record consistency do not establish which hosts are trusted to receive W365A_CP_TOKEN or W365A_DP_TOKEN. An unexpected out-of-service HTTPS URL can satisfy the stated format checks. The inherited #1615 rule against unrelated-origin credential forwarding expresses the intent, but its trust anchor is unspecified once caller-supplied host routing is removed.
Fix: Define trusted service origins/domain rules per token and environment, and require validation on receipt and on every record load before attaching credentials. CP and DP need not share an origin. Identify which inherited service-returned-URL restriction this proposal supersedes.
There was a problem hiding this comment.
Clarified in d90c09e: the fixed Graph origin is the trust anchor for the matching pool's URL; that checkout service supplies the computer URL. MXC performs local HTTPS/443, DNS-host, credentials/query and fragment checks rather than inventing a service-host allowlist. Protected records preserve that trust, with ownership/link, identity and URL checks repeated before attaching credentials. Redirects are prohibited and Graph pagination stays on the selected origin. The spec explicitly identifies the inherited service-returned-URL restriction being superseded.
| failover only, and no second checkout after uncertainty or persistence failure. | ||
| - Fresh-process lifecycle: assert saved full paths/queries are used, no Graph or | ||
| endpoint settings are needed, output/exit results are preserved and release uses API 2.0. | ||
| - Invalid DP metadata, storage corruption/conflict, ownership/link violations and |
There was a problem hiding this comment.
Medium (security) - Finding 4: Assert that rejected destinations receive no bearer token.
Attribution: introduced_by_change - the new returned/persisted-URL credential path needs explicit negative destination assertions.
The plan checks successful path/query preservation and storage failures, but does not explicitly require zero credential forwarding for rejected HTTP URLs, userinfo, fragments, authentication query parameters or destinations outside the trust policy. Ownership/corruption checks alone do not prove this; a well-formed record can name an unacceptable destination.
Fix: Extend the loopback fixtures with both response-sourced and stored-URL rejection cases. Assert an explicit error and zero token-bearing requests to the rejected destination, retaining the already-planned conflicting-destination checks.
There was a problem hiding this comment.
Added in 82694a2: response-sourced and stored invalid URLs must fail explicitly with zero token-bearing requests to the rejected destination. The plan also covers redirects and cross-origin Graph pagination. An unfamiliar hostname alone is not rejected: the agreed trust policy relies on Graph/checkout provenance plus local URL safety checks, not a guessed hostname allowlist.
| without checkout. Missing/malformed metadata fails. Read authoritative `poolUrl` | ||
| from the matching pool resource, never endpoint variables or region reconstruction. | ||
|
|
||
| Try another pool only after a definitive non-408 HTTP 4xx checkout rejection, with no allocation and `possiblySucceeded=false`. |
There was a problem hiding this comment.
Medium (reliability, performance) - Finding 5: Bound discovery and classify failover rejections.
Attribution: introduced_by_change - the new sequential candidate loop expands the prior single-pool checkout operation.
A definitive non-408 4xx includes 401/403 credential failures and 429 throttling. The proposal does not distinguish operation-wide authentication/throttling failures from candidate-specific rejection or define Retry-After handling. It also supplies no overall Graph/discovery/failover budget. The existing 45-second timeout is per checkout (src/mxc-sdk/src/backends/w365agents/service.rs:11,184), so total work and latency can scale with every assigned pool.
Fix: Define which responses permit another candidate, how authentication and throttling terminate or delay selection, and a total discovery/failover budget. Add corresponding failure and exhaustion cases. Preserve the existing no-allocation and no-replay conditions.
There was a problem hiding this comment.
Updated in 8ef4d5e. Selection has a shared 120-second deadline, with 30 seconds for listing across pages, 30 per detail fetch and 45 per checkout, all capped by remaining time. Checkout 401/403 may permit another candidate only with no cleanup identity and possiblySucceeded=false; they need not apply to every pool. A 429 stops selection and surfaces Retry-After without automatic sleep/retry. Graph failures, 408/5xx and uncertain allocations stop selection. The fixture plan covers budget exhaustion, per-pool diagnostics and recovery persistence at deadline expiry.
|
|
||
| Extend `w365_lifecycle` (including `lifecycle_contract_and_recovery_fixture` and Windows `lifecycle_fresh_executor_fixture`), | ||
| Node `w365-fixture.ts` and .NET `MxcLifecycleW365Tests.cs`. | ||
| Use existing loopback TLS fixtures and isolated `test-support` builds on supported Windows/Linux/macOS hosts with OpenSSL. |
There was a problem hiding this comment.
Medium (testability) - Finding 8: Plan an offline Graph transport seam.
Attribution: introduced_by_change - the proposed Graph list/fetch stages must be driven through the offline validation infrastructure.
The current fixture transport uses MXC_W365_TEST_CA/MXC_W365_TEST_PORT and allows a non-443 test port only for localhost (src/mxc-sdk/src/backends/w365agents/service.rs:149). Public/canary selection alone does not provide a local Graph origin. The plan needs to identify how new Graph requests reach the deterministic listener rather than live Graph.
Fix: State that a test-support-only Graph origin/adapter will be added, without weakening production endpoint restrictions. Require list/direct-fetch method, path, environment-prefix and checkout-order assertions. This asks for a validation-design seam, not implementation in this documentation PR.
There was a problem hiding this comment.
Added in bf9f908: a test-support-only loopback Graph transport override with fixture CA validation. Shipping builds ignore it and keep the fixed Graph origins. The fixture plan requires list/pagination/direct-detail methods, paths, public/Canary prefixes and checkout-order assertions without live Graph calls.
| ## Design and security | ||
|
|
||
| Keep discovery, checkout and storage in existing W365 backend modules in `mxc-sdk`; no new crate or broad refactor. | ||
| Preflight storage before discovery. Save versioned, bounded per-user records keyed by canonical `w365:{poolId}:{sessionId}`, |
There was a problem hiding this comment.
Medium (testability) - Finding 9: Isolate fixture routing storage across processes.
Attribution: introduced_by_change - persistent profile records and no-overwrite/conflict rules add shared state to fixtures that reuse fixed identities.
The existing native, Node and .NET fixtures reuse the same pool/session IDs and isolate only their existing environment keys (w365_lifecycle.rs:308-323, sdk/node/tests/integration/w365-fixture.ts:35-37, sdk/dotnet/Microsoft.Mxc.Sdk.Tests/V1/MxcLifecycleW365Tests.cs:255-257). A process-local mutex does not isolate a profile store across suites or fresh executors. Separate test-support builds also do not isolate that filesystem state.
Fix: Plan a temporary root per scenario that child executors inherit, with targeted cleanup. Specify suitable-host coverage for actual owner/link checks; a stored-identity mismatch is not a substitute for OS-owner validation.
There was a problem hiding this comment.
Added in bf9f908: each native/Node/.NET scenario gets a private temporary routing root inherited by child processes, with targeted cleanup. The plan explicitly calls for actual Unix owner/symlink and Windows owner/ACL/reparse-point checks rather than treating JSON identity mismatches as OS-owner coverage.
| W365 owns the remote reservation; the caller retains release responsibility. | ||
| The routing cache neither owns the reservation nor proves remote status/readiness. | ||
| After allocation, invalid DP metadata must preserve the allocated ID and CP-only recovery routing for release. | ||
| Persistence failure reports the allocated identity, CP destination and cleanup context, never success or a second checkout. |
There was a problem hiding this comment.
Medium (testability) - Finding 10: Make post-checkout persistence failure deterministic.
Attribution: introduced_by_change - the new recovery contract requires failure after allocation, separately from storage preflight rejection.
An unwritable root fails the proposed preflight before checkout. The existing HTTP reply queue can force service errors but cannot deterministically fail the subsequent atomic write after checkout succeeds. Racing permission changes is not a reliable Windows/Linux/macOS acceptance scenario.
Fix: Plan a test-support fault at the post-checkout persistence boundary. Assert one checkout, allocated ID/CP cleanup context in the error, no replay and no fabricated usable record. Use deterministic synchronization if process exit at this boundary is tested.
There was a problem hiding this comment.
Added in bf9f908: a test-only fault at post-checkout atomic publication, distinct from preflight failure. The planned assertions require exactly one checkout, allocated ID and CP cleanup context in the error, no replay and no fabricated usable record. An unwritable root alone is explicitly identified as only a preflight test.
|
|
||
| ## Acceptance criteria and validation plan | ||
|
|
||
| Extend `w365_lifecycle` (including `lifecycle_contract_and_recovery_fixture` and Windows `lifecycle_fresh_executor_fixture`), |
There was a problem hiding this comment.
Medium (test coverage) - Finding 11: Include Unix fresh-process routing validation.
Attribution: introduced_by_change - fresh-process saved routing is proposed for all supported hosts, but the identified subprocess fixture is Windows-only.
lifecycle_fresh_executor_fixture is gated by #[cfg(windows)] (src/mxc-sdk/tests/w365_lifecycle.rs:1211-1214). The existing Node/.NET lifecycle fixtures stay in one process. Extending only these named scenarios leaves Unix fresh-process record lookup and filesystem behavior unvalidated in the proposed persisted-routing workflow.
Fix: Name a Unix subprocess scenario or equivalent Linux/macOS harness and the CI lanes that run it. Require provision followed by fresh-process start, exec and cleanup without Graph or endpoint settings.
There was a problem hiding this comment.
Added in bf9f908: proposed lifecycle_fresh_sdk_process_fixture in w365_lifecycle, using a native SDK subprocess helper on Linux/macOS for separate provision/start/exec/deprovision processes sharing isolated storage. The plan requires helper build, test discovery and execution in Build.Linux.Job.yml and Build.MacOS.Job.yml, which scheduled validation reuses. Windows executor coverage remains; this does not add lifecycle operations to Unix executors.
| The [validation runbook](../../../build-and-test/ci-validation-infrastructure.md#offline-tls-fixtures) | ||
| describes build/SDK jobs; `Validation.Tests.Scheduled.yml` reuses native build jobs. | ||
|
|
||
| - Omitted/explicit pool: assert list order/direct fetch, null/invalid rejection, |
There was a problem hiding this comment.
Medium (test coverage) - Finding 12: Cover the new Graph configuration/error contract.
Attribution: introduced_by_change - mandatory Graph credentials and public/canary selection add caller-visible provisioning failures.
The acceptance list covers pool selection and malformed metadata, but does not explicitly cover missing Graph credentials, unsupported environment values or service-rejected Graph credentials.
Fix: Add local rejection before discovery for missing/local-invalid configuration and unsupported environments. For a supplied token rejected by Graph, assert an explicit auth error and no checkout. A syntactically valid but expired token may require a Graph request to diagnose, so zero Graph requests is not required in that case.
There was a problem hiding this comment.
Added in bf9f908: missing/local-invalid credentials and unsupported environments must fail before Graph or checkout. Credentials rejected by Graph must produce an explicit authentication failure with no checkout; the plan allows the Graph request needed to detect that rejection.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Service-owner and maintainer review is needed to confirm URL semantics, bearer-token destination trust, and experimental compatibility restrictions that offline fixtures cannot validate against deployed services.
Review effort: Balanced

📖 Description
Proposes W365 pool discovery and persistent nonsecret routing, extending the existing backend design without repeating it.
poolIdoptional: discover assigned pools when omitted, or target the explicitly supplied pool.api.md; SDK signatures and published contracts remain unchanged.Documentation only. Authentication/token management, other backends and the original #1615 documents are unchanged. Status remains Proposed; maintainer acceptance and design approval are pending.
🔗 References
Refs #1821. Builds on #1615.
🔍 Validation
git diff --check origin/main...HEAD— passed.✅ Checklist
feature-acceptedCargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow