Skip to content

[fix] Make uninstallDependency idempotent, matching installDependency - #96

Merged
kmturley merged 1 commit into
mainfrom
fix/dependency-idempotency
Jul 31, 2026
Merged

[fix] Make uninstallDependency idempotent, matching installDependency#96
kmturley merged 1 commit into
mainfrom
fix/dependency-idempotency

Conversation

@kmturley

Copy link
Copy Markdown
Member

Summary

  • installDependency() already treats "dependency already added at this version" as a no-op success. uninstallDependency() treated the mirror case ("not currently a dependency") as an error instead — an asymmetry flagged in an internal spec-compliance audit.
  • Removing a dependency that's already gone reaches the same requested end state as a successful removal, so it should succeed the same way most package managers treat "already removed"/"already installed": as idempotent success, not failure.
  • uninstallDependency() now mirrors installDependency()'s no-op pattern (log, mark installed, return the file unchanged) instead of throwing.
  • Updated specification.md's Install/Uninstall dependency logic sections to describe idempotent success for both cases instead of "return error".

Test plan

  • npm run check passes (format, lint, build, tests — 193/193)
  • Extended the existing add/remove dependency integration test to call installDependency/uninstallDependency a second time each, asserting idempotent success (same result, no throw) instead of an error

🤖 Generated with Claude Code

installDependency() already treats "dependency already added at this
version" as a no-op success. uninstallDependency() treated the mirror
case ("not currently a dependency") as an error instead - an
asymmetry flagged in an internal spec-compliance audit. Removing a
dependency that's already gone reaches the same requested end state
as a successful removal, so it should succeed the same way most
package managers treat "already removed"/"already installed": as
idempotent success, not failure.

uninstallDependency() now mirrors installDependency()'s no-op pattern
(log, mark installed, return the file unchanged) instead of throwing.
Updated specification.md's Install/Uninstall dependency logic sections
to describe idempotent success for both cases instead of "return
error".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kmturley
kmturley merged commit f310c9b into main Jul 31, 2026
6 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