Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
005f369
fix(policy): judge compilation-target on the canonical target set
danielmeppiel Nov 17, 2026
fe385f4
docs(changelog): compilation-target policy fix (#3774)
danielmeppiel Nov 17, 2026
f4bdfdc
test(arch): register policy-target-projection rule and pin local bundle
danielmeppiel Nov 17, 2026
0a9af04
docs(governance): state that target enforce takes precedence over allow
danielmeppiel Nov 17, 2026
18fbe82
Merge main into danielmeppiel-0361-t2-targets-policy
danielmeppiel Nov 17, 2026
6499c3e
refactor(targets): route every manifest target reader through one owner
danielmeppiel Nov 17, 2026
e4ec5c8
Merge commit 'refs/t2/pr1' into danielmeppiel-0361-t2-target-declaration
danielmeppiel Nov 17, 2026
456a637
docs(changelog): manifest target declaration owner (#3791)
danielmeppiel Nov 17, 2026
5f1190b
fix(architecture): scope target exemptions to the marked statement
danielmeppiel Nov 17, 2026
19488ec
fix(targets): route compile -g and disk readers through the declarati…
danielmeppiel Nov 17, 2026
80f6976
fix(targets): close delta-panel gaps in exemption scope and strict reads
danielmeppiel Nov 17, 2026
b5f0cf8
Merge origin/main (0dddb80e39) into danielmeppiel-0361-t2-targets-policy
danielmeppiel Nov 17, 2026
0d20c6c
chore(changelog): place #3774 entry away from the section head
danielmeppiel Nov 17, 2026
320975d
Merge main into danielmeppiel-0361-t2-target-declaration
danielmeppiel Nov 17, 2026
d4597f3
Merge #3774 head (0d20c6c5f6) into danielmeppiel-0361-t2-target-decla…
danielmeppiel Nov 17, 2026
60c8939
Merge main (d511536792) into danielmeppiel-0361-t2-target-declaration
danielmeppiel Nov 17, 2026
4a4a311
Merge main (7efd08038a, includes #3774 as 59925cdb67) into danielmepp…
danielmeppiel Nov 17, 2026
0f3579a
Merge main (c775a7f0e0) into danielmeppiel-0361-t2-target-declaration
danielmeppiel Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .apm/architecture/owners/core-runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"selectors": ["src/apm_cli/core/target_catalog.py"],
"guards": ["registry-delegation-target-vocabulary"]
},
{
"id": "manifest-target-declaration",
"decision": "Package manifest target declaration: target:/targets: spelling, token validation, legacy all, and the views readers consume",
"owner": "models/manifest_targets.py (ManifestTargetDeclaration, read_manifest_target_declaration) via models/apm_package.py (APMPackage.target_declaration, package_target_declaration)",
"selectors": ["src/apm_cli/models/manifest_targets.py"],
"guards": ["registry-delegation-manifest-target-declaration"]
},
{
"id": "effective-install-target-selection",
"decision": "Effective target selection and its compilation-target policy projection",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Release tags that are promoted without re-running integration now publish to PyPI and deploy docs again; `repository_dispatch` `publish-existing-tag` re-publishes a released tag that never reached PyPI. (#3794, #3796)
- `apm audit --ci` run from `~/.apm` no longer fails with "installed package materialization is missing" after `apm update -g` when the user manifest declares no APM packages (only MCP/LSP servers or your own `~/.apm` content); it still fails closed when the user lockfile records packages or local bundle staging and `~/.apm/apm_modules` is gone. (#3797)
- After `apm install --legacy-skill-paths`, `apm audit --ci` no longer reports the per-client skills (`.github/skills/`, `~/.copilot/skills/`) as drift, and `apm uninstall` keeps surviving skills in that layout instead of copying them into `.agents/skills/` and removes an uninstalled package's legacy-layout skills; both reuse the layout recorded in `apm.lock.yaml`. (#3793)
- `apm install` rejects `target: intellij` or `target: copilot-app` in `apm.yml` before writing any file (it used to deploy files and a lockfile, then fail); `target: all` no longer prints a contradictory "treating the field as omitted" warning in `apm install` or `apm compile -g` while deploying everywhere; re-running `apm init` keeps the targets `target: all` deploys to; and the docs now say the ignored `compilation.target` field has no effect, so use `targets:`. (#3791)
- `apm install -g` no longer reports APM's own converted agents as "files skipped" on a second run: Codex `.toml` agents, Kiro agents and agents whose relative links APM rewrote are now compared with the text APM would write and adopted, even when no lockfile records them. -- by @MohammedAlkindi (closes #3722, #3743)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/enterprise/policy-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ When `enforcement=block`, any of the following exit `1` and abort before integra
| `allowlist` | Dep not in non-empty `dependencies.allow` | `Policy violation: <dep> -- not in dependencies.allow` | Add the dep to the org allowlist or switch to an approved package. |
| `required` | Missing `dependencies.require` entry, or pin mismatch | `Policy violation: <required-dep> -- required by org policy but not declared in apm.yml` (or `... required >=X but apm.yml pins <Y>`) | Add the required dep to `apm.yml` (and pin the required version). Pin mismatches downgrade to warn under `require_resolution: project-wins`; missing required deps still block. |
| `transport` | MCP transport not in `mcp.transport.allow` | `Policy violation: <mcp-server> -- transport <t> not in mcp.transport.allow=[<list>]` | Switch the server to an allowed transport, or request `mcp.transport.allow` updates. |
| `target` | Resolved target not in `compilation.target.allow` (or violates `target.enforce`) | `Policy violation: target <t> -- not in compilation.target.allow=[<list>]` | Re-run with `--target <allowed>`, or update `compilation.target` in `apm.yml`. Evaluated post-`targets` phase, so CLI overrides are honoured. |
| `target` | Resolved target not in `compilation.target.allow` (or violates `target.enforce`) | `Policy violation: target <t> -- not in compilation.target.allow=[<list>]` | Re-run with `--target <allowed>`, or update `targets:` in `apm.yml`. Evaluated post-`targets` phase, so CLI overrides are honoured. |
| `pinned-constraint` | `require_pinned_constraint: true` and a dep declares an unbounded ref | `Policy violation: N dependency(ies) use unbounded constraints (hint: pin to a semver range, literal tag, or SHA)` plus per-dep `<dep>: <reason>` | Pin each listed dep to a semver range with an upper bound (`^1.2.3`, `>=1.0,<2.0`), a literal tag (`v1.5.3`), or a 40-char SHA. Roll out under `enforcement: warn` first to size the fleet impact. |
| `transitive_mcp` | MCP server pulled in by a transitive dep, blocked by `mcp.deny`/`transport`/`self_defined` | `Transitive MCP server(s) blocked by org policy. APM packages remain installed; MCP configs were NOT written.` plus per-server `Policy violation: ...` | Remove the offending dep, request an org policy update, or pass `--trust-transitive-mcp` only as a reviewed break-glass CLI choice. |

Expand Down
9 changes: 6 additions & 3 deletions docs/src/content/docs/reference/manifest-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Controls which output targets are generated during compilation, installation, an

**Deprecated: `all`.** Manifests published before the canonical target catalog could declare `all`, meaning "no restriction". The value is deprecated: parsers treat a field containing `all` as if the field were omitted (auto-detect / `--target` decide; any sibling targets listed alongside `all` are ignored, though they are still validated) and emit a deprecation warning once per run. Remove the field to keep this behavior permanently; `all` will become a hard parse error in a future release.

The exception is `target: all` on its own: `apm install` and `apm compile` select every supported target, and `compilation.target` policy judges that full set.

For project-scope commands, when both fields are omitted, APM auto-detects from the
[documented filesystem signals](../cli/targets/#detection-signals).
Once set, the field is authoritative.
Expand All @@ -194,6 +196,9 @@ A scalar remains accepted as a one-item compatibility input. Declaring both
fields is a parse error. Prefer `targets:` in new manifests; `target:` remains
supported for backward compatibility. The `vscode` alias is accepted in either
form and normalized to `copilot`; `agents` remains a CLI-only alias.
MCP-only and experimental `--target` values such as `intellij` and
`copilot-app` are not manifest targets: `apm install` rejects them in
`apm.yml` before writing any file.

| Value | Effect |
|---|---|
Expand Down Expand Up @@ -947,7 +952,7 @@ The `compilation` key is OPTIONAL. It controls [`apm compile`](../cli/compile/)

| Field | Type | Default | Constraint | Description |
|---|---|---|---|---|
| `target` | `enum<string>` | `all` | Same values as Section 3.6 | Output target. Defaults to `all` when set explicitly in compilation config. |
| `target` | `enum<string>` | unset | Same values as Section 3.6 | Ignored by `apm compile`, which uses `--target`, then the top-level `targets:` (Section 3.6), then auto-detection. Declare outputs with `targets:` instead. |
| `strategy` | `enum<string>` | `distributed` | `distributed`, `single-file` | `distributed` generates per-directory target files (e.g. `AGENTS.md`, `CLAUDE.md`). `single-file` generates one monolithic file at `output`. |
| `single_file` | `bool` | `false` | | Legacy alias. When `true`, overrides `strategy` to `single-file`. |
| `output` | `string` | `AGENTS.md` | File path | Custom output path for the compiled file. |
Expand All @@ -966,7 +971,6 @@ The `compilation` key is OPTIONAL. It controls [`apm compile`](../cli/compile/)

```yaml
compilation:
target: all
strategy: distributed
source_attribution: true
exclude:
Expand Down Expand Up @@ -1220,7 +1224,6 @@ devDependencies:
- owner/test-helpers

compilation:
target: all
strategy: distributed
exclude:
- "apm_modules/**"
Expand Down
2 changes: 1 addition & 1 deletion packages/apm-guide/.apm/skills/apm-usage/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ Violation classes:
| `required` | Missing `dependencies.require` entry, or version-pin mismatch | Add the dep (and pin) to `apm.yml`. Pin mismatches downgrade to warn under `require_resolution: project-wins`; missing required deps still block |
| `pinned-constraint` | `dependencies.require_pinned_constraint: true` + a direct dep with no ref, a wildcard, a bare branch, or a bare `>=X.Y` | Pin the dep to an exact version (`1.2.3` or npm/cargo-style `=1.2.3`; pip-style `==1.2.3` is not supported), caret/tilde/bounded semver range, literal tag (`vX.Y.Z`, or `{name}-vX.Y.Z` / `{name}--vX.Y.Z` for the dep's own package name), or a full SHA. The constraint is judged as declared in `apm.yml` (a `replace:` rule by the ref it selects), not the tag a range resolved to. Roll out enforcement with `warn` before `block`. |
| `transport` | MCP transport not in `mcp.transport.allow` | Switch transport, or request `mcp.transport.allow` update |
| `target` | Resolved target not in `compilation.target.allow` (or violates `target.enforce`) | Re-run with `--target <allowed>`, or adjust `compilation.target` in `apm.yml` |
| `target` | Resolved target not in `compilation.target.allow` (or violates `target.enforce`) | Re-run with `--target <allowed>`, or adjust `targets:` in `apm.yml` |
| `transitive_mcp` | MCP server pulled in by a transitive dep, blocked by `mcp.deny` / `transport` / `self_defined` | Remove offending dep, request policy update, or set `mcp.trust_transitive: true` |

Full message text per outcome and per class lives in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _check_mcp_target_selection(provider: FactsProvider) -> Iterable[Violation]:
return ()

findings: list[Violation] = []
if not _span_has_fixed(install_facts, adapter_span, "parse_targets_field(apm_config)"):
if not _span_has_fixed(install_facts, adapter_span, "manifest_target_restriction(apm_config)"):
findings.append(
violation(
rule_id, _MCP_INSTALL, "manifest adapter must parse targets from the manifest"
Expand All @@ -215,12 +215,16 @@ def _check_mcp_target_selection(provider: FactsProvider) -> Iterable[Violation]:
"resolver must consult the manifest adapter before runtime discovery",
)
)
if _span_has_fixed(install_facts, resolver_span, "parse_targets_field("):
if _span_has_fixed(install_facts, resolver_span, "parse_targets_field(") or _span_has_fixed(
install_facts, resolver_span, "manifest_target_restriction("
):
findings.append(
violation(rule_id, _MCP_INSTALL, "resolver must not parse manifest targets itself")
)
validation_line = _first_span_line(
integration_facts, integration_span, "parse_targets_field(mcp_apm_config)"
integration_facts,
integration_span,
"package_target_declaration(apm_package).validate_for_install()",
)
install_line = _first_span_line(integration_facts, integration_span, "MCPIntegrator.install(")
if validation_line is None or install_line is None or validation_line >= install_line:
Expand Down
Loading
Loading