Skip to content

gaia: stop __pycache__ from dirtying the dataset checkout - #1619

Merged
Evanfeenstra merged 1 commit into
mainfrom
gaia-pycache-clean
Aug 29, 2026
Merged

gaia: stop __pycache__ from dirtying the dataset checkout#1619
Evanfeenstra merged 1 commit into
mainfrom
gaia-pycache-clean

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Collaborator

On prod, GAIA grading failed with:

gaia: dataset checkout has local modifications — refusing to grade. Restore it to a clean tree first:
?? __pycache__/

The scorer driver does sys.path.insert(0, gaia_dir) + from scorer import question_scorer, and CPython writes bytecode to <GAIA_DIR>/__pycache__/ — so the first score() succeeds and dirties the tree, and every later grade refuses.

Fix:

  • run the driver with python -B so bytecode is never written into the checkout
  • verifyDataset deletes any existing __pycache__/ before the clean-tree check — it's derived state, and a doctored .pyc with matching mtime/size could shadow the sha-pinned scorer.py source, so deleting (rather than tolerating it untracked) also closes that pin-bypass vector

Already-dirty prod checkouts heal themselves on the next grade. Smoke gains a regression case: a planted __pycache__/ is removed, and score() is asserted not to create one.

🤖 Generated with Claude Code

Importing scorer.py compiled bytecode into <GAIA_DIR>/__pycache__/, so the
first score() dirtied the tree and every later grade refused with 'local
modifications'. Run the driver with python -B so bytecode is never written,
and have verifyDataset delete any existing __pycache__/ — it's derived
state, and a doctored .pyc there could shadow the sha-pinned scorer.py
source, so removal (not tolerance) is the right call. Heals already-dirty
prod checkouts on the next grade.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Evanfeenstra
Evanfeenstra merged commit f305bdf into main Aug 29, 2026
6 checks passed
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