Skip to content

feat(init): onboard existing local packages without rewriting source - #2937

Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-apm-onboarding-scope
Sep 11, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 4 commits into
mainfrom
danielmeppiel-apm-onboarding-scope

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

add(init): onboard existing local packages without rewriting source

TL;DR

This adds apm init --discover as a read-only inventory for existing local skills and packages, with an explicitly consented --apply that changes only consumer manifest metadata. A later, separate apm install --target ... uses the ordinary installer and collision policy; discovery does not convert, copy, execute, refresh, or claim provenance over source content. Authors and harnesses retain responsibility for standards compliance; this adds no compatibility layer.

Note

This supersedes Ron Izraeli's PR #2857 at maintainer request while reusing and crediting that discovery work. Ron (Ron Izraeli (@chkp-roniz)) is warmly invited to review, correct, or continue collaborating on this narrower implementation.

Related: #1122, #1130. This is a bounded subset; it does not claim the full migration scope in #1130.

Problem (WHY)

  • Existing repositories have agent content but no bounded path to declare already-local, installable packages without manually editing apm.yml.
  • Discovery must not turn into migration: converters, hook rewriting, provenance, refresh, source mutation, or implicit installation are outside this change.
  • Native root-skill installation previously bypassed the canonical BaseIntegrator collision check, so a discovered declaration could reach a pre-existing target directory without the ordinary protection.
  • The earlier proposal mixed discovery with a much broader migration surface. This branch keeps one coherent unit: "you want it to encapsulate a coherent unit of work that composes well with other skills."

The resulting contract is intentionally staged: discover read-only, declare metadata with consent, then install through the existing pipeline.

Approach (WHAT)

# Fix Boundary
1 Invert registered target profiles to find candidate package roots Read paths and metadata only; do not emit file contents
2 Admit candidates through canonical parsers and validate_apm_package(..., read_only=True) Reject formats that require normalization
3 Add missing local references to the consumer apm.yml after consent Preserve existing comments, fields, options, and source bytes
4 Keep deployment separate under apm install --target ... --target is invalid during discovery
5 Route native root skills through BaseIntegrator.check_collision Ownership is tracked per destination and only after a successful write
6 Register static architecture guards and end-to-end lifecycle proofs "do the work, run a validator (a script, a reference checklist, or a self-check), fix any issues, and repeat until validation passes."

Implementation (HOW)

Area Files What changed
Discovery core src/apm_cli/adopt/__init__.py, discovery.py, safety.py Adds bounded, non-symlink-following inventory; reads existing declarations and deployment ledger state; classifies supported, managed, unsupported, and unsafe candidates.
Manifest apply src/apm_cli/adopt/manifest_edit.py, materialize.py Revalidates under the lifecycle lock and atomically merges only missing dependencies.apm local paths after consent. Conflicting existing declarations block the entire write.
CLI and output src/apm_cli/commands/discover.py, commands/init.py, cli.py, core/output_mode.py Adds init --discover, --apply/--write, text/JSON/YAML output, project/global scope, consent rules, and update-check suppression on read-only discovery.
Read-only admission src/apm_cli/models/validation.py, agent_plugins/projection.py, utils/yaml_io.py Threads create_config=False through canonical validation/projection and exposes comment-preserving YAML serialization for atomic writes.
Install safety src/apm_cli/integration/skill_integrator.py Applies canonical collision protection before mutation, keys ownership by destination, and reports metadata from the first successful target.
Architecture ownership .apm/architecture/owners/contracts-tooling.json, scripts/architecture_linter/checks/onboarding.py, groups/mutation_writes.py Declares and statically enforces metadata-only onboarding.
Existing architecture checks scripts/architecture_linter/checks/install_base_integrator_and_contraction.py, install_frozen_and_audit.py, marketplace_package_and_registration.py Requires canonical collision handling and recognizes read-only discovery/projection boundaries.
User documentation CHANGELOG.md, docs/src/content/docs/getting-started/migration.md, docs/src/content/docs/reference/cli/init.md, packages/apm-guide/.apm/skills/apm-usage/commands.md Documents preview, consented declaration, separate install, idempotency, unsupported content, and target selection. No README or normative specification changes.
Lifecycle and boundary tests tests/integration/test_brownfield_lifecycle.py, test_architecture_onboarding.py, test_architecture_native_skill_collision.py Exercises the real CLI lifecycle and mutation-resistant architecture rules.
Component tests tests/unit/adopt/test_onboarding.py, test_native_skill_collision.py, tests/unit/integration/test_skill_integrator.py Covers consent, formats, unsafe paths, identity collisions, metadata preservation, global scope, idempotency, and target-specific ownership.
Existing-contract evidence tests/spec_conformance/test_resolution_reqs.py, CONFORMANCE.json, CONFORMANCE.md Binds native collision preservation and diagnostics to existing req-pr-002 local-priority semantics. Adds no requirement, schema, or compatibility contract.

Diagrams

Legend: notes identify new onboarding behavior; discovery and declaration never copy the source, while deployment remains a separate ordinary install.

stateDiagram-v2
    [*] --> Discovered: apm init --discover
    note right of Discovered
        NEW: read-only inventory and canonical admission
    end note
    Discovered --> Declared: consented --apply
    note right of Declared
        NEW: apm.yml local path only; source stays in place
    end note
    Declared --> Installed: apm install --target copilot
    Installed --> Rerun: discover or apply again
    Rerun --> Installed: manifest, lockfile, and ledger unchanged
    note right of Rerun
        NEW: no-copy source invariant across reruns
    end note
Loading

Trade-offs

  • Declare rather than migrate. Chose metadata-only local references; rejected converters, hooks rewriting, provenance capture, refresh, and source relocation because those require separate contracts and acceptance criteria.
  • Separate target selection. Chose --target only on apm install; rejected target-aware discovery so preview and declaration remain harness-neutral.
  • Reject unsafe or ambiguous candidates. Chose all-or-nothing apply on symlinks, overlaps, identity collisions, invalid manifests, and changed previews; rejected partial mutation because it would make consent stale or unclear.
  • Preserve installer behavior. Chose the existing lockfile, ledger, parser, and BaseIntegrator authorities; rejected onboarding-specific deployment ownership. Apply uses the ordinary operational lifecycle lock, not import-specific state.
  • Narrowed delivery. This intentionally does not complete all of RFE: Extend brownfield discovery to cover agent harness (hooks, commands, styles) #1130 and does not add a new specification or README contract.

Benefits

  1. A repository containing .claude/skills/review/SKILL.md can preview and declare exactly one local path dependency without changing the source tree.
  2. A subsequent apm install --target copilot deploys the ordinary skill to .agents/skills/review/, including CRLF text and binary resources byte-for-byte.
  3. Repeated discovery/apply preserves manifest bytes, source bytes, lockfile, and deployment ledger exactly.
  4. An unowned .agents/skills/review/ collision produces no target writes; ordinary install reports the skill skipped unless force is explicitly selected.
  5. Static guards reject future onboarding imports/writes that cross the metadata-only boundary or bypass canonical collision protection.

Validation

Important

CI passes at 325836ede5: both Linux test shards, lifecycle and binary smoke, Windows compatibility, lint, architecture ratchets, spec conformance, and the aggregate gate. Final CI run. Neither PR has been merged.

Targeted behavior suite:

APM_E2E_TESTS=1 uv run --frozen --extra dev pytest -q tests/unit/adopt tests/unit/test_local_deps.py tests/unit/integration/test_skill_integrator.py tests/unit/integration/test_skill_integrator_hermetic.py tests/unit/integration/test_skill_integrator_phase3w4.py tests/unit/scripts/test_architecture_runner.py tests/integration/test_brownfield_lifecycle.py tests/integration/test_architecture_onboarding.py tests/integration/test_architecture_native_skill_collision.py tests/spec_conformance/test_resolution_reqs.py --tb=short
541 passed in 42.34s

The final selection includes all three real CLI lifecycle cases. Earlier isolated lifecycle run:

tests/integration/test_brownfield_lifecycle.py
3 passed in 19.60s

This includes the collision lifecycle: apply exits 1 with no writes; install exits 0, skips the unowned target, and records no owned target path.

Quality and lint evidence
[+] assertion-quality ratchet clean: AQ001=4, AQ002=12
[+] exact test duplicate ratchet clean: 1218 files, 0 allowed duplicate group(s)

The full Ruff check, Ruff format check (1,855 files), pylint R0801, auth-signals check, architecture-boundary checks, YAML I/O guard, portable-relative-path guard, and 2,100-line guard all passed. skill_integrator.py is exactly 2,100 lines after comment compression.

Final code review confirmed both reported collision edge cases resolved. Docs-sync found no remaining drift at the final head.

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 Preview an existing skill without changing project, home, cache, or source content Secure by default, DevX tests/unit/adopt/test_onboarding.py::test_discovery_is_read_only_and_apply_changes_only_consumer
tests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machine
component + e2e
2 Consent to declare a local skill while preserving existing manifest metadata and source bytes Portability by manifest, DevX tests/unit/adopt/test_onboarding.py::test_equivalent_references_keep_comments_options_and_bytes
tests/unit/adopt/test_onboarding.py::test_new_dependency_preserves_existing_settings
component
3 Install the declared skill for Copilot with CRLF text and binary resources preserved Multi-harness support, Portability by manifest tests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machine e2e
4 Rerun discovery/apply without changing the manifest, lockfile, or deployment ledger Governed by policy, DevX tests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machine e2e
5 Preserve an unowned native target instead of overwriting it Secure by default, Governed by policy tests/integration/test_brownfield_lifecycle.py::test_onboarding_does_not_grant_install_collision_ownership
tests/unit/adopt/test_native_skill_collision.py::test_native_skill_preserves_unowned_directory (regression-trap related to #1122)
e2e + component
6 Refuse symlink escapes, changed previews, invalid manifests, and install-identity collisions before writing Secure by default tests/unit/adopt/test_onboarding.py::test_unsafe_symlinks_refuse_before_write
::test_changed_candidate_is_revalidated_before_apply
::test_install_identity_collision_refuses_entire_write
component

How to test

  • Create .claude/skills/review/SKILL.md plus a binary resource, run apm init --discover --format json, and verify the report proposes ./.claude/skills/review with no filesystem changes.
  • Run apm init --discover --apply --yes; verify only apm.yml gains the local dependency and the source remains byte-identical. The standard operational lifecycle lock may be initialized.
  • Run apm install --target copilot --no-policy; verify .agents/skills/review/ matches the source, including CRLF and binary bytes.
  • Repeat discovery and apply; verify apm.yml, apm.lock.yaml, source content, and deployment ledger are unchanged.
  • Pre-create an unowned .agents/skills/review/, rerun apply/install, and verify apply refuses the collision without writes while install preserves and skips that target.

The discovery groundwork in #2857 is credited to Ron Izraeli [email protected].

Co-authored-by: Ron Izraeli [email protected]
Co-authored-by: Copilot [email protected]

Build on the read-only discovery work from #2857 while keeping apply metadata-only. Prove discover, declare, install, rerun, and collision protection through the existing APMLifecycle runner.

Co-authored-by: Ron Izraeli <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Cover the existing req-pr-002 local-priority contract with the native-skill collision regression and assert its recorded diagnostic. No normative requirements or specification prose change.

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

Daniel Meppiel (danielmeppiel) commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Docs sync advisory

Verdict: no_change * Pages affected: 0 * LLM calls: 1/15

Classifier JSON

{
  "verdict": "no_change",
  "confidence": "high",
  "source": "L2",
  "scope_pages": [],
  "structural_proposal": null,
  "reasoning": "The synchronization delta from 363fe675a9 to 325836ede5 adds coverage for existing req-pr-002 without changing specification prose or requirements, makes discovery refuse pre-existing manifest install-slot collisions before apply, and corrects integration result metadata when a later target deploys successfully. These changes preserve and enforce behavior already documented: unsafe discovery findings do not write metadata, normal installation collision protection applies, local content wins, and diagnostics report collisions. No documentation files changed in the delta and no residual documentation drift was found."
}

Advisory

No additional documentation edits are necessary for PR #2937 at final head 325836ede5.

The cumulative onboarding documentation remains resolved by the pages already
updated earlier in the PR:

  • docs/src/content/docs/getting-started/migration.md
  • docs/src/content/docs/reference/cli/init.md
  • packages/apm-guide/.apm/skills/apm-usage/commands.md (secondary resource surface)

Delta evidence (363fe675a9..325836ede5):

  • No human-facing corpus, apm-guide, or specification prose files changed.
  • CONFORMANCE.json and CONFORMANCE.md only increase the test count and add
    a wrapper for existing requirement req-pr-002; there is no new requirement.
  • Discovery now identifies an already-conflicting manifest install slot as
    unsafe and refuses apply before writing. The init reference already says
    structured findings include unsafe, apply adds only safe missing local
    references, and normal collision handling remains active.
  • The successful-secondary-target fix changes internal integration result
    metadata so a protected first destination does not hide a later successful
    deployment. It introduces no command, flag, format, or user workflow.
  • Existing install documentation already states that local .apm/ content wins
    on collision and that collision diagnostics are reported.
  • The delta passed git diff --check.
  • Classifier JSON passed the repository schema.

Exact necessary edits: none.

The classifier cost gate stops the rerun here. No localizer, writer, verifier,
editorial, growth, CDO, or S7 command probes were required.

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.

Copilot review overview

🟡 Changes recommended

One critical and multiple moderate review findings remain unresolved.

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

Review tier: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

New issues introduced by this change (3)
Severity Finding
High severity src/​apm_cli/​integration/​skill_integrator.py — With force=True, check_collision returns False for any existing path, including a regular…
Medium severity src/​apm_cli/​adopt/​discovery.py — Global discovery is using raw profiles from active_targets_* and then always builds scan paths…
Low severity CHANGELOG.md — This Unreleased entry does not follow the repository changelog contract in…
What changed in this PR

Adds apm init --discover for read-only local package inventory, consented manifest-only onboarding, and safer native skill collision handling.

Changes:

  • Adds bounded discovery, validation, output formats, and scope support.
  • Adds atomic, comment-preserving manifest updates.
  • Adds collision safeguards, architecture checks, documentation, and lifecycle tests.
File Summary
tests/​unit/​integration/​test_skill_integrator.py Updates native-skill ownership expectations.
tests/​unit/​adopt/​test_onboarding.py Covers onboarding behavior. Two moderate findings (1 vote each) request skipping unavailable symlink setup.
tests/​unit/​adopt/​test_native_skill_collision.py Tests native collision behavior.
tests/​integration/​test_brownfield_lifecycle.py Covers the end-to-end discovery, declaration, installation, and rerun lifecycle.
tests/​integration/​test_architecture_onboarding.py Covers onboarding architecture guards.
tests/​integration/​test_architecture_native_skill_collision.py Covers collision architecture guards.
src/​apm_cli/​utils/​yaml_io.py Provides comment-preserving YAML serialization.
src/​apm_cli/​models/​validation.py Supports read-only package validation.
src/​apm_cli/​integration/​skill_integrator.py Adds native collision protection. Critical finding (1 vote): forced installs must handle file and directory destinations separately.
src/​apm_cli/​core/​output_mode.py Handles structured output modes.
src/​apm_cli/​commands/​init.py Integrates discovery with init.
src/​apm_cli/​commands/​discover.py Orchestrates discovery behavior and output.
src/​apm_cli/​cli.py Registers CLI routing and update suppression.
src/​apm_cli/​agent_plugins/​projection.py Supports read-only projection.
src/​apm_cli/​adopt/​safety.py Implements bounded filesystem safety checks.
src/​apm_cli/​adopt/​render.py Renders discovery reports.
src/​apm_cli/​adopt/​materialize.py Applies locked, consented manifest changes.
src/​apm_cli/​adopt/​manifest_edit.py Performs metadata-only manifest edits.
src/​apm_cli/​adopt/​discovery.py Inventories and classifies candidates. Three moderate findings request canonical global scope resolution (3 votes), correct project target-relative scoping (1 vote), and fail-closed handling of unknown targets (1 vote).
src/​apm_cli/​adopt/​__init__.py Defines onboarding package exports.
scripts/​architecture_linter/​groups/​mutation_writes.py Registers mutation-write guards.
scripts/​architecture_linter/​checks/​onboarding.py Enforces onboarding boundaries.
scripts/​architecture_linter/​checks/​marketplace_package_and_registration.py Updates projection boundary checks.
scripts/​architecture_linter/​checks/​install_frozen_and_audit.py Updates install architecture checks.
scripts/​architecture_linter/​checks/​install_base_integrator_and_contraction.py Enforces canonical collision handling.
packages/​apm-guide/​.apm/​skills/​apm-usage/​commands.md Documents usage guidance.
docs/​src/​content/​docs/​reference/​cli/​init.md Documents the init command.
docs/​src/​content/​docs/​getting-started/​migration.md Documents brownfield migration guidance.
CHANGELOG.md Adds the onboarding entry. Nit (3 votes): append the current PR number as the final suffix.
.apm/​architecture/​owners/​contracts-tooling.json Declares architecture ownership.
Suppressed comments (4)

src/apm_cli/adopt/discovery.py:114

  • This hard-codes user scope for every TARGET_RELATIVE deployment row. Project discovery passes a project root, so a project-scoped target-relative row is resolved against the user profile (or a relative profile with no managed root), which can make discovery fail or misclassify an already-managed path. Scope the profile from the locator/report instead of always passing True.
            profile = profile.for_scope(user_scope=True)

src/apm_cli/adopt/discovery.py:112

  • Do not fall back to the first registered target when a deployment ledger contains an unknown target. A stale or tampered TARGET_RELATIVE row is then guessed as Copilot and can reach resolve_locator() with the wrong root (or raise an uncaught RuntimeError), rather than failing closed with a clear invalid-ledger result. Keep any legacy fallback limited to path forms whose target is not needed, and explicitly reject unknown target-relative rows.
        profile = KNOWN_TARGETS.get(record.locator.target, next(iter(KNOWN_TARGETS.values())))

tests/unit/adopt/test_onboarding.py:175

  • On platforms where symlink creation is unavailable, these setup calls raise OSError or NotImplementedError before the onboarding behavior is exercised, turning this test into a platform failure rather than a skip. Existing symlink tests in the repository catch those exceptions and call pytest.skip; wrap this parameterized setup in the same guard.
    tests/unit/adopt/test_onboarding.py:263
  • This symlink setup can raise OSError or NotImplementedError on platforms without symlink support, so the test fails during setup instead of validating revalidation. Match the repository's existing symlink-test convention by skipping when creation is unavailable.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1159 to +1165
if self.check_collision(
target_skill_dir,
rel_path,
{rel_path} if session_owned else collision_managed,
force,
diagnostics=diagnostics,
):
Comment on lines +32 to +36
profiles = (
active_targets_user_scope("all", create_config=False)
if user_scope
else active_targets(root, "all", create_config=False)
)
Comment thread CHANGELOG.md Outdated

### Added

- `apm init --discover` previews existing agent content; consented `--apply` declares supported local packages without changing source files, ready for a separate `apm install`. Builds on discovery work by @chkp-roniz in #2857.
…gets

Reject conflicting pre-existing dependency slots before applying any manifest delta. Report native skill metadata from the first successful target, preserving skipped author-owned destinations. Refresh owned-collision fixtures and the architecture rule inventory.

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

Daniel Meppiel (danielmeppiel) commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

PR #2937 is a bounded brownfield onboarding on-ramp: discover local packages, declare metadata with consent, then install separately through APM.

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

The round-2 panel converges: the four bounded folds are resolved at head ab94de5, and no reviewer carries a new in-scope required or recommended finding. The evidence is now stronger than round 1: functional-final.log and functional-results.xml report 610 passed in 44.37s with failures=0/errors=0/skipped=0; mutation-folds.log shows the seven new fold guards fail when removed; mutation-collision.log shows the four native collision behavior/static/e2e guards fail when restored to the vulnerable form; lint-final.log reports the canonical Ruff/Pylint/auth/YAML/path/2100-line/architecture lint chain clean. This is local exact-head evidence only; remote CI on the final head still needs to be observed after push.

Scope disposition is unchanged and binding: this remains onboarding, not migration or standards compatibility. Discovery stays read-only through existing registries, parsers, and canonical admission; apply only creates or merges consumer apm.yml local-package declarations; author source content remains byte-for-byte in place and idempotent; installation remains a separate apm install using the ordinary consent, policy, path-safety, and collision pipeline; unsupported native rules, hooks, settings, and loose files are reported, not translated. No native-format converters, hook rewriting, provenance or refresh machinery, wrappers for loose native files, new harness features, compatibility matrix, standards normalization, new specification requirements, README expansion, broad documentation or architecture refactors, auto-filed issues, or hypothetical platform-format tests belong in this PR.

The only dissent-like item is closed by scope: Python's round-2 nit literally says "No further architecture fold requested" and is not actionable, while DevX accepts that the prior detailed-refusal taxonomy was declined as scope_boundary_crossed. The panel is advisory, not merge authority; the maintainer owns the final policy and review decision.

Dissent. No substantive round-2 disagreement remains. The prior DevX request for a broader detailed-refusal taxonomy stays deferred as scope_boundary_crossed; safety and the locked onboarding boundary outweigh broad diagnostic expansion here.

Aligned with: Portable by manifest, Secure by default, Governed by policy, Multi-harness / multi-host, OSS community-driven, Pragmatic as npm

Growth signal. The adoption story is a truthful brownfield on-ramp: users can preview and declare existing local agent content without a migration campaign. Do not amplify it as compatibility conversion, README repositioning, or a new standards promise.

Panel summary

Persona B R N Takeaway
CLI Logging Expert 0 0 0 CLI output concern resolved: global apply now points to apm install --global; no new logging defects in the fold.
DevX UX Expert 0 0 0 DevX folds are satisfied at final head; no remaining scoped correctness gaps from the delta.
Doc Writer 0 0 0 No remaining doc drift after the bounded exit-code correction; ship without prose expansion.
OSS Growth Hacker 0 0 0 No growth findings at final head; bounded onboarding story remains truthful after the four folds.
performance-expert 0 0 0 No final performance concerns; fold delta adds one static init-facade guard plus docs/output/tests, with no install/runtime scan growth.
Python Architect 0 0 1 Folds satisfy the prior architecture concern; no new in-scope architectural defect found.
Supply Chain Security 0 0 0 No supply-chain safety regressions in the final bounded folds; metadata-only onboarding and ordinary install protections remain intact.
Test Coverage 0 0 0 Prior coverage gap is folded; lifecycle and static tests cover the promised onboarding boundaries.

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

Architecture

classDiagram
    direction LR
    class InitCommand {
      <<CLIEntry>>
      +init(...) None
    }
    class DiscoverCommand {
      <<CLIFacade>>
      +run_discover(...) None
    }
    class DiscoveryService {
      <<Collector>>
      +discover(root, manifest, user_scope) dict
      -_inventory(root, user_scope) list
      -_managed_paths(consumer, root) set
    }
    class Materializer {
      <<Coordinator>>
      +apply_report(report) dict
    }
    class ManifestEditor {
      <<ManifestWriter>>
      +read_manifest(path, root) tuple
      +write_manifest(path, root, data, additions, original) bool
    }
    class DiscoveryLogger {
      <<Renderer>>
      +report(report, fmt) None
    }
    class CommandLogger {
      <<BaseLogger>>
    }
    class DependencyReference {
      <<ValueObject>>
      +get_install_path(base) Path
      +get_unique_key() str
    }
    class ValidationModule {
      <<AdmissionOwner>>
      +validate_apm_package(path, read_only) ValidationResult
    }
    class BaseIntegrator {
      <<CollisionOwner>>
      +check_collision(target_path, rel_path, managed_files, force) bool
    }
    class SkillIntegrator {
      <<Integrator>>
      +_integrate_native_skill(...) SkillIntegrationResult
    }
    class OnboardingBoundaryRule {
      <<StaticGuard>>
      +check_onboarding(provider) Iterable[Violation]
    }
    CommandLogger <|-- DiscoveryLogger
    InitCommand ..> DiscoverCommand : delegates init --discover
    DiscoverCommand ..> DiscoveryService : preview report
    DiscoverCommand ..> Materializer : consented apply
    DiscoveryService ..> ManifestEditor : reads existing deps
    DiscoveryService ..> DependencyReference : install slot identity
    DiscoveryService ..> ValidationModule : read_only=True
    Materializer ..> ManifestEditor : atomic apm.yml merge
    BaseIntegrator <|-- SkillIntegrator
    SkillIntegrator ..> BaseIntegrator : check_collision
    OnboardingBoundaryRule ..> InitCommand : guards discover branch
    OnboardingBoundaryRule ..> DiscoveryService : guards metadata-only owner
    note for DiscoveryLogger "Collect-then-render:\nreport dict -> text/json/yaml"
    note for ValidationModule "Read-only admission:\nreject normalization-required formats"
    note for BaseIntegrator "Canonical collision owner:\ninstall pipeline remains separate"
    note for OnboardingBoundaryRule "Dual guardrail:\nbehavioral test + static boundary check"
    class InitCommand:::touched
    class DiscoverCommand:::touched
    class DiscoveryService:::touched
    class Materializer:::touched
    class ManifestEditor:::touched
    class DiscoveryLogger:::touched
    class ValidationModule:::touched
    class SkillIntegrator:::touched
    class OnboardingBoundaryRule:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A["CLI: apm init --discover\nsrc/apm_cli/commands/init.py::init"] --> B{"discover_flag?"}
    B -- "false" --> C["[LOCK] serialized_lifecycle_unless keeps normal init scaffold serialized"]
    B -- "true" --> D{"project_name/plugin/marketplace/target_flag set?"}
    D -- "yes" --> E["exit 2 UsageError: --discover cannot scaffold or select targets"]
    D -- "no" --> F["src/apm_cli/commands/discover.py::run_discover"]
    F --> G["[I/O] src/apm_cli/adopt/discovery.py::discover(root, manifest, user_scope)"]
    G --> H["[I/O] manifest_edit.read_manifest(..., create_config=False)"]
    G --> I["[I/O] discovery._inventory(): bounded non-following path scan"]
    G --> J["models.validation.validate_apm_package(path, read_only=True)"]
    G --> K{"unsafe finding or install-slot collision?"}
    K -- "yes + --apply" --> L["exit 1 ClickException: No onboarding changes were applied"]
    K -- "no or preview" --> M{"--apply?"}
    M -- "no" --> N["DiscoveryLogger.report(report, --format): stdout report only"]
    M -- "yes" --> O{"--yes or interactive consent?"}
    O -- "no" --> P["exit 1 ClickException/Abort: no manifest write"]
    O -- "yes" --> Q["[LOCK] adopt.materialize.apply_report(): lifecycle_operation"]
    Q --> R["[I/O] apply_report re-runs discover(); changed report raises ValueError"]
    R --> S["[FS] manifest_edit.write_manifest(): atomic consumer apm.yml merge only"]
    S --> N
    T["Separate later CLI: apm install --target copilot"] --> U["[FS] SkillIntegrator._integrate_native_skill(...)"]
    U --> V["BaseIntegrator.check_collision(target_skill_dir, rel_path, managed_files, force)"]
    V -- "unowned target" --> W["skip target; diagnostics.collision; install continues"]
    V -- "managed, forced, or absent" --> X["[FS] shutil.copytree(package_path, target_skill_dir)"]
Loading

Recommendation

Driver completion update: the recommendation's push/CI steps below are now complete at ab94de5a6bbb6c9ceda21816617079d0c1e768b2. All 22 final-head checks are green or acceptably neutral/skipped; GitHub reports MERGEABLE, with policy/review action left to the maintainer.

Advisory recommendation: no in-scope panel work remains at the exact local head. Push the clean head, observe live CI before merging, and leave the final policy/review call with the maintainer; do not expand this PR beyond bounded onboarding.


Full per-persona findings

Python Architect

  • [nit] No further architecture fold requested.
    Scope lock disposition: honored. The final folds stay inside onboarding only: discovery remains read-only through existing registries/parsers/canonical admission; apply only merges consumer apm.yml local-package declarations; install remains a separate ordinary apm install path with BaseIntegrator collision policy; unsupported native content is reported, not translated. scope_boundary_crossed=false. The prior architecture concern is satisfied by adding src/apm_cli/commands/init.py to the onboarding owner selector, checking only the discover_flag branch for forbidden imports/writes/install calls, and adding mutation coverage for write_text, run_install_pipeline, shutil, and subprocess. The fold did not introduce a parallel authority or broaden native conversion/standards scope.

3. Design patterns

Design patterns

  • Used in this PR: Collect-then-render -- adopt.discovery.discover() and adopt.materialize.apply_report() collect a report dictionary, and DiscoveryLogger.report() renders text/json/yaml at the command boundary.
  • Used in this PR: Base + subclass -- DiscoveryLogger subclasses CommandLogger for command-specific presentation without duplicating logger lifecycle.
  • Used in this PR: Canonical owner routing -- discovery uses DependencyReference/APMPackage validation/path anchoring for identities and SkillIntegrator routes native collisions through BaseIntegrator.check_collision().
  • Pragmatic suggestion: none -- the folded guard coverage is now the right boundary; adding converters, compatibility layers, or broader guards for hypothetical formats would cross the locked scope.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

At head ab94de5, the final fold touches .apm/architecture/owners/contracts-tooling.json, docs/src/content/docs/reference/cli/init.md, scripts/architecture_linter/checks/onboarding.py, src/apm_cli/adopt/render.py, and onboarding tests, while the full PR remains limited to onboarding/discover/init/docs/conformance/linter/integrator/output-mode/test files and does not change AuthResolver, token_manager, authentication docs, credential resolution, token handling, or remote-host auth behavior.

Doc Writer

No findings.

Test Coverage

No findings.

Performance Expert

No final performance concerns; fold delta adds one static init-facade guard plus docs/output/tests, with no install/runtime scan growth.

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

Addresses scoped panel follow-ups: preserve user scope in the separate install hint, document declined consent, and defend the existing init discovery facade and target-selection boundary without expanding admission or installation behavior.

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

Copy link
Copy Markdown
Collaborator Author

Shepherd advisory: ready for maintainer review

Final head: ab94de5a6bbb6c9ceda21816617079d0c1e768b2. Final panel recommendation: ship_now. Four bounded folds, no remaining in-scope follow-ups.

Folded in this run

  • Preserve --global in the separate install hint, with component and real-CLI regression evidence. Resolved in ab94de5a6b.
  • Document discovery consent refusal exit 1 and invalid discovery options exit 2. Resolved in ab94de5a6b.
  • Defend the existing --discover/--target rejection with real CLI exit-2 and no-write assertions. Resolved in ab94de5a6b.
  • Extend the existing onboarding static guard and owner selector to the init discovery facade; four mutation cases. Resolved in ab94de5a6b.

Deferred (out-of-scope follow-ups)

  • Broader detailed refusal diagnostics / sanitized error taxonomy. scope_boundary_crossed: No reproducible correctness or safety defect was shown; new diagnostic taxonomy exceeds the locked onboarding allowlist and risks exposing native metadata. Existing explicit safe refusal is preserved.
    No tracking issues were opened. Generic exception details remain suppressed to avoid exposing native content.

Copilot signals reviewed

Two fetch rounds found zero inline Copilot comments to classify. The existing COMMENTED review was observed; no inline finding was ignored.

Canonical-owner and regression-trap evidence

Deterministic detection and semantic verification passed at base e38261c5db4d893d6ddebc3925742e4e3bd2ba74 and exact head ab94de5a6bbb6c9ceda21816617079d0c1e768b2: four touched owners, ten explicitly mapped passing functional test IDs, version-2 evidence.

  • 610 passed in 44.37s, with no skips, failures, or errors. Includes the five real-CLI onboarding cases and the existing legacy plugin lifecycle, projection, bounded YAML and BOM contracts.
  • Deleted the new global handoff, target-selection and init-facade protections: 7 expected failures.
  • Deleted native BaseIntegrator.check_collision routing: 4 expected component/static/real-CLI failures, including preservation of author-owned destination bytes.
  • All mutations restored byte-for-byte before the exact-head passing run. No replacement runner or proxy evidence added.

Lint contract

Full canonical Ruff check/format (1,855 files), pylint R0801, auth signals, architecture boundaries, YAML I/O, portable-relative-path and 2,100-line guards passed. Assertion-quality and exact-test-duplicate ratchets also passed. uv.lock was unchanged; the isolated environment used the frozen dependency versions.

CI

Final-head CI run: all 22 reported checks concluded successfully or acceptably (20 SUCCESS, 1 NEUTRAL, 1 SKIPPED). Includes both Linux shards, lint, lifecycle smoke, Windows compatibility, binary smoke, architecture ratchets, spec conformance, CodeQL and the aggregate gate. Zero CI recovery iterations.

Mergeability status

PR Head Panel Iterations Folds Defers Copilot rounds CI mergeable mergeStateStatus
#2937 ab94de5a6b ship_now 2 4 1 2 green MERGEABLE BLOCKED

BLOCKED is GitHub policy/review state, not a merge conflict. This run does not bypass it. No merge, auto-merge, issue closure, branch protection change, history rewrite or superseding PR was performed. Ron's attribution is preserved.

Reservations carried from strategic-alignment

This is ONBOARDING, NOT migration or standards compatibility. Keep read-only discovery through existing registries/parsers/canonical admission. Apply only creates/merges consumer apm.yml local-package declarations, leaves author source content in place byte-for-byte, and is idempotent. Installation remains a SEPARATE apm install using ordinary pipeline, consent, policy, path safety and collision protections. Unsupported native rules/hooks/settings/etc are REPORTED, never translated. NO native-format converters, hook-script rewriting, .import-sources.json, provenance/refresh machinery, wrappers for loose native files, new harness features, new compatibility matrix, native standards normalization, new specification requirements or broad documentation/architecture refactors. Authors and harnesses own compliance. No README changes or new features. Panels are advisory, not authority to expand scope. FOLD only reproducible correctness/safety/idempotence defects or genuinely missing evidence/docs for the promised flow. Any proposal crossing those boundaries must be rejected/deferred with explicit scope_boundary_crossed, not implemented; don't auto-file tracking issues. If a real blocker cannot be solved within scope, return blocked for maintainer rather than broadening. Pass PANEL_PRIOR.reservations reflecting these boundaries and include disposition in terminal advisory. Advisory tests for hypothetical new formats/platform support cannot change admissions contract.

Disposition: all reservations honored. The four changes above correct the existing onboarding flow or its evidence; the broader diagnostic proposal was explicitly set aside. No converters, source rewrites, new formats, new harness/specification contracts, README edits or broad refactors were introduced.

Convergence

Two bounded review iterations; final panel has no actionable in-scope findings. Documentation impact is already resolved in the changed pages. Converged panel recommendation. Ready for the maintainer's policy/review decision.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit fe63f39 into main Sep 11, 2026
22 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-apm-onboarding-scope branch September 11, 2026 20:05
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Sep 18, 2026
…ass (#2893)

* Initial plan

* build(deps): bump setuptools to 83.0.0 in uv lockfile

Co-authored-by: sergio-sisternes-epam <[email protected]>

* Fix skills subset installs for manifestless Git collections (#2891)

* Initial plan

* Fix manifestless skill collection subset resolution

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

---------

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

* test: restore complete architecture guard mutation coverage (#2892)

* Initial plan

* test: cover missing architecture owner guard mutations

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

---------

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

* fix(registry): exact version selectors must match published build metadata (#2894)

* fix(registry): exact version selectors must match published build metadata

A version selector with no range operator (e.g. 1.0.2+fa163e16) was
routed through semver range matching, which ignores build metadata in
every comparison. Two published builds sharing the same
major.minor.patch (e.g. 1.0.2+fa163e16 and 1.0.2+863e11af) tied under
that comparison, so the resolver could silently return a different
build than the one requested.

Check for an exact string match against the published version list
before falling into range matching. Real ranges (^, ~, >=, wildcards)
are unaffected, since none of them can ever equal a published version
string literally.

Fixes #2877

* test(registry): give each build-metadata test its own matching tarball

Addresses review feedback: the fixture previously reused one tarball
(declared apm.yml version 1.0.2, no build metadata) for both published
VersionEntry builds. Build a distinct tarball per build whose apm.yml
version matches its VersionEntry, and return the right bytes for the
requested version, so the test stays accurate if package validation
later cross-checks the extracted version against the resolved one.

* fix(install): fail loudly when a package deploys to no target (closes #2796) (#2806)

* fix(install): fail target-excluded plugin no-ops

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

* fix: preserve agent plugin recovery refs

Addresses panel follow-ups to keep Agent Plugin target-exclusion recovery commands pinned to the selected ref, document the breaking no-op contract, and add real CLI lifecycle coverage for total no-op failure plus mixed-install success.

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

* test: update plugin target no-op lifecycle

Addresses the CI regression from the legacy exit-0 expectation by rewriting the Agent Plugin non-Copilot target test for issue #2796: a total target-exclusion no-op now fails and commits no durable state.

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

* fix: ground plugin recovery hints in declared skills

Fold #2806 advisory follow-ups: select an inventoried skill directory, quote POSIX command operands, assert mixed-install skill bytes, and document dry-run behavior. Drop release-note duplicates resurrected while incorporating main. Mutation probes reject missing outcome, inventory and quoting guards.

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

---------

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

* docs: Add WinGet method installation (#2520)

* docs: Add WinGet method installation

* docs: clarify WinGet installation and upgrades

Address review follow-ups with exact registry selection, prerequisites, separate Windows examples, and matching upgrade guidance. Keep Scoop and the contributor's additive distribution intent.

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

---------

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

* chore(deps): bump svgo from 4.0.2 to 4.1.0 in /docs (#2914)

Bumps [svgo](https://github.com/svg/svgo) from 4.0.2 to 4.1.0.
- [Release notes](https://github.com/svg/svgo/releases)
- [Commits](svg/svgo@v4.0.2...v4.1.0)

---
updated-dependencies:
- dependency-name: svgo
  dependency-version: 4.1.0
  dependency-type: indirect
...

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

* fix(deps): preserve GitLab sparse-fetch transport (#2939)

* fix(deps): preserve GitLab sparse-fetch transport

Execute the shared transport plan using prepared remotes and per-attempt authentication. Gate REST on executed effective HTTPS, isolate live checkout identities, and add real-Git, architecture and mutation regression proof.

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

* test(spec): bind GitLab sparse fetch to port and cache requirements

Reuse the real-Git transport contract as executable evidence for req-sc-013 and req-rs-016, rather than waiving the Mode B conformance gate.

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

* docs(spec): regenerate GitLab sparse conformance evidence

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

* test(deps): align legacy REST fixtures with selected Git attempts

Configure a real strict HTTPS transport plan and a typed Git failure in REST tests, and include the new sparse-plan rule in the frozen architecture inventory.

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

* fix(deps): fold bounded sparse transport review feedback

Address CEO docs and diagnostics follow-ups on PR #2939: distinguish requested SSH from effective Git rewrites, correct packaged REST guidance, repair fallback recovery advice, and expose admitted protocol switches. Add a warning regression and isolated mutation proof without changing validation auth or other provider policy.

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

* test(deps): fold GitLab sparse Copilot regression fixes

Fix both legacy integration REST fixtures to execute a real HTTPS selector plan and raise only typed Git failures. Probe symlink capability rather than skipping Windows unconditionally, and qualify the canonical sparse-fetch credential documentation. Addresses Copilot review 5167472317 without changing validation auth or shared selector dedup semantics.

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

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

* test(deps): align clone fallback warning regression

CI recovery 1: the shared custom-port warning now correctly explains disabling all fallback configuration sources and points at the live docs route. Update its older clone consumer assertion to this reviewed wording without changing runtime behavior.

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

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

---------

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

* feat(init): onboard existing local packages without rewriting source (#2937)

* feat(init): onboard existing local packages without conversion

Build on the read-only discovery work from #2857 while keeping apply metadata-only. Prove discover, declare, install, rerun, and collision protection through the existing APMLifecycle runner.

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

* test(onboarding): bind native collision safety to local priority

Cover the existing req-pr-002 local-priority contract with the native-skill collision regression and assert its recorded diagnostic. No normative requirements or specification prose change.

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

* fix(onboarding): reject existing collisions and report successful targets

Reject conflicting pre-existing dependency slots before applying any manifest delta. Report native skill metadata from the first successful target, preserving skipped author-owned destinations. Refresh owned-collision fixtures and the architecture rule inventory.

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

* fix(onboarding): preserve global handoff and discovery boundaries

Addresses scoped panel follow-ups: preserve user scope in the separate install hint, document declined consent, and defend the existing init discovery facade and target-selection boundary without expanding admission or installation behavior.

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

---------

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

* chore(deps): bump astro from 7.2.7 to 7.3.2 in /docs (#2922)

Bumps [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) from 7.2.7 to 7.3.2.
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/[email protected]/packages/astro)

---
updated-dependencies:
- dependency-name: astro
  dependency-version: 7.3.2
  dependency-type: direct:production
...

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

* chore(deps): bump smol-toml from 1.6.1 to 1.8.0 in /docs (#2942)

Bumps [smol-toml](https://github.com/squirrelchat/smol-toml) from 1.6.1 to 1.8.0.
- [Release notes](https://github.com/squirrelchat/smol-toml/releases)
- [Commits](squirrelchat/smol-toml@v1.6.1...v1.8.0)

---
updated-dependencies:
- dependency-name: smol-toml
  dependency-version: 1.8.0
  dependency-type: indirect
...

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

* docs: establish issue-first contribution and governance policy (#2954)

* docs: establish issue-first contribution and governance policy

Implement the approved Phase 1 scope in #2953. Separate human scope approval from automated recommendations, document the maintainer roster and progression, and preserve technical reference material in the development guide. Live automation and backlog migration remain later phases.

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

* docs: fix rendered OpenAPM specification link

Use Astro's openapm-v01 route rather than the source filename spelling. Fix the broken link reported by the Deploy Docs workflow for #2954.

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

---------

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

* fix(triage): make automated recommendations advisory (#2956)

* docs: establish issue-first contribution and governance policy

Implement the approved Phase 1 scope in #2953. Separate human scope approval from automated recommendations, document the maintainer roster and progression, and preserve technical reference material in the development guide. Live automation and backlog migration remain later phases.

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

* docs: fix rendered OpenAPM specification link

Use Astro's openapm-v01 route rather than the source filename spelling. Fix the broken link reported by the Deploy Docs workflow for #2954.

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

* fix(triage): make automated recommendations advisory

Constrain workflow outputs to classification and processing metadata, retain legacy deduplication, and preserve human scope approval in direct consumers.

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

---------

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

* docs: define issue-backed roadmap and release planning (#2959)

* docs: establish issue-first contribution and governance policy

Implement the approved Phase 1 scope in #2953. Separate human scope approval from automated recommendations, document the maintainer roster and progression, and preserve technical reference material in the development guide. Live automation and backlog migration remain later phases.

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

* docs: fix rendered OpenAPM specification link

Use Astro's openapm-v01 route rather than the source filename spelling. Fix the broken link reported by the Deploy Docs workflow for #2954.

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

* fix(triage): make automated recommendations advisory

Constrain workflow outputs to classification and processing metadata, retain legacy deduplication, and preserve human scope approval in direct consumers.

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

* docs: define issue-backed roadmap and release planning

Closes #2958. Document the approved planning model; live Project rollout remains separately gated.

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

---------

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

* fix(governance): require human scope and add neutral eligibility evidence (#2964)

* fix(governance): require human scope and add neutral eligibility evidence

Refs #2960. Keep implementation authority human, make daily docs discovery-only, and deploy compatible triage consumers with regression coverage.

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

* fix(governance): make workflow trust and manual scope boundaries explicit

Use a verified literal default-branch checkout and bind policy to its actual commit. Remove remaining docs workflow label-ratification instructions; keep companion work outside unattended runs.

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

* fix: harden governance event and child-wave boundaries

Address the six bounded review contracts: default-branch entrypoints, fresh child-wave confirmation, trusted gh resolution, complete approval records, visible references, and bounded metadata reads.

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

---------

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

* fix(git-env): skip the HTTP header probe for non-HTTP effective URLs (#2906)

* fix(git-env): skip the HTTP header probe for non-HTTP effective URLs

An `insteadOf` rule that rewrites the fetched HTTPS URL to SSH, such as
`url."[email protected]:".insteadOf = https://github.com/`, made every private
dependency download fail on the authenticated retry.

`_validated_git_url_rewrite_policy` asked whether an HTTP `extraHeader`
applied to the effective URL. With an SCP-style target that probe ran
`git config --get-urlmatch http.extraHeader [email protected]:owner/repo`,
which git rejects with `invalid URL scheme name or missing '://' suffix`
and exit status 128, so the probe raised `GitUrlRewriteProbeError`.

An HTTP header can never reach a non-HTTP transport, so the answer is
already known: report no authorization and do not spawn the probe. The
remaining non-zero branch now names the exit status instead of only
saying the probe failed.

Fixes #2898

* docs(changelog): reference the pull request number

* fix(git-env): keep malformed rewrite targets on the wrapped safety error

The non-HTTP guard added in the previous commit was the first urlsplit
applied to the effective URL, and it is evaluated as an argument to
validate_resolved_git_url_rewrite -- so before that function's
try/except. An insteadOf rule whose replacement carries unbalanced
brackets, such as url."https://[::1/".insteadOf, therefore surfaced a raw
ValueError("Invalid IPv6 URL") instead of the module's
"Unable to verify Git URL rewrite safety", and the CPython message for a
bracketed non-address embeds the host unredacted.

Guarding the scheme lookup cannot fail open: both callers pass the same
URL straight to validate_resolved_git_url_rewrite, which re-splits it
inside its try and raises the wrapped error.

* fix: complete SCP rewrite consumer coverage and recovery

Address panel follow-ups on PR #2906 with real Git config resolver and authenticated-retry regressions, HTTP origin controls, and probe-specific recovery guidance. Preserve unsafe-rule recovery for proven policy failures and synchronize authentication documentation.

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

---------

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

* docs: publish the active issue-backed roadmap (#2988)

Publish Project 2304 from the README and contribution entry points, replace pending-rollout prose, and preserve issue-owned scope and milestone-owned release planning.

Refs #2960

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

* fix(uninstall): preserve unmanaged skills with an empty inventory (#2947)

* fix(uninstall): preserve unmanaged skills with an empty inventory

* docs(changelog): link unmanaged skill cleanup fix

* test(ci): repair stale daily release smoke fixtures (#2987)

Cover the two registered owner guards, exercise GitLab REST through real transport selection, and align Windows fixtures with canonical home/path and deployed-file hash contracts. Preserve production behavior and strengthen regression witnesses for #2965.

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

* fix(cache): pin core.autocrlf=false on GitCache checkouts (#2982)

* fix(cache): pin core.autocrlf=false on GitCache checkouts (closes #2971)

Git-subpath materialization went through GitCache without the
CRLF pin that bare_cache already set, so Windows hosts with
system core.autocrlf=true recorded non-portable content_hash
values. Add a -c pin that outranks env-frozen host config,
persist it on the checkout, and rematerialize unpinned shards.

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

* docs(changelog): cite #2982 for GitCache autocrlf pin

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

* fix(cache): heal GitCache autocrlf pin under shard lock

Defer unpinned SHA-valid eviction until _create_checkout holds the
shard lock, parse the local core.autocrlf key, fail closed on land
races, and document legacy lockfile regeneration.

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

* test(cache): isolate autocrlf host fixture and fail closed

Drop inherited GIT_CONFIG_NOSYSTEM/PARAMETERS before the hostile-host
regression, assert system autocrlf=true, document lock --update recovery,
and reject unremovable unpinned shards.

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

---------

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

* chore: release v0.31.0 (#2989)

Bump pyproject.toml and the apm-cli uv.lock entry to 0.31.0, and curate the dated changelog for the minor release. Current CI lint mirror passes locally; dependency versions, public registry URLs, and hashes remain unchanged.

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

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

* feat(autopilot): origin-aware skills with CODEOWNERS-safe review (#3003)

* feat: add ORIGIN x INTENT autopilot for triage, delivery, and review

Replay the actor-aware autopilot surface onto origin/main as one
commit: unattended runs never assign; actor-session delivery assigns
the working user; standalone review requests that user as reviewer.
Schedulers own the queue scripts and fan-out; workers advise or
implement one item. Keep CODEOWNERS additive and require full
conversation context before new advice.

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

* fix(autopilot): align tags and delivery with human-scope governance

Keep triage/requested as the only request trigger. status/needs-triage
stays human state. Delivery still queues on status/accepted, then probes
scripts/governance/eligibility.cjs and requires fresh confirmation.
Unattended ORIGIN never implements.

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

* refactor(autopilot): turn monolith orchestrators into sequencing aliases

apm-issue-autopilot and batch-bug-shepherd no longer implement. They
dispatch the canonical schedulers in-session, with a hard stop so
triage advice is not implementation permission.

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

* fix(autopilot): treat FANOUT_LIMIT as concurrency, not batch size

Schedulers must persist and drain the full helper-selected list,
refilling a slot when it returns. Two slots is parallelism only.

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

* fix(autopilot): stop spam-skipping bug forms; workers own writes

Sweep markup strip no longer lets a heading eat the rest of the
body, so valid GitHub bug forms stay eligible. Issue and PR triage
workers own comments and processing labels; schedulers only queue
and fan out.

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

* feat(autopilot): add worker activation card with optional writes

Issue-triage worker declares activation_card: on. Writes default
on; write: off returns the template without commenting or labeling.

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

* feat(autopilot): move PR-review writes off the scheduler

PR-review scheduler only queues and fans out. Reviewing sessions own
comments, labels, and the actor-session @me reviewer request. The
composed worker gets an activation card with write default on.

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

* fix(autopilot): gate PR review on panel-review

Unfiltered open-PR listing queued every pull request. Fresh review
now requires the panel-review label or an explicit named list.

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

* fix(autopilot): require status/accepted before PR review

panel-review only requests a pass. Without status/accepted on the PR
or a linked issue, the reviewing session comments, clears the request
label, and stops.

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

* refactor(autopilot): rename review panel; silent unaccepted stop

Rename apm-review-panel to autopilot-pr-review-panel and keep the
old name as a compatibility alias. Scheduler, worker, and panel all
stop when status/accepted is missing. Scheduler and worker leave no
comment; panel/worker may clear panel-review.

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

* refactor(autopilot): review-worker is advisory; merge-worker is drive-to-merge

Keep autopilot-pr-review-scheduler advisory-only. It composes
autopilot-pr-review-worker and never spawn autopilot-pr-merge-worker.
Summon merge-worker by name. Old panel names stay aliases.

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

* feat(autopilot): require Autogenesis activation cards on canonical skills

Enter before work, Exit after. Do not load Autogenesis path modules.
Schedulers are write off; workers default write on.

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

* refactor(autopilot): drop Autogenesis wording from activation cards

Keep Enter/Exit cards. Do not name the source discipline.

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

* feat(autopilot): declare activation_card on for every autopilot skill

Aliases and canonical skills both set the flag. Canonical skills still
own the Enter/Exit card body.

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

* docs: add maintainer map for autopilot skills

Internal package map only. Not product documentation.

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

* refactor(autopilot): nest skill packages under packages/autopilot

Keep leaf package names. Move the maintainer map to
packages/autopilot/README.md. Point pr-description-skill deps up one
more directory. Leave .agents/skills/ deploy layout flat.

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

* feat(autopilot): require scheduler queue tables with labels

Schedulers must emit keep-set and drop-set rows (number, kind,
labels, rationale, slot) before any spawn.

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

* fix(autopilot): invocation is harness, not origin

Copilot App, local, Cloud, and Remote Agent fill actor-session.
agentic-workflow is only gh-aw / Actions.

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

* fix(autopilot): exclude completed-advice from triage sweeps

Sweep fetch skips triage/recommended and status/triaged at GitHub
so already-advised open issues and PRs are not re-listed. Do not
write status/triaged. Named requests still fetch the one item.

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

* fix(autopilot): name worker sessions Domain stage #n

Issue triage #2993, PR triage #1017, Issue delivery #2902,
PR review #2741. No GitHub title. Do not rename in-flight sessions.

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

* Keep issue-triage JSON internal, not on GitHub comments.

The public advisory is prose plus the HTML receipt. Workers still fill
schema_version 2 JSON for the parent Exit, not the issue thread.

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

* Make triage JSON receipts optional, default off.

Enter/Exit cards take json: off|on. Omitted or unknown is off, not a
missing-field stop. json: on stays an internal payload; GitHub comments
stay prose.

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

* Stop the Triage Panel AW from requiring a JSON comment tail.

Pass json: off into autopilot-issue-triage-worker. GitHub comments stay
prose plus the HTML receipt.

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

* Route the PR Review Panel AW through the review scheduler.

Load autopilot-pr-review-scheduler (write off) then run
autopilot-pr-review-worker in-thread. Do not compose the merge worker.

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

* Auto-defer PRs with no accepted issue and thank the author.

PR triage writes status/deferred unless a same-repo linked issue is
status/accepted, and asks the author to open an issue first.

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

* Queue accepted PRs for advisory review without a named list.

Unsteered PR review now unions panel-review with status/accepted on
the PR, then still applies the accepted gate and CODEOWNERS
last-comment conditions. Named list is not required when a
maintainer already accepted the PR.

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

* Deliver accepted issues even when the author is a bot.

status/accepted from a CODEOWNER is the queue gate. Author type
is not a drop reason.

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

* Remove autopilot compatibility alias stubs.

Keep the nine canonical autopilot-{domain}-{stage}-{role} packages.
Drop the 22 installable aliases, retarget tests to merge-worker and
delivery, and refresh the lockfile.

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

* docs: retarget leftover alias names to canonical autopilot skills

PRINCIPLES.md, delivery/merge worker assets, and the cut-release
eval note now name autopilot-{domain}-{stage}-{role} only. Historical
CHANGELOG entries stay as written.

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

* style: ruff-format autopilot unit tests after main merge

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

* chore: refresh lock deployment hashes after alias-name retarget

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

* fix(autopilot): align review sweep, auto-defer, and lock orphans

Copilot App queue-open now unions panel-review with status/accepted on
the PR. PR triage auto-defers only when neither the PR nor a linked
issue is accepted. Drop deleted alias packages from the lockfile and
retarget merge-worker eval fixtures.

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

* fix(lock): rewrite deployed test-coverage-expert instruction link

Install replay retargets the relative markdown link from
.github/agents to .apm/instructions. The committed copy still used
the source-relative path, which failed APM Self-Check drift.

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

* fix(autopilot): sole-assignee claim and trusted gh lookup

Actor-session delivery continues only when @me is the sole human
assignee after add, and re-checks before implement or PR. Triage
queue helpers resolve gh through get_gh_executable so a
project-controlled binary is never used.

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

---------

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

* perf(cli): lazy-load heavyweight command modules (#3001)

* perf(cli): lazy-load heavyweight command modules

Defer install, audit, pack, marketplace, uninstall, update, and prune
until the matching verb is dispatched so apm --help, apm doctor, and
apm config get no longer import those graphs.

Closes #2996

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

* docs(changelog): link lazy CLI dispatch to #3001

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

* fix(cli): freeze lazy verbs and keep completion light

PyInstaller cannot follow importlib string paths, so collect
apm_cli.commands into hiddenimports. Complete from stubs, match
stub short_help to the real command, and advertise doctor --help.

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

---------

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

* fix(alias): reject path-traversing dependency aliases — fixes #2900 (#2901)

* fix(alias): reject path-traversing dependency aliases

Aliases were only matched against a lax character regex, letting values
like "..", "./x", or "foo/../bar" escape apm_modules at download and
integrate time. Now validating every parsed alias through
path_security's
segment checks and guarding the resolved install path inside the
download/integrate phases. Adds unit coverage for traversal and safe
aliases.

* fix(alias): surface friendly error for traversal aliases

Wrap validate_path_segments in parse_alias_override so '.'/'..' aliases
translate PathTraversalError into the existing allowed-character message
instead of leaking a low-level technical error. Strengthen traversal
tests
to assert the friendly message.

* test(alias): prove install-phase symlink escape is blocked

A valid alias like 'safe-name' passes parse-time validation, but
apm_modules_dir/safe-name can itself be a symlink pointing outside
apm_modules_dir. ensure_path_within is the only guard that resolves
symlinks before containment (download.py:65, integrate.py:622); this
test proves the escape raises PathTraversalError and never writes
outside the managed tree.

* test(alias): trap ensure_path_within guards end-to-end at install tier

The parser rejects traversal aliases (parse_alias_override), and the
ensure_path_within containment guards exist at download.py:65 and
integrate.py:622 as the defense-in-depth last line. But no test drove
those
guards through the real phase entry points -- the PR "Scenario 4" claim
(install path can never escape apm_modules even if the parser is
bypassed)
was proven only at unit tier.

Add install-tier regression traps that route malicious aliases through
the
actual phase run() functions:

- tests/red_team/install/test_alias_path_escape.py
  * download.run() rejects a '..' traversal alias and a symlink that
    resolves outside apm_modules_dir via PathTraversalError, asserting
    no
    download bytes land.
  * integrate.run() rejects the same two vectors before materialization.
  * Safe-alias controls confirm no false positive.

- tests/unit/test_registry_entry_alias_traversal.py
  * Covers the secondary parse_registry_object_entry alias validation
    (registry_entry.py:86): regex layer (%2e%2e) and
    validate_path_segments
    layer ('..', 'pkg/..'), plus a safe-alias affirmative control.

* Refactor install path handling for dependencies

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

* fix(alias): centralize safe destinations without restricting sources

Address the PR #2901 panel and Copilot follow-ups: route all alias ingress and materialization through existing owners, reject root-equal destinations, preserve local sibling sources, and defend real reinstall metadata and hashes with regression and architecture tests. Include actionable diagnostics and migration guidance.

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

* fix(alias): preserve normalized roots and legacy cache preflight

Address round-two architecture/security and lifecycle findings. Compare both roots through path_security, give safe alias recovery guidance, and preserve existing legacy-plugin validation before alias-aware resolution can normalize cached files. Main passes the legacy missing-metadata cases; added preflight keeps that behavior. Windows prefix and legacy-preflight mutation controls fail with guards removed.

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

* fix(alias): preserve remote source anchors and cache replacement

Keep authenticated remote coordinates separate from flat aliases. Inject the existing read-only legacy cache admission at actual reuse after canonical fetch decisions, not preparation; retain same-ref failure and transactional replacement. Extend real resolver and CLI lifecycle contracts with aliased remote siblings and invalid-cache ref changes. Mutation controls detect both source-anchor regression and misplaced or missing admission.

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

* fix(alias): preserve placement and current ref replay after install

Continue the existing PR #2901 CI recovery without resetting its run. Preserve the recovered implementation and review folds: durable alias projection, contained alias scanning, specification conformance, and current-remote ref observations after successful checkout. Original contributor and follow-up commits remain in the lineage.

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

* test(cache): exercise stale bare fallback under corrupt receipts

The mutation gate showed the previous fixture passed even when receipt handling was removed because no bare-cache directory existed. Materialize the canonical shard directory so the stale-ref fallback is reachable and the regression fails without the receipt guard. Production code is unchanged.

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

* test(lockfile): declare absent alias in dev dependency fixtures

Continue CI recovery2 after Linux shard2 exposed four generic Mock dependency references whose undeclared alias attribute became another Mock. Model the real unaliased DependencyReference default explicitly instead of weakening production alias validation.

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

* fix(spec): preserve published alias schema identities

Keep existing public v0.1 schemas byte-identical and select independent v0.1.41 schemas for alias validation. Accept the new exact manifest ID through the existing contract owner while retaining old-ID compatibility and fail-closed unknowns.

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

* fix(alias): clarify compatibility and recovery after main integration

Fold specification editorial fixes, keep the unshipped security note under Unreleased, document schema opt-in compatibility, and defend actionable diagnostics with regression assertions.

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

---------

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

* fix(ci): repair advisory locks and platform regressions (#3021)

* fix(ci): repair advisory locks and platform regressions

Regenerate advisory workflow metadata without changing runtime pins. Preserve root-local discovery scope during scratch drift replay and make the Windows alias fixture assert the on-disk directory name. Add source-freshness and replay regression coverage.

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

* fix(ci): honor pinned workflow compiler and harden regression fixtures

Recompile PR review with gh-aw v0.87.8 and verify the generated banner against the repository pin. Set explicit package deployment defaults and assert resolver initialization, isolate symlink-only prerequisites, and prove workflow hashes normalize LF, CRLF, and CR input.

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

---------

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

* chore(deps): bump gitpython from 3.1.58 to 3.1.59 (#2921)

Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.58 to 3.1.59.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](gitpython-developers/GitPython@3.1.58...3.1.59)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-version: 3.1.59
  dependency-type: direct:production
...

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

* chore(deps): bump js-yaml from 4.3.1 to 4.3.2 in /docs (#2920)

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.2/CHANGELOG.md)
- [Commits](nodeca/js-yaml@4.3.1...4.3.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.3.2
  dependency-type: indirect
...

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

* chore(deps): bump devalue from 5.8.1 to 5.9.2 in /docs (#3019)

Bumps [devalue](https://github.com/sveltejs/devalue) from 5.8.1 to 5.9.2.
- [Release notes](https://github.com/sveltejs/devalue/releases)
- [Changelog](https://github.com/sveltejs/devalue/blob/main/CHANGELOG.md)
- [Commits](sveltejs/devalue@v5.8.1...v5.9.2)

---
updated-dependencies:
- dependency-name: devalue
  dependency-version: 5.9.2
  dependency-type: indirect
...

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

* fix(build): support setuptools 83 in binary packaging

Require PyInstaller 6.17.0 and lock its minimum compatible hooks to avoid altgraph importing the removed pkg_resources module. Preserve the setuptools 83.0.0 security upgrade.

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

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: sergio-sisternes-epam <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Nadav Yogev <[email protected]>
Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Gijs Reijn <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ron Izraeli <[email protected]>
Co-authored-by: Arnaud <[email protected]>
Co-authored-by: Marco Frömbgen <[email protected]>
Co-authored-by: Sergio Sisternes <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[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.

2 participants