Skip to content

Consolidate install-state.json manipulation with InstallStateManager #193

@colombod

Description

@colombod

Background

PR microsoft/amplifier-app-cli#68 introduced surgical module dependency invalidation after self-updates. This required direct manipulation of install-state.json in two places:

  • amplifier_app_cli/utils/update_executor.py - Invalidates modules with missing deps after update
  • amplifier_app_cli/commands/reset.py - Clears install state when cache is removed

Current State

Both files now use a shared get_install_state_path() function from paths.py, but still manipulate the JSON file directly rather than using the InstallStateManager class from amplifier-foundation.

Implementation Plan

We chose Option A: Add methods to InstallStateManager in amplifier-foundation, then update amplifier-app-cli to use the new API.

Sub-Issues

Dependency Order

  1. First: Merge [foundation] Add consolidation API to InstallStateManager #194 (foundation API)
  2. Then: Merge [app-cli] Use InstallStateManager API instead of direct JSON manipulation #195 (app-cli migration)

Files Involved

  • amplifier-foundation: amplifier_foundation/modules/install_state.py
  • amplifier-app-cli: amplifier_app_cli/utils/update_executor.py
  • amplifier-app-cli: amplifier_app_cli/commands/reset.py
  • amplifier-app-cli: amplifier_app_cli/paths.py

Context

This was flagged during code review by @robotdad as a nice-to-have improvement for future consolidation.

Related PR: microsoft/amplifier-app-cli#68

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions