Skip to content

[lint] Fix pyrefly errors on main#6281

Closed
dlwh wants to merge 1 commit into
mainfrom
codex/fix-main-pyrefly-lint
Closed

[lint] Fix pyrefly errors on main#6281
dlwh wants to merge 1 commit into
mainfrom
codex/fix-main-pyrefly-lint

Conversation

@dlwh

@dlwh dlwh commented Jun 8, 2026

Copy link
Copy Markdown
Member

Repair the pyrefly failures currently blocking the main lint workflow. The fix restores the missing import in LM training, makes the labeled eval mixed-precision policy explicitly nullable, gives Jinja global mutation a type pyrefly accepts, and narrows completed trace eval metrics without relying on helper-predicate inference.

@dlwh dlwh added the agent-generated Created by automation/agent label Jun 8, 2026
@claude

claude Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Claude finished @dlwh's task in 1m 24s —— View job


🤖 ### Code review

No issues found. Checked for bugs and CLAUDE.md / AGENTS.md compliance across all four modified files.

Reviewed changes

File Change Verdict
lib/levanter/src/levanter/callbacks/labeled_eval.py mp: jmp.Policyjmp.Policy | None (matches None default; call sites already None-guard)
lib/levanter/src/levanter/main/train_lm.py adds import os (resolves existing os.path.join usage at line 400)
lib/levanter/src/levanter/tokenizers.py wraps env.globals writes through cast(dict[str, Any], env.globals) — typing-only no-op
lib/marin/src/marin/evaluation/trace_labeled_eval.py inlines _is_completed_dataset_result as explicit isinstance(..., Mapping) guards (semantically equivalent — the helper was exactly those two checks)

Method. 2 sonnet agents reviewed against the relevant CLAUDE.md / AGENTS.md files (root, lib/levanter/, lib/marin/). 2 opus agents independently audited the diff for bugs and broken call sites. One CLAUDE.md agent flagged the inlined isinstance check as "silent fallback replacing an assert" in trace_labeled_eval.py; on validation this is a false positive — the removed assert sat after _is_completed_dataset_result had already returned True, so it was a type-narrowing assertion that could never fire. Behavior is byte-equivalent.


  • Check PR status
  • Locate CLAUDE.md / AGENTS.md files for changed paths
  • Summarize PR changes
  • Run 4 parallel review agents (2 CLAUDE.md compliance, 2 bug-spotting)
  • Validate each flagged issue
  • Emit stats event (skipped — permission required for uv run was not granted; per skill, best-effort)
  • Post review
    · Branch codex/fix-main-pyrefly-lint

@rjpower

rjpower commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

i think these were fixed in a separate PR

@rjpower rjpower closed this Jun 8, 2026
@rjpower rjpower deleted the codex/fix-main-pyrefly-lint branch June 8, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-generated Created by automation/agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants