Skip to content

fix(integration): route user-scope Copilot hooks to the hooks bucket - #2559

Merged
Daniel Meppiel (danielmeppiel) merged 18 commits into
microsoft:mainfrom
aryansk:codex/issue-2558-copilot-hook-orphan
Sep 3, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 18 commits into
microsoft:mainfrom
aryansk:codex/issue-2558-copilot-hook-orphan

Conversation

@aryansk

@aryansk Aryan Singh K. (aryansk) commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Uninstalling a user-scope package (apm uninstall -g) removes every other deployed primitive but leaves its Copilot hook files behind in ~/.copilot/hooks/. The orphaned file is live wiring: Copilot CLI keeps firing a hook belonging to a package that is gone.

Root cause: at user scope the Copilot instructions primitive maps to an empty subdir, so its deploy root .copilot/ becomes a shallow catch-all trie node in BaseIntegrator.partition_managed_files. Hook paths under .copilot/hooks/ match that node first and are routed to the instructions bucket, so no integrator ever deletes them.

Change

Register the cross-target hooks/skills prefixes in the routing trie so the deeper .copilot/hooks/ prefix wins by longest-prefix match, routing hook files to the hooks bucket where HookIntegrator cleans them up.

The cleanup path also validates every manifest-owned path against the resolved deployment root before unlinking it. This prevents a symlinked hook root from redirecting cleanup outside the target tree.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 apm uninstall --global removes a package's Copilot hooks and keeps hooks the user wrote Multi-harness support; DevX (pragmatic as npm) tests/integration/test_hook_js_sidecar_lifecycle_contract.py::test_required_global_copilot_sidecar_lifecycle (regression trap for #2558) e2e
2 Copilot hook files recorded under .copilot/hooks/ are recognized as hooks during uninstall Multi-harness support tests/unit/integration/test_data_driven_dispatch.py::TestScopeResolvedPartition::test_partition_user_scope_copilot_hooks_not_shadowed unit
3 Uninstall refuses to follow a symlinked Copilot hook directory outside the deployment root Secure by default tests/unit/integration/test_deployed_files_manifest.py::TestHookSync::test_sync_rejects_symlinked_hook_root unit
4 Global uninstall refuses to follow .copilot into another directory under the same home directory Secure by default tests/unit/integration/test_deployed_files_manifest.py::TestHookSync::test_sync_rejects_hook_root_redirect_within_project_root unit
5 Uninstall removes managed hook symlinks without deleting their targets, including dangling links and absolute tool roots Secure by default; DevX (pragmatic as npm) tests/unit/integration/test_deployed_files_manifest.py::TestHookSync::test_sync_unlinks_final_managed_symlink_without_following_target; tests/unit/integration/test_deployed_files_manifest.py::TestHookSync::test_sync_unlinks_absolute_final_managed_symlink_without_following_target unit
6 Uninstall refuses an absolute tool hook directory that redirects through a symlinked parent Secure by default tests/unit/integration/test_deployed_files_manifest.py::TestHookSync::test_sync_rejects_absolute_managed_hook_parent_symlink unit
7 When a suspicious managed hook path is preserved, uninstall explains how to inspect it safely DevX (pragmatic as npm); Secure by default tests/unit/test_surviving_deps_reintegration.py::test_uninstall_warns_when_managed_hook_fails_containment unit
8 A late managed-hook unlink failure is reported and exits nonzero without false success DevX (pragmatic as npm) tests/integration/test_uninstall_hook_cleanup_failure.py::test_uninstall_reports_real_managed_hook_unlink_failure component
9 A user file or symlink replacing a managed hook after preflight is preserved by the final provenance gate Secure by default tests/integration/test_uninstall_hook_cleanup_failure.py::test_uninstall_preserves_hook_replaced_after_provenance_preflight; tests/integration/test_uninstall_hook_cleanup_failure.py::test_uninstall_preserves_symlink_replaced_after_provenance_preflight component
10 Canonical deployment-ledger hashes take precedence over compatibility hash views during cleanup Secure by default tests/integration/test_uninstall_hook_cleanup_failure.py::test_cleanup_snapshot_prefers_canonical_ledger_hash component
11 An unexpected integration-cleanup exception exits nonzero with safe recovery guidance DevX (pragmatic as npm) tests/integration/test_uninstall_hook_cleanup_failure.py::test_uninstall_reports_integration_cleanup_exception_nonzero component

Validation

  • 165 passed across the focused routing, hook cleanup, provenance, warning, and command-boundary suites.
  • 1 passed for the installed-CLI global Copilot hook lifecycle.

apm-spec-waiver: Repairs existing global uninstall semantics and hardens path containment; it introduces no new OpenAPM contract.

Closes #2558

@aryansk

Aryan Singh K. (aryansk) commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor Author

The CLA step is contributor-controlled. I have not issued the agree command or claimed acceptance on the contributor's behalf; the PR remains pending that legal authorization.

@danielmeppiel

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_with_followups

PR #2559 restores reliable global Copilot hook cleanup while hardening managed deletion against symlink escape.

cc Aryan Singh K. (@aryansk) -- a fresh advisory pass is ready for your review.

The interim E2E run failed on an unrelated stdout assertion; remove it and retain passing file-state assertions. The containment validation, symlink regression, and mutation-break proof are essential. Complete and rerun all folded lifecycle, containment, and performance changes before shipping.

Aligned with: Secure by default: containment validation prevents symlink escape; Multi-harness support: cross-target prefixes make ownership explicit; OSS community driven: the changelog credits the contributor; Pragmatic as npm: global uninstall removes managed artifacts while preserving user hooks.

Growth signal. This contributor-driven fix improves trust in global uninstall.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 The fix preserves BaseIntegrator as the single routing owner and correctly applies longest-prefix matching.
CLI Logging Expert 0 0 0 No CLI output or logging concerns; existing uninstall counts remain accurate.
DevX UX Expert 0 1 0 The CLI-level cleanup and preservation promise needs end-to-end coverage.
Supply Chain Security Expert 1 0 0 Add containment validation before enabling the new hook route.
OSS Growth Hacker 0 0 0 The changelog clearly communicates the fix and credits the contributor.
Test Coverage Expert 1 1 0 Remove the interim brittle assertion, rerun E2E evidence, and document scenario evidence.
Performance Expert 0 1 0 Hoist invariant validation work outside the managed-files loop.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 5 follow-ups

  1. [Supply Chain Security Expert] (blocking-severity) Complete containment validation before managed hook deletion and retain the symlink regression test -- uninstall must not delete outside the deployment root.
  2. [Test Coverage Expert] (blocking-severity) Remove the unrelated stdout assertion and rerun E2E file-state assertions -- installed-CLI lifecycle evidence must pass.
  3. [DevX UX Expert] Extend the global Copilot lifecycle test through uninstall -- this verifies the user promise.
  4. [Performance Expert] Hoist invariant validation work -- this preserves scaling.
  5. [Test Coverage Expert] Add Scenario Evidence to the PR body -- this makes verification explicit.

Architecture

classDiagram
    direction LR
    class TargetProfile
    class PrimitiveMapping
    class BaseIntegrator
    class HookIntegrator
    class SkillIntegrator
    class InstructionIntegrator
    class PromptIntegrator
    TargetProfile *-- PrimitiveMapping : owns mappings
    BaseIntegrator <|-- HookIntegrator
    BaseIntegrator <|-- SkillIntegrator
    BaseIntegrator <|-- InstructionIntegrator
    BaseIntegrator <|-- PromptIntegrator
    BaseIntegrator ..> TargetProfile : derives routing prefixes
Loading
flowchart TD
    A["apm uninstall --global"] --> B["Resolve user-scope targets"]
    B --> C["Partition managed files by longest prefix"]
    C --> D["HookIntegrator receives hook bucket"]
    D --> E["Validate containment"]
    E --> F["Remove managed hook files"]
    F --> G["Preserve user-authored hooks"]
Loading

Recommendation

Ship after the folded containment and installed-CLI lifecycle changes pass.


Full per-persona findings

Python Architect

  • [nit] Architecture is appropriate for this focused fix.
    The change extends the canonical routing path instead of introducing parallel authority.

CLI Logging Expert

No findings.

DevX UX Expert

  • [recommended] Cover the global Copilot hook fix through the installed CLI lifecycle at tests/unit/integration/test_data_driven_dispatch.py:660.
    The unit test proves trie routing only; it does not verify global uninstall cleanup and preservation.

Supply Chain Security Expert

  • [blocking] The new hook route enables deletion outside the deployment root through symlinked parents at src/apm_cli/integration/hook_integrator.py:1912.
    Apply containment validation before unlinking and add a symlink regression.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

Changes only touch integration cleanup, tests, and CHANGELOG.md.

Doc Writer -- inactive

The change restores documented behavior without changing commands, flags, formats, or user guidance.

Test Coverage Expert

  • [blocking] The interim E2E stdout assertion fails at tests/integration/test_hook_js_sidecar_lifecycle_contract.py:806.
    Remove the unrelated stdout assertion and rerun the file-state assertions.
  • [recommended] The PR body lacks the required Scenario Evidence table.
    Add lifecycle, preservation, and containment evidence.

Performance Expert

  • [recommended] Hoist invariant path-validation work out of the managed-files loop at src/apm_cli/integration/hook_integrator.py:1910.
    Avoid repeated target scans and root resolution.

This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.

@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the codex/issue-2558-copilot-hook-orphan branch from ce9b78b to 8869eb1 Compare September 3, 2026 03:27
@danielmeppiel

Daniel Meppiel (danielmeppiel) commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_now

Hardens global hook cleanup against routing errors, provenance races, and incomplete failure reporting.

cc Aryan Singh K. (@aryansk) -- a fresh advisory pass is ready for your review.

The specialists converge without substantive concerns. The exact head routes Copilot hooks correctly, centralizes cleanup provenance in DeploymentLedgerCodec, preserves late user replacements, and makes incomplete cleanup actionable and scriptable.

Evidence is strong: 165 focused/component tests and the installed-CLI E2E pass, the full lint and architecture gates pass, and targeted mutations for outcome propagation, scan placement, and owner routing were killed.

Aligned with: Secure by default through canonical provenance and fail-closed cleanup; pragmatic as npm through predictable lifecycle behavior and actionable failures; OSS community driven through a contributor-authored reliability fix.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Canonical ownership and cleanup boundaries are sound.
CLI Logging Expert 0 0 0 Diagnostics are actionable and raw exception details remain verbose-only.
DevX UX Expert 0 0 0 Partial cleanup is clear, rooted, and exits nonzero.
Supply Chain Security Expert 0 0 0 Hash-backed regular and symlink replacements are preserved.
OSS Growth Hacker 0 0 0 The change reinforces trust in package-manager lifecycle behavior.
Doc Writer 0 0 0 CLI reference and guide accurately describe recovery behavior.
Test Coverage Expert 0 0 0 Critical routing, provenance, failure, and installed-CLI paths are covered.
Performance Expert 0 0 0 No material performance regression.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Architecture

classDiagram
    class DeploymentLedgerCodec {
      +cleanup_snapshot()
    }
    class DeploymentCleanupSnapshot
    class BaseIntegrator {
      +validate_deploy_path()
    }
    class HookIntegrator {
      +sync_integration()
    }
    class IntegrationCleanupOutcome
    DeploymentLedgerCodec --> DeploymentCleanupSnapshot
    BaseIntegrator <|-- HookIntegrator
    HookIntegrator --> IntegrationCleanupOutcome
Loading
flowchart TD
    A[Uninstall request] --> B[Canonical cleanup snapshot]
    B --> C[Longest-prefix hook routing]
    C --> D[Containment and provenance checks]
    D -->|Safe| E[Remove managed hook]
    D -->|Changed or unsafe| F[Preserve path and explain recovery]
    E --> G[Complete outcome]
    F --> H[Incomplete outcome and exit 1]
Loading

Recommendation

Ship at exact head 2f44e428eca9e8f7c63991c4cd41bee40a3fa5c2; all active specialists are clear.


Full per-persona findings

Python Architect

  • [nit] No additional abstraction is warranted. The typed snapshots and outcomes keep ownership explicit without adding parallel cleanup authority.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

No authentication or credential-resolution surface changed.

Doc Writer

No findings.

Test Coverage Expert

No findings.

Performance Expert

No findings.

This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.

Shepherd convergence update

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#2559 5769795 ship_now 1 1 0 1 green MERGEABLE BLOCKED pending maintainer review

Ready for maintainer review.

Daniel Meppiel (danielmeppiel) added a commit to aryansk/apm that referenced this pull request Sep 3, 2026
Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR microsoft#2559.

Co-authored-by: Copilot <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) marked this pull request as ready for review September 3, 2026 10:32
Copilot AI lite review requested due to automatic review settings September 3, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Uninstall can log “Integration cleanup did not finish” on manifest parse failure but still report “Uninstall complete” and exit 0 due to returning (default_outcome, None).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes a user-scope uninstall bug where Copilot hook files under ~/.copilot/hooks/ were incorrectly routed to the instructions bucket (and therefore never deleted), and hardens hook cleanup to avoid following symlink redirects outside the intended deploy root.

Changes:

  • Register cross-target hooks/skills prefixes in BaseIntegrator.partition_managed_files()’s trie so longest-prefix match routes .copilot/hooks/ correctly at user scope.
  • Route hook deletion through the shared remove_stale_deployed_files() safety gates (containment + provenance), surface preserved/failed hook paths, and exit nonzero on incomplete managed-hook cleanup.
  • Add focused unit/component/integration coverage plus docs + changelog updates describing the new uninstall behavior.
File summaries
File Description
tests/unit/test_surviving_deps_reintegration.py Asserts uninstall emits actionable warnings when managed hook containment fails.
tests/unit/integration/test_hook_integrator.py Updates target mocks to include prefix/user_root_resolver required by new cleanup logic.
tests/unit/integration/test_deployed_files_manifest.py Adds hook cleanup failure + symlink containment regression tests (including absolute-root scenarios).
tests/unit/integration/test_data_driven_dispatch.py Regression test ensuring user-scope Copilot hooks route to the hooks bucket (not swallowed by .copilot/).
tests/unit/commands/test_uninstall_atomic_selection.py Verifies uninstall exits nonzero and suppresses “Uninstall complete” when hook cleanup is incomplete.
tests/integration/test_uninstall_hook_cleanup_failure.py New component contract tests for hook unlink failure, provenance races, and exception-to-nonzero behavior.
tests/integration/test_hook_js_sidecar_lifecycle_contract.py Extends e2e lifecycle to assert global Copilot hook paths are bucketed/cleaned correctly.
src/apm_cli/integration/hook_integrator.py Uses remove_stale_deployed_files() for manifest-based hook cleanup; reports failed/unsafe paths.
src/apm_cli/integration/cleanup.py Adds allow_final_symlink support to enable safe “unlink the link itself” semantics.
src/apm_cli/integration/base_integrator.py Hardens deploy-path validation with symlink-component checks and registers hooks/skills prefixes in the trie.
src/apm_cli/core/deployment_ledger.py Introduces cleanup_snapshot() to prefer canonical ledger hashes over legacy views for cleanup provenance.
src/apm_cli/commands/uninstall/engine.py Introduces IntegrationCleanupOutcome and surfaces preserved hook paths in uninstall flow.
src/apm_cli/commands/uninstall/cli.py Uses cleanup snapshots for pre-mutation state and centralizes final summary/exit-code reporting.
scripts/architecture_linter/checks/install_base_integrator_and_contraction.py Enforces routing uninstall through the canonical cleanup_snapshot() owner.
packages/apm-guide/.apm/skills/apm-usage/commands.md Documents new uninstall nonzero behavior when managed hook cleanup is incomplete.
docs/src/content/docs/reference/cli/uninstall.md Documents preserved-hook behavior and guidance when containment/provenance gates trigger.
CHANGELOG.md Adds Unreleased “Fixed” entry for apm uninstall --global Copilot hook cleanup (#2558).
Review details
  • Files reviewed: 17/17 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +83 to +89
except Exception as manifest_err:
logger.warning("Integration cleanup did not finish.")
logger.warning("Run 'apm install' to resync remaining integrations.")
logger.verbose_detail(
f"Integration cleanup skipped: {type(manifest_err).__name__}: {manifest_err}"
)
return default_outcome, None
Comment on lines +1061 to +1064
@property
def complete(self) -> bool:
"""Return whether every integration cleanup operation succeeded."""
return self.error_count == 0
Daniel Meppiel (danielmeppiel) added a commit to aryansk/apm that referenced this pull request Sep 3, 2026
Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR microsoft#2559.

Co-authored-by: Copilot <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the codex/issue-2558-copilot-hook-orphan branch from 5769795 to bf82dc9 Compare September 3, 2026 14:42
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Rebased PR head 57697956a7908f03d563288aaf10fbd5084fd350 onto current main c919ba3a100caf6e7810ffc9315082bec383cf1f -> bf82dc94793ff21248e86c2b7564139c6d96967d.

No conflicting paths were reported by git rebase origin/main; the rebase completed cleanly.

Lint contract: uv run --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ and uv run --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ both exited 0 with no diagnostics post-rebase.

Post-push mergeability: gh pr view --json mergeStateStatus,mergeable reports BLOCKED / MERGEABLE. The blocker is fork workflow action_required, not a merge conflict; pending run IDs: 33768438217, 33768437485, 33768437439, 33768437642, 33768437800, 33768437782. Push used git push --force-with-lease=codex/issue-2558-copilot-hook-orphan:57697956a7908f03d563288aaf10fbd5084fd350 pr-aryansk-apm HEAD:codex/issue-2558-copilot-hook-orphan (--force-with-lease, never bare --force).

Ready for maintainer workflow approval and review.

Daniel Meppiel (danielmeppiel) added a commit to aryansk/apm that referenced this pull request Sep 3, 2026
Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR microsoft#2559.

Co-authored-by: Copilot <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the codex/issue-2558-copilot-hook-orphan branch from bf82dc9 to 2ce2169 Compare September 3, 2026 20:46
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Rebased PR head bf82dc94793ff21248e86c2b7564139c6d96967d onto current main 30e69bfec659c311fbae24b4ad5399f1f5fb8c9a -> 2ce216963fab624642908f5930cd4c7ca07d7ea9.

Conflicting paths resolved (faithful merge of both intents):

  • src/apm_cli/commands/uninstall/cli.py

Lint contract: uv run --frozen --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ and uv run --frozen --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ both exited 0 with no diagnostics post-rebase; the full lint mirror, auth-signal lint, and architecture boundary lint exited 0.

Post-push mergeability: gh pr view --json mergeStateStatus,mergeable reports BLOCKED / MERGEABLE. This is blocked by required review and fork workflow approval, not by conflicts. Action-required workflow run IDs: 33804214887, 33804214891, 33804214919, 33804214944, 33804214924, 33804214881. Push used git push --force-with-lease=codex/issue-2558-copilot-hook-orphan:bf82dc94793ff21248e86c2b7564139c6d96967d pr-aryansk-apm HEAD:codex/issue-2558-copilot-hook-orphan (--force-with-lease, never bare --force).

Ready for maintainer workflow approval and review.

@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the codex/issue-2558-copilot-hook-orphan branch from 2ce2169 to 0284ef2 Compare September 3, 2026 21:27
Daniel Meppiel (danielmeppiel) added a commit to aryansk/apm that referenced this pull request Sep 3, 2026
Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR microsoft#2559.

Co-authored-by: Copilot <[email protected]>
At user scope the Copilot instructions primitive maps to an empty
subdir, so its deploy root ``.copilot/`` becomes a shallow catch-all
trie node. Hook paths under ``.copilot/hooks/`` matched that node first
and were routed to the instructions bucket, so uninstall never saw them
as managed files and the deployed hook files were left behind.

Register the cross-target hooks/skills prefixes in the routing trie so
the deeper ``.copilot/hooks/`` prefix wins by longest-prefix match.

Closes microsoft#2558
Validate manifest-owned hook paths before removal, cover the installed CLI lifecycle, and document the contributor fix.

Co-authored-by: Copilot <[email protected]>
Validate parent containment while allowing the final managed symlink itself to be unlinked safely.

Co-authored-by: Copilot <[email protected]>
Treat a final managed symlink as an unlinkable hook artifact while continuing to reject symlinked parent escapes.

Co-authored-by: Copilot <[email protected]>
Support final symlinks under absolute managed roots and warn when containment validation preserves a suspicious hook path.

Co-authored-by: Copilot <[email protected]>
Reject symlinked parent components even when they resolve elsewhere under the user deployment root.

Co-authored-by: Copilot <[email protected]>
Delegate symlink-component checks to the canonical path security helper for relative and absolute managed roots.

Co-authored-by: Copilot <[email protected]>
Point users to verbose path details and require symlink inspection before manual cleanup.

Co-authored-by: Copilot <[email protected]>
Report preserved paths during the original uninstall because package state is gone before a retry can expose verbose details.

Co-authored-by: Copilot <[email protected]>
Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR microsoft#2559.

Co-authored-by: Copilot <[email protected]>
Preserve the large anchor-free load regression while avoiding a high-node-count document that times out under coverage on CI.

Co-authored-by: Copilot <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the codex/issue-2558-copilot-hook-orphan branch from 0284ef2 to bf86229 Compare September 3, 2026 23:16
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Rebased PR head 0284ef21397a12a671dc11131f6553acf915fe6e onto current main 1560d88e3c7862df3f36df69b02bd8dae09ab765 -> bf86229a3c6f76e917f178a8e19ae994536db1a5.

Conflicting paths resolved (faithful merge of both intents):

  • src/apm_cli/integration/base_integrator.py
  • src/apm_cli/commands/uninstall/cli.py

Lint contract: uv run --frozen --extra dev ruff check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ and uv run --frozen --extra dev ruff format --check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ both exited 0 post-rebase; the full lint mirror, auth-signal lint, and architecture boundary lint exited 0. Targeted regression tests also passed: uv run --frozen --extra dev pytest -q tests/unit/commands/test_uninstall_atomic_selection.py tests/unit/integration/test_deployed_files_manifest.py tests/unit/integration/test_hook_integrator.py tests/integration/test_uninstall_hook_cleanup_failure.py tests/red_team/parser/test_yaml_bomb.py.

Post-push mergeability: gh pr view --json mergeStateStatus,mergeable reports BLOCKED / MERGEABLE. This is blocked by required review and fork workflow approval, not by conflicts. Action-required workflow run IDs: 33816856766, 33816856756, 33816856750, 33816856765, 33816856739, 33816856806. Push used git push --force-with-lease=codex/issue-2558-copilot-hook-orphan:0284ef21397a12a671dc11131f6553acf915fe6e pr-aryansk-apm HEAD:codex/issue-2558-copilot-hook-orphan (--force-with-lease, never bare --force).

Ready for maintainer workflow approval and review.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 68ade85 into microsoft:main Sep 3, 2026
18 checks passed
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Sep 7, 2026
…updates (#2785)

* fix: isolate dependency git repository state

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

* test: patch checkout at consumer boundary

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

* test: align git isolation contracts with CI

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

* perf: bound git isolation architecture scan

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

* fix: complete Git child environment isolation

Close the generic-host sparse checkout bypass, preserve actionable Git diagnostics, restore traversal errors, and add real install plus static regression evidence. Addresses the review-panel and Copilot findings for #2759.

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

* fix: isolate full clone fallback Git state

Replace the GitPython clone boundary with a sanitized subprocess adapter, extend generic-host and diagnostic evidence, and synchronize install documentation. Addresses the second review-panel pass for #2759.

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

* test: retain injected clone test seam

Keep the legacy Repo double path isolated to tests while production clones use the sanitized subprocess adapter.

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

* fix: preserve clone config while isolating repo state

Carry process-scoped Git configuration into the complete child environment, strip repository-locating state, and keep SSH key paths out of diagnostics. Recovers final-head CI for #2759.

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

* fix: retain safe clone config without ambient auth

Carry only explicit config selection and URL rewrites into clone subprocesses, keep resolved auth environments authoritative, and consolidate install documentation links. Addresses the terminal review findings for #2759.

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

* test: preserve platform PATH in clone auth guard

Keep the resolved child PATH valid under the Windows compatibility gate while still proving ambient credentials stay excluded.

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

* test: isolate clone auth guard from host Git lookup

Mock executable resolution so the Windows compatibility test exercises only the child environment contract under its deliberately cleared parent environment.

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

* fix: validate clone rewrites and stream progress

Reject credential-bearing and HTTPS-downgrade rewrites before clone, retain live Git progress reporting, and prove both guards by mutation. Addresses the fourth panel pass for #2759.

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

* fix: centralize Git URL rewrite safety

Validate every effective URL rewrite in the final child environment so inherited, appended, and supplied indexed entries cannot bypass credential or HTTPS downgrade checks. Route AuthResolver and clone execution through the Git environment owner and extend its static guard. Addresses the terminal panel follow-ups for #2759.

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

* fix: enforce Git rewrite safety at execution

Route every dependency network Git boundary through the canonical environment owner, keep managed credentials out of remote URLs, preserve safe rewrites exactly once, and add behavioral plus architecture mutation guardrails. This completes the blocking panel follow-ups for #2759.

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

* test: guard Git rewrite validation routing

Register an explicit architecture mutation that fails when the canonical network environment bypasses URL rewrite validation, completing the behavioral and static halves of the split-authority repair.

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

* test: align legacy Git transport assertions

Make the legacy downloader coverage opt into protocol fallback explicitly and assert that managed ADO credentials remain in AuthResolver rather than URL userinfo. This keeps the broader transport suite aligned with the centralized execution contract.

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

* fix: reuse validated Git rewrite snapshot

Carry the exact rewrite set validated at the network boundary into credential cleanup instead of reading mutable Git configuration a second time. This closes a time-of-check/time-of-use gap while preserving safe parameter-based rewrites.

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

* fix: bind Git execution to validated policy

Freeze effective non-local Git configuration at each network boundary, revalidate remote-activated includes, keep fallback fetches on one explicit remote, force trace redaction, and route credential formatting through AuthResolver and the canonical Git environment owner. Fold the complete review-panel security, UX, performance, documentation, and test follow-ups for #2759.

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

* fix: close Git transport policy gaps

Honor Git-native header specificity, preserve semver auth fallback, suppress clone templates, redact sparse transport diagnostics, and deduplicate rewritten fallback attempts. Addresses the second advisory panel follow-ups.

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

* fix: close final Git transport gaps

Reject cross-host rewrites, freeze effective Git config scopes, keep native retries credential-free, and build semver environments once per shared resolver context.

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

* docs: clarify Git rewrite recovery

Document longest-match validation, saved transport preferences, and file mirror recovery in the docs and bundled APM guide.

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

* chore(deps): bump the github-actions group across 1 directory with 6 updates

Bumps the github-actions group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [github/gh-aw-actions/setup](https://github.com/github/gh-aw-actions) | `0.87.1` | `0.87.7` |
| [github/gh-aw-actions/setup-cli](https://github.com/github/gh-aw-actions) | `0.87.1` | `0.87.7` |
| [azure/login](https://github.com/azure/login) | `3.0.1` | `3.0.2` |
| [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.7` | `4.37.9` |
| [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.7` | `4.37.9` |
| [actions/create-github-app-token](https://github.com/actions/create-github-app-token) | `3.1.1` | `3.2.0` |



Updates `github/gh-aw-actions/setup` from 0.87.1 to 0.87.7
- [Release notes](https://github.com/github/gh-aw-actions/releases)
- [Changelog](https://github.com/github/gh-aw-actions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/gh-aw-actions/compare/v0.87.1...1aa033c7bf25ac9428fe521065b90c30a7070c4e)

Updates `github/gh-aw-actions/setup-cli` from 0.87.1 to 0.87.7
- [Release notes](https://github.com/github/gh-aw-actions/releases)
- [Changelog](https://github.com/github/gh-aw-actions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/gh-aw-actions/compare/423b3dc04bbf1b1797194a4a75aa5cf5d0d4f5b3...1aa033c7bf25ac9428fe521065b90c30a7070c4e)

Updates `azure/login` from 3.0.1 to 3.0.2
- [Release notes](https://github.com/azure/login/releases)
- [Commits](https://github.com/azure/login/compare/f5d393ae46f8fde4be8b75f32e3fc50e654ad0ca...7ddb5af1ef8758cf1353cf3b42f940aee27ba21c)

Updates `github/codeql-action/init` from 4.37.7 to 4.37.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...cdf488f595d80d6e07e03d4674febd5ab45fa938)

Updates `github/codeql-action/analyze` from 4.37.7 to 4.37.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd...cdf488f595d80d6e07e03d4674febd5ab45fa938)

Updates `actions/create-github-app-token` from 3.1.1 to 3.2.0
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/create-github-app-token/compare/v3.1.1...bcd2ba49218906704ab6c1aa796996da409d3eb1)

---
updated-dependencies:
- dependency-name: github/gh-aw-actions/setup
  dependency-version: 0.87.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/gh-aw-actions/setup-cli
  dependency-version: 0.87.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: azure/login
  dependency-version: 3.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/init
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.37.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/create-github-app-token
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump pip from 26.1.2 to 26.2 (#2755)

Bumps [pip](https://github.com/pypa/pip) from 26.1.2 to 26.2.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/compare/26.1.2...26.2)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: '26.2'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump browserslist (#2756)

Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.28.2 to 4.28.8.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.28.2...4.28.8)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-version: 4.28.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs(changelog): collapse duplicate 0.29.0 blocks and restore released history (#2786)

* docs(changelog): collapse duplicate 0.29.0 blocks and restore released history

Three '## [0.29.0]' headings had accumulated on main, and two post-tag
entries had been injected into the released 0.28.0 block. Post-release
PR branches carried a pre-release changelog shape, so merges resurrected
already-shipped entries under stale headings and duplicated several
in-flight entries verbatim.

Restore the 0.29.0 and 0.28.0 sections byte-for-byte from the v0.29.0
tag (released history is immutable), and rebuild [Unreleased] from what
each post-tag PR actually contributed, deduplicated. Verified: every
heading is unique, the 0.29.0-and-older history matches the tag exactly,
and all 27 post-tag PR entries are present exactly once.

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

* docs(changelog): cite merge PRs for entries that referenced only their issue

#2693 landed the #2524 pack-metadata fix and #2760 landed @donglrd's
#2466 SSH-URL fix; both entries cited only the issue or the superseded
PR, leaving the merged PR untraceable from the changelog.

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

---------

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

* fix(install): upgrade legacy plugin skill receipts

Regenerate parser-owned skill metadata for hash-verified 0.28-era marketplace plugin caches before integration, and cover the real CLI lifecycle through lock reconciliation and convergence.

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

* docs(changelog): record legacy plugin repair

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

* chore(changelog): preserve latest unreleased layout

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

* fix: harden Git auth and diagnostics

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

* docs: clarify scoped Git authentication

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

* fix: fence helper-only Git environments

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

* fix: make Claude project LSPs discoverable (closes #2547) (#2733)

* fix: make Claude project LSPs discoverable

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

* fix: harden Claude LSP plugin lifecycle

Fold the review-panel follow-ups by binding executable consent to declaring packages, routing writes through canonical path security, refusing unowned collisions, preserving the reserved plugin during skill cleanup, and documenting migration behavior.

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

* fix: preserve LSP cleanup diagnostics

Keep ownership failures actionable during stale cleanup and direct unlocked-package users toward regenerating verifiable lock state.

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

* fix: preserve LSP trust across lifecycle paths

Resolve the CI regressions by deriving effective trust only when transitive LSP declarations exist, keeping update paths free of unrelated runtime discovery, and updating structural contracts for the new owner guards.

apm-spec-waiver: This PR repairs Claude adapter discovery and internal trust enforcement without changing the OpenAPM manifest contract.

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

* fix: close final Claude LSP trust gaps

Bind approval exclusively to lock-derived package identity, reject unowned JSON shapes, preserve resolved-disabled trust state, propagate local-bundle force, and align operator guidance and executable-trust docs.

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

* test: guard local-bundle LSP force forwarding

Lock the reviewed collision override through both the bundle adapter and the canonical LSP owner rule.

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

* fix: finish LSP trust convergence

Fold the terminal panel findings by routing bundle trust through the effective policy owner, covering LSP in deny and governance UX, making forced ownership transitions durable, and adding functional identity and recovery tests.

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

* fix: keep install command within architecture budget

Move bundle trust resolution into the local-bundle adapter while preserving native-boundary ordering and the executable-trust owner guard.

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

* fix: reconcile LSP lifecycle ownership

Persist target-scoped ownership so install filters, target changes, local-bundle denial, and uninstall revoke only proven APM-managed LSP entries. This addresses the current-head panel lifecycle and containment follow-ups.

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

* perf: index local approval ancestry

Resolve installed local package directories with one shared parent index and memoized ancestry so approval discovery stays linear instead of rescanning the lock graph. This addresses the performance panel follow-up.

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

* docs: align LSP trust diagnostics

Name every filtered server, pluralize recovery guidance, and make both executable-trust inventories describe the opt-in five-type gate. This addresses the logging and documentation panel follow-ups.

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

* fix: skip empty LSP reconciliation

Avoid target resolution and lockfile writes when uninstall or install has no LSP state. This recovers the CI uninstall and no-write determinism regressions without weakening owned LSP cleanup.

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

* fix: finish LSP lifecycle convergence

Fold the terminal panel guidance: document provenance and uninstall semantics, make recovery commands scope-correct, clarify ownership conflicts, and keep repeated local dependency resolution indexed. Add command-level cleanup failure coverage.

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

* fix: keep drift replay within module budget

Move inline diff hint rendering to the drift renderer while preserving the existing drift-module re-export contract.

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

* fix: close final LSP review gaps

Keep offline bundle installs cache-only, surface corrupt local ancestry, and make LSP recovery guidance actionable. Addresses the final review-panel follow-ups for PR #2733.

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

* chore: keep install command within lint budget

Remove redundant separators so the merge-head module remains within the 2100-line CI guardrail.

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

* fix: harden local LSP bundle integration

Bind local executable consent to bundle content and close the remaining security, cleanup, alias, performance, logging, test, and documentation gaps identified by the final review panel.

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

* fix: close final bundle trust gaps

Preflight multi-target LSP writes and bind every local executable type to an exact bundle digest. This addresses the final panel's correctness, security, test, logging, performance, and documentation follow-ups.

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

* fix: close final LSP trust review gaps

Keep digest approvals exact, reject symlinked package manifests, stream bundle hashing, and split the LSP target and lifecycle owners. Also makes canvas remediation copyable and aligns the LSP guide. Addresses final panel follow-ups.

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

* fix: finish LSP ownership follow-ups

Tighten LSP lifecycle ownership after the panel review by splitting target-adapter wording from lifecycle orchestration, guarding direct lifecycle calls, preventing bundle owner aliases from impersonating reserved owners, and surfacing Claude cleanup activation guidance.

Addresses APM review panel follow-ups for PR #2733.

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

* fix: reject symlinked bundle LSP metadata

Fold the supply-chain panel finding by refusing to parse a symlinked com.microsoft.apm metadata directory for no-lockfile local bundles. The regression proves the old path could write an LSP config from outside the bundle.

Addresses Supply Chain Security follow-up from the APM review panel.

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

* docs: finish local bundle trust guidance

Fold the docs and DevX panel findings by documenting exact local-bundle approval keys for MCP, LSP, and canvas, removing a stale --quiet hint, and correcting user-scope approval authority wording.

Addresses APM review panel documentation follow-ups for PR #2733.

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

* fix: close local bundle LSP review gaps

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

* fix: honor source policy for bundle roots

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

* fix: preflight bundle LSP target support

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

* fix: resolve post-rebase validation

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

* fix: keep CLI files under lint budget

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

* fix: use Claude personal skills plugin for LSP

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

* test: cover Claude LSP project cleanup lifecycle

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

---------

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

* fix(mcp): resolve dependencies.mcp against the configured registry (closes #2740) (#2745)

* fix(mcp): resolve dependencies.mcp against the configured registry (closes #2740)

`apm config set mcp-registry-url` is documented as "equivalent to exporting
MCP_REGISTRY_URL permanently", and the four-layer chain is documented for
`list`, `search`, `show`, and `install`. Only three of those honoured it: the
`apm mcp` commands and `apm install --mcp NAME` each re-implemented the chain
at the CLI boundary, while `SimpleRegistryClient` -- what the manifest-driven
`dependencies.mcp` path actually builds -- resolved `arg or MCP_REGISTRY_URL or
default` and never saw the persisted layer. A server `apm mcp show` found on a
private registry was therefore looked up on the public default during
`apm install` and reported as missing.

Fixed at the layer every consumer shares rather than by adding a fourth
re-implementation: `registry.client.resolve_mcp_registry_url()` now owns the
precedence chain (explicit > env > apm config > default) and returns the layer
that supplied the URL. `SimpleRegistryClient` resolves through it and records
`registry_url_source`; the two CLI-boundary resolvers delegate to it and keep
only their diagnostics.

Consequences of routing every consumer through one chain:

- A configured registry now counts as a deliberate override, so an unreachable
  one fails closed in `validate_servers_exist` instead of assuming the servers
  are valid.
- Rejection messages name the layer that supplied the URL instead of always
  pointing at `MCP_REGISTRY_URL`.
- A URL persisted with `apm config set` no longer needs `MCP_REGISTRY_ALLOW_HTTP`
  to use `http://`, matching `--registry` and the `apm config set` validator
  that already accepts it. The opt-in still gates the ambient env layer and
  caller-supplied URLs, which include the `registry:` field of an untrusted
  cloned apm.yml.
- `get_mcp_registry_url()` reads without materialising `~/.apm/config.json`,
  since resolution now runs on preview-only paths too.
- `apm install` names a non-default endpoint once before the lookup, and a
  missing server reports the registry it was looked up in.

apm-spec-waiver: collapses three copies of an already-documented CLI precedence chain into one; MCP registry endpoint selection carries no v0.1 normative surface (Registry class reserved for v0.2 per sec.11.3.3)

* fix(mcp): let the client resolve the registry URL so the layer survives

Review follow-up. `_build_registry_with_diag` pre-resolved the URL and passed
it into `RegistryIntegration`, but a caller-supplied URL is by definition the
"explicit" layer, so `registry_url_source` came back as "explicit" for every
`apm mcp` invocation. Two user-visible consequences:

- the network-failure hint fell through to the generic "may be temporarily
  unavailable" line instead of naming the layer that supplied the URL -- the
  exact misdirection the hint was rewritten to avoid;
- `_is_custom_url` was True even on the public default registry.

The command now constructs the client with no URL and reads the endpoint and
its layer back off it, which is also less code. The diagnostic is driven by the
label table alone: a source with no label is the quiet case, so an unexpected
value can no longer raise from a logging path.

The architecture guard is inverted to match: it banned a bare
`RegistryIntegration()` back when the command owned the chain, which now
describes the defect rather than the invariant. It bans a pre-resolved URL
instead, and was verified to fire on the violating form and pass on the
correct one.

Also drops a duplicated endpoint line on `apm install --mcp NAME`: the command
layer announced the registry and then the integrator announced the same one.
`resolve_registry_url` grows an `announce` flag (default unchanged) so the
command layer emits the line only for dry runs, where no later phase does. The
local-host warning and the flag-versus-env notice still come from there,
because nothing downstream repeats them.

Changelog entry now carries its PR number per the repo convention.

* fix(mcp): fold registry review findings

Prevent registry diagnostics from exposing URL query credentials, make explicit and recovery output actionable, register the precedence owner with mutation-backed architecture enforcement, repair diagnostic tests, and align the reference docs. Addresses the APM review panel follow-ups for PR #2745.

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

* fix(ci): preserve install module budget

Keep the registry precedence explanation concise so the existing 2100-line architecture budget remains enforced after the review fold.

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

* test: freeze MCP registry owner rule

Include the new registry resolution boundary in the semantic rule inventory so the architecture contract cannot drift silently.

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

* fix(mcp): close registry diagnostic gaps

Redact every registry failure path, reject unsupported URL components, preserve source-aware recovery, canonicalize endpoint grouping, and align the CLI documentation with the shared precedence chain. Addresses final panel follow-ups.

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

* test: align registry recovery assertions

The shared recovery helper now names the explicit registry source rather than blaming MCP_REGISTRY_URL, so the duplicated compatibility suites assert the correct setting.

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

* fix(mcp): redact malformed registry URLs

Treat URLs without a valid authority as entirely unsafe to display so path-shaped credential text cannot escape through validation errors. Addresses terminal auth-panel follow-up.

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

* test: cover registry query rejection via CLI

Drive the unsupported query path through Click so the usage exit code and secret-free terminal diagnostic remain protected. Addresses terminal test-coverage follow-up.

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

* refactor(install): extract frozen install recovery tip

Move the frozen-install recovery copy into the install error module so the Click command remains under the legacy line budget after merging current main.

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

---------

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

* fix: prefer APM manifests over plugins (closes #2735) (#2776)

* fix: prefer eligible APM manifests over plugins

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

* fix: clarify manifest precedence coverage

Correct the cascade documentation and add consumer-path coverage for eligible manifests, addressing Copilot review findings and strengthening the precedence regression trap.

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

* fix: route plugin admission through format precedence

Make package validation and Agent Plugin ingress honor NormalizationPlanner, add behavioral and static regression guards, and document how dependencies affect intentional plugin selection. Addresses panel follow-ups on split authority, coverage, documentation, and release notes.

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

* refactor: register package format precedence owner

Record NormalizationPlanner as the canonical precedence owner and give its ingress delegation a dedicated mutation-tested architecture guard, addressing the final panel follow-up.

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

* test: align resolver fixture with manifest precedence

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

* test: freeze package precedence architecture rule

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

* test: cover hybrid apm lifecycle precedence

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

---------

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

* fix: include LSP dependencies in install dry-run (#2580)

* fix: include LSP dependencies in dry-run output

* test: cover LSP dry-run command path

Align empty-plan reporting with the selected install mode and add command-level coverage for LSP-only manifests. Addresses panel follow-ups on filtered output and forwarding regression coverage.

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

* refactor: centralize LSP dry-run count

Use the plan-owned count and stable MagicMock magic-method configuration. Addresses Copilot inline review on dry-run rendering tests.

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

* test: use concrete dry-run display dependencies

Replace MagicMock __str__ setup in the renderer tests with a tiny display dependency so assertions exercise the same string conversion path as the dry-run renderer. Addresses Copilot review feedback on the LSP dry-run tests.

apm-spec-waiver: Restores dry-run parity for the existing LSP dependency contract.

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

* fix: clarify LSP dry-run service wording

Use configure wording for LSP dry-run output and describe filtered empty plans in terms of the selected --only mode. This addresses the final CLI and DevX panel follow-ups while keeping --only=mcp aligned with the existing MCP/LSP service path.

apm-spec-waiver: Restores dry-run parity for the existing LSP dependency contract.

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

* fix: align dry-run service filtering

Keep prospective dry-run selection aligned with --only filters and executable trust filtering before rendering service work. Add regression coverage for LSP-only --only=apm, APM-only --only=mcp, and unapproved LSP dry-run output.

apm-spec-waiver: Restores dry-run parity for the existing LSP dependency contract.

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

* test: cover lsp dry-run lifecycle state

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

---------

Co-authored-by: pr-relay <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Copilot <[email protected]>

* fix(integration): route user-scope Copilot hooks to the hooks bucket (#2559)

* fix(integration): route user-scope Copilot hooks to the hooks bucket

At user scope the Copilot instructions primitive maps to an empty
subdir, so its deploy root ``.copilot/`` becomes a shallow catch-all
trie node. Hook paths under ``.copilot/hooks/`` matched that node first
and were routed to the instructions bucket, so uninstall never saw them
as managed files and the deployed hook files were left behind.

Register the cross-target hooks/skills prefixes in the routing trie so
the deeper ``.copilot/hooks/`` prefix wins by longest-prefix match.

Closes #2558

* fix(integration): harden managed hook cleanup

Validate manifest-owned hook paths before removal, cover the installed CLI lifecycle, and document the contributor fix.

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

* fix(integration): preserve managed hook symlink cleanup

Validate parent containment while allowing the final managed symlink itself to be unlinked safely.

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

* fix(integration): remove dangling managed hook links

Treat a final managed symlink as an unlinkable hook artifact while continuing to reject symlinked parent escapes.

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

* fix(uninstall): report unsafe managed hook paths

Support final symlinks under absolute managed roots and warn when containment validation preserves a suspicious hook path.

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

* fix(integration): reject in-root hook redirects

Reject symlinked parent components even when they resolve elsewhere under the user deployment root.

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

* fix(integration): reject absolute hook redirects

Delegate symlink-component checks to the canonical path security helper for relative and absolute managed roots.

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

* fix(uninstall): clarify unsafe hook recovery

Point users to verbose path details and require symlink inspection before manual cleanup.

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

* fix(uninstall): show preserved unsafe hook paths

Report preserved paths during the original uninstall because package state is gone before a retry can expose verbose details.

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

* docs(uninstall): explain symlink containment warnings

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

* fix(uninstall): report incomplete hook cleanup

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

* fix(uninstall): propagate hook cleanup failures

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

* test(uninstall): cover cleanup failure propagation

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

* fix(uninstall): recheck hook provenance before deletion

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

* fix(uninstall): centralize hook cleanup provenance

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

* fix(uninstall): preserve replacement hook symlinks

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

* fix(uninstall): restore nonfatal cleanup compatibility

Treat legacy manifest parse failures and generic MCP cleanup warnings as nonfatal while preserving nonzero outcomes for managed hook cleanup failures and unexpected integration sync errors. Also keep the scoped hook cleanup test target mock aligned with TargetProfile metadata.

Addresses CI failures in Lint and Linux test shards for PR #2559.

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

* test(parser): keep anchor-free YAML guard fast

Preserve the large anchor-free load regression while avoiding a high-node-count document that times out under coverage on CI.

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

---------

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

* fix: avoid attributing shared .agents paths (closes #2743) (#2774)

* fix: avoid attributing shared agents paths

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

* docs: record legacy ledger attribution fix

Document the user-visible upgrade fix requested by the review panel.

Addresses panel follow-up from oss-growth-hacker.

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

* test: cover persisted legacy agents attribution

Exercise the deployment ledger through a serialized legacy lockfile so the shared-root fallback is protected at the consumer boundary.

Addresses test-coverage panel follow-up.

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

---------

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

* fix: close final Git auth transport gaps

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

* docs: align Git transport security guidance

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

* fix: retain ADO caller Git policy

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

* fix: protect catalog root context files (#2790)

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

* fix: retarget packed prompts for Copilot (closes #2763) (#2778)

* fix: retarget packed prompts for Copilot

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

* test: register command prompt architecture guard

Keep the frozen architecture rule inventory aligned with the new command-to-prompt normalization guard so the CI regression tripwire recognizes the deliberate owner addition.

Addresses CI failure in Build & Test Shard 2.

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

* test: cover packed prompt retargeting end to end

Add an integration-level install regression and document the user-visible fix so the packed Claude-to-Copilot mapping is both discoverable and guarded through the real CLI path.

Addresses review panel follow-ups for changelog coverage and integration evidence.

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

* fix: lower packed plugin paths by target primitives

apm-spec-waiver: local bundle path lowering reuses existing target primitive metadata and does not change the OpenAPM package contract.

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

---------

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

* fix: harden global lifecycle state handling (#2655)

* fix: harden global agent lifecycle

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* fix: address lifecycle review findings

* fix: fold lifecycle hardening review findings

Scope MCP cleanup by runtime, audit bounded external roots, and serialize remaining lifecycle mutators. Add dual-guardrail architecture evidence and regression coverage.

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

* refactor: extract install context finalization

Keep the install command under its enforced module-size budget while preserving transaction cleanup when root restoration fails.

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

* test: align CI contracts with lifecycle coverage

Freeze the new architecture rule, preserve platform-visible modes on Windows, and keep the expanded Windows family explicitly bounded.

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

* fix: fold terminal lifecycle review findings

Reject symlinked MCP configs, route prune cleanup to project scope, report lock contention, bound external scans, and align Hermes guidance and help.

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

* fix: fold final lifecycle and audit findings

Serialize watch startup, decode target-native audit claims, preserve partial MCP ownership, and harden cleanup/docs per the terminal review findings.

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

* test: align global MCP help contract

Update the exact help assertion for the Hermes runtime added by the final review fold and exposed by CI shard 1.

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

* fix: close terminal lifecycle review gaps

Serialize remaining state writers, reject symlinked lifecycle locks, add cross-process regression coverage, and correct the converged user guidance.

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

* test: stabilize lifecycle lock startup wait

Allow slow-starting audit and lifecycle contender commands to prove they remain blocked by the lifecycle lock instead of failing on CLI startup latency.

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

* fix: fold lifecycle audit panel followups

Fail closed when governed external target files become unsafe symlinks, avoid lifecycle-lock contention for read-only cleanup previews, and align Hermes documentation with HERMES_HOME.

Addresses apm-review-panel follow-ups from supply-chain-security, performance-expert, doc-writer, and oss-growth-hacker.

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

* fix: fold final review followups

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

* fix: restore audit symlink compatibility

Co-authored-by: lkshrk <[email protected]>

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

* fix: preserve lifecycle LOC budget exception

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

* chore: restore spec conformance waiver context

apm-spec-waiver: Corrects existing adapter ownership behavior without changing the OpenAPM contract.

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

* test: align MCP cleanup failure aggregation

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

* style: format compile conflict resolution

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

* Fix CI drift after main merge

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

* Add lifecycle coverage for global audit invariants

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

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: lkshrk <[email protected]>

* test: prove ADO caller Git policy survives

Add a real Git component regression covering tokenless Azure DevOps clone and ref resolution with a caller-only rewrite and an ambient credential-helper trap. Keep mirror diagnostics stable across terminal widths and correct the documented port-aware auth scope.

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* test: reconcile architecture mutation matrix

Preserve the lifecycle-serialization mutation introduced on main and sort the concurrently added bundle-layout case after merging the long-lived Git isolation branch.

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* fix: close git isolation CI regressions

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* fix: keep global install dry-run out of user state (#2592)

* fix: keep global install dry-run out of user state

* fix: keep global dry-run fully read-only

Fold review follow-ups for #2549 by keeping config reads non-mutating during global dry-run previews, cleaning default preview config state, correcting dry-run target wording, and documenting the global bootstrap exception.

Co-authored-by: aryansk <[email protected]>

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

* fix: keep registry preview reads non-mutating

Co-authored-by: aryansk <[email protected]>

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

* fix: avoid target-gate config writes in dry-run

Co-authored-by: aryansk <[email protected]>

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

* fix: clarify global dry-run scope output

Co-authored-by: aryansk <[email protected]>

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

* test: accept dry-run registry read mode

Co-authored-by: aryansk <[email protected]>

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

* refactor: keep install command under lint cap

Co-authored-by: aryansk <[email protected]>

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

* test: align dry-run config plumbing tests

Co-authored-by: aryansk <[email protected]>

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

* fix: keep local bundle dry-run read-only

Co-authored-by: aryansk <[email protected]>

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

* fix: preserve bundle consent under root redirect

Co-authored-by: aryansk <[email protected]>

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

* fix: honor canonical bundle executable consent

Co-authored-by: aryansk <[email protected]>

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

* fix: keep dry-run executable consent reads pure

apm-spec-waiver: bug fix restores dry-run read-only behavior without extending OpenAPM spec semantics.

Co-authored-by: aryansk <[email protected]>

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

---------

Co-authored-by: pr-relay <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Copilot <[email protected]>

* fix: gate inactive experimental target resolvers (#2791)

apm-spec-waiver: Bug fix only; prevents inactive experimental resolver execution, no OpenAPM contract added.

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

* refactor: isolate legacy plugin cache upgrade

Keep the receipt-less 0.28 compatibility bridge within the install module line budget while preserving its actionable failure path.\n\napm-spec-waiver: Backward-compatibility repair for parser-owned cache metadata, not a new OpenAPM contract.\n\nCo-authored-by: Copilot App <[email protected]>

* ci: document spec waiver

apm-spec-waiver: Backward-compatibility repair for parser-owned cache metadata, not a new OpenAPM contract.

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

* fix(install): restrict legacy plugin upgrade

Gate receipt reconstruction on verified APM 0.28 marketplace-plugin lock state, exclude fresh materializations, and cover the real cached-source failure path.

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

Copilot-Session: 5a805f25-7edf-45a5-a26f-d57cef92162d

* fix: bind legacy plugin upgrade to trusted lock state

Require exact 0.28.0 marketplace provenance, verified cached bytes, and safe metadata paths before regenerating parser receipts. Treat pre-download materialization as fresh and prove failure paths through the real CLI lifecycle.

apm-spec-waiver: Backward-compatibility repair for parser-owned cache metadata, not a new OpenAPM contract.

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

* fix: centralize primitive classification (#2797)

apm-spec-waiver: Correction to existing Section 8.1 and req-pr-006 plugin collection contract; plugin.json/.claude-plugin layout already identifies Claude plugins.

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

* fix: keep install command outcomes truthful (#2799)

Route install, update, and lock success/exit behavior through InstallResult.disposition, validate selective skill paths by full path, and make audit detect stale skill subset paths.

apm-spec-waiver: bug fixes align existing install and audit behavior without introducing a new OpenAPM requirement.

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

* fix(install): harden legacy plugin restoration

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* test(install): keep lifecycle smoke within budget

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* test(install): move extended lifecycle cases to merge gate

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

Copilot-Session: f9e36b84-e7f4-4b6c-a900-792b39bbac3f

* ci: make daily release smoke actionable (#2805)

Add an advisory scheduled-run issue signal, keep dispatches artifact-only, and let daily validation continue on platforms with available build artifacts while preserving tag fail-fast release gates.

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

* fix: restore release-blocking regressions (#2804)

Keep the Windows-only red-main failures covered by portable regression tests, preserve hook cleanup symlink safety for absolute managed roots, and keep audit replay bound to the package type recorded at install time.

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

* fix(install): fail loudly on unknown package hosts (#2800)

* fix: fail loudly on unknown package hosts

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

* fix: preserve supported host virtual parsing contracts

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

* ci: keep lifecycle smoke inside hosted timeout

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

* refactor: centralize host reference parsing

Route host-qualified reference coordinate parsing through host_virtual.py and guard against ad-hoc host/repo/subpath derivations.

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

* fix: preserve artifactory and ado virtual shorthand

Keep host-qualified virtual shorthand narrowing on the canonical parser so Artifactory and legacy ADO virtual paths continue through the resolver, and freeze the new architecture rule ID in the runner contract.

apm-spec-waiver: implementation-internal parser unification; req-mf-007 already governs dependency grammar and req-mf-009 already requires non-default hosts retain their FQDN

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

* test: prove auth credential selection equivalence

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

* fix: route post-merge auth coordinates through owner

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

* refactor: keep install sources below loc budget

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

* fix: restore private helper names on install.sources

The source_helpers extraction renamed _format_package_type_label,
_rebuild_cached_semver_resolution and _record_declared_license to
public names, dropping them from the apm_cli.install.sources surface.
Six test modules import or monkeypatch the private names there, so
collection failed across both Linux shards and Lifecycle Smoke.

Re-export under the original private names and call them through the
sources module globals so monkeypatching keeps working.

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

---------

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

* fix(ci): restore red main build-release checks (#2807)

* fix: restore red main build-release checks

Retry bounded Git config probes on transient CI timeouts and make the Windows installer self-update launcher contract deterministic against pinned releases. The URL rewrite safety probe still fails closed after bounded retries.

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

* test(ci): align lifecycle-smoke ratchet with widened hosted timeout

The lifecycle-smoke job cap moved 5 -> 10 minutes in ci.yml after hosted
run 33910395389 canceled the job during post-step cleanup following a
fully successful pytest run (136 passed ... in 294.53s, canceled 0.8s
later). tests/quality/test_ci_topology.py holds the co-located ratchet
constant, which still asserted <= 5 and failed with 'assert 10 <= 5'.

The invariant is unchanged: the required lifecycle gate must keep a hard
cap so a regression toward slowness fails loudly. Only the numeric cap
moved, to the smallest value that stops canceling green runs while still
bounding an accidental network retry loop. Rationale recorded next to the
constant so the next reader sees why it is 10.

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

---------

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

* Apply remaining changes (#2808)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>

* Harden package and workflow trust boundaries (#2810)

* Harden package and workflow trust boundaries

Co-authored-by: danielmeppiel <[email protected]>

* Align release build and regression contracts

Co-authored-by: danielmeppiel <[email protected]>

* Clarify trusted CLI resolution coverage

Co-authored-by: danielmeppiel <[email protected]>

* Align symlink lifecycle expectation

Co-authored-by: danielmeppiel <[email protected]>

* Make git argv tests Windows-safe

Co-authored-by: danielmeppiel <[email protected]>

* Avoid logging trusted executable paths

Co-authored-by: danielmeppiel <[email protected]>

* Organize GitHub CLI resolver tests

Co-authored-by: danielmeppiel <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>

* Harden APMLifecycle with open-world and generated coverage (#2809)

* Strengthen APMLifecycle observation and modeling

Co-authored-by: danielmeppiel <[email protected]>

* Enforce generated lifecycle write sets

Co-authored-by: danielmeppiel <[email protected]>

* Keep lifecycle gap ledger extensible

Co-authored-by: danielmeppiel <[email protected]>

* Harden lifecycle contract introspection

Co-authored-by: danielmeppiel <[email protected]>

* Use exact dry-run evidence

Co-authored-by: danielmeppiel <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>

* chore: release v0.29.1 (#2811)

Fold PR #2810 security hardening into the 0.29.1 changelog block, date the
block 2026-09-05, and bump pyproject.toml + uv.lock from 0.29.0 to 0.29.1 (the
release-prep changelog PR #2808 did not bump the version). Test-only, CI-only,
and maintainer-tooling PRs merged since #2808 are intentionally excluded.

Lint mirror verified locally: ruff check, ruff format --check, pylint R0801,
auth-signals boundary all PASS.

Post-merge: tag v0.29.1 to trigger the release workflow.

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

* Investigating and fixing CI workflow test failures (#2812)

* test: isolate policy token fallback cases

Co-authored-by: danielmeppiel <[email protected]>

* test: validate auth test isolation fix

Co-authored-by: danielmeppiel <[email protected]>

* chore: remove validation artifacts

Co-authored-by: danielmeppiel <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>

* fix: repair release integration contract regressions (#2814)

* fix: repair release integration contract regressions

Restore SSH semver transport, preserve hooks without declared targets, and bind prevalidated registry provenance to endpoint and server identities. Repair architecture guards and stale lifecycle fixtures without relaxing security or expanding LSP discovery.

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

* test: bind inactive target preservation to existing spec requirements

Add real req-lk-020/021 evidence for manifest-free CLI target selection preserving inactive hook state and lockfile inventory. Regenerate the conformance statement; no policy waiver or normative change.

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

---------

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

* fix(install): release abandoned transaction lock acquisitions (#2817)

Tie each acquisition to a one-shot transaction finalizer rather than the shared FileLock lifetime. Preserve immediate explicit release and nested owners; cover retained handles and cyclic collection.

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

* ci: diagnose bounded Windows unit test hangs (#2819)

* ci: diagnose bounded Windows unit test hangs

Preserve full xdist selection while reporting named outcomes and periodic process stacks without locals or captured output. Bound stalled runs and reporter cleanup without masking failures.

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

* ci: use verified test-name diagnostics without a custom reporter

Native Windows evidence did not validate worker stack delivery. Keep unbuffered verbose test starts and outcomes, private-output suppression and the external timeout; verify all blocked phases without adding a debugger.

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

---------

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

* fix(tests): repair Windows auth failures and credential-helper stalls (#2822)

* fix(tests): compare canonical Git executable across platforms

Reproduce six Windows failures with git.exe and preserve exact command/auth assertions. Select all eight failed regressions for native Windows PR evidence.

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

* fix(tests): isolate credential lookups and Git config probes

Mock credential-fill at its boundary in the two unfinished release tests and prove cache/port metadata never launches helpers. Isolate generic clone diagnostics from PATH and Git cache state. Pin Azure availability to a no-subprocess contract and select nineteen focused Windows regressions within the measured gate budget.

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

---------

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

* fix(tests): tolerate Rich wrapping in lifecycle assertions (#2828)

Reuse the unwrapped buffer for package identity and collapse whitespace for the exact uninstall recovery command. Preserve all state and exit-code assertions.

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

* chore: finalize v0.29.1 changelog (#2838)

Record the two approved user-facing fixes from #2814 and #2817. Keep version 0.29.1 and date 2026-09-05 unchanged; omit internal-only follow-ups. Completes release preparation from #2811. Post-merge tagging is handled separately.

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

* fix: bound Git connection recovery and synchronize timeout smoke setup (#2839)

Retry one exact HTTPS connection failure below auth and transport selection. Start the process-tree timeout contract only after bounded descendant readiness.

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

* fix(tests): preserve agent-skills fixture bytes on Windows (#2830)

* fix(tests): preserve agent-skills fixture bytes on Windows

* docs: record Windows fixture repair in changelog

* docs: align changelog entry format

* docs: remove fixture-only changelog entry

Keep release notes focused on user-observable changes while preserving the fixture repair in the PR history. Addresses the review-panel documentation follow-up.

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

---------

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

* fix(tests): repair release inventory and teardown diagnostic race (#2840)

* fix(tests): include clone retry guard in frozen rule inventory

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

* fix(tests): await failed report before releasing blocked teardown

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

---------

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

* fix(install): record published package paths, never resolution-staging paths (#2827)

* fix(install): record published package paths, never resolution-staging paths

A dependency fetched through the resolution-staging replacement path is
downloaded into `.apm-resolution-staging/<session>/replacements/...` and
only moved to `apm_modules/<owner>/<repo>` by `publish_replacement()`.
`APMPackage.from_manifest_data` substitutes `${CLAUDE_PLUGIN_ROOT}` in the
manifest's dependency block against the package path it is handed, so a
package validated while still staged had the staging directory baked into
its self-defined MCP server `command`, `args`, `cwd` and `env` values.

`_activate_validated_package` already remapped `package_path` and
`source_path` onto the published tree but left those substituted strings
alone, so the staging path reached `apm.lock.yaml`, `~/.claude.json` and
`~/.codex/config.toml`. The staging root is deleted when the transaction
commits, so the MCP server could never start again while the install kept
reporting success.

Rebase the substituted plugin-root strings onto the published path at the
same point the package paths are remapped. The placeholder may sit anywhere
in a string and may appear more than once, so the rebase replaces every
occurrence of the staged root and is the exact inverse of the substitution.

Refuse outright to write a lockfile or a client MCP configuration that
still names a staging directory, so a future regression fails loudly
instead of persisting a path that is about to be removed. The refusal names
the offending field so an operator can act on it.

Closes #2825

Claude-Session: https://claude.ai/code/session_01KAH4MjAAcXJF6xZaJJLVnr

*…
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.

[BUG] apm uninstall -g leaves Copilot hook files in ~/.copilot/hooks/

4 participants