Repository navigation
Conversation
mypy runs with check_untyped_defs over autodev and mia_data, in CI before the tests. The fixes are mostly narrowing Optionals the code already handled at runtime: - GitHub.request is overloaded so it returns None only with ok404, and read_untrusted returns str or bytes depending on `binary`. - autodev's shared helpers (auth, Temporal connection, logging, ops) take a Deployment protocol that both packages' Config satisfy, instead of autodev's Config. - Activities.temporal raises a clear error if an activity that needs the Temporal client runs without one (the CLI), instead of AttributeError. - MiaDataDataset._limits() reads the round limits lazily, replacing the repeated `self.limits or await ...`; a merged PR without a merge commit ends the round in needs-human instead of crashing the workflow task. - App credentials are checked in one place (_app_credentials) and the App key must be RSA. orjson is added explicitly: the pixi env had an empty orjson directory (an NFS leftover) that shadowed the package mypy uses for its cache. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pixi run typecheck(check_untyped_defs, warnings on unused ignores). CI runs it between lint and tests. The suite was clean at 0 after fixing 121 findings; nothing is suppressed withtype: ignore.GitHub.requestis now overloaded: it returnsResponse | Noneonly whenok404=True, so the twenty.json()call sites type-check without guards.read_untrustedis overloaded onbinary, so text readers getstr | Noneand the crop/gallery readers getbytes | None.token_fn,bot_login,_client,_setup_logging, the ops commands) take aDeploymentprotocol instead of autodev'sConfig. Both packages' configs satisfy it structurally; no runtime change.Activities.temporal(both packages) raises a clear error when an activity that needs the Temporal client runs without one, instead of anAttributeErroronNone.MiaDataDataset._limits()loads the round limits lazily, replacing the repeatedself.limits or await self._act("limits"). On every recorded path the activity calls are unchanged (the replay tests pass). A merged PR that reports no merge commit now ends the round in needs-human rather than failing the workflow task.combine_checksandcheck_statetakeSequence[str]; a few Optional narrowings withassertwhere the invariant is established earlier in the workflow.site-packages/orjson/directory (an NFS leftover from a deleted file) that shadowed the real package and crashed mypy's cache writer. A fresh environment would not have hit this, but pinning the dependency makes it moot.Test plan
pixi run lint,pixi run typecheckcleanpixi run test: 328 passed, including the Temporal replay tests🤖 Generated with Claude Code