apm icon indicating copy to clipboard operation
apm copied to clipboard

[BUG] Global agent-skills audit requires dependency MCP entries after --only apm install

Open Melivo opened this issue 1 month ago • 3 comments

Describe the bug

On Linux with APM 0.33.0 (18c4c43), apm audit --ci fails config-consistency after a global skills-only installation:

chrome-devtools: in manifest but not in lockfile
context7: in manifest but not in lockfile

The user manifest selects only agent-skills, and installation explicitly uses --only apm. The two MCP servers are declared by an installed dependency, not directly by the user manifest. No MCP configuration is intended to be installed by this workflow.

To Reproduce

Observed workflow, with the private dependency identity omitted:

  1. The user manifest at ~/.apm/apm.yml has targets: [agent-skills] and an unpinned Git package under dependencies.apm. That package provides skills and declares chrome-devtools and context7 under its own dependencies.mcp.

  2. Install/update only the skills:

    apm install --global --target agent-skills --only apm --update
    
  3. From ~/.apm, run:

    apm audit --ci --no-fail-fast --format json --output /path/to/audit.json
    
  4. Observe config-consistency fail because those dependency-declared MCP servers are absent from the user lockfile.

This was observed after the existing user lockfile was backed up and a fresh lockfile was generated through the skills-only install. Repeating apm install --global --target agent-skills --only apm does not clear the finding. No --force or MCP installation was used.

This is a report from an existing installation, not a claim that an isolated fixture has been tested. The source package is private; its relevant shape is a skill bundle with two self-defined MCP declarations (registry: false), one stdio and one HTTP. Other installed dependencies are omitted from this description.

Expected behavior

Audit should assess configuration consistency for the selected installation scope. A successful agent-skills / --only apm installation should not require deployment of dependency MCP servers merely to pass that check.

If requiring the omitted services is intentional, please clarify the supported way to audit a skills-only global installation without installing MCP services. I am not requesting that real configuration drift be ignored or that an audit gate be disabled.

Environment

  • OS: Linux, x86_64
  • APM: standalone binary 0.33.0 (18c4c43), managed through mise
  • Scope: global/user
  • Target: agent-skills
  • Install filter: --only apm
  • Dependency references: default branches, without explicit commit/tag pins; resolved revisions are recorded normally in the lockfile
  • Python version: not separately selected; using the packaged APM binary

Logs

Relevant audit JSON:

{
  "name": "config-consistency",
  "passed": false,
  "message": "2 MCP config inconsistenc(ies) -- run 'apm install' to reconcile",
  "details": [
    "chrome-devtools: in manifest but not in lockfile",
    "context7: in manifest but not in lockfile"
  ]
}

The same audit passes lockfile existence, ref consistency, deployment ownership, deployed-file presence, orphan detection, skill subsets, content integrity, and includes consent. All 260 recorded file hashes match the installed files, with no missing recorded files. Its separate link-replay drift failure is documented in the follow-up to #2208; this report concerns only config-consistency.

Additional context

#3090 also concerns MCP metadata after lockfile regeneration, but its reproduction intentionally installs native MCP configuration and then loses ownership. This case explicitly excludes MCP installation and targets agent-skills only. I have not established whether the same implementation boundary is responsible.

Suggested acceptance coverage: a global consumer with target agent-skills installs a skill dependency that also declares MCP servers using --only apm; immediate audit must either pass config-consistency for that supported selection or explain the supported audit contract without requiring unintended MCP deployment.

Melivo avatar Oct 18 '26 03:10 Melivo

A minimal, public reproduction of the same config-consistency failure, in project scope, with APM 0.33.0 (18c4c43, macOS arm64, Homebrew). It shows the failure happens whenever a dependency-declared MCP server is not installed, whatever the reason.

Dependency: firebase/agent-skills (public), pinned at 019fc52a76b5b3afc747b7201360bd68be94abe4. Its root .mcp.json declares a self-defined firebase server.

Case A: direct dependency, MCP skipped with --only apm

# apm.yml
name: repro-direct
version: 1.0.0
targets: [claude, copilot]
dependencies:
  apm:
    - git: https://github.com/firebase/agent-skills.git
      ref: 019fc52a76b5b3afc747b7201360bd68be94abe4
      skills: [firebase-hosting-basics]
git init -q && apm install --only apm
apm audit --ci --no-fail-fast   # exit 1

Case B: transitive dependency, MCP refused by default

# wrapper/apm.yml
name: wrapper
version: 0.1.0
dependencies:
  apm:
    - git: https://github.com/firebase/agent-skills.git
      ref: 019fc52a76b5b3afc747b7201360bd68be94abe4
      skills: [firebase-hosting-basics]
# consumer/apm.yml
name: repro-transitive
version: 1.0.0
targets: [claude, copilot]
dependencies:
  apm:
    - ../wrapper
cd consumer && git init -q && apm install
# [!] Transitive package 'firebase' declares self-defined MCP server 'firebase' (registry: false).
#     Re-declare it in your apm.yml or use --trust-transitive-mcp.
apm audit --ci --no-fail-fast   # exit 1

Both cases report:

{ "name": "config-consistency", "passed": false,
  "message": "1 MCP config inconsistenc(ies) -- run 'apm install' to reconcile",
  "details": ["firebase: in manifest but not in lockfile"] }

For contrast, the same direct dependency installed without --only apm configures the MCP server and apm audit --ci passes (exit 0).

Case B is the notable one: install refuses the transitive MCP by design (secure default), and audit --ci then fails because of that refusal. So the secure default cannot pass CI, and the only way to get a green audit is to trust the transitive MCP. Expected: an MCP server that install deliberately skipped (--only apm, or a refused transitive self-defined server) should not be required by config-consistency, or the audit contract for that case should be documented.

emmanuelperu avatar Oct 20 '26 08:10 emmanuelperu

Decision: approve Area: project Scope: For #3265, reproduce on current source and repair MCP config-consistency auditing so deliberately omitted dependency MCP servers from --only apm and default refusal of transitive self-defined MCP do not become required merely to pass audit. Cover project and global scope, including agent-skills, through the existing canonical MCP selection/comparison owner. Permit only the minimal durable selection/omission evidence needed in existing install/lock state, bound to the applicable dependency and declaration rather than a permanent exemption by server name. Preserve read-only audit, root-declared and previously admitted MCP drift detection, native ownership, user settings, target selection and consent. Include directly related lifecycle coverage and audit/install guidance. Done when: Installed-CLI APMLifecycle scenarios reproduce both public pinned Firebase cases and the global skills-only case, then prove clean immediate audit, repeat installs and selection/trust transitions without enabling omitted MCP. Negative controls retain failures for changed, missing or removed root-declared and previously admitted MCP configuration and damaged or lost metadata. A later skills-only install preserves the prior MCP baseline. Empty MCP fields alone never establish deliberate omission; stale omission evidence cannot exempt a different dependency/declaration. Older or damaged state that cannot establish intent reports uncertainty with safe reconciliation using the intended selection, never assumed success, blanket trust, silent native adoption or deletion. Audit leaves project, lockfile, installed content and native configuration unchanged apart from an explicitly requested report. Align directly related documentation and packaged usage guidance. If current execution no longer reproduces the report, publish that evidence instead of manufacturing a fix. Out of scope: General receipt or lockfile redesign, new trust model, audit bypass or blanket empty-state exemption, enabling services to make CI green, native ownership redesign or #3090's distinct lost-ownership repair, reopening or expanding #3271 cold replay, unrelated LSP behavior, new flags or package formats, assignment, release commitments, technical PR approval or merge, implementation dispatch or restarting blocked delivery. Review contact: @danielmeppiel

danielmeppiel avatar Oct 20 '26 20:10 danielmeppiel

Accepted as a bounded install/audit consistency repair.

The concrete expectation is simple: installing the Firebase hosting skill with --only apm, or declining a transitive self-defined MCP server through the existing secure default, must not require enabling that server merely to pass config-consistency.

The public pinned reproduction above is sufficient to start; no private package is requested. Inspection of current main 53ccf06d11dd2d675e8ea8c3e2523a6d321c1b79 finds that service installation respects the selected mode and actual transitive-trust choice, whereas audit derives the current MCP view with transitive trust enabled. This decision session inspected that source and the complete discussion; it did not independently execute the reported reproduction.

The important limit is that absent MCP metadata is not evidence of deliberate omission. The accepted repair allows narrowly scoped durable selection/omission evidence where needed, with conservative older-lock handling and safe reconciliation guidance. It must still catch real root or previously admitted MCP drift and must not erase a prior baseline on a later skills-only install. The existing native ownership and consent boundaries remain intact.

This follows the same bounded consistency principle as #3151 and #3214, without folding in #3090's lost-ownership report or reopening the already accepted #3271 cold-replay work. The strict scope record is separate from this explanation. The issue stays open for delivery under normal contribution and review rules; no assignment, release date, PR approval, automation dispatch or blocked-delivery restart is implied.

Disclosure: GitHub Copilot prepared and posted this record after Daniel Meppiel explicitly accepted the complete bounded proposal in an interactive product-decision session.

danielmeppiel avatar Oct 20 '26 20:10 danielmeppiel