fix(task-lease): discover machine identity on native Windows #6653
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6653"
general
weight: 0.35
JasonBuildAI
Impact: on native Windows the verified-worktree lease path could never be acquired — the documented, CLI-recommended
loopx task-lease acquire --write-worktree <path>always failed closed withinvalid_worktree_lease_request/ "host identity unavailable for worktree isolation" — because the host-identity source only covered macOS (IOPlatformUUID) and Linux (/etc/machine-id). Every Windows contributor or agent following thewrite_scope_conflictadvisory, the flag help or the code-edit worktree guide dead-ended, and the released 1.4.2 wheel reproduced the identical payload, while POSIX hosts were unaffected and the two observation tests skipped on win32, which is why the defect survived. Closes #6640.Goal And Delivered Outcome
dda6f7ef7).loopx/control_plane/work_items/task_lease_workspace.tsderived the worktree-isolation host identity fromioregIOPlatformUUIDon darwin and/etc/machine-idon linux, leavingmachinenull on every other platform;observeLeaseWorktreethen failed closed, so on native Windows every--write-worktreeacquire rejected at thedurable_writebacksettlement step.uv run python examples/control_plane/task-lease-runtime-smoke.pyaborted at its first worktree acquire withCalledProcessErrorand the exact payload quoted in #6640; with this head the same smoke exitsrc=0and printstask-lease-runtime-smoke ok, andtests/control_plane_ts/task_lease_workspace.test.tsgoes from5 pass / 3 skippedto19 pass / 0 fail / 2 skippedon the same host (the observation test now runs; all 13 of its subtests pass). See thereal_entrypointandunitrows.Closes #6640, intended basemainatd3b7b141c.Author Declaration
JasonBuildAI/loopxfork at the request of and under the direction of the repository account owner.Implemented against
maindda6f7ef7; the same file's repository-identity codec was normalized in #5584, and the advisory workflow landed with #5364/#5587.| Criterion (spec clause) | Disposition | Symbol / path | Test or command |
| --- | --- | --- | --- |
| Verified machine discovery has a Windows identity source | implemented |
machineIdentity()win32 branch readingHKLM\SOFTWARE\Microsoft\Cryptography\MachineGuidthroughreg query|tests/control_plane_ts/task_lease_workspace.test.tsobservation test (runs on win32 now) || The documented
--write-worktreeacquire works on native Windows | implemented |observeLeaseWorktree|examples/control_plane/task-lease-runtime-smoke.py:rc=1before →rc=0after || The existing fail-closed error is kept when no identity can be read | implemented |
machineIdentity()defaultundefined; unchangedthrow new LeaseWorktreeObservationError| branch unchanged by the diff; unsupported hosts still throw — no CI execution, same as before, see Coverage || Platform skips narrow to the implemented identity sources | implemented |
tests/control_plane_ts/task_lease_workspace.test.ts(win32 unskipped), two Python skip reasons corrected | TS19 pass / 0 fail / 2 skipped; focused pytest36 passed, 10 skipped(remaining skips are the Windows symlink fixture) || The supported-host documentation matches the implementation | implemented |
docs/reference/canonical-lease-renew.md| sentence now readsmacOS, Linux and Windowsin the verified machine discovery paragraph || The suite runs on the
windows-powershelllane so the source cannot silently regress | deferred (concrete successor step named below) |.github/workflows/python-tests.yml(lane step) | the lane mechanism is the in-flight #6639 (owned by another contributor); its current qualified-suite list does not yet include this file, so the remaining one-line addition oftests/control_plane_ts/task_lease_workspace.test.tsto the lane step stays a named follow-up. This PR deliberately does not touch the workflow to avoid conflicting with that in-flight change |ruff, the control-plane typecheck and the repository premerge gate on this host before and after the change; read the diff for stray changes (none; a local untrackeduv.lockwas left uncommitted); deliberately left out the workflow change (owned by #6639) and the two Python symlink tests (unrelated fixture constraint).Scope And Continuation
machineIdentity()extraction with the win32 source, the win32 test unskip, corrected Python skip reasons, and the lease-guide sentence. The two Python tests remain skipped on Windows because their fixture creates symlinks (needs Developer Mode or administrator rights) — a separate, pre-existing constraint now named in their skip reason.Validation
c20493b7b41f1324b60af96b92893b838fcda7cc(rebased ontomaind3b7b141c; this amended head differs from0dd51f535, on which the gate measurements below were taken, only by a docs line rewrap, and all focused checks were re-run green at this head)| Check kind | Result | Public-safe evidence / limitation |
| --- | --- | --- |
|
static|passed|ruff checkon the two changed Python files →All checks passed!;tsc --project tsconfig.control-plane.json --noEmit→ clean;git diff --check→ clean ||
unit|passed|node --experimental-strip-types --test tests/control_plane_ts/task_lease_workspace.test.ts→# tests 21 / # pass 19 / # fail 0 / # skipped 2(observation test now executes on win32; 13/13 subtests pass); focused pytest on the four lease test files →36 passed, 10 skipped||
real_entrypoint|passed|uv run python examples/control_plane/task-lease-runtime-smoke.py(drives the shipped CLItask-lease acquire/renew/releaseagainst the file and sqlite authority stores): aborted withCalledProcessErrorbefore →rc=0,task-lease-runtime-smoke okafter ||
integration|failed|loopx canary premerge --from-git-diff --git-diff-base upstream/main(risk-based gate): direct checks 4/4 passed; catalog canaries 6 selected / 0 failed (1 advisory — a pre-existing ratchet finding in an unrelated turn-driver file, explicitly marked inherited baseline); risk-profile run 2 of 8 failed — both are the known Windows smoke-harness fixture-cleanup class (retained temp dir with read-only.git/objects,WinError 5) after the selected check itself printedcatalog-canary-planner-smoke ok; the failing commands' sources are untouched by this diff and a parallel Windows contributor reproduced the same class at the merge base. Gate status is thereforefailedand this PR is not self-merged ||
unit|failed| pre-existing, disclosed:tests/control_plane/test_task_lease_argument_recovery.py→28 failed, 12 passedon this host, every failure the samejson.decoder.JSONDecodeError: Invalid \escapewhile loading a fixture whose$ROOTplaceholder was substituted with a Windows path (fails before product code);tests/control_plane_ts/retained_lease_receipts.test.tsfails the same way inside itsrestorehelper (Bad escaped character in JSON) — both unrelated to this diff ||
regression_parity|passed| released1.4.2wheel (pre-fix artifact) driven from a disposable environment returned"error": "host identity unavailable for worktree isolation",error_code: invalid_worktree_lease_request— identical to the source-checkout baseline; the source-checkout smoke is green at this head. No rebuilt wheel was validated (packaging builds frommain) |ioreg//etc/machine-id), and the fail-closed path is unchanged (not CI-executed on any platform, same as before; the win32 CI lane addition is the deferred row above). Disclosed host failures above all fail at fixture load or in the smoke harness on Windows before product code. No manual holds were recorded by the gate. A local untrackeduv.lockwas scanned by the boundary check and is not committed.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).