Skip to content

fix: satisfy ty 0.0.87 checks and bump pinned floor - #716

Merged
brndnmtthws merged 1 commit into
mainfrom
brndnmtthws/fix/ty-type-errors
Oct 14, 2026
Merged

brndnmtthws merged 1 commit into
mainfrom
brndnmtthws/fix/ty-type-errors

Conversation

@brndnmtthws

Copy link
Copy Markdown
Owner

Summary

Fixes the ty check CI failures seen on PR branches: CI resolves uvx ty to 0.0.87 while the repo pinned ty>=0.0.73, and the newer checker flags 7 errors plus 2 deprecation warnings on main.

User Impact

CI ty check passes again on all branches. No runtime behavior changes; annotations and dependency floor only.

Root Cause

  • Pinned ty floor (0.0.73) lagged CI's floating uvx ty (0.0.87), which added invalid-mutable-override and invalid-argument-type (invariance) diagnostics plus contextmanager return-type deprecations.
  • track_async took invariant list[Coroutine] while callers pass concrete coroutine lists.
  • Two @contextmanager helpers annotated Iterator instead of Generator.

Fix

  • log.track_async: parameter widened to Sequence[Coroutine[...]] (covariant; all callers pass lists).
  • db.session_scope, ibkr.supervise_order_errors: return Generator per ty's prescribed fix.
  • Six Literal/as_of_session envelope narrowings in tail_harvest_decision.py / target_weight_policy.py: intentional pydantic discriminators (validated at construction, schema-exported, never mutated via base) — scoped ty: ignore[invalid-mutable-override] per site with rationale.
  • Bump dev ty floor to >=0.0.87 and refresh uv.lock so local checks match CI.

Validation

  • uvx ty check (0.0.87): clean
  • uv run ty check: clean
  • uv run ruff check ., uv run ruff format --check .: clean
  • uv run pytest: 818 passed

- Narrowed Literal/required-session envelope overrides are intended
  pydantic discriminators; scope ty ignores per site with rationale.
- track_async takes Sequence (covariant) instead of invariant list.
- contextmanager helpers annotate Generator, not Iterator.
- Bump dev ty floor 0.0.73 -> 0.0.87 to match CI's uvx resolution.
@brndnmtthws
brndnmtthws marked this pull request as ready for review October 14, 2026 14:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T14:24:01.654826Z 77f1f7f Draft marked ready
🔒 Security Review ✅ Completed 2026-10-14T14:24:34.517048Z 77f1f7f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@brndnmtthws
brndnmtthws merged commit 4ac5893 into main Oct 14, 2026
9 checks passed
@brndnmtthws
brndnmtthws deleted the brndnmtthws/fix/ty-type-errors branch October 14, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant