Repository navigation
Skip an Unreadable winget Log and Match a Package Id Whole - #3857
Conversation
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.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
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.
There was a problem hiding this comment.
🟡 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
claudeoutput as unknown while preserving fail-closedgit_inbehavior. - 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
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
A recorded local strict-review pass covers head |
…#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)

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.Select-Stringwas the one log read with no-ErrorAction, so under the installer'sStoppreference 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.Portable.Tooldoes not take a log namingPortable.Tool-ExtraorVendor-Portable.Tool.claudelisting returnsNone, asclaude_jsondocuments, where it raised before.git_inkeeps raising on purpose, sinceNonefrom 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>.*.logalso takes a longer id, such asOpenJS.NodeJS.LTSforOpenJS.NodeJS.c6a423beadded a name filter for it, and the next pass raised two findings against that filter.87abc727removes the filter, which answers both, and these are their outcomes.host-setup/windows/install-tools.ps1, the longer-id match, classintroduced. Declined underGOVERNANCE.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, classintroduced. Fixed in87abc727.host-setup/windows/install-tools.ps1, the filter dropping an attempt's own log where its version starts with neither a digit norv, classintroduced. Fixed in87abc727.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