Skip to content

Skip an Unreadable winget Log and Match a Package Id Whole - #3857

Merged
ptr727 merged 3 commits into
developfrom
fix/promotion-3856-findings
Nov 4, 2026
Merged

ptr727 merged 3 commits into
developfrom
fix/promotion-3856-findings

Conversation

@ptr727

@ptr727 ptr727 commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Answers the findings on promotion #3856, whose head is develop, so a code fix lands here first. Each test below failed before its fix, measured on native Windows 11.

  • A locked winget log no longer aborts the failure report. Select-String was the one log read with no -ErrorAction, so under the installer's Stop preference it threw. Measured under pwsh 7 and Windows PowerShell 5.1. A throw there would also skip the Docker maintenance exit that follows the report.
  • A package id in winget's own log matches whole. A hyphen counts as part of an id, so Portable.Tool does not take a log naming Portable.Tool-Extra or Vendor-Portable.Tool.
  • An undecodable claude listing returns None, as claude_json documents, where it raised before. git_in keeps raising on purpose, since None from it could read as a clean tree, and its docstring now says so.

The full suite passes natively from Git Bash on this head.

Findings from the local passes

A pass raised that the installer-log filter <id>.*.log also takes a longer id, such as OpenJS.NodeJS.LTS for OpenJS.NodeJS. c6a423be added a name filter for it, and the next pass raised two findings against that filter. 87abc727 removes the filter, which answers both, and these are their outcomes.

  • host-setup/windows/install-tools.ps1, the longer-id match, class introduced. Declined under GOVERNANCE.md "Trust Boundaries and Hardening Effort". Packages install one at a time and the window opens just before each call, so a sibling's log falls inside it only where a second winget runs during the attempt.
  • host-setup/windows/install-tools.ps1, the filter as over-hardening, class introduced. Fixed in 87abc727.
  • host-setup/windows/install-tools.ps1, the filter dropping an attempt's own log where its version starts with neither a digit nor v, class introduced. Fixed in 87abc727.

The hyphen boundary needs the same second winget to matter, and it stays because it costs nothing. It cannot drop the attempt's own log, where the name filter could.

🤖 Generated with Claude Code

These answer the findings on promotion #3856.

`Select-String` was the one log read with no `-ErrorAction`, so under the
installer's `Stop` preference a locked `WinGet-*.log` aborted the failure report
for the tool that just failed. It now skips like the reads beside it.

The id pattern treated a hyphen as a boundary, though winget ids hold hyphens.
So `Portable.Tool` also matched a log naming `Portable.Tool-Extra`, and the report
could quote another package's failure.

`claude_json` documents `None` for a listing it cannot read, and an undecodable
one raised instead. It now catches `ValueError`, as `git_in` does.
The installer-log filter `<id>.*.log` also took a longer id, and the tool table
holds a real pair in `OpenJS.NodeJS` and `OpenJS.NodeJS.LTS`. The name must now
continue into a version, which every installer log on the measured host does.

`git_in` said it returned None on any failure, and undecodable output raises. It
differs from `claude_json` on purpose, since None from `git_in` could read as a
clean tree, while None from `claude_json` reads as unknown. The previous commit's
"as `git_in` does" holds only for the `ValueError` clause, not for that case.
Copilot AI lite review requested due to automatic review settings November 4, 2026 01:39
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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

@ptr727

ptr727 commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head c6a423be7d3adff565c5c7e11bbc84e1ca6ba31c, the content this pull request carries at that commit against develop, and it recorded 2 findings.

The filter answered a log from a sibling id, which needs a second winget running
during the attempt, since packages install one at a time and the window opens
just before each call. It cost more than that case does. An attempt's own log was
dropped where its version starts with neither a digit nor `v`, so the report lost
that package's reason. It did not achieve a whole-id match either, since a numeric
sibling id satisfies it.

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 two active moderate issues in log selection: it can associate a sibling package's log with the failed attempt and can omit valid logs for versions beginning with letters.

2 open issues
What changed in this PR

This pull request improves failure reporting for unreadable WinGet logs and undecodable CLI output, while adding regression coverage for these cases and package-ID matching.

Changes:

  • Treats undecodable claude output as unknown while preserving fail-closed git_in behavior.
  • Continues processing when WinGet logs are unreadable.
  • Adds tests for decoding failures, locked logs, and neighboring package IDs.
  • Adjusts installer-log filtering.

Two unresolved moderate findings remain in the installer-log filter: numeric sibling IDs can still match, and logs for alphabetic versions can be excluded.

File Description
tests/​test_skills_install.py Tests handling of undecodable Claude listings.
tests/​test_install_tools.py Covers locked WinGet logs and package-log matching scenarios.
scripts/​skills_install.py Handles Claude decode failures and documents Git output behavior.
host-setup/​windows/​install-tools.ps1 Filters installer logs and suppresses unreadable WinGet-log errors.

Review effort: Lite

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

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.31%. Comparing base (36947ab) to head (87abc72).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3857   +/-   ##
========================================
  Coverage    83.31%   83.31%           
========================================
  Files           29       29           
  Lines         9956     9956           
========================================
  Hits          8295     8295           
  Misses        1661     1661           
Flag Coverage Δ
python-3.13 83.31% <100.00%> (ø)

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 4, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 87abc727f0a41ce5d8f20c73b6e989966b48b509, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit c86ee86 into develop Nov 4, 2026
11 of 13 checks passed
@ptr727
ptr727 deleted the fix/promotion-3856-findings branch November 4, 2026 02:26
ptr727 added a commit that referenced this pull request Nov 4, 2026
…#3856)

Promotes the changes merged into `develop` since promotion #3849 to
`main`.

- [#3851](#3851) reads
winget's own log for a failed install or upgrade in
`host-setup/windows/install-tools.ps1`, so a portable package whose
files are in use names the processes holding them.
- [#3855](#3855) runs each
`claude` child in `scripts/skills_install.py` through the path
`shutil.which` returned, so an npm `claude.cmd` shim is reached. It also
makes a report child's deadline hold on Windows, where a 3-second
deadline over a stalled git took 20.1 seconds and now takes 3.2.
Measured on native Windows 11, with the full suite passing there.
- [#3857](#3857) answers
this promotion's first review round. A locked winget log no longer
aborts the failure report, a package id in winget's own log matches
whole, and an undecodable `claude` listing reads as unknown.

Fixes #1754

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants