Skip to content

Fix mypy type errors in pool-coordinator services and API wiring#29

Merged
chrystianmartins merged 1 commit into
mainfrom
codex/fix-mypy-type-errors-in-app
Feb 9, 2026
Merged

Fix mypy type errors in pool-coordinator services and API wiring#29
chrystianmartins merged 1 commit into
mainfrom
codex/fix-mypy-type-errors-in-app

Conversation

@chrystianmartins

Copy link
Copy Markdown
Owner

Motivation

  • Resolve static typing errors flagged by mypy across the pool-coordinator package to ensure safer, clearer API surfaces and service logic.
  • Make numeric/Decimal conversions and handler/middleware signatures explicit to avoid Any/incompatible-type issues at type-check time.

Description

  • Rename the temporary logging handler variable to stream_handler and keep JsonFormatter usage consistent in configure_logging to avoid handler type inference issues in pool-coordinator/app/core/logging.py.
  • Make cosine_similarity return a float explicitly instead of an untyped value to remove Any inference in pool-coordinator/app/services/verification.py.
  • Introduce DailyEmissionStatus (TypedDict) and annotate get_daily_emission_status to return it, and use the typed remaining_tokens value safely in run_daily_emission in pool-coordinator/app/services/emission.py.
  • Harden reputation conversion in emission logic to accept Decimal, numeric, or string inputs and fallback to Decimal("0") for invalid types to avoid Decimal(object) errors in pool-coordinator/app/services/emission.py.
  • Add explicit return typing for require_roles and annotate FastAPI middleware dispatch and lifespan signatures for better static checking in pool-coordinator/app/api/dependencies/auth.py and pool-coordinator/app/main.py.

Testing

  • Ran mypy app inside pool-coordinator and confirmed success: Success: no issues found in 44 source files.
  • Verified the changes compile with static typing and adjusted code paths touched during the typing fixes.

Codex Task

@chrystianmartins
chrystianmartins merged commit 6fc896d into main Feb 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant