Skip to content

[0.38] feat(codex): retire the app-server route; explicit split install - #4003

Closed
Daniel Meppiel (danielmeppiel) wants to merge 67 commits into
mainfrom
danielmeppiel-congenial-garbanzo
Closed

Daniel Meppiel (danielmeppiel) wants to merge 67 commits into
mainfrom
danielmeppiel-congenial-garbanzo

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TL;DR

APM no longer spawns codex app-server to register .codex-plugin bundles. Codex now gets every plugin as an explicit split install (skills to .agents/skills/, agents/hooks/MCP to .codex/) with one default-visible diagnostic naming the target, scope, plugins and the unmet native capability (OpenAPM criterion A3, declarative enable). Registrations made by the removed route are retired once, through the Codex config owner, leaving user-owned or user-changed entries alone.

Fixes #3920

Note

Rebuilt for 0.38 on main + #4559 (head b1a7d57), because the train it was based on (#4635) closed. #4003 lands after #4559. It no longer includes #4005, which is unrelated (Claude AGENTS.md).

Problem (WHY)

  • APM coupled install/uninstall to a vendor binary: codex_plugins/client.py located codex on PATH, version-gated it (>= 0.163.0) and drove config/batchWrite, marketplace/upgrade, plugin/read, plugin/uninstall over JSON-RPC.
  • The [EPIC] Native plugin installation and lifecycle across all APM targets #3094 decision is that APM drives harnesses through files only. The spec's req-na-003 says a consumer "MUST NOT locate, invoke, or version-check a target-native binary, CLI, or RPC endpoint in order to activate, register, or remove a plugin".
  • Codex 0.170.0 has no files-only native route: [plugins."x@m"] enabled = true leaves the plugin installed: false, and a session start does not install it (spec Part C, Codex row: "Split (fails A3; A2 also not met)").
  • [!] req-na-006: a target that does not qualify gets split install or refusal, and the consumer "MUST NOT split-install a plugin silently". It was waived pending this delivery.

Approach (WHAT)

# Change
1 Delete the app-server route: codex_plugins/{client,registrar,snapshot,admission,manifest}.py and every codex_native branch in install, drift, MCP view, policy, uninstall and approve.
2 Classify .codex-plugin/plugin.json like any plugin manifest: MARKETPLACE_PLUGIN normalization, so primitives deploy per target and executables use per-type approval.
3 Record each plugin Codex receives (note_codex_split_install) and emit one aggregated info diagnostic per install; --dry-run reports the same decision ("would split-install").
4 Retire legacy registrations once on apm install -g / apm uninstall -g: read the old journal, remove only config.toml entries that still hold exactly what APM wrote (disabled plugin + recorded source) via the Codex adapter, delete APM's own snapshots and journal. Codex's plugin cache is never touched.
5 Replace the architecture guard with marketplace-integrations-codex-split-install: single owners, and a forbid-scan for "app-server" / which("codex") anywhere in src/.

Implementation (HOW)

File Intent
src/apm_cli/codex_plugins/legacy_registrations.py (new) One-time migration. Recomputes the route's marketplace name, delegates the config.toml edit, removes snapshots inside its own root only, deletes the journal. Unreadable journal/config: nothing changes, journal kept, warning names the file.
src/apm_cli/adapters/client/codex.py retire_plugin_registrations() sits beside migrate_legacy_managed_servers(): the adapter already owns config.toml I/O. Keeps entries that are enabled, edited, re-sourced or shared.
src/apm_cli/install/phases/codex_plugins.py Rewritten: the A3 diagnostic, the retirement call, and the dry-run report.
src/apm_cli/install/target_warnings.py note_codex_split_install(), called from warn_unsupported_primitives so services.py stays deletion-only.
src/apm_cli/models/validation.py, install/{deployment_plan,services,drift,sources,exec_gate,pipeline,context,deployable_source_plan}.py, integration/mcp_config_view.py, commands/{approve,uninstall/cli}.py, policy/ci_checks.py Deletions only (per the 0.38 seam ruling). uninstall/cli.py swaps the remove_codex_plugins call 1:1 for the retirement call.
src/apm_cli/install/cache_pin.py Gains is_full_source_pin (moved from the deleted registrar); the warm-cache source-pin behavior from #3388 is kept.

Diagrams

Legend: what apm install does for a plugin when Codex is a selected target. The dashed edge is the removed path.

flowchart LR
    A["plugin package<br/>.codex-plugin / .claude-plugin / plugin.json"] --> B["validation.py<br/>MARKETPLACE_PLUGIN normalization"]
    B --> C["services.py<br/>per-target primitive integrators"]
    C --> D[".agents/skills/  .codex/agents/<br/>.codex/hooks.json  .codex/config.toml"]
    C --> E["target_warnings.py<br/>note_codex_split_install"]
    E --> F["phases/codex_plugins.py<br/>one info diagnostic: scope, plugins, A3"]
    F --> G["legacy_registrations.py<br/>retire journal-owned entries"]
    G --> H["CodexClientAdapter<br/>retire_plugin_registrations"]
    A -.->|"removed: codex app-server JSON-RPC"| X["codex binary"]
Loading

Trade-offs

  • Split install for every plugin format on Codex, not only .codex-plugin. That is what req-na-006 asks of a non-qualifying target; Claude-format plugins installed for Codex now also print the A3 line.
  • No new migration journal or flag. Retirement is driven by the old journal's presence and is idempotent; once deleted, nothing runs.
  • Enabled or changed registrations are left to the user, not removed. An enabled one can load alongside the split install; the warning says so. Deleting a user-enabled plugin would discard their activation decision.
  • Codex's own plugin cache stays. Writing it is out of scope (undocumented private state). Verified with real Codex 0.170.0 that, after retirement, plugin/list shows no APM marketplace or plugin.
  • compute_native_bundle_hash kept. It has no src/ caller now but is a shared fingerprint utility with its own tests; removal is a separate cleanup.

Benefits

  1. Zero code paths locate or spawn codex (guarded statically by the new architecture rule, and dynamically by a PATH spy in the lifecycle test).
  2. Codex plugins install at project and user scope on any OS, with no Codex version floor.
  3. req-na-006 moves from waived to active in CONFORMANCE.md.
  4. About 3,000 net lines removed (56 files changed, 1006 insertions(+), 4001 deletions(-) in the code commit).
Draft request to openai/codex (NOT filed; needs maintainer go-ahead)

Install config-enabled local-marketplace plugins at session start

What happens today (Codex CLI 0.170.0). A tool that manages agent configuration from files can declare a local marketplace and enable a plugin in config.toml:

[marketplaces.example]
source_type = "local"
source = "/path/to/marketplace"

[plugins."my-plugin@example"]
enabled = true

Codex discovers the marketplace, but the plugin stays installed: false, and starting a session in a trusted project does not install it. A local plugin is installed only by codex plugin add, a git marketplace upgrade, or the plugin browser.

Request. When a trusted session starts, install any plugin that is enabled in config.toml and listed by a declared local marketplace but not yet installed, the same way codex plugin add would. Leave a plugin set to enabled = false as it is.

Why. Package managers and team setups can then declare Codex plugins in the documented settings file alone, without running the codex binary or writing Codex's plugin cache. A repository-level .agents/plugins/marketplace.json that the CLI discovers on its own would help in the same way.

Reproduce. Use an isolated CODEX_HOME with the two entries above and a trusted project, start a session, then check plugin/list: the plugin shows installed: false.

Upgrade note

If an earlier APM version registered a Codex plugin through codex app-server, run one plain apm install -g before any apm install -g --frozen. That first install converts the cached bundle, retires the old registration, and records the plugin's MCP evidence in ~/.apm/apm.lock.yaml. Until then, --frozen fails closed, because the old lockfile has no MCP evidence for the plugin:

[x] --frozen: restored MCP declarations differ from apm.lock.yaml.
  - MCP server 'example' is missing from apm.lock.yaml
[i] Tip: review the restored sources and lockfile before running 'apm install'
without --frozen to record the intended declarations. MCP configuration has not
been activated.
[x] Install failed after 0.2s.

(example is the plugin's MCP server name. The message was captured from this branch at d562f31 with the lifecycle fixture's old-route state.)

Rebuild notes (P4 v2, 2026-11-21)

  • Rebuilt as main + feat(native): project-scope native plugins for Claude and Copilot (#3921, #3896) #4559 + the four [0.38] feat(codex): retire the app-server route; explicit split install #4003 commits (2f22ee9..08aac58). Conflicts take main's side plus the [0.38] feat(codex): retire the app-server route; explicit split install #4003 delta from the earlier train merge 60f83e0, and a cross-check confirms every file in that delta still carries it. The bug-ledger rows (4154, 4432, 4449, 4480) are ported to main's one-file-per-row layout.
  • Drift fix (install/drift.py, _normalize_legacy_local_plugin_for_replay): the audit replay looked up plugin.json without the .codex-plugin location, so a split-installed Codex bundle never deployed its skill in the scratch tree, and audit --ci reported it orphaned. Replay now normalizes with the manifest the canonical classifier (detect_package_type) selects. Witness: test_approve_parked_native_plugin_lifecycle.py::test_codex_bundle_mcp_waits_for_the_printed_command_while_skills_split_install (failed before, passes now).
  • Docs redone on the current layout: consumer/installing-from-marketplaces.md, consumer/install-plugins.md, reference/package-types.md, reference/cli/approve.md and pack.md, and apm-usage commands.md, dependencies.md and package-authoring.md.
  • CONFORMANCE: req-na-006 becomes active 1/1. req-sc-009 moves 5/10 -> 4/9 and req-sc-015 7/8 -> 4/5, because the deleted app-server tests cited them.
  • The complexity baseline entry for the deleted test_codex_native_plugin_lifecycle.py is pruned.
  • compute_native_bundle_hash is kept (deferred cleanup).

Issue and approved scope

Issue: Fixes #3920

Human scope-approval comment: #3920 (comment) (re-checked with scripts/governance/eligibility.cjs: record-present, review contact Daniel Meppiel (@danielmeppiel)).

Completes the issue: no code path spawns codex; the lifecycle test migrates an existing APM registration; the diagnostic is documented in docs and apm-usage; one CHANGELOG line. The openai/codex request is drafted above and not filed.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass (see Validation for the environment-only baseline)
  • Added tests for new functionality (if applicable)

Validation

At b12ca1d, local (macOS), all through the host guard:

  • Lint mirror: uvx [email protected] check and format --check (CI paths), pylint R0801, lint-auth-signals.sh, check_complexity_ratchet.py --base-ref origin/main, tests.quality.taxonomy --changed and check_test_assertions.py: all clean.
  • Targeted sweep (APM_E2E_TESTS=1): test_approve_parked_native_plugin_lifecycle, test_codex_split_install_lifecycle, test_native_plugin_cache_audit and cache_replay, test_native_project_plugin_lifecycle, test_native_project_scope, test_local_bundle_codex_agents_lifecycle, test_architecture_outcome_guards; unit test_cached_source_pin, test_claude_native_hooks, test_codex_split_install, test_codex_split_intent; spec test_resolution_reqs and test_frozen_service_lock_reqs: 245 passed, 3 xfailed.
  • Earlier on this WIP: tests/quality passed; drift, replay and plugin unit tests (477) passed.
  • Out-of-band, real Codex 0.170.0 (not in CI; from the original PR): retirement keeps model and the user's foreign@external, removes the journal, and plugin/list shows no APM marketplace.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 Upgrading APM retires the Codex registration it made earlier and split-installs the plugin, without running codex Vendor-neutral, DevX tests/integration/test_codex_split_install_lifecycle.py::test_install_migrates_owned_registration_then_split_installs integration
2 A registration I enabled or edited is never removed Governed by policy, DevX tests/integration/test_codex_split_install_lifecycle.py::test_user_enabled_registration_is_left_in_place
tests/unit/install/test_codex_split_install.py::test_changed_registration_is_left_to_the_user
integration, unit
3 Installing a plugin for Codex is never silent: one line names scope, plugins and A3, also in --dry-run Multi-harness support, DevX tests/spec_conformance/test_native_activation_profile_reqs.py::test_unqualified_target_gets_explicit_split_install
tests/unit/install/test_codex_split_install.py::test_phase_reports_one_diagnostic_naming_target_scope_plugins_and_a3
unit
4 A .codex-plugin bundle deploys its skills and MCP servers like any plugin Portability by manifest, Multi-harness support tests/unit/test_codex_split_intent.py::test_codex_only_manifest_normalizes_into_loose_primitives
tests/unit/integration/test_mcp_config_view.py::test_local_codex_plugin_mcp_uses_synthesized_manifest
unit
5 Unreadable Codex config or journal changes nothing Secure by default tests/unit/install/test_codex_split_install.py::test_unreadable_state_changes_nothing_and_keeps_the_journal unit
6 No future change can reintroduce a codex spawn Vendor-neutral tests/integration/test_architecture_owner_rule_mutations.py::test_codex_split_install_and_retirement_gates_cannot_be_bypassed integration

How to test

  • With a pre-0.38 APM, run apm install -g <codex-plugin> --target codex (needs Codex >= 0.163 on PATH). Then, on this branch with codex removed from PATH, rerun it. Expect Retired 1 Codex plugin registration(s) and no apm- keys left in ~/.codex/config.toml.
  • Expect ~/.agents/skills/<skill>/SKILL.md, an mcp_servers.<name> entry in config.toml, and the [i] Codex: split-installed ... A3 line.
  • Rerun with --dry-run: expect the "would split-install" line and no file changes.
  • Set the legacy plugin to enabled = true before upgrading: expect it kept, plus a warning.

Changelog

  • One fragment, changelog.d/4003.breaking-changes-and-upgrade-notes.md (users must run one plain apm install -g before --frozen after upgrading).
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: not needed. req-na-006 and Part C already classify Codex as split.
  • Manifest edit: not needed.
  • Test edit: @pytest.mark.req("req-na-006") waiver replaced by a behavioral test.
  • CONFORMANCE.{md,json} regenerated and committed (req-na-006 is now active).
  • N/A

apm-spec-waiver: implements existing req-na-006 with its existing marker; no new normative surface

Co-authored-by: Copilot [email protected]

, #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]>
Codex fails the native activation profile's declarative-enable criterion
(A3), so every plugin, including .codex-plugin bundles, is split-installed
for it and APM never locates or runs the codex binary. One default-visible
diagnostic per install (and --dry-run) names the target, scope, plugins
and A3. Registrations made by the removed app-server route are retired
once on apm install -g / apm uninstall -g through the Codex config owner,
leaving enabled or changed entries to the user.

Binds req-na-006 to real behavior; no spec change.

apm-spec-waiver: implements existing req-na-006 with its existing marker; no new normative surface

Refs #3920

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
- 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]>
The removed route locked a .codex-plugin bundle's raw bytes and never
converted it. On upgrade the split install re-materializes the locked
commit and converts it, which the supply-chain check rejected as a content
hash mismatch, so the plugin was neither registered nor deployed.
legacy_plugin_compat now accepts exactly the conversion delta: the tree
minus apm.yml and .apm/ must hash to the locked value and converting those
bytes again must reproduce the fresh tree. The lifecycle test seeds an
old-route apm_modules copy and lock row and asserts skills and MCP deploy
after the registration is retired.

Refs #3920

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
The retired-route acceptor reused the 0.28 helpers, whose errors said
'Cached Claude Plugin'. They now take the plugin kind, and the Codex path
reports 'Cached Codex plugin'.

Refs #3920

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…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
…plugin_root

Unfinished rebase work for #4003, not yet fully gated.

- deployable_source_plan.py back to main: the Claude native route still
  passes native_plugin_root=.
- A -g .codex-plugin bundle with claude selected: Codex split-installs it,
  Claude parks it (unit test).
- Parked-native lifecycle: Codex cells now assert split install, MCP gated
  until the printed approve command, and a codex spy never runs.
- Lifecycle world: p-native-codex runs at both scopes against the codex
  trap; Codex CLI provisioning removed from lifecycle-full CI and topology.
- Retired-route lifecycle seeds v1 (legacy) and v4 (framed) lock rows.
- Promise P-OWN-codex-native-plugin-lifecycle -> P-OWN-codex-split-install.

Co-authored-by: copilot-swe-agent[bot] <[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]>
…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]>
The loose-hooks switch remedy picks its scope in the remediation owner
(claude_native_switch_loose_hooks), so services.py adds no lines over
main. Generator citations and CONFORMANCE regenerated.

Co-authored-by: Copilot App <[email protected]>
…l-fix-3896-native-project

# Conflicts:
#	tests/quality/lifecycle_obligations.json
A survivor rebuilt from the normalized apm_modules copy lost its
marketplace_plugin type, so its own deployment plan never routed it
native: a parked Claude plugin was rebuilt loose for copilot while
install deploys nothing (I1, M-SOURCE spine). native_harnesses takes the
lock's recorded type, as audit replay does (Analyst HIGH-D).

Co-authored-by: Copilot App <[email protected]>
A test that patches LockFile could be the first to import it, leaving
its LockFile bound to the mock (Windows shard 2 session-finish check).

Co-authored-by: Copilot App <[email protected]>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: 76b4794 -> 57ad78a (standing 0.38 reviewer)

Verdict: NOT CLEAN, for one mechanical reason. Both folds from review 6007239540 are correct, but Lint is red on the CI merge commit. The fix is to merge #4559's current head. No code change is needed.

Previous items

ID Status Evidence
HIGH-3 unclassified remediation id Resolved codex-legacy-retirement-retry is in COMPONENT_ONLY of tests/unit/core/test_remediation_w3_plugins_runtime_catalog.py, with a reason (the split-install unit cells drive the unreadable-journal path).
HIGH-4 stale generator cites Resolved U-BIN (exec_gate.py 715/716/719), the _MCP_VIEW parked lines (1199/1211), E3 (services.py 814/1017) and the uninstall accepts/user-scope cites (uninstall/cli.py 850/852/858) were all re-anchored. I re-ran the citation check mechanically: all 82 Ev(...) anchors in tests/lifecycle/generator/rules.py hold at 57ad78a under the test's 8-line EVIDENCE_WINDOW.

Merges

  • The lifecycle-journeys.yml resolution is correct. Dropping the pinned Codex CLI install step and APM_REQUIRE_CODEX matches "APM never runs codex", main's APM_LIFECYCLE_RECEIPTS_DIR is kept, and nothing at 57ad78a still reads APM_REQUIRE_CODEX.
  • The #4559 merge (8606dbe) and the main merge (f8b2b1c) are clean.

Blocking

  • HIGH-5: Lint red. src/apm_cli/commands/uninstall/engine.py is 2101 lines (max 2100) on the CI merge commit (57ad78a + main 488a4b1; it is 2099 at 57ad78a alone). This branch carries #4559 at 8606dbe. #4559 has since moved to b0e817d (refactor(uninstall): keep engine.py under the 2100-line guard, plus 76e3ea0 stamp planned native_declared before the one lock commit (#4329) and a main merge). I simulated 57ad78a2 + b0e817d0:

    • The merge is clean, and since b0e817d already includes main 488a4b1, the CI merge tree is the same.
    • engine.py is 2098 lines, install.py 2095 and uninstall/cli.py 1575, and no file under src/ or scripts/architecture_linter/ exceeds 2100.
    • All 82 generator cites still hold.

    Fix: merge #4559's head b0e817d again and push.

Note

The rest of CI at 57ad78a was still pending when this was posted (14 pass, 20 pending; Lint is the only failure). Since #4003 lands after #4559, re-merge #4559's head each time it moves; it is the source of this round's red.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: 57ad78a -> affda5b (standing 0.38 reviewer)

Verdict: CLEAN for #4003's own content. CI is red, but every red check comes from #4559 at b0e817d, and #4003 introduces none of it. #4003 goes green once #4559 is fixed and re-merged here.

  • affda5b is exactly the tree I simulated for review 6008356586 (git diff against the 57ad78a2 + b0e817d0 merge tree is empty): main 488a4b1 plus #4559 b0e817d, with no other edits. engine.py is 2098 lines, no file exceeds 2100, and all 82 generator cites hold.
  • HIGH-5 (engine.py 2101 lines) is resolved.

Red checks, all inherited from #4559 b0e817d

Lint (lint_architecture_boundaries), Architecture Scaling, and Owner Surface Slice (2/3) (test_owner_rules_report_nothing_before_mutation) all report the same violation:

src/apm_cli/commands/uninstall/engine.py:1:1: install-deployment-package-target-authorization [legacy AC15b] selector result does not drive survivor rebuild

#4559's own CI run at b0e817d (44952165831) fails Lint and Architecture Scaling identically.

Cause: b0e817d (refactor(uninstall): keep engine.py under the 2100-line guard) turned this loop in _sync_integrations_after_uninstall (engine.py:1501):

authorized_targets = []
for target in target_selection.targets:
    if target.name not in native:
        authorized_targets.append(target)

into authorized_targets = [t for t in target_selection.targets if t.name not in native]. AC15b's _consumer_routes_through_selector (scripts/architecture_linter/checks/install_package_target_authorization.py) requires an ast.For loop over target_selection.targets in the function's own scope, and a comprehension does not count. Fix in #4559: restore the loop, and find the 3 lines elsewhere, for example the multi-line docstring or a comment. Then re-merge #4559 into #4003.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: affda5b -> 67cb61f (standing 0.38 reviewer)

Verdict: CLEAN. CI at 67cb61f is fully green (42 pass).

  • 67cb61f is a single merge of #4559 d7525ed (the restored AC15b loop). Its tree is identical to affda5b8 + d7525ed7 (git diff against the git merge-tree result is empty), so it carries no other edits.
  • The inherited AC15b failure on uninstall/engine.py is resolved. Lint, Architecture Scaling and Owner Surface are green.
  • All prior #4003 findings (HIGH-1..5, MEDIUM-2) remain resolved.
  • Note: uninstall/engine.py is exactly 2100 lines, at the limit. Any later edit on either PR must save lines first.

#4003 lands after #4559. If #4559 moves again before landing, re-merge it here.

…6-native-project

# Conflicts:
#	docs/src/content/docs/specs/openapm-v0.1.md
#	src/apm_cli/install/pipeline.py
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json
…all/errors

commands/install.py had reached its LOC budget. The auth, frozen, native
settings / LSP gate, policy and generic failure renderers of the APM
dependency phase move to install/errors.py
(render_apm_dependency_failure, log_authentication_error), beside
log_frozen_install_error; both install handlers use them. pipeline.py
keeps main's comment length so it stays under its 1005 budget.

Co-authored-by: Copilot App <[email protected]>
…ed and announced

Witness agreed with QL for the new layout: at project scope for claude and
copilot, a hand edit inside .agents/plugins/<name>/ is restored to the
approved publisher bytes with the [!] Restored line (I7), the lock is
unchanged and a user file outside the root survives.

Co-authored-by: Copilot App <[email protected]>
- install/pipeline.py: keep #4594's order (services before native work, a
  rolled-back reconciliation skips it) with #4559's Copilot move; Codex
  legacy retirement now runs inside that gate, before Claude registration.
- openapm-v0.1.md: keep #4559's 0.1.74 row and main's 0.1.75 row (152
  statements, 147 MUST).
- Lifecycle generator cites re-anchored; obligations and CONFORMANCE regenerated.
- commands/install.py back to 2100 lines: the Codex split dry-run report is
  now emitted at the end of preflight_agent_plugin_dry_run.

Co-authored-by: Copilot App <[email protected]>
- install/pipeline.py: #4559's phase comment; #4003 keeps the codex client
  removal (no CodexNativeError).
- With #4559's install.py extraction (2057 lines), the Codex dry-run report
  returns to commands/install.py; template.py is unchanged from 67cb61f.
- Lifecycle generator cites re-anchored; obligations regenerated.

Co-authored-by: Copilot App <[email protected]>
…rite gate

Main's #4381 overwrite planning skipped plans with codex_native; #4003
retires that route, so a split-installed Codex plugin is planned like any
other package.

Co-authored-by: Copilot App <[email protected]>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: 67cb61f -> 5fce2c3 (standing 0.38 reviewer)

Verdict: NOT CLEAN, for one test-harness reason. The merges and fold (4) are correct. CI has one real red, Build & Test Shard 1.

Merges and changes: correct

  • I simulated 67cb61f1 + #4559 b87969b7 (which already includes main 899d17b) with git merge-tree. Besides the regenerated rules.py and obligations files, 5fce2c3 differs from that tree only by fold (4). pipeline.py (1003 lines) is the automatic merge, unchanged: release_deploy_targets(), then services, then codex_plugins and claude_plugins inside the #4594 gated block. CodexNativeError stays removed.
  • Spec rows 0.1.74 (#4559) and 0.1.75 (#1925) are both kept. template.py is identical to 67cb61f.
  • All 82 generator Ev cites hold at 5fce2c3 under the 8-line window. No file under src/ or scripts/architecture_linter/ exceeds 2100 lines (uninstall/engine.py is exactly 2100).
  • (4) install/commit_gate.py:338: dropping plan.codex_native is correct. The field no longer exists, and no codex_native reference is left in src/. A split-installed Codex plugin is ordinary loose content, so it should be overwrite-gated. The Claude-native route is still excluded, because _planned_keeps only plans targets in plan.projection_targets, which leaves out native harnesses.

Blocking

  • HIGH-6: Build & Test Shard 1 fails with all tests passing (15278 passed, then exit 1). The session-finish guard reports:
    [x] apm_cli module globals left as unittest.mock objects (a patch was captured by a module first imported inside it):
        apm_cli.install.legacy_plugin_compat.compute_package_hash
    
    install/legacy_plugin_compat.py is only imported lazily (source_helpers.py:142,375, sources.py:378, phases/resolve.py:740, phases/codex_plugins.py:48), and it is not in tests/conftest.py _LAZY_CONSUMERS. When its first import lands inside a patch("apm_cli.utils.content_hash.compute_package_hash") (test_sources_materialisation.py, test_cached_source_lockfile_only.py), the module binds the mock for the rest of the session. Whether that happens depends on how xdist distributes the tests, which explains why main and #4559 are green. Fix: add "apm_cli.install.legacy_plugin_compat" to _LAZY_CONSUMERS. That is the same fix #4559 used for install.integrity (7f256bb).

Other

  • Owner Surface Slice (1/3) was canceled with The operation was canceled., the second timeout of this slice on #4003 (also at 76b4794). Rerun it. If it recurs, the slice is near its time budget with #4003's owner surface selected, so raise it with the CI owner.

Its compute_package_hash import was left as a mock at session finish on
Build & Test Shard 1; preload it like install.integrity.

Co-authored-by: Copilot App <[email protected]>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: 5fce2c3 -> f2b0771 (standing 0.38 reviewer)

Verdict: CLEAN for #4003's content. HIGH-6 is resolved. The only red check is a CI capacity timeout, not a test failure.

  • HIGH-6 resolved. tests/conftest.py adds "apm_cli.install.legacy_plugin_compat" to _LAZY_CONSUMERS, sorted after install.integrity, and nothing else changed. Build & Test Shards 1-2 are green, so the session-finish mock-leak guard no longer fires.
  • CI at f2b0771: 39 pass. The only red is Owner Surface Slice (1/3) (plus its aggregate, Owner Surface Check), which was canceled at the job's timeout-minutes: 15 (.github/workflows/owner-surface.yml) at 79% progress with no failing test. Slices 2/3 and 3/3 passed in 11m05s and 9m50s. This is the third timeout of slice 1 on #4003, and #4559's slice 1 already needed 14m06s, so shard 1 sits at the budget whenever the native-plugin owner surface is selected.
    • Owner of the fix: the CI or ratchet owner, not #4003. Either rebalance scripts.ci_sharding with --shard-durations for the owner-surface slice, or raise the slice timeout. Until then, rerun the job; a rerun may pass if it lands on a faster runner.
  • All earlier #4003 findings remain resolved.

…s .gitattributes

Review findings on #4559:
- apm prune skipped install's gate, so a revoked or denied native plugin
  stayed declared and a missing root was redeployed from locked bytes.
  Prune now asks the gate retirement owner (gate_retirements) through
  native_plugins/uninstall.retire_gated_native_plugins, as uninstall does,
  on both the nothing-to-prune and prune paths, and stages the lock after
  the survivor preflight (new commit site _resync_native_plugins).
- A failed settings write while removing the last plugin restored the
  catalog but left APM's .gitattributes deleted, so a checkout could
  convert the byte-pinned roots. The rollback now restores it.

Co-authored-by: Copilot App <[email protected]>
…ing commit site

The commit-site ratchet forbids a new lockfile commit site. A prune that
only retires gated native records now takes the regular prune path,
whose single write follows the survivor preflight; dry run judges nothing.

Co-authored-by: Copilot App <[email protected]>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review: f2b0771 -> 48efede (standing 0.38 reviewer)

Verdict: content CLEAN, but #4559 needs re-merging.

  • 48efede is a pure merge of #4559 48e3cbc: its tree equals git merge-tree f2b07711 48e3cbce (empty diff).
  • That #4559 commit added a second prune lockfile commit site (prune.py::_resync_native_plugins). The commit-site ratchet rejects it, and #4559's own CI at 48e3cbc failed Owner Surface Slice (3/3). #4559 fixed this at 40bfa9a (persist gate-retired native records through prune's existing commit site), which is green, so re-merge #4559 40bfa9a before relying on this run.
  • I reviewed #4559's prune and .gitattributes changes on #4559 itself; they are CLEAN at 40bfa9a.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 22, 2026
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Closing per the 0.38 feature-cut ruling (no draft PRs, rule 16): this feature is not in 0.38.0. The branch is kept; it reopens as a ready PR when resumed.

Jason 'Jay' Jack (jasonjack-jay) pushed a commit to jasonjack-jay/Agent-Package-Manager that referenced this pull request Nov 23, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Codex: retire the app-server registration route; explicit split install

1 participant