Skip to content

Generated install.mjs crashes on a foreign destination: inventory() lstats artifact-manifest paths that don't exist #812

Closed

Description

@ScriptedAlchemy

Generated installer from agent-bundle@62ffe403 (pkg.pr.new), consumer: ScriptedAlchemy/plugin-library artifact/install.mjs.

Repro. ~/.cursor/plugins/local/plugin-library already holds a copy written by a different installer (a receipt named .plugin-library-install.json, no agent-bundle.manifest.json). Run the generated node artifact/install.mjs:

Error: ENOENT: no such file or directory, lstat '.../plugin-library/agent-bundle.compile-evidence.json'
    at async visit (artifact/install.mjs:128)
    at async inventory (artifact/install.mjs:145)
    at async (artifact/install.mjs:1194)

Cause. With no receipt at the destination, the main flow calls inventory(destination) to hash the foreign tree and decide legacy vs foreign. But inventory() shares the artifact-side branch: when artifactManifest !== undefined it selects ['agent-bundle.manifest.json', ...artifactManifest.files] and visit()s each path under root — which is now the destination, so any manifest file missing there throws ENOENT instead of being counted as a difference.

Expected. Inventory of the destination should walk what is actually there (the readdir branch), or tolerate missing manifest paths; the outcome should be the normal foreign-directory verdict (refuse / require --replace), not a crash.

Workaround used: rm -rf the stale copy, then install.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions