Repository navigation
fix(0.37): route every caller through its canonical owner - #3988
Daniel Meppiel (danielmeppiel) merged 33 commits into
Conversation
…3962) Harvested from #3977. Co-authored-by: Copilot App <[email protected]>
…#3963) Harvested from #3978. Co-authored-by: Copilot App <[email protected]>
…nt (#3959) Harvested from #3976; the positional install reads the lock lazily. Co-authored-by: Copilot App <[email protected]>
…un (#3960) Harvested from #3973. Co-authored-by: Copilot App <[email protected]>
Harvested from #3974. Co-authored-by: Copilot App <[email protected]>
…ops them (#3956) Harvested from #3975. Co-authored-by: Copilot App <[email protected]>
…deny (#3958) Harvested from #3981. Co-authored-by: Copilot App <[email protected]>
…a same-store deny (#3957) Harvested from #3979. Co-authored-by: Copilot App <[email protected]>
A partial name could grant or deny execution for another package. Co-authored-by: Copilot App <[email protected]>
Harvested from #3971. Co-authored-by: Copilot App <[email protected]>
… executables: (#3954) exec_trust_context_for_project takes the manifest file instead of deriving apm.yml from a caller-chosen root; -g resolves APM_HOME/apm.yml through core.scope.get_manifest_path. A closed-world guard registers every caller. Supersedes #3969 and keeps its lifecycle test. Co-authored-by: Copilot App <[email protected]>
Every caller of the shared install entry now runs inside a registered catalog-freshness envelope; the guard is closed-world. Co-authored-by: Copilot App <[email protected]>
APM_NO_SCRIPTS, org executables.deny_all and project script trust now apply; LifecycleScriptRunner is built only by build_runner_from_context, guarded closed-world by the new lifecycle-script-firing-gate owner. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
#3966) The only opt-out is a dependency's own authored .mcp.json; a closed-world guard refuses any other. Co-authored-by: Copilot App <[email protected]>
…ervers (#3956) Co-authored-by: Copilot App <[email protected]>
…ove matching Co-authored-by: Copilot App <[email protected]>
… the gate was never on (#3958) Harvested from #3981 (b4cface, cb015e6); the trust read uses the scope manifest. Co-authored-by: Copilot App <[email protected]>
Harvested from #3969 (5c2cab2). Co-authored-by: Copilot App <[email protected]>
Reads the manifest restriction through the same owner install uses. Co-authored-by: Copilot App <[email protected]>
- compile's no-output hint names targets:, not the deprecated target: - pack's mismatch hint no longer suggests the deprecated pack --target - skip messages name executables.allow instead of allowExecutables - origin and freshness errors say marketplace, not catalog - generated apm.yml headers and unknown-target errors stop listing vscode - config docs show default_client: copilot Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Critical gaps in legacy-lockfile validation and update-time policy enforcement can bypass catalog-origin checks and leave denied executable hooks deployed.
8 open issues
Legacy apm.lock is ignored during catalog-origin checks · New Incomplete policy chains skip the guarded install path · New Local-only shortcut skips current executable policy checks · New Approve cannot clear equivalent URL-form deny entries · New Singular target: all is incorrectly treated as inactive · New Dry-run row lookup rebuilds the marketplace index per entry · New Marketplace index is rebuilt for every declaration · New Test fixture claims the server it expects to pack · New
What changed in this PR
This PR hardens APM’s existing decision owners so commands consistently enforce executable trust, marketplace origins, lockfile compatibility, and lifecycle script controls. It addresses the must-ship consistency fixes tracked by #3983, while leaving broader architectural work for 0.38.
Changes:
- Routes install, update, audit, bundle, and approval flows through shared checks.
- Adds deny-by-default architecture guards and regression coverage.
- Updates CLI guidance, documentation, and release notes for the changed behavior.
| File | Description |
|---|---|
| tests/unit/scripts/test_architecture_runner.py | Registers new guard expectations. |
| tests/unit/marketplace/test_catalog_origin.py | Tests row-level origin checks. |
| tests/unit/install/test_replay_exec_allow_map.py | Tests current executable decisions. |
| tests/unit/deps/test_lockfile_generator.py | Tests stamping and invalid-version warnings. |
| tests/unit/core/test_target_catalog.py | Tests deprecated-alias visibility. |
| tests/unit/core/test_plugin_manifest.py | Tests managed MCP exclusion. |
| tests/unit/commands/test_targets_command.py | Tests manifest-selected targets. |
| tests/unit/commands/test_approve_deny.py | Tests exact and ambiguous matching. |
| tests/unit/bundle/test_local_bundle.py | Tests embedded-lock warnings. |
| tests/red_team/trust/test_kill_switch.py | Verifies lifecycle kill-switch enforcement. |
| tests/red_team/install/test_execute_bypass.py | Verifies lifecycle trust enforcement. |
| tests/integration/test_package_mcp_executables_gate_lifecycle.py | Covers global-scope executable trust. |
| tests/integration/test_pack_mcp_ownership_lifecycle.py | Checks pack output excludes managed credentials. |
| tests/integration/test_marketplace_origin_entry_points_lifecycle.py | Covers alias rebind refusals. |
| tests/integration/test_marketplace_object_form_prune_lifecycle.py | Covers object-form pruning. |
| tests/integration/test_marketplace_object_form_dry_run_lifecycle.py | Covers read-only object-form previews. |
| tests/integration/test_marketplace_explicit_refresh_lifecycle.py | Extends marketplace refresh coverage. |
| tests/integration/test_lockfile_generator_gate_lifecycle.py | Covers writer stamps and bundle warnings. |
| tests/integration/test_local_bundle_mcp_retire_lifecycle.py | Covers bundle MCP retirement. |
| tests/integration/test_install_local_bundle_e2e.py | Covers bundle LSP retirement. |
| tests/integration/test_executables_deny_retires_hooks_lifecycle.py | Covers audit and update after denial. |
| tests/integration/test_deny_remediation_lifecycle.py | Covers approval remediation and user scope. |
| tests/integration/test_architecture_owner_rule_mutations.py | Adds guard mutation cases. |
| tests/integration/test_architecture_marketplace_locked_evidence.py | Tests origin-check guard enforcement. |
| src/apm_cli/security/trust.py | Passes explicit trust manifest paths. |
| src/apm_cli/security/executables.py | Makes trust resolution accept manifest paths. |
| src/apm_cli/models/manifest_bootstrap.py | Omits deprecated targets from generated comments. |
| src/apm_cli/marketplace/errors.py | Uses marketplace terminology in diagnostics. |
| src/apm_cli/marketplace/catalog_origin.py | Adds shared row-level origin validation. |
| src/apm_cli/integration/mcp_config_view.py | Names executable denials in diagnostics. |
| src/apm_cli/install/template.py | Uses scoped trust and skips unresolved previews. |
| src/apm_cli/install/services.py | Updates executable approval wording. |
| src/apm_cli/install/service.py | Distinguishes gated MCP from removed declarations. |
| src/apm_cli/install/orphans.py | Maps marketplace declarations to locked coordinates. |
| src/apm_cli/install/mcp/integration.py | Uses manifest trust and skips empty reconciliation. |
| src/apm_cli/install/local_bundle_handler.py | Reconciles empty bundle MCP selections. |
| src/apm_cli/install/exec_gate.py | Re-evaluates executable trust for replay and update. |
| src/apm_cli/install/dry_run_plan.py | Deduplicates resolved marketplace dependencies. |
| src/apm_cli/install/drift.py | Applies current executable decisions during replay. |
| src/apm_cli/deps/reachability.py | Exposes locked marketplace mapping. |
| src/apm_cli/deps/outdated_row.py | Adds diagnostic details to outdated rows. |
| src/apm_cli/deps/lockfile.py | Stamps substantive writes and detects null versions. |
| src/apm_cli/deps/lockfile_generator.py | Adds bundle-specific compatibility warnings. |
| src/apm_cli/core/target_detection.py | Omits deprecated aliases from errors. |
| src/apm_cli/core/target_catalog.py | Defines advertised manifest target names. |
| src/apm_cli/core/plugin_manifest.py | Excludes APM-managed root MCP servers. |
| src/apm_cli/core/experimental.py | Updates canvas approval guidance. |
| src/apm_cli/commands/update.py | Reconciles changed trust without ref changes. |
| src/apm_cli/commands/uninstall/engine.py | Checks origins before marketplace fallback. |
| src/apm_cli/commands/targets.py | Reads manifest target declarations. |
| src/apm_cli/commands/pack.py | Corrects target-selection guidance. |
| src/apm_cli/commands/outdated.py | Reports marketplace origin conflicts. |
| src/apm_cli/commands/lock.py | Wraps resolution in catalog freshness handling. |
| src/apm_cli/commands/lifecycle.py | Routes execution through the script gate. |
| src/apm_cli/commands/install.py | Checks locked origins for positional marketplace installs. |
| src/apm_cli/commands/deps/cli.py | Revalidates catalogs during dependency updates. |
| src/apm_cli/commands/compile/cli.py | Uses current target-field wording. |
| src/apm_cli/commands/approve.py | Tightens selection and clears same-store denials. |
| src/apm_cli/codex_plugins/admission.py | Updates approval-field diagnostics. |
| src/apm_cli/bundle/plugin_exporter.py | Filters managed MCP with a dependency exception. |
| src/apm_cli/bundle/local_bundle.py | Warns about newer embedded lock generators. |
| scripts/architecture_linter/groups/contracts_tests.py | Registers lifecycle script guards. |
| scripts/architecture_linter/checks/marketplace_pack_plugin_manifests.py | Guards MCP ownership filtering. |
| scripts/architecture_linter/checks/marketplace_locked_evidence.py | Guards marketplace mapping and resolution callers. |
| scripts/architecture_linter/checks/marketplace_catalog_freshness.py | Requires registered freshness envelopes. |
| scripts/architecture_linter/checks/install_lsp_plugin.py | Guards trust callers and exact matching. |
| scripts/architecture_linter/checks/install_frozen_and_audit.py | Guards bundle MCP reconciliation. |
| scripts/architecture_linter/checks/contracts_lockfile_generator.py | Guards version stamps and serialization. |
| scripts/architecture_linter/checks/contracts_lifecycle_script_gate.py | Restricts lifecycle runner construction. |
| packages/apm-guide/.apm/skills/apm-usage/package-authoring.md | Documents bundle executable retirement. |
| packages/apm-guide/.apm/skills/apm-usage/dependencies.md | Documents marketplace origin refusals. |
| docs/src/content/docs/troubleshooting/install-failures.md | Explains newer bundle-lock warnings. |
| docs/src/content/docs/reference/lockfile-spec.md | Clarifies generator stamping semantics. |
| docs/src/content/docs/reference/cli/pack.md | Documents managed MCP filtering. |
| docs/src/content/docs/reference/cli/outdated.md | Documents origin conflicts and exit status. |
| docs/src/content/docs/reference/cli/marketplace.md | Lists commands that reject rebound aliases. |
| docs/src/content/docs/reference/cli/lifecycle.md | Documents execution gate requirements. |
| docs/src/content/docs/reference/cli/install.md | Clarifies frozen denial diagnostics. |
| docs/src/content/docs/reference/cli/deny.md | Explains remediation and hook reconciliation. |
| docs/src/content/docs/reference/cli/config.md | Corrects the default client example. |
| docs/src/content/docs/reference/cli/approve.md | Documents denial clearing and user scope. |
| docs/src/content/docs/reference/baseline-checks.md | Documents denied MCP audit diagnostics. |
| docs/src/content/docs/enterprise/lifecycle-scripts.md | Clarifies gated synthetic execution. |
| docs/src/content/docs/consumer/installing-from-marketplaces.md | Explains alias-rebind protection. |
| docs/src/content/docs/consumer/deploy-a-bundle.md | Documents MCP and LSP retirement. |
| CHANGELOG.md | Records fixes, security changes, and migration guidance. |
| .apm/architecture/owners/marketplace-plugins.json | Updates marketplace origin ownership. |
| .apm/architecture/owners/contracts-tooling.json | Registers script-gate and stamping ownership. |
Review effort: Balanced
Harvested from #3981 (6cd7b3a, delta panel fold). Only a denied row with mixed per-type verdicts reconciles, so common partial approvals keep the no-change short-circuit; the probe catches only unreadable-package errors instead of every exception. Tests pin when the probe fetches policy, mixed detection on a two-type package, and every unavailable policy outcome. Test calls pass the scope manifest path, per #3988's trust-owner signature. Refs #3958 apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: danielmeppiel <[email protected]> Co-authored-by: Copilot App <[email protected]>
CI on 913336a was red on tests that encoded the pre-#3983 contracts: - lifecycle test --execute now fires through the script gate, so the firing test trusts the project first and the old bypass trap now asserts untrusted scripts are withheld (mutation-break: restoring an ungated LifecycleScriptRunner fails it); - codex native admission names executables.allow, not allowExecutables; - a real LockFile.write stamps the running CLI (#3962), so the heal eligibility fixture pins the stamp it means to write; - pack no longer ships servers apm install renders from apm.yml (#3966), so the bundle MCP retire test authors its server in .mcp.json. Addresses merge-worker CI triage on #3988. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
require_locked_catalog_origin rescanned lockfile.dependencies for every package, breaking the uninstall single-traversal guarantee. The batch index now also keys rows case-insensitively, and the registry fallback checks each matched row through require_locked_row_origin before any catalog I/O. Adds a rebound-alias regression test (mutation-break: dropping the check lets the catalog be reached) and moves the origin entry-point guard and its mutation case to the new call. Refs #3959 apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
A Claude plugin silently lost the MCP servers apm install renders from apm.yml. Pack now names them and the remedy; the CHANGELOG moves the #3966 line to upgrade notes with that migration, pack.md and apm-usage say the same, and the unrelated #3931 line this PR dropped is restored. Addresses panel follow-ups (supply-chain, doc-writer) on #3988. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
- install x@alias reads a legacy apm.lock for the origin check, through the read-only lockfile resolver, so a rebound alias fails closed before migration (Copilot on commands/install.py:220); - the update probe reuses POLICY_RESOLUTION_FAILURE_OUTCOMES, so an incomplete policy chain also forces the guarded install path (Copilot on commands/update.py:148); - apm approve clears a same-store deny stored under any spelling the deny ladder matches (URL, host, case), via canonical_exec_identity (Copilot on commands/approve.py:817). Each fix has a regression test proven by mutation-break. Refs #3957, #3958, #3959 apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
restriction() folds singular `target: all` to None (auto-detect), but
install expands it to the stable install set, so apm targets showed every
target inactive. Expand it through target_catalog.expand_all("install").
Regression test proven by mutation-break.
Addresses Copilot on commands/targets.py:32.
Refs #3792
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement
Co-authored-by: Copilot App <[email protected]>
locked_marketplace_row and locked_marketplace_form were called per declaration without an index, so LockFile.get_dependency rebuilt the marketplace index each time (O(M*N)). Both callers now build it once, as the reachability walk already does. Addresses Copilot on install/dry_run_plan.py:33 and install/orphans.py:46. Refs #3960 apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
The object-form mutation cases match the exact call text, which now passes the shared marketplace index. Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 3 | 0 | Owner routing is sound; two harvest seams broke CI and the uninstall single-traversal contract -- both folded at the owner. |
| Supply Chain Security Expert | 0 | 2 | 0 | Fail-closed defaults hold (origin check, exact approve, gate on update/audit); pack drop of managed MCP was silent for Claude producers. |
| Test Coverage Expert | 1 | 2 | 0 | Coverage is broad and fail-on-main; CI exposed four suites still encoding pre-#3983 contracts -- all realigned with mutation-breaks. |
| Doc Writer | 0 | 2 | 0 | Docs and apm-usage track the changes; the CHANGELOG lost an unrelated line and the pack change needs an upgrade note. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 5 follow-ups
- [Test Coverage Expert] (blocking-severity) Realign lifecycle, codex admission, heal-eligibility and bundle-retire tests to the 0.37 contracts (folded in 430b4e2). -- They were the CI-red cause on 913336a.
- [Python Architect] Uninstall origin check consumes the batch index via require_locked_row_origin (folded in 95e5310). -- Restores the single-traversal guarantee without losing the [BUG] apm install plugin@alias bypasses the marketplace origin check after an alias rebind #3959 check.
- [Supply Chain Security Expert] Warn when Claude pack leaves out APM-managed MCP servers; [BUG] Codex plugin.json from apm pack can point at APM's rendered .mcp.json, which may contain credentials #3966 moved to upgrade notes (folded in 5e5e354). -- Silent omission of shipped content surprises producers.
- [Doc Writer] Restore the fix(self-update): isolate Windows installer from inherited PSModulePath #3931 CHANGELOG line this PR dropped (folded in 5e5e354). -- Never delete another PR's Unreleased entry.
- [Python Architect] Converge trust-owner manifest-path derivation on core.scope.manifest_root (done in the fix(security): apply ~/.apm/apm.yml executable grants to global install and uninstall #3986 merge, e9d6c9d). -- Removes the last split in how callers name the scope manifest.
Recommendation
Ship after required review: every required check is green on 2e846b8. Iteration 3 merged main (#3986) onto one trust-owner signature and folded red-team qa-prA-5/6: Claude bundles again ship the producer's own apm.yml MCP servers (from apm.yml, credentials stripped, identical before and after install), and only claims whose runtime writes root .mcp.json can hide an authored root server. The one red check is the advisory eligibility evidence, which stops at its issue-reference limit for this umbrella PR and asks for human review by design.
Reservations carried from strategic-alignment
- PR A scope is the 0.37 owner hardening: route every caller through its canonical owner, with closed-world guards (one PR) #3983 scope record and supersedes fix(install): install -g honours executables: in APM_HOME/apm.yml #3969, fix(pack): never ship APM-managed root .mcp.json servers #3971, fix(install): preview object-form marketplace dependencies in --dry-run #3973-fix(approve): correct the remediation after apm deny #3979, fix(update,audit): honour the current executables decision after apm deny #3981; exit-code/stderr changes, plan/apply core, obligations linter, deprecation registry and single-selector refactor stay in 0.38 -- addressed by keeping every fold inside the touched owners; no 0.38 item was folded.
- Tier-2 polish (B4, B5, C4, C5a, C5b, C5d, C5e, A6, S8, S11) goes to stacked PR C -- addressed by not folding any of them.
- [BUG] MCP servers from a local bundle are invisible to the MCP view: audit and --frozen fail, and the next install removes them #3955, [BUG] audit --ci fails skill-subset-consistency on a correct lock when apm_modules is a stale warm copy #3964, [BUG] apm pack on plugin-only packages never prints the target deprecation warnings #3965, [BUG]
apm installwith several sub-path dependencies: when one is invalid, the valid one's skill files stay deployed while the output says no changes were committed #3874, feat(mcp): per-dependencytargetsscoping fordependencies.mcpentries #2606 and native-plugin pin portability go to stacked PR B -- addressed by not folding any of them.
Folded in this run
- (copilot) src/apm_cli/commands/install.py:220 -- origin check read only apm.lock.yaml; a legacy apm.lock was ignored before migration -- resolved in 1a24c8d.
- (copilot) src/apm_cli/commands/update.py:148 -- duplicated failure-outcome set missed incomplete_chain; now reuses POLICY_RESOLUTION_FAILURE_OUTCOMES -- resolved in 1a24c8d.
- (copilot) src/apm_cli/commands/approve.py:817 -- same-store deny clear only stripped versions; now matches every spelling the deny ladder matches via canonical_exec_identity -- resolved in 1a24c8d.
- (copilot) src/apm_cli/commands/targets.py:32 -- restriction() folds singular target: all to auto-detect; install expands it to the install set -- resolved in 60667a1.
- (copilot) src/apm_cli/install/dry_run_plan.py:33 -- per-declaration marketplace index rebuild made the dry-run dedupe O(M*N) -- resolved in 2249909.
- (copilot) src/apm_cli/install/orphans.py:46 -- per-declaration marketplace index rebuild in prune expected paths -- resolved in 2249909.
- (copilot) tests/integration/test_local_bundle_mcp_retire_lifecycle.py:51 -- fixture declared the server in apm.yml, which pack now withholds; server is now authored in .mcp.json -- resolved in 430b4e2.
- (panel) test_lifecycle.py realigned: --execute fires through the script gate (test-coverage-expert) -- resolved in 430b4e2.
- (panel) codex admission tests and req-sc-009 spec test match executables.allow wording (test-coverage-expert) -- resolved in 430b4e2.
- (panel) heal-eligibility fixture pins the 0.37 stamp LockFile.write now restamps (test-coverage-expert) -- resolved in 430b4e2.
- (panel) uninstall origin check consumes the batch index via require_locked_row_origin; single traversal restored (python-architect) -- resolved in 95e5310.
- (panel) Claude pack warns when APM-managed root .mcp.json servers are left out (supply-chain-security-expert) -- resolved in 5e5e354.
- (panel) CHANGELOG: restore dropped fix(self-update): isolate Windows installer from inherited PSModulePath #3931 line; [BUG] Codex plugin.json from apm pack can point at APM's rendered .mcp.json, which may contain credentials #3966 line now describes authored-source packing; pack.md and apm-usage updated (doc-writer) -- resolved in 5e5e354.
- (panel) harvest fix(update,audit): honour the current executables decision after apm deny #3981 delta fold 6cd7b3a: denied-only mixed reconcile, narrowed probe except, tests (implementer request) -- resolved in 30dc28d.
- (panel) object-form mutation cases track the shared marketplace index -- resolved in 034033d.
- (panel) Merge main fix(security): apply ~/.apm/apm.yml executable grants to global install and uninstall #3986 (14d828e): trust callers pass project_manifest_path(manifest_root(...)); package_path getattr chain dropped; audit replay reads APM_HOME/apm.yml under -g; guard refuses registered callers deriving apm.yml (resolves the deferred manifest_root convergence) -- resolved in e9d6c9d.
- (panel) qa-prA-5: Claude bundle and plugin.json ship the producer's apm.yml self-defined MCP servers from apm.yml values, credential-stripped, byte-identical before/after install -- resolved in 2e846b8.
- (panel) qa-prA-6: only lock claims whose runtime writes root .mcp.json hide an authored root server (Cursor-only claim no longer drops it from Claude/Codex) -- resolved in 2e846b8.
Copilot signals reviewed
src/apm_cli/commands/install.py:220-- LEGIT: origin check read only apm.lock.yaml; a legacy apm.lock was ignored before migration (resolved in 1a24c8d).src/apm_cli/commands/update.py:148-- LEGIT: duplicated failure-outcome set missed incomplete_chain; now reuses POLICY_RESOLUTION_FAILURE_OUTCOMES (resolved in 1a24c8d).src/apm_cli/install/exec_gate.py:396-- NOT-LEGIT: deliberate fix(update,audit): honour the current executables decision after apm deny #3981 delta-panel design: no org fetch when no gate was ever recorded and local layers leave it off; apm install applies a newly enabled gate and apm audit --ci replay re-derives current trust, so hooks are reported.src/apm_cli/commands/approve.py:817-- LEGIT: same-store deny clear only stripped versions; now matches every spelling the deny ladder matches via canonical_exec_identity (resolved in 1a24c8d).src/apm_cli/commands/targets.py:32-- LEGIT: restriction() folds singular target: all to auto-detect; install expands it to the install set (resolved in 60667a1).src/apm_cli/install/dry_run_plan.py:33-- LEGIT: per-declaration marketplace index rebuild made the dry-run dedupe O(M*N) (resolved in 2249909).src/apm_cli/install/orphans.py:46-- LEGIT: per-declaration marketplace index rebuild in prune expected paths (resolved in 2249909).tests/integration/test_local_bundle_mcp_retire_lifecycle.py:51-- LEGIT: fixture declared the server in apm.yml, which pack now withholds; server is now authored in .mcp.json (resolved in 430b4e2).
Regression-trap evidence (mutation-break gate)
tests/unit/commands/test_lifecycle.py::TestLifecycleTestTrustDisplay::test_execute_flag_withholds_untrusted_scripts-- deletedbuild_runner_from_context in lifecycle_test (replaced by an ungated LifecycleScriptRunner); test FAILED as expected; guard restored.tests/unit/test_uninstall_engine_helpers.py::TestResolveMarketplacePackagesSingleTraversal::test_rebound_alias_never_reaches_the_catalog-- deletedrequire_locked_row_origin loop in _resolve_marketplace_packages; test FAILED as expected; guard restored.tests/integration/test_local_bundle_mcp_retire_lifecycle.py::test_bundle_mcp_retires_on_revoke_deny_and_repack-- deletedClaude-format clause of bundle_mcp_present in install_local_bundle; test FAILED as expected; guard restored.tests/unit/core/test_plugin_manifest.py::TestApmManagedMcpExcludedFromPack::test_mixed_file_is_not_referenced_by_codex_and_filtered_for_claude-- deleteddropped-server warning in collect_mcp_servers; test FAILED as expected; guard restored.tests/unit/test_install_command.py::test_marketplace_origin_check_reads_a_legacy_lockfile-- deletedresolve_lockfile_path_for_read in _scoped_lockfile; test FAILED as expected; guard restored.tests/unit/install/test_replay_exec_allow_map.py::test_update_probe_fails_toward_the_gate_on_unavailable_policy[incomplete_chain-True]-- deletedPOLICY_RESOLUTION_FAILURE_OUTCOMES in _executables_need_reconcile (old 4-outcome set); test FAILED as expected; guard restored.tests/unit/commands/test_approve_deny.py::test_approve_clears_a_deny_stored_under_another_spelling-- deletedcanonical_exec_identity match in _same_store_denies; test FAILED as expected; guard restored.tests/unit/commands/test_targets_command.py::TestTargetsHonourManifest::test_singular_target_all_is_active_like_install-- deletedsingular all expansion in _manifest_targets; test FAILED as expected; guard restored.tests/unit/install/test_replay_exec_allow_map.py::test_global_replay_reads_the_user_manifest-- deleteduser_scope in ReplayExecAllowMap manifest_root call; test FAILED as expected; guard restored.tests/integration/test_architecture_owner_rule_mutations.py::test_trust_owner_guard_rejects_root_derived_callers[registered-caller-derives-apm-yml-from-root]-- deletedregistered-caller apm.yml derivation clause in GUARD_EXECUTABLE_TRUST; test FAILED as expected; guard restored.tests/unit/core/test_plugin_manifest.py::TestApmManagedMcpExcludedFromPack::test_root_manifest_declarations_ship_identically_before_and_after_install-- deletedapm.yml projection (whole fix; fails on e9d6c9d153); test FAILED as expected; guard restored.tests/unit/core/test_plugin_manifest.py::TestApmManagedMcpExcludedFromPack::test_another_runtimes_claim_does_not_hide_an_authored_root_server-- deletedroot-destination claim filter (whole fix; fails on e9d6c9d153); test FAILED as expected; guard restored.
Lint contract
uvx [email protected] check and format --check (src/, tests/, architecture linter scripts) silent; scripts/lint-auth-signals.sh clean; scripts/lint-architecture-boundaries.sh exit 0; pylint R0801 10.00/10.
CI
gh pr checks 3988 at 2e846b8: 30 pass (Lint, Build & Test shards, Lifecycle Smoke shards, Windows gates, Spec tests + conformance gate, NOTICE, CodeQL, 'gate'), 3 skipping, 1 fail: 'Publish neutral eligibility evidence' (advisory-only pull_request_target check: 'Issue reference limit exceeded' for this umbrella PR's body; asks for human review; not a required check). Earlier recovery: test realignment push, two infra flakes rerun once each. (after 3 CI fix iteration(s)).
Mergeability status
| PR | head SHA | CEO stance | iters | folds | defers | Copilot rounds | CI | mergeable | mergeStateStatus | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #3988 | 2e846b8 |
ship_with_followups | 3 | 18 | 0 | 2 | red (advisory eligibility only) | MERGEABLE | BLOCKED | pending required review |
Convergence
3 outer iteration(s); 2 Copilot round(s). Final panel stance: ship_with_followups. Ready for maintainer review.
Full per-persona findings
Python Architect
- [recommended] Harvested fix(pack): never ship APM-managed root .mcp.json servers #3971 (pack excludes APM-managed .mcp.json) and fix(install): retire a local bundle's MCP servers when a reinstall drops them #3975 (bundle MCP retire test) disagreed: the test shipped its server via apm.yml dependencies.mcp, which pack now withholds. at
tests/integration/test_local_bundle_mcp_retire_lifecycle.py
Two harvested owners were never exercised together; test_bundle_mcp_retires_on_revoke_deny_and_repack failed on its first approved install in Lifecycle Smoke Shard 1.
Suggested: Author the bundle server in the producer's root .mcp.json so the [BUG] An approved local-bundle MCP server is never removed after revoke, deny or repack #3956 retire path is tested under the [BUG] Codex plugin.json from apm pack can point at APM's rendered .mcp.json, which may contain credentials #3966 pack contract. - [recommended] The uninstall registry fallback called require_locked_catalog_origin per package, rescanning lockfile.dependencies and breaking the single-traversal guarantee. at
src/apm_cli/commands/uninstall/engine.py:683
TestResolveMarketplacePackagesSingleTraversal pins one values() call per batch; the origin owner should consume the rows the batch index already holds.
Suggested: Index rows case-insensitively in the existing pre-index loop and call require_locked_row_origin per matched row; move the closed-world entry-point guard to that call. - [recommended] Trust-owner callers derive the manifest path three ways (project_manifest_path, get_manifest_path(scope), apm_package.package_path). at
src/apm_cli/install/mcp/integration.py:63
The owner now takes a manifest path, but the derivation is still split; fix(security): apply ~/.apm/apm.yml executable grants to global install and uninstall #3986 introduces core.scope.manifest_root, which is the natural single helper.
Suggested: When rebasing onto fix(security): apply ~/.apm/apm.yml executable grants to global install and uninstall #3986, route directory callers through project_manifest_path(manifest_root(...)).
Supply Chain Security Expert
- [recommended] Claude pack silently drops root .mcp.json servers apm install manages, so a producer's apm.yml-declared MCP vanishes from the plugin without notice. at
src/apm_cli/core/plugin_manifest.py
Codex already warns on a mixed file; the Claude path filtered with no message. Silent omission of shipped content is a correctness surprise even when the direction is safe.
Suggested: Warn naming the dropped servers and the remedy (write them in .mcp.json yourself). - [recommended] Uninstall registry fallback must keep the [BUG] apm install plugin@alias bypasses the marketplace origin check after an alias rebind #3959 origin check before any catalog I/O once it moves off require_locked_catalog_origin. at
src/apm_cli/commands/uninstall/engine.py
A rebound alias must never reach the new catalog; a recased plugin name misses both exact and plugin indexes and is the only path that reaches the fallback with a locked row.
Proof (passed):tests/unit/test_uninstall_engine_helpers.py::TestResolveMarketplacePackagesSingleTraversal::test_rebound_alias_never_reaches_the_catalog-- proves: uninstall never resolves through a marketplace alias rebound since lock time
Test Coverage Expert
- [blocking] test_lifecycle.py still asserted that lifecycle test --execute bypasses trust, the contract this PR deliberately reverses. at
tests/unit/commands/test_lifecycle.py:234
Build & Test Shard 1/2 failed on 913336a; the stale trap kept CI red and mis-documented the security posture.
Proof (passed):tests/unit/commands/test_lifecycle.py::TestLifecycleTestTrustDisplay::test_execute_flag_withholds_untrusted_scripts-- proves: an untrusted project script is not fired by lifecycle test --execute - [recommended] Codex admission tests (unit and spec_conformance req-sc-009) matched the old allowExecutables wording. at
tests/spec_conformance/test_codex_compatibility_admission_reqs.py:80
Spec tests (2/3) and the Spec conformance gate failed on the message rename only; the req-sc-009 deny behavior is unchanged.
Proof (passed):tests/spec_conformance/test_codex_compatibility_admission_reqs.py::test_codex_consumer_denies_unapproved_manifest_referenced_mcp-- proves: an unapproved manifest-referenced MCP server is denied before queueing - [recommended] heal-eligibility fixture wrote a 0.37 lock through LockFile.write, which now restamps the running CLI. at
tests/unit/install/test_copilot_project_mcp_destination.py
The fixture, not the heal, was wrong: the pre-install snapshot case passes; the stamped-only fixture must pin the stamp it intends to write.
Proof (passed):tests/unit/install/test_copilot_project_mcp_destination.py::test_heal_eligibility_reads_the_pre_install_lock-- proves: heal eligibility reads the pre-install lock, not a post-write stamp
Doc Writer
- [recommended] CHANGELOG diff deleted the unrelated fix(self-update): isolate Windows installer from inherited PSModulePath #3931 self-update line under Fixed. at
CHANGELOG.md:81
Unreleased entries must never be deleted by another PR; the line was replaced while adding [BUG] apm install plugin@alias bypasses the marketplace origin check after an alias rebind #3959/[BUG] Deprecated apm deps update skips the marketplace revalidation from #3910 #3961 text.
Suggested: Restore the fix(self-update): isolate Windows installer from inherited PSModulePath #3931 line verbatim. - [recommended] The [BUG] Codex plugin.json from apm pack can point at APM's rendered .mcp.json, which may contain credentials #3966 pack change is a must-act for Claude-plugin producers who declared MCP in apm.yml, but it sat under Security without a migration. at
CHANGELOG.md
changelog.instructions.md: changes users must act on go only under Breaking changes and upgrade notes, with the migration in the same line; pack.md and apm-usage should state the remedy too.
Suggested: Move it to upgrade notes: to ship one, write it in .mcp.json, not apm.yml; mirror in pack.md and package-authoring.md.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
…t caller Brings in #3986 (user-scope executable grants from ~/.apm/apm.yml) at 14d828e. Conflicts in install/template.py and security/trust.py are resolved to #3988's trust-owner signature: exec_trust_context_for_project takes the scope's manifest FILE, derived through the scope owner as project_manifest_path(manifest_root(root, user_scope=...)). #3986's manifest_root stays for directory callers (resolve_project_exec_allow_map, uninstall, hook integrator); policy stays anchored at the deploy root. Folded at the owner: - prepare_mcp_integration drops the apm_package.package_path getattr chain; McpAdmission.for_project(user_scope=...) now names the grants manifest. - Audit replay (ReplayExecAllowMap) takes user_scope and reads APM_HOME/apm.yml under -g instead of deriving apm.yml from the deploy root; regression test proven by mutation-break. - GUARD_EXECUTABLE_TRUST also refuses a registered caller whose body derives apm.yml from a root; standalone mutation test test_trust_owner_guard_rejects_root_derived_callers covers an unregistered #3986-style global-uninstall caller and a registered caller deriving apm.yml (mutation-break: dropping the new clause fails it). apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
…entries Red team qa-prA-5 and qa-prA-6 on #3988, both regressions against main: - A Claude bundle and plugin.json dropped the producer's own apm.yml MCP servers: they were read only from the rendered root .mcp.json, which pack now withholds. collect_mcp_servers projects the root manifest's self-defined declarations from apm.yml values (never the rendered copy), through the existing credential stripping, so output is byte-identical before and after apm install. The pack warning remains only for APM-managed servers apm.yml does not define (a dependency's). - apm_managed_mcp_names unioned lock claims from every runtime, so a Cursor-only claim on `docs` hid an authored root `docs` from Claude and Codex. Only claims whose runtime writes root .mcp.json count, read through the factory (ClientFactory.project_destination_is_root_mcp_json, side-effect free); unknown runtimes and unplaced aggregate names stay managed (conservative). The new unit tests fail on e9d6c9d and pass here; the bundle-retire lifecycle test is back to its apm.yml declaration; test_pack_mcp_ownership asserts byte identity, no header or secret values and no reference to the rendered file; the pack guard requires both owner rules, with a standalone mutation test. CHANGELOG, pack.md and apm-usage updated. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
#3966's pack projection (#3988) ships the root apm.yml's self-defined MCP servers in the Claude plugin, and #2606 (this PR) adds `targets:` on dependencies.mcp. A server declared `targets: [cursor]` was still embedded in the Claude plugin.json and bundle .mcp.json. The projection now asks the per-dependency runtime owner (mcp_dependency_runtimes) whether Claude receives it. Regression test proven by mutation-break; pack.md updated. Addresses merge-worker lean panel (python-architect) on #3989. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>


Description
The 0.37 architecture review (umbrella #3983) found that roughly 60 consistency defects share one cause. A command, scope or mode skipped an owner that already exists: trust, marketplace origin, lockfile writer or script gate. Some owners also failed open when a caller left out an argument. Route-list guards, which name only the known callers, leaked. Closed-world guards, which refuse every caller except the approved ones, held.
This PR fixes each defect inside its owner, at the last shared point before the effect. In the same PR it makes that owner's static guard closed-world: deny by default, with named exemptions and an insertion mutation case. It adds no new frameworks. The plan/apply core, the obligations linter, the deprecation registry and the single-selector refactor are 0.38 work.
The paused worker PRs below were harvested and reshaped where needed. Each harvested commit names its source PR.
LockFile.writewarn_if_newer. (#3977, #3978)deps/lockfile.pyserializes a lockfile (to_yaml).resolve_marketplace_pluginentry point: positionalinstall x@alias(project and-g), uninstall andoutdated. The lock read is lazy. (#3976)resolve_marketplace_pluginfail.catalog_freshnessenvelopeapm deps updateandapm lock --updaterevalidate marketplaces. (#3961, new)_install_apm_dependenciesmust sit inside a registered envelope. This replaces the route list.exec_trust_context_for_project)apm.ymlfrom a root the caller picked.-gresolvesAPM_HOME/apm.yml. MCP admission under-greads the parsed manifest. (#3969 test and MCP-admission change)apm.ymlitself. This caught a newsource_rootcall in the #3981 follow-up.apm updatewith no ref change runs the executables reconcile, and audit replay re-derives current trust instead of trustingexec_status: deployed. (#3981)_wire_legacy_bundle_mcp_servers->run_owned_mcp_integration, plus the required reconcile condition..mcp.jsonexclude APM-managed servers by default. A mixed file is not referenced by Codex. (#3971)apm lifecycle test --executebuilds its runner withbuild_runner_from_context, soAPM_NO_SCRIPTS, orgdeny_alland script trust apply. (new)lifecycle-script-firing-gate:LifecycleScriptRunner(is constructed only by the factory.apm approveon a denied package clears the same-store deny and says so.--frozennames the gate, anddeny --userworks outside a project. (#3979, plus new matching)apm install --dry-runandapm prunemap object-form{name, marketplace}declarations to their lock row. (#3973, #3974)apm targetshonourstargets:. Messages nametargets:,executables.allowand "marketplace". Generatedapm.ymlheaders and unknown-target errors stop listingvscode. Config docs showcopilot.Behaviour changes Daniel approved on #3983:
install x@aliasrefuses after the alias is rebound.apm_version.approveon a denied package clears the deny and says so.Exit-code and stderr changes stay in 0.38.
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement
Issue and approved scope
Issue: Refs #3983 (umbrella; scope record: #3983). This is PR A (owner hardening).
Fixes #3956
Fixes #3957
Fixes #3958
Fixes #3959
Fixes #3960
Fixes #3961
Fixes #3962
Fixes #3963
Fixes #3966
Fixes #3792
Refs #3954: #3986 carries the main
-ggrant fix. This PR adds the trust owner's manifest-path signature, the closed-world guard and the-gMCP-admission read. It will be rebased onto #3986 once that lands.Refs #3967: this PR covers the
vscodeheader and error text (C5c). Left for a follow-up, or 0.38 where noted: B4 deps list keys, B5 prefixes, C4--excludenormalization, C5a double warning, C5bupdate -glabel, C5d.github/mcp.jsonsignal list, C5e dry-run.mcp.jsonpreview, the A6 view hint, S8setup-codex.sh, S11 intellij help.Does this PR complete the issue, or what remains? It completes the must-ship tier of #3983. PR B, stacked on this one, carries #3955, #3964, #3965, #3874, #2606 and the native-plugin pin portability fix.
Supersedes: #3969 (pending the rebase onto #3986), #3971, #3973, #3974, #3975, #3976, #3977, #3978, #3979, #3981.
Type of change
Testing
Local evidence:
uvx [email protected] checkandformat --checkover the CI paths: passed.relative_toguards: clean.bash scripts/lint-auth-signals.sh: clean.bash scripts/lint-architecture-boundaries.sh: exit 0.python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 ...: 10.00/10.pytestover the touched unit test files plustest_install_command.py,test_exec_vocab_unification.pyandtest_manifest_bootstrap.py: 501 passed, 1 skipped.test_architecture_owner_rule_mutations.py -ktrust_owner_reads, freshness_envelope, pack_never_ships, bundle_reinstall_reconciles, object_form_declarations, gated_hooks_retire, lifecycle-script-gate, lockfile-generator): passed.test_marketplace_explicit_refresh_lifecycle.py(deps updatere-pin and the 503 matrix includingdeps updateandlock --update);test_approve_deny.pyexact and ambiguous matching tests;test_targets_command.py::TestTargetsHonourManifest.APM_E2E_TESTS=1 pytest -n 2 tests/integration/test_package_mcp_executables_gate_lifecycle.py test_deny_remediation_lifecycle.py test_executables_deny_retires_hooks_lifecycle.py test_lockfile_generator_gate_lifecycle.py: 41 passed.Changelog
## [Unreleased], grouped by theme (Fixed, Security, one upgrade note forlifecycle test --execute).Spec conformance (OpenAPM v0.1)