Skip to content

Promote develop to main: Survive a NUL-Byte Registered Path in the Skills Installer Report - #2193

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 1, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes develop to main, carrying #2192.

  • Close the Installer Gaps Left After the Marketplace Re-Point Fix #2192 stops scripts/skills_install.py --report from crashing on a registered marketplace path that carries a NUL byte. git_in() now catches ValueError and still re-raises UnicodeDecodeError, so undecodable git output is never read as a clean tree. The installer's message, --report's reason, and scripts/README.md now say a registered path that is gone, or that holds a plain file, "is not a directory".
  • The issue's third item, the refresh cadence's --snapshot-only wording, is not carried here. That flag registers nothing, so the proposed wording would strand a machine with no install. Which surface owns the cadence is now decision Settle Which Surface Owns the Skills Refresh Cadence and Which Flag Each Runs #2191.

Fixes #2019

🤖 Generated with Claude Code

## Summary

Closes the installer gaps #2019 names, apart from its third item.

- **`git_in()` catches `ValueError`**, so `--report` survives a
registered marketplace path carrying a NUL byte instead of crashing in
`subprocess.run`. It re-raises `UnicodeDecodeError`, a `ValueError`
subclass, so undecodable git output still raises as before rather than
reading as "no answer", which would let a dirty tree be stamped clean.
- **The "gone" wording now says "is not a directory".** The installer's
stderr line, `--report`'s reason, and `scripts/README.md` all say that
instead of "no longer exists" / "does not exist", which was wrong where
a plain file sits at the registered path.
- **The third item, the refresh cadence's `--snapshot-only` wording, is
not changed here.** A local review showed that `--snapshot-only`
registers nothing, so the issue's proposed wording would leave a machine
with no install, or a gone registration, without the Claude Code
channel. Two rounds of carve-outs did not converge, so this branch
reverts to the develop wording. The ownership question moves to #2191
(`decision`).

## Tests

- New `LiveChannelCase` tests cover a NUL-byte registered path (with no
subprocess mock, since subprocess itself refuses the path) and a plain
file at the registered path.
- A new `GitInCase` test checks that `UnicodeDecodeError` is raised, not
swallowed.
- With each fix reverted, its test fails: the NUL test errors with
`ValueError: embedded null byte`, and the decode test fails.
- `python3 -m unittest tests.test_skills_install`: 74 tests, OK.
- The pre-commit gates (ruff, mypy, prose, eol), `build_dist.py
--check`, `spec/validate.py`, and `docker_lint.py` all pass.

## Known, not fixed here

- The `git_in` docstring's "None on any failure" was already untrue for
`UnicodeDecodeError` before this change.
- `source_ref()` reads a `None` status as clean. That is #1869.

Refs #2019. The closing keyword goes on the promotion PR.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 02:28
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1786293f-5549-4108-9019-0025ed1a6bd8

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

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

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.61%. Comparing base (15b7e6a) to head (8679432).
⚠️ Report is 300 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2193      +/-   ##
==========================================
+ Coverage   56.60%   56.61%   +0.01%     
==========================================
  Files          16       16              
  Lines        7480     7482       +2     
==========================================
+ Hits         4234     4236       +2     
  Misses       3246     3246              
Flag Coverage Δ
python-3.13 56.61% <100.00%> (+0.01%) ⬆️

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.

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.

Copilot review overview

🟢 Approval recommended

The carried fix is small, self-contained, logically correct per verification of the exception ordering, and fully covered by new tests with consistent wording across code, tests, and docs.

Review effort: Balanced
Findings: None

What changed in this PR

This promotion PR merges develop into main, carrying a single hardening fix to the fleet Skills installer (scripts/skills_install.py). It stops skills_install.py --report from crashing when the registered Claude Code marketplace path carries a NUL byte, while ensuring undecodable git output is still surfaced rather than silently read as a clean tree. It also corrects user-facing wording for the "gone registration" case from "no longer exists" to "is/no longer a directory", which is accurate when a plain file sits at the registered path.

Changes:

  • git_in() now swallows ValueError (alongside OSError/TimeoutExpired) so a NUL-byte registered path is reported instead of crashing, but explicitly re-raises UnicodeDecodeError so undecodable output is never read as "no answer".
  • Updated the installer message, --report reason, and scripts/README.md to say the registered path "is not / is no longer a directory".
  • Added tests covering a NUL-byte registered path, a plain file at the registered path, and the UnicodeDecodeError re-raise.
File Description
scripts/​skills_install.py Hardens git_in() exception handling and updates the two "gone registration" messages to directory-based wording.
tests/​test_skills_install.py Adds tests for NUL-byte path, file-at-path, and decode re-raise; updates assertions to new wording.
scripts/​README.md Aligns the installer's documented re-point behavior wording with the code change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit 3442449 into main Oct 1, 2026
11 checks passed
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.

Close the Installer Gaps Left After the Marketplace Re-Point Fix

2 participants