Repository navigation
fix(0.37): finish owner hardening for bundle MCP, audit copies, failed installs, MCP targets and plugin pins - #3989
Merged
Daniel Meppiel (danielmeppiel) merged 71 commits intoNov 20, 2026
Conversation
…3962) Harvested from #3977. Co-authored-by: Copilot App <[email protected]>
…#3963) Harvested from #3978. Co-authored-by: Copilot App <[email protected]>
…nt (#3959) Harvested from #3976; the positional install reads the lock lazily. Co-authored-by: Copilot App <[email protected]>
…un (#3960) Harvested from #3973. Co-authored-by: Copilot App <[email protected]>
Harvested from #3974. Co-authored-by: Copilot App <[email protected]>
…ops them (#3956) Harvested from #3975. Co-authored-by: Copilot App <[email protected]>
…deny (#3958) Harvested from #3981. Co-authored-by: Copilot App <[email protected]>
…a same-store deny (#3957) Harvested from #3979. Co-authored-by: Copilot App <[email protected]>
A partial name could grant or deny execution for another package. Co-authored-by: Copilot App <[email protected]>
Harvested from #3971. Co-authored-by: Copilot App <[email protected]>
… executables: (#3954) exec_trust_context_for_project takes the manifest file instead of deriving apm.yml from a caller-chosen root; -g resolves APM_HOME/apm.yml through core.scope.get_manifest_path. A closed-world guard registers every caller. Supersedes #3969 and keeps its lifecycle test. Co-authored-by: Copilot App <[email protected]>
Every caller of the shared install entry now runs inside a registered catalog-freshness envelope; the guard is closed-world. Co-authored-by: Copilot App <[email protected]>
APM_NO_SCRIPTS, org executables.deny_all and project script trust now apply; LifecycleScriptRunner is built only by build_runner_from_context, guarded closed-world by the new lifecycle-script-firing-gate owner. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
#3966) The only opt-out is a dependency's own authored .mcp.json; a closed-world guard refuses any other. Co-authored-by: Copilot App <[email protected]>
…ervers (#3956) Co-authored-by: Copilot App <[email protected]>
…ove matching Co-authored-by: Copilot App <[email protected]>
… the gate was never on (#3958) Harvested from #3981 (b4cface, cb015e6); the trust read uses the scope manifest. Co-authored-by: Copilot App <[email protected]>
Harvested from #3969 (5c2cab2). Co-authored-by: Copilot App <[email protected]>
Reads the manifest restriction through the same owner install uses. Co-authored-by: Copilot App <[email protected]>
- compile's no-output hint names targets:, not the deprecated target: - pack's mismatch hint no longer suggests the deprecated pack --target - skip messages name executables.allow instead of allowExecutables - origin and freshness errors say marketplace, not catalog - generated apm.yml headers and unknown-target errors stop listing vscode - config docs show default_client: copilot Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
Harvested from #3972. Co-authored-by: Copilot App <[email protected]>
…#3965) Harvested from #3980. Raw apm.yml readers must pass the manifest path to manifest_target_restriction; only APMPackage-loaded configs may omit it (closed-world guard). Co-authored-by: Copilot App <[email protected]>
…2606) Harvested from #3951 (eecc79d). Co-authored-by: Copilot App <[email protected]>
…idity owner (#3964) A warm copy that contradicts apm.lock.yaml routes audit to the lock-pinned scratch replay, as a cold checkout does; replay's own marker check now asks drift.locked_copy_holds_commit. The copy-validity guard is closed-world. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
…egration (#3874) Every requested package resolves and downloads before any is integrated, so a failed multi-package install leaves no untracked deployed files. Guarded by the install-outcome rule. apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement Co-authored-by: Copilot App <[email protected]>
…ing systems The committed plugin pin covers path and bytes; the exec bit stays only in the per-machine integrity hash, because Windows derives it from file extensions and an approval made on macOS would park on Windows. The trust-fingerprint guard requires the mode-less pin and owns it closed-world. apm-spec-waiver: approval pin binding is implementation-defined; root digest integrity unchanged Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
8 of 19 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Base automatically changed from
danielmeppiel-docs-redesign-cdo-thesis
to
main
November 20, 2026 06:28
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-0-37-owner-hardening-b
branch
November 20, 2026 06:39
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Resolve exec_gate.py (native_plugin_verdict keeps its gate-off transitive MCP check through the explicit gate-disabled map), local_bundle_handler.py (scope-manifest bundle trust from #3989), and route the new local_bundle_hook_trust.py adapter through the trust owner. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
3 of 9 tasks
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
… route (#3714) Unit contracts: rendered TOML and claim hash, adopt/collision/--force/--dry-run, render failure and non-Markdown sources write nothing, manifest-mismatch skip, and a parameterized regression asserting every non-Codex agent target still copies the packed bytes. Installed-CLI lifecycle: project install, audit --ci, identical reinstall, edited destination with and without --force, --dry-run, render failure, and argument-free install --frozen without lockfile churn; user scope renders to ~/.codex/agents and $CODEX_HOME/agents. The $APM_HOME lock and audit check is strict-xfail until #3989 (0.37 stack) moves the -g bundle lock root. The bundle-native-layout guard now pins the rendered-format set, the loop hand-off and the AgentIntegrator render/deploy route, with bypass mutations. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
…3714) At user scope the bundle claim is an absolute path. Passing it as the collision key made BaseIntegrator.check_collision index past the destination's parents, so reinstalling over an edited ~/.codex/agents file (or one under CODEX_HOME) crashed with IndexError instead of keeping the edit. The collision key is now the destination relative to the first root that contains it (project or home, else the deploy root); the absolute record stays the lockfile claim. Tests: a unit and an installed-CLI -g case (default home and CODEX_HOME) edit the agent, reinstall without --force (kept) and with it (replaced); both fail without the fix. Everything that works on main now passes outside the strict xfail, including the rendered hash in $HOME's lock; only the #3989-dependent $APM_HOME lock and audit stay strict-xfail. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
#3714) #3989 moved the -g bundle lockfile to $APM_HOME with home-relative claims, so the strict xfail is removed and the user-scope lifecycle asserts the rendered hash there. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
… route (#3714) Unit contracts: rendered TOML and claim hash, adopt/collision/--force/--dry-run, render failure and non-Markdown sources write nothing, manifest-mismatch skip, and a parameterized regression asserting every non-Codex agent target still copies the packed bytes. Installed-CLI lifecycle: project install, audit --ci, identical reinstall, edited destination with and without --force, --dry-run, render failure, and argument-free install --frozen without lockfile churn; user scope renders to ~/.codex/agents and $CODEX_HOME/agents. The $APM_HOME lock and audit check is strict-xfail until #3989 (0.37 stack) moves the -g bundle lock root. The bundle-native-layout guard now pins the rendered-format set, the loop hand-off and the AgentIntegrator render/deploy route, with bypass mutations. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
…3714) At user scope the bundle claim is an absolute path. Passing it as the collision key made BaseIntegrator.check_collision index past the destination's parents, so reinstalling over an edited ~/.codex/agents file (or one under CODEX_HOME) crashed with IndexError instead of keeping the edit. The collision key is now the destination relative to the first root that contains it (project or home, else the deploy root); the absolute record stays the lockfile claim. Tests: a unit and an installed-CLI -g case (default home and CODEX_HOME) edit the agent, reinstall without --force (kept) and with it (replaced); both fail without the fix. Everything that works on main now passes outside the strict xfail, including the rendered hash in $HOME's lock; only the #3989-dependent $APM_HOME lock and audit stay strict-xfail. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
#3714) #3989 moved the -g bundle lockfile to $APM_HOME with home-relative claims, so the strict xfail is removed and the user-scope lifecycle asserts the rendered hash there. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
… route (#3714) Unit contracts: rendered TOML and claim hash, adopt/collision/--force/--dry-run, render failure and non-Markdown sources write nothing, manifest-mismatch skip, and a parameterized regression asserting every non-Codex agent target still copies the packed bytes. Installed-CLI lifecycle: project install, audit --ci, identical reinstall, edited destination with and without --force, --dry-run, render failure, and argument-free install --frozen without lockfile churn; user scope renders to ~/.codex/agents and $CODEX_HOME/agents. The $APM_HOME lock and audit check is strict-xfail until #3989 (0.37 stack) moves the -g bundle lock root. The bundle-native-layout guard now pins the rendered-format set, the loop hand-off and the AgentIntegrator render/deploy route, with bypass mutations. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
…3714) At user scope the bundle claim is an absolute path. Passing it as the collision key made BaseIntegrator.check_collision index past the destination's parents, so reinstalling over an edited ~/.codex/agents file (or one under CODEX_HOME) crashed with IndexError instead of keeping the edit. The collision key is now the destination relative to the first root that contains it (project or home, else the deploy root); the absolute record stays the lockfile claim. Tests: a unit and an installed-CLI -g case (default home and CODEX_HOME) edit the agent, reinstall without --force (kept) and with it (replaced); both fail without the fix. Everything that works on main now passes outside the strict xfail, including the rendered hash in $HOME's lock; only the #3989-dependent $APM_HOME lock and audit stay strict-xfail. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
#3714) #3989 moved the -g bundle lockfile to $APM_HOME with home-relative claims, so the strict xfail is removed and the user-scope lifecycle asserts the rendered hash there. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is PR B of the #3983 owner-hardening program. PR A (#3988) landed as 67936cd. The stack base is now #3996 (docs redesign): this PR targets
danielmeppiel-docs-redesign-cdo-thesis, journey pages come from #3996 plus the CDO docs patch, and reference/apm-usage edits are kept. Following Daniel's no-deferral decision, the five issues first planned as 0.38 fallbacks ship fully in 0.37. Each one is fixed at its canonical owner, and that owner's guard refuses every caller except the approved ones (closed-world), with insertion mutation cases. This PR also folds in the native-plugin pin portability fix (option (a), decided by Daniel through the 0.37 captain).CurrentMcpConfigViewbundle:<owner>provenance) are recorded baseline:audit --ciand--frozenpass, and unrelated installs keep them. A package can never claim the bundle owner namespace. (harvested from #3972)mutation_mcp_target_and_scope(from #3972)manifest_target_restriction(ManifestTargetDeclaration)apm packon plugin-only packages warns abouttarget:,vscodeandcompilation.target. (harvested from #3980)targets:ondependencies.mcpscopes each server, never leaks into native config, and stale pruning is per target. (harvested from #3951)drift.locked_copy_proofapm_modulescopy that contradicts the lock routesaudit --cito the lock-pinned scratch replay, as a cold checkout does. It never repairs the live tree. Replay's own marker check now askslocked_copy_holds_commit.run_install_pipeline)_fail_before_integrationbefore_run_integration_phase.security/trust_fingerprint.native_plugin_fingerprintplugin:pin covers path and bytes. The exec bit stays only in the per-machine integrity hash (compute_native_plugin_hash), so an approval made on macOS does not park on Windows.compute_native_plugin_pincaller.install/exec_gate.lock_exec_decisions_staleapm installdoes. Org policy is fetched only when a locked package declares executables.install-deployment-executable-trust-context:package_exec_decisionandrecorded_exec_status_is_stalehave closed-world caller sets, plus 2 mutation cases.recorded_exec_status_is_stale(#3944 owner) +security/trust.package_exec_decisionexec_allowed_types. Staleness compares that set with the types allowed now, so removing one type's approval retires that type onapm update. This subsumes the denied+mixed rule and converges after one install.install/local_bundle_handlerapm install -g <bundle>records bundle files (home-relative) and MCP servers in the user lockfile in$APM_HOME, soinstall -g --frozenand audit replay them.LockFile.write,recorded_generator, pack lock enrichmentapm_version: nulllike project reads; packed bundle locks name the packer.contracts-tooling-lockfile-generator: destination-based stamp guard.apm approvebulk paths--alland--recommendedskip a package that any layer denies (org included) and write no allow for it.core/plugin_manifestpack projectionapm.ymlMCP server whosetargets:leave out Claude is not embedded in the Claude plugin.CurrentMcpConfigView/apm audit --cibundle:<owner>provenance cannot hide a denied MCP server: audit re-checks bundle-provenance servers against the gate.mutation_mcp_target_and_scopeprovenance cases.effective_bundle_allow_map(trust owner caller)apm install -g <bundle>reads executables grants from$APM_HOME/apm.yml, never the working directory'sapm.yml; skip messages name the right manifest.deps/apm_resolvermarketplace replaymarketplace_locked_evidenceroutes.install/drift.diff_scratch_against_project->policy/ci_checks.verify_deployed_file_hashesapm auditandapm audit --cireach the same verdict on an edited local-bundle file: both read its locked hash through the one deployed-hash verifier.install_frozen_and_auditdeployed-hash routes (drift route added).InstallLogger.record_mcp_removedRemoved N stale MCP server(s)instead ofNo changes.test_mcp_dependency_targets_lifecycle.py.Spec: req-na-002's lock root digest is unchanged (it keeps modes). The Copilot/Codex approval pin is not the Section 8.5.11 activation approval. Per the 0.37 captain, any req-na-005 amendment travels with #3290.
apm-spec-waiver: consistency fixes route callers through existing owners; no new or changed normative requirement
Issue and approved scope
Issue: Refs #3983. The superseding scope record on #3983 moves #3955, #3964, #3965, #3874 and #2606 into 0.37 in full.
Fixes #3955
Fixes #3964
Fixes #3965
Fixes #3874
Fixes #2606
Fixes #3990
Fixes #3991
Does this PR complete the issue, or what remains? Together with #3988 it completes the #3983 must-ship tier and the five no-deferral issues. PR C (stacked on this one) carries the remaining #3967 polish items and #3940.
Supersedes: #3972, #3980, #3951.
Type of change
targetsscoping fordependencies.mcpentries #2606 per-dependency MCP targets)Testing
Local evidence:
relative_toand auth-signal checks: clean.bash scripts/lint-architecture-boundaries.sh: exit 0.test_lock_derived_expected_state_lifecycle.py::test_stale_module_copy_keeps_locked_skill_subset_on_first_frozen_install(new warmaudit --cicell);test_fail_before_integrate_lifecycle.py::test_failed_direct_dependency_integrates_nothing..mcp.json, since pack ships only authored servers ([BUG] Codex plugin.json from apm pack can point at APM's rendered .mcp.json, which may contain credentials #3966). Bundle-owned servers declare notargets:, so feat(mcp): per-dependencytargetsscoping fordependencies.mcpentries #2606's per-target deselection only considers dependency declarations. Without that fix,install --frozendropped bundle servers.tests/unit/install/test_replay_exec_allow_map.py, includingtest_update_regates_rows_recorded_before_org_policy_enabled_the_gate,test_update_retires_a_type_whose_approval_was_removed, the lock round trip and the install attach. Mutation-break: restoring the early return fails the apm update does not re-gate rows when org policy newly enables the executables gate #3990 tests, and dropping the allowed-set compare fails the apm update does not retire a type whose approval was removed on a gated partial package #3991 tests. Exec-gate lifecycles pass: deny-retires-hooks, deny-remediation, package MCP executables gate (24 passed).Changelog
## [Unreleased]: one Added line for feat(mcp): per-dependencytargetsscoping fordependencies.mcpentries #2606, and Fixed lines for [BUG] MCP servers from a local bundle are invisible to the MCP view: audit and --frozen fail, and the next install removes them #3955, [BUG] audit --ci fails skill-subset-consistency on a correct lock when apm_modules is a stale warm copy #3964, [BUG] apm pack on plugin-only packages never prints the target deprecation warnings #3965, [BUG]apm installwith several sub-path dependencies: when one is invalid, the valid one's skill files stay deployed while the output says no changes were committed #3874 and pin portability.Spec conformance (OpenAPM v0.1)