Skip to content

fix(plugins): a cached pass classifies a plugin as its fresh fetch does (#4270) - #4276

Merged
Daniel Meppiel (danielmeppiel) merged 9 commits into
mainfrom
danielmeppiel-claude-plugin-type-parity-4270
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 9 commits into
mainfrom
danielmeppiel-claude-plugin-type-parity-4270

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TL;DR — A cached install pass classified a parser-normalized Claude plugin with root skills/ as skill_bundle (or hybrid), while its fresh fetch classifies it marketplace_plugin. After apm approve, apm install -g --trust-bin reads the cache, so the plugin skipped Claude native admission: only its skill landed under ~/.claude/skills, bin/ was not deployed, and no warning was printed. Classification is now identical on a fresh fetch and a cached pass, at the single type-precedence owner.

Problem (WHY)

  • install/legacy_plugin_compat.preserve_normalized_marketplace_plugin_type restored marketplace_plugin only when the cached pass detected apm_package. The parser writes apm.yml and .apm/ into the cache, so a plugin with root skills/ is detected as skill_bundle (root SKILL.md: hybrid) and kept that type.
  • claude_plugins/admission.plan_native_claude_plugin routes only marketplace_plugin, so the plugin projected loose (Claude plugin with bin/ is no longer deployed whole at user scope after approve + --trust-bin (silent) #4270). The same drift makes test_claude_native_hook_lifecycle::test_installed_hook_source_reinstall_and_removal[False-*] fail (KeyError: 'enabledPlugins'): only the git/cached path is affected.

Approach (WHAT)

The fresh pass is the reference. When the parser's receipt is present and the cached pass detects apm_package, skill_bundle or hybrid (types the parser's generated apm.yml can produce), a tree with a plugin manifest is marketplace_plugin, as on its fresh pass. A skills/ bundle without a plugin manifest is never normalized, so it keeps skill_bundle and its --skill subset selection. Claude admission is unchanged.

Implementation (HOW)

File Change
src/apm_cli/install/legacy_plugin_compat.py _PARSER_SHADOWED_TYPES = {apm_package, skill_bundle, hybrid}; with a plugin manifest those map back to marketplace_plugin.
tests/unit/install/test_legacy_plugin_compat.py Parity test at the owner: fresh detect_package_type == cached result across manifest location (.claude-plugin/, .github/plugin/, root plugin.json, none) × root skills/ / SKILL.md × locked type. Replaces the #4126 assertion that a manifest-bearing root-skills/ cache stays skill_bundle (that diverged from its fresh pass).
tests/integration/test_claude_native_hook_lifecycle.py Installed-CLI test: plugin with .claude-plugin/, root skills/ and bin/ from git; apm approve --all, apm install -g --trust-bin; asserts bin/tool (executable) under ~/.agents/plugins/<plugin>/, no loose skill, enabled in Claude settings, lock row marketplace_plugin with its native root.
tests/integration/test_frozen_remote_plugin_lifecycle.py, tests/integration/test_plugin_e2e.py Updates the producer-lock oracle for .claude-plugin (and .github/plugin/plugin.json) packages to the documented Claude plugin collection type, marketplace_plugin (reference/package-types.md, layout table and "Plugin collection"). These oracles pinned the previous cached-pass type, skill_bundle.
tests/integration/test_frozen_remote_plugin_lifecycle.py (upgrade safety) test_frozen_and_audit_accept_a_lock_with_the_previous_plugin_type: a consumer lock seeded with skill_bundle for a whole plugin replays under apm install --frozen (twice, lock bytes unchanged) and passes apm audit --ci.
CHANGELOG.md One Fixed line.

Trade-offs

Validation

Targeted local run (APM_E2E_TESTS=1 APM_BINARY_PATH=.venv/bin/apm pytest -n 2 tests/integration/test_frozen_remote_plugin_lifecycle.py tests/integration/test_claude_native_hook_lifecycle.py -k "frozen or root_skills_deploys_bin or reinstall_and_removal"): 37 passed. ruff check / ruff format --check on changed files: clean. Full suites run in CI (full-integration). Classification parity was probed directly against detect_package_type / validate_apm_package (all manifest × shape combinations match after the fix).

Done-when mapping:

  • (a) test_plugin_with_root_skills_deploys_bin_natively_after_approve_and_trust (fails before: no ~/.agents/plugins/.../bin/tool).
  • (b) test_installed_hook_source_reinstall_and_removal[False-*].
  • (c) Control: the parity test's manifest-less rows (skill_bundle / claude_skill) and the existing tests/integration/test_package_shape_lifecycle_contract.py::test_manifestless_skill_bundle_subset_lifecycle (--skill subset).
  • (d) test_cached_pass_classifies_as_the_fresh_pass.

Issue and approved scope

Fixes #4270

Human scope-approval comment: #4270 (comment)

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally (targeted; full suites in CI)
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

apm-spec-waiver: restores the fresh-fetch package type on the cached pass; no new behaviour

  • N/A -- this PR does not change OpenAPM-observable behaviour (restores existing classification).

Co-authored-by: Copilot [email protected]

…es (#4270)

A parser-normalized plugin cache with root skills/ or SKILL.md is detected as
skill_bundle or hybrid on the cached pass; with a plugin manifest present its
fresh type is marketplace_plugin. Return the fresh type at the type-precedence
owner so Claude native admission routes it after approve, and bin/ deploys
inside the plugin root. A skills/ bundle without a manifest is unchanged.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added the full-integration Run the full integration suite (ci-integration.yml) on this PR before merge label Nov 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Integration tests still expect skill_bundle for the manifest-bearing fixture now classified as marketplace_plugin, causing plugin setup failures before frozen restoration can be tested.

1 open issue
What changed in this PR

This PR addresses #4270 by making cached plugin classification match fresh fetches, restoring native Claude plugin deployment after approval and --trust-bin.

Changes:

  • Restores marketplace_plugin classification for parser-normalized caches detected as APM packages, skill bundles, or hybrids.
  • Adds classification-parity tests and a lifecycle regression test for native deployment of plugins containing skills/ and bin/.
  • Documents the user-visible fix in the changelog.
File Description
tests/​unit/​install/​test_legacy_plugin_compat.py Tests fresh/cached classification parity across manifest locations, package shapes, and locked types.
tests/​integration/​test_claude_native_hook_lifecycle.py Verifies approved plugin deployment, executable permissions, Claude registration, and lock metadata.
src/​apm_cli/​install/​legacy_plugin_compat.py Expands classification restoration at the existing compatibility owner.
CHANGELOG.md Records the restored native plugin deployment behavior.

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Landing on prior green (Daniel rule) under the PM-approved shard-1 timeout exception: at 8e49996 every check was green except Integration Tests Shard 1, which hit the 50-min step cap at 31% with 0 failures; shards 2-4 were clean. Rerun 44733826312 confirms; the H lane fixes forward if it shows a real failure. Interdiff since 8e49996: main merge plus a mechanical CHANGELOG resolution only.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 5627eb6 into main Nov 20, 2026
24 of 26 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-claude-plugin-type-parity-4270 branch November 20, 2026 13:08
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
…4142 resolves

- Taxonomy baseline: drop the temporary allowances for the modules #4142 marks
  (spec behavior modules, journey index, registry archive, git lock content hash,
  policy outcome routing, credential rendering) and the deleted integration machines;
  test_m_gate.py now carries e2e and promise marks.
- Exact-duplicate baseline: drop the credential_rendering pair (now one parametrized test).
- #4270 landed (#4276): the Claude plugin bin/ user-scope world cells are required again.
- #4178 cell keys on the same approve warning printed twice, not on any warning.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Fold [Unreleased] into the untagged [0.37.0] - 2026-11-20 block. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicate lines from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder now names #4271. pyproject.toml is already 0.37.0. Refreshed again on the final release train; its train merge on main is the RC SHA.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Fold [Unreleased] into the untagged [0.37.0] - 2026-11-20 block on the final release train. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicates from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder names #4271. pyproject.toml is already 0.37.0. The train merge on main is the RC SHA.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 21, 2026
Fold [Unreleased] into the untagged [0.37.0] block on the final release train. Contributor, CI and test-only lines are dropped per the cut-release DROP list; exact duplicates from parallel merges are removed; the #4126/#4276 plugin-type lines are merged; the #4187 placeholder names #4271. pyproject.toml is already 0.37.0. The train merge on main is the RC SHA.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-integration Run the full integration suite (ci-integration.yml) on this PR before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude plugin with bin/ is no longer deployed whole at user scope after approve + --trust-bin (silent)

2 participants