Skip to content

feat(hooks)!: retire filename hook routing with safe migration - #3613

Merged
Daniel Meppiel (danielmeppiel) merged 14 commits into
mainfrom
danielmeppiel-fix-3226-hook-target-routing
Nov 12, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 14 commits into
mainfrom
danielmeppiel-fix-3226-hook-target-routing

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

TL;DR

Hook filenames no longer choose install targets. Every hook file in a package now reaches every target allowed by apm.yml (the active targets, narrowed by the dependency's targets: and the package's target:). Packages whose old filenames kept a hook file from a target now fail with migration guidance instead of quietly giving that target more executable hooks. Claude output now renames documented Copilot alias events (e.g. subagentStop → SubagentStop) and refuses lower-case events Claude does not support before changing .claude/settings.json.

Fixes #3226

Important

Breaking (pre-1.0, minor-bump class). Packages that used *-<target>-hooks.json / hooks-<target>.json to send different files to different targets now fail with an actionable error naming the target and files. The CHANGELOG Removed entry and the docs section "Migrating from filename routing" give the migration steps. No removal release or date is promised here; the maintainer chooses the release and notice window.

Description

Issue and approved scope

Issue: Fixes #3226

Human scope-approval comment: #3226 (comment) (apm-scope:v1, approver and review contact Daniel Meppiel (@danielmeppiel)). On 2026-11-12, Daniel Meppiel (@danielmeppiel) confirmed again that this is a bounded Tier1 accept. The trusted-main eligibility.cjs returned record-present with authorizes_implementation: false.

Does this complete the issue? Yes, for the accepted scope. Filename inference is removed from the single hook selection owner that every consumer uses, and the migration fails closed. The demonstrated Claude/Copilot event-rendering defect is repaired. Out of scope, per the record: per-file or per-event selectors, general event translation, and spec ratification.

Note

Adjacent work. Draft PR #3332 (#3227, inline hook consent) also edits hook_integrator.py, hook_source_selection.py, hooks-and-commands.md and package-authoring.md. Here the overlap is limited to the selection owner, preflight and the alias table; #3332 is not modified. PR #3600 only shares CHANGELOG.md.

Local preflight skipped by maintainer instruction (2026-11-12); CI is the gate.

Problem (WHY)

  • Copilot events leak into Claude settings. Reproduced on main at 3b1ab4d: a hooks file declaring both SubagentStop and subagentStop produced {'SubagentStop': 1, 'subagentStop': 1, ...} in .claude/settings.json. Claude Code rejects subagentStop as an unknown event.
  • Filenames silently routed executables. x-claude-hooks.json made Claude skip a generic hooks.json (claude: ['x-claude-hooks.json'] copilot: ['hooks.json']). The reporter's spelling, checks.claude.json, was ignored, so the behaviour depended on a naming convention nobody could discover.
  • [!] Naive removal widens reach. The old filter chose target-specific files instead of generic ones. Deleting it alone would activate previously shadowed or foreign-target scripts.

Why these matter: the accepted record requires that "formerly excluded or shadowed scripts cannot silently gain executable reach, and incompatible legacy reliance produces actionable migration failure rather than guessed targets or silent loss of protection" (#3226 scope).

Approach (WHAT)

# Fix
1 Selection ignores filenames: every descriptor reaches every effective target. Routing authority is apm.yml only.
2 The legacy selection is reproduced only to detect widening per target. When it finds widening, it records a conflict; it never routes.
3 Conflicts raise HookContractError with migration steps at install preflight (before any primitive write), direct per-target integration, and uninstall reintegration (before its destructive wipe).
4 The Claude event map gains Copilot alias pairs documented in the Copilot hooks reference: subagentStop, sessionEnd, userPromptSubmitted, postToolUseFailure, preCompact.
5 Lower-case events with no Claude equivalent (errorOccurred, subagentStart, stop) fail before .claude/settings.json changes. Existing content dedupe collapses equivalent registrations; distinct matchers stay distinct.

Implementation (HOW)

  • integration/hook_file_routing.py -- rewritten from a router into a migration guard: configured_hook_file_selection, legacy_routing_widening, raise_for_legacy_routing, hook_package_label. Deprecation and "unresolved token" warnings are removed, because filenames no longer mean anything.
  • integration/hook_source_selection.py (single selection owner) -- drops the filter_hook_files seam. HookSourceSelection gains legacy_routing_conflicts plus require_configured_routing() / require_deployable().
  • integration/hook_integrator.py -- the Claude alias map; guard calls in select_hook_sources_for_target, preflight_hooks_for_targets, Claude merge and reintegration. Net −10 lines, now 2090 against the 2100 guardrail.
  • integration/hook_native_formats.py (rendering owner) -- require_claude_native_events.
  • Docs and guide -- hooks-and-commands.md and apm-usage/package-authoring.md get the configuration-only model, a "Migrating from filename routing" section and the extended alias table.
  • Tests -- new test_hook_configured_routing.py (unit) and test_hook_configured_routing_e2e.py (lifecycle; replaces the ponytail combined-manifest e2e). Legacy-routing assertions are rewritten to the fail-closed contract; pure classifier tests now import legacy_hook_file_selection.

Diagrams

Legend: the selection owner records widening once, and every write path that could deploy hooks checks it before writing.

flowchart LR
    SP["DeployableSourcePlan.create"] --> SEL["select_hook_sources"]
    SEL --> CFG["every descriptor per target"]
    SEL --> LEG["legacy_routing_widening"]
    LEG --> CONF["legacy_routing_conflicts"]
    CONF --> PRE["preflight_hooks_for_targets"]
    CONF --> DIR["select_hook_sources_for_target"]
    CONF --> REI["uninstall reintegration"]
    PRE -->|"conflict"| ERR["HookContractError: no hook write"]
    DIR -->|"conflict"| ERR
    REI -->|"conflict, before wipe"| ERR
    PRE -->|"clean"| CL["require_claude_native_events"]
    CL -->|"lower-case event"| ERR
    CL -->|"ok"| W["render and write targets"]
Loading

Trade-offs

  • Fail instead of guess. Chose an actionable failure for any target whose file set would grow. Rejected "use the legacy selection one more release", because the record requires actual removal rather than "another warning or indefinite compatibility mode".
  • Compatible legacy names keep working. A legacy-named file whose old routing already matched every effective target installs unchanged, so packages that already declare target: are not churned.
  • Whole package fails, not one target. The preflight runs before any primitive write, so the package stays atomic; other packages still install.
  • Claude validation is casing-based. Every documented Claude event is PascalCase, so only lower-case names are rejected. New PascalCase Claude events keep passing without an allowlist to maintain.
  • Spec unchanged. req-tg-008 says consumers MAY infer a legacy filename restriction; APM stops exercising that MAY, which keeps it conformant. Tightening the spec text is left to the spec review process. Mode B is waived in the commit (apm-spec-waiver:).

Benefits

  1. No hook file reaches a target that the old filenames excluded unless configuration says so; legacy reliance always exits non-zero with named files.
  2. .claude/settings.json no longer receives subagentStop-style Copilot events; the reported manifest yields {'SubagentStop': 1, 'PreToolUse': 2}.
  3. One routing authority (apm.yml) for install, preflight, replay, reintegration and audit drift, all through HookSourceSelection.
  4. 46 obsolete routing assertions now prove the fail-closed contract across every merge-harness pair, Copilot and Kiro.

Validation

Repro before / after (direct integrator script)
# main @ 3b1ab4d
claude events: {'SubagentStop': 1, 'subagentStop': 1, 'PreToolUse': 2}
claude: ['x-claude-hooks.json'] copilot: ['hooks.json']
# this branch
claude events: {'SubagentStop': 1, 'PreToolUse': 2}
claude: ['hooks.json', 'x-claude-hooks.json'] copilot: ['hooks.json', 'x-claude-hooks.json']   # recorded as conflicts -> install refuses
Targeted tests (no xdist, one process at a time)
tests/unit/integration/test_hook_configured_routing.py         20 passed (15 fail on main source: TDD)
mutation: legacy widening disabled                             5 failed / 15 passed
mutation: Claude event check + subagentStop alias removed      5 failed / 15 passed
tests/unit/integration/test_hook*.py + cursor native contract
 + install/test_security_scan_scope + selected hook integration 744 passed, 5 skipped
tests/unit/integration/test_dep_target_intersection.py         61 passed
tests/integration/test_cursor_hook_lifecycle.py (APM_BINARY_PATH=.venv/bin/apm)  2 passed
tests/integration/test_architecture_owner_rule_mutations.py -k hook  51 passed
tests/unit/test_triage_advisory.py -k "snapshots_match_lockfile or canonical_integrity"  2 passed
Lint mirror (after merging origin/main)
ruff check / ruff format --check (src tests scripts/...)   clean
pylint R0801                                                10.00/10
scripts/lint-auth-signals.sh                                [+] auth-signal lint clean
scripts/lint-architecture-boundaries.sh                     exit 0
file length (max 2100) / str(relative_to)                   clean

Full unit, integration and spec suites were not run locally (maintainer directive); CI is the authority.

Scenario evidence

Scenario Test Principle
Generic file reaches every effective target; target: narrows test_generic_hook_file_reaches_every_effective_target, test_package_target_declaration_limits_generic_hooks configuration-led routing
Target word in filename no longer alters destination test_target_word_in_filename_no_longer_alters_destination, test_reporter_dot_suffix_name_is_an_ordinary_generic_file configuration-led routing
Legacy migration incl. formerly shadowed hooks fails before any write, known-good settings preserved test_legacy_reliance_fails_before_any_hook_write[*], test_legacy_filename_layout_fails_before_any_hook_write[*] fail closed / executable reach
Valid aliases, equivalent dedupe, distinct matchers, repeat install test_documented_copilot_aliases_render_claude_events[*], test_copilot_events_render_as_claude_events_without_duplicates native fidelity
Invalid events fail before Claude settings change; Copilot unaffected test_event_without_claude_equivalent_fails_before_settings_change[*], test_copilot_only_event_still_installs_for_copilot no silent loss of protection
Migrated packages, repeat install, target contraction test_migrated_packages_follow_their_configured_targets, test_consumer_target_contraction_retires_the_dropped_target lifecycle ownership

Type of change

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

Testing

  • Tested locally (targeted; see Validation)
  • All existing tests pass (CI is the authority)
  • Added tests for new functionality

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- req-tg-008's legacy filename inference is an optional MAY; APM no longer exercises it, and its observable behaviour stays within the normative text. A spec text change, if desired, goes through normal spec review.

How to test

  • Package with hooks/hooks.json declaring SubagentStop + subagentStop with the same command → apm install --target claude writes one SubagentStop entry.
  • Add hooks/x-claude-hooks.json beside hooks.json → install fails with Target 'claude' would newly activate: hooks/hooks.json; .claude/settings.json is unchanged.
  • Split into two packages with target: claude / target: copilot → each target receives only its package's hooks.
  • Event errorOccurred with --target claude → fails with no Claude Code equivalent; with targets: [copilot] it installs.

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

Hook filenames no longer choose install targets. Every discovered hook
file reaches every effective target (active targets intersected with
dependency targets: and package target:). Packages whose retired
filename routing hid files from a target now fail with actionable
migration guidance instead of silently widening executable reach, at
preflight, direct integration and uninstall reintegration.

Claude output renders documented Copilot alias events (subagentStop,
sessionEnd, userPromptSubmitted, postToolUseFailure, preCompact) under
their Claude names, dedupes equivalent registrations, and fails before
changing settings for lower-case events with no Claude equivalent.

apm-spec-waiver: req-tg-008 filename inference is an optional MAY; APM stops exercising it, no normative spec change

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…3226)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 13:53
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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 delete a legacy-routed survivor’s working hooks before routing validation, then swallow the migration failure as a warning without marking cleanup incomplete.

1 open issue
What changed in this PR

This PR replaces filename-based hook routing with configuration-led selection in APM, addressing #3226. It adds migration checks to prevent previously excluded hooks from silently reaching new targets and improves Claude event rendering.

Changes:

  • Select hook files through configured targets and reject incompatible legacy layouts.
  • Normalize additional Claude event aliases and reject unmapped lower-case events.
  • Update migration guidance and regression coverage for routing, rendering, and target contraction.
File Description
tests/​unit/​integration/​test_hook_target_deprecation.py Replace deprecation-warning expectations with migration failures.
tests/​unit/​integration/​test_hook_integrator.py Update legacy-routing and alias-deduplication regressions.
tests/​unit/​integration/​test_hook_integrator_issue1892.py Verify incompatible multi-target layouts fail closed.
tests/​unit/​integration/​test_hook_file_routing_combined_stems.py Test legacy classification and widening diagnostics.
tests/​unit/​integration/​test_hook_configured_routing.py Add configured-routing and Claude-event regressions.
tests/​unit/​integration/​test_dep_target_intersection.py Assert migration failures across target combinations.
tests/​unit/​install/​test_security_scan_scope.py Verify configured descriptors are scanned and conflicts recorded.
tests/​integration/​test_wave6_integrators_coverage.py Redirect classifier tests to the legacy helper.
tests/​integration/​test_integrators_hooks_phase3c.py Update the legacy classifier import.
tests/​integration/​test_integrators_hooks_execution.py Update the legacy classifier import.
tests/​integration/​test_hook_routing_combined_manifest_e2e.py Remove obsolete filename-routing scenarios.
tests/​integration/​test_hook_configured_routing_e2e.py Add in-process migration, reinstall, and target-contraction scenarios.
src/​apm_cli/​integration/​hook_source_selection.py Select configured descriptors and record migration conflicts.
src/​apm_cli/​integration/​hook_native_formats.py Add Claude event validation.
src/​apm_cli/​integration/​hook_integrator.py Extend aliases and invoke routing/event checks.
src/​apm_cli/​integration/​hook_file_routing.py Replace filename routing with a legacy-widening guard.
packages/​apm-guide/​.apm/​skills/​apm-usage/​package-authoring.md Update packaged routing and migration guidance.
docs/​src/​content/​docs/​producer/​author-primitives/​hooks-and-commands.md Document configured targets, migration, and event aliases.
CHANGELOG.md Record the breaking routing change and Claude fixes.

Review effort: Balanced

Resolve hook_integrator.py: keep #2944's _DOT_NAMED_HOOK_ROOTS and drop
the retired _filter_hook_files_for_target seam (filename routing is
removed by this PR).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
apm uninstall wiped APM-owned merged hook settings in Phase 1 and only
then rebuilt survivors, so a survivor relying on retired filename
routing (or a Claude event without a native pair) lost its working
hooks and the HookContractError was swallowed as a best-effort warning.
preflight_survivor_hooks (hook_reintegration owner) now runs the shared
HookSourceSelection.require_deployable check for every authorized
survivor before Phase 1, so settings and sidecars stay byte-identical,
the migration message is shown and uninstall exits non-zero.

Addresses Copilot inline on src/apm_cli/integration/hook_integrator.py:1993.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the entry to Changed under the repo's **BREAKING:** convention
(next to the Python 3.11 break shipping in the same release), drop the
duplicate Removed header left by the merge, and spell out the migration
steps and the uninstall stop.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- preflight_survivor_hooks validates the selection the canonical
  HookIntegrator.select_deployable_hook_sources returns, reusing the
  discovered files, instead of building and scanning a full source plan
  that the rebuild builds again (performance-expert FU).
- legacy_routing_widening reuses the configured descriptors instead of
  recomputing them per target (performance-expert nit).
- Claude event refusals name the package and say 'no documented Claude
  Code name' (SubagentStart exists in Claude; subagentStart lacks a
  documented alias) (devx-ux-expert, doc-writer FUs).
- Uninstall tells the user to migrate before 'apm install' when the
  survivor preflight refused (devx-ux-expert FU); grammar fix in the
  routing refusal text; layering comments (python-architect nit).
- test_hook_configured_routing.py declares pytestmark component.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- reconcile_after_removal refuses a legacy-routed or invalid-event
  survivor before wiping (mutation-break verified).
- Real-binary lifecycle: configured-target packages install, repeat
  idempotently, audit clean, a legacy-routed package is refused with no
  write, and uninstall of one package leaves the other's hooks
  (test-coverage-expert FUs).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Narrowing a dependency with targets: only resolves the refusal when the
package ships hooks for that one target; a generic hooks.json beside
target files needs the author to split the package. Docs, apm-guide and
CHANGELOG now separate the author and consumer paths, say the refused
package writes nothing, mention the uninstall stop in the guide, and
describe refused events as lacking a documented Claude alias
(doc-writer FUs).

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Retires filename-derived hook routing with a fail-closed migration guard, fixes Claude event rendering, and hardens uninstall so survivors never lose working hooks.

panel-mode=full; personas=python-architect,test-coverage-expert,doc-writer,devx-ux-expert,supply-chain-security-expert,performance-expert

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

Six panelists converged without dissent. Every recommended and nit-level finding was folded at head 1548ede9 and verified by 705 targeted tests plus a real-binary lifecycle case (install, repeat, audit, refused legacy package, uninstall). The supply-chain-security expert confirmed that every hook deployment path enforces require_configured_routing and that the new uninstall preflight runs before the Phase 1 wipe, which is the property the Copilot inline review found missing. The performance concern (a full DeployableSourcePlan plus scan per survivor) was resolved by validating through the canonical selector with reused hook files. The doc-writer's corrections (the dependency-narrowing path only works for single-target packages; subagentStart lacks a documented alias rather than a Claude event) landed in docs, the apm-guide resource, the CHANGELOG and the error text. The devx-ux expert's migrate-first uninstall advice replaced a circular "Run apm install" suggestion.

Strategically this is the right kind of pre-1.0 breaking change: an invisible filename convention becomes an explicit apm.yml declaration that the CLI can check, refuse and explain, and no existing user silently gains or loses executable reach. The one note worth tracking: hook_integrator.py is at 2093 of 2100 lines.

Aligned with: portable by manifest (routing authority moves into apm.yml); secure by default (widening refused, survivors protected before any wipe, unsupported Claude events fail before settings change); governed by policy (one check at every write path); multi-harness (five new Claude aliases, native gates kept); pragmatic as npm (one manifest edit per affected package, docs link in the error).

Growth signal. Strong 0.36.0 release-note story: APM refuses to silently widen executable reach when hook routing changes, and protects surviving packages during uninstall.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 2 Selection authority stays in HookSourceSelection; the uninstall preflight extends it without splitting authority; all write paths guarded.
Test Coverage Expert 0 2 1 Regression traps cover install preflight, aliases, invalid events and uninstall byte-identity; reconcile and lifecycle gaps now folded.
Doc Writer 0 2 1 Migration docs follow the configuration-only model; narrowing path and alias wording corrected.
DevX UX Expert 0 1 2 Uninstall recovery advice now says migrate first; refusals name the package.
Supply Chain Security Expert 0 0 0 Every hook deployment path enforces configured routing; widening is detected per effective target after narrowing. Ship.
Performance Expert 0 1 2 Survivor preflight now uses the hook selector only; cost bounded to hook-carrying survivors.

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

Top 1 follow-ups

  1. [Python Architect] Extract _HOOK_EVENT_MAP and the alias tables from hook_integrator.py into a shared module to regain headroom below the 2100-line CI guard (currently 2093). -- Mechanical refactor; land it before the next hooks-touching PR (for example feat(hooks): stage consent-aware Claude standalone inline hooks #3332) to avoid a guard breach.

Architecture

classDiagram
    direction LR
    class HookSourceSelection {
        <<ValueObject>>
        +descriptor_files dict
        +bundle_files dict
        +legacy_routing_conflicts dict
        +require_configured_routing(label) void
        +require_deployable(pkg_info, event_maps) void
    }
    class DeployableSourcePlan {
        <<ValueObject>>
        +hook_source_selection HookSourceSelection
        +create() DeployableSourcePlan
        +scan_security(policy) SecurityVerdict
    }
    class HookIntegrator {
        +select_deployable_hook_sources() HookSourceSelection
        +select_hook_sources_for_target() HookSourceSelection
        +preflight_hooks_for_targets() void
        +integrate_hooks_for_target() IntegrationResult
        +reconcile_after_removal() dict
    }
    class HookFileRouting {
        <<MigrationGuard>>
        +configured_hook_file_selection() list
        +legacy_routing_widening() list
        +raise_for_legacy_routing() void
    }
    class HookNativeFormats {
        +require_claude_native_events() void
    }
    class HookReintegration {
        <<Preflight>>
        +build_hook_reintegration_source_plan() DeployableSourcePlan
        +preflight_survivor_hooks() void
    }
    HookIntegrator ..> HookSourceSelection : selects and checks
    DeployableSourcePlan *-- HookSourceSelection : carries
    HookSourceSelection ..> HookFileRouting : routing check
    HookSourceSelection ..> HookNativeFormats : Claude event check
    HookReintegration ..> HookIntegrator : canonical selector
    HookReintegration ..> HookSourceSelection : require_deployable
    class HookSourceSelection:::touched
    class HookFileRouting:::touched
    class HookNativeFormats:::touched
    class HookReintegration:::touched
    class HookIntegrator:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading

Recommendation

All six panelists converged with no blocking-severity findings and no open recommended findings after the folds. 705 targeted tests, a real-binary lifecycle case, a clean lint mirror and mutation-break checks confirm that the fail-closed contract holds. The CHANGELOG BREAKING entry and the migration docs are in place. Ship in 0.36.0 with this PR, and track the hook_integrator.py extraction as a hygiene task before the next hooks-touching PR.

Folded in this run

  • (copilot) Uninstall wiped survivor hooks before the routing/event check, then swallowed the refusal -- resolved in 38dbb05 (preflight_survivor_hooks runs before Phase 1; exit 1, settings byte-identical).
  • (merge) Conflict with fix(hooks): anchor POSIX user-scope hook commands to $HOME #2944 in hook_integrator.py; kept _DOT_NAMED_HOOK_ROOTS and dropped the retired filter seam -- resolved in 5166113.
  • (release) CHANGELOG moved to **BREAKING:** under Changed with explicit migration steps (0.36.0 alongside the Python 3.11 break) -- resolved in 54d3163.
  • (performance-expert) Survivor preflight validates through the canonical hook selector instead of building and scanning a full plan; hook files discovered once; configured selection reused across targets -- resolved in cb29cff.
  • (devx-ux-expert) Migrate-first advice when the survivor preflight refuses; package label on Claude event refusals; grammar in the routing refusal -- resolved in cb29cff.
  • (python-architect) Comments documenting the selection / preflight / write-boundary check layering -- resolved in cb29cff.
  • (test-coverage-expert) reconcile_after_removal refusal trap; real-binary lifecycle case test_required_configured_hook_routing_lifecycle; module pytestmark = pytest.mark.component -- resolved in 2e72d49 and cb29cff.
  • (doc-writer) Separate author and consumer migration paths (narrowing only helps single-target packages); "no documented Claude alias" wording; uninstall stop in the guide; "writes nothing from it" -- resolved in 1548ede and cb29cff.

Copilot signals reviewed

  • src/apm_cli/integration/hook_integrator.py:1993 -- LEGIT: uninstall Phase 1 wiped merged hooks before the survivor rebuild hit the routing guard, losing working hooks silently (resolved in 38dbb05; thread resolved).

Regression-trap evidence (mutation-break gate)

  • tests/unit/test_surviving_deps_reintegration.py::test_uninstall_rejects_undeployable_survivor_hooks_before_wiping -- deleted preflight_survivor_hooks(...) call in engine.py (and, separately, its .require_deployable(...)); test FAILED as expected; guard restored.
  • tests/unit/test_surviving_deps_reintegration.py::test_reconcile_after_removal_refuses_undeployable_survivor_before_wiping -- deleted require_deployable in reconcile_after_removal; test FAILED as expected; guard restored.

Lint contract

The full CI lint mirror is silent on the merged head: ruff check, ruff format --check, pylint R0801 (10.00/10), lint-auth-signals.sh and lint-architecture-boundaries.sh. The file-length, YAML-IO and relative_to guards are clean too.

CI

All checks green at 1548ede9 (23 success, 2 neutral, 1 skipped; license/cla success) after 0 CI fix iterations.

Mergeability status

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#3613 1548ede ship_now 1 8 0 1 green MERGEABLE BLOCKED pending required review

Convergence

1 outer iteration; 1 Copilot round. Final panel stance: ship_now. Ready for maintainer review.

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


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

…outing

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoids landing-order conflicts with other queued PRs.

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

Copy link
Copy Markdown
Collaborator Author

Lane L: main merged for landing

  • Pre-merge head: 1548ede9f565990766a238b067a580da2bdd18e9
  • Merged origin/main f2369b760765fe91ef4955cbdd2fb47dcd7959f2 (clean merge; GitHub reported DIRTY only on CHANGELOG.md, which this repo merges with merge=union).
  • New head: b47b81209454a7996708923f66dd36c65e0b1ac0
  • CHANGELOG: moved 2 bullet(s) in '### Changed' after entry Add GitHub Enterprise (GHE) hostname support to dependency parsing #8 of 8, so queued PRs no longer collide at the section head while landing serially.
  • Lint: ruff check + ruff format --check silent at the new head; CI green at the new head.
  • Owner-touch report regenerated at the new head; every recorded functional test was re-run at that exact head and passed (one process at a time, no xdist).
  • Push: git push https://github.com/microsoft/apm.git HEAD:refs/heads/danielmeppiel-fix-3226-hook-target-routing (plain push, no force).

This comment was generated by an AI agent (Lane L landing desk) on behalf of Daniel Meppiel (@danielmeppiel).

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 6758c9a into main Nov 12, 2026
26 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-3226-hook-target-routing branch November 12, 2026 22:39
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.

Hook files cannot be limited to a target: Copilot events leak into Claude settings

2 participants