Skip to content

lab: the held-out guard looks everywhere, not just at config.split - #96

Merged
AdvayMonga merged 1 commit into
mainfrom
lab/heldout-guard
Oct 5, 2026
Merged

AdvayMonga merged 1 commit into
mainfrom
lab/heldout-guard

Conversation

@AdvayMonga

Copy link
Copy Markdown
Owner

Problem

ledger._check only applies the held-out rule (one aggregate per metric, nothing else) when a record has a top-level config.split == "heldout". Tool records written through Toolbox._record nest everything under result and carry no top-level config, so a held-out submit written that way would skip the rule and could store per-request held-out detail in the ledger.

Change

  • lab/ledger.py: a "split": "heldout" anywhere in the record (outside claim) marks it held-out; it must then be declared as top-level config.split with top-level config + metrics, or it is refused.
  • lab/tools.py: Toolbox._record_heldout, the one way a tool writes a held-out result in the accepted shape.
  • Tests: held-out nested under result, args or lists is refused; a _record-shaped held-out record is refused; claims may still name the split; the helper writes the accepted shape; seeding knowledge/ is unchanged.
  • lab/README.md: documents the rule.

Notes

  • Branch is 10 commits behind main but merges cleanly. The full suite passed on its base when written (485 tests); re-run before merging.
  • Not to be merged without your review. You may prefer to close the gap your own way.

🤖 Generated with Claude Code

The writer only restricted records whose top-level config.split was heldout, but tool records
nest everything under result and carry no config, so a held-out submit written through
Toolbox._record would have bypassed the one-aggregate-per-metric rule.

- ledger._check: a "split": "heldout" anywhere outside claim marks the record held-out; it
  must then be declared as config.split with top-level config + metrics, else refused
- Toolbox._record_heldout: the one way a tool writes a held-out result
- tests: nested held-out under result/args/lists refused, a _record-shaped held-out refused,
  claims may name the split, the helper writes the accepted shape; seeding knowledge/ unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AdvayMonga
AdvayMonga merged commit 684e99f into main Oct 5, 2026
4 checks passed
@AdvayMonga
AdvayMonga deleted the lab/heldout-guard branch October 5, 2026 04:47
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