← Back to Pull requests

fix(windows): remove external VC runtime dependency #40

Closed
unknown closed this pull request without merging on Nov 14, 2026 02:42 UTC
View on GitHub
unknown unknown commented on Nov 10, 2026 23:43 UTC
Author

Maintainer integration

Rebased on main, preserving the Linux filesystem-launch helper added in #39 and contributor credit. Current candidate: 3a1650413db371a6d5671a7e2f40b67bf49bdb59. Independent P0–P2 review is clean. Published 0.5.0 x64 binary independently reproduces the undeclared VCRUNTIME140.dll import. Exact-head CI is the remaining landing gate. Earlier source and artifact receipts below describe their named historical heads.

Summary

Fixes #38.

  • Link Windows x64/ARM64 compiler-specific runtime support statically while retaining the dynamic, OS-serviced UCRT; preserve inherited Rust flags and Cargo's encoded-flags precedence.

  • Reject malformed/wrong-architecture Windows addons, external VC redistributable imports (including delay imports), and missing OS-UCRT linkage before native staging and package collection.

  • Add focused binary-behavior regression coverage and document the linkage and clean-runtime qualification contract. Other platforms' linkage is unchanged.

  • Build the separately compiled x86 inspection fixture through the same linker policy and validate its PE32 executable, eliminating its separate VC-redist prerequisite.
  • Source and artifact provenance

    Current head: 18471bde8ae86415663610a868264bda43356d72; current tree: 64df56f8b4cb0743e6972d09241fdf95be9c374e.
    Base: f3958be7ddd6e33206c9a3ce49dca0a906b874d2.
    Original addon-proof head: d1b8ba501684facf3af15dedc061a795060a346a, tree 9f395b933ab063c741788b52ac9997a120863c85, exactly matched original local ClawSweeper snapshot 4bdb059ff620e585eef4f23e0b79030f503d9aa9 (nine files, 194 added lines, no actionable findings). The current fixture follow-up has separate exact-source/runtime proof below. Native Rust, public TypeScript/API, version and effective addon linker flags are unchanged; old artifact hashes are not mislabeled as rebuilt current-head packages.

    The runtime artifacts were built before this commit existed, from the base plus this patch. The producer/native source is unchanged; the two new validator/test files were subsequently normalized from CRLF to repository-standard LF, with canonical-source equivalence verified. Source archive SHA-256: f4af4da0c9b8da86d737430c02bebff81e75183e6cd79995f0de513bd1f0d21d. Do not interpret the commit timestamp as a later rebuild or claim bit-reproducible output.

    | Tested candidate artifact | SHA-256 |
    | --- | --- |
    | x64 native addon | 1dfe09217f96bf588f5395e45cae34208ab4d92c73fc5da6e69829023f095cce |
    | ARM64 native addon | 8649693033b3d5445418d2d27a97c3f8d11a915a6fce9b50dc5a4b63f18ea986 |
    | Root 0.5.0 tarball | f7caa4ea98c8e26d9eaa797c424201188e0aff68541baad0f7dfa2e2f48acc52 |
    | x64 platform 0.5.0 tarball | 3f77dc9df40de092c986e954a93d677348f5238d1155c5c8c65410ce9bb4c1a4 |
    | ARM64 platform 0.5.0 tarball | d9a1d7789f4fccead902fcd461e18c4f0183c84fa3973e5a557af47c5348bb75 |

    These are unpublished local candidate packages; there is no version bump or release.

    Observed clean Windows x64 package-load proof

    Separate build and runtime guests were used. The runtime environment was Windows 11 Enterprise Insider x64 build 29683, without desktop VC redistributable DLLs or development tools, before and after the proof. Relevant runtime registry keys were absent; System32/SysWOW64 VC runtime files were absent and system-directory load probes failed with Win32 error 126. Inbox packaged AppX VCLibs frameworks were present but not desktop-load accessible; they are not being described as absent.

    | Exact consumer bytes | Node 22.23.4 | Node 24.22.1 |
    | --- | --- | --- |
    | Published x64 0.4.2 | Main + inherited Worker: ERR_DLOPEN_FAILED; identity helper-unavailable | Same |
    | Published x64 0.5.0 | Main + inherited Worker: ERR_DLOPEN_FAILED; identity helper-unavailable | Same |
    | Packed root + x64 candidate pair above | Main + inherited Worker: native loaded, direct require passed, real self identity | Same |

    Published x64 addon SHA-256 controls: 0.4.2 = 82a1e12aa3f254184a0f2e04fcb94b609695f806c40e09e653a91aca763c36bb; 0.5.0 = 03c439fe057d794ab803ee3a0b18ea762b272cf804e479d14cc2da50a4dfa588. Registry integrity was verified. The new PE validator rejected both controls for VCRUNTIME140.dll before the linkage change.

    The candidate used default/auto native mode and Workers inheriting --conditions=proc-safe-crt-proof, not success-shaped fallbacks. Module observations showed system ucrtbase.dll and no external VC runtime. The committed standalone installed-package smoke passed on both Node majors using the exact packed root/platform pair. The unchanged published 0.5.0 consumer still failed afterward, showing the environment was not repaired to mask the defect.

    Reviewer-accessible actual output and before/after environment receipt excerpts are now attached in the clean-x64 proof comment, including both Node majors, default-mode main/Worker results, exact hashes, packed installed-smoke output and unchanged published controls. Private controller endpoints/user identifiers are omitted; original record SHA-256 identities are preserved. This publishes existing proof, not a replay or an ARM64 execution claim.

    Original addon validation (d1b8 source/artifacts above)

  • Eleven focused PE binary-behavior regression cases passed.

  • Required-native pnpm check: 19 files, 129 tests passed, eight pre-existing unsupported-platform skips.

  • Portable native suite (node --test scripts/native-runtime.test.mjs): five passed, zero skips, actual process exit code 0.

  • cargo clippy --workspace --locked -- -D warnings and cargo test --workspace --locked passed; the latter had zero Windows Rust unit cases.

  • Real root-only npm/pnpm package-consumer checks, package contract checks and stock Git whitespace checks passed.

  • Normal actionable local ClawSweeper review completed across the full nine-file patch with no findings, including P1/P2 correctness scope. This is separate from the earlier P0-only autoreview and is not a claim of hosted review completion.
  • The full AppContainer/fixture suite ran in a separate guest's interactive session, not the clean runtime guest: a minimal control demonstrated pre-JavaScript initialization failure from SSH service session 0. An x86-only redist was needed there for the unchanged x86 inspection fixture; no redist was installed on the attested clean runtime guest. Existing assertions, timeouts and platform skips were not weakened. All owned guests were released and verified removed.

    Current-head x86 fixture follow-up

    Actual reviewer-accessible fixture proof and before/after x86+x64 absence receipts.

    The original separate rustc invocation did not inherit the addon's environment-local flags. The correction extracts the identical flag sequence for both producers, routes CI through scripts/build-windows-inspect-fixture.mjs, and extends the existing validator narrowly for PE32 x86 executables. Release addon call sites retain strict default DLL validation. An actual-built-binary dependency regression and focused PE32 ordinary/delay-import tests were added.

    Final head/tree above matches all 184 files in the exact guest-built source archive SHA-256 0a0fe0cc2fdd97051d6a1cc5cf761405befd54982220af11ba1835dee55bb6b4. Actual candidate x86 EXE SHA-256 024a87b169f26c7558fcd9fb7fe6fc9ea2846fbc811fc5018ca604c776ff428a; raw-rustc control SHA-256 8bb30d4d574d2f3e3c8a2363c0a22a3c3d2893f15a6a0a8ff07e50e893bde10e. Candidate imports OS UCRT/system DLLs only, no delay imports; control imports VCRUNTIME140.dll.

    A fresh separate clean x64 runtime guest (Windows build 29683) had no x86/x64 desktop VC runtime before or after proof, including real 32-bit pointer-size-4 load probes returning error 126. On both Node 22.23.4 and 24.22.1, control reproduced 0xC0000135, candidate's real --launch child exited 0, and the unchanged committed scripts/inspect-proof.mjs passed five checks including real x86 arguments/environment inspection on main and Worker. No redist was installed there. The first task-harness consumer folder was misnamed and caused an initial isSupported() failure; that output was preserved, only the task-only layout was corrected, and the unchanged scenario then passed. No assertion/timeout was relaxed.

    The rebuilt validation x64 addon has its own SHA-256 8ba4aa7f8fc902e5ff1d1305cdd0b4fbf0a65c5b7bac45b49db9617572b40ee4; it is not the earlier packed candidate hash. Its imports still match the approved policy. The earlier transferred ARM64 packages remain separately identified and untouched; this fixture-only follow-up does not request repeating unaffected ARM64 evidence.

    Current-source checks: default pnpm check passed 123 tests with 16 native-mode/platform skips; required-native focused inspection/PE tests passed 35 with two Darwin-only skips. Normal actionable local ClawSweeper reviewed all 12 branch paths at snapshot c3d1be83df267f5d6fdcab8fbaba00366c0fc3c6, no code findings. Only the new builder was then normalized CRLF-to-LF, with canonical equivalence recorded and final LF bytes actually built/tested above. Shared autoreview explicitly included P1/P2 and was also clean. Runtime readiness gaps were not represented as a clean source-review finding.

    Returned ARM64 execution and remaining CI gate

    Native Windows ARM64 execution evidence has now been returned and independently qualified. Actual reviewer-accessible ARM64 output, architecture/package/source receipts and limits cover the identified prebuilt packed root/ARM64 pair under native ARM64 Node 22.23.4/24.22.1, main and inherited Workers, direct require, real self identity and the unchanged committed installed-package smoke. The earlier cross-build/import checks are supporting evidence, not the basis for this execution claim.

    The returned run used a task-owned native Hyper-V Windows ARM64 guest on the remote ARM64 machine, Windows 11 Pro Insider Preview build 29576. CIM CPU architecture 12, IsWow64Process2(native 0xaa64, process 0), actual ARM64 Node admission, official executable hashes and ARM64 addon bytes agree. All 112 returned-file manifest hashes/sizes and all 183 transported source hashes matched. Published ARM64 0.4.2/0.5.0 failed with ERR_DLOPEN_FAILED/helper-unavailable on both Node majors and both threads (eight observations), while the exact candidate loaded/returned real identity on both majors/threads (four observations); eight post-candidate published controls remained unchanged. Both genuine packed installed-smoke invocations exited 0. Published probes used observe; their failures were recorded, not required as an equipped-laptop assumption. No product assertion or timeout was relaxed.

    Actual returned ARM64 outcome matrix

    All cells below are native ARM64 Windows 11 build 29576, official ARM64 Node executables, and the identified prebuilt artifacts above; both threads inherit --conditions=proc-safe-crt-proof.

    | ARM64 artifact / scenario | Node 22.23.4 main + Worker | Node 24.22.1 main + Worker |
    | --- | --- | --- |
    | Published 0.4.2 | Both: native/direct require ERR_DLOPEN_FAILED; identity helper-unavailable | Both: same observed failure |
    | Published 0.5.0 | Both: native/direct require ERR_DLOPEN_FAILED; identity helper-unavailable | Both: same observed failure |
    | Exact candidate 0.5.0 root + ARM64 package | Both: loaded, direct require passed, real self identity | Both: same actual success |
    | Unchanged committed packed installed-smoke | Exit 0; main + Worker identity/ancestry/inspection/platform selection passed | Exit 0; same actual success |
    | Post-candidate published controls | Four main/Worker observations remain failed | Four main/Worker observations remain failed |

    This is 12 primary observations plus eight post-candidate control observations, and two installed-smoke process exits. Complete selected actual stdout/error/architecture/hash/exit receipts are publicly accessible here; this matrix restates the already reviewed records rather than adding a new run or claim.

    Retained ARM64 limits: execution of the identified prebuilt cross-built artifact, not a fresh build/pack from the later head; no independently attested pristine-image qualification (normal Crabbox OpenSSH/MinGit/Node bootstrap occurred). Relevant VC registry keys were absent, native external-VC LoadLibraryW checks failed with 126, UCRT loaded from System32, and reported Node modules had no external VC runtime. This is scoped runtime-unavailability evidence. The after-inventory module batch serialized parallel arrays with generic Signature=System.Object[] and one Origin label; individually valid per-module signature/origin claims are not made. Scalar UCRT signature was UnknownError, not promoted to Valid; AppxVCLibs={} is not exhaustive absence. Deliberate capture exit17, initial supplemental PowerShell alias failure and provisioning limitations remain in the returned evidence. Cleanup is supported by remote receipts, not local-machine state.

    The original handoff/inputs and returned raw evidence remain untouched. Existing clean-x64 and clean-x86 proofs remain separately identified. The completed-evidence hosted review explicitly accepted the ARM64 proof at current head 18471bde8ae86415663610a868264bda43356d72: overall 5/6, proof 5/6, patch 5/6, no findings. The code/proof review bar is met. This PR is Ready for review (non-draft), marked ready by paulcam206 at 2026-11-11T19:36:17Z. Before merge, maintainer authorization and successful required current-head CI remain necessary: run 42931345464 is action_required with zero jobs. Ready status does not mean CI passed; Socket reports are not native CI. No further evidence-return or Ready-signoff request is outstanding. No every-supported-Windows qualification, downstream Gateway/MSIX adoption or performance claim is made.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: steipete Review duration: 4498m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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 #40"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%