Repository navigation
fix(workspace): prepare cloud placeholders and WSL redirectors without ACL failures (#744, #669, #576, #814) - #1003
Closed
Nicholas023 wants to merge 6 commits into
Closed
Nicholas023 wants to merge 6 commits into
Nicholas023 wants to merge 6 commits into
Conversation
…nders (#814) A foreground command that outlived its timeout is promoted to a host job, and the render offered job_output/job_kill as if the kill stopped one command. The host's subprocess and job layer actually terminates the whole tree, so daemons the command started and left attached to its pipes (an adb server, a dev-server watcher) went down with it. The host layer owns that semantics and this repository cannot fix it; the render now states what a job kill reaches and how to keep daemons out of the blast radius.
…tes (#744) A OneDrive workspace root carries IO_REPARSE_TAG_CLOUD with no target, and the bootstrap's ancestry walk refused any reparse point before the DACL decision could run, so every workspace-write tool failed on an otherwise ready folder. The reparse check moves to the single branch that actually writes the DACL: an already-ready root answers without any tag inspection, the cloud-files family (Microsoft's 0x90000000-0x9FFFFFFF band) passes because a placeholder keeps a real directory entry behind the point, and every other tag fails closed with the tag named, read through FSCTL_GET_REPARSE_POINT on the point itself. Unreadable points fail closed too.
#669) The WSL 9P redirector (\\wsl.localhost and \\wsl$) exposes no NTFS security descriptor, so the bootstrap's Get-Acl threw on every WSL workspace and all of run_code died in workspace-write mode. Exactly those two Microsoft-fixed prefixes now answer ready before Get-Item or Get-Acl is touched, decided by the pure classifier Get-DshOpsWorkspaceNtfsState. This is a prefix decision, not a catch that swallows ACL errors: every other path keeps its existing behaviour and a real ACL failure there still fails closed; authority inside the distribution remains its own uid/gid mapping.
…669) The redirector prefix decision ran before Get-Item, which turned '9P has no NTFS ACL' into 'the workspace need not exist': a nonexistent-distro path answered ready. The decision now runs after the existence and container validation and before Get-Acl, so a missing path fails exactly like any other missing workspace and a live 9P root still answers ready without reaching Get-Acl. The live end-to-end case becomes an explicit DSH_OPS_TEST_WSL_DISTRO opt-in that registers only after probing the provider, reports not-run without counting it as passed, and runs before the negative case because touching a nonexistent distribution leaves the redirector unable to answer valid paths for under two seconds.
The tag classifier accepted the whole 0x9xxxxxxx band on the high nibble alone, which is wider than the issue's proven family and let unproven tags through before a DACL write. The rule is now the exact family shape: (Tag -band 0xFFFF0FFF) -eq 0x9000001A, i.e. IO_REPARSE_TAG_CLOUD, CLOUD_ROOT, CLOUD_ON_DEMAND and family members sharing 0x9000?01A; 0x9FFFFFFF and a 0x9 tag whose low 16 bits are not ?01A are pinned as negative cases. Decimal literals keep the Windows PowerShell 5.1 unsigned arithmetic working. Docs state the precise family instead of the reserved band, and the same three files also carry the post-review wording that the 9P allowance runs after existence validation (#669).
…call (#576) Each optional WSL read drove one wsl.exe invocation per Windows drive mapping, one more for the payload sha256, and a final one for the worker, so a small read paid four WSL startups for one result. Preparation is now a single fixed /bin/sh -c script: the text is a constant and every drive root and the payload path travel as positional arguments, so no Windows path can alter the command shape. The wslpath mappings are still resolved anew per call, the payload digest must still match the packaged receipt, and a refused mapping (exit 9), refused digest (exit 8) or failed spawn still falls back to the Windows worker exactly as before.
This was referenced Nov 20, 2026
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.
Closes #744, #669, #576
Refs #814
What was wrong
IO_REPARSE_TAG_CLOUDplaceholders (no redirect target), but the bootstrap treated every reparse point as a junction and refused before the "already ready" fast path, so workspace-write failed for every command.\\wsl.localhost\<distro>or\\wsl$) has no NTFS security descriptor;Get-Aclthrew and the whole workspace bootstrap died.wsl.exestartup per drive mapping plus one for the digest plus one for the worker.job_killterminates the whole process tree.The change
bin/prepare-workspace.ps1: existence/container validation first; the "ready" fast path runs before any reparse inspection, so a ready workspace never needs a write; reparse tags are inspected only on the DACL-writing branch, with a handle-based query of the point itself.bin/workspace-acl.ps1: only the proven cloud-files family(tag & 0xFFFF0FFF) == 0x9000001Ais allowed through; other/unreadable tags fail closed with the tag named.readyafter existence validation and beforeGet-Acl; a real ACL error on other paths still fails closed.src/execution/wsl-worker.ts: one fixed/bin/sh -cpreparation call with constant text and positional arguments (drive roots then payload), preserving per-callwslpathresolution, digest verification and the Windows-worker fallback.src/shells/host-contract.ts: promoted renders state the full-tree reach ofjob_kill.Local validation:
workspace-acl8/8,workspace-wsl-redirector2/2 (+ opt-in live 9P case),workspace-reparse-ready3/3,workspace-language2/2,wsl-prepare-merge3/3,wsl-readonly6/6,shells-job-promoted-guidance2/2;npm run check:sizegreen.Validation
The gate lines above were produced on the local integration head
b21274dd(all slices merged) with the pinned local fixtures:DSH_OPS_TEST_BASH= a verified pinned MSYS bash (sha256 6cc575e9…),DSH_OPS_NIUBASH_ARCHIVE= the shipped frozen archive. Each PR branch was also built and its own suites were run before push; the counts below are from those runs.CI required run: the pull_request event for this PR triggers
ci.yml; paste the aggregateCI requiredrun URL here once it finishes.Environment
maincommit58f6e281(origin/main at submission)npm ci --ignore-scripts --offline,npm run build,npm run stage:niubash -- --offline --archive <frozen archive>)