Skip to content

fix(audit): verify skill subset of local plugins without apm.yml - #4494

Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-fix-audit-local-skill-subset-4321
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-fix-audit-local-skill-subset-4321

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

apm audit --ci reported skill-subset-consistency as "selection unverified -- the manifests that declare it could not all be read" for a local Claude plugin (.claude-plugin/plugin.json + skills/, no apm.yml) installed with apm install ./pkg --skill beta.

Install normalizes such a plugin (copy, then validate_apm_package, which synthesizes apm.yml) and resolves its dependencies from that manifest. The reachability walk (deps/reachability.py, the expected-selection owner for audit) read the source directory, found no apm.yml, and marked the node unverifiable. The walk now stages a temporary copy of the local plugin source and normalizes it through the same validate_apm_package owner (_normalized_local_plugin). The apm_modules copy is never read (S-13: no trust in an unverified copy), and the source is never written. Other local sources are read in place as before and still fail closed when unreadable.

Issue and approved scope

Issue: Fixes #4321

Human scope-approval comment: #4321 (comment)

Does this PR complete the issue, or what remains? Completes it. Remote dependency subset rules are out of scope and untouched.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

New tests/integration/test_local_plugin_skill_subset_audit_lifecycle.py (installed CLI): install ./pkg --skill beta, then audit --ci passes warm and cold. Tampering the apm_modules copy's manifest (injecting an unreadable edge) changes neither audit --ci nor install --frozen (both pass; P-INV-I3). A tampered lock skill_subset still fails with declared skills ['beta'] != lockfile skill_subset ['alpha'].

  • APM_BINARY_PATH=.venv/bin/apm pytest tests/integration/test_local_plugin_skill_subset_audit_lifecycle.py: passed with the fix, and failed on main with the issue's "selection unverified" message (fails-before).
  • pytest tests/quality/test_lifecycle_bug_ledger.py + tests/quality/test_test_taxonomy.py + unit tests referencing the reachability owner: 592 passed.
  • ruff check / ruff format --check (0.15.12) on touched files: clean.
  • scripts/lint-architecture-boundaries.sh: clean.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md:
    user-visible effect first, 25 words or fewer, ending with (#PR);
    breaking changes only under upgrade notes; no Highlights; see
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour.

apm-spec-waiver: bug fix aligning audit's expected skill selection with install's existing local plugin normalization; no new or changed normative requirement.

apm audit --ci reported skill-subset-consistency as unverified for a local
Claude plugin without apm.yml installed with --skill. The reachability walk
now reads the manifest install normalized into the package's apm_modules
copy, the same one install resolves from. A tampered selection still fails.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) added this to the 0.37.0 milestone Nov 20, 2026
Copilot AI balanced review requested due to automatic review settings November 20, 2026 19:45

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

The new integration test lacks required taxonomy markers, and manifestless local plugins resolve relative children against the installed copy instead of the original source, leaving valid selections unverified.

2 open issues
What changed in this PR

This PR addresses #4321 by making audit’s dependency reachability walk read the normalized manifest for local Claude plugins without apm.yml, allowing their installed skill selections to be verified.

Changes:

  • Uses the installed manifest for manifestless local plugins while preserving existing handling of other local sources.
  • Adds lifecycle coverage for warm and cold audits and tampered lockfile selections.
  • Records the regression and documents the user-visible fix.
File Description
tests/​integration/​test_local_plugin_skill_subset_audit_lifecycle.py Adds installed-CLI coverage for plugin skill-selection audits.
tests/​fixtures/​lifecycle_bug_ledger.json Links issue #4321 to its regression test.
src/​apm_cli/​deps/​reachability.py Selects the normalized installed manifest for local plugins.
CHANGELOG.md Documents the local-plugin audit fix.

Review effort: Balanced

Comment on lines +21 to +24
pytestmark = [
pytest.mark.integration,
pytest.mark.requires_apm_binary,
]
Comment thread src/apm_cli/deps/reachability.py Outdated
(parent_repo_url, None if ref.replacement is not None else ref.local_path),
)
manifest_dir = real_dir
manifest_dir = _local_manifest_dir(ref, real_dir, apm_modules_dir)
… the copy

Per review: reading the normalized manifest from the apm_modules copy
trusted an unverified copy. The reachability walk now stages the local
plugin source and normalizes it through validate_apm_package, as install
does, so the copy is never read and the source is never written. A
tampered copy changes neither audit --ci nor install --frozen. Classify the
lifecycle test (e2e; P-INV-I3, P-OWN-dependency-selection-merge).

Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: bug fix aligning audit's expected skill selection with install's existing local plugin normalization; no new or changed normative requirement.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
…ithout apm.yml

Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/fixtures/lifecycle_bug_ledger.json
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit b7bd508 into main Nov 21, 2026
43 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-audit-local-skill-subset-4321 branch November 21, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

audit: skill-subset-consistency unverified for local-path dependencies installed with --skill

2 participants