feat(packages): honor .apmignore on install, pack, and compile - #2677
Open
Sergio Sisternes (sergio-sisternes-epam) wants to merge 11 commits into
Open
feat(packages): honor .apmignore on install, pack, and compile#2677Sergio Sisternes (sergio-sisternes-epam) wants to merge 11 commits into
Sergio Sisternes (sergio-sisternes-epam) wants to merge 11 commits into
Conversation
Add a gitignore-compatible .apmignore so authors can keep maintainer-only files such as evals/ out of skill deploy, pack, and compile. One owner parses the file; SKILL.md and apm.yml cannot be ignored. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio Sisternes (sergio-sisternes-epam)
requested a review
from Daniel Meppiel (danielmeppiel)
as a code owner
August 24, 2026 12:58
Copilot started reviewing on behalf of
Sergio Sisternes (sergio-sisternes-epam)
August 24, 2026 12:58
View session
Add pathspec to NOTICE metadata and regenerate NOTICE. Copy the canonical-owner row into the .apm source so apm audit --ci matches the deployed .github copy. apm-spec-waiver: CLI-only .apmignore membership; not an OpenAPM v0.1 normative change Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
_integrate_skill_bundle passed package_root=package_path without binding the name, so SKILL_BUNDLE installs crashed. Bind package_info.install_path and update the copytree source guard to require build_copy_ignore. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio Sisternes (sergio-sisternes-epam)
enabled auto-merge
August 24, 2026 13:10
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a canonical .apmignore implementation (gitignore semantics, including nested files and !) and wires it into install deploy copy, pack collection, and compile/discovery so package authors can exclude maintainer-only content (for example evals/) without splitting membership logic across subsystems.
Changes:
- Introduce
ApmIgnoreSpecinsrc/apm_cli/utils/apmignore.pyas the single owner for ignore parsing and membership decisions, plus an architecture boundary guard (AC35). - Apply
.apmignorefiltering consistently across skill deploy copytree, bundle packing collectors, and primitive discovery walkers. - Add unit and integration coverage, and update docs and changelog to document the new behavior.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds pathspec to the locked dependency set. |
| pyproject.toml | Adds runtime dependency on pathspec>=0.12.0. |
| src/apm_cli/constants.py | Introduces APM_IGNORE_FILENAME constant. |
| src/apm_cli/utils/apmignore.py | New canonical .apmignore loader/matcher and copytree ignore helper. |
| src/apm_cli/primitives/discovery.py | Applies package ignore spec to discovery scans and cache invalidation. |
| src/apm_cli/integration/skill_support.py | Extends build_copy_ignore() to compose .apmignore with existing ignore callbacks. |
| src/apm_cli/integration/skill_integrator.py | Routes skill deployment copy operations through the new ignore owner. |
| src/apm_cli/bundle/plugin_exporter.py | Filters collected pack components using ApmIgnoreSpec. |
| scripts/lint-architecture-boundaries.sh | Adds AC35 enforcement so .apmignore parsing and pathspec imports stay single-owned. |
| tests/unit/utils/test_apmignore.py | Adds coverage for .apmignore semantics, copytree behavior, discovery pruning, and pack collectors. |
| tests/integration/test_architecture_authorities.py | Adds an integration assertion that the owner + guard + architecture table entry exist. |
| packages/apm-guide/.apm/skills/apm-usage/package-authoring.md | Documents .apmignore usage and constraints for authors. |
| docs/src/content/docs/producer/pack-a-bundle.md | Documents .apmignore effect on bundling. |
| docs/src/content/docs/producer/author-primitives/skills.md | Documents .apmignore for root SKILL.md packages. |
| docs/src/content/docs/concepts/package-anatomy.md | Documents .apmignore as an optional package file. |
| CHANGELOG.md | Adds an Unreleased entry describing .apmignore support. |
| .github/instructions/architecture.instructions.md | Adds canonical owner table row for .apmignore membership authority. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
An unreadable or non-regular .apmignore now raises ApmIgnoreError instead of being skipped, so install/pack/compile do not ship maintainer-only files by accident. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep both architecture owner rows, combine compile inventory walks with .apmignore filtering, and refresh the architecture instruction hash. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep architecture owner rows, thread package ignore through _build_deployable_copy_ignore, and refresh lockfile hashes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…r row Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…e bump Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… row Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apm-spec-waiver: CLI-only .apmignore membership; not an OpenAPM v0.1 normative change
TL;DR
Authors can now put a
.apmignorenext to a package (gitignore semantics, including nested files and!) so maintainer-only trees such asevals/stay out of skill deploy, pack, and compile. One owner (src/apm_cli/utils/apmignore.py) answers membership;SKILL.mdandapm.ymlcannot be ignored. The git checkout inapm_modules/stays a faithful clone.No built-in
evals/default. Authors write the file. Live/tmpe2e on Copilot and Claude confirmed deploy/pack/compile omit ignored paths.Problem (WHY)
SKILL.mdpackage is installed by copying the whole tree into<target>/skills/<name>/, soevals/and other maintainer files ship to consumers.compilation.excludeonly skips compile discovery;includes:is a pack allow-list;ignore_non_contentonly drops symlinks and.apm-pin. None of those is a package-local deny list.Approach (WHAT)
ApmIgnoreSpecowner onpathspec(GitIgnoreSpec): nested files, last-match-wins, directory-only/, and!.copytreegoes throughbuild_copy_ignore(package_root=...).SKILL.mdorapm.ymlwould be ignored.apm_modules/checkout so the ignore file stays present.Implementation (HOW)
src/apm_cli/utils/apmignore.py: sole parser/matcher. Loads root + nested.apmignore, applies git parent-dir rules, exposesis_ignoredandcopytree_ignore.src/apm_cli/integration/skill_support.pyandskill_integrator.py: deploy copytree composesignore_non_contentwith the spec.src/apm_cli/bundle/plugin_exporter.py:_collect_flat/_collect_recursive/ bare-skill / explicit includes skip ignored files.src/apm_cli/primitives/discovery.py: compile/discovery prunes ignored dirs and files.pathspec.package-authoring.md, and CHANGELOG updated in place. README unchanged.Trade-offs
pathspecso!and nested files match git; rejected a second home-grown matcher next toutils/exclude.py.evals/default. Authors opt in..apmignoreand break updates.evals/then!evals/README.mddoes not re-include the file (un-ignore the directory first withevals/*)..apmignoreis a working-draft CLI filter, waived from Mode B spec citation.Validation
CI-mirror lint is green (
ruff check,ruff format --check, pylint R0801, auth-signal lint). Targeted pytest: 345 passed. Live/tmpe2e on--target copilot,claude:SKILL.mddeploy to.agentsand.claudekeptSKILL.md+references/keep.mdonly..apm/skills/{alpha,beta,gamma}deploy omitted everyevals/.evals/..apmignorekeptKEEP-COMPILE-THREEonly; removing the file compiledMUST-NOT-COMPILE-THREE.pathspecand resyncs the architecture-instruction lockfile hash soapm audit --ciis clean.How to test
SKILL.mdpackage, add.apmignorewithevals/and a dummyevals/secret.md. Runapm install ./that-pkg --target copilot,claude. Expect.agents/skills/<name>/and.claude/skills/<name>/to lackevals/..apm/skills/{a,b,c}/evals/, runapm pack. Expect the bundle skill dirs to containSKILL.mdand references only.apm compile --target copilot,claudewith an ignoredevals/*.instructions.md. ExpectAGENTS.md/CLAUDE.mdnot to include that body. Remove.apmignoreand recompile: the body appears.SKILL.mdin.apmignoreand run install or pack. Expect a hard error naming the required file.apm_modules/_local/<pkg>/evals/still exists after install (cache is unfiltered).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com