Skip to content

[BUG] compile --help and unknown-target error omit the accepted intellij target (advertised != accepted) #2138

Description

@danielmeppiel

Describe the bug

The intellij target is accepted by apm compile (it runs, exits 0, and generates output) but is omitted from that command's own help text and from its unknown-target error listing. So the set of targets APM advertises for compile is narrower than the set it accepts. install --help lists intellij (4 mentions); compile --help and the compile unknown-target error list it 0 times.

To Reproduce

Baseline SHA: 26d8cee8a4079bb3d31956f1b57d343654835fc8.

  1. apm compile --help -> count occurrences of intellij -> 0.
  2. apm install --help -> count occurrences of intellij -> 4 (present).
  3. apm compile --target bogus (invalid) -> error lists valid targets, but the listing omits intellij.
  4. apm compile --target intellij in a project with a compilable primitive -> exit 0, generates output (e.g. AGENTS.md). So the target is real and accepted, just undocumented at this entry point.

Expected behavior

The advertised target set (help text + invalid-target error listing) must equal the accepted target set for every command that takes --target. If compile accepts intellij, its help and error listings must include it; conversely a target that is not accepted must not be advertised.

Environment

  • OS: macOS
  • APM Version: 0.24.1 (26d8cee8a)

Root-cause (architecture)

Architecture cluster r2-target-capability-catalog-drift (recommendation: canonical-owner refactor). Target identity is spread across sibling constants/paths (e.g. src/apm_cli/core/target_detection.py: VALID_TARGET_VALUES, KNOWN_TARGETS, RUNTIME_TO_CANONICAL_TARGET, plus per-command help strings). Each command surface reads a different subset, so help/error/acceptance drift apart. Recommended: a single target-capability catalog that every command's acceptance, help rendering, and invalid-target error derive from, so "accepted" and "advertised" cannot diverge. Vendor-neutral, native target names only, no translation layer.

Additional context

Authorized first-party reliability/regression validation (red-team Round 2). Independently reproduced twice (finder != confirmer) with control and cleanup verification. Same catalog surface previously touched by #1957/#2041 (intellij validation); this finding is the help/error advertisement gap, distinct from acceptance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliCLI command surface, flags, help text (cross-cutting).area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.priority/highShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).type/bugSomething does not work as documented.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions