Repository navigation
fix(claude): install intact user plugins through Claude settings, owned by the lock - #3290
Daniel Meppiel (danielmeppiel) wants to merge 77 commits into
Conversation
Register new plugins disabled via the qualified native CLI, preserve activation, and reconcile owned metadata from locked sources. Authenticated runtime qualification remains pending. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c656434-efdf-444d-bb89-27407cbc7c44
Read saved lock state, preserve parser-normalized legacy plugin types, and retain selector/preflight ownership while suppressing loose projection. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c656434-efdf-444d-bb89-27407cbc7c44
Cover user-hook migration, standalone and replay controls, full-source safety, interrupted ownership recovery and native transport metadata exclusion. Document qualified metadata versus pending runtime execution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c656434-efdf-444d-bb89-27407cbc7c44
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c656434-efdf-444d-bb89-27407cbc7c44
Fold independent PR3290 panel findings and observed CI failures. Exercise installed APM hook metadata lifecycle without native hook execution. Preserve canonical empty survivors until native cleanup succeeds, keep target-aware diagnostics, and document the missing runtime witnesses. Metadata protocol fixture extracted from Daniel Meppiel's command lifecycle test in commit 41bdcf1, preserving its metadata-only boundary. Co-authored-by: Daniel Meppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a # Conflicts: # src/apm_cli/install/drift.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Refuse unsupported automatic migration through the existing hook owner. Exercise req-lk-021 byte preservation and malformed-state refusal with real component conformance cases; keep native runtime qualification open. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Preserve retained-hook compliance and the canonical native replay seam. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Keep existing package and lockfile hash semantics unchanged. Provide one canonical raw-content and Git executable-bit fingerprint for native consumers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Exercise complete publisher assets, Git executable bits, transport exclusions, symlink refusal, and unchanged historical package hashes without any native runtime. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Use the sole canonical native fingerprint API for admission, retained ownership, readback and read-only audit. Bind remote attestations to saved source pins, refuse unfingerprinted legacy adoption, and retain recoverable removal intent. Normalize local replay inputs only in scratch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Exercise missing pins, independently callable pre-write checks, mixed-version removal recovery, normalization stability and real local CLI audit. Keep the pre-existing local MCP consistency diagnostic distinct from native drift evidence. Document audit scope and retained fingerprint boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Fold the independent CEO synthesis follow-up without weakening the generic MCP source-admission contract. Raw local legacy plugins can retain a separate config-consistency failure while their native fingerprint is healthy. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
APM Review Panel:
|
Preserve both native registrars, selected-format admission, audit replay and cleanup. Retain canonical native hashing and source-plan authority; cover combined target selection and defer the Claude phase import. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
The exact merged candidate emitted the required user-scope refusal, but Rich wrapped the phrase across a line. Normalize diagnostic whitespace while retaining the failure, wording and unchanged-native-state assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Keep dynamic function lookup through the existing pure lockfile_state owner. This removes a redundant function-local import and restores the unchanged 200-statement budget after the native merge, without changing cleanup or refusal behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f79e464c-180e-4be3-9056-0773aa679a1a
Share prepared native admission with batch skill preflight, verify local locks against the original source image, and inspect raw local MCP declarations in disposable validated snapshots. Keep Claude audit verification isolated from loose deployment replay and preserve independent cache fingerprints. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6c656434-efdf-444d-bb89-27407cbc7c44
Integrate published #3290 d23d1ac and main 7e20 while preserving the independent #3181 command contracts and contributor ancestry. Native runtime acceptance remains unmet; this merge does not grant consent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 583dd1bc-30be-41e1-b45e-a1dd8988136e
|
Published The resumed repair shares native admission with batch skill preflight, preserves same-name personal loose skills, checks local locks against original source snapshots, validates raw local MCP declarations in disposable scratch, and keeps complete Claude audit verification out of loose-deployment replay. The command companion #3291 consumed this public foundation; no private producer patch was required. Evidence: 424 functional and 120 static passes on the merged working tree; full conformance 517 passed / 2 skipped; 46 exact-head functional cases bind all 8 detected owners; full current lint mirror and strict guards pass. Four process-memory guard mutations produced 10 intended failures with zero errors before restoration. Current CI, spec conformance, and Merge Gate are successful at this head. The original lifecycle job completed 394 tests successfully, with 13 skips, then hit its 10-minute job deadline. Its one isolated retry passed in 511.37 seconds / 9:05 total job time. No timeout, selection or source was changed. The original cancellation remains recorded; historical 6/3/2 is preserved, with cumulative CI recoveries now 3. Acceptance remains blocked, not ready to merge. Normal native consent for the isolated owned fixture session is still absent. Actual Claude Code 2.1.291 Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
Resolve two conflicts while keeping main's behavior and this PR's native Claude registration owner: - uninstall: keep main's _persist_uninstall_lockfile (symlink refusal, committed-claim binding, profile-scoped updates) and extend it with defer_empty_removal so an empty last-package lock is still retained until Claude native cleanup converges, then removed. - mcp_config_view: adopt main's #3540 redirect to the install-synthesized apm_modules/_local manifest for local Claude plugins (with missing-manifest warning and frozen cold-cache deferral). Drop the superseded scratch snapshot and retarget the marketplace-integrations-claude-ownership static guard and its mutation cases to main's redirect. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Route uninstall lock persistence through main's guarded _persist_uninstall_lockfile call; a small helper persists survivors, converges native registrations, then removes an empty last-package lock, keeping uninstall() within its statement budget. - Extract _queue_native_claude so integrate_package_primitives stays within the C901 limit after combining main's changes. - Align the local Claude MCP read-only test with main's #3540 semantics: without the install-synthesized manifest, servers stay uncollected and the publisher source is never mutated. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fold delta-panel follow-ups on the merge resolution: - _persist_lock_then_resync_native takes deploy_root, modules_dir and scope explicitly instead of forwarding **kwargs. - Unit traps for _persist_uninstall_lockfile defer_empty_removal branches and for removing an empty last-package lock only after native resync converges (mutation-break: no-defer -> 3 failures, unlink-before-resync -> 2 failures). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Native Claude check (10 minutes)This is the merge gate for #3181: Claude Code itself must load the plugin APM registered and run its namespaced command, with Requirements: macOS or Linux, 1. Isolated tools (about 3 minutes)2. Isolated HOME and CLAUDE_CONFIG_DIR3. Install the fixture plugin globally with APMExpected output includes: Expected: exactly one entry, 4. Your consent: enable the pluginAPM never enables plugins. You do that: 5. Run the namespaced command in a real sessionIn Claude:
6. Verify the witness (proof of success)Success means the script prints Failure looks like one of these: Heads-up from the agent dry run: 7. Clean upThen open a new shell so What the agent already verified at stack head Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors. |
A natively loaded plugin is approved as ONE item, executables.allow.<pkg>.plugin: sha256:<64 hex>, over the native plugin file set (path, exec bit, bytes; APM's root apm.yml and .apm/ excluded). Any byte or mode change parks the plugin with the re-approve hint. Per-file hook pins and the stray-file refusal leave the native path; split installs keep per-hook-file pins (D3). Seam for #3290: security.trust.admit_native_plugin(allow_executables, package_keys, plugin_root) -> Admission, and security.trust_fingerprint.native_plugin_fingerprint, delegating to utils.content_hash.compute_native_plugin_hash. Refs req-sc-016 (unchanged; MCP-only text). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…utables (#3902) (#3918) * feat(security): portable, content-pinned approval for dependency executables Approvals in apm.yml executables.allow can pin each hook file and MCP server to a full SHA-256 of what runs. One owner, security/trust.py admit(), decides every dependency-declared executable item for install, update, install --frozen, apm audit --ci, apm approve and the install prompt; security/trust_fingerprint.py is the only hasher. The lockfile stays evidence only (mcp_omissions reasons definition-changed, denied). - apm approve lists what each package runs and records pins; a changed definition is parked with a re-approve message. - --trust-transitive-mcp stays a one-off and says it does not persist. - install --frozen applies the executables gate like install (#3893). - audit --ci fails servers the lock admits but apm.yml does not approve. - Native plugin hooks are admitted per hook file from the install dir. - Legacy true approvals still deploy and warn. - Guards: executable-item-admission, trust-fingerprint, mcp-admission. Spec: OpenAPM v0.1 amendment 0.1.64 adds req-sc-016 and extends req-sc-011 to frozen install. Refs #3902 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(changelog): number the #3902 entries (#3918) apm-spec-waiver: changelog-only follow-up to the req-sc-016 amendment commit Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(security): fold panel review of #3918 into the trust owner - Native plugins: an org/project deny wins before any hook file is read, and per-file pins only narrow the package verdict (no empty-pin bypass). - One per-type verdict reader, trust.package_type_verdicts, now backs apm policy explain, approve --list/--pending, doctor, lockfile exec_status and native status; G1 forbids pin-blind resolvers outside security/. - One MCP enumerator feeds install, status and pins, so a changed pinned registry overlay reads as not deployed everywhere. - --trust-transitive-mcp never re-approves a changed self-defined server. - apm audit --ci discovers org policy like install (honoring --no-policy) and names an unavailable policy instead of passing silently. - apm approve prints success after the write, exits 1 on a refused pin or declined prompt, and hints the APM 0.37 requirement on the first pin. - Stale integration tests moved to the pinned shape; new lifecycle traps for --user vs audit, refusal exit code and uninstall survivors. Refs #3902 (req-sc-016, req-sc-011) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * feat(security): approve native plugins with one whole-root pin A natively loaded plugin is approved as ONE item, executables.allow.<pkg>.plugin: sha256:<64 hex>, over the native plugin file set (path, exec bit, bytes; APM's root apm.yml and .apm/ excluded). Any byte or mode change parks the plugin with the re-approve hint. Per-file hook pins and the stray-file refusal leave the native path; split installs keep per-hook-file pins (D3). Seam for #3290: security.trust.admit_native_plugin(allow_executables, package_keys, plugin_root) -> Admission, and security.trust_fingerprint.native_plugin_fingerprint, delegating to utils.content_hash.compute_native_plugin_hash. Refs req-sc-016 (unchanged; MCP-only text). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * test: assert every stored hook pin is a full fingerprint Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(security): honour native plugin pins only on the native path Fold the supply-chain review of the whole-root plugin pin: - a plugin pin admits only a native install (admitted Copilot Agent Plugin or Codex bundle); a split install reads item pins, which apm approve now records beside the plugin pin; - with a pin, deny and the content hash are checked even when no executable type is detected; the native type set is one owner (native_root_exec_types); - decision A: an executable surface that references root .apm/ or apm.yml parks the plugin (apm-owned-reference) with one diagnostic naming the reference; - the dev-dependency lifecycle persists consent with apm approve before audit --ci (D6). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(spec): fold the apm-spec-guardian panel into req-sc-016 (0.1.64) - define the definition fingerprint: full sha256, never by prefix, from installed source, covering every launch-affecting field plus the resolved registry entry; unrecognized means not matching - (b) also admits a per-user req-sc-010 pin (manifest decides); a dependency's own manifest never grants - a stale pin is withheld even under the opt-in; trust.admit no longer lets --trust-transitive-mcp override a changed overlay pin - define the scope terms, (a) semantics, org denial over every path, the req-sc-010 relation and the MCP-only scope; disclose that the grant key and byte construction are implementation-defined - lifecycle: a lockfile depth edit cannot make a transitive server direct Refs req-sc-016, req-sc-011. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(install): route #3938's select factory through the trust owner CurrentMcpConfigView.select now takes McpAdmission instead of an approve callable plus trust_transitive_self_defined; install, both --frozen checks and audit admit through security/trust.py. Audit passes exact=False (structural evidence) and still re-checks consent. The omission-evidence rule pins the new routing; org deny-all records reason 'denied'. Drop the duplicated frozen CHANGELOG line (#3938 owns it). Refs req-sc-011, req-sc-016. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(security): fold Copilot review of #3918 into the trust owner - an existing MCP pin is checked even when the new declaration would not need approval (self-defined -> registry no longer bypasses it); the pin probe is policy-free, so no extra org policy discovery - the admission subject fingerprints the authored declaration, as apm approve pins it - apm approve --list/--pending report a transitive server that a legacy mcp: true leaves parked, matching install (D2) Refs req-sc-016. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(security): fold the delta panel into the native trust owner - every native install (pinned or not) is decided once by admit_native_plugin, over one type set (IR and manifest types passed as extra_types); the caller-side hook overrides are gone - root .apm/ content that is not a byte copy of a pinned plugin file, or a symlink, parks the plugin (apm-owned-reference); approve refuses it with exit 1 and --pending says it cannot be approved - a transitive native plugin with MCP needs the plugin pin (D2); admit_native_plugin gains keyword-only transitive and extra_types - a malformed pin store falls back to the full context, which reports it - denied items point at apm policy explain, not apm approve; the native listing says which split-install item pins it also records - lifecycle: registry rewrite of a pinned server parks, legacy mcp: true shows in --pending, real per-file pins never register a native plugin Refs req-sc-016. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * fix(security): a bare grant map keeps the native gate on admit_native_plugin read a plain allowExecutables mapping without a routed trust context as gate-off and admitted an unapproved Codex bundle; build a gate-on context from the map so it fails closed (req-sc-009, test_codex_consumer_denies_unapproved_manifest_referenced_mcp). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…admit_native_plugin - deployment_plan: Claude admission asks exec_gate.native_plugin_verdict, which calls security.trust.admit_native_plugin on the apm_modules source; parked plugins carry the trust owner's parked_plugin_message (req-na-005). - Drop the local native hasher; import native_plugin_files and compute_native_plugin_hash from utils/content_hash (#3918's single owner). - Fix: at user scope, install resolved executable trust from ~/apm.yml instead of ~/.apm/apm.yml, so pinned grants never applied to global installs; read the grants beside the manifest. - Fix: unpinned_apm_copy refused every normalized legacy plugin because of the parser-owned .apm/.plugin-skill-sources.json receipt; exempt exactly it. - apm approve treats a user-scope Claude-format plugin as native, so it writes the whole-plugin pin the native route checks (plus split item pins). - Pending-approval entries for a parked Claude plugin are marked native. - Lifecycle tests: park -> apm approve --all -> declared, with pinned grants. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…3902) At user scope the deploy root is $HOME, but the manifest and its `executables` grants live in $APM_HOME (~/.apm). `apm install -g` (install/template.py) and global uninstall survivor rebuild (uninstall/engine.py, HookIntegrator.reconcile_after_removal) resolved trust from $HOME/apm.yml, so the user manifest's approvals and gate were ignored and unapproved hooks could deploy. core.scope.manifest_root() names the manifest directory for the existing resolvers; no new decider. Also exempt exactly the parser-owned `.apm/.plugin-skill-sources.json` normalization receipt from unpinned_apm_copy: it is APM metadata, not a plugin copy, and refusing it parked every normalized legacy plugin. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…-plugin-root-3290
…ifest_root) Same fix as #3986, which lands on main independently: user-scope executable grants are read from ~/.apm/apm.yml for install and global uninstall, and the normalization receipt is exempt from unpinned_apm_copy. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…PM's canonical receipt Review follow-ups on #3986: - resolve_project_exec_allow_map gains manifest_dir: grants come from the user manifest while org policy is still discovered from the deploy root, so an external APM_HOME cannot drop HOME's Git-derived policy in survivor rebuilds (uninstall engine, HookIntegrator.reconcile_after_removal). - The .apm/ receipt exemption now requires the exact canonical receipt that normalization writes for a legacy plugin (plugin_parser owns the check) and never applies to a live-loaded Agent Plugin root; publisher-controlled or extended receipt bytes still park the plugin. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ides for 0.37 (#3950) * docs: reground consumer, producer, integration and troubleshooting guides for 0.37 Refs #3948. Wave 1 of the 0.37 docs sweep (docs-corpus-audit): guide pages outside reference/, excluding pages owned by in-flight #3918 and #3290. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs: tighten 0.37 frozen replay, origin and error quotes Panel follow-ups on the 0.37 guides sweep: --frozen still reads the marketplace for packages whose MCP/LSP servers come from the entry when apm_modules is empty; the rebound-alias origin check fires on any marketplace re-resolve, not only apm update; the dependency-confusion refusal runs after the marketplace.json fetch and before any plugin repository probe. Restore the remedy lines APM prints for the newer-lockfile, --frozen selection and MCP conflict errors, use a version pair that can actually produce the newer-lockfile refusal, and split the ci-cd --frozen sentence so "never" does not carry to "exits 1". Addresses CEO follow-ups FU-1..FU-4 (devx-ux-expert, doc-writer). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: scope marketplace update, replay check and frozen upgrade apm marketplace update refreshes caches only and keeps the ones that refreshed when another fails, so it is described apart from the apm update / --refresh "changes nothing" guarantee. Rows replayed from apm.lock.yaml skip the dependency-confusion check, and the 0.37 --frozen upgrade note now applies only when an older lock records a pairing that differs from what 0.37 resolves. Addresses Copilot inline on consumer/update-and-refresh.mdx:105, troubleshooting/common-errors.md and troubleshooting/migration.md:183. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: unify the --frozen MCP/LSP caveat and origin-conflict cause The marketplace read under --frozen applies to any package that contributes MCP or LSP servers whose copy under apm_modules/ is missing, so one per-package sentence now carries it on all three pages. The origin-conflict check only fires for an entry the lock already records, so a brand-new entry is no longer listed as a trigger. Addresses delta panel follow-ups (devx-ux-expert, doc-writer). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: name the fresh-checkout MCP/LSP case for origin conflicts A package that contributes MCP or LSP servers re-resolves through the marketplace when its apm_modules copy is missing, so plain and --frozen installs on a fresh checkout can also hit the origin-conflict check. Mark the trigger list as examples and include that case. Addresses terminal delta panel follow-up (devx-ux-expert). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* docs: reground pages freed by #3918 and leftover 0.37 drift Refs #3948. Wave 2 of the 0.37 docs sweep (docs-corpus-audit): the pages #3918 owned (concepts, install-packages, enterprise policy and security, mcp-as-primitive, reference update/manifest-schema, apm-usage dependencies/governance) plus reference/cli/deps.md (#3916 refusal). Pages owned by in-flight #3290 are not touched. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * docs(security): scope dependency-confusion and rebound claims to code The new threat-model row credited #3895 with general dependency-confusion protection, but it only catches one install graph declaring the same owner/repo from two hosts; bare shorthand still resolves to the default host. The rebound sentence also omitted lock rows without a recorded origin, local marketplaces and in-repo moves, which the check skips. Addresses supply-chain-security-expert panel findings and Copilot inline on docs/src/content/docs/enterprise/security.md:323. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(policy): fix skill CLI samples and allow-list wording The apm-usage governance CLI samples used header and footer lines the CLI never prints and a dry-run overflow that cannot follow two lines (the preview limit is 5); align them with policy-reference. Section 3 still described a repo override in the discovered chain, and the allowlist rows said 'non-empty', contradicting null vs [] semantics. Addresses doc-writer and supply-chain-security-expert panel findings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(install): qualify marketplace replay and default_host wording Locked marketplace entries replay offline except for a package whose locked MCP or LSP servers have no apm_modules copy; that case reads the marketplace even under --frozen (drift.py catalog-metadata). Also tie default_host to the shorthand rather than #ref and link the newer lockfile troubleshooting section. Addresses Copilot inline on reference/manifest-schema.md:701 and doc-writer panel nit on consumer/install-packages.md:64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(docs): track host-qualified policy wording in security.md security.md no longer says policy patterns are host-blind or cannot restrict host identity: dependencies.allow/deny accept host-qualified patterns (policy-reference). The docs-contract test still pinned the old wording and failed Build & Test Shard 1. Keep its intent (no transport-aware policy claim) and assert the scheme-blind sentence and the host-qualified link instead. Addresses CI failure in tests/unit/test_tls_docs_scope.py:127. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(security): name the manifest whose default_host applies Each parsed manifest, transitive ones included, resolves its own bare owner/repo dependencies against its own default_host, so a root default_host does not pin the whole graph. Say so in the dependency-confusion row and point at host-qualified allow patterns as the control. Addresses supply-chain-security-expert delta panel finding on docs/src/content/docs/enterprise/security.md:635. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…MCP and LSP Fold the lean review panel on #3986: - McpAdmission.for_project and resolve_project_exec_allow_map take a required user_scope and read grants from the scope's manifest themselves, so the MCP and LSP user-scope paths (and every future caller) can no longer read $HOME/apm.yml. Org policy discovery stays anchored at the deploy root. - Harden the normalization-receipt exemption: one shared serializer, bounded read, '.'/'..' names refused, each .apm/skills/<name>/ file must be a byte copy of the same path under its recorded source, and the skip re-checks path and bytes. - Tests: behavioral req-sc-009 conformance test at user scope (install hooks and MCP admission) with a deploy-root decoy manifest; decoys in the unit and real-CLI tests; writer round-trip receipt test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
An in-process `apm audit --format json` call (test_audit_recorded_target_reqs) routes the process-global console to stderr and nothing reset it, so test_packed_hook_resolution_reqs read an empty stdout whenever shard balancing placed it later in the same process. Adding a spec module shifted the shard boundary and exposed it; reproduced with the CI shard 3 flags (6 failed) and fixed (219 passed). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…-plugin-root-3290 # Conflicts: # src/apm_cli/commands/uninstall/engine.py # src/apm_cli/integration/hook_integrator.py # src/apm_cli/utils/content_hash.py # tests/integration/test_user_scope_exec_trust_lifecycle.py # tests/unit/security/test_trust_fingerprint.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…record The harness that loads a natively activated plugin follows from the lock entry's targets; the record no longer repeats it. Section 5.2 row updated. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The conflict resolution took #3986's hook_integrator.py and dropped this branch's dry_run parameter on reconcile_target_contraction, so every native Claude install failed with an unexpected keyword argument when services.py counted leftover loose hooks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
services -> claude_plugins.admission -> deps -> bundle -> integration -> skill_integrator -> services failed when services was imported first. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ith org policy applied - Admission accepts .mcp.json, .lsp.json, mcpServers and lspServers (paths must stay inside the plugin). The whole-plugin approval covers them; an executables deny for mcp or lsp parks the plugin. - Every declared MCP server goes through the org MCP checks (policy_checks.mcp_policy_checks, now the single composition used by the install gate too): enforcement block parks the plugin, warn reports. - Claude loads those servers from the plugin, so APM's MCP and LSP writers skip the Claude runtime for a natively routed dependency (one predicate, native_service_runtimes) and retire any loose Claude entry APM wrote earlier; other targets still get APM's copy. - Docs, apm-usage guide and CHANGELOG updated. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…pers in budget - Restore reporting the apm-hooks.json sidecar beside the settings file in failed_paths (lost in the #3986 merge), so the native-transition refusal names both files. - native_runtimes_of() reads a dependency's native runtimes as a frozenset for every writer, so non-dependency values (test doubles) never compare. - Move retire_native_runtime_claims to install/mcp/native_runtimes.py so install/mcp/ownership.py stays within its 1000-line budget. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ion output A real install of a plugin whose normalization writes apm.yml and .apm/ copies into the cache deploys exactly the publisher's tree, byte for byte, and the lock's native_plugin fingerprint equals the pristine source's. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
apm approve pinned a local plugin's hook file on its source tree (hooks/hooks.json) while install gated APM's normalized cache copy (.apm/hooks/hooks.json), so an approved hook stayed parked (finding #19). hook_item_key now names a normalized .apm/hooks byte copy by the publisher file it copies (plugin_parser.normalized_hook_source, the normalization owner); a copy whose bytes differ keeps its own key and still parks. Real-CLI regression: install parks, approve, reinstall deploys. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Description
Reshaped per the 2026-11-19 #3094 design record and brief. Claude only, user scope.
apm install --global --target claudenow installs an eligible Claude plugin intact. Its hooks (#3191,process.env.CLAUDE_PLUGIN_ROOT) and commands (#3181,${CLAUDE_PLUGIN_ROOT}) find their own bundled files. APM never runs theclaudeCLI.~/.apm/apm_moduleskeeps the fetched source.native_plugin_files: native bundle minus.git, rootapm.ymland root.apm/) to~/.agents/plugins/<plugin>/, and generate~/.agents/plugins/.claude-plugin/marketplace.json.settings.json(CLAUDE_CONFIG_DIRhonored) with onlyextraKnownMarketplaces.<apm-u-hash>(directory) andenabledPlugins["<plugin>@<apm-u-hash>"]: true.Ownership comes only from
apm.lock.yaml. Each entry carries anative_pluginrecord{name, root, fingerprint, marketplace{name,path}}(the loading harness follows from the entry's targets); settings keys and roots are derived from the previous and next lock. There is no receipt file.trueonly when a key is absent, and keeps an explicitfalse, foreign entries and edited roots.MCP and LSP servers (
.mcp.json,.lsp.json,mcpServers,lspServers) are supported. Claude loads them from the plugin; the whole-plugin approval covers them; every declared MCP server goes through the org MCP checks (policy_checks.mcp_policy_checks, the one composition the install gate also uses). APM's MCP/LSP writers skip the Claude runtime for a natively routed dependency (native_service_runtimes) and retire any loose Claude entry they wrote earlier; other targets still get APM's copy.Refusals:
enforcement: block;warnreports and enables), or declared plugindependencies. Never a loose fallback.bin/, unknown manifest capabilities, manifest or server paths outside the plugin, and case-folded name collisions.Approval pin portability: the approval binds paths and bytes (#3989
compute_native_plugin_pin); the mode-including root digest still gates source, deployed copy and lock. Spec amendment 0.1.66 (revises req-na-005 in place; no count change) is folded here once #3989 lands.Dropped:
claude_plugins/client.py(CLI driving), the Claude version allow-list, theapm-registration.jsonledger and the disabled default. Registrations from earlier heads of this PR are migrated by a guarded cleanup.src/apm_cli/native_plugins/{record,layout,settings}.pyclaude_plugins/registrar.py(reconcile_claude_plugins,verify_claude_native_cache),claude_plugins/admission.py(park, refusals)deps/lockfile.py(native_pluginfield),install/phases/lockfile.py(records, carry-forward across a one-shot--targetwithout Claude)install/phases/claude_plugins.py,commands/uninstall/cli.py(pre-mutation snapshot and lock restore)utils/content_hash.py(native_plugin_files,compute_native_plugin_hash; #3918 hosts the canonical copy when it lands)Merge order: #3929 (landed) -> #3918 -> this PR. When #3918 merges I switch the hooks bool to
security.trust.admit_native_plugin(allow_executables, package_keys, plugin_root)and import its hasher. Until then the interim approval is the legacyallowExecutableshooks bool, and no new approval path is added.Issue and approved scope
Issue: Fixes #3191; Fixes #3181
Human scope-approval comment: #3191 (comment) (reshape, supersedes the CLI-driven route); companion record #3181 (comment). Review contact: Daniel Meppiel (@danielmeppiel).
Does this PR complete the issue? Yes, once the human runtime witness passes on this head; its recipe was sent to the coordinator. The #3094 design study observed a settings-only SessionStart on real Claude 2.1.322. The command and UserPromptSubmit witness at 4624e7f used the earlier CLI route, so neither is evidence for this head. Out of scope: project scope and Copilot (#3921), Codex (#3920), the plugin dependency resolver, README.
Type of change
Testing
Validation at the pushed head (macOS arm64):
uvx ruff@0.15.12 checkandformat --checkover the CI lint scope: passed (2454 files).pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/...: 10.00/10.bash scripts/lint-auth-signals.shandbash scripts/lint-architecture-boundaries.sh: clean. The 2100-line andrelative_toguards: clean.APM_E2E_TESTS=1 pytest tests/integration/test_claude_native_hook_lifecycle.py: 7 passed. Covers two plugins whose realnodehooks resolve per-plugin roots, userfalseand foreign keys preserved, a one-shot--target codexkeeping Claude declarations,--frozen, audit tamper and mode drift, both failure-and-recovery paths, and a trapclaudeonPATHthat is never run.pytest tests/spec_conformance/test_native_activation_profile_reqs.py tests/unit/install/test_claude_native_*.py: passed. The req-na-001/006 waivers are skipped.pytest tests/unit tests/spec_conformance -n 8: 29017 passed, 14 failed. Each failure was rerun in isolation:test_ci_topologyandtest_targets_phase.test_is_tool_available.5b902f828. This head adds only the CHANGELOG line.apm install -g obra/superpowers(22f0b46) in an isolated HOME:~/.agents/plugins/superpowerswith noapm.yml,.apm/or.git, and all 4 hook files present.Changelog
## [Unreleased]inCHANGELOG.md: user-visible effect first, 25 words or fewer, ending with(#PR); breaking changes only under upgrade notes; no Highlights; see.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated. Section 5.2 gains thenative_pluginrow (fields, plus install/frozen/restore/audit timing), cited from req-na-002 and req-na-004. The req-na-002 digest exclusion is stated as unconditional (oci-rec-d1-1). No new anchors (amendment 0.1.65, docs(spec): add the OpenAPM native plugin activation profile (#3919) #3929).tests/spec_conformance/test_native_activation_profile_reqs.pybinds req-na-002 (known-answer digest vector and deployment), 003 (two keys, no subprocess), 004 (all 11 oracle cases, no receipt), 005 (parked, not declared) and 007 (per-APM-home name, binding refusal). req-na-001 (disclosure after the runtime witness) and 006 ([FEATURE] Codex: retire the app-server registration route; explicit split install #3920) stay waived.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com