Skip to content

fix(compile): discover Claude dependency memory at arbitrary installed depth - #2952

Merged
Daniel Meppiel (danielmeppiel) merged 9 commits into
microsoft:mainfrom
vyrnsynx:fix/claude-compile-ado-three-level-deps
Sep 30, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 9 commits into
microsoft:mainfrom
vyrnsynx:fix/claude-compile-ado-three-level-deps

Conversation

@vyrnsynx

@vyrnsynx VyrnSynx (vyrnsynx) commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

fix(compile): discover Claude dependency memory at arbitrary installed depth

TL;DR

apm compile --target claude now imports dependency-root CLAUDE.md files through canonical manifest and lockfile materialization paths, rather than assuming a two- or three-directory layout. This fixes Azure DevOps and deeper generic-host/virtual-package layouts, including transitive dependencies installed with --root. Present invalid metadata fails explicitly instead of enabling filesystem fallback.

Fixes #2951.

Continues VyrnSynx (@vyrnsynx)'s original contribution without rewriting contributor history.

Important

This revision replaces the original three-level fallback approach. Arbitrary depth requires manifest/lockfile evidence; only the original two-level compatibility fallback remains when metadata is absent.

Advisory review does not replace CODEOWNERS approval, required CI, or existing maintainer holds. No governance labels were changed.

Problem (WHY)

  • ADO repositories materialize below organization/project/repository; other hosts and virtual packages can be deeper still. The original formatter missed those package memories. Project-specific memory supplies context the agent otherwise lacks: "Add what the agent lacks, omit what it knows".
  • Source declarations alone do not describe transitive dependencies installed at a redirected destination. Real install/compile/frozen replay exposed source-versus-selected-store admission gaps: "Refine with real execution".
  • Searching one additional directory level can mistake nested docs/CLAUDE.md for a package root. Root selection belongs to the existing materialization/lockfile owners, not a second host-depth policy: "Design coherent units".

Approach (WHAT)

# Fix Principle Source
1 Discover actual installed package roots from source declarations and the selected store's lock. "Add what the agent lacks, omit what it knows" Agent Skills
2 Keep path construction, read-only lock selection and scoped frozen admission with existing owners. "Design coherent units" Agent Skills
3 Exercise install, compile, replay, update and rejection through an installed CLI with local Git origins. "Refine with real execution" Agent Skills

Implementation (HOW)

File Intent and boundary
src/apm_cli/primitives/discovery.py Combine source declarations with the selected installation lock; delegate paths to DependencyReference.get_install_path() and LockFile.get_installed_paths(). Check each unique local-bundle root once.
src/apm_cli/compilation/claude_formatter.py Select source modules first, otherwise output modules; emit sorted unique output-relative imports; enforce metadata presence and containment. Preserve main's context-link resolution.
src/apm_cli/commands/compile/cli.py Admit existing selected deployment modules through core.scope.get_modules_dir(PROJECT). No new command or flag.
src/apm_cli/install/service.py Scoped frozen requests use core.scope.get_lockfile_dir(scope); unscoped API calls retain manifest-relative behavior. Missing-lock diagnostics identify the selected path.
src/apm_cli/install/errors.py Recovery retains the original installation options, including --root or --global. No suggested update of the wrong store.
src/apm_cli/deps/lockfile.py Read-only selection and reading distinguish absent metadata from dangling links, preserving modern-file precedence. Write/migration policy is unchanged.
.apm/architecture/owners/contracts-tooling.json Register discovery as a materialization-owner consumer.
scripts/architecture_linter/checks/contracts_test_taxonomy.py Extend existing materialization/read-only-lock guards. No new rule ID.
scripts/architecture_linter/checks/install_frozen_and_audit.py Extend the existing frozen-admission guard to require canonical scoped-lock selection.
tests/unit/compilation/test_claude_dependency_roots.py Real metadata/path matrices, selected-store precedence, malformed/dangling metadata, containment and deterministic per-root work.
tests/unit/compilation/test_claude_formatter.py Existing root-import tests now exercise real manifests instead of only fallback.
tests/unit/primitives/test_discovery_parser.py Assert canonical materialization and selected-store discovery behavior.
tests/unit/install/test_frozen_roots.py Real project/user source-versus-selected lock matrix, no-write snapshots and scope-preserving recovery text.
tests/integration/test_claude_dependency_import_lifecycle.py Installed-CLI normal/redirected install, compile, frozen replay, update and fail-closed transitions.
tests/integration/test_architecture_dependency_reference.py Regression trap for bypassing the materialization owner.
tests/integration/test_architecture_pack_lockfile_read.py Regression traps for dropping current/legacy metadata-presence handling.
tests/integration/test_architecture_owner_rule_mutations.py Frozen-store guard mutation assertion, without duplicating the primary rule inventory.
tests/test_lockfile.py Fixture-only alias=None compatibility correction after reproducing the untouched test failure on current main; original assertion and production alias validation retained.
tests/spec_conformance/test_lockfile_reqs.py Six real-file cases for existing frozen-admission/no-write and retained-source/virtual-case link obligations. No new arbitrary-depth discovery norm.
CONFORMANCE.json, CONFORMANCE.md Canonical generator updates only req-lk-006/022 test IDs and counts; specification, schema, requirement manifest and seed are unchanged.
docs/src/content/docs/reference/cli/compile.md Document arbitrary metadata-backed roots, bounded fallback and source/output selection.
docs/src/content/docs/reference/cli/install.md Canonical explanation of selected-store frozen replay under Deploy location.
packages/apm-guide/.apm/skills/apm-usage/commands.md Match CLI behavior and link to the canonical install guidance.
CHANGELOG.md Credit the contributor and describe arbitrary depth rather than a third hardcoded level.

Data flow

Dashed boxes identify the changed selection/discovery boundary; all path construction still routes through existing owners.

flowchart LR
    subgraph Sources
        M["Source manifest"]
        L["Selected current or legacy lock"]
    end
    subgraph Discovery
        S["Source store first; otherwise output store"]
        R["Canonical materialization roots at any depth"]
        V["Metadata validity and containment"]
    end
    subgraph Output
        C["Sorted output-relative CLAUDE imports"]
        E["Explicit failure; existing files preserved"]
    end
    M --> R
    S --> L
    L --> R
    R --> V
    V -->|"valid package-root memory"| C
    V -->|"invalid or escaping input"| E
    classDef new stroke-dasharray: 5 5;
    class S,R,V new;
Loading

Trade-offs

  • Retain metadata-absent two-level compatibility rather than recursively searching every CLAUDE.md; deeper roots must be declared or locked.
  • Preserve source-store precedence instead of merging unrelated source/deployment stores. Redirected output uses relative links; cross-drive output reports an actionable failure.
  • Treat dangling metadata as present and unreadable rather than silently substituting another filename or filesystem scan. Valid in-root links remain supported.
  • Keep the scoped compile-admission/frozen repairs bounded to canonical existing APIs; auth, download transport, lock schema and other target adapters are unchanged.
  • Test host-shaped URLs against fixture-owned local bare repositories rather than public services. This proves install/compile behavior, not live ADO authentication.

Benefits

  1. The installed CLI emits the exact four expected root-memory imports for GitHub, ADO, a deeper GitLab namespace and a nested virtual package.
  2. Successful frozen replay preserves lock bytes and normalized output; updating the fixture repository advances the installed locked content.
  3. Invalid selected metadata, missing selected frozen locks and escaping memory return exit 1 without changing source, deployment or isolated home artifacts.
  4. Both 500-file and 5,000-file local bundles perform one containment check per unique root.

Validation

Exact pushed candidate: b07dad61ab9035836e27a33ebfd0da3eddaaa53a, incorporating main d14fa7df98bd9d82cdd2703a7aa871a721374678.

The run used an installed Python 3.12 CLI, isolated HOME/APM/cache/config, and process-local URL rewriting to fixture-owned Git origins. Formatter, discovery, lockfile and install results were not mocked in the lifecycle scenarios.

Note

These are observed local results, not a claim that GitHub CI or human review is complete. Required remote checks are evaluated separately on the pushed head.

Executed functional and architecture consumer suite

With APM_E2E_TESTS=1 and APM_BINARY_PATH="$PWD/.venv/bin/apm", the isolated wrapper executed:

uv run --no-sync --extra dev pytest \
  tests/integration/test_claude_dependency_import_lifecycle.py \
  tests/unit/compilation/test_claude_dependency_roots.py \
  tests/unit/compilation/test_claude_formatter.py \
  tests/unit/primitives/test_discovery_parser.py \
  tests/unit/primitives/test_discovery_walk.py \
  tests/test_enhanced_discovery.py \
  tests/unit/install/test_frozen_roots.py \
  tests/test_lockfile.py \
  tests/integration/test_architecture_dependency_reference.py \
  tests/integration/test_architecture_pack_lockfile_read.py \
  tests/integration/test_architecture_owner_rule_mutations.py::test_frozen_preflight_uses_selected_lockfile_store \
  tests/unit/scripts/test_architecture_runner.py -q --tb=short
416 passed in 404.18s (0:06:44)

The current canonical lint chain also passed: Ruff check/format, Pylint R0801, YAML I/O, 2100-line limit, portable relative paths, auth boundary, architecture boundary, assertion quality and exact-test duplication.

Selected verbatim output from those commands:

All checks passed!
1887 files already formatted
[+] auth-signal lint clean
[+] assertion-quality ratchet clean: AQ001=4, AQ002=12
[+] exact test duplicate ratchet clean: 1247 files, 0 allowed duplicate group(s)

Mutation experiments removed canonical-root delegation, selected-lock routing, containment and registered guard conditions; the corresponding tests failed. Removing dangling-link handling and restoring repeated per-file containment produced 6 failed, 4 passed in 15.80s. All mutants were restored. The full 782-test consumer/owner-mutation catalog passed at prior candidate e10a3ac2; the post-main command above reran the affected owner mutation plus the complete architecture runner inventory, not the whole mutation catalog.

One earlier lifecycle attempt timed out during cached frozen replay. Its cause was not established. A bounded post-sync retry passed that step, exposed a line-wrapped diagnostic assertion, and the assertion was corrected without increasing the timeout or weakening exit/no-write checks.

Existing-requirement conformance evidence and CI recovery

The first remote spec run reported missing critical-path requirement citations. The bounded correction adds six real-file cases against existing obligations:

  • req-lk-006: project/user selected-store absent or missing-pin frozen rejection before writes, despite a valid source lock decoy.
  • req-lk-022: relative Claude links retain repository source spelling and case-sensitive virtual paths at four/six materialization segments.

These citations do not establish an arbitrary-depth discovery or import-selection norm. No specification body, version, schema, anchors, requirement manifest, seed, detector or waiver was changed. A source-decoy/lowercased-materialization mutation made all six new cases fail; restored cases pass.

Exact-head orphan checking, Mode B, full conformance, canonical generation and clean generated-file diff all passed:

[+] orphan_check OK: 123 requirements aligned across anchors / manifest / Appendix C / pytest markers
[+] mode_b: spec-concurrent edit detected; orphan_check owns this PR
273 passed, 2 skipped in 156.93s (0:02:36)
[+] wrote CONFORMANCE.json and CONFORMANCE.md

The two unchanged pre-existing skips cover publisher timestamp and path-policy schema harness limitations. None of the six new cases is skipped.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 My ADO and deeply nested host packages contribute all direct/transitive root memories. Portability by manifest, Vendor-neutral tests/integration/test_claude_dependency_import_lifecycle.py::test_deep_dependency_memory_install_compile_replay_update (regression-trap for #2951) e2e
2 Installing under --root, compiling, replaying frozen state and updating preserve the intended installation. Governed by policy, DevX Same lifecycle test, both parameter values e2e
3 A valid source lock cannot authorize a missing selected frozen lock; invalid selected metadata and escaping memory fail without writes. Secure by default, Governed by policy Same lifecycle test, [True] e2e
4 My source installation stays authoritative when I redirect compiled output. Portability by manifest tests/unit/compilation/test_claude_dependency_roots.py::test_source_modules_take_precedence_and_imports_resolve_from_output integration
5 Nested docs and unrecorded debris are not imported as dependencies. Secure by default tests/unit/compilation/test_claude_dependency_roots.py::test_nested_and_unrecorded_memory_not_imported; test_declared_root_without_memory_does_not_import_nested_docs integration
6 Project/user frozen validation checks the chosen store without altering either store. Governed by policy tests/unit/install/test_frozen_roots.py::test_frozen_scoped_lockfile_selection_is_read_only integration
7 Dangling current/legacy metadata fails closed; valid links and metadata-absent compatibility still work. Secure by default, DevX tests/unit/compilation/test_claude_dependency_roots.py::test_lock_metadata_links_preserve_precedence_and_fail_closed integration
8 Large local bundles do not repeat identical root-containment work per staged file. DevX tests/unit/compilation/test_claude_dependency_roots.py::test_local_bundle_containment_work_is_per_unique_root integration
9 Personal rules, Claude settings and hand-authored project/global memory survive the lifecycle. DevX, Secure by default tests/integration/test_claude_dependency_import_lifecycle.py::test_deep_dependency_memory_install_compile_replay_update e2e
10 Frozen selected-store absence/missing pins fail before writes even when source has a valid decoy lock. Governed by policy, Secure by default tests/spec_conformance/test_lockfile_reqs.py::test_frozen_selected_store_rejects_source_decoy_without_writes (req-lk-006, four cases) integration
11 Generated links preserve retained repository spelling and exact virtual-path case. Portability by manifest tests/spec_conformance/test_lockfile_reqs.py::test_claude_materialization_links_preserve_locked_source_and_virtual_case (req-lk-022, two cases) integration

The deterministic owner report identifies materialization identity, frozen mutation eligibility and read-only lock selection. Each is linked to executed exact-head functional evidence; the existing static guards and their mutation assertions are retained.

How to test

  • Restore the development environment with uv sync --extra dev; use the resulting .venv/bin/apm as the installed CLI.
  • Run the functional command above with the stated E2E environment variables. Expect both lifecycle variants to pass without public Git host access.
  • Run uv run --extra dev pytest tests/unit/compilation/test_claude_dependency_roots.py tests/unit/install/test_frozen_roots.py -q. Expect real-file invalid-metadata, selected-store and no-write cases to pass.
  • Run bash scripts/lint-architecture-boundaries.sh and the repository's canonical lint chain. Expect no owner-boundary or style violations.
  • Run the full tests/spec_conformance suite before python -m tests.spec_conformance.gen_statement, then git diff --exit-code CONFORMANCE.json CONFORMANCE.md. Expect unchanged generated statements and only the two existing skips.

Co-authored-by: Copilot [email protected]

Claude compile previously walked only apm_modules/owner/package, so
Azure DevOps installs at org/project/repo were omitted from the
Dependencies @import list. Prefer declared install roots, with a
shallow two- and three-level filesystem fallback for fixtures.

Fixes microsoft#2951

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 dependency-root handling and fallback-scan issues must be addressed before approval.

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

Pull request overview

Fixes Claude compilation to import dependency CLAUDE.md files from Azure DevOps three-level paths.

Changes:

  • Uses manifest and lockfile declaration order for dependency roots.
  • Adds two- and three-level filesystem fallback scanning.
  • Adds regression tests and a changelog entry.
File summaries
File Summary Review notes
tests/unit/compilation/test_claude_formatter.py Covers ADO and mixed dependency layouts. Add coverage for declared ADO dependencies and redirected-root handling.
src/apm_cli/compilation/claude_formatter.py Collects dependency imports from declarations and filesystem layouts. Moderate issues remain with redirected-root lockfile paths and ambiguous depth-three fallback scanning; nits request declaration-path tests and compile documentation.
CHANGELOG.md Records the bug fix. No direct comments.
Review details

Suppressed comments (3)

src/apm_cli/compilation/claude_formatter.py:256

  • When --root is paired with apm install --root, the manifest remains under source_dir but apm.lock.yaml and apm_modules are under base_dir. A manifest with any direct dependency makes declared non-empty, so this condition skips the base-root lookup; consequently transitive lockfile paths are never considered and their CLAUDE.md files (including three-level ADO packages) are omitted. Merge the deploy-root lockfile paths with the source manifest paths through the canonical declaration-order helper, and add a redirected-root regression test.
        declared = get_dependency_declaration_order(str(self.source_dir))
        if not declared and self.base_dir.resolve() != self.source_dir.resolve():
            declared = get_dependency_declaration_order(str(self.base_dir))

src/apm_cli/compilation/claude_formatter.py:286

  • The fallback cannot distinguish an ADO org/project/repo package from a GitHub owner/repo/docs/CLAUDE.md file when the GitHub package has no root CLAUDE.md. In that layout, this loop emits @apm_modules/owner/repo/docs/CLAUDE.md even though it is not a package root, so the generated context imports arbitrary nested documentation. Keep the depth-3 heuristic behind declaration/materialization metadata (or another package-root marker) rather than treating every third-level CLAUDE.md as an ADO package.
                for repo_dir in mid_dir.iterdir():
                    if not repo_dir.is_dir() or repo_dir.name.startswith("."):
                        continue
                    ado_claude = repo_dir / "CLAUDE.md"
                    if ado_claude.is_file():
                        dependencies.append(
                            f"@apm_modules/{owner_dir.name}/{mid_dir.name}/{repo_dir.name}/CLAUDE.md"

src/apm_cli/compilation/claude_formatter.py:240

  • This changes the user-visible contents of generated CLAUDE.md files, but the PR updates no Starlight page. Add a concise note to the compile documentation describing that Claude imports declared dependency-root CLAUDE.md files, including the ADO org/project/repo layout, so the documented compile behavior stays aligned with the implementation.
        Prefers installed package roots from ``apm.yml`` / lockfile declaration
        order (GitHub ``owner/repo``, Azure DevOps ``org/project/repo``, and
        virtual paths). Falls back to a shallow filesystem scan that understands
        both two-level and three-level layouts when no declarations are present
        (e.g. unit fixtures).
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

@sergio-sisternes-epam

Sergio Sisternes (sergio-sisternes-epam) commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

PR triage recommendation

needs-issue

Recommendation only, not merge or scope approval. A responsible
human maintainer must approve. Labels, automated advice, and
silence are not approval.

Linked issue

#2951 (open; area/multi-target, type/bug, triage/recommended; not status/accepted)

Proposed classification

area/multi-target, type/bug

Suggested next action

Wait for a maintainer to review and accept #2951 before treating this
PR as invited work. Do not open a duplicate issue.

Thank you for contributing this pull request. APM starts with an
issue, not an implementation
(https://github.com/microsoft/apm/blob/main/CONTRIBUTING.md).

#2951 already describes this bug and has automated issue-triage
advice, but it is not labelled status/accepted. A maintainer still
needs to review and accept that issue's scope first.

This PR is labelled status/deferred until that happens. CODEOWNERS
review requests (danielmeppiel, sergio-sisternes-epam) are unchanged.
This comment is advisory only and is not merge approval.


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

@sergio-sisternes-epam Sergio Sisternes (sergio-sisternes-epam) added triage/recommended Automated advice completed; not human scope approval. status/deferred Not invited for implementation now; no release commitment. area/multi-target Multi-target deploy spec, target directory creation, agent surface routing. type/bug Something does not work as documented. status/accepted Human scope approval; verify the issue's approval record and review contact before work. labels Sep 18, 2026
Preserve bounded metadata-free compatibility while supporting declared and locked materializations at arbitrary host and virtual-package depths. Route redirected compile admission and frozen replay through the existing installation-scope helpers, with real CLI lifecycle and containment regressions.

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

Copy link
Copy Markdown
Collaborator

APM Review Panel: needs_rework

Canonical dependency roots fix the depth assumption; selected-store rejection and one legacy metadata edge still need work.

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

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

This review covers local candidate 90d2720, including the merge of current main and the explicitly authorized selected-root compile/frozen-replay repairs. The candidate has not yet been pushed; the original contributor history is preserved. All seven panel participants ran on GPT-6 Astra.

The canonical path ownership repair supports arbitrary ADO, GitLab and virtual-package depth without a recursive memory scan. The supplied exact-head run passed 297 tests, including real installed-CLI install/compile/frozen replay/update against isolated local Git remotes, plus the full local lint/quality gates. These success-path results do not prove rejection survives compiler aggregation or that a rejected redirected install leaves all state untouched.

Panel summary

Persona B R N Takeaway
Python Architect 0 1 0 Canonical owners are retained; exercise failure propagation through the actual CLI.
Test Coverage 0 2 0 Add one rejected frozen transition and publish exact-head scenario/owner evidence.
Supply Chain Security 0 1 0 A dangling legacy lock must not activate metadata-free discovery.
Doc Writer 0 1 0 Put scoped frozen replay guidance in the install reference.
Performance 0 1 0 Validate each unique local-bundle root once, not once per staged file.
DevX UX 0 2 0 Recovery hints must preserve source-first selection and installation scope.

Counts express finding severity, not shipping authority.

Recommended folds

  1. Add real CLI malformed-selected-lock and escaping-memory tests, asserting failure diagnostics and unchanged output.
  2. Add a rejected install --root --frozen transition with a valid decoy source lock and no-write snapshots; publish the final scenario/test/tier and owner mapping.
  3. Recognize dangling legacy lock metadata through the existing read-only resolver, preserve modern precedence, and explicitly reject unreadable selected metadata.
  4. Make cross-drive and frozen recovery hints actionable under the actual selection policy; make the install reference canonical for frozen replay.
  5. Deduplicate local-bundle slugs before containment I/O, with an automated bounded-work guard.

Recommendation

Fold the bounded work and obtain a targeted review of the resulting head. The legacy-lock probe demonstrates an unrecorded in-store import edge, not an outside-store escape. The performance probe measured isolated helper work, not end-to-end latency. No finding is being waived.

P5 portability and P6 predictable behavior support the ownership repair; P4 requires useful recovery instructions. Preserve the existing acceptance/deferred labels and requested reviewers danielmeppiel and sergio-sisternes-epam. This advisory is not merge approval; GitHub CI and human review remain separate.

Architecture: reviewed candidate data flow
flowchart TD
    C["apm compile --target claude --root DIR"] --> V["[I/O] commands/compile/cli.py: _validate_project(source_root)"]
    V --> A{"Source content or core/scope.py get_modules_dir(PROJECT).exists()?"}
    A -->|No, live non-clean compile| X["commands/compile/cli.py: sys.exit(1)"]
    A -->|Yes| RUN["commands/compile/cli.py: _run_compilation -> AgentsCompiler.compile"]
    RUN -. compiler dispatch .-> F["compilation/claude_formatter.py: format_distributed -> _generate_placements"]
    F --> P{"Empty placement_map or root placement?"}
    P -->|No| CONTENT["_generate_claude_content: non-root placements without dependency imports"]
    P -->|Yes| D["[I/O] _collect_dependencies: inspect source_dir/apm_modules"]
    D --> SOURCE{"Source modules exists or is_symlink()?"}
    SOURCE -->|Yes| SRC["installed_root = source_dir"]
    SOURCE -->|No| DEPLOY["installed_root = base_dir"]
    SRC --> BOUND["[I/O] ensure_path_within(modules_root, installed_root); modules_root.is_dir"]
    DEPLOY --> BOUND
    BOUND -->|Not a directory| EMPTY["return empty list; no store substitution"]
    BOUND -->|Directory| META{"[I/O] Source apm.yml or selected resolve_lockfile_path_for_read path present?"}
    META -->|No| LEGACY["[I/O] owner/package fallback only; ensure_path_within owner"]
    META -->|Yes| ORDER["primitives/discovery.py: get_dependency_declaration_order(source_dir, installation_root)"]
    ORDER --> MAN["[I/O] APMPackage.from_apm_yml(source apm.yml); non-marketplace dep.get_install_path(modules_root)"]
    MAN --> LOCK["[I/O] deps/lockfile.py: resolve_lockfile_path_for_read(installed_root, read_only=True); LockFile.read"]
    LOCK --> ROOTS["[I/O] lock.get_installed_paths(modules_root); lock-backed local staging roots; stable dedup"]
    ROOTS --> VALID["validate_path_segments(relative)"]
    VALID --> FILE["[I/O] ensure_path_within(package_root, modules_root); ensure_path_within(CLAUDE.md, package_root)"]
    LEGACY --> FILE
    FILE --> EXISTS{"[I/O] claude_path.is_file()?"}
    EXISTS -->|No| OMIT["Omit this package; do not scan nested docs"]
    EXISTS -->|Yes| REL["portable_link_relpath(claude_path, base_dir)"]
    REL --> DRIVE{"Relative link available?"}
    DRIVE -->|No| FAIL["format_distributed catches exception: success=False, errors populated, empty content_map"]
    DRIVE -->|Yes| IMPORT["sorted unique output-relative @imports"]
    BOUND -->|Containment exception| FAIL
    ORDER -->|Metadata or materialization exception| FAIL
    FILE -->|Containment exception| FAIL
    IMPORT --> CONTENT
    EMPTY --> CONTENT
    CONTENT --> RESULT["ClaudeCompilationResult returned to compiler"]
    FAIL --> RESULT
    RUN --> AGG{"Returned aggregate result.errors?"}
    AGG -->|Yes| X
    AGG -->|No errors and no critical findings| OK["_run_compilation returns; normal CLI exit 0"]
    RESULT -. "Aggregation internals outside reviewed files; negative CLI guard requested" .-> AGG
    subgraph Frozen["install/service.py"]
      I["apm install --root DIR --frozen: InstallService.enforce_frozen"] --> SCOPE{"request.scope is not None?"}
      SCOPE -->|Yes| SELECT["core/scope.py: get_lockfile_dir(request.scope)"]
      SCOPE -->|No| MP["[I/O] choose directory from request.apm_package.package_path"]
      SELECT --> LP["[I/O] LockFile.read: selected apm.lock.yaml"]
      MP --> LP
      LP --> CHECK{"Lock present, readable, and satisfies manifest plus MCP view?"}
      CHECK -->|No| ERR["raise FrozenInstallError before pipeline"]
      CHECK -->|Yes| PASS["enforce_frozen returns"]
    end
Loading

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

Fold first-panel containment, lifecycle rejection, per-root discovery work and recovery guidance findings.

Co-authored-by: Copilot App <[email protected]>
Fresh main reproduced the untouched mock synthesizing an invalid alias. Declare the real contract's absent alias without changing assertions or production validation.

Co-authored-by: Copilot App <[email protected]>
Keep exact diagnostic tokens, rejected status and no-write snapshots while tolerating Rich line wrapping.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel Daniel Meppiel (danielmeppiel) changed the title fix(compile): include ADO three-level CLAUDE.md dependencies fix(compile): discover Claude dependency memory at arbitrary installed depth Sep 30, 2026
@danielmeppiel

Copy link
Copy Markdown
Collaborator

Docs sync advisory

Verdict: internal tooling error * Pages affected: undetermined * LLM calls: 1/15

The mandatory classifier could not access repository/filesystem tools and returned no schema-valid classification. This docs-sync run stopped rather than reporting that documentation was verified.

The PR already includes compile/install reference and bundled usage updates from the implementation review. Their targeted doc-writer delta review is tracked separately; it is not represented as a successful docs-sync classification.

No labels, review requests or implementation scope were changed.


Generated by docs-sync. This comment is AI-generated and may contain errors.

@danielmeppiel

Copy link
Copy Markdown
Collaborator

APM Review Panel: needs_discussion

The prior implementation findings are closed on 2564296. Remote spec-conformance failure still prevents a final readiness conclusion.

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

All seven participants ran on GPT-6 Astra. This is the targeted follow-up to the first advisory, not a new full panel.

Persona Findings Delta result
Python Architect 0 Executed negative CLI scenarios close the propagation gap; canonical read-only lock ownership is retained.
Test Coverage 0 Independently reran redirected lifecycle rejection and update: 1 passed in 65.16s; focused fixtures: 52 passed in 11.79s. Scenario and all three owner mappings are present.
Supply Chain Security 0 Dangling current/legacy locks fail closed; selected invalid metadata and escaping memory have real CLI no-write evidence.
Doc Writer 0 Install guidance is canonical, links agree, and arbitrary-depth/source-store claims match code.
Performance 0 Unique-root containment closes repeated work; 500/5000 entry operation-count guards need no timing threshold or cache.
DevX UX 0 Cross-drive and frozen recovery respect source precedence and installation scope.

Evidence and limits

The exact-head implementation run passed 782 tests in 406.17s, with the complete local lint/architecture/quality chain. The independent lifecycle rerun checks exit 1 and unchanged source/deployment/HOME snapshots for rejected selected-store state, then restores fixture state and completes update/compile.

The bundle guard counts work over lockfile entries, not physical staging or elapsed-time improvement. Cross-drive diagnostics are simulated unit evidence, not native Windows proof. Local Git fixtures do not certify live-host authentication. The failed docs-sync classifier is disclosed separately; docs confidence here comes from the actual doc-writer review.

Recommendation

The CEO retires the earlier implementation-level needs_rework: no specialist recommends further code work in this reviewed delta. The genuine current stance is needs_discussion, because Spec conformance run 36692541726 failed before running conformance tests. Its Mode B detector reports substantive critical-path changes without matching spec citation. This must receive a truthful conformance-evidence disposition, not a false no-behavior-change waiver.

CI, CodeQL, Deploy Docs, NOTICE and Merge Gate succeeded on this head, but those successes do not cancel the spec failure. GitHub reports MERGEABLE / BLOCKED. Requested CODEOWNERS review and existing maintainer holds remain separate from this advisory. Contributor history, requested reviewers, and both acceptance/deferred labels are preserved. No merge approval is implied.


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

Exercise existing req-lk-006 selected-store rejection and req-lk-022 source-spelled materialization-relative links. Regenerate statements without new normative requirements or a waiver.

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

Copy link
Copy Markdown
Collaborator

APM Review Panel: ship_now

PR #2952 restores metadata-backed Claude dependency imports across installed layouts; exact-head conformance and CI now close the prior technical readiness gap.

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

All three participants ran on GPT-6 Astra against b07dad6, incorporating main d14fa7d. This is a targeted final delta, not another full panel.

The genuine CEO recommendation is ship_now. The two current specialists report zero findings and independently verified continuity of the reviewed source/test files after the main merge. The prior needs_discussion concerned remote spec-conformance evidence; that failure is now resolved by six real-file tests against existing req-lk-006 and req-lk-022, with canonical generated statements and successful remote checks.

The citations prove selected-store absent/missing-pin frozen rejection before writes, and retained repository spelling plus case-sensitive virtual paths in relative links. They do not establish an arbitrary-depth discovery or import-selection norm. No specification body, version, schema, requirement manifest, seed, detector or waiver was changed.

Aligned with: portable metadata-backed materialization, fail-closed admission, canonical ownership and preservation of contributor work and human governance.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 Exact-head applicability, requirement boundaries and generated-file fidelity hold; no parallel authority introduced.
Test Coverage 0 0 0 Independently executed all six conformance cases: 6 passed in 1.95s. Current and historical evidence are correctly separated.

Recommendation

The scoped technical work is ready for the maintainers' decision, with no in-scope technical follow-ups deferred. This advisory is not human approval or merge authorization. GitHub reports MERGEABLE / BLOCKED; requested CODEOWNERS danielmeppiel and sergio-sisternes-epam, and both status/accepted and status/deferred, remain unchanged. No merge, auto-merge, reviewer request or governance-label change was performed.

After the CEO return, the driver passed the completion schema and the deterministic terminal owner verifier: verified=true, terminal_evidence_required=true, three touched owners with executed exact-head functional coverage. This is not the earlier nonterminal shortcut.

Executed evidence, closed findings and limits

Exact b07dad6 evidence

  • Local installed-CLI lifecycle, affected consumers, applicable static regressions and complete architecture runner inventory: 416 passed in 404.18s.
  • Full conformance: 273 passed, 2 unchanged pre-existing skips; orphan check aligned 123 requirements; Mode B, canonical generation and clean regeneration passed.
  • Complete current lint/architecture/test-quality chain passed. All mutants were restored; six new conformance cases failed under the source-decoy/case-folding mutants before passing unmutated.
  • All 23 observed remote rollup entries completed with success, neutral or skipped conclusions; actual Linux and Windows execution succeeded, not merely skipped checks. The separately queried required gate succeeded.
  • CI, including Windows and lifecycle, Spec conformance, CodeQL, Docs build, NOTICE, and aggregate gate succeeded.
  • Remote spec execution independently reports 273 passed, 2 skipped in 15.49s, with successful orphan, Mode B, generation and clean-diff steps.

Folded in this run

Finding Resolution
Missing command-level negative compile/frozen evidence 60c2e30e78: installed-CLI selected-store and escaping-memory rejection with exit 1, diagnostics and unchanged source/deployment/HOME snapshots.
Dangling legacy metadata treated as absence 60c2e30e78: canonical reader/resolver recognize present dangling links while retaining modern-lock precedence.
Recovery could target the wrong store 60c2e30e78: source-aware cross-drive guidance and scope-preserving frozen recovery.
Frozen replay documentation lacked one canonical home 60c2e30e78: install reference owns guidance; compile and bundled usage link to it.
Repeated bundle-root containment work 60c2e30e78: unique-root validation with deterministic 500/5000-entry regression guards.
Scenario/owner attribution and stale PR narrative Final description and version-2 evidence name b07 and distinguish executed tiers and earlier-head results.
Missing critical-path conformance citation e10a3ac2ad: approved req-lk-006/022 real-file evidence and canonical statement updates; no normative expansion.

Copilot signals reviewed

All four original signals were LEGIT and addressed: real declared ADO/lock tests, redirected transitive roots, exclusion of nested-doc fallback, and compile documentation (90d2720586, with later lifecycle strengthening). The original inline thread was replied to and resolved. Three suppressed signals came from review 5182412895; no new classification round was started.

Limits retained

The 782-test catalog is prior e10a evidence, not the current 416-test run. Local Git origins exercise host-shaped installation behavior, not live ADO authentication. Cross-drive diagnostics are simulated locally; the independent Windows CI is reported separately. Bundle tests count containment operations rather than claim elapsed-time speedups. The two conformance skips are unchanged publisher/path-policy harness limitations.

The prior docs-sync classifier tool-access error remains publicly disclosed; documentation confidence comes from the separate genuine doc-writer review, not a fabricated classifier success. This evidence-only delta changes no user-facing documentation.

Counters remain outer 3/4, Copilot 2/2, CI recovery 1/3. No loop reset or replacement driver.


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

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit dddd86c into microsoft:main Sep 30, 2026
23 checks passed
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Sep 30, 2026
Preserve landed Claude discovery and selected-store authority from #2952, OpenCode enabled semantics from #3102, and package-remote marketplace tags from #3044. Union existing dependency-identity selectors with the standalone reader/frozen routes; regenerate combined conformance. No unmerged prerequisite branch is imported.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/multi-target Multi-target deploy spec, target directory creation, agent surface routing. status/accepted Human scope approval; verify the issue's approval record and review contact before work. status/deferred Not invited for implementation now; no release commitment. triage/recommended Automated advice completed; not human scope approval. type/bug Something does not work as documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Claude compilation omits CLAUDE.md from three-level dependencies

4 participants