Repository navigation
feat(native): project-scope native plugins for Claude and Copilot (#3921, #3896) - #4559
Conversation
, #3896) At project scope, `apm install` now deploys each approved Claude-format plugin whole to the committed `.agents/plugins/<plugin>/`, generates the catalog under a marketplace name unique to the repo, and declares it with a relative path in `.claude/settings.json` and `.github/copilot/settings.json`, following the plugin's targets. A fresh clone loads it in Claude Code and GitHub Copilot without APM. Agent Plugins move onto the same owner at both scopes, and `apm_modules/.github/plugin/apm-registration.json` registrations are migrated. Ownership comes from the previous and next `apm.lock.yaml`. This is the #3896 fix the 2026-11-19 decision chose: obra/superpowers ships per-harness hook files, so splitting it into primitives tripped the retired filename-routing guard (#3226) and every approved project install exited 1. It now installs intact with its hooks. Supersedes #4010 (rebased onto main after v0.37.0), with these changes: - approve: a Claude plugin is native at both scopes, so `apm approve` pins the whole plugin at project scope too (it pinned only hook files, leaving the approved plugin parked). - uninstall: a surviving native plugin the gates no longer allow loses its lock record, so the native owner retires its root and declarations (I4, as #4446 does for loose files). - 0.37 owners kept: catalog remedies for the new and moved messages (native-settings-invalid, native-plugin-update-held, project-scope loose-hooks switch), kept_note for the kept-version line, restore_lockfile_bytes for the rollback, scope-aware native drift for --frozen; lock row parsing and serialization of native fields moved to native_plugins/record.py (deps/lockfile.py at the 2100-line cap). - spec: provisional amendment renumbered 0.1.68 -> 0.1.73 (pending editor decision); CONFORMANCE regenerated. - tests: new failing-before lifecycle cell for the superpowers shape; 0.37 oracles that pinned project-scope split behavior re-pointed to the native surface (same promises); #4010 tests meet the AQ ceilings. Out of scope: targets that include cursor still refuse (no native route until #3922); Codex stays split (#3920). Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…l-fix-3896-native-project
- Plugin names may carry interior dots (Agent Plugin names such as acme.review); a leading or trailing dot is still refused (req-na-002). - $schema is inert manifest metadata: it no longer parks a plugin. - At project scope a skills: selection deploys loose, as a root-only plugin.json does; a whole-plugin load cannot honor it. - Lifecycle cells re-pointed to the native surface with the same promise (S15, accepted by the 0.38 PM): Copilot enablement in the committed settings, the generalized native summary, the gate write set and the project-scope I1 digest. Split-route cells (export-patch, legacy classification, plugin-root MCP portability) keep their promise on the split route: cursor, or a root-only plugin.json. - Quickstart: the committed paths get their own git add line; J02 anchors the world-independent audit lines. Co-authored-by: Copilot App <[email protected]>
…l-fix-3896-native-project
…eview folds) - Frozen read goes through InstallService.frozen_disposition; the native_declared stamp is written by the registered commit site. - install-commit-order anchors on the native activation phases; carry.py joins the claude-native-plugin-registration owner; the manifest path goes through core.scope.manifest_file. - Uninstall never rebuilds a survivor loose for a harness that loads it natively, and never restages a native plugin from its source (HIGH-2; hooks ran twice). Regression cell with approve --all. - Generator citations and obligations regenerated after main moved. Co-authored-by: Copilot App <[email protected]>
…t changed #4446's definition-change retirement still re-judges a changed local native plugin; an unchanged one is never re-copied or rebuilt loose. The #3499 MCP-shape cell keeps the split route with a root plugin.json. Docs: a skills: selection deploys loose at project scope. Co-authored-by: Copilot App <[email protected]>
…l-fix-3896-native-project # Conflicts: # docs/src/content/docs/specs/openapm-v0.1.md # tests/quality/lifecycle_obligations.json
Co-authored-by: Copilot App <[email protected]>
…l-fix-3896-native-project # Conflicts: # tests/lifecycle/generator/rules.py # tests/quality/lifecycle_obligations.json
Daniel Meppiel (danielmeppiel)
left a comment
There was a problem hiding this comment.
Delta review: fc6973e -> 1c81340 (standing 0.38 reviewer)
Verdict: CLEAN. No blocking findings. One spec-number collision to sort out at merge time (below).
Method: gh pr diff 4559, the PR-own commits since fc6973e (d3f8f2a, af54e06, 003275f, plus merges of main), and the changed owners, linter checks and tests. CI at 1c81340: Lint, Architecture Ratchet Contracts, Test Architecture Ratchets, Architecture Scaling, Build & Test, Spec tests and Lifecycle Smoke shards 1-4 are all green. The gate check was still pending when this was posted.
Prior findings
| ID | Status | Evidence |
|---|---|---|
| HIGH-1 CI red / arch-linter | Resolved | The frozen read goes through InstallService.frozen_disposition(ctx).withhold_lockfile_writes (install/phases/claude_plugins.py:88-94). The lock write moved into run, which main already registers as a lockfile-write site (contracts_lockfile_write_authority.py:56,93), so the authority list did not grow. carry.py, scopes.py and uninstall.py joined the claude-native-plugin-registration selectors. scopes.py uses core.scope.manifest_file. test_native_project_scope.py uses the apm_engine_command fixture. All lifecycle shards pass. |
| HIGH-2 double-load on sibling uninstall | Resolved | The fix works at two levels. uninstall/engine.py:1499-1503 removes the harnesses that load the plugin natively (native_harnesses) from the survivor rebuild targets, so nothing is rebuilt loose for them. engine.py:1792 skips restaging an unchanged native plugin. The regression cell test_uninstalling_a_sibling_keeps_a_local_native_plugin_whole asserts that the settings, root bytes and lock row are unchanged, and that no loose hooks or skills are written. |
| MEDIUM approve --all step | Resolved | The cell runs approve --all, asserts a sha256: plugin pin, then runs install and uninstall. The closing audit --ci is left out on purpose because of open bug #4566 (uninstall writes apm.yml/.apm into the local source). That is acceptable: the fingerprint excludes the root apm.yml and .apm/ (utils/content_hash.py:153-159), so #4566 cannot make native_source_current return a false result. |
P4 checklist
native_source_currentvs #4446 definition-changed semantics: resolved.scopes.py:85-104compares the source withrecord.fingerprintusing the same construction as the registrar (portableat project scope; compareregistrar.py:139portable=not user_scope). When the plugin has changed, it falls through to #4446's existing source-vs-materialized check, so a redefined native plugin is still re-copied and re-judged. The parametrizedtest_uninstalling_another_package_retires_a_disallowed_native_plugin(changed-definition case) covers this path, and it would have failed under d3f8's skip-all, which is why af54 relaxed it. Double-load cannot come back through this path, because loose rebuild targets are filtered separately (engine.py:1499).- Loose
skills:selection vs req-na-002: resolved. req-na-002 requires deploying "exactly the plugin root covered by the approval". Askills:subset is not the whole approved root, so it cannot be activated natively. Routing it to a loose deployment at project scope is the conforming choice, and af54 documents it. - Commit-order anchor guard is real: resolved (stricter).
install_entry_and_commit.py:214-218now pins both_run_phase("codex_plugins"and_run_phase("claude_plugins"aftertransaction.release_deploy_targets(). Main pinned onlycopilot_plugins, and that phase has left the pipeline.pipeline.py:947,959-960matches. - Spec renumber to 0.1.74: consistent, but it COLLIDES with #4001. No stray 0.1.73 is attributed to this amendment: every remaining 0.1.73 belongs to #2903, which is on main. In-text cites at the req-na-002/004/005 revisions and in
test_native_activation_profile_reqs.pyall say 0.1.74. However, draft #4001 (#1925,--policy) also adds a0.1.74 (proposed)row and a "0.1.64 and 0.1.74 proposals each add one MUST" count clause. Whichever PR lands second must renumber to 0.1.75, including the in-text "amendment 0.1.74" cites and the statement-count paragraph (openapm-v0.1.md:5703).
New findings (non-blocking)
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues can widen Claude skill selection and leave rejected native or legacy plugins enabled, while raw-byte fingerprints can falsely report drift after line-ending conversion.
4 open issues
What changed in this PR
This PR extends APM's native-plugin lifecycle to project-scope Claude Code and GitHub Copilot installs, addressing plugins such as Superpowers that depend on their complete directory layout.
Changes:
- Deploys whole plugins to committed
.agents/plugins/directories with relative settings declarations. - Consolidates native registration, lockfile ownership, approval, migration and removal handling.
- Updates lifecycle coverage, architecture checks, conformance reports and documentation.
| File | Description |
|---|---|
| tests/unit/install/test_pipeline_ownership_snapshot.py | Updates the reconciliation mock. |
| tests/unit/install/test_claude_native_registration.py | Adapts shared registration tests. |
| tests/unit/install/test_claude_native_hooks.py | Updates transition checks and diagnostics. |
| tests/unit/install/test_claude_native_admission.py | Covers project-scope admission and fallback. |
| tests/unit/install/test_agent_plugin_deployment_boundary.py | Checks new native deployment paths. |
| tests/unit/deps/test_lockfile_field_properties.py | Covers declaration-field round trips. |
| tests/unit/deps/test_lockfile_consumer_contract.py | Adds native declaration fixture data. |
| tests/unit/core/test_remediation_w4_phases_targets_catalog.py | Registers new remediation coverage. |
| tests/unit/core/test_remediation_w3_plugins_runtime_catalog.py | Renames settings remediation coverage. |
| tests/unit/copilot_plugins/test_pr2705_ergonomics_units.py | Removes retired registrar-specific tests. |
| tests/unit/copilot_plugins/_builders.py | Adds native-path fixture helpers. |
| tests/spec_conformance/test_native_activation_profile_reqs.py | Tests project declarations, fingerprints and suppression. |
| tests/quality/lifecycle_obligations.json | Refreshes generated evidence references. |
| tests/lifecycle/world/test_world.py | Checks native surfaces and bin consent. |
| tests/lifecycle/security/test_gate_removal.py | Tracks whole-plugin retirement surfaces. |
| tests/lifecycle/security/gate_slices/native.py | Updates native gate-removal expectations. |
| tests/lifecycle/oracles.py | Recognizes project-scope native ownership. |
| tests/lifecycle/machines/test_m_gate.py | Tests scope-aware native fingerprints. |
| tests/lifecycle/machines/_gate_kit.py | Includes native roots in expected writes. |
| tests/lifecycle/journeys/consumer/J02-team-onboarding.yaml | Removes the fixed scan-count expectation. |
| tests/lifecycle/generator/rules.py | Refreshes source-line evidence references. |
| tests/integration/test_unmanaged_skill_preflight_matrix.py | Checks unmanaged skills beside native plugins. |
| tests/integration/test_remediation_advice_lifecycle.py | Updates settings recovery proof. |
| tests/integration/test_ownership_invariant_lifecycle.py | Separates native and split-route expectations. |
| tests/integration/test_native_plugin_retirement_lifecycle.py | Checks native root and declaration retirement. |
| tests/integration/test_native_plugin_cache_audit.py | Covers source and deployed-copy tampering. |
| tests/integration/test_native_plugin_audit_lifecycle.py | Checks committed registration and deployed content. |
| tests/integration/test_mcp_portable_approval_lifecycle.py | Reads committed Copilot enablement. |
| tests/integration/test_lock_derived_expected_state_lifecycle.py | Preserves split-route service fixtures. |
| tests/integration/test_export_patch_installed_packages_lifecycle.py | Moves split-plugin scenarios to Cursor. |
| tests/integration/test_dependency_replacement_lifecycle.py | Checks native replacement ownership and cleanup. |
| tests/integration/test_copilot_project_settings_precedence.py | Adds Copilot settings-precedence checks. |
| tests/integration/test_claude_plugin_hook_approval_lifecycle.py | Keeps split-hook coverage through Codex. |
| tests/integration/test_claude_plugin_flat_mcp_lifecycle.py | Preserves split-route MCP parsing coverage. |
| tests/integration/test_claude_native_hook_lifecycle.py | Updates shared-native diagnostic expectations. |
| tests/integration/test_bin_canvas_deny_diagnostics_lifecycle.py | Updates native deployment summary expectations. |
| tests/integration/test_architecture_owner_rule_mutations.py | Adapts native ownership mutation checks. |
| tests/integration/test_approve_parked_native_plugin_lifecycle.py | Checks whole-plugin activation at both scopes. |
| tests/fixtures/lifecycle_bug_ledger.json | Records the Superpowers regression coverage. |
| src/apm_cli/native_plugins/uninstall.py | Shares removal reconciliation and lock recovery. |
| src/apm_cli/native_plugins/settings.py | Supports relative declarations and target suppression. |
| src/apm_cli/native_plugins/record.py | Extends names and native lock-field serialization. |
| src/apm_cli/native_plugins/carry.py | Preserves unevaluated native dependency rows. |
| src/apm_cli/install/template.py | Skips deployment for carried native rows. |
| src/apm_cli/install/services.py | Routes native plugins by harness set. |
| src/apm_cli/install/pipeline.py | Consolidates final native activation phases. |
| src/apm_cli/install/phases/lockfile.py | Records scope-aware ownership and carried state. |
| src/apm_cli/install/phases/copilot_plugins.py | Retains capability setup; removes separate registration. |
| src/apm_cli/install/phases/claude_plugins.py | Runs shared reconciliation and records declarations. |
| src/apm_cli/install/native_plugin_admission.py | Queues Agent Plugins through shared registration. |
| src/apm_cli/install/drift.py | Verifies lock-recorded native plugin content. |
| src/apm_cli/install/deployment_plan.py | Excludes native harnesses from loose projection. |
| src/apm_cli/install/context.py | Tracks carried native dependencies. |
| src/apm_cli/deps/lockfile.py | Persists native declaration metadata. |
| src/apm_cli/core/remediation.py | Updates native recovery guidance. |
| src/apm_cli/copilot_plugins/constants.py | Retains vocabulary needed for legacy migration. |
| src/apm_cli/copilot_plugins/catalog.py | Removes the separate Copilot catalog renderer. |
| src/apm_cli/copilot_plugins/__init__.py | Updates exports for shared ownership. |
| src/apm_cli/commands/uninstall/engine.py | Adjusts native survivor rebuilding and retirement. |
| src/apm_cli/commands/uninstall/cli.py | Delegates native removal reconciliation. |
| src/apm_cli/commands/prune.py | Adds lock-derived native cleanup and recovery. |
| src/apm_cli/commands/install.py | Surfaces native refusal messages directly. |
| src/apm_cli/commands/deps/cli.py | Reports native plugins from the lockfile. |
| src/apm_cli/commands/approve.py | Recognizes Claude plugins at both scopes. |
| scripts/architecture_linter/checks/marketplace_package_and_registration.py | Updates shared ownership checks. |
| scripts/architecture_linter/checks/install_entry_and_commit.py | Updates native activation-order checks. |
| packages/apm-guide/.apm/skills/apm-usage/workflow.md | Explains committed native plugin loading. |
| packages/apm-guide/.apm/skills/apm-usage/package-authoring.md | Updates plugin routing and bin guidance. |
| packages/apm-guide/.apm/skills/apm-usage/governance.md | Updates native bin policy guidance. |
| docs/src/content/docs/troubleshooting/index.md | Explains native plugin discovery and activation. |
| docs/src/content/docs/reference/policy-schema.md | Updates bin deployment scope. |
| docs/src/content/docs/reference/package-types.md | Documents native and split routing. |
| docs/src/content/docs/reference/lockfile-spec.md | Documents native ownership and declaration fields. |
| docs/src/content/docs/reference/cli/uninstall.md | Documents native cleanup and recovery. |
| docs/src/content/docs/reference/cli/pack.md | Updates packed Agent Plugin installation guidance. |
| docs/src/content/docs/reference/cli/install.md | Documents native deployment at both scopes. |
| docs/src/content/docs/reference/cli/audit.md | Describes native source and copy verification. |
| docs/src/content/docs/reference/cli/approve.md | Documents whole-plugin Claude approval. |
| docs/src/content/docs/quickstart.mdx | Adds committed plugin and settings steps. |
| docs/src/content/docs/producer/write-primitives.md | Distinguishes native hooks from split hooks. |
| docs/src/content/docs/producer/publish-to-a-marketplace.mdx | Distinguishes producer and consumer catalog paths. |
| docs/src/content/docs/producer/build-a-plugin.mdx | Explains whole-plugin installation eligibility. |
| docs/src/content/docs/consumer/installing-from-marketplaces.md | Updates native marketplace installation guidance. |
| docs/src/content/docs/consumer/install-packages.md | Lists native files to commit. |
| docs/src/content/docs/consumer/install-mcp-servers.md | Explains native ownership of bundled servers. |
| docs/src/content/docs/consumer/approve-executables.mdx | Updates whole-plugin approval guidance. |
| docs/src/content/docs/concepts/how-apm-works.md | Updates generated-file commit guidance. |
| CONFORMANCE.md | Refreshes coverage counts and waiver notes. |
| CONFORMANCE.json | Refreshes machine-readable conformance evidence. |
| CHANGELOG.md | Records the project-scope native plugin change. |
| .apm/architecture/owners/marketplace-plugins.json | Registers shared ownership and legacy migration boundaries. |
Review effort: Balanced
#4559 keeps 0.1.74 per the program ruling. Co-authored-by: Copilot App <[email protected]>
#4559 keeps 0.1.74 per the program ruling. Co-authored-by: Copilot App <[email protected]>
- Uninstall retires a surviving native plugin install would now park (revoked or changed pin, missing MCP grant, org MCP policy block): gate_retirements gains native_packages, judged by the whole-plugin trust admission and the shared MCP policy check. - A per-target skill pairing (req-rs-018) that restricts a native harness counts as a selection: loose at project scope, parked with -g. - Legacy Copilot registration retires for plugins this run evaluated and refused, so a withheld plugin stops loading live apm_modules bytes. - Project scope writes .agents/plugins/.gitattributes (* -text): a core.autocrlf checkout keeps the pinned bytes. Each has a failing-before test. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
left a comment
There was a problem hiding this comment.
Delta review: ec90087 -> 2768abe (standing 0.38 reviewer)
Verdict: NOT CLEAN. The logic folds are sound, but this delta turns CI red in two places. There is also one parity gap in the new native retirement owner.
Blocking: CI red at 2768abe (both caused by this delta)
- HIGH-A
tests/lifecycle/generator/rules.py:265: the citationEv("src/apm_cli/install/services.py", 836, "staged_files")is stale. The services.py edit (+1skill_pairing=, -2 comment lines) moved the text toservices.py:835. Lifecycle Smoke Shard 4 fails:test_generator_rules.py::test_every_rule_cites_code_that_still_says_it. Fix: change 836 to 835, then re-check the otherservices.pycitations below line 252. - HIGH-B
tests/unit/install/test_claude_native_hooks.py:161:test_a_per_target_skill_pairing_is_never_widened_to_a_whole_plugintrips AQ003_unobserved_outcome (observed 1, allowed 0) in Architecture Ratchet Contracts (tests/quality/test_quality_baselines.py). The test asserts only on the in-memory plan, with no output, exit code or durable state. Fix: assert an observable outcome, or prove this behavior at the integration level (an install with a diamond pairing that leaves the loosereviewskill and no.agents/plugins/<name>). Do not raise the baseline.
P4 question 1: does locked_native_retired match install's admission (update uses any(retirements))?
Mostly. One install park reason is missing.
-
Matches install:
- The trust verdict is
admit_native_plugin. It uses the same(pkg_key, pkg_key-without-#ref)key pair asplan_admission.py:82-83, and the same gate-off semantics:exec_trust_context_for_projectwithgate_enabled=Falseadmits unless the plugin is transitive with MCP. transitivecomes from the lock depth, which is equivalent to install's graph depth (plan_admission.py:18-26).- The org MCP policy parks only under
enforcement: block, as atadmission.py:381-382, andnative_policy_violationreuses_mcp_policy_violationinstead of copying it. one_offis omitted. That matches a flagless install and McpAdmission's loose transitive MCP, so a--trust-transitive-mcpone-off is retired on the next sibling uninstall and re-judged by update. That is consistent with how the loose case behaves.
- The trust verdict is
-
For
update,any(retirements)only decides whether the install pipeline re-runs, and install then makes the real decision. A false positive costs a no-op reconcile. Only a false negative matters, and there is one: -
MEDIUM-C
src/apm_cli/claude_plugins/admission.py:203-238: install also parks a native plugin that shipsbin/when orgbin_deploy.deny_allorbin_deploy.denynames it (admission.py:390-396, fed bydeployment_plan.py:198bin_deploy_denial).locked_native_retirednever checks this. After abin_deploytightening:apm uninstall <sibling>keeps the plugin, with its livebin/, declared.apm updatewith nothing to update does not re-run install.enforce_declared_policyjudges dependency refs, not bin content.
Fix: inside the try,
or (bin_deploy_denial(info, policy) if (install_path / "bin").exists() else None), plus one morepolicy-bin-denyrow in thetest_native_plugin_retirement_lifecycle.pyparametrization. Loosebin/has the same gap on main, so this is not a regression. But the docstring promises "each native plugin install would now park", so fold it here.
P4 question 2: can the legacy Copilot retirement drop an entry this run did not evaluate?
No. Resolved.
ctx.native_rejected_namesis filled only at evaluation sites in this run:queue_native_claudewhen parked withcopilotin its harnesses (admission.py:467-468), and_record_rejectedatnative_plugin_admission.py:151,210._migratablestill refuses unlesscopilotis inrun_targets(registrar.py:494), so a narrowed--target, uninstall or prune never retires.- In the main path,
missing = legacy.plugins - declared - rejectedkeeps the whole registration if any legacy plugin is neither declared now nor refused this run. - The new early branch (
registrar.py:345-352) requireslegacy.plugins <= rejectedand still goes through_migratable. dry_runreturns before any of this (registrar.py:317).- Residual (LOW):
rejectedmatches by plugin name, not by lock key. Two packages that ship the same plugin name, one refused and one legacy-registered, could retire the other's legacy entry. That is unlikely, and the native layer already refuses case-fold duplicate names.
Other folds
skill_pairingnow reaches the native planners through_native_skill_selection(deployment_plan.py:48-65). That is correct, since any per-target restriction now counts as a selection. Its test needs the HIGH-B fix..agents/plugins/.gitattributes(* -text) is written only at project scope, only while plugins are declared, and is removed only when it holds APM's exact text (layout.py:92-103). The CRLF-clone cell proves thatinstall --frozenandaudit --ciboth pass on anautocrlfcheckout. Resolved.- Uninstall moved into
native_plugins/uninstall.py::retire_disallowed_native_survivors, inside the registered owner. Keys retired by the native verdict are returned for rebuild under install's gate, and the warning is suppressed for keys already reported as denied or hooks-retired. Resolved. - Architecture linter anchor update (
_migratable(..., rejected)): exact-text anchor, not weakened. Resolved.
Prior items from the fc6973e->1c813409 review remain resolved.
…fold delta review - locked_native_retired also applies the org bin_deploy rule install parks a bin/ plugin with (Analyst MEDIUM), with a unit cell. - The skill-pairing cell asserts the deployed skills (AQ003). - Generator citations refreshed for the moved lines. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> # Conflicts: # tests/lifecycle/generator/rules.py # tests/quality/lifecycle_obligations.json
Co-authored-by: Copilot App <[email protected]>
…rate Keeps main's _EXPECTED_KINDS (#4559, native plugins deploy whole at project scope) with train 6's bundle gating in deploys_what_the_model_allows. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> # Conflicts: # docs/src/content/docs/consumer/install-plugins.md
…arget is expected (#4559) #4559 deploys a Claude plugin whole for claude and copilot at project scope and gives other targets APM's loose copy. Gemini deploys skills to the cross-tool .agents/skills root that copilot also reads, so with gemini current a parked native plugin's skill lands there and the copilot skill cell observes it. projected_cells now keeps a native package's claude/copilot skill cell only when a current non-whole-plugin target expects the same package's skill at that same root. Stale model, not a product regression: test_first_command_after_a_target_change[kinds-offline-multi-widened]. Co-authored-by: Copilot App <[email protected]>
…to train 6 Co-authored-by: Copilot App <[email protected]>
…lugin root (#4559) #4559 deploys a Claude plugin whole to .agents/plugins/<plugin>/ at project scope, declared in each harness's settings and recorded as the lock's native_plugin (name, root, fingerprint). Earlier today the native-plugin row was switched to the pre-#4559 normalized layout (.claude/agents). It now asserts the agent with its text inside the plugin root, plus the native_plugin record naming that root, before and after compile. A CLI repro on main shows exactly that layout. Fixes test_compile_keeps_a_remote_package_file_primitive[native-plugin]. Co-authored-by: Copilot App <[email protected]>
…4559) The kinds-offline row installed p-native-claude-bin without --trust-bin, so the plugin stayed parked, and the #4559 projection let it pass without any native deployment while crediting SRC=native-plugin x TGT. The row now uses p-native-claude (no bin/), which deploys whole once approved. Before and after the target change it asserts the plugin's skill inside .agents/plugins/p-native-claude, and an enabledPlugins entry set to true in each current harness's settings (claude, copilot). Co-authored-by: Copilot App <[email protected]>
) CI showed the git-served c-ndoc install parks the plugin ('Parked native plugin lifecycle/c-ndoc: not approved'). #4559 parks an unapproved Claude plugin at project scope too, so no deploy and no lock row was correct. The row now approves, then installs, then compiles, and asserts the whole plugin and its native_plugin record. Co-authored-by: Copilot App <[email protected]>
… regenerate Keeps #4843's native observation (a root half plus the enabledPlugins declaration half, native_gaps). Builds _surface_hits on train 5's entry-aware surfaces (JsonEntry, MergedHooks) and _observable. projected_cells keeps #4843's native projection plus the shared-root loose skill (#4559). #4751 fixed #4744, so the user-scope bin target-change cell drops its strict known and is required (known 9 -> 8, L15). Co-authored-by: Copilot App <[email protected]>
… ruling, #4894) #4559 and #4808 deploy a trusted project-scope whole plugin with bin/, and prune can retire that root. So U-BIN-OPS no longer lists prune (premises and the tripwire test updated). Covering rows prune only loose packages, whose bin/ never deploys at project scope. A prune step there therefore visits no bin gate level, and its OP x SRC x PRIM absence witness stands. The five T1|OP=prune|PRIM=bin|GATE=<non-org> cells return as honest baseline (38 -> 43) until a whole-plugin prune row credits them (#4894). Co-authored-by: Copilot App <[email protected]>
…eout The slice was split by integration-suite durations, but each slice shard pays the 40-80s mutation-test module baselines per worker, so install-path slices reached the 15-minute limit on 3 shards (3 timeouts on microsoft#4003, 14m06s on microsoft#4559). The shard count now comes from strategy.job-total, so the job name and the --shard argument follow the matrix. Fixes microsoft#4746 Co-authored-by: Copilot App <[email protected]>


Description
obra/superpowerscould not be installed at project scope with its hooks approved (#3896). The plugin ships per-harness hook files (hooks/hooks.jsonfor Claude,hooks/hooks-cursor.jsonnamed by.cursor-plugin/plugin.json). APM split it into primitives, which dropped that mapping, and the retired filename-routing guard (#3226) then refused the package. On main (0.37.0) this happens on the first install already, because the executables gate is opt-in.The 2026-11-19 decision on #3094 rules out bringing per-file routing back. This PR therefore delivers the accepted fix, #3921: project-scope native plugins.
apm installdeploys each approved Claude-format plugin whole to the committed.agents/plugins/<plugin>/..claude/settings.jsonand.github/copilot/settings.json, following the plugin's targets.apm_modules/.github/plugin/apm-registration.jsonare migrated.apm.lock.yaml.This supersedes #4010, rebased onto main after v0.37.0 with authorship kept through commit trailers. Changes beyond #4010:
apm approvetreats a Claude plugin as native at both scopes (commands/approve.py)commands/uninstall/engine.py)test_native_plugin_retirement_lifecyclecaught it.plugin.json(anapm packbundle) deploys loose (claude_plugins/admission.py)native-settings-invalid,native-plugin-update-held,claude-native-switch-loose-hooks-project. The kept-version line useskept_note. The rollback usesrestore_lockfile_bytes. Frozen native drift is scope-aware.native_plugins/record.py(deps/lockfile.pyat the 2100-line cap). The carry-forward moved tonative_plugins/carry.py(install LOC budgets).commands/uninstall/engine.py,native_plugins/scopes.py)native_pluginrecord is declared to is never rebuilt loose; a local native plugin is restaged only when its source digest changed, so #4446's definition-change retirement still holds.$schemais inert metadata; askills:selection deploys loose at project scope (native_plugins/record.py,claude_plugins/admission.py)np.agent.plugin) stopped registering, a plugin with$schemawas parked, and askills:selection deployed nothing.install/phases/claude_plugins.py,.apm/architecture/owners/marketplace-plugins.json, linter anchor)InstallService.frozen_disposition; thenative_declaredstamp is written by the registered commit site;carry.pyjoins the native owner; install-commit-order anchors on the native activation phases.Oracle decisions accepted by the 0.38 PM (S15); spec 0.1.73 lands per the D-a ruling, with editor review post-merge. (Main took 0.1.73 for #2903, so this amendment is now 0.1.74.)
Decisions taken without escalation (rule S15, recommended default):
test_native_plugin_retirement_lifecycle,test_approve_parked_native_plugin_lifecycle, the gate-removal native slice and I1 oracle, and the world surfaces.test_claude_plugin_hook_approval_lifecyclekeeps the split-route pin contract by targetingcodex, which still splits Claude plugins.bin/plugin at project scope: it parks until--trust-binin non-interactive runs, as at user scope. The world cell runs the printed step.cursor; legacy agent classification, plugin-root MCP portability (MCP servers from a Claude plugin are recorded with an absolute${CLAUDE_PLUGIN_ROOT}path, soapm install --frozenfails in a clone at another path #3825, [BUG] Dependency identity key ignores the port; MCP conflict hint misreads ${CLAUDE_PROJECT_DIR:-.} #3927) and the [BUG] A Claude plugin's .mcp.json without the mcpServers wrapper is silently ignored #3499.mcp.jsonshapes use a root-onlyplugin.json, which still deploys loose at project scope. A Claude-format plugin now deploys intact, and the harness reads its MCP servers itself..github/copilot/settings.json; the native summary line; the gate machine write set (.agents/plugins); the I1 project-scope digest; J02 anchors the world-independent audit lines; the quickstart commits the plugin paths on their owngit addline.audit --ci.Issue and approved scope
Issue: Fixes #3921. Refs #3896 (closed as a duplicate of #3094; this delivers its fix), #3094.
Human scope-approval comment: #3921 (apm-scope:v1 record by Daniel Meppiel (@danielmeppiel), 2026-11-19). It covers Claude and Copilot at project scope, and its Done-when includes "Superpowers installs intact with its hooks running".
Does this PR complete the issue, or what remains?
cursorstill refuse a plugin shaped like superpowers, because Cursor has no qualified native route until the [FEATURE] Qualify remaining targets against the native activation profile #3922 survey. Workaround:targets: [claude, copilot].dependenciesstay refused.test_m_source's strict known cellregistry-source-switch-stale-pin([BUG] A git-to-registry source switch leaves the stale git .apm-pin in apm_modules until install --update #4572), which no longer fires since fix(install): drop the stale .apm-pin after a git -> registry source switch #4597 fixed it. This PR lands after the main-red fix test(lifecycle): retire the #4572 strict cell after its fix (main red) #4619 retires that cell.Type of change
Testing
Lifecycle evidence (apm-lifecycle-tests):
Real-package check on this branch (
obra/superpowers#v7.0.2,targets: [claude, copilot],executables: {}):apm approveexits 0 ("whole plugin");.agents/plugins/superpowers/with both hook files and both settings declarations;audit --ciandinstall --frozenboth exit 0;apm uninstallremoves only APM's entries, andaudit --cistays clean.Local runs (
pytest -p no:xdist, one file at a time,APM_E2E_TESTS=1):Lint mirror:
ruff checkandruff format --check(ruff 0.15.12): clean.lint-auth-signals.sh: OK.tests.quality.taxonomy --changed: clean.check_test_assertions.py: ratchet clean (no baseline growth).Known red on main, not from this PR:
test_codex_native_plugin_lifecycle::test_git_pinned_install_and_missing_apm_cache_restorex2 (T1 owns it).Changelog
## [Unreleased]inCHANGELOG.md(Fixed). The PR number will be added after this PR is numbered.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated. Amendment 0.1.74 (proposed) revises req-na-002 (portable project-scope digest), req-na-004 (cross-target suppression) and criterion A5 in place, and updates Part C. No statement count change.@pytest.mark.reqtests extended intests/spec_conformance/test_native_activation_profile_reqs.pyandtest_copilot_plugins_reqs.pyCONFORMANCE.{md,json}regenerated viapython -m tests.spec_conformance.gen_statementand committedCo-authored-by: copilot-swe-agent[bot] [email protected]