Repository navigation
Description
Describe the bug
apm audit --ci config-consistency detects when a locally-installed local-path sub-package changes its MCP server config, but does not detect when that sub-package removes its entire dependencies.mcp declaration after install. When the recorded mcp_configs lockfile baseline has a server that the current source no longer declares, audit still reports "All checks passed" and exits 0. The drift-detection guarantee is one-directional: it compares current-source entries against the lock baseline but ignores lock-only (removed) entries.
This is the removal sibling of #2127 (change-drift). The pending fix for #2127 (#2132) was empirically verified to fix the change sub-case but still miss removal: overlaying #2132's ci_checks.py on a working build leaves the post-removal audit at exit 0.
To Reproduce
Baseline SHA: 26d8cee8a4079bb3d31956f1b57d343654835fc8 (origin/main).
- Consumer
apm.ymldeclares a local dependency./packages/agent-config. ./packages/agent-config/apm.ymldeclares one MCP server (dependencies.mcpwithname/command/args).apm install --force --trust-transitive-mcp --target copilot --no-policy-> exit 0; server recorded inapm.lock.yamlmcp_configs.apm audit --ci --no-policy --no-fail-fast(baseline, source unchanged) -> exit 0 (correct).- Edit
./packages/agent-config/apm.ymlto delete the entiredependencies.mcpblock. apm audit --ci --no-policy --no-fail-fast-> exit 0, "All checks passed" (BUG; should be exit 1 with a source-vs-lock drift diagnostic).
Expected behavior
Audit must compare the complete current MCP declaration graph against the stored lock baseline symmetrically: changed, added, AND removed declarations must all affect the consistency verdict. A removed source declaration that still exists in the lock baseline is drift and must exit 1.
Environment
- OS: macOS
- APM Version: 0.24.1 (
26d8cee8a)
Root-cause (architecture)
src/apm_cli/policy/ci_checks.py::_check_config_consistency derives current_configs only from present manifest declarations and diffs one-directionally, so lock-only (removed) servers are never compared. Recommended fix (architecture cluster r2-symmetric-source-lock-consistency): introduce a side-effect-free current-MCP-config view resolver plus one symmetric source-vs-lock diff (changed / source-only / lock-only) consumed by _check_config_consistency and install/update reconciliation. Keep mcp_config_provenance for ownership classification, not as a blanket removal exemption. Vendor-neutral, no primitive-schema change, no harness translation layer.
Additional context
Filed from an authorized first-party reliability/regression validation sweep (red-team Round 2). Independently reproduced twice by a separate confirmer (finder != confirmer), with control (unchanged source exits 0) and cleanup verification. Distinct from #2127/#2132 (change vs removal).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Jul 10, 2026
Triage Panel Verdict
Thank you for filing this, Daniel Meppiel (@danielmeppiel) -- this is a well-reproduced, clearly scoped bug report.
Decision: ACCEPT
Summary:
apm audit --ciperforms a one-directional source-vs-lock diff for MCP config consistency. It catches changes and additions (partially addressed by #2132) but silently ignores lock-only (removed) entries -- causing a false-clean exit 0 when a local-path sub-package removes itsdependencies.mcpblock entirely.Panel findings:
"All checks passed"with exit 0 when drift exists breaks the CI gate contract. Users runningapm audit --ciin automated pipelines will not catch removal drift, defeating the purpose of the command._check_config_consistencyinci_checks.py. Architecture clusterr2-symmetric-source-lock-consistencyalready named in the issue. Should be paired with or follow fix(audit): detect local-path sub-package MCP source drift (closes #2127) #2132 to close the full audit integrity gap. High priority.Label decisions:
area/lockfile,area/audit-policy,type/bug(authoritative, not changed)theme/security-- MCP audit integrity is a security surfacepriority/high-- false-clean CI audit exit is a reliability and security gapSuggested next action: Implement a symmetric source-vs-lock diff in
_check_config_consistency: after comparing current-source entries against lock baseline, add a second pass comparing lock-only entries (present in lock but absent from current source) and flag those as removal drift (exit 1). Coordinate with #2132 to avoid merge conflicts.