Skip to content

fix(windows): redact private data from Windows bootstrap WSL output - #6009

Merged
cv merged 4 commits into
mainfrom
fix/windows-bootstrap-install-log-redaction
Jun 30, 2026
Merged

fix(windows): redact private data from Windows bootstrap WSL output#6009
cv merged 4 commits into
mainfrom
fix/windows-bootstrap-install-log-redaction

Conversation

@zyang-dev

@zyang-dev zyang-dev commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Hardens the Windows bootstrap’s WSL installation logs by removing PowerShell transcript metadata and generated temporary paths, reducing the risk that users accidentally include usernames, machine details, or local paths when copying output into bug reports. It also requests a reboot only when the WSL installer reports that one is required.

Changes

  • Strip PowerShell transcript headers and footers without relying on localized field names.
  • Remove transcript lines containing temporary exit-code and transcript file paths.
  • Fail closed when a transcript header is incomplete.
  • Gate the post-install reboot request on the WSL reboot-required message.
  • Preserve useful WSL command output for troubleshooting.
  • Add tests for localized metadata, temporary-path redaction, footer removal, malformed transcripts, reboot detection, and artifact cleanup.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: No changes to documented installation steps or options.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: zyang-dev 267119621+zyang-dev@users.noreply.github.com

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved WSL setup handling when Ubuntu installs successfully but the distro isn’t registered yet.
    • Reboot is now requested only when the install logs indicate it’s required; otherwise a clearer warning is shown.
    • WSL install/repair log output shown to users is sanitized to remove sensitive transcript details and file path information.
    • Repair flow now better detects “reboot required” messaging to trigger the correct behavior.
  • Tests

    • Expanded Windows bootstrap tests for Ubuntu install transcript redaction and reboot/request behavior in registration-failure scenarios.

Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7b98b835-0911-4250-863b-ba3f20c2503c

📥 Commits

Reviewing files that changed from the base of the PR and between 65eec13 and 3524227.

📒 Files selected for processing (2)
  • scripts/bootstrap-windows.ps1
  • test/bootstrap-windows.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/bootstrap-windows.ps1

📝 Walkthrough

Walkthrough

The WSL bootstrap script now sanitizes install logs before display, detects reboot requirements from log content, and conditionally reboots when Ubuntu is not registered after install. Tests add transcript redaction coverage and verify the no-reboot path.

Changes

WSL Install Log Sanitization and Conditional Reboot

Layer / File(s) Summary
Generic reboot detection helpers
scripts/bootstrap-windows.ps1
Adds Test-WslOutputRequiresReboot as a shared detection helper and refactors Test-WslRepairOutputRequiresReboot into a thin wrapper over it.
Log-handling subsystem: read, sanitize, display, detect reboot
scripts/bootstrap-windows.ps1
Adds Get-WslInstallLog, Convert-WslInstallLogForDisplay, an updated Write-WslInstallLog that accepts LogPath and StatusPath, and Test-WslInstallLogRequiresReboot.
Distro-not-registered conditional reboot flow
scripts/bootstrap-windows.ps1
Passes -StatusPath to Write-WslInstallLog and changes the Ubuntu install path to request reboot only when the install log indicates one is required.
Test coverage: transcript redaction and reboot handling
test/bootstrap-windows.test.ts
Expands the transcript fixture, asserts redacted output, adds sanitization edge-case coverage, and checks the no-reboot Ubuntu install path and cleanup behavior.

Sequence Diagram(s)

sequenceDiagram
  participant Write-WslInstallLog
  participant Get-WslInstallLog
  participant Convert-WslInstallLogForDisplay
  participant Test-WslInstallLogRequiresReboot
  Write-WslInstallLog->>Get-WslInstallLog: read log from disk
  Get-WslInstallLog-->>Write-WslInstallLog: raw log content
  Write-WslInstallLog->>Convert-WslInstallLogForDisplay: sanitize for display
  Convert-WslInstallLogForDisplay-->>Write-WslInstallLog: redacted output
  Test-WslInstallLogRequiresReboot->>Get-WslInstallLog: load log content
  Get-WslInstallLog-->>Test-WslInstallLogRequiresReboot: log text
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5950: Directly modifies the same WSL repair/reboot detection logic in scripts/bootstrap-windows.ps1, introducing the predecessor helper this PR refactors.

Suggested labels

area: install, bug-fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: redacting private data from Windows bootstrap WSL output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-bootstrap-install-log-redaction

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the fix/windows-bootstra... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/windows-bootstra... 3524227 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the fix/windows-bootstra... branch is 68%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main fix/windows-bootstra... 3524227 +/-
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 79%
src/lib/actions...dbox/rebuild.ts 74%
src/lib/state/sandbox.ts 72%
src/lib/shields/index.ts 70%
src/lib/onboard/preflight.ts 69%
src/lib/actions...licy-channel.ts 59%
src/lib/onboard...er-gpu-patch.ts 59%
src/lib/policy/index.ts 52%
src/lib/onboard.ts 20%

Updated June 29, 2026 19:51 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 2 suggestions · 4 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation of redaction across Windows 10/11 x64/ARM64 locales recommended
  • PRA-T4 Add or justify test follow-up: Runtime validation of reboot detection message across WSL installer versions recommended
  • PRA-1 In-scope improvement: Runtime validation of redaction across Windows 10/11 x64/ARM64 locales recommended in scripts/bootstrap-windows.ps1:754
  • PRA-2 In-scope improvement: Runtime validation of reboot detection message across WSL installer versions recommended in scripts/bootstrap-windows.ps1:1283

Findings index

ID Severity Category Location Required action
PRA-1 Improvement tests scripts/bootstrap-windows.ps1:754 Document as follow-up: run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64 with real WSL install to verify redaction matches actual Start-Transcript output across locales. Link follow-up issue if not already tracked.
PRA-2 Improvement tests scripts/bootstrap-windows.ps1:1283 Document as follow-up: verify reboot detection triggers correctly on real 'Changes will not be effective until the system is rebooted' message from wsl --install across WSL versions. Link follow-up issue if not already tracked.
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 2 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

  • None.

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

PRA-1 Improvement — Runtime validation of redaction across Windows 10/11 x64/ARM64 locales recommended

  • Location: scripts/bootstrap-windows.ps1:754
  • Category: tests
  • Problem: The Vitest unit tests thoroughly cover redaction logic with mocked PowerShell transcripts, but actual Start-Transcript output varies across Windows versions, architectures, and locales. Real-world validation would confirm the regex patterns match production transcript formats.
  • Impact: Low risk of production PII leakage if transcript format diverges from test fixtures. Unit tests cover known patterns (BOM, indentation, localized field names, missing separators) but cannot guarantee coverage of all locale variations.
  • Suggested action: Document as follow-up: run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64 with real WSL install to verify redaction matches actual Start-Transcript output across locales. Link follow-up issue if not already tracked.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64; inspect console output for '[PowerShell transcript metadata redacted.]' marker and absence of usernames, machine names, host paths, PSVersion.
  • Missing regression test: Runtime integration test on real Windows hosts across locales (cannot be added in Vitest harness). Existing unit tests in test/bootstrap-windows.test.ts cover all known patterns.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: PR description acknowledges locale variation; test fixtures include 'Benutzername' (German) and 'Computer' (localized) fields; PRA-T1/PRA-T2 from previous review document this gap

PRA-2 Improvement — Runtime validation of reboot detection message across WSL installer versions recommended

  • Location: scripts/bootstrap-windows.ps1:1283
  • Category: tests
  • Problem: Reboot detection relies on matching 'Changes will not be effective until the system is rebooted' in transcript output. WSL installer message wording may vary across versions.
  • Impact: If message wording changes, reboot may not be requested when needed (leaving system in inconsistent state) or requested unnecessarily (poor UX). Fail-closed behavior in Ensure-UbuntuWsl mitigates: no reboot message → no reboot request, throws with guidance.
  • Suggested action: Document as follow-up: verify reboot detection triggers correctly on real 'Changes will not be effective until the system is rebooted' message from wsl --install across WSL versions. Link follow-up issue if not already tracked.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Run wsl --install --no-distribution and wsl --install -d Ubuntu-24.04 on target Windows versions; capture Start-Transcript output; confirm 'Changes will not be effective until the system is rebooted' appears verbatim.
  • Missing regression test: Runtime integration test on real Windows hosts with actual WSL installer (cannot be added in Vitest harness). Existing unit test 'requests reboot when Ubuntu install exits before distro registration' covers the matching logic.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Test-WslOutputRequiresReboot uses exact string match; PRA-T2 from previous review documents this gap; fail-closed logic in Ensure-UbuntuWsl (line 1383-1392) mitigates false negatives
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64 with real WSL install to verify redaction matches actual Start-Transcript output across locales. Runtime/sandbox/infrastructure paths need behavioral runtime validation: scripts/bootstrap-windows.ps1. Unit tests cover all redaction logic branches with mocked PowerShell, but actual Start-Transcript output varies across Windows 10/11 x64/ARM64 locales and real wsl --install reboot message variations cannot be fully validated in the Vitest harness.
  • PRA-T2 Runtime validation — Verify reboot detection triggers correctly on real 'Changes will not be effective until the system is rebooted' message from wsl --install across WSL versions. Runtime/sandbox/infrastructure paths need behavioral runtime validation: scripts/bootstrap-windows.ps1. Unit tests cover all redaction logic branches with mocked PowerShell, but actual Start-Transcript output varies across Windows 10/11 x64/ARM64 locales and real wsl --install reboot message variations cannot be fully validated in the Vitest harness.
  • PRA-T3 Runtime validation of redaction across Windows 10/11 x64/ARM64 locales recommended — Document as follow-up: run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64 with real WSL install to verify redaction matches actual Start-Transcript output across locales. Link follow-up issue if not already tracked.
  • PRA-T4 Runtime validation of reboot detection message across WSL installer versions recommended — Document as follow-up: verify reboot detection triggers correctly on real 'Changes will not be effective until the system is rebooted' message from wsl --install across WSL versions. Link follow-up issue if not already tracked.
Since last review details

Current findings, using the urgency labels above:

PRA-1 Improvement — Runtime validation of redaction across Windows 10/11 x64/ARM64 locales recommended

  • Location: scripts/bootstrap-windows.ps1:754
  • Category: tests
  • Problem: The Vitest unit tests thoroughly cover redaction logic with mocked PowerShell transcripts, but actual Start-Transcript output varies across Windows versions, architectures, and locales. Real-world validation would confirm the regex patterns match production transcript formats.
  • Impact: Low risk of production PII leakage if transcript format diverges from test fixtures. Unit tests cover known patterns (BOM, indentation, localized field names, missing separators) but cannot guarantee coverage of all locale variations.
  • Suggested action: Document as follow-up: run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64 with real WSL install to verify redaction matches actual Start-Transcript output across locales. Link follow-up issue if not already tracked.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Run bootstrap-windows.ps1 on Windows 10/11 x64 and ARM64; inspect console output for '[PowerShell transcript metadata redacted.]' marker and absence of usernames, machine names, host paths, PSVersion.
  • Missing regression test: Runtime integration test on real Windows hosts across locales (cannot be added in Vitest harness). Existing unit tests in test/bootstrap-windows.test.ts cover all known patterns.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: PR description acknowledges locale variation; test fixtures include 'Benutzername' (German) and 'Computer' (localized) fields; PRA-T1/PRA-T2 from previous review document this gap

PRA-2 Improvement — Runtime validation of reboot detection message across WSL installer versions recommended

  • Location: scripts/bootstrap-windows.ps1:1283
  • Category: tests
  • Problem: Reboot detection relies on matching 'Changes will not be effective until the system is rebooted' in transcript output. WSL installer message wording may vary across versions.
  • Impact: If message wording changes, reboot may not be requested when needed (leaving system in inconsistent state) or requested unnecessarily (poor UX). Fail-closed behavior in Ensure-UbuntuWsl mitigates: no reboot message → no reboot request, throws with guidance.
  • Suggested action: Document as follow-up: verify reboot detection triggers correctly on real 'Changes will not be effective until the system is rebooted' message from wsl --install across WSL versions. Link follow-up issue if not already tracked.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Run wsl --install --no-distribution and wsl --install -d Ubuntu-24.04 on target Windows versions; capture Start-Transcript output; confirm 'Changes will not be effective until the system is rebooted' appears verbatim.
  • Missing regression test: Runtime integration test on real Windows hosts with actual WSL installer (cannot be added in Vitest harness). Existing unit test 'requests reboot when Ubuntu install exits before distro registration' covers the matching logic.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: Test-WslOutputRequiresReboot uses exact string match; PRA-T2 from previous review documents this gap; fail-closed logic in Ensure-UbuntuWsl (line 1383-1392) mitigates false negatives

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: wsl-e2e
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • wsl-e2e (high): Required because this PR changes Windows/WSL bootstrap and WSL lifecycle behavior. The existing WSL E2E workflow is the closest end-to-end Windows runner coverage for validating NemoClaw build and downstream full E2E behavior inside Ubuntu WSL.

Optional E2E

  • None.

New E2E recommendations

  • windows-installer-bootstrap (high): Existing WSL E2E coverage provisions WSL through workflow-owned steps and does not appear to execute scripts/bootstrap-windows.ps1 itself, so it may miss regressions in transcript redaction, reboot detection, RunOnce resume, Docker Desktop handoff, and interactive Windows bootstrap behavior.
    • Suggested test: Add a Windows bootstrap E2E job that runs scripts/bootstrap-windows.ps1 on a disposable Windows runner/VM with controlled WSL install states and asserts successful handoff, reboot-required handling, failed-registration handling, and sanitized log output.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • None. No dispatchable live Vitest scenario currently covers the changed Windows bootstrap / WSL distro-install behavior. The WSL typed scenario exists in the registry but is not live-supported by runtime-support, and the accompanying test change is outside test/e2e-scenario/.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • scripts/bootstrap-windows.ps1

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 3 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — On a Windows host, capture an actual `Start-Transcript` log from the WSL install window path and verify the displayed bootstrap output keeps WSL installer diagnostics while omitting username, machine, host command, status path, and log path.. The changed unit/PowerShell harness coverage is strong for parser and branch behavior, but this is Windows/WSL host bootstrap logic where a small amount of real runtime validation would improve confidence in platform transcript shape and native WSL output handling.
  • PRA-T2 Runtime validation — On a Windows host or equivalent controlled WSL fixture, verify that a successful `wsl --install -d Ubuntu-24.04` exit without distro registration and without the reboot-required message fails with manual Ubuntu guidance rather than requesting reboot.. The changed unit/PowerShell harness coverage is strong for parser and branch behavior, but this is Windows/WSL host bootstrap logic where a small amount of real runtime validation would improve confidence in platform transcript shape and native WSL output handling.
  • PRA-T3 Runtime validation — On a Windows host, verify that a successful install transcript containing `Changes will not be effective until the system is rebooted` still requests reboot after log redaction.. The changed unit/PowerShell harness coverage is strong for parser and branch behavior, but this is Windows/WSL host bootstrap logic where a small amount of real runtime validation would improve confidence in platform transcript shape and native WSL output handling.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/bootstrap-windows.test.ts (2)

688-740: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid locking this test to Write-Status wording.

Stubbing Write-Status and asserting exact warning strings couples the test to implementation text instead of the no-reboot behavior. The observable contract is already covered by the surfaced output, requestReboot === false, thrown guidance, and artifact cleanup. As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/bootstrap-windows.test.ts` around lines 688 - 740, The test is
over-coupled to internal Write-Status message text and should assert only the
no-reboot behavior exposed by Ensure-UbuntuWsl. Remove the Write-Status stub and
the exact warning-string checks tied to statusMessages, and instead verify the
public outcomes already surfaced in the test: stdout guidance, requestReboot
remains false, the expected thrown/returned outcome, and cleanup of the temp
artifacts. Keep the test anchored on Ensure-UbuntuWsl and the install flow
around Start-WslInstallInPowerShellWindow, not on implementation wording.

Source: Path instructions


676-680: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the fail-closed assertion exact.

This still passes if Convert-WslInstallLogForDisplay leaks static header text around the marker. Assert the trimmed output equals the redaction marker, or also exclude header labels like Windows PowerShell transcript start, Username:, and Machine:.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/bootstrap-windows.test.ts` around lines 676 - 680, The fail-closed check
in the Windows bootstrap transcript test is too loose, so it can still pass if
Convert-WslInstallLogForDisplay leaks surrounding header text. Tighten the
assertion around the existing marker by making the trimmed stdout exactly match
the redaction marker, or extend the negative checks in this test to exclude
transcript header labels such as Windows PowerShell transcript start, Username:,
and Machine: alongside the existing redaction assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/bootstrap-windows.ps1`:
- Around line 1370-1383: The reboot check in the WSL install flow is too
dependent on the English output string, so localized installs can miss a
required restart and incorrectly fall through to the final failure. Update the
unregistered-after-success handling around Test-WslInstallLogRequiresReboot and
the install result path to treat this case as reboot-required without matching
the literal message, and route it through Request-Reboot before the throw in the
same install command block.

---

Nitpick comments:
In `@test/bootstrap-windows.test.ts`:
- Around line 688-740: The test is over-coupled to internal Write-Status message
text and should assert only the no-reboot behavior exposed by Ensure-UbuntuWsl.
Remove the Write-Status stub and the exact warning-string checks tied to
statusMessages, and instead verify the public outcomes already surfaced in the
test: stdout guidance, requestReboot remains false, the expected thrown/returned
outcome, and cleanup of the temp artifacts. Keep the test anchored on
Ensure-UbuntuWsl and the install flow around Start-WslInstallInPowerShellWindow,
not on implementation wording.
- Around line 676-680: The fail-closed check in the Windows bootstrap transcript
test is too loose, so it can still pass if Convert-WslInstallLogForDisplay leaks
surrounding header text. Tighten the assertion around the existing marker by
making the trimmed stdout exactly match the redaction marker, or extend the
negative checks in this test to exclude transcript header labels such as Windows
PowerShell transcript start, Username:, and Machine: alongside the existing
redaction assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 010a133b-1a81-40aa-9319-f48acfb4e927

📥 Commits

Reviewing files that changed from the base of the PR and between e727fec and 83789eb.

📒 Files selected for processing (2)
  • scripts/bootstrap-windows.ps1
  • test/bootstrap-windows.test.ts

Comment thread scripts/bootstrap-windows.ps1
Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@zyang-dev
zyang-dev marked this pull request as draft June 29, 2026 19:11
@copy-pr-bot

copy-pr-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@zyang-dev
zyang-dev marked this pull request as ready for review June 29, 2026 19:31
@zyang-dev zyang-dev added platform: wsl Affects Windows Subsystem for Linux platform: windows Affects native Windows environments labels Jun 29, 2026
Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
@cv cv added v0.0.71 and removed v0.0.70 labels Jun 30, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the full installer diff and targeted coverage. Security pass: transcript metadata and generated status/log paths are removed before display; malformed transcript structure fails closed; no credential, dependency, privilege, or command-construction boundary is weakened. The localized reboot-message limitation falls back safely by stopping and preserving native WSL diagnostics. Required CI, WSL E2E, CodeRabbit, and both advisor checks are green at 3524227.

@cv
cv merged commit 95a7838 into main Jun 30, 2026
45 checks passed
@cv
cv deleted the fix/windows-bootstrap-install-log-redaction branch June 30, 2026 04:07
@jyaunches jyaunches mentioned this pull request Jun 30, 2026
21 tasks
jyaunches added a commit that referenced this pull request Jun 30, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the public documentation for NemoClaw v0.0.71 after scanning
commits since v0.0.70. Adds release notes and fills the remaining doc
gaps for Windows bootstrap diagnostics, OpenClaw agent auto-relock
warnings, auto-pair cadence tuning, and plugin-install recovery hints.

## Changes
- `docs/about/release-notes.mdx`: adds the v0.0.71 release-note section,
grouped by gateway recovery, OpenShell auth, policy provenance, day-two
maintenance, messaging/inference, and Windows setup.
- `docs/get-started/windows-preparation.mdx`: documents sanitized WSL
install output and reboot gating in the Windows bootstrap.
- `docs/reference/commands.mdx`: documents the host `agent` wrapper's
shields auto-relock warning and OpenClaw auto-pair watcher tuning
variables.
- `docs/reference/troubleshooting.mdx`: adds plugin-install network
failure recovery guidance and updates Windows WSL troubleshooting for
sanitized install logs and reboot-required handling.

Source summary:
- #6065 -> `docs/about/release-notes.mdx`: Notes explicit model override
preservation and gateway-log guard-chain recovery diagnostics.
- #5874 -> `docs/about/release-notes.mdx`: Summarizes host-mediated
`recover` and `gateway restart`, linking to lifecycle, command,
troubleshooting, and trusted-boundary docs already added by the source
PR.
- #5596 -> `docs/about/release-notes.mdx`: Summarizes OpenShell 0.0.71
gateway auth, loopback binding, and compatibility-container docs already
added by the source PR.
- #5797 and #5798 -> `docs/about/release-notes.mdx`: Summarizes
`policy-list` provenance, Restricted tier suppression, and Balanced tier
weather behavior already reflected in policy docs.
- #5784 -> `docs/about/release-notes.mdx`: Summarizes
`--destroy-user-data` and the safe `--yes` uninstall behavior already
documented in lifecycle and command docs.
- #6034 -> `docs/about/release-notes.mdx`: Summarizes custom Dockerfile
warm-build cache behavior already documented in the command reference.
- #5951 -> `docs/reference/commands.mdx`: Documents the stderr-only host
`agent` wrapper warning after recent shields auto-relock.
- #5387 -> `docs/reference/commands.mdx`: Documents OpenClaw auto-pair
watcher cadence and fast-reentry tuning variables.
- #5835 -> `docs/reference/troubleshooting.mdx`: Adds recovery guidance
for OpenClaw plugin-install network failures.
- #5995 and #5956 -> `docs/about/release-notes.mdx`: Summarizes
Microsoft Teams final-message delivery and runtime mention hints already
covered by messaging docs.
- #5716 -> `docs/about/release-notes.mdx`: Summarizes non-interactive
Ollama loopback safety already covered by local inference docs.
- #5505, #5527, and #5528 -> `docs/about/release-notes.mdx`: Summarizes
compatible local endpoint, model task-fit, and model capability audit
docs.
- #6009 -> `docs/get-started/windows-preparation.mdx`,
`docs/reference/troubleshooting.mdx`: Documents sanitized Windows
bootstrap WSL output and reboot-required gating.
- #6055 -> no additional source doc page change needed beyond the
already-merged quickstart update; release notes did not duplicate
routine quickstart cleanup.

No matching v0.0.71 GitHub announcement discussion was found in the
latest 20 discussions, so this refresh is based on the commit scan and
existing source PR docs.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: docs-only refresh with no
runtime behavior changes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [ ] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — ran
`npm run docs`; Fern reported 0 errors and 2 existing warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added a new release-notes entry covering gateway recovery,
authentication, network policy/provenance output, uninstall safety,
Windows bootstrap diagnostics, messaging defaults, and inference setup
guidance.
* Clarified Windows preparation steps around reboot behavior and
redacting troubleshooting transcripts.
* Expanded command reference details for OpenClaw wrapper behavior and
new auto-pair tuning options.
* Improved troubleshooting guidance for plugin installation issues, WSL
repair/reboot cases, and install timing problems.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…VIDIA#6009)

<!-- markdownlint-disable MD041 -->
## Summary
<!-- 1-3 sentences: what this PR does and why. -->
Hardens the Windows bootstrap’s WSL installation logs by removing
PowerShell transcript metadata and generated temporary paths, reducing
the risk that users accidentally include usernames, machine details, or
local paths when copying output into bug reports. It also requests a
reboot only when the WSL installer reports that one is required.

## Changes
<!-- Bullet list of key changes. -->
- Strip PowerShell transcript headers and footers without relying on
localized field names.
- Remove transcript lines containing temporary exit-code and transcript
file paths.
- Fail closed when a transcript header is incomplete.
- Gate the post-install reboot request on the WSL reboot-required
message.
- Preserve useful WSL command output for troubleshooting.
- Add tests for localized metadata, temporary-path redaction, footer
removal, malformed transcripts, reboot detection, and artifact cleanup.


## Type of Change

- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [ ] Docs updated for user-facing behavior changes
- [x] Docs not applicable — justification: No changes to documented
installation steps or options.
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [ ] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Improved WSL setup handling when Ubuntu installs successfully but the
distro isn’t registered yet.
* Reboot is now requested only when the install logs indicate it’s
required; otherwise a clearer warning is shown.
* WSL install/repair log output shown to users is sanitized to remove
sensitive transcript details and file path information.
* Repair flow now better detects “reboot required” messaging to trigger
the correct behavior.

* **Tests**
* Expanded Windows bootstrap tests for Ubuntu install transcript
redaction and reboot/request behavior in registration-failure scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: zyang-dev <267119621+zyang-dev@users.noreply.github.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Refreshes the public documentation for NemoClaw v0.0.71 after scanning
commits since v0.0.70. Adds release notes and fills the remaining doc
gaps for Windows bootstrap diagnostics, OpenClaw agent auto-relock
warnings, auto-pair cadence tuning, and plugin-install recovery hints.

## Changes
- `docs/about/release-notes.mdx`: adds the v0.0.71 release-note section,
grouped by gateway recovery, OpenShell auth, policy provenance, day-two
maintenance, messaging/inference, and Windows setup.
- `docs/get-started/windows-preparation.mdx`: documents sanitized WSL
install output and reboot gating in the Windows bootstrap.
- `docs/reference/commands.mdx`: documents the host `agent` wrapper's
shields auto-relock warning and OpenClaw auto-pair watcher tuning
variables.
- `docs/reference/troubleshooting.mdx`: adds plugin-install network
failure recovery guidance and updates Windows WSL troubleshooting for
sanitized install logs and reboot-required handling.

Source summary:
- NVIDIA#6065 -> `docs/about/release-notes.mdx`: Notes explicit model override
preservation and gateway-log guard-chain recovery diagnostics.
- NVIDIA#5874 -> `docs/about/release-notes.mdx`: Summarizes host-mediated
`recover` and `gateway restart`, linking to lifecycle, command,
troubleshooting, and trusted-boundary docs already added by the source
PR.
- NVIDIA#5596 -> `docs/about/release-notes.mdx`: Summarizes OpenShell 0.0.71
gateway auth, loopback binding, and compatibility-container docs already
added by the source PR.
- NVIDIA#5797 and NVIDIA#5798 -> `docs/about/release-notes.mdx`: Summarizes
`policy-list` provenance, Restricted tier suppression, and Balanced tier
weather behavior already reflected in policy docs.
- NVIDIA#5784 -> `docs/about/release-notes.mdx`: Summarizes
`--destroy-user-data` and the safe `--yes` uninstall behavior already
documented in lifecycle and command docs.
- NVIDIA#6034 -> `docs/about/release-notes.mdx`: Summarizes custom Dockerfile
warm-build cache behavior already documented in the command reference.
- NVIDIA#5951 -> `docs/reference/commands.mdx`: Documents the stderr-only host
`agent` wrapper warning after recent shields auto-relock.
- NVIDIA#5387 -> `docs/reference/commands.mdx`: Documents OpenClaw auto-pair
watcher cadence and fast-reentry tuning variables.
- NVIDIA#5835 -> `docs/reference/troubleshooting.mdx`: Adds recovery guidance
for OpenClaw plugin-install network failures.
- NVIDIA#5995 and NVIDIA#5956 -> `docs/about/release-notes.mdx`: Summarizes
Microsoft Teams final-message delivery and runtime mention hints already
covered by messaging docs.
- NVIDIA#5716 -> `docs/about/release-notes.mdx`: Summarizes non-interactive
Ollama loopback safety already covered by local inference docs.
- NVIDIA#5505, NVIDIA#5527, and NVIDIA#5528 -> `docs/about/release-notes.mdx`: Summarizes
compatible local endpoint, model task-fit, and model capability audit
docs.
- NVIDIA#6009 -> `docs/get-started/windows-preparation.mdx`,
`docs/reference/troubleshooting.mdx`: Documents sanitized Windows
bootstrap WSL output and reboot-required gating.
- NVIDIA#6055 -> no additional source doc page change needed beyond the
already-merged quickstart update; release notes did not duplicate
routine quickstart cleanup.

No matching v0.0.71 GitHub announcement discussion was found in the
latest 20 discussions, so this refresh is based on the commit scan and
existing source PR docs.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates
<!-- Check all that apply. For any "covered by existing tests", "not
applicable", or waiver entry, add a brief justification on the same line
or in the Changes section. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: docs-only refresh with no
runtime behavior changes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
<!-- Check each item you ran and confirmed. Leave unchecked items you
skipped. Doc-only changes do not require npm test unless you ran it. -->
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [ ] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — ran
`npm run docs`; Fern reported 0 errors and 2 existing warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added a new release-notes entry covering gateway recovery,
authentication, network policy/provenance output, uninstall safety,
Windows bootstrap diagnostics, messaging defaults, and inference setup
guidance.
* Clarified Windows preparation steps around reboot behavior and
redacting troubleshooting transcripts.
* Expanded command reference details for OpenClaw wrapper behavior and
new auto-pair tuning options.
* Improved troubleshooting guidance for plugin installation issues, WSL
repair/reboot cases, and install timing problems.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Co-authored-by: Prekshi Vyas <34834085+prekshivyas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: windows Affects native Windows environments platform: wsl Affects Windows Subsystem for Linux

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants