Skip to content

Pin the stored task hash of every registered spec - #514

Merged
gregorybchris merged 2 commits into
mainfrom
chrisg/pin-task-hashes
Oct 27, 2026
Merged

gregorybchris merged 2 commits into
mainfrom
chrisg/pin-task-hashes

Conversation

@gregorybchris

@gregorybchris gregorybchris commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a golden test that pins the stored task hash of every registered spec, so a change that moves a hash fails CI until it is acknowledged.

A task hash identifies stored results. Until now, nothing caught a change that moved one, short of reviewers noticing.

What it adds

  • tests/evals/tasks/test_task_hashes.py. It hashes 2,681 specs: every task, every single variant, and every spec a suite expands to, including stacked variants such as arc_easy:rc:olmo3base. It hashes each once with OLMO_EVAL_JUDGE unset and once set, clears the environment variables tasks read into their config (such as CTC_SUITE_DATA_ROOT), and compares with task_hashes.json. A failure lists added, removed and changed specs separately, with old and new hashes. When a change is intended, regenerate the file with uv run pytest tests/evals/tasks/test_task_hashes.py --update-task-hashes; the moved hashes then show up as a diff to review.
  • configure_task in runners/asynq/preparation.py. This is the part of prepare_task_items that builds a task's stored config, extracted with no change in behavior. The test hashes through it, so it pins the hash runs actually store and not a proxy.
  • An AGENTS.md "Pinned hashes" rule, with a pointer from CONTRIBUTING.md:
    • A new task or variant only adds specs: regenerate the file, and no entry is needed.
    • A changed hash should usually be a new variant instead, per "Spec meaning is fixed". When a hash must move in place, regenerate the file and add an entry to docs/result-compatibility.md naming the specs.
    • A removed spec is a retirement and needs an entry too.
    • The test can't see a change in what a spec measures that leaves its hash alone; that still needs an entry.

Validation

  • For the 2,450 task and single-variant specs, the fixture matches stored hashes computed independently from main's runner code.
  • A separate review found the test missing suite specs and leaking CTC_SUITE_DATA_ROOT; both are fixed. The test passes with that variable set.
  • It is stable across Python 3.12 and 3.13, and with a different HOME, temp dir and working directory.
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
uv run ty check src/
uv run pytest tests/ --ignore=tests/integration

All pass: 4,433 passed, 36 skipped.

This PR comes from #512, which unifies the LLM-judge code. #512 builds on it, so its diff shows only the hashes it changes.

🤖 Generated with Claude Code

A task hash identifies stored results, and nothing caught a change that
moved one. Add a golden test of the hash of every task and single
variant, with OLMO_EVAL_JUDGE unset and set, built through the same
configure_task the runner uses, so it pins the hash runs store. An
intended change shows up as a reviewed diff to task_hashes.json.
configure_task is extracted from prepare_task_items without a change in
behavior. AGENTS.md says what to do when the test fails.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review of the hash test found that it missed the stacked-variant specs
suites run, that CTC_SUITE_DATA_ROOT reached 199 pinned hashes from a
developer's environment, and that its failure message asked for a
compatibility entry when a spec was only added. The test now also pins
every spec a suite expands to, clears the environment variables tasks
read into their config, lists added, removed and changed specs apart
with old and new hashes, and reads the registry through its public
functions. The AGENTS.md rule defers to "Spec meaning is fixed", says a
removed spec is a retirement, and says what the test cannot catch;
CONTRIBUTING.md points to it. configure_task is exported.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@gregorybchris
gregorybchris merged commit 6826e90 into main Oct 27, 2026
8 checks passed
@gregorybchris
gregorybchris deleted the chrisg/pin-task-hashes branch October 27, 2026 04:26
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