Skip to content

Call the October upgrade's fixed outputs fixed, and build the table's split from a helper - #209

Open
MaxGhenis wants to merge 1 commit into
mainfrom
engine-upgrade-fixed-wording
Open

MaxGhenis wants to merge 1 commit into
mainfrom
engine-upgrade-fixed-wording

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Follow-up to release dashboard-data-20261010 (#208, merged as 5a8164a). This fixes the two non-blocking nits from its round-2 final review (~/reviews/policybench-haiku-5-5/final-review/round2/review.md).

Changes

  1. Upgrades table split comes from a helper. The US references on policyengine-us … (October 2026 upgrade) cell in paper/index.qmd built its parenthetical inline from r.engine_upgrade_restored_count - r.engine_upgrade_restored_ruled_count and r.engine_upgrade_restored_ruled_count. With zero ruled outputs it would print "the 0 ruled on … stay scored", and with one, "the 1 … stay".
    • The new restored_split_clause(restored, ruled, ruling_date) in policybench/paper_results.py, beside restored_split_sentence, builds the whole verb phrase. It handles no fixed outputs, all returned, all ruled, a mix, and singular and plural ("one", "returns", "stays", "output", "defect").
    • The cell calls it through r.engine_upgrade_restored_split_clause.
    • For this release's (18, 4) the output is byte-identical to what the cell printed before.
  2. "Fixed", not "restored", where the sentence covers all 18. engine_upgrade_restored_sentence now reads "The fixed outputs take the upstream fixes for …". The four outputs ruled on 2026-10-06 while still scored never left scoring, so "restored" didn't fit them.
    • The docstrings that cover all of them now say "fixed": EngineUpgrade, partition_engine_upgrade_changes, engine_upgrade_restored_count, _fixes, _fix_phrase, _targets and _target_sentence.
    • So do the per-entry refusal messages ("is fixed off its target", "is fixed on a tolerance of"), and the test docstrings.
    • The accessor names stay as they are, so the paper, the card test and the notes test need no rename churn.
    • The note's restored/newlyScored/restoredRuled facts and its "{newlyScored} restored outputs" (the 14 that did return) are already accurate and stay unchanged.

Rendered paper: two words, no numbers

I re-rendered with .venv/bin/python paper/render_paper.py and re-pinned with .venv/bin/python scripts/freeze_snapshot.py --rendered-only. Word-level diffs of the old and new renders:

  • HTML: "restored" becomes "fixed" twice (the October paragraph and the table cell). The only other change is the Quarto cell id of the edited table cell.
  • PDF (pdftotext): "restored" becomes "fixed" twice. Nothing else changes.
  • The manifest and app/src/paperSnapshot.json change only in the pdf and index.html hashes.

Invariants (load-bearing prose helper)

For every 0 ≤ ruled ≤ restored, restored_split_clause:

  • names the total in numerals with an agreeing noun and "defect"/"defects";
  • says "return" iff restored − ruled > 0, and "stay" and the ruling date iff ruled > 0;
  • agrees with restored_split_sentence on both;
  • agrees each verb with its count;
  • never prints "the 0", "the 1", "0 that", "1 that" or a lone "1" inside the split;
  • has exactly one balanced parenthetical;
  • refuses ruled > restored and ruled < 0.

Tests

  • test_the_split_clause_counts_both_kinds: a Hypothesis property test over (restored ∈ 0..40, ruled ∈ 0..restored) of the invariants above. I also checked the same properties exhaustively over 0..200 by script.
  • test_the_fixed_outputs_split_into_returned_and_still_scored pins this release's clause. It also requires the cell to call engine_upgrade_restored_split_clause and refuses the old inline arithmetic.
  • test_the_upgrade_sentences_name_what_the_sidecar_records pins "The fixed outputs take the upstream fixes for …" and refuses "restored outputs take" in the source.
  • test_rendered_html_calls_the_upgrade_fixes_fixed_not_restored requires the clause and the fixed sentence (twice) in the rendered HTML. test_rendered_pdf_calls_the_upgrade_fixes_fixed_not_restored checks the PDF.
  • Mutation check: each of these mutants fails at least one of the new tests: the sentence back to "restored", "the 1 … stay", "1 that … return", and "1 outputs".
  • Locally: tests/test_paper_results.py, tests/test_disclosures.py and tests/test_snapshot_artifacts.py give 202 passed and 1 skipped (pre-existing); the full suite is in the notes below. uv run ruff format . and ruff check . are clean.

🤖 Generated with Claude Code

… split from a helper

Follow-up to release dashboard-data-20261010 (#208), fixing the two
non-blocking nits from its round-2 final review.

1. The upgrades table cell built its 14 returned / 4 ruled parenthetical
   inline in paper/index.qmd. With zero ruled outputs it would print "the 0
   ruled on ... stay scored", and with one, "the 1 ... stay". The new
   restored_split_clause in policybench/paper_results.py, beside
   restored_split_sentence, builds the whole verb phrase. It handles no
   fixed outputs, all returned, all ruled, a mix, and singular and plural
   ("one", "returns", "stays"). The cell calls it through
   engine_upgrade_restored_split_clause. For this release's (18, 4) it gives
   the same text the cell printed before.

2. engine_upgrade_restored_sentence called all 18 fixed outputs "restored",
   though the four ruled on 2026-10-06 while still scored never left
   scoring. It now says "The fixed outputs take the upstream fixes for ...".
   The docstrings and the per-entry refusal messages that cover all of them
   say "fixed" too.

The rendered paper changes in two words only: "restored" becomes "fixed" in
the paragraph and in the table, in both the HTML and the PDF. No number
changes. Re-rendered with paper/render_paper.py and re-pinned with
scripts/freeze_snapshot.py --rendered-only.

Tests:
- A Hypothesis property test over (restored, ruled) for the clause checks
  the total and its noun, that it says "return" and "stay" exactly when the
  split sentence does, verb agreement, and no "the 0", "the 1" or lone "1".
- The clause is pinned for this release, and the paper must call it.
- The fixed sentence is pinned.
- Rendered HTML and PDF checks require "fixed outputs take" and refuse
  "restored outputs take".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
policybench-site Ready Ready Preview Oct 10, 2026 9:53am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 4399335d Deployed Oct 10, 2026 by vercel[bot]
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