-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Description
Parent Issue
Part of #193 - Consolidate install-state.json manipulation with InstallStateManager
Depends on: #194 (foundation API must be merged first)
Summary
Update amplifier-app-cli to use the new InstallStateManager API from amplifier-foundation instead of directly manipulating install-state.json.
Scope: amplifier-app-cli
Files to Update
-
amplifier_app_cli/utils/update_executor.py- Replace
_invalidate_modules_with_missing_deps()function - Use
InstallStateManager.invalidate_modules_with_missing_deps()instead
- Replace
-
amplifier_app_cli/commands/reset.py- Replace direct JSON file deletion/manipulation
- Use
InstallStateManager.clear()instead
Files That Can Be Simplified
amplifier_app_cli/paths.pyget_install_state_path()may no longer be needed if all access goes throughInstallStateManager- Or keep it but only for constructing the
InstallStateManagerinstance
Changes Required
update_executor.py
Replace:
def _invalidate_modules_with_missing_deps() -> tuple[int, int]:
# ~60 lines of direct JSON manipulation
...With:
def _invalidate_modules_with_missing_deps() -> tuple[int, int]:
from amplifier_foundation.modules.install_state import InstallStateManager
cache_dir = get_cache_dir() # or however you get the cache path
mgr = InstallStateManager(cache_dir)
return mgr.invalidate_modules_with_missing_deps()reset.py
Replace direct file operations with:
from amplifier_foundation.modules.install_state import InstallStateManager
mgr = InstallStateManager(cache_dir)
mgr.clear()
mgr.save()Acceptance Criteria
-
update_executor.pyusesInstallStateManager.invalidate_modules_with_missing_deps() -
reset.pyusesInstallStateManager.clear() - No direct JSON manipulation of install-state.json remains
- All existing tests pass
-
amplifier updatestill correctly invalidates stale modules -
amplifier reset --remove cachestill correctly clears install state
Benefits
- Single source of truth for install state logic
- Consistent behavior between proactive healing and explicit invalidation
- Easier to maintain and evolve the install state format
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels