Skip to content

fix(deps): agree with prune on bundled skills after repo-to-subdirectory switch - #3612

Merged
Daniel Meppiel (danielmeppiel) merged 11 commits into
mainfrom
danielmeppiel-fix-2926-deps-list-subdir-orphans
Nov 12, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 11 commits into
mainfrom
danielmeppiel-fix-2926-deps-list-subdir-orphans

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

TL;DR

apm deps list now agrees with apm prune on orphaned content when a dependency switches from a whole repository (yoshiko-pg/difit) to subdirectory dependencies (path: skills/difit). Two causes are fixed. deps list falsely flagged skills bundled inside a declared whole-repo package, and install/update left the old whole-repo checkout behind the new subdirectory installs. Both decisions now go through the single registered orphan selector, _find_orphaned_packages.

Thanks to Atsuki Nohira (@maro114510) for the report and for supplying the missing before-state (a repository-level install first, then the switch). That transition is what made this reproducible.

Note

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

Problem (WHY)

Reproduced on main (2794714d) with the real yoshiko-pg/difit@82a765c0 and an isolated HOME:

  • Step 1 (repo-level install): apm deps list -g reports all 8 embedded skills (skills/*, .claude/skills/*, .codex/skills/*) as orphaned, while apm prune reports No orphaned packages found. deps list only knew "declared path or ancestor of one", not "content bundled inside a declared package". Prune's selector already keeps bundled descendants.
  • Step 2 (switch to two path: deps + apm update -g --yes): the old checkout stays at apm_modules/yoshiko-pg/difit/ as the parent of the new installs. deps list and prune flag 6 dot-dir skills, while deps tree shows a clean graph. prune would delete only those 6 marker directories and leave README, src/, and other files behind.
  • [!] Full installs never remove a dropped dependency's apm_modules copy (prune owns that). When the dropped root is the parent of retained installs, _find_orphaned_packages keeps it as an ancestor, so nothing could ever clean it.

Why it matters: the scope record requires that "deps list, deps tree and prune agree, and no false orphan warnings". .github/instructions/architecture.instructions.md also requires that every call site "routes THROUGH that owner instead of re-deriving the answer locally".

Approach (WHAT)

# Fix
1 deps list asks the shared _find_orphaned_packages owner whether a scanned package lies inside an expected install path, the same expected set prune builds. Its stricter warning for a real, undeclared package above a declared subdirectory is kept.
2 Install cleanup trims a released lock entry's copy that now only hosts retained packages (for example owner/repo hosting owner/repo/skills/a) down to those subtrees. The same owner selects what to remove, so the result matches a fresh subdirectory install.
3 The install-deployment-orphan-selection architecture guard now covers both new call sites, with a mutation test for each.

Implementation (HOW)

  • src/apm_cli/commands/deps/cli.py: _resolve_scope_deps builds _build_expected_install_paths(get_all_apm_dependencies(), lockfile), as prune does. A scanned package is orphaned only if the existing rule flags it and the owner selects it (or it is a strict ancestor of an expected path, which preserves the real-orphan warning). If computing expected paths fails, it falls back to the old behavior.
  • src/apm_cli/install/phases/cleanup.py: adds _trim_superseded_package_roots, called after orphan deployed-file cleanup for full installs (released = previous keys not intended and not retained by refused cleanup) and partial installs (partial_dropped - pinned). It skips any released root that is itself retained, lies inside a retained package, or hosts nothing. Those roots keep today's contract and are left for apm prune. Entries are compared case-folded so a case-insensitive filesystem never loses a retained subtree. Deletions go through safe_rmtree / ensure_path_within, and a failure becomes a diagnostic warning. The retained-path computation is shared with _remove_dropped_package_dirs (no R0801 duplication).
  • scripts/architecture_linter/checks/install_uninstall_and_resolution.py: registers deps/cli.py::_resolve_scope_deps and cleanup.py::_trim_superseded_package_roots as required routes through _find_orphaned_packages.
  • Docs: reference/cli/deps.md, reference/cli/prune.md, and the apm-usage skill's commands.md (deps list and prune rows), plus a CHANGELOG entry.

Diagram

Legend: the install cleanup phase after this PR. The new trim (boxed) runs after deployed-file orphan cleanup and selects through the same owner as prune.

flowchart LR
    A["previous lock: yoshiko-pg/difit"] --> B["released keys"]
    C["new graph: difit/skills/difit, difit/skills/difit-review"] --> D["retained install paths"]
    B --> E{"released root hosts retained paths?"}
    D --> E
    E -->|"no"| F["untouched; apm prune owns it"]
    E -->|"yes"| G["NEW: _trim_superseded_package_roots"]
    G --> H["_find_orphaned_packages"]
    H --> I["apm_modules == fresh subdirectory install"]
    style G stroke-width:3px
Loading

Trade-offs

  • Trim at install time vs. widening prune. Prune keeps whole ancestors of needed children by design. Widening it to delete non-package files inside ancestors would redesign the prune model, which the scope rules out. Only install knows the root was a whole-repo checkout that has just been released.
  • Existing broken states are not auto-healed. A user whose lockfile already moved, like the reporter, now gets the same answer from deps list and prune (the 6 stale skills), and apm prune removes them. Non-package files in that old root remain, but they are inert and never reported.
  • Root .apm-pin remains. The existing cache-pin self-heal (#1137) re-marks the released root after cleanup, because the directory still exists. Verified harmless: switching back to yoshiko-pg/difit re-downloads the full repository (28 entries).
  • deps list row shape unchanged. A marker-less whole-repo bundle still lists its embedded skills as rows, now with source github instead of orphaned. Folding them into a single root row would drop their skill counts, so it is out of scope.

Benefits

  1. Reporter sequence, real repo: orphan warnings drop from 8 (step 1) and 6 (step 2) to 0, with deps list, deps tree, and prune agreeing.
  2. After the switch, apm_modules/ holds only the requested subdirectories, plus one pin file, instead of the 28-entry stale checkout.
  3. One orphan-selection authority for prune, warnings, targeted installs, deps list, and the trim, guarded statically.

Issue and approved scope

Issue: Fixes #2926

Human scope-approval comment: #2926 (comment) (Decision: approve, Area: project, Review contact: Daniel Meppiel (@danielmeppiel))

Does this PR complete the issue, or what remains? Yes. It meets every Done-when item: the reporter's sequence ends with all three commands agreeing; the stale checkout is cleaned by update; the regression test covers project and user scope; and the related docs are updated. It makes no prune model, flag, or lockfile schema change.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass (CI is the authority; targeted suites below pass locally)
  • Added tests for new functionality (if applicable)

Scenario evidence

Scenario (user promise) Test Principle
Repo-level install: embedded skills are bundled, not orphaned (project + user scope) tests/unit/install/test_repo_to_subdirectory_switch.py::test_repo_level_install_lists_embedded_skills_as_bundled Govern: truthful inventory
Repo -> path: switch trims the stale checkout; deps list + prune agree (project + user scope) ...::test_switch_to_subdirectory_deps_trims_superseded_checkout Consume: install is a sync
Plain removal still left for apm prune ...::test_released_root_without_hosted_subdirectory_is_left_for_prune Least surprise
A still-declared whole repo is never trimmed ...::test_retained_whole_repo_package_is_never_trimmed Safety
A real undeclared parent package is still reported ...::test_undeclared_standalone_parent_of_declared_subdirectory_stays_orphaned Govern
Guard rejects bypass of the owner in both call sites tests/integration/test_architecture_owner_rule_mutations.py::test_orphan_selection_guard_rejects_{deps_list,superseded_root_trim}_bypass One owner

Mutation-break: neutering the trim (for orphan in []) fails both scope variants of the switch test. Forcing the old deps list rule fails both repo-level variants. Dropping the ancestor clause fails the real-orphan test.

Commands and results
Command Result
pytest tests/unit/install/test_repo_to_subdirectory_switch.py -p no:xdist 7 passed
pytest tests/unit/install/phases/test_cleanup_phase.py tests/unit/install/test_partial_subtree_reconciliation.py (+ new file) 50 passed
pytest tests/unit/commands/test_deps_cli_{helpers,phase3,phase3w4,alias_readers,branch_coverage,cli_surface}.py 166 passed
pytest tests/unit/test_deps_list_tree_info.py tests/unit/test_orphan_announce_parity.py + ancestor/standalone suites 204 passed
pytest tests/integration/test_architecture_owner_rule_mutations.py -k orphan_selection 4 passed
ruff check / ruff format --check (CI paths, ruff 0.15.12) All checks passed / 2145 files already formatted
pylint --enable=R0801 --min-similarity-lines=10 ... 10.00/10
bash scripts/lint-auth-signals.sh, bash scripts/lint-architecture-boundaries.sh exit 0 / exit 0
YAML-io, file-length (2100), str(relative_to) guards no violations

Real-repo end-to-end (HOME=/tmp/..., yoshiko-pg/difit@82a765c0, this branch):

== step1 (repo-level) deps list orphan rows: 0
[+] No orphaned packages found. apm_modules/ is clean.
== step2 (two path: deps, apm update -g --yes) files:
./yoshiko-pg/difit/.apm-pin
./yoshiko-pg/difit/skills/difit-review/{.apm-pin,SKILL.md,agents/openai.yaml}
./yoshiko-pg/difit/skills/difit/{.apm-pin,SKILL.md,agents/openai.yaml}
== deps list orphan rows: 0
|-- yoshiko-pg/difit/skills/difit@unknown
`-- yoshiko-pg/difit/skills/difit-review@unknown
[+] No orphaned packages found. apm_modules/ is clean.

How to test

  • export HOME=$(mktemp -d); mkdir -p ~/.apm && cd ~/.apm, then write apm.yml with dependencies: {apm: [yoshiko-pg/difit]} and run apm install -g.
  • Run apm deps list -g. Expect no orphan warning (on main: 8).
  • Replace the dependency with two git: yoshiko-pg/difit / path: skills/difit and path: skills/difit-review entries, then run apm update -g --yes.
  • Run apm deps list -g, apm deps tree -g, and apm prune --dry-run. Expect no orphans (on main: 6), and find ~/.apm/apm_modules -type f shows only the two skills plus one root pin.

Spec conformance (OpenAPM v0.1)

  • Spec edit
  • Manifest edit
  • Test edit
  • CONFORMANCE.{md,json} regenerated
  • N/A -- this PR does not change OpenAPM-observable behaviour. The change touches only the apm_modules cache layout and deps list classification, with no lockfile, manifest, or deployment contract change. The commit carries an apm-spec-waiver: line for Mode B.

Co-authored-by: Copilot [email protected]

…ory switch (#2926)

`apm deps list` flagged skills bundled inside a declared whole-repository
skill bundle as orphaned while `apm prune` kept them, and switching that
dependency to `path:` subdirectory dependencies left the old checkout in
place, so its embedded skills were reported as orphaned by `deps list` and
`prune` while `deps tree` showed a clean graph.

- deps list routes bundled-descendant classification through the shared
  `_find_orphaned_packages` owner, keeping its stricter warning for a real
  undeclared package above a declared subdirectory.
- install cleanup trims a released whole-repository copy to the retained
  subdirectory packages nested inside it, via the same owner, so the
  result matches a fresh subdirectory install.
- The orphan-selection architecture guard now also covers both call sites.

Reproduction by @maro114510.

apm-spec-waiver: apm_modules cache-layout trim and deps list classification only; no normative lockfile, manifest or deployment behavior change

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 13:48

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

Unresolved bugs can hide deeper undeclared parent packages, falsely flag bundled skills after repository-casing changes, and leave case-distinct files behind during cleanup.

3 open issues
What changed in this PR

This PR addresses #2926 by using shared orphan-selection logic for bundled skills and trimming stale repository content when dependencies switch to subdirectory installs.

Changes:

  • Update deps list to recognize skills bundled within declared packages.
  • Trim released repository checkouts while preserving retained subdirectory dependencies.
  • Add regression tests and architecture guards, and update command documentation.
File Description
tests/​unit/​install/​test_repo_to_subdirectory_switch.py Adds project- and user-scope regressions for bundled skills and subdirectory transitions.
tests/​integration/​test_architecture_owner_rule_mutations.py Tests that new call sites cannot bypass the shared selector.
src/​apm_cli/​install/​phases/​cleanup.py Shares retained-path calculation and adds superseded-checkout trimming.
src/​apm_cli/​commands/​deps/​cli.py Uses shared orphan selection when classifying installed packages.
scripts/​architecture_linter/​checks/​install_uninstall_and_resolution.py Extends selector-routing checks to listing and checkout trimming.
packages/​apm-guide/​.apm/​skills/​apm-usage/​commands.md Updates agent-facing dependency-listing and prune guidance.
docs/​src/​content/​docs/​reference/​cli/​prune.md Documents cleanup during repository-to-subdirectory transitions.
docs/​src/​content/​docs/​reference/​cli/​deps.md Documents bundled-skill orphan classification.
CHANGELOG.md Records the classification and checkout-cleanup fixes.

Review effort: Balanced

Comment thread src/apm_cli/commands/deps/cli.py Resolved
Comment thread src/apm_cli/commands/deps/cli.py Resolved
Comment thread src/apm_cli/install/phases/cleanup.py Resolved
Copilot and the advisory panel found edge cases in the shared-selector
routing introduced for #2926; all sit inside the PR's stated scope.

- deps list now uses prune's installed-case lookup
  (preserve_installed_case=True), so a re-cased declaration such as
  Owner/Repo installed under owner/repo keeps its bundled skills out of
  the orphan list (Copilot inline on src/apm_cli/commands/deps/cli.py:397).
- The real-orphan warning for an undeclared package above a declared
  subdirectory now holds at every depth, not only the first three path
  components (Copilot inline on src/apm_cli/commands/deps/cli.py:403).
- The superseded-root trim groups every physical entry under its
  case-folded key, so case-distinct siblings (README.md / readme.md) on a
  case-sensitive filesystem are all removed (Copilot inline on
  src/apm_cli/install/phases/cleanup.py:458).
- Partial installs compute released/retained install paths once and
  share them between the dropped-copy removal and the trim
  (performance-expert follow-up).
- Regression tests: re-cased bundle, deeper standalone parent,
  case-distinct trim, selector-input fallback, and a CLI-level
  deps list / deps tree / prune agreement check in project and user
  scope (test-coverage-expert follow-ups).

Co-authored-by: Copilot App <[email protected]>
Drives the #2926 reporter sequence with the apm binary: install a whole
repository skill bundle, switch to two path: dependencies, run
apm update, then assert the old checkout is trimmed to the requested
subdirectories and deps list, deps tree and prune agree. Addresses the
test-coverage-expert follow-up on lifecycle-tier coverage for the
destructive trim; mutation-break verified by neutering the trim.

Co-authored-by: Copilot App <[email protected]>
deps list still reports a real package installed above a declared
subdirectory dependency, which prune keeps because it contains that
dependency, so "orphaned only when prune would select it" overstated
the agreement. Also notes that a GitHub owner/repository casing change
no longer orphans bundled skills. Doc drift caused by the folded review
findings.

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Fixes silent disagreement between deps list and prune after repo-to-subdirectory switch by sharing the orphan-selection path; component tests prove the fix with real I/O, three Copilot edge-case folds in flight.

panel-mode=lean; personas=python-architect,test-coverage-expert,performance-expert,apm-ceo

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

All three panelists agree. The architecture is sound: python-architect found no concerns, and both new call sites route through _find_orphaned_packages. The performance cost is negligible: one duplicate path computation on partial installs. The component tests exercise the fix on real tmp filesystems with the shared selector unpatched. The three Copilot inline items are real edge-case bugs inside this PR's stated scope: installed-case lookup in deps list, standalone ancestors deeper than three components, and case-folded entry collapse in the trim.

The test-coverage-expert raised three missing-test gaps. The strongest is the destructive _trim_superseded_package_roots path (secure-by-default), which has no lifecycle-tier coverage. A regression trap for the silent fallback is a proportionate, low-cost defensive test.

Strategically, this PR reinforces APM's positioning: when you declare a dependency shape in the manifest, every command agrees on what that means, and it does so through a shared code path rather than ad-hoc patching.

Aligned with: Portable by manifest -- manifest-declared subdirectory deps are the single source of truth for deps list, prune and install cleanup; Secure by default -- the destructive trim is guarded by the shared selector; Pragmatic as npm -- sibling commands no longer disagree.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 Both new call sites route through _find_orphaned_packages; extracted helper and trim safety boundary are sound.
Test Coverage Expert 0 3 0 Component tests defend the fix with real filesystem; CLI-level and lifecycle-tier coverage and the silent fallback branch lack regression traps.
Performance Expert 0 1 0 Steady-state cost near zero; partial drops computed released/retained install paths twice.

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

Top 4 follow-ups

  1. [Test Coverage Expert] Add a lifecycle-binary test for _trim_superseded_package_roots after a repo-to-subdirectory switch. -- Destructive-write path with component coverage only.
  2. [Test Coverage Expert] Add a unit test for the except Exception fallback in _resolve_scope_deps. -- A broken helper would silently revert deps list to the [BUG] deps list incorrectly reports embedded skills as orphaned for subdirectory dependencies #2926 bug shape.
  3. [Test Coverage Expert] Add a CLI test proving deps list, deps tree and prune agree after the switch. -- The Done-when was proven at component tier only.
  4. [Performance Expert] Compute _released_and_retained_install_paths once on partial installs and share it. -- Avoids doubling path construction.

Recommendation

Ship after the folds land and CI is green.

Merge-worker folds (pushed in 2c0bf6d)

All four follow-ups and all three Copilot items sit inside this PR's surface. They were folded into this PR, not deferred:

  • (copilot) deps list uses prune's installed-case lookup (preserve_installed_case=True) -- resolved in d519bc2.
  • (copilot) The real-orphan warning for a package above a declared subdirectory holds at every depth -- resolved in d519bc2.
  • (copilot) The trim groups case-distinct entries per case-folded key and removes all of them -- resolved in d519bc2.
  • (panel) Released/retained install paths are computed once and shared on partial installs -- resolved in d519bc2.
  • (panel) Regression tests for the selector-input fallback, plus CLI-level deps list / deps tree / prune agreement in project and user scope -- resolved in d519bc2.
  • (panel) Lifecycle-binary test of the reporter sequence (install, switch to path:, update, then deps list / deps tree / prune) -- resolved in 0a90953.
  • (doc drift) deps list docs no longer claim strict equality with prune for a real parent package above a declared subdirectory -- resolved in 48c4528.

Mutation-break: each new test fails with its guard removed (installed-case flag, uncapped ancestors, fallback branch, trim loop, per-key grouping on a case-sensitive volume) and passes once restored.


Full per-persona findings

Python Architect

No findings.

Test Coverage Expert

  • [recommended] Scope-record done-when proven at component tier only; install-pipeline floor is integration-with-fixtures via CLI. at tests/unit/install/test_repo_to_subdirectory_switch.py
    No CLI-level scenario drives apm deps list / apm prune after a repo-to-subdirectory switch.
    Proof (missing at): tests/integration/test_wave6_deps_cli_coverage.py::test_deps_list_prune_agree_after_repo_to_subdirectory_switch [devx]
  • [recommended] Silent except-Exception fallback in _resolve_scope_deps has no regression trap. at src/apm_cli/commands/deps/cli.py:407
    If a future change breaks the helper, deps list silently reverts to the [BUG] deps list incorrectly reports embedded skills as orphaned for subdirectory dependencies #2926 bug shape.
    Proof (missing at): tests/unit/install/test_repo_to_subdirectory_switch.py::test_resolve_scope_deps_fallback_on_helper_failure_preserves_pre_fix_behavior [devx]
  • [recommended] _trim_superseded_package_roots performs destructive deletion; no lifecycle-state-machine test through the real binary. at src/apm_cli/install/phases/cleanup.py
    Proof (missing at): tests/integration/test_required_lifecycle_state_machine.py::test_required_repo_to_subdirectory_switch_trims_only_superseded_content [devx,secure-by-default]

Performance Expert

  • [recommended] Partial install calls _released_and_retained_install_paths twice with an identical released set. at src/apm_cli/install/phases/cleanup.py:186
    Suggested: Compute once in _run_cleanup and pass the result to both consumers.

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.

… test

CI on the PR head failed in two places:

- Spec conformance: test_lockfile_reconciles_inactive_target_paths_fail_safe
  drives cleanup.run with a SimpleNamespace context that has no
  apm_modules_dir; the new released/retained path helper now reads it
  with getattr and skips when absent, like dependency_graph.
- Lifecycle smoke: test_prune_retains_installed_ancestor_after_root_declaration_removed
  encoded the pre-#2926 contract in which removing the whole-repo root
  declaration left its full checkout as the ancestor of a still-declared
  nested path: dependency. That is exactly the transition #2926 scopes
  ("must not leave a stale whole-repository checkout"), so install now
  trims the released root to the nested dependency it hosts. The test is
  renamed and asserts the trimmed state; prune still finds nothing to
  remove and leaves later personal content untouched.

apm-spec-waiver: cleanup-phase hardening and test contract update for the #2926 apm_modules trim; no OpenAPM-observable lockfile, manifest, or deployment change

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Delta clears all four prior follow-ups and three Copilot items with zero new findings; install now trims superseded repo roots at update time instead of deferring to prune.

panel-mode=delta; personas=python-architect,test-coverage-expert,performance-expert,apm-ceo

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

The delta since the last advisory (eb287d6 -> d342fb7) is clean. All four follow-ups from that ship_with_followups pass are folded:

  • A lifecycle-binary test of the destructive trim (test_required_repo_to_subdirectory_switch_trims_superseded_checkout).
  • Unit coverage of the deps list fallback branch.
  • A CLI agreement test for deps list, deps tree and prune after the switch, in project and user scope.
  • Retained/released paths computed once on partial installs.

The three Copilot items are folded and their threads are replied to and resolved. All three delta panelists returned zero findings, and CI is green on every required gate.

One behavior-contract change for the maintainer. Consider a user who removes a whole-repository root declaration while a nested path: child of the same repository stays declared. Install now trims the root checkout down to the hosted subtree; the root's own SKILL.md is removed. Previously the full checkout stayed, and apm prune reported it as retained. This is exactly the #2926 transition. tests/integration/test_prune_skill_lifecycle.py was renamed to test_install_trims_released_root_to_nested_dependency_it_hosts and now asserts the trimmed state. Prune's "Retained " message keeps its unit coverage in tests/unit/test_prune_command.py.

The #2926 scope record is satisfied: the reporter sequence ends with deps list, deps tree and prune agreeing, and no false orphan warnings.

Aligned with: Portable by manifest -- declared subdirectory deps decide what stays on disk after a switch; Secure by default -- both new call sites are guarded routes through _find_orphaned_packages; Governed by policy -- every Done-when item in the apm-scope:v1 record is met and tested.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 All four delta items are architecturally sound: single owner for released/retained paths, safe partial-context guard, grouped trim, warning-only uncapped ancestor set.
Test Coverage Expert 0 0 0 All three prior gaps closed at stated tiers; retained-root lifecycle rename is faithful; case-sensitive skip guard valid for Linux CI.
Performance Expert 0 0 0 Duplicate path computation removed on partial installs; grouped trim and uncapped ancestor set are negligible at realistic dep counts.

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

Recommendation

All prior follow-ups are folded and verified, the Copilot items are resolved, and CI is green. The delta panel found nothing new. The lifecycle-test rename captures the intended behavior change (install trims superseded roots instead of deferring to prune). No open items remain.

Folded in this run

  • (copilot) deps list uses prune's installed-case lookup (preserve_installed_case=True) -- resolved in d519bc2.
  • (copilot) The real-orphan warning for a package above a declared subdirectory holds at every depth -- resolved in d519bc2.
  • (copilot) The trim groups case-distinct entries per folded key and removes every one -- resolved in d519bc2.
  • (panel) Released/retained install paths computed once and shared on partial installs -- resolved in d519bc2.
  • (panel) Unit test for the deps list selector-input fallback -- resolved in d519bc2.
  • (panel) CLI-level deps list / deps tree / prune agreement after the switch, in project and user scope -- resolved in d519bc2.
  • (panel) Lifecycle-binary test of the reporter sequence -- resolved in 0a90953.
  • (doc drift) deps list docs state the stricter real-parent warning truthfully -- resolved in 48c4528.
  • (CI) Partial cleanup contexts without apm_modules_dir are tolerated (spec conformance), and the retained-root lifecycle test is updated to the [BUG] deps list incorrectly reports embedded skills as orphaned for subdirectory dependencies #2926 contract -- resolved in a6196d7.

Copilot signals reviewed

  • src/apm_cli/commands/deps/cli.py:397 -- LEGIT: deps list did not use prune's installed-case lookup, so a re-cased bundle's skills were flagged (resolved in d519bc2).
  • src/apm_cli/commands/deps/cli.py:403 -- LEGIT: the depth-3 ancestor cap silently cleared a deeper undeclared parent package (resolved in d519bc2).
  • src/apm_cli/install/phases/cleanup.py:458 -- LEGIT: case-folded dict keys dropped case-distinct entries on case-sensitive filesystems (resolved in d519bc2).

Regression-trap evidence (mutation-break gate)

  • test_declared_bundle_with_changed_repo_casing_lists_skills_as_bundled -- deleted preserve_installed_case=True; test FAILED as expected; guard restored.
  • test_undeclared_parent_deeper_than_repo_root_stays_orphaned -- restored the depth-3 ancestor cap; test FAILED as expected; guard restored.
  • test_deps_list_falls_back_to_declared_paths_when_selector_inputs_fail -- narrowed the fallback except Exception; test FAILED as expected; guard restored.
  • test_cli_deps_list_and_prune_agree_after_switch[project,user] and test_required_repo_to_subdirectory_switch_trims_superseded_checkout -- neutered the trim loop; tests FAILED as expected; guard restored.
  • test_switch_trims_case_distinct_entries_on_case_sensitive_filesystem -- kept one entry per folded key (run on a case-sensitive APFS volume); test FAILED as expected; guard restored.

Lint contract

The full CI lint mirror is silent on the merged head: ruff check and ruff format --check (src, tests, architecture linter scripts), pylint R0801 at 10.00/10, scripts/lint-auth-signals.sh, and scripts/lint-architecture-boundaries.sh.

CI

All required checks are green at d342fb7: Lint, Build & Test shards, Lifecycle Smoke shards, Spec conformance gate, Windows Compatibility Gate, Architecture Ratchet Contracts, CodeQL, and license/cla. One CI fix iteration was needed.

Mergeability status

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#3612 d342fb7 ship_now 2 9 0 2 green MERGEABLE BLOCKED pending required review

Convergence

2 outer iterations; 2 Copilot rounds. 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.

Avoids landing-order conflicts with other queued PRs.

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

Copy link
Copy Markdown
Collaborator Author

Lane L: main merged for landing

  • Pre-merge head: d342fb7fe6b9fa4178b1b1ceb9996c639f6c9da4
  • Merged origin/main c2c2e0d72c8e8c88f143099c73f40720b6529a4e (clean merge; GitHub reported DIRTY only on CHANGELOG.md, which this repo merges with merge=union).
  • New head: fcff97bac59682aa8790f6da462a734b612d2824
  • CHANGELOG: moved 1 bullet(s) in '### Fixed' after entry Security Policy missing the email address for security reports #10 of 18, 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-2926-deps-list-subdir-orphans (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 64830b4 into main Nov 12, 2026
26 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-2926-deps-list-subdir-orphans branch November 12, 2026 18:37
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] deps list incorrectly reports embedded skills as orphaned for subdirectory dependencies

2 participants