Skip to content

[FEATURE] Carry the source licence with packages installed from a repository subdirectory #3556

Closed

Description

Is your feature request related to a problem? Please describe.

When a dependency is a subdirectory of a repository (path:), APM fetches and deploys only that subdirectory. The repository's LICENSE (or NOTICE) at its root is never fetched, deployed or recorded. Projects commit the deployed files, as the docs recommend for reproducibility and for CI and cloud agents. So every committed copy of a permissively licensed skill loses the licence notice. MIT, BSD and Apache-2.0 all require that notice to be kept with copies.

Reproduction with APM 0.35.0:

targets: [copilot]
dependencies:
  apm:
    - git: https://github.com/mattpocock/skills.git
      path: skills/productivity/grilling
      ref: 4ae2317ddb22b046e26455e4f9c9b3aaaf62212d

After apm install:

  • .agents/skills/grilling/ holds SKILL.md and agents/openai.yaml only;
  • apm_modules/mattpocock/skills/skills/productivity/grilling/ has no LICENSE;
  • apm.lock.yaml has no licence information;
  • yet the repository has an MIT LICENSE at its root at that commit.

The same applies to whole-repository packages whose LICENSE sits outside the deployed primitive folders.

Describe the solution you'd like

The licence travels with what APM installs, so a project that commits deployed files stays compliant without extra steps. For example:

  1. Record it: resolve the nearest LICENSE/COPYING/NOTICE file from the package path up to the repository root at the resolved commit, and record its SPDX identifier (where it can be detected) and path in apm.lock.yaml. This would also feed the SBOM export in Deepen install-time integrity: signature verification, SBOM, provenance #1777, which currently says licence data isn't present.
  2. Carry it: deploy that file alongside each skill (for example .agents/skills/grilling/LICENSE), or write one aggregated third-party notices file per project, kept up to date by install and uninstall and checked by apm audit.
  3. Optional policy: let apm-policy.yml allow or deny licences, or require a detectable licence.

You'd know it works when installing the example above leaves an MIT notice next to the deployed skill, or in a notices file, and in the lockfile.

Describe alternatives you've considered

  • Copying the licence by hand after each install: it's easy to forget, and apm audit doesn't know about it.
  • Depending on the whole repository instead of a subdirectory: the licence still isn't a deployed primitive, and it installs more than wanted.
  • Keeping a hand-written third-party notices file in the consuming project: it works, but every consumer has to discover and maintain it.

Additional context

Related: #1777, which covers SBOM and provenance export, and notes that licence data isn't recorded.

Activity

  1. danielmeppiel commented on Nov 12, 2026

    @danielmeppiel
    Collaborator

    Decision: approve
    Area: project
    Scope: For packages materialized from a repository subdirectory (and whole-repo packages whose primitives sit below the root), copy the nearest LICENSE, LICENSE.*, COPYING or NOTICE file found from the package path up to the repository root at the locked commit, verbatim and uninterpreted, into the materialized package and next to each deployed skill directory; record its source path and hash in apm.lock.yaml; keep install, uninstall and audit consistent.
    Done when: Installing the subdirectory reproduction from this issue leaves the repository's MIT LICENSE, byte-identical, in the materialized package and alongside the deployed grilling skill; apm.lock.yaml records the license file source path and hash; uninstall removes the carried copies; apm audit reports a missing or modified carried copy; packages with no such file in that path range behave as today; tests cover subdirectory and whole-repo cases; docs and the packages/apm-guide apm-usage guide describe the behavior.
    Out of scope: SPDX detection or inferring a license from file text (APM keeps the declared-license model of #1777); license allow or deny policy; an aggregated notices file; changes to lock export formats.
    Review contact: Daniel Meppiel (@danielmeppiel)

  2. danielmeppiel commented on Nov 12, 2026

    @danielmeppiel
    Collaborator

    The scope record above was approved by Daniel Meppiel (@danielmeppiel) on 2026-11-12. Thank you Alex Broad (@alex-broad) for the precise reproduction. The approved part is narrow: carry the nearest license or notice file verbatim and record it in the lockfile. Detecting or inferring licenses from file text, and license policy, remain declined: APM keeps the declared-license model from #1777 (it trusts the declared license field and never concludes a license from file text). Contributors may comment here to claim the work.


    Generated by issue-reduction-lane-h. This comment is AI-generated and may contain errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions