Repository navigation
feat(init): onboard existing local packages without rewriting source - #2937
Conversation
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]>
Docs sync advisoryVerdict: 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."
}AdvisoryNo additional documentation edits are necessary for PR #2937 at final head The cumulative onboarding documentation remains resolved by the pages already
Delta evidence (
Exact necessary edits: none. The classifier cost gate stops the rerun here. No localizer, writer, verifier, |
There was a problem hiding this comment.
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
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
src/apm_cli/integration/skill_integrator.py — With force=True, check_collision returns False for any existing path, including a regular… |
|
src/apm_cli/adopt/discovery.py — Global discovery is using raw profiles from active_targets_* and then always builds scan paths… |
|
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_RELATIVEdeployment 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 passingTrue.
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_RELATIVErow is then guessed as Copilot and can reachresolve_locator()with the wrong root (or raise an uncaughtRuntimeError), 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
OSErrororNotImplementedErrorbefore 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 callpytest.skip; wrap this parameterized setup in the same guard.
tests/unit/adopt/test_onboarding.py:263 - This symlink setup can raise
OSErrororNotImplementedErroron 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.
| if self.check_collision( | ||
| target_skill_dir, | ||
| rel_path, | ||
| {rel_path} if session_owned else collision_managed, | ||
| force, | ||
| diagnostics=diagnostics, | ||
| ): |
| profiles = ( | ||
| active_targets_user_scope("all", create_config=False) | ||
| if user_scope | ||
| else active_targets(root, "all", create_config=False) | ||
| ) |
|
|
||
| ### 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]>
APM Review Panel:
|
| 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
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)"]
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]>
Shepherd advisory: ready for maintainer reviewFinal head: Folded in this run
Deferred (out-of-scope follow-ups)
Copilot signals reviewedTwo 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 evidenceDeterministic detection and semantic verification passed at base
Lint contractFull 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. CIFinal-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
Reservations carried from strategic-alignmentThis 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. ConvergenceTwo 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. |
…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]>



add(init): onboard existing local packages without rewriting source
TL;DR
This adds
apm init --discoveras a read-only inventory for existing local skills and packages, with an explicitly consented--applythat changes only consumer manifest metadata. A later, separateapm 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)
apm.yml.BaseIntegratorcollision check, so a discovered declaration could reach a pre-existing target directory without the ordinary protection.The resulting contract is intentionally staged: discover read-only, declare metadata with consent, then install through the existing pipeline.
Approach (WHAT)
validate_apm_package(..., read_only=True)apm.ymlafter consentapm install --target ...--targetis invalid during discoveryBaseIntegrator.check_collisionImplementation (HOW)
src/apm_cli/adopt/__init__.py,discovery.py,safety.pysrc/apm_cli/adopt/manifest_edit.py,materialize.pydependencies.apmlocal paths after consent. Conflicting existing declarations block the entire write.src/apm_cli/commands/discover.py,commands/init.py,cli.py,core/output_mode.pyinit --discover,--apply/--write, text/JSON/YAML output, project/global scope, consent rules, and update-check suppression on read-only discovery.src/apm_cli/models/validation.py,agent_plugins/projection.py,utils/yaml_io.pycreate_config=Falsethrough canonical validation/projection and exposes comment-preserving YAML serialization for atomic writes.src/apm_cli/integration/skill_integrator.py.apm/architecture/owners/contracts-tooling.json,scripts/architecture_linter/checks/onboarding.py,groups/mutation_writes.pyscripts/architecture_linter/checks/install_base_integrator_and_contraction.py,install_frozen_and_audit.py,marketplace_package_and_registration.pyCHANGELOG.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.mdtests/integration/test_brownfield_lifecycle.py,test_architecture_onboarding.py,test_architecture_native_skill_collision.pytests/unit/adopt/test_onboarding.py,test_native_skill_collision.py,tests/unit/integration/test_skill_integrator.pytests/spec_conformance/test_resolution_reqs.py,CONFORMANCE.json,CONFORMANCE.mdreq-pr-002local-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 noteTrade-offs
--targetonly onapm install; rejected target-aware discovery so preview and declaration remain harness-neutral.BaseIntegratorauthorities; rejected onboarding-specific deployment ownership. Apply uses the ordinary operational lifecycle lock, not import-specific state.Benefits
.claude/skills/review/SKILL.mdcan preview and declare exactly one local path dependency without changing the source tree.apm install --target copilotdeploys the ordinary skill to.agents/skills/review/, including CRLF text and binary resources byte-for-byte..agents/skills/review/collision produces no target writes; ordinary install reports the skill skipped unless force is explicitly selected.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:
The final selection includes all three real CLI lifecycle cases. Earlier isolated lifecycle run:
This includes the collision lifecycle: apply exits
1with no writes; install exits0, skips the unowned target, and records no owned target path.Quality and lint evidence
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.pyis 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
tests/unit/adopt/test_onboarding.py::test_discovery_is_read_only_and_apply_changes_only_consumertests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machinetests/unit/adopt/test_onboarding.py::test_equivalent_references_keep_comments_options_and_bytestests/unit/adopt/test_onboarding.py::test_new_dependency_preserves_existing_settingstests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machinetests/integration/test_brownfield_lifecycle.py::test_discover_declare_install_rerun_state_machinetests/integration/test_brownfield_lifecycle.py::test_onboarding_does_not_grant_install_collision_ownershiptests/unit/adopt/test_native_skill_collision.py::test_native_skill_preserves_unowned_directory(regression-trap related to #1122)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_writeHow to test
.claude/skills/review/SKILL.mdplus a binary resource, runapm init --discover --format json, and verify the report proposes./.claude/skills/reviewwith no filesystem changes.apm init --discover --apply --yes; verify onlyapm.ymlgains the local dependency and the source remains byte-identical. The standard operational lifecycle lock may be initialized.apm install --target copilot --no-policy; verify.agents/skills/review/matches the source, including CRLF and binary bytes.apm.yml,apm.lock.yaml, source content, and deployment ledger are unchanged..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]