Skip to content

[DESIGN] Per-package primitive routing (targets:) as the single placement mechanism #1911

Closed

Description

North star

APM needs exactly one answer to "who controls which primitive goes to which harness, and in what shape." This issue records the converged three-layer model so future requests (and PRs) resolve against a single design instead of accreting per-type flags and new verbs.

This supersedes the per-primitive-type approach in #1898 and is the design that PR #1902 implements.

The three layers

Layer Question Mechanism Status
CONSENT May this package's executable run at all? executables: {allow, deny} keyed per-package x per-exec-type (hooks/mcp/bin/canvas), deny-wins, deny-by-default shipped (security/executables.py)
PLACEMENT Which harness(es) does this package go to? per-package targets: on a dependency entry, uniform across every primitive type in that package PR #1902
PORTING What shape per harness? each primitive written to the harness's native format (.claude/settings.json, .codex/hooks.json, .agents/skills/, ...) shipped
(intra-harness) Where inside a harness do instructions land? apm compile (root/nested AGENTS.md/CLAUDE.md, .claude/rules toggle) shipped

Design rulings (and why)

  1. No new lifecycle verb. apm install is idempotent regeneration; apm audit detects drift. We do not add apm sync, apm mcp export, or a --check flag (declines [FEATURE] Standalone apm mcp export --runtime <target> command #1868 / closes PR feat(mcp): add 'apm mcp export --runtime <target>' (closes #1868) #1905).
  2. No per-primitive-TYPE routing for inert primitives (declines [FEATURE] Primitives exclusion for targets #1898). Splitting one package's skills to one harness and its instructions to another is a fork of that package. The supported path is per-package routing: route an instruction-only package to one harness and a skill-only package to another. The bloat [FEATURE] Primitives exclusion for targets #1898 describes is a harness-standards gap (Claude does not read the .agents/skills/ convention that Copilot/Cursor/Codex/Gemini share), not an APM defect.
  3. Hooks are not special. "hooks off" = the CONSENT trust floor (apm deny <pkg> hooks). "hooks to one harness" = plain per-package targets:. No dedicated hooks: lever.
  4. We port, we do not glue. Porting a primitive into each harness's native format is faithful porting. Inventing a universal cross-harness format, or translating semantics between harnesses that disagree on a should-be-standard, is out of scope. (This is also why [BUG] hook_integrator merges all per-harness hook manifests into every target (codex/cursor hooks leak into .claude/settings.json) #1892 is a porting bug, not a translation layer.)

Folds into this design

Implementation

The build surface is substantially PR #1902. Re-reviewed via the apm-review-panel against this model, then driven to green. #1882 (require explicit targets) is tracked separately as opt-in governance.

Activity

  1. added
    area/multi-target
    type/feature
    status/needs-design
    on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/multi-targetstatus/needs-designtype/feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions