test(curate): regression cover write_changelog → auto-install wiring#120
Merged
Conversation
The auto-install feature shipped in #113-era curate work was silently broken: write_changelog() called `_maybe_auto_install(..., force=args.auto_install)` but had no `args` parameter, so the NameError was swallowed by the surrounding bare `except Exception` and auto-install never ran. Fixed in #118 by threading `args` through; this adds the regression coverage that was missing. Three tests exercise the real write_changelog → _maybe_auto_install path (heavy git/state/index helpers stubbed so the test is hermetic): - force=args.auto_install reaches the installer and symlinks skills even with the project opt-in off (the --auto-install path that broke); - the force value is read from args, not a constant; - flag off installs nothing. Verified these fail (swallowed NameError → no install) against the buggy signature and pass on the fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #118.
#118 fixed a silent breakage in the auto-install feature:
write_changelog()ended with_maybe_auto_install(..., force=args.auto_install)but had noargsparameter, so theNameErrorwas swallowed by the surrounding bareexcept Exceptionand auto-install never actually ran. The fix threadedargsthrough; this PR adds the regression coverage that was missing so it can't silently break again.Tests (in
tests/test_auto_install.py)All three drive the real
write_changelog → _maybe_auto_installpath, with the heavy environment-touching helpers (_git_commit_artifacts,_publish_watchmen_state,_build_skill_index) stubbed so the test is hermetic and only the auto-install wiring is under test:test_write_changelog_force_installs_via_args—args.auto_install=Truemust reach the installer and symlink skills into both harness dirs even when the project opt-in is off (the--auto-installpath that broke).test_write_changelog_propagates_args_auto_install_flag— theforcevalue is read fromargs, not a constant (spy on_maybe_auto_install).test_write_changelog_no_install_when_flag_off— flag off + opt-in off installs nothing.Verified the tests actually catch it
Reintroduced the bug (undefined name in the swallowed call) and confirmed the two regression tests fail with the original symptom in captured output:
Restored the fix → 8 passed. Full suite green: 517 passed.
🤖 Generated with Claude Code