[BUG] compile help and invalid-target error must advertise the accepted intellij target#2141
[BUG] compile help and invalid-target error must advertise the accepted intellij target#2141danielmeppiel wants to merge 3 commits into
Conversation
Derive compile and install target help from the accepted target catalog, and use the same catalog for unknown-target guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a DevX drift where apm compile --target intellij is accepted, but apm compile --help and the unknown-target error message did not advertise intellij. It centralizes target help text around a shared target catalog and adds regression tests + doc updates to keep the advertised/accepted sets aligned.
Changes:
- Introduces a shared, stable
TARGET_VALUES_HELPstring derived from the--targetvalidator’s accepted value set. - Uses the shared projection in
compileandinstall--targethelp text, and updates unknown-target rendering to include the accepted catalog. - Adds unit tests and documentation updates covering
intellijhelp visibility, invalid-target guidance, and a successful IntelliJ compilation scenario.
Show a summary per file
| File | Description |
|---|---|
| src/apm_cli/core/target_detection.py | Adds TARGET_VALUES_HELP and switches unknown-target guidance to use the accepted target catalog. |
| src/apm_cli/commands/compile/cli.py | Derives --target help from the shared projection and documents IntelliJ behavior in CLI help text. |
| src/apm_cli/commands/install.py | Uses the same shared target projection in install --help to prevent drift. |
| tests/unit/compilation/test_compile_target_flag.py | Adds regression tests for help text, invalid-target guidance, and --target intellij success. |
| docs/src/content/docs/reference/cli/compile.md | Updates CLI reference docs to reflect that help derives from the validation catalog and documents IntelliJ behavior. |
| docs/src/content/docs/producer/compile.md | Updates producer docs to include intellij as an accepted compile target and clarifies behavior. |
| packages/apm-guide/.apm/skills/apm-usage/commands.md | Updates the command reference to mention intellij acceptance and Copilot-profile behavior for file primitives. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Low
| if "is not a valid target" in err_msg: | ||
| target_name = value if isinstance(value, str) else ",".join(value or []) | ||
| rendered = render_unknown_target_error(target_name, sorted(CANONICAL_TARGETS)) | ||
| rendered = render_unknown_target_error(target_name, sorted(VALID_TARGET_VALUES)) |
| `agent-skills` is a no-op for `compile` (skills-only deployment target); | ||
| `antigravity` is explicit-only and is not included in `all`. Use `apm install` | ||
| or `apm deps update` when you want shared `.agents/skills/` output. | ||
| `antigravity` and `intellij` are explicit-only and are not included in `all`. | ||
| For `intellij`, file primitives use the Copilot profile and produce `AGENTS.md`; | ||
| IntelliJ-specific integration remains MCP-only. Use `apm install` or | ||
| `apm deps update` when you want shared `.agents/skills/` output. |
…ellij The kiro discoverability test hard-coded the brittle 'all' target join (copilot+...+kiro), which the accepted-target catalog now supersedes as the single source of the help Values list. Assert each advertised target -- including the MCP-only intellij target this PR adds -- is discoverable in both install and compile help instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Superseded by #2155. The reliability campaign consolidated all 13 point fixes into a single architectural cure PR that re-homes each fix under its canonical owner module and adds owner-invariant guards. The fix for #2138 is folded into #2155 and re-verified there (full CI green). Closing this point PR in favor of the consolidated cure; the branch is preserved and this can be reopened if #2155 is not merged. |
fix(compile): advertise the accepted IntelliJ target
TL;DR
apm compile --target intellijalready succeeds, but compile help and unknown-target guidance omitted it. This change derives compile and install help from the accepted target catalog and uses that catalog for invalid-target guidance.Fixes #2138
Problem (WHY)
apm compile --helpcontained zerointellijmentions.apm compile --target definitely-bogusexited 2 but omittedintellijfromValid targets.Approach (WHAT)
VALID_TARGET_VALUES.Implementation (HOW)
src/apm_cli/core/target_detection.pyTARGET_VALUES_HELPfromVALID_TARGET_VALUESand supplies the accepted set to unknown-target guidance.src/apm_cli/commands/compile/cli.py--targethelp from the shared projection and explains IntelliJ's Copilot file profile.src/apm_cli/commands/install.pytests/unit/compilation/test_compile_target_flag.pyAGENTS.md.apm-usage/commands.mdDiagram
The catalog is now the common input for validation, help, and invalid-target guidance.
flowchart LR C[VALID_TARGET_VALUES] --> V[TargetParamType validation] C --> H[TARGET_VALUES_HELP] H --> CH[compile help] H --> IH[install help] C --> E[unknown-target guidance]Trade-offs
agent-skillsfiltering policy in the generic error renderer; this change only corrects the catalog supplied byTargetParamType.Benefits
intellijthree times instead of zero.intellijwhile retaining exit code 2.apm compile --target intellijremains accepted and generatesAGENTS.md.Validation
Base regression proof
Before the implementation, the new tests produced:
Fixed regression tests
Targeted suites
Manual CLI scenarios
Lint
The CI-mirror ruff, formatting, YAML I/O, file-length, portable-path, pylint R0801, auth-boundary, and ASCII checks passed.
Scenario Evidence
tests/unit/compilation/test_compile_target_flag.py::TestCompileCommandCLI::test_help_advertises_intellij_target(regression-trap for #2138)tests/unit/compilation/test_compile_target_flag.py::TestCompileCommandCLI::test_invalid_target_error_advertises_intellij(regression-trap for #2138)AGENTS.mdtests/unit/compilation/test_compile_target_flag.py::TestCompileCommandCLI::test_target_flag_accepts_intellijHow to test
apm compile --help; confirmintellijappears.apm compile --target definitely-bogus; confirm exit 2 andintellijinValid targets.apm compile --target intellij; confirm exit 0 andAGENTS.mdexists.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com