Update Ruff and ty tooling - #2148
Conversation
ApprovabilityVerdict: Approved Mechanical tooling upgrade updating Ruff linter and ty type checker versions. Changes are formatting adjustments, import reordering, lint/type ignore comments, and minor Pydantic mutable default fixes. No significant runtime behavior changes. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e2e784a41
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4dd4882. Configure here.
12bbe71 to
c8b2354
Compare
Pull Request is not mergeable
Pull Request is not mergeable
Dismissing prior approval to re-evaluate c8b2354
Four conflicts, all from tooling churn rather than overlapping design — nobody else has been in artifacts.py, the Harbor artifact wiring, or the topology logic. - verifiers/v1/__init__.py, task.py, tasksets/harbor/taskset.py: import ordering. #2146 relocated `configs.task`/`configs.taskset` and #2148's isort re-sorted the package; my artifacts imports had landed on the same lines. Kept both sides. - envs/agentic_judge/env.py: #2147 changed the solver-runtime guard from `ValueError` to `TypeError` for Ruff 0.16, on the same line where I had rewritten the message (the check no longer means "the judge plays in the solver's box"). Took their exception type with my message. Also converted three pydantic mutable defaults to `Field(default_factory=...)` — `Artifact.exclude`, `TaskData.artifacts`, `HarborData.collect`. Not conflicts, but Ruff 0.16 flags them and CI would have failed on the merged result. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…fload Picks up 35 main commits: the v1 structure cleanup (#2146) that retires StrictBaseModel and renames _NODE_DUMP_EXCLUDE -> EXCLUDE_FIELDS, the ruff 0.16 / ty tooling bump (#2147, #2148), runtime-on-agent + agent config stamped on the trace (#2106), Reward score/weight records (#2119), MCP tools for Codex (#2140), and assorted v1 fixes. Resolutions: - trace.py: main's restructure subsumes this branch's block wholesale — EXCLUDE_FIELDS already carries multi_modal_data, and TRACE_VERSION=1 is main's deliberate reset (this branch never touched it). Took main. - graph.py: kept the raw-mm sidecar validators and previous_multi_modal_data; adopted main's plain BaseModel now that StrictBaseModel is gone. - clients/train.py: kept the is_multimodal import — still used by the bridge path that threads previous_multi_modal_data. Ruff 0.16 flagged two spots this branch added that main's cleanup pass never saw: a constant getattr in the ingress offload walker, and the blind except at the prepare_request_body boundary (annotated noqa, per main's own convention at rollout boundaries).

Overview
Updates the repository tooling to Ruff 0.16.0 and ty 0.0.63, with hooks using the locked project environment.
Details
uv run --lockedso local hooks use the committed versions.This PR is stacked on #2147 to keep the tooling upgrade separate from the Ruff cleanup.
Note
Low Risk
Tooling and type-check suppressions only; no production logic changes. Main risk is CI/pre-commit failing if Ruff 0.16 or ty 0.0.63 report new issues beyond the added ignores.
Overview
Upgrades Ruff to 0.16.0 and ty to 0.0.63, with dev dependency floors, a refreshed
uv.lock, andtool.uv.exclude-newer-packagecutoffs for those two tools.CI pins Ruff 0.16.0 in the style workflow. Pre-commit runs Ruff and ty via
uv run --lockedso hooks match the lockfile.Across
verifiers/, addsty:ignore[...](alongside existing type ignores) for diagnostics surfaced by the newer ty release—clients, envs, rubrics, utils, and related paths—without changing runtime behavior.Reviewed by Cursor Bugbot for commit c8b2354. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Update Ruff and ty tooling to fix mutable default and type annotation issues across the codebase
ruffto>=0.16.0andtyto>=0.0.63in pyproject.toml and updates CI in style.yml to match.# ruff: noqafile-level directives to ~100 files where existing code patterns cannot cleanly satisfy the stricter rules.TaskConfig,RetryConfig,NetworkPolicyConfig,RubricJudgeConfig,EnvServerConfig, etc.) by replacing bare list/dict literals withField(default_factory=...).ValueErrorraises toTypeErrorin type-guard and validation contexts (agent.py,harness.py,egress.py,agentic_judge/env.py, etc.) to align with Python conventions.typing.Callable/typing.Iteratorimports withcollections.abcequivalents and updatesasyncio.TimeoutErrorcatches toTimeoutErrorinEnvClient.EnvClient._requestandEnvClient.ping_servernow catchTimeoutErrorinstead ofasyncio.TimeoutError; sinceasyncio.wait_forraisesasyncio.TimeoutError(a subclass ofTimeoutError), this is functionally equivalent, but callers relying onasyncio.TimeoutErrortype specifically may be affected.Macroscope summarized c8b2354.