Resolve Ruff 0.16 findings - #2147
Merged
Merged
Conversation
Contributor
ApprovabilityVerdict: Approved Purely mechanical linting and formatting changes to resolve Ruff 0.16 findings. All modifications are non-behavioral: import reordering, whitespace fixes, noqa annotations, and Pydantic best-practice patterns for mutable defaults. 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: b47c50e0a0
ℹ️ 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".
hallerite
approved these changes
Jul 27, 2026
rasdani
added a commit
that referenced
this pull request
Jul 27, 2026
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>
eligotts
added a commit
that referenced
this pull request
Jul 31, 2026
…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).
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.
Overview
Updates the repository for Ruff 0.16's expanded default rule set across v1 code, legacy surfaces, tests, environments, and documentation examples.
Details
Note
Low Risk
Changes are overwhelmingly lint, formatting, and defensive defaults; the few behavior tweaks (mutable defaults, closure capture, subprocess/async exec) are localized and low blast radius.
Overview
Brings the tree in line with Ruff 0.16’s expanded defaults: most legacy v0 packages, tests, and CLI shim modules get a file-level
# ruff: noqaso CI can pass without rewriting those surfaces, while v1 and example environments are updated in place.In v1 and tasksets, the substantive fixes are mutable Pydantic defaults switched to
Field(default_factory=...)(judges, retries, env server legacyargs, echo phrases, wiki judges, etc.), import / API hygiene (sorted__all__,Self,pairwise,ClassVaron class-level spec lists), and narrow lint-driven behavior tweaks such asTypeErrorfor wrong-type validation, explicitsubprocesscheck=False, andasyncio.to_threadfor blocking shell in Terminus2’s local exec. Framework boundaries that intentionally catch broad exceptions are kept but annotated with targeted# noqa: BLE001(and similar) instead of being refactored away.Docs and README Python snippets are reformatted to match the new formatter; example envs get small correctness fixes (e.g. alphabet sort
sort_keyclosure overby_first, proposer–solver JSON answer type errors). Tests pick up the same patterns (Fieldfor list defaults,subprocess.run(..., check=False)).Reviewed by Cursor Bugbot for commit a3467d6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix mutable default arguments and resolve Ruff 0.11 linting findings across the codebase
Field(default_factory=...), preventing cross-instance state mutation in models likeNetworkPolicyConfig,RetryConfig,TaskConfig,Criterion, and others.# ruff: noqafile-level directives on ~100 files where wholesale suppression is preferred over inline fixes.# noqa: BLE001inline comments to intentional broadexcept Exceptionhandlers rather than removing them.ValueErrorraises toTypeErrorin validation paths (e.g._check_borrowed_placement,Harness.resolve_prompt,EgressProxy._handle,CodexHarness.resume,AgenticJudgeEnv).EnvClientto catch built-inTimeoutErrorinstead ofasyncio.TimeoutError, and wraps a blockingsubprocess.runinasyncio.to_threadinLocalEnvironment.exec.Macroscope summarized a3467d6.