Round cents in PE derivation narratives#36
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks
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.
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.
Applies a regex pass over the committed case-explanations CSV to round
$X.YZdollar amounts to whole dollars in every narrative. Regeneratesapp/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.