Skip to content

Harden Windows WSL runtime setup - #76731

Merged
pelikhan merged 7 commits into
mainfrom
copilot/graft-daily-intelligence-wsl-jobs
Nov 11, 2026
Merged

pelikhan merged 7 commits into
mainfrom
copilot/graft-daily-intelligence-wsl-jobs

Conversation

Copilot AI commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Windows jobs now bootstrap Node.js inside WSL and forward selected job environment variables. The bootstrap previously fetched the Node.js checksum list alongside the archive and did not guard against oversized WSLENV values.

  • Verify Node.js downloads: Validate the signed checksum manifest with gpgv and a pinned Node.js release-keyring revision before checking the archive.
  • Bound environment forwarding: Fail with an actionable error when WSLENV exceeds 32,767 characters.
  • Update generated output: Regenerate /home/runner/work/gh-aw/gh-aw/.github/workflows/windows.lock.yml.
gpgv --keyring nodejs-release-keyring.kbx \
  --output SHASUMS256.txt SHASUMS256.txt.asc
grep -F "  $archive" SHASUMS256.txt | sha256sum -c -

Copilot AI and others added 4 commits November 11, 2026 03:33
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Windows jobs to run inside WSL Harden Windows WSL runtime setup Nov 11, 2026
Copilot AI requested a review from gh-aw-bot November 11, 2026 03:59
@github-actions

Copy link
Copy Markdown
Contributor

Triage

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~6 AIC · ⌖ ~2 AIC · ⊞ 14.9K · ◷

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76731

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: sonnet55 high · ~6 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.5K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #76731

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-11T08:36:00Z
review_event: COMMENT
top_themes: [security verification test coverage]
files_reviewed: [pkg/workflow/jobs_test.go, pkg/workflow/windows_runner.go]
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one non-blocking test-coverage issue: the signature-verification test does not assert verification ordering or that the verified manifest is the one checked. Inline comment posted. The implementation otherwise looks reasonable based on static review; no tests/builds were run per review constraints.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread pkg/workflow/jobs_test.go Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd to this bug_fix hardening change. No blocking defects found, but the Node.js keyring pin needs confirmation before merge.

📋 Key Themes & Highlights

Verified

  • ✅ TestRenderStepForRunner passes at PR head.
  • ✅ gpgv accepts a genuine clearsigned SHASUMS256.txt.asc and rejects both a tampered manifest and a wrong-key manifest.
  • ✅ Recompiling windows.md and the three reviewer workflows from PR head reproduces the committed lock files exactly.
  • ✅ The WSLENV guard runs before $env:WSLENV is set, so an oversized environment fails cleanly.

Open Items

  • Keyring pin: the commit SHA is unconfirmed (see inline comment on windows_runner.go).
  • Test strength: the new assertions do not enforce ordering (see inline comment on jobs_test.go).

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/workflow/windows_runner.go Outdated
$ErrorActionPreference = 'Stop'
$env:WSLENV = 'RUNNER_TEMP/p:GH_AW_WSL_NODE_VERSION'
& wsl.exe --distribution Ubuntu --user root --exec bash -lc 'set -euo pipefail; version="${GH_AW_WSL_NODE_VERSION#v}"; if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid WSL Node.js version." >&2; exit 1; fi; archive="node-v${version}-linux-x64.tar.xz"; staging="$(mktemp -d)"; trap ''rm -rf "$staging"'' EXIT; curl -fsSL "https://nodejs.org/dist/v${version}/$archive" -o "$staging/$archive"; curl -fsSL "https://nodejs.org/dist/v${version}/SHASUMS256.txt" -o "$staging/SHASUMS256.txt"; cd "$staging"; grep -F " $archive" SHASUMS256.txt | sha256sum -c -; install_dir="/usr/local/lib/nodejs/node-v${version}-linux-x64"; mkdir -p "$install_dir"; tar -xJf "$archive" -C "$install_dir" --strip-components=1; ln -sfn "$install_dir" /usr/local/lib/nodejs/current; ln -sfn "$install_dir/bin/node" /usr/local/bin/node; ln -sfn "$install_dir/bin/npm" /usr/local/bin/npm; ln -sfn "$install_dir/bin/npx" /usr/local/bin/npx'
& wsl.exe --distribution Ubuntu --user root --exec bash -lc 'set -euo pipefail; version="${GH_AW_WSL_NODE_VERSION#v}"; if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid WSL Node.js version." >&2; exit 1; fi; archive="node-v${version}-linux-x64.tar.xz"; staging="$(mktemp -d)"; trap ''rm -rf "$staging"'' EXIT; curl -fsSL "https://nodejs.org/dist/v${version}/$archive" -o "$staging/$archive"; curl -fsSL "https://nodejs.org/dist/v${version}/SHASUMS256.txt.asc" -o "$staging/SHASUMS256.txt.asc"; curl -fsSL "https://raw.githubusercontent.com/nodejs/release-keys/481637f813e912c4aa3622d7964ab426c97b8e8d/gpg-only-active-keys/pubring.kbx" -o "$staging/nodejs-release-keyring.kbx"; gpgv --keyring "$staging/nodejs-release-keyring.kbx" --output "$staging/SHASUMS256.txt" "$staging/SHASUMS256.txt.asc"; cd "$staging"; grep -F " $archive" SHASUMS256.txt | sha256sum -c -; install_dir="/usr/local/lib/nodejs/node-v${version}-linux-x64"; mkdir -p "$install_dir"; tar -xJf "$archive" -C "$install_dir" --strip-components=1; ln -sfn "$install_dir" /usr/local/lib/nodejs/current; ln -sfn "$install_dir/bin/node" /usr/local/bin/node; ln -sfn "$install_dir/bin/npm" /usr/local/bin/npm; ln -sfn "$install_dir/bin/npx" /usr/local/bin/npx'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] The Node.js signature check relies on a keyring pinned to commit 481637f8.... I could not confirm that commit from the review sandbox, so please verify it exists and contains gpg-only-active-keys/pubring.kbx. Because the pin is a fixed snapshot, a Node release signed by a key added later will fail gpgv and break every WSL run.

💡 Suggested follow-up

Confirm the SHA with git ls-remote or the GitHub API. Add a short note on how to bump the pin when Node rotates release keys. Also confirm that every pinned Node version publishes SHASUMS256.txt.asc, since older releases may not.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the pinned nodejs/release-keys commit and confirmed its README documents gpg/pubring.kbx as the full keyring, including retired signers. Updated the pin’s keyring path, documented how to update the pin, and confirmed the workflow’s Node 24 release publishes SHASUMS256.txt.asc in commit 8592602.

Comment thread pkg/workflow/jobs_test.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The keyring excludes retired signers, causing valid Node.js releases to fail signature verification, and the WSLENV guard misses the 32,767-character rejection boundary.

2 open issues
What changed in this PR

Hardens the WSL runtime emitted by the gh-aw compiler for Windows jobs, focusing on Node.js download verification and environment forwarding.

Changes:

  • Verify Node.js checksum manifests with gpgv and a pinned release-keyring revision.
  • Add a WSLENV length guard and update rendering assertions.
  • Regenerate Windows workflow output and clarify allowed review events in generated tool descriptions.
File Description
pkg/​workflow/​windows_runner.go Adds signed-manifest verification and the environment-forwarding size guard.
pkg/​workflow/​jobs_test.go Updates assertions for bootstrap dependencies, verification, and the length guard.
.github/​workflows/​windows.lock.yml Incorporates the runtime changes into generated Windows jobs.
.github/​workflows/​pr-specification-reviewer.lock.yml Clarifies that review events allow COMMENT and REQUEST_CHANGES.
.github/​workflows/​pr-code-quality-reviewer.lock.yml Clarifies that review events allow COMMENT and REQUEST_CHANGES.
.github/​workflows/​ponytail-reviewer.lock.yml Clarifies that review events allow only COMMENT.

Review effort: Max (auto)

Comment thread pkg/workflow/windows_runner.go Resolved
"$environmentNames = $allowedEnvironmentVariables | Where-Object { $processEnvironment.Contains($_) }",
"$env:WSLENV = (($environmentNames | ForEach-Object { $value = [string]$processEnvironment[$_]; if ($pathVariableSet.Contains($_) -or $value -match '^(?:[A-Za-z]:[\\\\/]|\\\\\\\\)') { \"$_/p\" } else { $_ } }) -join ':')",
"$wslEnvironment = (($environmentNames | ForEach-Object { $value = [string]$processEnvironment[$_]; if ($pathVariableSet.Contains($_) -or $value -match '^(?:[A-Za-z]:[\\\\/]|\\\\\\\\)') { \"$_/p\" } else { $_ } }) -join ':')",
"if ($wslEnvironment.Length -gt 32767) { throw 'The Windows job environment exceeds the WSL forwarding limit.' }; $env:WSLENV = $wslEnvironment",
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/jobs_test.go:356): address unresolved feedback - Review comment
  3. Review (pkg/workflow/windows_runner.go:47): address unresolved feedback - Review comment
  4. Review (pkg/workflow/jobs_test.go:356): address unresolved feedback - Review comment
  5. Fix failing check lint-go-govulncheck (FAILURE): Check run.
  6. Fix failing check lint-go-govulncheck (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "106d2670871812f36237c286a837f9c2c0018f0a",
  "kind": "requested",
  "schema_version": "1",
  "state": "8a1216d11d5aba37e749357b1bd659a55ad3e31328c29b72a0213a97fcac36d2",
  "work": [
    "4ce4dd407e604d374ecd66edfd2afc18c54e2d0b3733dbac37ac8e9c8834fdba",
    "c6dfd69dc587fcdaa765021d16c2068a7ad3d8fa21f29d23378f81df5498bace",
    "dada2857b8e0436fccf7b0dd6544846b7b32161a52a9298b1dce1fb460f4a35d",
    "f1d8a22648c2a1dbf50a83879c785396b5e2501e7a76a1800b90d52310141450"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits November 11, 2026 09:11
…ntelligence-wsl-jobs

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 71/100 (impact 38 + urgency 18 + quality 15). Recommended action: batch_review. Batch: pr-batch:copilot-platform. Reason: platform hardening is valuable and targeted, but it is best reviewed with adjacent pipeline fixes.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~5 AIC · ⌖ ~2 AIC · ⊞ 15.9K · ◷

@pelikhan
pelikhan merged commit 09291ac into main Nov 11, 2026
68 checks passed
@pelikhan
pelikhan deleted the copilot/graft-daily-intelligence-wsl-jobs branch November 11, 2026 15:03
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[graft-intelligence] [graft] Daily intelligence: Windows jobs now run inside WSL (2026-11-10)

4 participants