Ce deprecation

From Moffran/calibrated_explanations · View interactive version

Ce deprecation is an AI agent skill from the GitHub repository Moffran/calibrated_explanations. Implement ADR-011 deprecation and removal workflows with correct warnings, migration notes, and release timeline handling.

How to use this skill

Skill file

CE Deprecation & Mitigation

You are deprecating a public symbol, parameter, module path, or serialized output,

or removing a previously deprecated symbol. Follow ADR-011 strictly.

The mitigation guide (docs/migration/deprecations.md) is the single source of

truth for all deprecated and removed features.

Load references/deprecation_patterns.md for full code patterns and test templates.


⚠ Mandatory: Update the Status Table

Every deprecation introduced or removed MUST update docs/migration/deprecations.md:


The Mitigation Guide (`docs/migration/deprecations.md`)

  1. Check if existing: Every symbol marked with .. deprecated:: MUST be listed in the Active Deprecations table.
  2. Add if missing: If you find a deprecation in code that isn't in the guide, add it immediately.
  3. Removal Status: Check the "Removal ETA" column to determine if a symbol is eligible for removal.

Removing Deprecated Symbols

Before removing a symbol, verify it meets the ADR-011 "Two Minor Release" rule:

Steps for removal:

  1. Delete the implementation, deprecated parameters, or module shims.
  2. Update docs/migration/deprecations.md: move the row from Active Deprecations to Removed Deprecations (History) and fill in the actual removal version.
  3. Confirm no remaining call sites exist in src/ via grep -r "<symbol>" src/.
  4. Remove associated deprecation tests.
  5. If the deprecation/removal changes what is committed for the release

currently being coordinated, add/update a row in the active

development/current-work/vX.Y.Z_plan.md.


Historical Research (Missing Versions)

If a symbol's docstring contains .. deprecated:: but lacks a version:

  1. Search commit history: git log -S ".. deprecated::" or git blame <file>.
  2. Find the earliest version/tag containing that change.
  3. Update code + guide with the found version.

Timeline (ADR-011)

v0.X.0  — introduce new API; add deprecation warning for old API
v0.X+1  — still warning (minimum: 2 minor releases before removal)
v0.X+2  — remove old API (earliest)

Docstring annotation

Always add a .. deprecated:: directive to the Numpy docstring:

.. deprecated:: <version>
    <one-line reason and migration pointer>.

Migration guide entry

Add an entry to docs/migration/deprecations.md:

| Deprecated symbol | Replacement | Introduced | Removal ETA | Notes |
|---|---|---:|---:|---|
| `old_param` | `top_features` | v0.9.0 | v0.11.0 | Uses `deprecate()` in `explain_factual`. |

Also add/update a row in the active development/current-work/vX.Y.Z_plan.md

if the deprecation changes what is committed for the release currently being

coordinated.


CI strict mode

Users can opt into treating deprecation warnings as errors:

CE_DEPRECATIONS=error pytest

Out of Scope

Evaluation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.