Skip to content

♻️ refactor(exceptions): zero-based review of exception hierarchy before 1.0.0#421

Merged
sodre merged 3 commits into
mainfrom
task/336-exceptions-review
Mar 28, 2026
Merged

♻️ refactor(exceptions): zero-based review of exception hierarchy before 1.0.0#421
sodre merged 3 commits into
mainfrom
task/336-exceptions-review

Conversation

@sodre

@sodre sodre commented Mar 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove backward-compat table_name aliases from RateLimiterUnavailable and InfrastructureNotFoundError
  • Rename StackCreationError to StackOperationError (covers create, update, delete, and deploy)
  • Add StackAlreadyExistsError as direct InfrastructureError subclass
  • Add LeaseExpiredError(RateLimitError) replacing RuntimeError in leases
  • Add NamespaceStateError(InfrastructureError) for namespace state conflicts
  • Convert namespace ValueError raises to ValidationError/NamespaceStateError
  • Add scoped .claude/rules/exceptions.md for ongoing enforcement
  • Add comprehensive hierarchy tests (62 exception tests, 2613 unit total)

Test plan

  • All 2613 unit tests pass
  • 100% diff coverage on changed lines
  • Sync code regenerated and verified
  • CI passes (lint, mypy, unit tests)

Closes #336

🤖 Generated with Claude Code

sodre and others added 2 commits March 28, 2026 13:01
…ore 1.0.0 (#336)

- Remove table_name backward-compat aliases from RateLimiterUnavailable
  and InfrastructureNotFoundError
- Rename StackCreationError → StackOperationError (no alias)
- Reparent StackAlreadyExistsError as direct InfrastructureError subclass
- Add LeaseExpiredError(RateLimitError) replacing RuntimeError in leases
- Add NamespaceStateError(InfrastructureError) for namespace state conflicts
- Convert namespace ValueError raises to ValidationError/NamespaceStateError
- Update __init__.py exports, CLI catch sites, docs, and CLAUDE.md
- Add scoped .claude/rules/exceptions.md for ongoing enforcement
- Add comprehensive hierarchy tests (62 exception tests, 2603 unit total)

Closes #336

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…in stack_manager

Cover 5 missing lines in stack_manager.py (lines 94, 368, 572, 584, 611)
to satisfy diff-cover 100% requirement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sodre sodre added this to the v1.0.0 milestone Mar 28, 2026
@sodre sodre added api-design API surface changes area/limiter Core rate limiting logic labels Mar 28, 2026
@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (d82ed07) to head (7b2e4be).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   92.19%   92.38%   +0.19%     
==========================================
  Files          37       37              
  Lines        7842     7854      +12     
==========================================
+ Hits         7230     7256      +26     
+ Misses        612      598      -14     
Flag Coverage Δ
doctest 29.14% <20.00%> (?)
e2e 42.33% <20.00%> (-0.04%) ⬇️
integration 50.76% <42.00%> (+0.10%) ⬆️
unit 92.18% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

RateLimiterUnavailable is under InfrastructureError, not RateLimitError.
Update docstring to reflect actual subclasses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sodre sodre marked this pull request as ready for review March 28, 2026 19:36
@sodre sodre merged commit d847257 into main Mar 28, 2026
25 checks passed
@sodre sodre deleted the task/336-exceptions-review branch March 28, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-design API surface changes area/limiter Core rate limiting logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📋 Zero-Based Review of exceptions module before 1.0.0

1 participant