Skip to content

feat(policy): host-qualified dependency allow/deny patterns - #3606

Merged
Daniel Meppiel (danielmeppiel) merged 19 commits into
mainfrom
danielmeppiel-issue-3509-host-qualified-dep-patterns
Nov 12, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 19 commits into
mainfrom
danielmeppiel-issue-3509-host-qualified-dep-patterns

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Description

TL;DR

Dependency policy allow / deny patterns can now name a host (github.com/example-org/**, ghes.corp.example/**). Every dependency — direct or transitive, written with a host or defaulting to GITHUB_HOST / github.com — is matched against its effective host, exactly. Hostless patterns keep matching any host, so existing policies behave as before. apm audit now also gates locked transitive dependencies.

Important

One deliberate compatibility edge: a pattern whose first segment contains a dot is now read as a host. A hostless pattern for a dotted GitLab group (my.group/**) must be written gitlab.com/my.group/**. GitHub org names cannot contain dots, so default-host policies are unaffected. Called out in CHANGELOG and docs.

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

Problem (WHY)

  • Policy matching used get_canonical_dependency_string(), which omits the host. example-org/** admitted example-org/* on any host, including unapproved ones; host-qualified patterns never matched anything (pinned by the old test test_host_qualified_pattern_does_not_match_host_blind_policy_identity).
  • Enterprises cannot express "any org on our GHES/GHE.com hosts, only example-org on github.com" — the exact policy in [Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments #3509.
  • A shorthand example-org/repo silently follows GITHUB_HOST; a host-blind allow list could not reject it when that host is unapproved.
  • [!] apm audit evaluated allow/deny on manifest (direct) deps only, so a transitive from an unapproved host passed audit even though install would see it.

Approach (WHAT)

# Fix
1 Host recognition rule in the identity owner: first segment containing . is a host (mirrors host-qualified dependency shorthand). Host matched literally, ASCII-case-folded, port ignored; no wildcard expansion in the host.
2 Each DependencyReference exposes policy_host: written host, else default_host(); None for local paths.
3 Matcher skips a host-qualified pattern unless its host equals the dependency's effective host, then glob-matches the remaining path with the existing case rules. Hostless patterns unchanged.
4 apm audit adds lockfile transitive entries (depth > 1) to the allow/deny subject set only; require / pin / depth checks keep their existing inputs.
5 Violation details name the host (ghes.other.example/example-org/repo: not in allowed sources).

Implementation (HOW)

  • src/apm_cli/models/dependency/identity.py — new normalize_policy_host() and split_policy_pattern_host(); the single owner for host recognition and host casing (matcher stays free of .lower() per the existing architecture guard).
  • src/apm_cli/models/dependency/reference.py — DependencyReference.policy_host property.
  • src/apm_cli/policy/matcher.py — host gate in _first_matching_dependency_pattern; dependency_policy_subject() for diagnostics; protocol gains policy_host. Raw-string check_dependency_allowed(str, …) API unchanged.
  • src/apm_cli/policy/policy_checks.py — run_dependency_policy_checks(source_deps=…) (defaults to deps_to_install, so install is unchanged); _audit_source_dependencies() for the audit wrapper.
  • scripts/architecture_linter/checks/contracts_dependency_policy.py — existing contracts-tooling-policy-identity guard now also requires the matcher to route host splitting through the identity owner and forbids redefinition of the new helpers (verified: injecting .lower() into the matcher host compare trips the guard).
  • Docs — enterprise/policy-reference.md (new Host-qualified patterns section), reference/policy-schema.md, packages/apm-guide/.apm/skills/apm-usage/governance.md, OpenAPM spec (below), CHANGELOG.

Diagrams

How one pattern is evaluated against one dependency (new behavior boxed in the host gate):

flowchart LR
    P["policy pattern"] --> S{"first segment contains a dot?"}
    S -- "no: hostless" --> G["glob-match path<br/>(existing case rules)"]
    S -- "yes: host-qualified" --> H{"pattern host == dependency effective host?"}
    H -- "no" --> X["skip pattern"]
    H -- "yes" --> G
    D["dependency"] --> E["effective host<br/>written host, else GITHUB_HOST / github.com"]
    E --> H
    G --> R["match / no match"]
Loading

Trade-offs

  • Dot rule vs. trying both interpretations. Treating a dotted first segment as both host and hostless path would let a GitLab group named ghes.corp.example satisfy ghes.corp.example/** — the lookalike attack this issue closes. Chose one unambiguous rule; dotted-group hostless patterns need their host.
  • Ports ignored. The SSH (:7999) and HTTPS (:443) forms of one host must give identical results; keeping ports would break that.
  • No host wildcards. *.corp.example/** matches nothing, keeping "exact host, no implicit subdomains" literal.
  • Audit transitive scope. Only allow/deny consume lockfile transitives; widening require/pin inputs would change unrelated semantics.
  • Registry / proxy deps match the host they are fetched from (their declared host), consistent with "explicit host".

Benefits

  1. The [Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments #3509 policy (two enterprise hosts + one github.com org) is expressible and enforced.
  2. example-org/**-style lookalike admission across hosts is closable with one host-qualified line.
  3. Shorthand, HTTPS and SSH forms of a package give identical decisions (parametrized test across 5 policies × 9 forms).
  4. Transitive deps are gated at both install and audit.
  5. Existing hostless policies are unchanged (dedicated compatibility tests).

Issue and approved scope

Issue: Fixes #3509

Human scope-approval comment: #3509 (comment) (Daniel Meppiel (@danielmeppiel), review contact Daniel Meppiel (@danielmeppiel))

Completes the issue: every "Done when" item is covered by a test in tests/unit/policy/test_dependency_policy_host.py (default-host gating incl. GITHUB_HOST, explicit hosts, lookalike/subdomain rejection, form equivalence, transitive install + audit, hostless compatibility, host-recognition rule incl. dotted GitLab groups) and docs are updated. Out of scope and untouched: lockfile identity (#773), MCP/registry source policy, new CLI flags, separate allowed-hosts setting.

Type of change

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

Testing

  • Tested locally
  • All existing tests pass (targeted files; full suites are CI's job per maintainer instruction)
  • Added tests for new functionality (if applicable)

TDD + mutation-break: the new tests were red before the fix; disabling the host gate in the matcher fails 18 tests, dropping _audit_source_dependencies fails the 2 audit-transitive tests; both restored.

Local validation commands and results
.venv/bin/python -m pytest -p no:xdist -q tests/unit/policy/ tests/unit/install/test_policy_gate_phase.py \
  tests/unit/install/test_dry_run_policy.py tests/unit/test_audit_policy_command.py tests/spec_conformance/test_policy_reqs.py
1426 passed, 1 xfailed, 63 subtests passed

.venv/bin/python -m pytest -p no:xdist -q tests/integration/test_architecture_owner_rule_mutations.py -k policy
15 passed, 549 deselected

.venv/bin/python -m tests.spec_conformance.orphan_check
[+] orphan_check OK: 137 requirements aligned across anchors / manifest / Appendix C / pytest markers

Lint mirror (after merging origin/main): ruff check + ruff format --check (src, tests, scripts paths) -> clean;
pylint R0801 -> 10.00/10; scripts/lint-auth-signals.sh -> clean; scripts/lint-architecture-boundaries.sh -> exit 0;
file-length guard (2100) -> no violations.

Scenario evidence

User promise Test Principle
github.com/example-org/** admits example-org/repo on the default host, rejects it when GITHUB_HOST is unapproved TestDefaultHostDependencies Secure by default
Lookalike / subdomain hosts never match test_lookalike_and_subdomain_hosts_do_not_match Secure by default
Shorthand / HTTPS / SSH equivalent TestReferenceFormsAreEquivalent Portability
Existing hostless policies unchanged TestHostlessCompatibility Backward compatibility
Transitives gated at install and audit TestTransitiveDependencies Governance

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md — req-pl-018 clause (a) no longer says the subject is host-blind-only; new clause (g) defines host-qualified patterns; §6.3.1 allow row, req-rpl-002 and threat §10.8 updated. No new req id, so no Appendix C row change.
  • Manifest edit: docs/public/specs/manifests/openapm-v0.1.requirements.yml req-pl-018 notes extended.
  • Test edit: test_policy_host_qualified_patterns_match_effective_host (@pytest.mark.req("req-pl-018")).
  • CONFORMANCE.{md,json} regenerated via python -m tests.spec_conformance.gen_statement (req-pl-018 test_count 1 → 2).
  • N/A

How to test

  • apm-policy.yml with dependencies.allow: ["github.com/example-org/**"]; apm install example-org/<repo> passes, apm install other-org/<repo> is blocked.
  • Same policy with GITHUB_HOST=ghes.other.example: example-org/<repo> is blocked, detail names ghes.other.example/….
  • Add a transitive from an unlisted host to apm.lock.yaml; apm audit --ci --policy <file> fails dependency-allowlist.

Co-authored-by: Copilot [email protected]

Every dependency, direct or transitive, is matched against its effective
host: the written host, or GITHUB_HOST / github.com by default. A pattern
whose first segment contains a dot names a host matched exactly (case and
port ignored, no lookalikes or subdomains); hostless patterns keep matching
every host. Shorthand, HTTPS and SSH references give the same result.
apm audit now also checks locked transitive dependencies; violation
details name the host. Amends OpenAPM req-pl-018 with clause (g).

Fixes #3509

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

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

Critical host-normalization flaws can bypass deny rules, while audit checks miss effective replacement sources and direct dev dependencies, allowing unapproved hosts to escape enforcement.

3 open issues
What changed in this PR

Adds host-qualified dependency allow/deny patterns to APM’s policy engine, supporting multi-host enterprise source restrictions requested in #3509 without changing lockfile identity.

Changes:

  • Matches host-qualified patterns against dependencies’ effective hosts and includes hosts in violation details.
  • Extends audit source checks to locked transitive dependencies.
  • Adds regression and conformance coverage, architecture checks, and policy documentation.
File Description
tests/​unit/​policy/​test_dependency_policy_host.py Tests host matching, reference forms, compatibility, and transitives.
tests/​unit/​policy/​test_dependency_identity_case.py Updates expectations for host-qualified matching.
tests/​spec_conformance/​test_policy_reqs.py Adds effective-host conformance coverage.
src/​apm_cli/​policy/​policy_checks.py Adds audit source inputs and host-aware diagnostics.
src/​apm_cli/​policy/​matcher.py Gates patterns by host before matching package paths.
src/​apm_cli/​models/​dependency/​reference.py Exposes the effective policy host.
src/​apm_cli/​models/​dependency/​identity.py Centralizes policy-host normalization and pattern splitting.
scripts/​architecture_linter/​checks/​contracts_dependency_policy.py Enforces centralized host-policy logic.
packages/​apm-guide/​.apm/​skills/​apm-usage/​governance.md Documents host-qualified governance patterns.
docs/​src/​content/​docs/​specs/​openapm-v0.1.md Defines host-aware policy semantics.
docs/​src/​content/​docs/​reference/​policy-schema.md Updates dependency-pattern reference guidance.
docs/​src/​content/​docs/​enterprise/​policy-reference.md Adds enterprise examples and matching rules.
docs/​public/​specs/​manifests/​openapm-v0.1.requirements.yml Extends req-pl-018 notes with host semantics.
CONFORMANCE.md Updates req-pl-018 test count.
CONFORMANCE.json Records the new conformance test.
CHANGELOG.md Announces host policies and the dotted-group compatibility change.

Review effort: Balanced

Comment thread src/apm_cli/policy/policy_checks.py Resolved
Fixes the red CI on #3606: a first pattern segment beginning with a dot
(./packages/**, ../shared/**) was read as a host, so a deny on a local
dependency's canonical path silently stopped matching (failing
test_dependency_policy_evaluates_the_selected_source and the
req-pl-018/source-replacement conformance test). Host names never begin
with a dot, so such segments now stay hostless.

Also folds the two other in-scope Copilot findings:
- normalize_policy_host strips a valid :port, so GITHUB_HOST with a port
  matches (and is denied by) the same host-qualified rules.
- apm audit gates the effective direct sources (production, dev, and
  replace-selected) via project_manifest_dependencies, plus lockfile
  transitives; an unbindable replace table is a failing check.

Spec req-pl-018(g), policy docs, apm-usage governance guide and CHANGELOG
updated. Addresses Copilot inline on identity.py:190, identity.py:206 and
policy_checks.py:1423.

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Host-qualified dependency allow/deny gives APM host-aware supply-chain admission; the panel converges on one defense-in-depth gap (DNS trailing-dot bypass) and one upgrade-comms item.

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

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

This PR delivers the core capability that closes the multi-host policy bypass: every dependency, direct and transitive, is now resolved to its effective host before allow/deny evaluation. The architecture is clean -- identity.py owns normalization, matcher.py owns host routing, and an architecture-linter contract prevents redefinition. The python-architect found only cosmetic nits (defensive list copy, type annotations), which is a strong signal for a change of this scope. The C1-C3 folds from the prior Copilot inline review are each covered by mutation-verified regression tests, and the 1,384-test policy suite is green. The spec-guardian panel (4 editors, shocked avg 7.75, no blockers) independently validated the req-pl-018 clause (g) text.

The highest-signal finding is the trailing-dot FQDN bypass, independently flagged by both the supply-chain-security-expert and the spec-guardian panel. Evidence outcome is 'missing' on a secure_by_default surface: when GITHUB_HOST contains a trailing DNS dot (e.g. 'ghes.corp.example.'), normalize_policy_host preserves it, so deny rules written without the dot silently fail open. The fix is a single rstrip('.') plus one regression test. Low real-world probability (GITHUB_HOST trailing dots are rare), but the failure mode is silent deny bypass on the org admission gate, and it falls squarely within the approved scope's 'exact host matching' commitment. This should be folded before landing.

The second cluster is upgrade communication. The CHANGELOG's Added entry names the dotted-segment reinterpretation as a rewrite tip, but does not name the security consequence for deny patterns: an existing deny on 'my.group/' silently stops denying after upgrade (fail-open). The doc-writer correctly calls for a separate Changed or Security entry naming that consequence, plus a note that wildcard host patterns such as '*.corp.example/' match nothing. Both are in-scope documentation updates and close the last gap between what the code does and what users read before upgrading.

Dissent. No dissent between panelists. All four personas agree on severity levels and no finding contradicts another. Notable convergence: supply-chain-security-expert and the independent spec-guardian panel both flagged the trailing-dot FQDN gap without coordination, reinforcing its signal.

Aligned with: secure by default: Deny rules now bind to a specific host, closing the multi-host bypass where a dep on ghes.corp.example evaded github.com-scoped deny rules. One trailing-dot edge remains unfixed. governed by policy: Host-qualified patterns give org admins per-host admission control in apm-policy.yml without requiring separate policy files per host; hostless patterns unchanged for backward compat. multi harness multi host: The core unlock -- dependencies from different Git hosts are now distinguished in policy evaluation, matching APM's multi-host dependency model. pragmatic as npm: Hostless patterns keep working unchanged; the dotted-segment reinterpretation only affects patterns that were already ambiguous (GitHub org names cannot contain dots).

Panel summary

Persona B R N Takeaway
Python Architect 0 0 2 Host-qualified policy matching cleanly respects canonical-owner discipline; identity helpers, protocol, and arch-linter guard are well-placed.
Supply Chain Security Expert 0 1 0 Host-qualified policy matching is architecturally sound; one defense-in-depth gap: trailing-dot FQDN in GITHUB_HOST silently bypasses deny rules.
Test Coverage Expert 0 1 0 All Done-when host-matching scenarios have regression traps; C1-C3 folds each tested. One gap: unbindable-replace audit error path lacks a test.
Doc Writer 0 2 1 Docs match the code, contain only ASCII and cross-link well. One gap: a dotted or wildcard-host deny pattern now silently matches nothing, and no page says so.

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

Top 5 follow-ups

  1. [Supply Chain Security Expert] Strip trailing DNS dot in normalize_policy_host; add GITHUB_HOST trailing-dot regression test. -- Missing-test evidence on a secure_by_default surface. Silent deny-rule bypass when GITHUB_HOST has a trailing dot. One-line fix (rstrip) + one test. In the PR's approved scope ('exact host matching, no lookalike domains').
  2. [Doc Writer] Add a CHANGELOG Changed or Security entry naming the deny-side consequence of the dotted-segment host reinterpretation. -- Existing deny on 'my.group/**' silently fails open after upgrade. The Added entry names the rewrite but not the security consequence. In the PR's approved scope ('policy docs updated').
  3. [Doc Writer] State in policy-reference.md and governance.md that a wildcard host pattern (e.g. '*.corp.example/**') matches no dependency. -- Users from glob conventions expect expansion in the host segment; silence is a deny-disablement trap. In scope ('host-recognition rule unambiguous').
  4. [Test Coverage Expert] Add a test exercising the unbindable-replace audit error path (ValueError -> failing dependency-sources check). -- Missing-test evidence on the new audit error path introduced by the C3 fold. The try/except at policy_checks.py:1422 has no regression trap. In scope (audit path was added in this PR).
  5. [Python Architect] Wrap project_manifest_dependencies return in list() inside _audit_source_dependencies before appending. -- Defensive copy prevents invisible aliasing coupling. Nit severity, zero cost. In scope.

Architecture

classDiagram
    direction LR
    class DependencyReference {
        <<Entity>>
        +host str
        +is_local bool
        +policy_host str or None
        +get_canonical_dependency_string() str
    }
    class identity_py {
        <<CanonicalOwner>>
        +normalize_policy_host(host) str
        +split_policy_pattern_host(pattern) tuple
        +normalize_package_policy_identity(value) str
    }
    class _DependencyPolicySubject {
        <<Protocol>>
        +policy_host str or None
        +get_canonical_dependency_string() str
    }
    class PolicyMatcher {
        <<Strategy>>
        +check_dependency_allowed(dep, policy)
        +dependency_policy_subject(dep) str
    }
    class PolicyChecks {
        <<Facade>>
        +run_dependency_policy_checks(deps, policy)
        +run_policy_checks(root, policy)
    }
    class ArchLinter {
        <<StaticGuard>>
        +check_policy_identity(provider)
    }
    DependencyReference ..|> _DependencyPolicySubject : implements
    DependencyReference ..> identity_py : policy_host delegates to
    PolicyMatcher ..> _DependencyPolicySubject : depends on
    PolicyMatcher ..> identity_py : host split and casing
    PolicyChecks ..> PolicyMatcher : delegates matching
    ArchLinter ..> identity_py : guards helper uniqueness
    ArchLinter ..> PolicyMatcher : guards delegation calls
Loading
flowchart TD
    A["apm audit / apm install"] --> B["run_policy_checks or install policy gate"]
    B --> D["source deps: effective direct deps + locked transitives"]
    D --> J["run_dependency_policy_checks"]
    J --> K["allowlist / denylist checks"]
    K --> L["check_dependency_allowed (matcher.py)"]
    L --> N["split_policy_pattern_host (identity.py)"]
    N --> O{"host-qualified pattern?"}
    O -- yes --> P{"pattern host == dep.policy_host?"}
    P -- no --> Q["skip pattern"]
    P -- yes --> R["glob-match path (existing case rules)"]
    O -- no --> R
    R --> S{"match?"}
Loading

Recommendation

The architecture is sound, the test suite is green, and the spec-guardian panel found no blockers. The trailing-dot rstrip fix (follow-up 1) and the CHANGELOG deny-consequence entry (follow-up 2) are both one-line, in-scope changes that should be folded before landing -- they close the last gap between the approved scope's 'exact host matching' promise and what ships. The remaining follow-ups (wildcard-host docs note, unbindable-replace test, two nits, link dedup) are low-cost in-scope cleanups suitable for the same PR or an immediate successor.


Full per-persona findings

Python Architect

  • [nit] _audit_source_dependencies mutates the list returned by project_manifest_dependencies via .append() at src/apm_cli/policy/policy_checks.py:1358
    Safe today (fresh list) but invisible aliasing coupling; defensive list() copy costs nothing.
    Suggested: deps = list(project_manifest_dependencies(manifest))
  • [nit] New source_deps parameter and _audit_source_dependencies lack type annotations at src/apm_cli/policy/policy_checks.py:1193
    Codebase standard is type hints on public APIs; cheap to add.
    Suggested: source_deps: Iterable[DependencyReference] | None = None; _audit_source_dependencies(manifest: APMPackage, lock: LockFile | None) -> list[DependencyReference]

Supply Chain Security Expert

  • [recommended] normalize_policy_host does not strip DNS trailing dot, enabling a deny-rule bypass when GITHUB_HOST contains one. at src/apm_cli/models/dependency/identity.py:193
    GITHUB_HOST='ghes.corp.example.' gives policy_host 'ghes.corp.example.' which misses deny 'ghes.corp.example/' (silent fail-open). Explicit-host references reject trailing dots at parse time, but default_host() from env does not. Low probability, silent failure mode.
    Suggested: rstrip a trailing '.' in normalize_policy_host; add a GITHUB_HOST trailing-dot regression test.
    Proof (missing at): tests/unit/policy/test_dependency_policy_host.py -- proves: A deny rule for ghes.corp.example/
    blocks shorthand deps when GITHUB_HOST has a trailing dot.

Test Coverage Expert

  • [recommended] New dependency-sources audit error path (unbindable replace table) has no regression trap at src/apm_cli/policy/policy_checks.py:1422
    run_policy_checks now aborts with a failing dependency-sources check when project_manifest_dependencies raises ValueError; no test exercises it (grep confirmed).
    Suggested: Add TestAuditDirectSources test with an unbindable replace rule asserting a failing dependency-sources check.
    Proof (missing at): tests/unit/policy/test_dependency_policy_host.py -- proves: When a replace rule cannot bind, apm audit reports a clear dependency-sources error

Doc Writer

  • [recommended] An existing deny pattern with a dotted first segment silently stops denying after upgrade; docs present it only as a rewrite tip inside an Added entry at CHANGELOG.md:12
    my.group/** is now host 'my.group'; for deny that is fail-open. Upgrade notes should name the security consequence under ### Changed.
    Suggested: Separate ### Changed entry naming the deny consequence; one line in policy-reference.md.
  • [recommended] Docs do not say a wildcard host pattern such as .corp.example/* matches nothing, which disables a deny at docs/src/content/docs/enterprise/policy-reference.md:419
    Host segment compared literally; readers from glob conventions expect expansion.
    Suggested: State that such a pattern matches no dependency; list each host explicitly. Same in governance.md.
  • [nit] policy-schema.md restates the host-recognition rule at line 147 without linking the canonical table at docs/src/content/docs/reference/policy-schema.md:147
    State once, reference elsewhere.
    Suggested: Replace parenthetical with a link to Host-qualified patterns.

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.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Spec Guardian: fold_and_ship

Scope: editorial-patch (operator-directed; Wave 0 would classify the spec delta as editorial-only by size, but it adds normative clause (g) to req-pl-018); diff = +30/-12 lines across 2 file(s). Shocked-meter avg: 7.75/10.

All four panels converge on ship_with_followups with zero blocking findings and a shocked_meter average of 7.75. The seven fold-now items are surgical, single-section edits addressing two convergent themes (require-field exclusion sentence flagged by swagger and OCI; comma splice flagged by swagger and TAG) plus five standalone improvements (numeric-only port grammar matching the implementation, trailing-dot normalization that the supply-chain code reviewer also flagged, Appendix D revision row, glossary-term anchor for the default host, deny-row table parity). No fold crosses the approved scope boundary; F4 pairs with a one-line code change in normalize_policy_host.

The single deferred item (F8, req-mf-019 default_host: integration) is the highest-signal follow-up: once the implementation consults the manifest default_host: field for dependency-policy evaluation, clause (g) should delegate to req-mf-019. Recommend fold_and_ship after F1 through F7.

Convergence

Panel Stance Shocked New B New R New N
Spec Swagger Editor ship_with_followups 8/10 0 1 2
Spec OCI Editor ship_with_followups 7/10 0 1 1
Spec Pkgmgr Editor ship_with_followups 8/10 0 1 1
Spec TAG Architect ship_with_followups 8/10 0 1 1

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

Convergent themes (flagged by 2+ panels)

  • T1 -- Host-qualified require entry is dead and undocumented (supporting: sw-rec-r1-1, oci-nit-r1-1)
  • T2 -- Comma splice in clause (g) ports summary sentence (supporting: sw-nit-r1-2, tag-nit-r1-1)

Fold now (7 item(s))

  1. [F1 / T1] req-pl-018 clause (g) -- Append to clause (g): 'This clause does not apply to dependencies.require. A require entry whose first segment resembles a host is compared literally under clause (a) and matches no dependency whose canonical path omits the host.'
    Success criterion: grep -c 'does not apply to.*dependencies.require' openapm-v0.1.md returns 1
  2. [F2 / standalone] req-pl-018 clause (g) -- Replace both 'with any :port suffix removed' phrases with 'with any trailing colon followed by one to five ASCII digits (U+0030 through U+0039) removed'.
    Success criterion: grep -c ':port suffix' openapm-v0.1.md returns 0; grep -c 'U+0030 through U+0039' returns at least 2
  3. [F3 / T2] req-pl-018 clause (g) -- Replace 'Ports are ignored on both sides, the host segment is compared literally' with 'Ports are ignored on both sides; the host segment is compared literally'.
    Success criterion: grep -c 'both sides, the host' openapm-v0.1.md returns 0
  4. [F4 / standalone] req-pl-018 clause (g) -- After each port-normalization phrase (per F2), insert ', and any single trailing U+002E removed' so pattern host and effective host both drop one trailing dot (companion code change in normalize_policy_host).
    Success criterion: grep -c 'trailing U+002E removed' openapm-v0.1.md returns exactly 2
  5. [F5 / standalone] Appendix D -- Add a '0.1.58 (proposed) | 2026-11-12' revision row for the req-pl-018 clause (g) amendment ([Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments #3509 / PR feat(policy): host-qualified dependency allow/deny patterns #3606), count unchanged at 137, and mention 0.1.58 in the reconciliation paragraph.
    Success criterion: grep -c '0.1.58' openapm-v0.1.md returns at least 2
  6. [F6 / standalone] req-pl-018 clause (g) -- Replace 'the implementation's configured default host' with 'the implementation-default host (Section 1.4)'.
    Success criterion: grep -c 'implementation.s configured default host' openapm-v0.1.md returns 0
  7. [F7 / standalone] Section 6.3.1 dependencies table -- Deny row: 'Always wins over allow; host-qualified pattern matching per req-pl-018 clause (g); case treatment per req-pl-018.'
    Success criterion: grep 'deny.*clause (g)' openapm-v0.1.md returns 1 line in the Section 6.3.1 table

Defer to v0.1.1

Linter notes (1 note)

  • [11] .py files are modified in this PR (policy host matching); autopilot-pr-review-worker ran in parallel. Checks 1, 2, 5, 6 (137 at all three count sites), 7 and 10 pass; 3, 4, 8 and 9 are N/A (no schema, fixture or mermaid change).

Linter handoff: After F2 + F4: no ':port suffix' remains in clause (g); 'U+0030 through U+0039' appears twice; 'trailing U+002E removed' appears twice. After F5: Appendix D has a 0.1.58 (proposed) row and the reconciliation paragraph mentions 0.1.58. After F7: the 6.3.1 deny row contains 'clause (g)'. Count sites remain 137.


Full per-panel findings

Spec Swagger Editor -- shocked_meter 8/10, confidence high

Summary: Clean, well-integrated amendment. One recommended: require-field edge case undocumented. Nits: Appendix D row, comma splice.

New recommended findings (1)

  • [sw-rec-r1-1] req-pl-018 clause (g) -- Clause (g) is silent on dependencies.require; a require entry whose first segment contains a dot is vacuously unsatisfiable under clause (a). Fail-closed but undocumented.
    Recommended fix: Add a sentence to clause (g): this clause does not apply to dependencies.require; such an entry is compared literally under clause (a) and matches no dependency.

New nit findings (2)

Preserved strengths confirmed

  • RFC 2119 discipline on the new MUST
  • Cross-reference accuracy across 6.3.1, req-rpl-002 sentence and 10.8
  • Normative count consistency (137)
  • Anchor stability
  • Deny-precedence preservation

Spec OCI Editor -- shocked_meter 7/10, confidence high

Summary: Well-integrated; one recommended port-grammar tightening and one nit on require authoring trap; no blockers.

New recommended findings (1)

  • [oci-rec-r1-1] req-pl-018 clause (g) -- ':port suffix' is not defined; implementations stripping only numeric ports vs any colon-tail disagree on malformed host tokens.
    Recommended fix: Say 'any trailing colon followed by one or more ASCII digits (U+0030 through U+0039) removed'.

New nit findings (1)

  • [oci-nit-r1-1] A host-qualified require entry is a dead entry; the authoring trap is silent. -- fix: Append a sentence to clause (g) stating it does not apply to dependencies.require.

Preserved strengths confirmed

  • ASCII-only host case fold
  • Explicit no-subdomain/no-prefix language
  • Local-path exemption
  • Replacement source host binding
  • 10.8 note accurate

Spec Pkgmgr Editor -- shocked_meter 8/10, confidence high

Summary: Tight and well-scoped. One recommended: anchor 'configured default host' to req-mf-019. One nit on the deny table row.

New recommended findings (1)

  • [pkg-rec-r1-1] req-pl-018 clause (g) -- 'the implementation's configured default host' is a third phrasing beside req-mf-019 (manifest default_host:) and the glossary term 'implementation-default host'; readers may disagree on which tier applies.
    Recommended fix: Delegate to req-mf-019: 'the default host selected by req-mf-019 (the manifest default_host: value, or the declared implementation-default host when that field is omitted)'.

New nit findings (1)

  • [pkg-nit-r1-1] The deny row does not mention clause (g) while the allow row does. -- fix: Append '; host-qualified pattern matching per clause (g)' to the deny row.

Preserved strengths confirmed

  • Host-recognition heuristic separates local paths
  • Port normalization on both sides
  • Replace-selected source interaction addressed
  • Deny-over-allow preserved
  • Hostless backward compatibility explicit

Spec TAG Architect -- shocked_meter 8/10, confidence high

Summary: Clean, well-layered amendment. One recommended: normalize a trailing DNS dot. One nit: comma splice.

New recommended findings (1)

  • [tag-rec-r1-1] req-pl-018 clause (g) -- A trailing DNS dot is not normalized before host comparison; github.com. and github.com are the same host, and a trailing-dot reference or default host could slip past a host-qualified deny.
    Recommended fix: Append ', and any single trailing U+002E removed' where clause (g) removes the :port suffix, for both pattern host and effective host.

New nit findings (1)

  • [tag-nit-r1-1] Comma splice in the ports sentence. -- fix: Use a semicolon or split the sentence.

Preserved strengths confirmed

  • Purely syntactic deterministic grammar
  • Clause (g) self-contained
  • Implementation-agnostic default host phrasing
  • Form-equivalence MUST
  • Requirements manifest updated in lockstep
  • 10.8 note updated

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


Generated by apm-spec-guardian. This comment is AI-generated and may contain errors.

A default host such as GITHUB_HOST=ghes.corp.example. kept its root dot,
so host-qualified deny rules for ghes.corp.example silently missed
shorthand dependencies. normalize_policy_host now drops one trailing dot
on both the pattern and dependency side. Also defensively copies the
projected manifest deps in the audit source set, adds type hints, and
adds a regression test for the fail-closed dependency-sources check when
replace rules cannot bind. Addresses panel follow-ups from
supply-chain-security-expert, python-architect and test-coverage-expert.

Co-authored-by: Copilot App <[email protected]>
An existing hostless pattern with a dotted first segment (my.group/**) now
matches nothing, so as a deny it stops blocking. Record that under
Changed, state that wildcard host patterns match nothing, mention the
trailing-dot rule, and link policy-schema to the canonical table.
Addresses doc-writer panel follow-ups.

Co-authored-by: Copilot App <[email protected]>
Folds F1-F7 from the apm-spec-guardian round-1 synthesis: require is not
host-qualified, numeric-only port grammar, trailing-dot removal, comma
splice, implementation-default host glossary term, deny table parity and
an Appendix D 0.1.58 revision row. F8 (req-mf-019 manifest default_host)
is deferred: it needs new behavior outside the #3509 scope.

Co-authored-by: Copilot App <[email protected]>
Spec req-pl-018(g) removes a trailing colon plus one to five digits from
the pattern and effective host, but the code only removed a valid port
(1-65535), so deny ghes.corp.example:99999/** matched nothing (fail-open).
Use one regex on both sides so code and spec agree; pinned by a regression
test. Addresses doc-writer delta-panel finding.

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

All 7 prior follow-ups and the delta port-range finding folded; 4 panelists return clean on 925f440. Host-qualified dependency policy is ready to land.

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

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

Since the prior full-panel advisory (head a26b7b1, stance ship_with_followups, 7 follow-ups), every in-scope finding has been resolved. The two highest-signal items -- trailing-dot DNS bypass (supply-chain-security-expert) and CHANGELOG deny-consequence entry (doc-writer) -- were folded in 8513986 and a872939 respectively, each with mutation-verified regression tests. The spec-guardian round-1 folds (F1-F7) landed in 45b9f73. The delta panel then surfaced one new finding: a spec-vs-code mismatch where the spec stripped any colon-plus-1-to-5-digits but the code only stripped valid ports 1-65535, making a deny on host:99999/** a silent no-op. That was folded in 925f440 with a single regex on both sides and a regression test (test_out_of_range_pattern_port_still_names_the_host), mutation-break verified. Three Copilot inline threads (port in GITHUB_HOST, ./../ read as hosts, missing replace-sources and dev-deps in audit) were fixed in 575142c and resolved.

All four delta panelists return clean: python-architect confirms both nits resolved; supply-chain-security-expert confirms the trailing-dot fix is correct and symmetric with no new bypass; test-coverage-expert reports every regression trap covered and passing; doc-writer's sole delta finding is already folded. The only deferred item is spec-guardian F8 (delegate default host to req-mf-019 manifest default_host:), which the merge worker excluded because reading that field for policy is new behavior outside the #3509 approved scope. No panelist dissent exists in this round or the prior one.

Aligned with: secure by default: Deny rules now bind to a specific host, closing the multi-host bypass. The trailing-dot DNS edge, out-of-range port edge, and leading-dot path edge are all fixed with regression traps. governed by policy: Host-qualified patterns give org admins per-host admission control in apm-policy.yml; hostless patterns unchanged for backward compat; CHANGELOG names the dotted-segment reinterpretation and its deny-side consequence. multi harness multi host: Dependencies from different Git hosts are now distinguished in policy evaluation, matching APM's multi-host dependency model. pragmatic as npm: Hostless patterns keep working unchanged; the dotted-segment reinterpretation only affects patterns that were already ambiguous (GitHub org names cannot contain dots).

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 Both round-1 nits (list() copy, type hints) resolved; trailing-dot normalization is sound; no new findings.
Supply Chain Security Expert 0 0 0 Trailing-dot DNS bypass fix is correct and symmetric; no new bypass introduced in the delta.
Test Coverage Expert 0 0 0 Prior fail-closed audit gap closed; trailing-dot normalization has a regression trap; 60/60 tests pass. Ship.
Doc Writer 0 1 0 All 3 round-1 doc items are fixed and the delta is ASCII-clean; one spec-vs-code mismatch remained on which port suffixes get stripped.

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

Top 1 follow-ups

  1. [spec-pkgmgr-editor] Spec-guardian F8: once the policy engine reads a manifest default_host:, delegate clause (g)'s effective default host to req-mf-019. -- Outside this PR's approved scope ([Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments #3509 excludes new settings; the implementation does not read default_host: for policy today). Track as a follow-up so spec and implementation converge.

Delta since the last advisory (a26b7b1 -> 925f440)

Recommendation

Every in-scope finding from both the full panel and the delta round is folded, regression-tested, and mutation-verified. The 4 delta panelists return unanimously clean. The sole remaining item (spec-guardian F8, default_host: field for policy) is explicitly outside the #3509 approved scope and is suitable for a post-merge follow-up issue. This PR is ready to land pending green CI on the final head.


Full per-persona findings

Python Architect

No findings.

Supply Chain Security Expert

No findings.

Test Coverage Expert

No findings.

Doc Writer

  • [recommended] Spec clause (g) strips any colon plus 1-5 digits from a host, but the code stripped only valid ports 1-65535 at docs/src/content/docs/specs/openapm-v0.1.md
    normalize_policy_host suppressed the ValueError for ports 0 or above 65535, so deny ghes.corp.example:99999/** named host 'ghes.corp.example:99999' and matched nothing, while the spec reads it as ghes.corp.example. Code applied such a deny more loosely than the spec states.
    Suggested: Align code and spec; add a test that pins an out-of-range port.

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.

…tterns

Resolve Appendix D conflict: main took 0.1.58 for req-tg-018 (#2030); this PR's req-pl-018 clause (g) amendment becomes 0.1.59, count 138 (133 MUST, 5 SHOULD).

Co-authored-by: Copilot App <[email protected]>
Adds test_policy_host_recognition_grammar_and_scope (@Req req-pl-018): leading-dot local-path patterns stay hostless, numeric ports and one trailing dot are removed on both sides, require is not host-qualified, and audit gates locked transitives. CONFORMANCE.{json,md} regenerated in full after collecting the whole tests/spec_conformance suite. Appendix D 0.1.59 row now ends with the Section 9.3 amendment-panel sentence (coordinator-required, precedent 0.1.8/0.1.9).

Co-authored-by: Copilot App <[email protected]>
Folds spec-guardian round-2 convergent nit (oci-nit-r2-1, pkg-nit-r2-1): both 0.1.56 and 0.1.59 revise in place and add no statement.

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

Copy link
Copy Markdown
Collaborator Author

APM Spec Guardian: fold_and_ship

Scope: editorial-patch (round 2, after merging main and folding round-1 F1-F7); req-pl-018 clause (g) plus Appendix D 0.1.59. Shocked-meter avg: 9.0/10.

All four panels converge on unanimous 'ship' with zero blocking findings, zero recommended findings, and a shocked_meter average of 9.0 -- a 1.25-point rise from round 1's 7.75. Every round-1 finding (F1 through F7) was closed in 45b9f73. The single convergent round-2 nit (T1: reconciliation-paragraph 'in place' scope ambiguity, flagged by the OCI and pkgmgr editors) was folded in 8c65adf with the panels' exact recommended wording. No fold-now items remain.

The one deferred item (F8, req-mf-019 default_host: integration) stays in defer_v0_1_1: once the implementation reads the manifest default_host: field for policy evaluation, clause (g) should delegate to req-mf-019. This is outside the approved #3509 scope and remains the highest-signal follow-up. After merging main (which took 0.1.58 for req-tg-018), this PR's Appendix D row is 0.1.59 and ends with the Section 9.3 amendment-panel note; counts are consistent at 138 (133 MUST, 5 SHOULD). Recommend fold_and_ship.

Convergence

Panel Stance Shocked New B New R New N
Spec Swagger Editor ship 9/10 0 0 0
Spec OCI Editor ship 9/10 0 0 1
Spec Pkgmgr Editor ship 9/10 0 0 1
Spec TAG Architect ship 9/10 0 0 0

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

Convergent themes (flagged by 2+ panels)

  • T1 -- Appendix D reconciliation paragraph 'in place' scope ambiguity (supporting: oci-nit-r2-1, pkg-nit-r2-1) -- folded in 8c65adf.

Defer to v0.1.1

Linter notes (1 note)

  • [11] .py files are modified (policy host matching); autopilot-pr-review-worker ran in parallel. Checks 1, 2, 5, 6 (138 at every count site), 7 and 10 pass; orphan_check OK (138 aligned); CONFORMANCE regenerated in full; 3, 4, 8, 9 N/A.

Linter handoff: No new folds to apply. Count sites remain 138 (133 MUST, 5 SHOULD); Appendix D row 0.1.59 ends with the Section 9.3 amendment-panel note; clause (g) carries the numeric port grammar and trailing-dot removal twice each.


Full per-panel findings

Spec Swagger Editor -- shocked_meter 9/10, confidence high

Summary: All round-1 findings closed by F1-F7; counts agree at 138; no new findings.

Round-1 closure: sw-rec-r1-1 closed by F1 (require exclusion sentence); nits closed by F5 (Appendix D row, now 0.1.59) and F3 (comma splice).

Preserved strengths confirmed

  • RFC 2119 discipline on the clause (g) MUST
  • Cross-reference accuracy (6.3.1 allow/deny rows, replacement sentence, Section 1.4 link, 10.8)
  • Count consistency at 138 (133 MUST, 5 SHOULD) across all sites
  • Anchor stability; 0.1.59 is the next free slot after main's 0.1.58
  • Deny-precedence preserved

Spec OCI Editor -- shocked_meter 9/10, confidence high

Summary: All round-1 findings closed; one nit on reconciliation-paragraph wording.

Round-1 closure: oci-rec-r1-1 closed by F2 (1-5 ASCII digit port grammar on both sides); oci-nit-r1-1 closed by F1 (require exclusion).

New nit findings (1)

  • [oci-nit-r2-1] '0.1.56 revises [req-tg-005] and 0.1.59 revises [req-pl-018] in place and add none' leaves the scope of 'in place' ambiguous. -- fix: '0.1.56 revises [req-tg-005] in place and 0.1.59 revises [req-pl-018] in place; neither adds a statement.'

Preserved strengths confirmed

  • ASCII-only host case fold
  • No-subdomain/no-prefix language
  • Local-path exemption
  • Replacement source host binding
  • Port and trailing-dot normalization on both sides
  • Appendix D 0.1.59 row with Section 9.3 note
  • req-pl-018 conformance coverage 1 -> 3

Spec Pkgmgr Editor -- shocked_meter 9/10, confidence high

Summary: All round-1 findings closed; Appendix D numbering and counts consistent; one reconciliation nit.

Round-1 closure: pkg-rec-r1-1 closed by F6 (implementation-default host glossary anchor); F8 deferred appropriately; pkg-nit-r1-1 closed by F7.

New nit findings (1)

  • [pkg-nit-r2-1] 'in place' attaches only to the 0.1.59 clause although both revisions are in place. -- fix: '0.1.56 revises [req-tg-005] in place and 0.1.59 revises [req-pl-018] in place; neither adds a statement.'

Preserved strengths confirmed

  • Host-recognition heuristic separates local paths
  • Numeric port and trailing-dot normalization on both sides
  • Replace-selected source addressed
  • Deny-over-allow preserved
  • Hostless backward compatibility explicit
  • All count sites consistent after main's 0.1.58

Spec TAG Architect -- shocked_meter 9/10, confidence high

Summary: Both round-1 findings closed; no new findings.

Round-1 closure: tag-rec-r1-1 closed: one trailing U+002E removed symmetrically on pattern and effective host; comma splice fixed.

Preserved strengths confirmed

  • Purely syntactic deterministic grammar
  • Clause (g) self-contained
  • Default host anchored to the Section 1.4 glossary term
  • Form-equivalence MUST preserved
  • Requirements manifest updated in lockstep
  • 10.8 note accurate

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


Generated by apm-spec-guardian. This comment is AI-generated and may contain errors.

…tterns

Resolve policy_checks.py and policy-schema.md conflicts with #3652 by keeping both sides: source_deps (host-qualified allow/deny over effective direct + locked transitive sources) and declared_refs (authored constraint for require_pinned_constraint); both doc paragraphs kept.

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

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

Spec conflict resolved (main's 0.1.58 kept, req-pl-018 amendment is 0.1.59); #3652 policy_checks conflict merged keeping both seams; spec-guardian round 2 ship (9.0/10); CI green at c7085a8.

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

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

Since the prior ship_now advisory on 925f440, the only material change is spec-surface housekeeping forced by main's concurrent merge of req-tg-018 (#2030). The merge worker resolved the Appendix D textual conflict faithfully: main's 0.1.58 row and its count of 138 were preserved verbatim, and this PR's req-pl-018 amendment was renumbered to 0.1.59 with the count stated as 138 (133 MUST, 5 SHOULD). Coordinator-required folds landed: (1) the 0.1.59 row carries the standard Section 9.3 amendment-panel + comment-window proviso (precedent 0.1.8/0.1.9), and (2) a new conformance test test_policy_host_recognition_grammar_and_scope exercises the full clause (g) grammar -- leading-dot paths hostless, numeric-port and trailing-dot normalization on both sides, require not host-qualified, and audit gating locked transitives -- mutation-break verified. CONFORMANCE.{json,md} was regenerated across the entire spec suite (req-pl-018 tests 1 -> 3). The Mode B detector passes (spec-concurrent) and orphan_check confirms 138 aligned.

The apm-spec-guardian round 2 returned all four panels at 'ship' with a shocked average of 9.0 (up from 7.75) and zero blockers; the single convergent nit (reconciliation-paragraph 'in place' wording) was folded in the final head 8c65adf. Both delta panelists return clean: test-coverage-expert confirms the new conformance test is hermetic and passing; doc-writer confirms the 0.1.59 row, reconciliation sum, Appendix C, Section 1.3 and CONFORMANCE agree with no ASCII violations. python-architect and supply-chain-security-expert were not re-spawned because the PR's src/ is unchanged since 925f440. The prior ship_now stance is reaffirmed.

After that pass, main landed #3652 (declared_refs for require_pinned_constraint), which conflicted with this PR's source_deps seam in policy_checks.py and with policy-schema.md. Both sides were kept: allow/deny judge source_deps (effective direct plus locked transitive sources) and the pinned-constraint check judges declared_refs; both doc paragraphs stay. python-architect re-reviewed the resolution and returned no findings: both consumers route through the single replacement-projection owner, and an unbindable replace table still fails closed before collect_manifest_declarations runs. CONFORMANCE regeneration, orphan_check (138 aligned) and the Mode B detector remain clean at the final head; the spec delta is byte-identical to the round-2 spec-guardian review.

Aligned with: secure by default: Deny rules bind to a specific host with trailing-dot, out-of-range port, and leading-dot path edges all regression-trapped; the new conformance test locks the grammar end-to-end. governed by policy: Host-qualified patterns give org admins per-host admission control in apm-policy.yml; the 0.1.59 spec row formalizes the clause with the amendment-panel proviso; CONFORMANCE regenerated and aligned at 138. multi harness multi host: Dependencies from different Git hosts are distinguished in policy evaluation; the conformance test validates host-qualified vs hostless scoping.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 0 Merged composition is correct: both project_manifest_dependencies callers route through the single replacement owner; fail-closed ordering holds; no split authority.
Test Coverage Expert 0 0 0 New req-pl-018 clause (g) conformance test exercises all grammar rules (leading-dot hostless, port/trailing-dot removal, require unchanged, transitive gating); hermetic and passes; ship.
Doc Writer 0 0 0 The 0.1.59 row, reconciliation sum, Appendix C, Section 1.3 and CONFORMANCE agree. Text is ASCII. Ship.

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

Top 1 follow-ups

  1. [spec-pkgmgr-editor] Spec-guardian F8: once the policy engine reads a manifest default_host:, delegate clause (g)'s effective default host to req-mf-019. -- Outside the [Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments #3509 approved scope (the implementation does not read default_host: for policy today). Track as a post-merge follow-up issue.

Delta since the last advisory (925f440 -> c7085a8)

  • Appendix D conflict with main's 0.1.58 (req-tg-018) resolved faithfully; this amendment is 0.1.59, count 138 (133 MUST, 5 SHOULD), row ends with the Section 9.3 amendment-panel sentence.
  • New req-pl-018 conformance test; CONFORMANCE.{json,md} regenerated in full; orphan_check 138 aligned; Mode B passes (spec-concurrent).
  • apm-spec-guardian round 2: all four panels ship, shocked avg 9.0; convergent nit folded in 8c65adf.
  • Merged fix(policy): judge the declared constraint, accept package release tags (supersedes #3381) #3652: policy_checks.py and policy-schema.md conflicts resolved keeping both seams.
  • CI green at c7085a8 (26 checks); license/cla SUCCESS; 0 unresolved review threads.

Recommendation

Every in-scope finding from the full panel, all delta rounds and both spec-guardian rounds is folded, regression-tested and verified, and CI is green at c7085a8 with 0 unresolved threads and license/cla passing. The sole remaining item (F8, default_host: field for policy) is outside the #3509 scope and suitable for a post-merge follow-up issue.


Full per-persona findings

Python Architect

No findings.

Test Coverage Expert

No findings.

Doc Writer

No findings.

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: c7085a8d84e5ab16b4f600b8a36b84a0d2264117
  • Merged origin/main f2369b760765fe91ef4955cbdd2fb47dcd7959f2 (clean merge; GitHub reported DIRTY only on CHANGELOG.md, which this repo merges with merge=union).
  • New head: 0906943e9a7ea8c921727153735a230b626b5356
  • CHANGELOG: moved 2 bullet(s) in '### Added' after entry Refactor apm init to minimal-only mode (breaking change) #13 of 13, 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-issue-3509-host-qualified-dep-patterns (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 a2c63ef into main Nov 12, 2026
26 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-issue-3509-host-qualified-dep-patterns branch November 12, 2026 22:42
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 12, 2026
…tives (#3658)

main's source-dependency owner (#3606) already runs the allow and deny
checks over effective direct deps plus locked transitives. This keeps
the installed-CLI guard that install and audit --ci agree.

Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 12, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 13, 2026
…kfile symlink, audit replay, targeted install, MCP cleanup) (#3672)

* fix(export-patch): make subdirectory package patches apply from the repo root (#3649)

A git: + path: (or marketplace git-subdir) dependency is cached as just
its subdirectory, so exported diff paths were relative to that
subdirectory while the patch header says to apply from the package
repository root; git apply failed with 'No such file or directory'.
Prefix the locked virtual_path for subdirectory packages.

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

* fix(export-patch): export edits to Claude plugin packages (#3649)

Install normalizes a Claude plugin (no apm.yml) by mirroring skills/,
agents/ and commands/ into .apm/ inside the cache. export-patch indexed
both copies, so every skill or agent edit in a marketplace plugin was
skipped as 'ambiguous source'. When the cache carries the parser-owned
normalization receipt, prefer the upstream candidate over the .apm/
mirror.

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

* fix(view): accept logical absolute paths in view --file (#3649)

apm view --file "$PWD/<file>" exited 2 ('outside the project deploy
root') whenever the working directory was reached through a symlink
(macOS /tmp and /var, symlinked workspaces): the deploy root comes from
the physical getcwd() while the query kept its logical parents. When
the lexical query is not under the deploy root, resolve only its parent
directory so the queried leaf stays exact.

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

* test(redteam): C5 marketplace, pack, export-patch and view --file chains (#3649)

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

* fix(lockfile): refuse a symlinked lockfile before update or uninstall writes (#3649)

apm update, apm install --update and apm uninstall detected a symlinked
apm.lock.yaml (#3532) only when writing the lockfile, after deploying new
files, cleaning stale ones and editing apm.yml. The command then exited 1
with the lockfile still describing the old state, and update reported that
no transaction changes were committed. ensure_lockfile_writable() is now
the single owner of the rule; LockFile.write uses it, and update (when the
plan changes the graph) and uninstall (when it removes a locked package)
call it before any other write, so the transaction rolls back cleanly.

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

* fix(audit): replay local apm.yml packages with plugin.json as apm_package (#3649)

apm install DIR (routed by #3604) and manifest-declared local deps classify
a directory with apm.yml and a root plugin.json as apm_package and deploy
only its .apm/ primitives. The audit --ci replay normalized any local dir
with a plugin.json as a legacy plugin, integrating root agents/ and failing
drift on a fresh install. Route the replay through detect_package_type,
the same classifier install uses.

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

* fix(install): keep a targeted package's dropped deps an unreached entry may need (#3649)

apm install PKG drops the selected package's former descendants that this
run's graph no longer contains (#3528). With #3571 the graph is rebuilt from
the current apm.yml of every local package, so an unselected sibling edited
since it was locked makes the graph omit retained entries it still locks.
A shared dependency of such an entry was then removed while the entry stayed
locked, leaving apm.lock.yaml without that entry's dependency while audit
and prune passed. When the graph omits any retained entry it cannot prove the
candidate unneeded, so drop nothing; the next full install reconciles.

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

* fix(mcp): keep user short-name entries when a slashed server is removed (#3649)

Stale MCP cleanup expanded every stale name to its last path segment, so
removing self-defined com.example/server deleted a user-authored or
still-declared 'server' entry from VS Code, Cursor, Copilot and OpenCode.
Self-defined servers keep their declared key (#3493) and older truncated
keys are reconciled only under ownership proof at install time, so derive
the alias from the adapter key owner with self-defined context.

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

* test(lifecycle): guard 0.36.0 release flows with lifecycle chains (#3649)

Permanent APMLifecycle scenarios from the 0.36.0 pre-release sweep.
They drive the real apm binary over hermetic local Git fixtures across
install, install --frozen, update, audit --ci, prune, uninstall, pack,
marketplace, export-patch, view --file, policy and user scope. They
assert disk, lockfile, receipts and exit code after every step.

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

* docs(changelog): record 0.36.0 red-team regression fixes (#3649)

apm-spec-waiver: restores promised behavior of features merged since v0.35.0; no OpenAPM requirement changes

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

* refactor(owners): route export-patch mirror, lockfile preflight, and MCP config-key through canonical owners (#3649)

Fix 2: export_patch now routes .apm/ mirror classification through
plugin_parser.is_install_generated_mirror() instead of hard-coding
.apm/ prefix knowledge. The normalization owner decides what is a
mirror.

Fix 4: lockfile symlink write-guard consolidated into
refuse_lockfile_before_mutation() in deps/lockfile.py (single owner).
Both pipeline.py and uninstall/cli.py now call this owner API.
Added owner registry guard contracts-tooling-lockfile-symlink-write-guard
with a MutationCase proving its teeth.

Fix 7: MCPClientAdapter._determine_config_key promoted to public
determine_config_key(). All 17 call sites (adapters, integrators,
ownership, cleanup) updated. No cross-module private access.

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

* docs(changelog): cite #3672 for the red-team regression fixes (#3649)

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

* fix(compile): never overwrite hand-authored nested context files (#3655)

Distributed compile replaced a hand-authored subdirectory AGENTS.md or
CLAUDE.md that carries no APM marker, then treated the replaced file as
generated output and reported it as orphaned. The canonical owner
hand_authored_root_context_blocks_write now applies its marker rule to
catalog context filenames at any depth, the AGENTS.md and CLAUDE.md call
sites route every placement through it, and nested Git repository skips
are decided before protection so their accounting is unchanged. The
static guard pins the any-depth rule, with mutation cases.

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

* fix(uninstall): keep apm.lock.yaml truthful when uninstall refuses (#3656)

When apm uninstall stopped because a tracked target file was edited or a
user file sat in a managed skill directory, it had already removed the
package's other target files but left apm.lock.yaml claiming all of them.
The target-contraction owner (reconcile_target_deployed_files) now reports
what each selected dependency still owns through SelectedCleanupOutcome,
and the refusal applies it via DeploymentLedgerCodec.replace_legacy_owners
and writes the lockfile, so it claims only files still on disk while
apm.yml keeps the package for the retry. Preserved profile rows stay
claimed. The retained-edit warning now carries its [!] symbol.

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

* fix(uninstall): keep the other runtime's default root on selected-profile uninstall (#3661)

A global uninstall retained for another Claude/Hermes profile removed rows
under every USER_ROOT_ENV_VARS target's selected root, so a HERMES_HOME
profile uninstall also deleted ~/.claude files (and vice versa).
profile_scope now shares one other-profile record walk and removes only the
selected roots of the runtimes whose profiles split the package.

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

* fix(deps): replay proxy-routed lock rows under --frozen (#3657)

A transparent registry proxy records the proxy host and registry_prefix
instead of the upstream host, so drift classified every such row as a
provider change and --frozen refused the lock the proxy had just written.
ArtifactoryRouter now owns the proxy routing target (promoted from the
resolver's private copy) and answers whether a dep routes to a locked proxy
row; drift, download-ref replay and the cached-commit owner reuse it.

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

* fix(audit): honor --no-cache for auto-discovered policy (#3659)

The explicit --policy and auto-discovery branches now share one discovery
call that always forwards no_cache, so 'apm audit --ci --no-cache' fetches
the org policy fresh as documented.

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

* test(policy): guard audit --ci agreeing with install on denied transitives (#3658)

main's source-dependency owner (#3606) already runs the allow and deny
checks over effective direct deps plus locked transitives. This keeps
the installed-CLI guard that install and audit --ci agree.

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

* fix(marketplace): real recovery hint, verified package refs, packed relative hook scripts (#3670)

- apm pack on a branch-ref marketplace package no longer suggests the
  nonexistent --allow-head flag; it names the real recovery command
  (apm marketplace package set <pkg> --ref <tag-or-sha>).
- marketplace package add/set --ref verify the ref on the entry's own host
  through the explicit-ref owner shared with marketplace check
  (ref_resolver.explicit_ref_error, package_entry_coordinates): a missing
  tag or unreachable remote exits 2 without changing apm.yml; --no-verify
  keeps the opt-out. Previously a non-default host looked 'network
  unavailable' and any missing tag was stored with exit 0.
- apm pack carries hook scripts referenced as ./scripts/x from .apm/hooks
  the way install resolves them (resolve_relative_hook_script, promoted to
  public) and repoints the packed command.
- Owner record marketplace-entry-ref-verification + AC10 guard + MutationCase.

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

* fix(bundle): name skipped source symlinks in pack; skip plugin hooks in bundle installs (#3670)

- apm pack keeps not following own-source symlinks (matching own-project
  install), but now names each dropped link in a pack warning instead of
  dropping it silently. The existing exporter walkers record the skipped
  links; both bundle exporters warn through _emit_pack_warning.
- apm install <bundle> no longer copies a Claude plugin bundle's hooks.json
  raw into the target root or lowers hooks/ scripts through the hook
  descriptor extension (fmt.sh -> fmt.sh.json). The local-bundle routing
  owner (install/local_bundle_paths.py) skips plugin-native hook paths and
  reports one bundle_deploy_skip_warning per file; deployed-layout bundles
  keep routing their target hook files. Merging bundle hooks through the
  hook integrator is a follow-up.

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

* fix(mcp): clean recorded servers after their runtime opt-in dir is pruned (#3664)

Removing a dependency prunes an emptied .claude/ or .opencode/ before MCP
stale cleanup runs, and remove_stale reused those write opt-in directories
as cleanup gates, so the recorded server stayed in .mcp.json or
opencode.json while its ledger ownership was dropped (apm uninstall and
apm install after removing the dependency).

install/mcp/ownership.py, the safe-removal owner, gains
project_mcp_cleanup_reachable: ledger-scoped cleanup (an explicit runtime
from the ownership ledger) stays reachable, otherwise the opt-in dir still
gates. remove_stale routes both gates through it; Claude removal stays
content-verified by require_removable_mcp_connections. The
install-deployment-mcp-ownership-migration guard requires that route and
rejects a raw .claude/.opencode is_dir gate in mcp_integrator.py, with a
mutation case.

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

* fix(hooks): retire merged events a hook source no longer declares (#3665)

Merged hook targets cleared a source's earlier entries only for the
events its current hook files declare. Deleting one hook file from a
package or the root .apm/hooks while another remained left the old event
entry in .claude/settings.json and apm-hooks.json, pointing at a deleted
script, and apm audit --ci then reported drift.

hook_ownership.py gains drop_source_entries, extracted from Cursor's
inline whole-source clear. HookIntegrator now uses it for that clear and,
after merging, to drop the source's entries from every event it did not
re-declare, so hook_integrator.py shrinks. The neutral-hook-contract
guard requires both calls and forbids a second definition, with a
mutation case.

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

* fix(mcp): exit apm mcp install through the install outcome (#3666)

apm mcp install forwarded to apm install --mcp with
cli.main(standalone_mode=False), which returns ctx.exit codes instead of
raising them, so a failed forwarded install (for example an org policy
block) exited 0. Run the forwarded command in standalone mode so its exit
comes from install/outcome.py and Click's error handling exactly as for
apm install. The install-deployment-outcome guard rejects
standalone_mode=False under commands/, with a mutation case.

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

* fix(deps): list the dependency key apm uninstall accepts (#3671)

apm deps list showed a self-hosted GitLab dependency (type: gitlab) by its
host-blind org/repo key with Source github, while apm deps tree showed
the host-qualified key and apm uninstall only accepts that identity.
deps list now shows the key deps tree derives (_dep_display_key, extracted
from _dep_display_name) for remote locked dependencies, keeping
host-blind keys for orphan detection, and labels Source through the
canonical classify_host_provider with the declared or locked host_type.

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

* fix(cleanup): never delete a deployed file without a matching recorded hash (#3663)

Stale, orphan, contraction, prune and uninstall cleanup all route through
integration/cleanup.py::remove_stale_deployed_files. Its provenance gate
deleted any lockfile-claimed file without a recorded hash (legacy
fall-through), so a hand-edited lockfile could make a receipt-less install
delete user files. Gate 3 now keeps such files with a warning and reports
them as retained, matching the documented rule that stale files are removed
only when recorded hashes match. cowork:// rows stay exempt because install
records no hashes for them yet. enterprise/security.md now states that a
committed apm.lock.yaml is reviewed input with cleanup authority.

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

* fix(audit): replay local packages through the install package image (#3667)

apm install copies a local package with materialize_local_package, which
dereferences in-package links and materializes single files. The audit
--ci replay integrated straight from the source tree, where integrators
skip links, so a clean install of a package with a contained link reported
its deployed file as orphaned drift.

materialize_local_package is now the one raising owner of the local
package image: install (_copy_local_package), the uninstall survivor
refresh and audit replay (materialize_local_package_for_replay) all copy
through it. path_anchoring.resolve_local_dep_base owns the admission
anchor for a locked local dep. The replay's raw-directory branch, the
file-only replay materializer and the legacy-plugin normalizer's extra
copy are gone. The single-file owner guard, registry record and mutation
cases now pin the shared routes.

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

* fix(prune): keep a hand-removed direct dependency another package still needs (#3668)

prune and deps list retained lock entries recorded with depth > 1 only, so
a dependency hand-removed from apm.yml that another installed package
still declares looked orphaned and prune deleted its checkout, deployed
files and lock entry.

deps/reachability.py, the forward-reachability owner uninstall already
uses, now answers which lock entries are retained (retained_lock_keys):
recorded transitives plus stale direct entries still reachable from a
declared package's manifest, failing closed when the walk is incomplete.
_build_expected_install_paths (prune, deps list, orphan warning) and
prune's lock-key selection route through it instead of re-deriving
depth > 1. The walk treats a manifestless skill, skill bundle or hook
package as a leaf (classified by detect_package_type) instead of an
unverifiable node. The reachability guard rejects a parallel depth rule
in prune or the selector; docs describe the kept package.

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

* fix(uninstall): keep is_dev as install writes it and never report a withheld lock write (#3669)

The forward-reachability walk that rescues a shared dependency after
uninstall treated every survivor as production, so a dependency left
reachable only through devDependencies was rewritten without is_dev and
the next install rewrote apm.lock.yaml.

compute_forward_reachable_keys now takes the surviving devDependencies
separately and drains production paths first, reporting dev_only keys
with the install resolver's rule (a production path wins); uninstall
persists it with the resolved_by repair. LockFile.write/save return
whether the file was persisted, so install --frozen no longer prints
'Updated apm.lock.yaml' for a write it withheld.

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

* refactor(install): gate update plans through one plan_inputs owner (#3649)

The update-plan confirmation and the symlinked-lockfile refusal now
live in install/helpers/plan_inputs.confirm_update_plan, next to
build_resolved_update_plan. The pipeline makes one call and drops its
local helper, so pipeline.py stays under the install LOC budget. The
plan is still built lazily, only when an unwritable lockfile needs it.

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

* refactor(install): keep install modules within their LOC budgets (#3649)

Moves SelectedCleanupOutcome (#3656) into install/selected_cleanup.py;
the target-contraction owner re-exports it for its callers. Compacts
the cached-commit tail in sources.py (#3657) with no behavior change.
The dependency-replacement guard and its mutation case now pin the plan
through plan_inputs.confirm_update_plan.

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

* docs(changelog): record the #3649 fix wave (#3672)

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

* docs(policy): state that org policy does not govern user-scope installs (#3660)

Org policy discovery starts from the project's git remote, so apm install -g
(user scope) is not governed by org policy today. Docs only; no behavior
change. A user-scope policy source is tracked separately.

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

* test(architecture): keep one matrix case per guard for sweep sub-rules (#3649)

The #3664, #3665 and #3666 guard extensions now prove their teeth in a
parametrized standalone test, so the owner-rule matrix keeps exactly one
mutation case per registry guard.

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

* fix(install): keep packages apm.yml no longer declares during --frozen (#3662)

apm install --frozen tolerated lockfile entries that apm.yml no longer
declares but still ran orphan cleanup, deleting their deployed files while
the never-rewritten lockfile kept claiming them. The cleanup phase now
retains every orphan under --frozen through the existing
orphan_cleanup_retained map, so files, the apm_modules checkout and the
lock rows stay in place, and prints one info line naming the kept packages
with the remedy to run apm install. Retained orphans now carry their
source rows' concrete targets, so the frozen build stays equivalent to the
committed lockfile and no rewrite is withheld.

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

* docs(changelog): record frozen orphan retention (#3662)

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

* test(lifecycle): install vs audit --ci replay matrix across package shapes (#3649)

Sixteen package shapes (APM package via Git/local/alias/target subset,
monorepo subdirectory, contained links in Git and local packages, hooks via
Git alias/local alias/symlinked path, Claude skill local alias and Git,
skill bundle subset, Claude plugin Git and local alias, MCP-only, single
file) driven through install, re-install, install --frozen, compile, cold
clone without receipts or cache, and uninstall, asserting audit --ci agrees
at every step. Guards the #3667 local package image replay for aliased and
symlinked local paths.

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

* fix(audit): keep local replay images out of the live apm_modules (#3667)

The #3667 replay wrote each local package image at
apm_modules_dir/<slot>. A cache-only replay (bare 'apm audit') passes the
live project apm_modules there, so auditing silently rewrote the installed
copy with unaudited source bytes and normalized legacy plugins in place;
in --ci mode the image landed on the native plugin replay path and
verify_native_plugin_cache then copied the source onto itself
(SameFileError). Materialize local images under the scratch deployment
root and let native verification hash that image instead of re-copying.

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

* fix(deps): find case-equivalent installs in the reachability walk; keep sweep guards green (#3649)

- models/dependency/materialization.installed_package_path is the one
  read-only lookup for where a dependency is materialized. It recognizes a
  case-equivalent directory. Prune's expected-path builder and the forward
  reachability walk both use it, so prune and uninstall no longer treat a
  casing-equivalent install as unverifiable on case-sensitive file systems
  (#3668).
- integration/cleanup.py: a managed final symlink needs no content hash
  to be unlinked, because unlinking removes no file content (#3663).
- Hook sync tests pass the recorded hashes that uninstall passes. The
  Claude MCP broadcast test pins the opt-in gate (#3664). The frozen rule
  inventory lists the lockfile symlink guard.

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

* docs(changelog): drop the #3658 entry delivered by #3606 (#3649)

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

* docs(changelog): remove stale placeholder bullets left by the rebase (#3649)

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

* style(tests): format owner-rule mutations after rebase (#3649)

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

* fix(install)!: fail --frozen when deployed bytes differ from locked hashes (#3654)

BREAKING CHANGE: apm install --frozen now exits 1 when a deployed file's
on-disk bytes differ from its deployed_file_hashes entry (OpenAPM
req-lk-017), naming each path with its expected and observed envelope.
Before, frozen exited 0 on a dirty tree and the next apm audit --ci
failed with hash drift. This covers a kept local edit (e.g. a user-edited
skill) and an APM upgrade that renders an already-locked file
differently. Repair: run apm install without --frozen and commit.

The per-record hash loop of audit content-integrity is extracted into
policy/ci_checks.py verify_deployed_file_hashes, and audit scope/target
resolution into resolve_audit_scope; audit and the existing post-deploy
frozen owner (InstallService._enforce_frozen_no_rewrite) both call them.
The install success line now reads 'Deployed files verified against
apm.lock.yaml.'. Audit drift text no longer offers export-patch for a
modified file whose bytes still match the lock; local_edits owns the new
rendering-change hint. check_frozen pins both verifier call sites; docs,
apm-usage skill, a req-lk-017 CLI conformance test and lifecycle guards
are updated.

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

* docs(changelog): record the frozen hash verification break (#3654)

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

* test(spec): give the cleanup conformance context its frozen default (#3662)

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

* fix(audit): keep user-scope local replay images out of the governed tree (#3667)

At user scope the scratch modules root sits under the governed .apm
directory, so local package images read as deployed drift. Replay now
materializes local images in an ungoverned scratch apm_modules. At project
scope that is the same directory as before.

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

* test(lifecycle): parse git URLs in the SSH transport guard (#3640)

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

* test(deps): guard the case-equivalent install lookup directly (#3668)

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

* refactor(architecture): register MCP config-key derivation owner (#3649)

Add guard hooks-integrations-mcp-config-key-derivation to the existing
mcp-package-launcher owner in hooks-integrations.json, with a static
check in mutation_mcp_target_and_scope.py that verifies:
  - determine_config_key exists as a definition in MCPClientAdapter
  - MCP consumers (mcp_integrator, mcp_integrator_install, mcp/ownership)
    route through determine_config_key() and do not re-derive config keys
    by splitting on "/"

MutationCase proves the guard fires when the definition is renamed.
Frozen rule inventory updated in test_architecture_runner.py.

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

* test(install): guard frozen hash verification at user scope (#3654)

Parametrize the warm kept-edit frozen guard over project and user scope:
apm install -g, tamper with a deployed skill under the isolated HOME,
then apm install --frozen -g must exit 1 naming the path with expected
and observed hashes and leave $APM_HOME/apm.lock.yaml byte-identical;
after the user resolves the edit and runs apm install -g, --frozen -g
exits 0.

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

* fix(uninstall): scope selected-profile removal per package in batched uninstalls (#3649)

selected_profile_survivors combined the split runtimes of every requested
package, so uninstalling two packages at once could delete files that two
separate uninstalls keep (one package split across Hermes homes, the other
across Claude profiles). The removable selected-profile prefixes are now
computed per package before survivor rows are combined.

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

* fix(install): refuse a symlinked lockfile before any update side effect (#3649)

confirm_update_plan only refused a symlinked apm.lock.yaml when the
resolved dependency plan had changes. A target-only change under
apm install --update leaves the plan unchanged but still rewrites the
deployment ledger, so files were deployed before the lockfile write
failed. An update exists to rewrite the lockfile, so it now refuses
unconditionally through refuse_lockfile_before_mutation(would_mutate=True),
after the apm update plan callback and before any download, deploy or
cleanup. Plain install, --frozen, apm lock and dry runs are unchanged.

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

* fix(export-patch): classify plugin mirrors from path-specific receipt evidence (#3649)

A normalization receipt does not prove every .apm/ file was generated:
plugins can declare authored .apm/skills or .apm/agents sources. When such
a source shared bytes with an unrelated repository file, export-patch
dropped the real source and patched the unrelated file. The normalization
owner now maps only .apm/skills/<name>/<tail> to the source directory its
receipt records (install_generated_mirror_source), and export-patch drops a
candidate only when that proven source is itself another candidate;
otherwise the ambiguity skip is kept.

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

* fix(pack): reject symlinked relative hook scripts before packing (#3649)

resolve_relative_hook_script() resolved symlinks before pack validated the
resource, so a contained ./scripts/alias.sh -> fmt.sh (or a linked scripts/
directory) was packed instead of rejected. The owner gains a lexical mode,
like resolve_plugin_root_hook_script, so pack validates the unresolved path
and its ancestors through the existing hook-resource symlink rule; install
keeps resolving as before.

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

* fix(pack): anchor packed relative hook scripts on the plugin root (#3649)

A packed ./scripts/fmt.sh reference became ./hooks/scripts/fmt.sh, which
resolves from the consumer's working directory rather than the installed
plugin, so it could not find the bundled file. The plugin-root vocabulary
owner gains plugin_root_script_reference, which anchors the packed path on
${CLAUDE_PLUGIN_ROOT} while keeping the authored quoting (unquoted,
double- or single-quoted); pack uses it for relative script references.

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

* fix(hooks): retire dropped events under safe legacy source markers (#3649)

The #3665 retirement pass dropped a source's entries from events it no
longer declares only under the canonical marker. An upgraded install
whose sidecar still carries a leaf marker such as 'hooks' kept the
dropped event pointing at a deleted script. HookIntegrator now computes
the owned marker set once from _get_hook_source_markers (keeping its
ambiguity rules) and passes it to both drop_source_entries passes. The
neutral-hook-contract guard requires both passes to use it, with a
mutation case.

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

* docs(changelog): match export-patch and pack entries to the review folds (#3672)

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

---------

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support host-qualified dependency allow/deny patterns for multi-host enterprise environments

2 participants