Envelope checks: store answers as expected_log10 to prevent spoilers - #136
Merged
Conversation
…he estimate Joe spotted that check(guess, expected=9.0, ...) sits one line below the learner cell — the answer in plain sight before the reader commits. - jansky.envelope.check gains expected_log10 (exactly one of expected / expected_log10 required); the real value is only ever shown in the printed comparison after a guess, never before. 4 new tests. - All 73 check calls across 45 notebooks swept to expected_log10 (base-10 log, 4 decimals; <=0.00005 dex rounding, invisible to decade grading), with the check-cell comment explaining the convention. All notebooks re-executed, stderr stripped, nbmake green (45 passed). - Chapter 1's checker introduction, CONTRIBUTING.md's envelope template, and the notebook-author agent spec updated to require the log form. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PigBKcWuR6ee7xUHAPEfcG
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.
What
Joe spotted a flaw in the envelope design from #135: the check cell —
check(tau_guess_s, expected=9.0, ...)— sits one line below where the learner is asked to commit to a guess, with the answer in plain sight. The collapsed<details>reveal protects the worked answer, and then the check cell undid it.Fix
The checker needs the true value at runtime (it grades by decades), so the answer can't be removed — only made unreadable at a glance.
jansky.envelope.checknow acceptsexpected_log10=(the answer's base-10 logarithm, 4 decimal places):expected_log10=0.9542instead ofexpected=9.0. The real value appears only in the printed comparison after a guess — theNonepath prints "no guess yet" and leaks nothing.expected/expected_log10is required (expectedkept for direct/test use); 4 new unit tests.pytest --nbmakegreen on all 45.Checks
make lint/make typecheck/make cov(279 passed, 93.8%) /make docs(strict) all green.🤖 Generated with Claude Code
https://claude.ai/code/session_01PigBKcWuR6ee7xUHAPEfcG