Skip to content

[Problem] install-state keeps operations the current plan no longer contains, so doctor reports them missing forever #3232

Description

@philippschaedle

What is the impact?

Doctor or repair does not recover the install

What happened?

I expected install-state to list only what the current install plan writes. Instead, it keeps operations from a previous install-state that the current plan no longer contains.

With install.sh --profile custom --enable-hooks --target claude --dry-run --json at 1ac07903, the plan has 955 plannedOperations, but statePreview.operations has 957. The two extra records are:

  • copy-file hooks/hooks.json -> ~/.claude/hooks/hooks.json (no longer shipped for this target; hooks are registered in settings.json instead)
  • copy-file scripts/lib/cost-estimate.js -> ~/.claude/scripts/lib/cost-estimate.js (source removed in 08c1c407)

Because the records survive every install, doctor.js reports them for good. The stale hooks.json copy shows as drifted, or as missing once it's removed, and cost-estimate.js always shows as a missing source. Neither a normal install nor uninstall plus install clears them. Uninstall keeps the drifted hooks.json copy, so the old install-state is not removed and gets carried into the next one.

Steps:

  1. Install at a pin that ships hooks/hooks.json and scripts/lib/cost-estimate.js.
  2. Update to 1ac07903 and install again.
  3. Run node scripts/doctor.js --json: missing-source-files for cost-estimate.js, and drifted-managed-files for hooks.json.
  4. Run uninstall, then install: both findings are still there.

Expected: records not in the current plan are dropped from install-state (and their files removed if unmodified, or reported once as orphaned).

Harness

Claude Code

Install method

Harness-specific installer target

Operating system

macOS

ECC and harness versions

ECC 2.2.1 at 1ac07903

Optional redacted diagnostics

claude-home: 1 managed file(s) are missing (~/.claude/hooks/hooks.json)
claude-home: 1 source file(s) referenced by install-state are missing (scripts/lib/cost-estimate.js)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions