← Back to Pull requests

fix(windows): make recovery evidence authoritative #3789

Closed
unknown closed this pull request without merging on Aug 26, 2026 05:34 UTC
View on GitHub
unknown unknown commented on Aug 25, 2026 11:49 UTC
Author

Summary

This PR advances #2624 and the Windows support plan in #2142 by making the native recovery check eligible for branch protection and removing two deterministic failure groups from the Windows baseline.

  • restores windows_recovery on every pull request and main push;

  • declares windows_recovery beside test in the ASF-managed required status checks and locks the workflow/config relationship with a CI contract;

  • captures the marker fs.promises.open intrinsic at module initialization, while the Node 24 Windows initialization-race fixture patches it before dynamically importing the authority;

  • replaces the unsupported fsutil file queryStreams call with one bounded Windows stream query fed by Node's no-reparse tree walk;

  • checks the dependency root, nested directories, and regular files through FindFirstStreamW / FindNextStreamW, including Win32 namespaced paths for long-path compatibility;

  • keeps every query/start/timeout/output/parse/API failure fail-closed.
  • Runtime PTY cleanup is intentionally excluded because another contributor has already claimed that slice on #2624. The remaining Git fixture cleanup and symlink-permission inventory are also not folded into this PR.

    Why the ADS change is needed

    fsutil file queryStreams is not a supported subcommand on the current developer Windows build or the GitHub hosted runner. Normal dependency trees therefore failed before their receipt could be verified. The previous ADS test matched the words "alternate data stream" in the query-failure diagnostic, so it passed without proving a named stream had been observed.

    The replacement keeps traversal in Node, rejects reparse points before the external query, and sends a JSON array over stdin to one bounded Windows PowerShell 5.1 process. The process hosts the documented Win32 stream enumeration APIs because the PowerShell 5.1 provider does not enumerate directory streams. Only ERROR_HANDLE_EOF is accepted as no streams; other API and process failures reject the environment. Regressions now prove exact named-stream rejection for a regular file, the published dependency root, and a nested directory.

    Verification

    Local Windows, Node 24.19 for platform-sensitive tests:

  • managed dependency environment: 17 passed, 0 failed, 2 POSIX-only skips;

  • focused file/root/nested-directory ADS cases under Windows code page 936 with a Chinese root and entry: 3 passed, 0 failed, 0 skipped;

  • managed dependency crash recovery: 5 passed, 0 failed;

  • marker file: 7 passed, 0 failed;

  • focused root-authority concurrency selection: 4 passed, 0 failed;

  • CI planner and Windows harness: 76 passed, 0 failed, 1 privilege skip;

  • repository control-plane YAML contract: 1 passed, 0 failed;

  • npm run windows:inventory: current, 64 declarations;

  • lint, format, Core/Storage builds, and git diff --check: passed.
  • Hosted exact-head evidence:

  • windows_recovery: passed, including the strict UTF-8/non-ASCII managed-dependency ADS gate (3 tests / 3 pass / 0 skip), followed by every recovery step;

  • test: all steps through Runtime Host passed, then the independent prompt-rail virtualization timing issue #3862 failed Desktop e2e (65 passed, 1 failed, 1 skipped). The separate fix #3863 is exact-head green, including the full Desktop e2e suite.
  • The post-merge #3788/#3790 blockers were repaired by merged #3796. The overlapping schema-constructor handle fix is inherited from main and no longer appears in this PR diff. The marker P2 is closed by commit 917e3d110; the fixture binding clarification is in 648585896; the strict ADS gate is in 4645cec9c; the UTF-8 pipe fix is in b98f3b329.

    Administration boundary

    .asf.yaml is the repository's declarative branch-protection authority. After merge, ASF infrastructure must apply the updated main protection so windows_recovery is actually required. The workflow now reports that stable context on every PR and main push, so enabling it cannot leave unrelated PRs permanently pending.

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool and scope: Codex traced recent Windows baseline artifacts, reproduced the system API and handle failures on Windows/Node 24, implemented the storage and workflow changes, and ran the listed local gates.

    Refs #2624. Refs #2142.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, affected builds, Windows inventory, and focused Windows suites pass locally

  • Exact-head hosted windows_recovery passes on head b98f3b329 with strict UTF-8/non-ASCII ADS evidence

  • Exact-head hosted test passes; currently blocked only by independent #3862, fixed in green #3863
  • Does this PR entail a change in behavior?

  • Yes - windows_recovery returns to PR/main and becomes a required context; Windows storage validation now uses supported Win32 ADS enumeration for files and directories plus a portable marker-race interception boundary.

  • No
  • Diff: 647 lines (+485 / -162) across 8 files Reviewer: liugddx Review duration: 1064m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 647 lines diff across 8 files
    0.75
    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%
    60%
    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.387
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #3789"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 29.7% · Safe to merge
    29.7%
    Repository