Repository navigation
[0.38] plan/apply P5b: one deprecation catalog (#4019) - #4035
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 21, 2026
Merged
Conversation
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
from
November 20, 2026 00:56
5438701 to
232dabf
Compare
Closed
5 of 14 tasks
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
from
November 20, 2026 01:29
232dabf to
3b970a9
Compare
This was referenced Nov 20, 2026
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
from
November 20, 2026 07:46
3b970a9 to
b917fa3
Compare
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
load_marketplace_config now delivers every MarketplaceConfig.warnings entry (the list/string outputs deprecation and the outputs.<format>.path conflict) through its warn_callback, after the legacy marketplace.yml deprecation. apm pack, marketplace check and outdated already render that callback. Pack's release-gate reload passes a discard callback so no load warning prints twice. The marketplace-outputs-list catalog entry is now a printed warning with no scheduled removal, so the text drops the stale v0.15 date. Flips #4035's stays-unprinted pin into installed-CLI tests. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
from
November 21, 2026 08:06
b917fa3 to
37690e7
Compare
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
load_marketplace_config now delivers every MarketplaceConfig.warnings entry (the list/string outputs deprecation and the outputs.<format>.path conflict) through its warn_callback, after the legacy marketplace.yml deprecation. apm pack, marketplace check and outdated already render that callback. Pack's release-gate reload passes a discard callback so no load warning prints twice. The marketplace-outputs-list catalog entry is now a printed warning with no scheduled removal, so the text drops the stale v0.15 date. Flips #4035's stays-unprinted pin into installed-CLI tests. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
2 times, most recently
from
November 21, 2026 08:46
2deb875 to
1a0595e
Compare
…on (#4019) Captured before the text moves into the deprecation catalog: installed-CLI scenarios pin each CLI-visible warning's exact wording, stream and single print; in-process tests pin owner repetition/scope and the Python DeprecationWarning texts with filtering enabled explicitly. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
core/deprecations.py, under the diagnostics owner, holds each deprecation's warning template, replacement, deprecated-since version (or unknown) and removal horizon (an announced version, or not scheduled). Every emitted deprecation now reads its words through deprecation_message(); domain owners keep triggering, dynamic hints, scope and repetition, and output owners keep rendering. Text is byte-identical (pinned by the previous commit's tests). Warning-free deprecations are inventoried separately. Guard registry-delegation-deprecation-catalog rejects catalog template text spelled anywhere else in src/apm_cli; the existing target: phrase check now exempts the catalog instead of manifest_targets.py. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…4019) scripts/render_deprecations_table.py renders the table from the catalog; a unit test fails when the page drifts. Unscheduled horizons read 'not scheduled'; nothing is inferred. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
force-pushed
the
danielmeppiel-curly-fishstick
branch
from
November 21, 2026 09:18
1a0595e to
c668fbd
Compare
Daniel Meppiel (danielmeppiel)
marked this pull request as ready for review
November 21, 2026 09:45
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 09:45
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-curly-fishstick
branch
November 21, 2026 09:46
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The guard misses catalog constants referenced by f-strings, allowing the old CI banner text to pass, while whitespace-normalized tests fail to enforce exact warning preservation.
2 open issues
What changed in this PR
Implements #4019 by centralizing APM’s deprecation wording and metadata under the diagnostics owner, while keeping warning triggers and rendering with their existing owners.
Changes:
- Adds a catalog for 21 deprecations and an inventory of warning-free deprecated surfaces.
- Routes existing warnings through the catalog, with an architecture guard and preservation tests.
- Generates CLI reference tables from the catalog and records the addition in the changelog.
| File | Description |
|---|---|
tests/unit/test_deprecations_docs_table.py |
Checks generated documentation parity. |
tests/unit/scripts/test_registry_deprecation_catalog.py |
Tests duplicate-wording detection. |
tests/unit/scripts/test_architecture_runner.py |
Registers the expected guard rule. |
tests/unit/core/test_deprecations.py |
Checks catalog metadata and consumers. |
tests/unit/core/test_deprecation_owner_behavior.py |
Tests warning triggers and repetition. |
tests/integration/test_deprecation_warnings_installed_cli.py |
Captures warning text, streams and visibility. |
tests/integration/test_architecture_owner_rule_mutations.py |
Adds a duplicate-warning mutation case. |
src/apm_cli/security/executables.py |
Sources the approval-alias warning from the catalog. |
src/apm_cli/registry/client.py |
Sources the deprecated API warning from the catalog. |
src/apm_cli/policy/parser.py |
Sources the bin_deploy warning from the catalog. |
src/apm_cli/models/manifest_targets.py |
Catalogs manifest warnings, preserving dynamic hints. |
src/apm_cli/marketplace/yml_schema.py |
Catalogs the collected outputs-format warning. |
src/apm_cli/marketplace/migration.py |
Preserves the public warning constant through catalog lookup. |
src/apm_cli/install/phases/targets.py |
Reuses the cataloged agents warning. |
src/apm_cli/deps/registry_proxy.py |
Catalogs deprecated environment-variable warnings. |
src/apm_cli/core/target_detection.py |
Reuses the cataloged Python target warning. |
src/apm_cli/core/target_catalog.py |
Delegates target-alias wording to the catalog. |
src/apm_cli/core/deprecations.py |
Defines deprecation metadata and message rendering. |
src/apm_cli/core/apm_yml.py |
Catalogs the legacy all warning. |
src/apm_cli/commands/update.py |
Reuses cataloged compatibility warnings and shared wording. |
src/apm_cli/commands/pack.py |
Catalogs pack and unpack warnings. |
src/apm_cli/commands/deps/cli.py |
Catalogs the legacy update-command warning. |
src/apm_cli/commands/config.py |
Catalogs the deprecated configuration-key warning. |
src/apm_cli/commands/compile/cli.py |
Catalogs the --target all warning. |
src/apm_cli/adapters/client/copilot.py |
Catalogs the legacy MCP placeholder warning. |
scripts/render_deprecations_table.py |
Generates and checks reference tables. |
scripts/architecture_linter/checks/registry_owner_guards.py |
Registers the guard and updates catalog exemptions. |
scripts/architecture_linter/checks/registry_deprecation_catalog.py |
Detects copied warning fragments outside the catalog. |
docs/src/content/docs/reference/index.md |
Adds generated deprecation reference tables. |
CHANGELOG.md |
Records the new reference inventory. |
.apm/architecture/owners/core-runtime.json |
Assigns catalog ownership and its guard. |
Review effort: Balanced
Comment on lines
+60
to
+76
| fragments: dict[str, str] = {} | ||
| for node in nodes: | ||
| if not ( | ||
| isinstance(node, ast.Call) | ||
| and isinstance(node.func, ast.Name) | ||
| and node.func.id == _ENTRY_CALL | ||
| ): | ||
| continue | ||
| key = _keyword_text(node, "key") | ||
| if key is None: | ||
| continue | ||
| for template in _template_parts(node): | ||
| for literal, _field, _spec, _conversion in string.Formatter().parse(template): | ||
| # Spacing around a placeholder is not part of the words. | ||
| literal = literal.strip() | ||
| if len(literal) >= _MIN_FRAGMENT_LENGTH: | ||
| fragments[literal] = key |
Comment on lines
+252
to
+256
| expected = _collapse(scenario.text) | ||
| evidence = f"stdout={result.stdout!r}\nstderr={result.stderr!r}" | ||
|
|
||
| assert _collapse(streams[scenario.stream]).count(expected) == 1, evidence | ||
| assert expected not in _collapse(streams[other]), evidence |
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
load_marketplace_config now delivers every MarketplaceConfig.warnings entry (the list/string outputs deprecation and the outputs.<format>.path conflict) through its warn_callback, after the legacy marketplace.yml deprecation. apm pack, marketplace check and outdated already render that callback. Pack's release-gate reload passes a discard callback so no load warning prints twice. The marketplace-outputs-list catalog entry is now a printed warning with no scheduled removal, so the text drops the stale v0.15 date. Flips #4035's stays-unprinted pin into installed-CLI tests. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This was referenced Nov 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
TL;DR.
src/apm_cli/core/deprecations.pyis now the single catalog for every deprecation APM emits. It owns the warning template, the replacement, the deprecated-since version (orunknown) and the removal horizon (an announced version, ornot scheduled). All 23 emission sites read their wording throughdeprecation_message(key), and the text users see is unchanged byte for byte. A new architecture guard rejects catalog text spelled anywhere else, and the CLI reference gains a deprecations table generated from the catalog.Note
No new warnings, no removals, no stream moves, no changes to removal dates. Domain owners still decide when a warning fires, its dynamic hints, scope and repetition. Output owners still render it.
Problem (WHY)
--target agents, was spelled out in two of them (core/target_detection.pyandinstall/phases/targets.py).target:phrase had a guard. Copies of every other deprecation message could drift without anything failing.Approach (WHAT)
core/deprecations.py(DEPRECATIONS,deprecation_message)manifest_targets,target_catalog,apm_yml,executables,policy/parser, ...)CommandLogger,_rich_warning,click.echo,warnings.warn)WARNING_FREE_DEPRECATIONS; no warnings addedregistry-delegation-deprecation-catalogImplementation (HOW)
core/deprecations.py(new)Deprecationentries plus the warning-free inventory. Since-versions come from explicit CHANGELOG lines (the four 0.37[Unreleased]deprecations are0.37.0); everything else isunknown. Horizons are recorded only where the warning text already announces one (v0.15, v0.16, v1.0).deprecation_message("<key>", **fields). The init flags now emit oneclick.echoof a two-line message instead of two echoes; the bytes are identical.marketplace/migration.DEPRECATION_MESSAGEkeeps its public name.scripts/architecture_linter/checks/registry_deprecation_catalog.py(new)Deprecation(template=...), splits each template at its{field}placeholders, and flags anysrc/apm_clistring constant (f-string parts included) that contains a fragment of 16 characters or more. An emptied catalog fails closed.registry_owner_guards.pytarget:phrase check now exempts the catalog instead ofmanifest_targets.py..apm/architecture/owners/core-runtime.jsonuser-facing-output-diagnosticsgains the catalog selector and the new guard.scripts/render_deprecations_table.py+reference/index.mdTrade-offs
Fragment match instead of fuzzy match. The guard flags exact template fragments of 16+ characters. Near-copies with a changed word slip through. Fuzzy windows would also flag unrelated help text such as
unpack's "will be removed in a future release", so exact match keeps the guard from crying wolf.Help strings stay inline.
[Deprecated]Click help text is not warning text, and the scope covers warnings only.Since =
0.37.0forvscode,target:,compilation.targetandauto-integrate: they shipped in the published 0.37.0.Passed horizons stay as-is. The
marketplace.outputslist form announces v0.15, which has passed; the table shows it verbatim ([0.38] fix(marketplace): print collected marketplace config warnings (#4046) #4062 changes that entry).apm init --plugin/--marketplacewere removed in 0.37 (feat(init)!: remove apm init --plugin and --marketplace (Fixes #4073) #4074), so their entries are gone.Finding, left unchanged per scope: the
marketplace.outputslist-form warning is collected intoMarketplaceConfig.warnings, but no command prints it. The table labels it "Collected, not printed", and a test pins that it stays unprinted.Rebase onto the 0.37 hardening (decision log). Main added
core/remediation.py, the single owner of "run 'apm ...'" advice, guarded bycontracts-tooling-remediation-advice. Four warnings now embed a remediation sentence (marketplace.yml,deps update,unpack, theapm updateself-updater forward). Default taken: aDeprecationmay name aRemediation, andmessage()fills a{remedy}slot from it. The catalog keeps owning deprecation wording, remediation keeps owning advice, and the printed text is byte-identical to 0.37.0; the re-pinned capture tests pass on unmodified main. The CI banner inupdate.pyshares the sentence'apm update' refreshes APM dependencies.with the self-updater warning, so the catalog exports it asUPDATE_REFRESHES_DEPENDENCIESinstead of exempting it in the guard. The guard now reads f-string templates by their literal parts.Benefits
Issue and approved scope
Fixes #4019
Human scope-approval comment: #4019 (comment) (
eligibility.cjs:record-present, re-checked before this PR).This PR completes the issue's "Done when" list: installed-CLI text, stream and visibility tests; in-process repetition and scope tests; Python-warning tests with explicit filters; the generated table with
not scheduledhorizons; the static mutation test; and one CHANGELOG line.Type of change
Testing
Scenario evidence
bin_deployJSON, outputs list never printed)tests/integration/test_deprecation_warnings_installed_cli.py, committed before the text moved (8cfaa27)allonce per process,vscodeflag once per alias across flags,bin_deployonce per validation,marketplace.ymlon every load, outputs into sinktests/unit/core/test_deprecation_owner_behavior.pyDeprecationWarnings (ARTIFACTORY_* x3,get_server_info,AgentsTargetDeprecationWarning) withsimplefilter("always")tests/unit/core/test_deprecations.pyMutationCase(registry-delegation-deprecation-catalog)intests/integration/test_architecture_owner_rule_mutations.py;tests/unit/scripts/test_registry_deprecation_catalog.pytests/unit/test_deprecations_docs_table.pyCommands run locally
How to test
uv run python scripts/render_deprecations_table.pyexits 0. Then edit anytemplate=incore/deprecations.pyand the docs test fails.src/apm_climodule and runbash scripts/lint-architecture-boundaries.sh. It reportsregistry_delegation.deprecation_catalog.apm compile -t vscode --dry-runstill prints the same[!] --target: replace ...line on stderr.Docs re-home after #3996
## Deprecationssection + generated tabledocs/src/content/docs/reference/index.md(CLI reference "Overview")DOC_PAGEinscripts/render_deprecations_table.py(one constant).Changelog
### Addedin[Unreleased](closes #4019).Spec conformance (OpenAPM v0.1)
N/A: no normative behavior changes. Warning text, streams and triggers are unchanged.
Co-authored-by: Copilot [email protected]