Skip to content

test(curate): regression cover write_changelog → auto-install wiring#120

Merged
aktasbatuhan merged 1 commit into
mainfrom
fix/auto-install-regression-test
Jun 5, 2026
Merged

test(curate): regression cover write_changelog → auto-install wiring#120
aktasbatuhan merged 1 commit into
mainfrom
fix/auto-install-regression-test

Conversation

@aktasbatuhan

Copy link
Copy Markdown
Member

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 no args parameter, so the NameError was swallowed by the surrounding bare except Exception and auto-install never actually ran. The fix threaded args through; 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_install path, 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_argsargs.auto_install=True must reach the installer and symlink skills into both harness dirs even when the project opt-in is off (the --auto-install path that broke).
  • test_write_changelog_propagates_args_auto_install_flag — the force value is read from args, 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:

auto-install failed (non-fatal): NameError: name 'undefined_args' is not defined
2 failed, 6 passed

Restored the fix → 8 passed. Full suite green: 517 passed.

🤖 Generated with Claude Code

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>
@aktasbatuhan aktasbatuhan merged commit 39b7838 into main Jun 5, 2026
7 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.

1 participant