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.yml declares a local dependency ./packages/agent-config.
./packages/agent-config/apm.yml declares one MCP server (dependencies.mcp with name/command/args).
apm install --force --trust-transitive-mcp --target copilot --no-policy -> exit 0; server recorded in apm.lock.yaml mcp_configs.
apm audit --ci --no-policy --no-fail-fast (baseline, source unchanged) -> exit 0 (correct).
- Edit
./packages/agent-config/apm.yml to delete the entire dependencies.mcp block.
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).
Describe the bug
apm audit --ciconfig-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 entiredependencies.mcpdeclaration after install. When the recordedmcp_configslockfile baseline has a server that the current source no longer declares, audit still reports "All checks passed" and exits0. 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.pyon a working build leaves the post-removal audit at exit0.To Reproduce
Baseline SHA:
26d8cee8a4079bb3d31956f1b57d343654835fc8(origin/main).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)../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
26d8cee8a)Root-cause (architecture)
src/apm_cli/policy/ci_checks.py::_check_config_consistencyderivescurrent_configsonly from present manifest declarations and diffs one-directionally, so lock-only (removed) servers are never compared. Recommended fix (architecture clusterr2-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_consistencyand install/update reconciliation. Keepmcp_config_provenancefor 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).