Skip to content

fix(claude): install intact user plugins through Claude settings, owned by the lock - #3290

Open
Daniel Meppiel (danielmeppiel) wants to merge 77 commits into
mainfrom
danielmeppiel-native-hook-delivery
Open

Daniel Meppiel (danielmeppiel) wants to merge 77 commits into
mainfrom
danielmeppiel-native-hook-delivery

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Reshaped per the 2026-11-19 #3094 design record and brief. Claude only, user scope.

apm install --global --target claude now 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 the claude CLI.

  1. Resolve, lock, scan and approve the plugin as before; ~/.apm/apm_modules keeps the fetched source.
  2. Copy exactly the plugin files (native_plugin_files: native bundle minus .git, root apm.yml and root .apm/) to ~/.agents/plugins/<plugin>/, and generate ~/.agents/plugins/.claude-plugin/marketplace.json.
  3. Declare it in Claude's settings.json (CLAUDE_CONFIG_DIR honored) with only extraKnownMarketplaces.<apm-u-hash> (directory) and enabledPlugins["<plugin>@<apm-u-hash>"]: true.

Ownership comes only from apm.lock.yaml. Each entry carries a native_plugin record {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.

  • APM writes true only when a key is absent, and keeps an explicit false, foreign entries and edited roots.
  • A missing previous lock, a moved or renamed binding, or a foreign same-name marketplace is reported and changes nothing.
  • Lock plus settings form one rollback unit: a failed declaration restores the previous lock and removes roots this run created.

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:

  • Parked (not deployed, not declared, one warning, exit 0): unapproved executables, an MCP server org policy blocks (enforcement: block; warn reports and enables), or declared plugin dependencies. Never a loose fallback.
  • Fail closed (as before): partial skill subsets, symlinks, 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, the apm-registration.json ledger and the disabled default. Registrations from earlier heads of this PR are migrated by a guarded cleanup.

Area Files
Harness-neutral layer (Copilot reuses it in #3921) src/apm_cli/native_plugins/{record,layout,settings}.py
Claude owner claude_plugins/registrar.py (reconcile_claude_plugins, verify_claude_native_cache), claude_plugins/admission.py (park, refusals)
Lock deps/lockfile.py (native_plugin field), install/phases/lockfile.py (records, carry-forward across a one-shot --target without Claude)
Wiring install/phases/claude_plugins.py, commands/uninstall/cli.py (pre-mutation snapshot and lock restore)
Digest utils/content_hash.py (native_plugin_files, compute_native_plugin_hash; #3918 hosts the canonical copy when it lands)
Guards architecture owner registry, Claude/Copilot ownership checks and sorted mutation cases

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 legacy allowExecutables hooks 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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation at the pushed head (macOS arm64):

  • uvx ruff@0.15.12 check and format --check over 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.sh and bash scripts/lint-architecture-boundaries.sh: clean. The 2100-line and relative_to guards: clean.
  • APM_E2E_TESTS=1 pytest tests/integration/test_claude_native_hook_lifecycle.py: 7 passed. Covers two plugins whose real node hooks resolve per-plugin roots, user false and foreign keys preserved, a one-shot --target codex keeping Claude declarations, --frozen, audit tamper and mode drift, both failure-and-recovery paths, and a trap claude on PATH that 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:
    • 2 lockfile contract tests, now updated and passing.
    • Load-timing flakes that pass alone: installer shell tests, test_ci_topology and test_targets_phase.
    • 2 that also fail without this PR's code paths: the Azure DevOps credential-helper hang and test_is_tool_available.
  • CI: CI and Spec conformance green at 5b902f828. This head adds only the CHANGELOG line.
  • Real apm install -g obra/superpowers (22f0b46) in an isolated HOME:
    • The plugin installed intact under ~/.agents/plugins/superpowers with no apm.yml, .apm/ or .git, and all 4 hook files present.
    • Settings held only the two keys.
    • Uninstall left empty sections and no plugins root.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.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.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated. Section 5.2 gains the native_plugin row (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).
  • Manifest edit: not needed (no new requirement IDs).
  • Test edit: tests/spec_conformance/test_native_activation_profile_reqs.py binds 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 via uv run --extra dev python -m tests.spec_conformance.gen_statement and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

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
@danielmeppiel

Daniel Meppiel (danielmeppiel) commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups - qualified draft publication only

DRAFT / NATIVE ACCEPTANCE HOLD. Actual Claude SessionStart, SubagentStart and UserPromptSubmit witnesses and native consent remain absent. Successful CI is not native, specification or release readiness. Keep PR3290 draft and issue3191 open.

Current head: 0d4ee8095f43c241995b30c5c3b83a3c4fe50f0b; integrated base: 53ccf06d11dd2d675e8ea8c3e2523a6d321c1b79.
This ancestry-preserving continuation integrates landed Codex behavior with the prior Claude foundation. It preserves separate native registrars, queues, ledgers, canonical source-plan/hash ownership and default hashing semantics.

Independent delta disposition

Seven genuine specialists reviewed the frozen initial merge tree: architecture, supply-chain, coverage, performance, DevX, documentation and authentication. Later folds were separately qualified at the exact published head. The genuine CEO stance is ship_with_followups for qualified draft publication, not permission to merge.

  • Folded lazy Claude phase loading and existing both-target installed-CLI lifecycle coverage.
  • Preserved both native/static catalogs and retained-hook conformance; fixed only the merged statement budget and wrapped-output assertion without weakening their contracts.
  • The CEO rejected proposed loose projection from an opaque Codex bundle because it contradicts canonical suppression of all loose projections.
  • Retained factual corrections: e69283b was the earlier Claude head, not Codex; remote CI was observed after publication, not before it. Original specialist/CEO returns remain preserved. No new panel ran for this metadata closeout.

Exact-head qualification

610 focused tests (including 68 quality cases), 31 static cases, six existing official Codex metadata/content cases, and 348 conformance cases passed; two conformance cases skipped. All ten local lint/architecture/strict guards passed.

Sixteen Claude/shared mutations produced 40 failures; 41 producer Codex/API mutants produced 46 test-call failures; two additional static disablings produced 15. All 81 distinct failed IDs passed after restoration. Five Codex failures are downstream contract exceptions, not literal assertions; none are setup/import errors or skips. API source bytes remained unchanged; in-memory mutations are disclosed.

Owner precision: five deterministically detected owners map to 13 executed current-head functional IDs. Actual completion status remains blocked, so canonical verify_completion skips terminal-owner enforcement. The separately disclosed advisory-status projection is an architecture-only probe, not an actual terminal gate or readiness pass.

Observed CI

Fresh exact-head REST reads confirm successful CI 39470640291, Spec conformance 39470640316 and Merge Gate 39470640367. CI job evidence includes both Linux shards/Coverage, Windows gates, lint, architecture and APM/lifecycle/binary smoke. CodeQL, Docs, NOTICE and eligibility workflows also succeeded.

Original yellow-CI completion, validation, publication and handoff receipts remain untouched. This green observation is additive; historical e69283b results and its needs_discussion stance are not relabelled.

Remaining boundaries

#3181 alone owns native runtime investigation under the existing consent boundary. Metadata responses and substituted Claude transport do not supply runtime witnesses. No new trust, activation, credential use or native action occurred.

Unproven replay optimization, cross-dependency failure isolation and unrelated raw-local missing-manifest MCP consistency remain outside this repair. Native acceptance itself is still an unmet original criterion, not deferred or waived.

Cumulative counts remain 6 outer / 3 Copilot rounds / 2 CI recoveries, under the authorized session-only budget override. This metadata closeout adds no iteration or recovery. GitHub reports MERGEABLE / BLOCKED; the PR remains draft/open, with no auto-merge, reviewer request, merge or issue closure.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

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
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Oct 21, 2026
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
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Published d23d1acca67e569352ae89022f0cc8fcb7e42f31 on this same draft PR, preserving 0d4ee809 ancestry and merging main 7e20e044.

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 SessionStart, SubagentStart and UserPromptSubmit execution, distinct effective roots/resources, and runtime lifecycle-state witnesses must follow that consent through the designated runtime owner. No native probe, trust bypass or activation occurred here. Metadata, substituted transport, conformance and green CI do not replace those witnesses. Keep this PR draft and #3191 open; final qualification/merge stays with the coordinating maintainer.


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>
@danielmeppiel

Daniel Meppiel (danielmeppiel) commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

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 ${CLAUDE_PLUGIN_ROOT} resolving to the intact plugin. An agent cannot pass Claude's trust prompt, so this needs one human run. Everything happens in a throwaway HOME, so your real ~/.claude and ~/.apm are not touched.

Requirements: macOS or Linux, git, node + npm, uv, python3, and a Claude login (or ANTHROPIC_API_KEY). The fixture is the #3291 plugin tests/fixtures/native_claude_commands: its manifest selects one command, selected/status.md, which runs node "${CLAUDE_PLUGIN_ROOT}/scripts/context.mjs", which reads a bundled resource file.

1. Isolated tools (about 3 minutes)

export CHECK="$(mktemp -d /tmp/apm-native-claude-check.XXXXXX)"
export SHA="$(git ls-remote https://github.com/microsoft/apm refs/heads/danielmeppiel-claude-command-qualification | cut -f1)"
echo "check dir: $CHECK  stack head: $SHA"

# Claude Code 2.1.291 is the only version APM's native route is qualified for.
npm install --silent --prefix "$CHECK/npm" @anthropic-ai/claude-code@2.1.291
# APM from the #3290 + #3291 stack head.
if ! { uv venv -q "$CHECK/apm-venv" && uv pip install -q --python "$CHECK/apm-venv/bin/python" "git+https://github.com/microsoft/apm@$SHA"; }; then
  # Fallback if uv cannot resolve from your index: run the stack source with
  # the .venv of an existing microsoft/apm checkout.
  export APM_REPO="$HOME/Repos/awd-cli"
  git -C "$APM_REPO" fetch -q origin danielmeppiel-claude-command-qualification
  git -C "$APM_REPO" worktree add -q --detach "$CHECK/apm-src" "$SHA"
  mkdir -p "$CHECK/apm-venv/bin"
  printf '#!/bin/sh\nPYTHONPATH="%s/apm-src/src" exec "%s/.venv/bin/python" -m apm_cli.entrypoint "$@"\n' "$CHECK" "$APM_REPO" > "$CHECK/apm-venv/bin/apm"
  chmod +x "$CHECK/apm-venv/bin/apm"
fi
"$CHECK/apm-venv/bin/apm" --version   # the version line ends with the first 9 chars of $SHA

2. Isolated HOME and CLAUDE_CONFIG_DIR

export REAL_HOME="$HOME"
export HOME="$CHECK/home"
export CLAUDE_CONFIG_DIR="$CHECK/home/.claude"
export PATH="$CHECK/npm/node_modules/.bin:$CHECK/apm-venv/bin:$PATH"
mkdir -p "$HOME/.apm" "$CHECK/work"
claude --version     # expect: 2.1.291 (Claude Code)

3. Install the fixture plugin globally with APM

cat > "$HOME/.apm/apm.yml" <<EOF
name: native-claude-check
version: 1.0.0
targets: [claude]
dependencies:
  apm:
    - git: microsoft/apm
      ref: $SHA
      path: tests/fixtures/native_claude_commands
EOF
(cd "$CHECK/work" && apm install -g --target claude --only apm)

Expected output includes:

1 native Claude plugin(s) registered; existing activation preserved. New plugins
are disabled. Review and enable them in Claude; restart or reload plugins there.
claude plugin list --json
ls "$CLAUDE_CONFIG_DIR/commands" 2>&1    # expect: No such file or directory (no loose copies)

Expected: exactly one entry, "id": "apm-command-context@apm-claude", "scope": "user", "enabled": false, with readFromFolder ending in .apm/apm_modules/microsoft/apm/tests/fixtures/native_claude_commands.

4. Your consent: enable the plugin

APM never enables plugins. You do that:

claude plugin enable apm-command-context@apm-claude --scope user

5. Run the namespaced command in a real session

cd "$CHECK/work"
APM_COMMAND_PROBE_MARKER="$CHECK/witness.jsonl" claude

In Claude:

  1. Accept the folder trust prompt and log in if asked (the config is fresh).
  2. Type /apm-command-context:. The menu must offer status and must NOT offer unselected.
  3. Run /apm-command-context:status qualified-3181. Approve the node command if Claude asks.
  4. Claude prints JSON like this. The root is your $CHECK path, so it will differ. Claude loads the plugin in place from APM's apm_modules (readFromFolder), not from its plugin cache (confirmed on real 2.1.322, 2026-11-19):
{"root":"<CHECK>/home/.apm/apm_modules/microsoft/apm/tests/fixtures/native_claude_commands","resource":"APM_NATIVE_COMMAND_CONTEXT","argument":"qualified-3181"}
  1. Type /exit.

6. Verify the witness (proof of success)

python3 - "$CHECK" <<'PY'
import json, pathlib, sys
check = pathlib.Path(sys.argv[1]).resolve()
rows = [json.loads(l) for l in (check / "witness.jsonl").read_text().splitlines() if l.strip()]
assert len(rows) == 1, rows
row = rows[0]
assert row["resource"] == "APM_NATIVE_COMMAND_CONTEXT", row
assert row["argument"] == "qualified-3181", row
root = pathlib.Path(row["root"]).resolve()
assert root.is_relative_to(check / "home"), root
assert (root / "scripts/context.mjs").is_file() and (root / "resources/identity.txt").is_file(), root
print("[+] NATIVE CLAUDE CHECK PASSED")
print("    root:", root)
PY

Success means the script prints [+] NATIVE CLAUDE CHECK PASSED, Claude showed the same JSON, and the menu had status but no unselected. Paste the two printed lines plus the claude plugin list --json output into this PR.

Failure looks like one of these: /apm-command-context:status is missing from the menu, unselected is offered, the JSON has an empty or wrong resource, root is outside $CHECK/home, or the witness file is missing. If Claude printed the JSON but no witness file exists, paste the JSON anyway; the env var may not reach the command shell.

Heads-up from the agent dry run: claude plugin details apm-command-context@apm-claude reports Skills (0). A plain plugin with no APM involved shows the same thing when its command is declared through a manifest commands path, while default commands/ files are counted. That could be a details blind spot or a real loading gap. This step settles it.

7. Clean up

(cd "$CHECK/work" && apm uninstall -g microsoft/apm/tests/fixtures/native_claude_commands)
claude plugin list --json      # expect: []
export HOME="$REAL_HOME"; unset CLAUDE_CONFIG_DIR
[ -n "${APM_REPO:-}" ] && git -C "$APM_REPO" worktree remove --force "$CHECK/apm-src"
rm -rf "$CHECK"

Then open a new shell so PATH is clean again.

What the agent already verified at stack head 73a2550d0 (no trust, enable, or session): with real Claude 2.1.291 and an isolated HOME and CLAUDE_CONFIG_DIR, step 3 registered apm-command-context@apm-claude disabled at user scope, created no loose commands, and step 7 removed the registration and the empty lock. On this machine the uv pip install path failed to resolve dependencies, and the step 1 fallback worked.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 19, 2026
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>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 19, 2026
…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>
…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>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 19, 2026
…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>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 19, 2026
* 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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants