Repository navigation
fix(runtime): scope file admission and preserve Windows lock contention - #926
Open
Haoming9527 wants to merge 3 commits into
Open
Haoming9527 wants to merge 3 commits into
Haoming9527 wants to merge 3 commits into
Conversation
This was referenced Nov 14, 2026
Haoming9527
marked this pull request as ready for review
November 14, 2026 04:52
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.
Refs #872. Stacked on #925; this slice does not close the full issue.
What was wrong
The shared Native/PTC file-call budget lived in a module-level map of hosts, outside the resident client's lifetime. Stopping or losing that client could leave pre-admission waiters pending until active callbacks released their permits.
The Windows concurrency CI also exposed an
ACCESS_DENIEDrefusal. A deterministic held-handle fixture identified an unhandled sidecar deletion state: nativeSTATUS_DELETE_PENDINGwas collapsed into Win32 error5, losing the distinction between contention and a real permission denial. The original CI log did not identify the failing internal stage; a separate 1,200-call stress diagnostic did not reproduce it.The change
The existing
ResidentClientnow owns the same FIFO throughadmitFileCall: two active and eight waiting calls per session. Waiting callbacks resolve current authority only after admission, before any native request exists. Stop/failure rejects waiting callbacks immediately; accepted calls and result-cache cleanup retain their existing joined lifecycle. Native execution queues are unchanged.The shared fixtures now declare their owning client explicitly. Windows lock acquisition uses a held-directory, no-follow native opener to preserve exactly
STATUS_DELETE_PENDINGas error303 and thenREVISION_CONFLICT. True access denial remainsACCESS_DENIED; inherited ACLs, ordinary read/write rights, sharing and binding checks are retained. There are no added retries or DELETE rights.Bilingual rationale and changelog are updated. No dependency, version, model schema, prompt, runtime-pin or platform-policy changes.
Validation
Original admission checks on Windows x64, existing worker SHA256
024d5e80b9befe77dce3b3ad4bf6c2d4d40e236047054acc79dd9f7196192b2c:The first PR run 43512919665 failed its minimum-Node job in three additional preflight-only fixtures that lacked an owning client (
wsl-readonly,read-files-host,safety-atomicity). The append-only correction declares those owners and keeps the missing-workingDirectory regression focused on its intended refusal. All four corrected suites passed 20 checks, zero skipped; production code did not change.The second PR run 43513959592, head
ace51a2d69e96f1e1198c8aab773ae40d77ff054, failed its Windows functional job: the six-writerlinux-protocolcheck returnedACCESS_DENIEDonce. Windows recorded 261 passed suites, one failed, four skipped; all eight other underlying CI jobs passed. The subsequent sidecar fix does not claim that the unlabelled CI interleaving was fully traced.Focused sidecar validation at
b3f2f4f58530eb09264e35e220a6a26135c4ddb8, explicitly using CI-pinned Rust1.97.1:cargo +1.97.1 build --locked --manifest-path native/Cargo.toml --bin dsh-ops-worker: passed.cargo +1.97.1 test --locked --manifest-path native/Cargo.toml -p ops-files -p dsh-ops-windows-metadata: 24 unit tests passed, zero failed/ignored.cargo +1.97.1 clippy --locked --manifest-path native/Cargo.toml -p ops-files -p dsh-ops-windows-metadata --all-targets -- -D warnings: passed. Format/diff checks passed; size gate passed all944 tracked code files.ACCESS_DENIEDinstead ofREVISION_CONFLICT. Real sidecar DACL denial still passed. Initial fixture setup emitted PowerShell module progress to stderr; that cosmetic progress was disabled before this red control.node test/run.mjs windows-security lock-sidecar linux-protocol replace-concurrency: 16 checks across four suites passed, zero skipped. The held delete-pending case leaves target bytes unchanged and a new call succeeds after the holder closes; a real WriteData DACL denial remainsACCESS_DENIEDwith unchanged permissions.Current
pull_requestCI: run43551459661, exact headb3f2f4f58530eb09264e35e220a6a26135c4ddb8; completed successfully. All nine underlying jobs and aggregateCI requiredpassed. Windows functional gate: 262 suites passed, four platform skips in299s;linux-protocol4/4,replace-concurrency2/2 andwindows-security6/6. No performance claim.Environment
Windows x64, Node 26.12.1, locked development dependencies. Base: public PR #925 head
80dbcc8535271f7da460fe913d68783fdd6f163e. The matching worker was staged with the repository tool and verified by hash. Validation used isolated test homes and the existing pinned legacy Bash fixture. No merge or release.