Skip to content

Envelope checks: store answers as expected_log10 to prevent spoilers - #136

Merged
joebarbere merged 1 commit into
mainfrom
envelope-log10-expected
Jul 30, 2026
Merged

Envelope checks: store answers as expected_log10 to prevent spoilers#136
joebarbere merged 1 commit into
mainfrom
envelope-log10-expected

Conversation

@joebarbere

Copy link
Copy Markdown
Owner

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.check now accepts expected_log10= (the answer's base-10 logarithm, 4 decimal places): expected_log10=0.9542 instead of expected=9.0. The real value appears only in the printed comparison after a guess — the None path prints "no guess yet" and leaks nothing.

  • Exactly one of expected / expected_log10 is required (expected kept for direct/test use); 4 new unit tests.
  • All 73 check calls across 45 notebooks swept mechanically (rounding error ≤0.00005 dex — invisible to decade grading); check-cell comments now explain the convention.
  • Chapter 1's checker introduction teaches it; CONTRIBUTING.md's envelope template and the notebook-author agent spec require it for future chapters.
  • All 45 notebooks re-executed with outputs committed, stderr stripped; pytest --nbmake green 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

…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
@joebarbere
joebarbere merged commit d3a0a80 into main Jul 30, 2026
2 checks passed
@joebarbere
joebarbere deleted the envelope-log10-expected branch July 30, 2026 04:48
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