Repository navigation
fix(mcp): announce kept MCP entries on every install path (#4861) - #4908
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits intoNov 23, 2026
Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
Daniel Meppiel (danielmeppiel) merged 4 commits into
Conversation
…ept reporting Reporting accuracy for kept entries from lockless MCP write evidence (#4861, deferred from #4818). Nothing is removed differently: - apm install <bundle>, apm install --mcp NAME and apm mcp install NAME announce kept entries (announce-only) against the lockfile's complete managed-server set, through one helper, announce_kept_mcp_writes; - a located rewrite supersedes the key-less record of the same runtime, config and name, so a retired entry leaves no stale notice or audit finding; - announce-only skips a server redeclared on the same native key, as retirement already does; - every recognized unusable-evidence reason (OSError, path traversal) is announced on a lockless install, not only a parse error. Six red-first cells. Fixes #4861 Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 23, 2026 04:09
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Audit still filters receipts only by managed names, so a kept entry redeclared as self-defined on the same native key incorrectly fails apm audit --ci.
1 open issue
What changed in this PR
This PR follows up on #4801 and #4818 to improve APM’s kept-MCP-entry reporting across install paths, without changing which entries are removed.
Changes:
- Adds kept-entry announcements to local bundle and direct MCP installs.
- Updates stale receipt handling, native-key redeclaration filtering, and unusable-evidence warnings.
- Adds regression coverage, a bug-ledger entry, and documentation.
| File | Description |
|---|---|
tests/unit/install/test_mcp_write_receipts.py |
Tests receipt supersession, redeclaration, and unsafe-evidence warnings. |
tests/integration/test_mcp_kept_entry_announcement_lifecycle.py |
Checks announcements and entry preservation across install paths. |
tests/fixtures/lifecycle_bug_ledger/bugs/4861.json |
Records reporting failures and regression tests. |
src/apm_cli/install/mcp/write_receipts.py |
Adds the announcement helper and adjusts reporting filters. |
src/apm_cli/install/mcp/integration.py |
Announces kept entries after direct MCP installs. |
src/apm_cli/install/local_bundle_handler.py |
Announces kept entries after local bundle installs. |
docs/src/content/docs/reference/cli/install.md |
Documents additional announcement paths and unusable evidence. |
changelog.d/4908.fixed.md |
Summarizes the user-visible reporting changes. |
Review effort: Balanced
A kept owner/demo entry redeclared as self-defined demo on the same native key stopped warning at install but still failed apm audit --ci (kept-mcp-entries). The native-key check now lives in the kept() reader both install and audit use, with the lockfile's MCP configs passed from audit. The redeclaration cell asserts the audit reader agrees (red before). Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-4861-mcp-kept-entry-reporting
branch
November 23, 2026 07:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Reporting accuracy for kept MCP entries from lockless write evidence (#4801, #4818). Copilot review of #4818 found five gaps; each one leaves a notice or audit finding missing or wrong. Nothing is removed differently. Retirement decisions are unchanged (#4784 owns any retirement change).
apm install <bundle>) andapm install --mcp NAME/apm mcp install NAMEreturned before the kept-entry announcement. Both now call a new announce-only helper,announce_kept_mcp_writes, with the lockfile's complete managed-server set and configs (all owners), so nothing unrelated is retired.owner/demounderdemo) now supersedes the key-less record for the same runtime, config and name. Other profiles' records stay._declared_keys()check retirement uses.OSErrorand path-traversal, such as a symlinked evidence file) is now warned on a lockless install, not onlyMcpWriteEvidenceError.Docs:
reference/cli/install.md("MCP cleanup without a lockfile") names the extra install paths and unusable-evidence cases.Issue and approved scope
Issue: Fixes #4861
Human scope-approval comment: #4861 (apm-scope:v1 record)
Does this PR complete the issue, or what remains? It completes the issue.
apm-spec-waiver: kept-entry reporting accuracy for lockless MCP evidence; no OpenAPM-observable behaviour changes
Type of change
Testing
Lint chain (local), all clean:
ruff check/format --check(0.15.12)lint_architecture_boundaries.py --root .lint-auth-signalstests.quality.taxonomy --changedcheck_test_assertions.py(AQ unchanged)tests.lifecycle.generator --checkThe install-module LOC budget still holds:
integration.py998 andlocal_bundle_handler.py994, both under 1000.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regenerated