apm icon indicating copy to clipboard operation
apm copied to clipboard

[BUG] apm install <plugin>@<marketplace> rejects the versioned bundle directories apm pack produces ("should not have a file extension")

Open siegenthalerroger opened this issue 2 months ago • 4 comments

Describe the bug

apm install <plugin>@<marketplace> cannot install a plugin from a git-hosted marketplace when the plugin's source is the directory apm pack itself produces. apm pack names each bundle <name>-<version>/ (for example plugins/llmctl-ops-2026.9.3/). The marketplace entry's source points there, the install turns it into a virtual subdirectory package, and validation then reads the dotted version suffix as a file extension and rejects it.

So a marketplace built with apm pack is installable by Claude Code, Codex and VS Code, but not by apm install.

To Reproduce

A public marketplace built this way: https://github.com/siegenthalerroger/.llmctl-marketplace (entries like source: ./plugins/llmctl-ops-2026.9.3).

mkdir probe && cd probe && git init -q
apm marketplace add siegenthalerroger/.llmctl-marketplace --name llmctl-marketplace
apm install "llmctl-ops@llmctl-marketplace" --target claude

Output:

[x] siegenthalerroger/.llmctl-marketplace/plugins/llmctl-ops-2026.9.3 -- Invalid virtual package path 'plugins/llmctl-ops-2026.9.3'. Individual files must end with one of: .prompt.md, .instructions.md, .agent.md. For subdirectory packages, the path should not have a file extension.
All packages failed validation. Nothing to install.

The same marketplace registered from a local path installs fine, because the source then resolves to a local directory instead of a virtual package path. The failure is specific to git-hosted marketplaces.

Expected behavior

A directory whose name contains dots (plugin-1.2.3, plugin-2026.9.3) is accepted as a subdirectory package. Telling a file from a directory by the path suffix alone breaks on the naming apm pack itself uses. Checking against the known file suffixes (.prompt.md, .instructions.md, .agent.md, …) instead of "any extension" would fix it.

Environment

  • OS: macOS 26 (Darwin 25.6.0)
  • APM Version: 0.31.0 (8fd10ac)

Additional context

Related: #2432, which asks apm pack to write into the output directory without the <name>-<version>/ level. That would avoid this path for producers who opt in, but the install-side check still rejects any dotted directory name.

siegenthalerroger avatar Sep 25 '26 10:09 siegenthalerroger

Thanks for the clear repro and root-cause analysis. This looks like a genuine bug: apm install's virtual-package validation treats any dot in a subdirectory name as a file extension, which breaks specifically for apm pack's own versioned bundle-directory naming convention (e.g. plugin-2026.9.3/). The reproduction with a real public marketplace makes this easy to verify independently.

The suggested fix direction (check against the known file suffixes -- .prompt.md, .instructions.md, .agent.md, etc. -- rather than "any extension present") looks targeted and low-risk, but it's worth confirming:

  • Whether other virtual-package validation call sites share this same "any dot = extension" assumption, so the fix is applied consistently rather than just at this one check.
  • Interaction with the related issue #2432 (removing the -/ nesting level in apm pack output) -- fixing this bug doesn't require that change, but a reviewer should confirm the two aren't meant to land together.

A maintainer will need to confirm scope and assign review before a fix PR proceeds.

Generated by Triage Panel · copilot · auto · 61.2 AIC · ⌖ 8.54 AIC · ⊞ 12K · ◷

github-actions[bot] avatar Sep 26 '26 12:09 github-actions[bot]

Decision: approve Area: project Scope: Repair installation of valid versioned package directories from Git-hosted marketplaces, including directory names produced by apm pack. A dotted version suffix must not by itself cause a directory package to be rejected as an unsupported file. Done when: The reported pack-to-marketplace-to-install flow succeeds for valid versioned directories such as plugins/my-plugin-1.2.3; directory packages and supported individual files are classified correctly; regression coverage preserves rejection of unsafe paths and invalid package content. Preserve existing bundle naming and supported local marketplace behavior. Out of scope: Accepting arbitrary unknown files; weakening path-containment or package-content checks; redesigning bundle layout; a universal loader or translation framework; new target support; treating completion of the whole native-plugin epic as a prerequisite. Review contact: @danielmeppiel

This is a bounded repair to APM's existing production/consumption contract, not approval of every implementation suggestion in the report. Reproduce the current failure and reuse the canonical path/package validation owners rather than adding a parallel classifier.

Recorded by Copilot on behalf of @danielmeppiel after his explicit 2026-10-01 choice: "Accept all four bounded repairs (Recommended)" for #3078, #3055, #3035, and #3062. No implementation assignment, merge approval, new parent relationship, concurrent delivery commitment, or release date is implied.

danielmeppiel avatar Oct 01 '26 20:10 danielmeppiel

I'd like to take this within the approved scope. I'll keep the change focused on installing versioned directories from Git-hosted marketplaces, preserve supported-file and package-content validation, and cover the pack-to-install flow with a local Git fixture.

Pybsama avatar Oct 03 '26 05:10 Pybsama

Decision: approve Area: project Scope: Repair installation of valid versioned package directories from Git-hosted marketplaces, including directory names produced by apm pack. A dotted version suffix must not by itself cause a directory package to be rejected as an unsupported file. Done when: The reported pack-to-marketplace-to-install flow succeeds for valid versioned directories such as plugins/my-plugin-1.2.3; directory packages and supported individual files are classified correctly; regression coverage preserves rejection of unsafe paths and invalid package content. Preserve existing bundle naming and supported local marketplace behavior. Out of scope: Accepting arbitrary unknown files; weakening path-containment or package-content checks; redesigning bundle layout; a universal loader or translation framework; new target support; treating completion of the whole native-plugin epic as a prerequisite. Review contact: @danielmeppiel

danielmeppiel avatar Oct 15 '26 14:10 danielmeppiel