Skip to content

Stop install-tools.ps1's Log Profile Replacement at a Path Component #4113

Closed

Description

@ptr727

Problem

Write-InstallFailure in host-setup/windows/install-tools.ps1 hides the profile in installer and winget log lines with $entry -ireplace [regex]::Escape($HOME), '%USERPROFILE%'. The match does not stop at a path component. So with a constructed $HOME of C:\Users\ann, a log line naming C:\Users\anna\AppData\... prints as %USERPROFILE%a\AppData\.... That reads as a path inside this profile.

It is the same class as the Hide-Home boundary fixed in #4105 and #4112. This site is the last one in that file. It was found by the attested local review of promotion #4096, where it sits in a file the promotion touches but on a line it does not change.

Fix

Use a replace pattern that requires a separator or the end of the text right after the profile path. For example, append (?=[\\/]|$) to the escaped home. Add a lifted-function test beside the Hide-Home copies test in TestInstallAgentsWindowsHelpers, so it runs on the native Windows runner.

Activity

  1. added
    pre-existing
    on Nov 12, 2026
  2. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim (round 3, 2026-11-22): branch burndown/windows-ps1-probe-and-profile. Predicted files: host-setup/agent-safety/claude/install.ps1, new tests/test_install_ps1.py, host-setup/windows/install-tools.ps1, tests/test_install_agents.py (shared with #4031). No other group may edit these files while this claim stands.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions