Skip to content

Consolidate legacy aliases and finish the weaver_kernel naming migration #196

Description

@dgenio

Summary

Run one coordinated deprecation cycle that removes the lingering pre-rename artifacts:
the _DEFAULT_RATE_LIMITS/_SERVICE_RATE_MULTIPLIER aliases in policy.py, and the
base exception name AgentKernelError (introduce WeaverKernelError with the old
name as a deprecated alias).

Why this matters

The package was renamed to weaver_kernel (PyPI: weaver-kernel), but the exception
hierarchy still roots at AgentKernelError — the first symbol every integrator
writes in an except clause teaches the old name. Meanwhile policy.py keeps
private aliases that internal code still uses inconsistently (lines 147 and 423 use
the aliases; the canonical names exist alongside), a small but real drift hazard.
One deliberate cleanup release beats indefinite naming debt.

What to remove, why, replacement, migration, communication

  • Remove: _DEFAULT_RATE_LIMITS / _SERVICE_RATE_MULTIPLIER aliases (policy.py:35-36); internal uses switch to the canonical constants. Replacement: DEFAULT_RATE_LIMITS / SERVICE_RATE_MULTIPLIER.
  • Deprecate then remove: AgentKernelError as the primary name. Replacement: WeaverKernelError = class; AgentKernelError = WeaverKernelError alias kept for ≥2 minor releases with a deprecation note (subclass except clauses keep working through the alias).
  • Why it adds complexity: two names for every concept; onboarding confusion; grep noise; inconsistent internal usage.
  • Migration path: alias period, CHANGELOG Deprecated entries, a one-line sed recipe in release notes.
  • Compatibility risks: downstream except AgentKernelError continues working during the alias period; only direct identity checks (is AgentKernelError) would notice — rare.
  • Communication: CHANGELOG, release notes, docstrings on both names during the alias period.

Current evidence

  • errors.py:4: class AgentKernelError(Exception): roots the hierarchy in the renamed package.
  • policy.py:35-36 define the aliases; lines 147 and 423 still consume them while canonical names exist.
  • Repo discipline (Keep-a-Changelog, stable reason codes) supports a clean deprecation cycle.

External context

Not required for this issue.

Proposed implementation

  1. PR 1: introduce WeaverKernelError, re-root subclasses, alias the old name,
    update all internal references, docs, and examples; CHANGELOG Deprecated.
  2. PR 1 (same): delete the private policy aliases (private surface — no deprecation
    needed), switching the two internal call sites.
  3. Release N+2: drop the alias; CHANGELOG Removed.

AI-agent execution notes

  • Inspect first: errors.py (full hierarchy), policy.py:35-36,147,423, __init__.py exports, tests/test_public_api.py, all docs mentioning AgentKernelError.
  • The alias must preserve isinstance/except semantics — use simple name binding, not a subclass.
  • Grep docs and sibling-repo integration docs (docs/integrations/*.md) for the old name.

Acceptance criteria

  • except WeaverKernelError catches all kernel errors; AgentKernelError still works during the alias period with a documented deprecation.
  • No internal reference to the old name or the private aliases remains.
  • Public API tests cover both names during the alias period.

Test plan

Identity/equality tests for the alias; full suite for the rename; docs grep check.
Run make ci.

Documentation plan

CHANGELOG Deprecated/Changed; update docs/* and examples; migration snippet in
release notes.

Migration and compatibility notes

Alias period ≥2 minor releases; sed one-liner migration; flag cross-repo impact
(integration docs in contextweaver/ChainWeaver mention kernel errors).

Risks and tradeoffs

Any rename creates churn for early adopters — batching it with the alias period and
doing it pre-1.0 minimizes lifetime cost. Alternative (keep old name forever)
perpetuates brand confusion with the repo/package name.

Suggested labels

deprecation, breaking-change, architecture

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions