microsoft / microsoft/amplifier

Consolidate install-state.json manipulation with InstallStateManager

Open
#193 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.1k
Forks
261
Avg merge
3h 28m
Merged PRs (30d)
13

Description

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
  • #194 - [foundation] Add consolidation API to InstallStateManager
  • #195 - [app-cli] Use InstallStateManager API instead of direct JSON manipulation
Dependency Order
  1. First: Merge #194 (foundation API)
  2. Then: Merge #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: https://github.com/microsoft/amplifier-app-cli/pull/68

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with amplifier_foundation/modules/install_state.py to understand the API added by sub-issue #194, then inspect direct install-state.json handling in amplifier_app_cli/utils/update_executor.py and amplifier_app_cli/commands/reset.py. Review amplifier_app_cli/paths.py for the shared path helper. Done means both app-cli locations use InstallStateManager rather than manipulating JSON directly, while preserving invalidation and reset behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.