apm icon indicating copy to clipboard operation
apm copied to clipboard

[BUG] audit config-consistency rejects valid virtual claude_skill deps without apm.yml

Open Cianai opened this issue 4 months ago • 1 comments

Describe the bug

apm audit --ci reports config-consistency failure for every supported claude_skill virtual subpath dependency whose source has SKILL.md but no apm.yml. A successful apm install cannot repair the failure because no package manifest exists by design.

The minimal reproduction below has one skill dependency and no MCP dependencies, yet the MCP-oriented config-consistency check fails.

To reproduce

APM 0.25.0:

tmpdir="$(mktemp -d)"
cd "$tmpdir"

apm init -y --target codex virtual-skill-audit
cd virtual-skill-audit

apm install 'mattpocock/skills/skills/productivity/grilling#2454c95dc305c158b21a0cdafeb728879dd0359a'
apm audit --ci --no-fail-fast

Generated manifest:

name: virtual-skill-audit
version: 1.0.0
targets:
  - codex
dependencies:
  apm:
    - mattpocock/skills/skills/productivity/grilling#2454c95dc305c158b21a0cdafeb728879dd0359a
  mcp: []
includes: auto
scripts: {}

Actual behavior

Install exits 0. Audit exits 1 with 8/9 checks green:

config-consistency: 1 MCP config inconsistenc(ies) -- run 'apm install' to reconcile

mattpocock/skills/skills/productivity/grilling: package manifest not found at
.../apm_modules/mattpocock/skills/skills/productivity/grilling/apm.yml;
re-run 'apm install' to restore it

The installed package correctly contains .apm-pin and SKILL.md; it cannot contain the requested apm.yml because the upstream virtual skill has none.

Expected behavior

config-consistency should ignore a locked dependency that cannot contribute MCP declarations, including package_type: claude_skill virtual packages without apm.yml. The minimal project should audit 9/9 green.

If audit needs a more general rule, it should treat the lockfile package type / installed marker as the authority for whether an absent package manifest is expected rather than reporting every non-skill_bundle absence as corruption.

Root cause

In v0.25.0, integration/mcp_config_view.py::_collect_locked_dependencies iterates every locked dependency and calls _package_manifest_path(). When the resulting apm.yml is absent, only package_type == "skill_bundle" is exempted:

if not manifest_path.exists():
    if dependency.package_type == "skill_bundle":
        continue
    problems.append(... "package manifest not found" ...)

A virtual subpath skill is locked as package_type: claude_skill, so it always enters the error branch even though its SKILL.md-only shape is valid and it cannot declare MCP configuration.

Real-project impact

In a project with 36 dependencies, 29 valid virtual skill dependencies produce the same false failure immediately after a successful real install. This masks actual MCP configuration problems and makes the suggested repair loop (apm install then apm audit) impossible to complete.

Environment

  • OS: macOS 27.0
  • APM: Homebrew v0.25.0 (d73e6ac)
  • Target: Codex

Related

  • #2206 covers inconsistent metadata and lockfile churn for the same claude_skill virtual-subpath package shape; this report is the distinct audit false-positive path.

Cianai avatar Jul 14 '26 16:07 Cianai

Triage Panel Verdict

Summary: Clear audit false-positive affecting all projects with claude_skill virtual subpath dependencies. The exemption in _collect_locked_dependencies covers only skill_bundle, leaving claude_skill packages in a broken state that cannot be repaired by apm install (no apm.yml to restore). The fix is a one-line extension of the exemption condition. Related to #2206 (same package shape, different failure surface).


Panel Analysis

DevX UX Expert: The suggested repair loop (apm install then apm audit) is impossible to complete -- install exits 0, audit exits 1, repeat. This means CI pipelines using apm audit --ci are permanently broken for any project with virtual skill dependencies. The 29/36 false-positive rate in the reporter's real project means the audit output is essentially useless noise. This erodes trust in the tool's audit capability.

Supply Chain Security Expert: False audit positives are a security anti-pattern: they train users to ignore or disable audit output, which masks genuine supply chain problems. The fix should make the audit signal trustworthy by exempting package shapes that are valid-by-design (no apm.yml is correct for claude_skill virtual packages). The lockfile package_type field is the correct authority here.

Python Architect: The fix is bounded and low-risk: extend the if dependency.package_type == "skill_bundle": continue guard to also cover package_type == "claude_skill" (or a broader set of non-MCP-contributing types). This is the right pattern -- use the lockfile's own type field rather than filesystem presence as the discriminant for MCP-contribution eligibility.

APM CEO (Arbiter): Accept with high priority. The issue is complete: minimal reproduction, clear root cause, exact code location, fix proposal. Directly related to #2206 -- both expose the same gap in handling of the claude_skill virtual subpath shape. Should be fixed in the same patch.


Decision: status/accepted

Label set:

  • theme/portability -- affects any project using the claude_skill virtual subpath dependency shape
  • area/audit-policy -- audit check exemption logic is the direct failure site
  • type/bug -- confirmed false positive that cannot be self-repaired
  • priority/high -- breaks apm audit --ci in CI pipelines for all affected projects

Milestone: Next patch release (no milestone assigned at this time; maintainer to assign).

Suggested next action: In integration/mcp_config_view.py::_collect_locked_dependencies, extend the manifest-absent exemption to include package_type == "claude_skill" (and consider any other non-MCP-contributing types). Coordinate with #2206 fix since both touch the claude_skill virtual subpath handling.


Triage status: agentic proposal pending human ratification. Silence is approval. Maintainers can:

  • Override any label or milestone above by editing it directly -- human edits are authoritative and will not be reverted on subsequent runs.
  • Re-trigger triage by applying the status/needs-triage label, or by removing status/triaged to enroll the issue in the next daily sweep.

Posted by the Triage Panel workflow. See .apm/skills/apm-triage-panel for the panel skill.

Generated by Triage Panel · 52.2 AIC · ⌖ 7 AIC · ⊞ 9.2K · ◷

github-actions[bot] avatar Jul 15 '26 12:07 github-actions[bot]