Skip to content

Round cents in PE derivation narratives#36

Merged
MaxGhenis merged 1 commit into
mainfrom
scrub-cents
May 17, 2026
Merged

Round cents in PE derivation narratives#36
MaxGhenis merged 1 commit into
mainfrom
scrub-cents

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Applies a regex pass over the committed case-explanations CSV to round $X.YZ dollar amounts to whole dollars in every narrative. Regenerates app/src/data.json + the paper-snapshot copies + the manifest SHA so the modal renders the cleaner text in production. Avoids re-running the LLM batch for all 2,188 cases.

Apply a regex pass over the existing case_reference_explanations CSV that
rounds any \$X.YZ dollar amount to the nearest whole dollar (\$4,454.80 ->
\$4,455, \$3,179.15 -> \$3,179). Regenerate the dashboard payload and the
paper snapshot's run data.json copies, and refresh the snapshot
manifest's SHA256 to match.

The narratives read cleaner without the trailing cents and we avoid
having to re-call the model for the whole 2,188-case batch.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

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

Project Deployment Actions Updated (UTC)
policybench-site Ready Ready Preview, Comment May 17, 2026 8:37pm

Request Review

@MaxGhenis MaxGhenis merged commit 014c7c6 into main May 17, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the scrub-cents branch May 17, 2026 20:37
MaxGhenis added a commit that referenced this pull request May 17, 2026
The previous trace renderer took the first element of every OpenFisca
trace value, which silently dropped every other entity's contribution.
For joint households, the narrative would describe the head's row as
the entire household: scenario_000's federal_income_tax_before_refundable_credits
narrative reported "the household's only income is \$45,000 of
self-employment income" — silently dropping the spouse's \$40,000 in
wages. AGI \$81,821 magically appeared without an explanation that
reconciled.

Switch _value_repr and _is_zero to handle per-entity arrays as a unit:
- length-1 collapses to a scalar (the common tax-unit/household case),
- length>1 renders as ``sum (per entity: a, b, ...)`` for numeric values
  so the summariser sees both the total and the per-person decomposition,
- booleans surface as ``[True, False]``,
- ``_is_zero`` requires every entry to be zero before pruning a subtree.

Regenerate all 2,188 US narratives (0 errors) and the dashboard +
paper-snapshot data.json copies. Apply the cents-round pass that #36
introduced.
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