Skip to content

Probe Each Python Candidate in install.ps1 and Bound the Profile Mask - #4335

Merged
ptr727 merged 7 commits into
developfrom
burndown/windows-ps1-probe-and-profile
Nov 22, 2026
Merged

ptr727 merged 7 commits into
developfrom
burndown/windows-ps1-probe-and-profile

Conversation

@ptr727

@ptr727 ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • install.ps1 now runs each of py -3, python3, and python with a probe only Python 3.11 or newer passes, leaves the probe's stderr visible, and falls through on a mismatch. The WindowsApps python3 alias stub (exit 9009) is passed over. This mirrors install.sh. The maintainer approved the shape on Probe Each Interpreter install.ps1 Tries Rather Than Taking the First One Found #4031 on 2026-11-19.
  • install-tools.ps1 masks the profile in installer and winget log lines unless a folder-name character follows it, so a sibling such as <profile>a or <profile>.000 stays whole, while a bare profile before a quote, colon, or sentence period is still masked. A sibling folder whose name continues after a space is not told apart from the profile followed by text.
  • New tests/test_install_ps1.py drives install.ps1 under pwsh against stub candidates, one of them running the real probe text. A lifted Write-InstallFailure test sits in TestInstallAgentsWindowsHelpers, so the native Windows runner runs both.

This edits host-setup/agent-safety/, so it waits for the maintainer's read of the diff. Do not merge before that.

Closes on promotion: #4031, #4113

🤖 Generated with Claude Code

ptr727 and others added 4 commits November 21, 2026 19:56
install.ps1 now runs each of py -3, python3, and python with a probe only
Python 3.11 or newer passes, skipping the WindowsApps alias stub.
install-tools.ps1 masks the profile in log lines only at a path component.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 22, 2026
Copilot AI lite review requested due to automatic review settings November 22, 2026 04:05
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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 change still has an unresolved profile-boundary bug for dot-hyphen sibling directories, and its regression test does not verify that the Store stub’s diagnostic remains visible.

2 open issues
What changed in this PR

This pull request hardens Windows host setup by probing each Python candidate before selection and improving profile masking in installer logs.

Changes:

  • Probes py -3, python3, and python for Python 3.11 or newer while preserving probe diagnostics.
  • Bounds profile replacement to avoid masking sibling directory names.
  • Adds PowerShell-backed tests for interpreter selection, fallback behavior, and log-path masking.
File Description
tests/​test_install_ps1.py Adds PowerShell tests for Python candidate probing, fallback behavior, diagnostics, and installer selection.
tests/​test_install_agents.py Extends native Windows helper coverage with tests for profile masking in installer failure logs.
host-setup/​windows/​install-tools.ps1 Applies boundary-aware profile masking to installer and winget log paths.
host-setup/​agent-safety/​claude/​install.ps1 Probes each available Python candidate and selects the first one that satisfies the Python 3.11+ requirement.

Review effort: Lite

Comment thread host-setup/windows/install-tools.ps1 Resolved
Comment thread tests/test_install_ps1.py Resolved
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.15%. Comparing base (66dd36c) to head (8fe9fcf).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4335   +/-   ##
========================================
  Coverage    79.15%   79.15%           
========================================
  Files           45       45           
  Lines        15926    15926           
========================================
  Hits         12606    12606           
  Misses        3320     3320           
Flag Coverage Δ
python-3.13 79.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 8fe9fcf6a192df38c09942addf506652f67aeb06, the content this pull request carries at that commit against develop, and it recorded 1 finding.

@ptr727

ptr727 commented Nov 22, 2026

Copy link
Copy Markdown
Owner Author

Local pass finding on install-tools.ps1 (profile mask masks a sibling like bob(old) or bob#2): declined. The mask is a privacy heuristic on free-text log lines, where an unmasked account name costs more than a sibling folder shown as a profile child. The lookahead covers the realistic sibling shapes (letters, digits, underscore, hyphen, dot suffixes such as .000 and .-backup), and Hide-Home, which sees whole paths, stays exact. Punctuation-suffixed sibling profiles are not something Windows creates.

@ptr727
ptr727 merged commit 225c9fc into develop Nov 22, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/windows-ps1-probe-and-profile branch November 22, 2026 14:54
ptr727 added a commit that referenced this pull request Nov 22, 2026
…ocal Cover, UTF-8 Children (#4342)

Promotes the eight pull requests that landed on develop since the last
promotion.

- #4334: Create the PR with the `comments` label in drive-pr.
- #4337: Correct the reviewer reference on CodeRabbit in private
repositories.
- #4335: Probe each Python candidate in `install.ps1` and bound the
profile mask.
- #4336: Write kit files atomically through a temporary file beside each
target.
- #4338: Pin the governance sections the host CLAUDE.md blocks mirror.
- #4340: Let an attested pass cover a main head with no Copilot table.
- #4339: Rebase or append where an upstream rejects merges or rewrites.
- #4341: Pass `PYTHONIOENCODING` to every Python child a test decodes as
UTF-8.

Closes #1577
Closes #2274
Closes #4176
Closes #4322
Closes #3601
Closes #4317
Closes #4031
Closes #4113
Closes #3925

🤖 Generated with [Claude Code](https://claude.com/claude-code)


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

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Improvements**
* The Windows agent installer now detects a working Python 3.11+
interpreter and reports which options were unavailable or too old.
* Agent installation better preserves existing files if interrupted or
if a write fails.
* Installer logs more accurately distinguish profile paths from
similarly named folders.
* Pull request review guidance clarifies when local review coverage can
qualify and how labels affect review runs.
* **Documentation**
* Updated contribution, review, and agent setup guidance, including
governance synchronization checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants