Fix top review findings: coverage labeling, error handling, UX dead ends - #9
Open
daphnehanse11 wants to merge 2 commits into
Open
Fix top review findings: coverage labeling, error handling, UX dead ends#9daphnehanse11 wants to merge 2 commits into
daphnehanse11 wants to merge 2 commits into
Conversation
Backend:
- Label unsubsidized marketplace ("Marketplace (full price)") and
Medicare (65+) instead of showing "No coverage" when PTC is $0
- Raise on failed core-variable calculations instead of silently
returning $0 (optional lcbp/chip_premium still default to 0)
- Use the destination state's bronze/silver ratio for the after side
of a move's ACA premium estimate
- Categorize lcbp and chip_premium so totalBenefits no longer counts
the gross bronze premium or CHIP fees as benefits
- Stop leaking internal exception text in 500 responses
Frontend:
- Block employer-coverage households at wizard step 5 with an inline
heads-up (plus a "continue without employer coverage" path) instead
of after all seven questions
- Lead result headlines with per-person coverage transitions
("qualifies you and your family for Medicaid") instead of tax-credit
mechanics that framed good news as bad
- Add stale-response guard so slow simulations can't clobber a newer
household or wedge the UI; hide the change wizard while the error
card is shown
- Proxy routes: maxDuration=120, backend fetch timeout, safe handling
of non-JSON error bodies, shared helper (was duplicated)
- Restore pregnantMember when decoding share links
- Fix hooks-order violation in ResultsView; add route error boundary
- Show the move-specific silver explainer only for move scenarios
README: point Live link at the working deployment.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- SimulationComputeError with a user-safe message replaces the ValueError that embedded raw PolicyEngine exception text; full details go to the server log, and the Flask API returns it as 500 (engine fault), not 400 - modal_app.py gets the same sanitization as the Flask API (it previously still returned raw exception text) and logs tracebacks in-container - Marriage/divorce counterfactual side-simulations run non-strict again: their aggregated results are discarded, so a failed variable there no longer aborts the whole comparison - restoreScenario bumps the request sequence and clears loading, so an in-flight simulation can't override a restored saved scenario - decodeScenario rejects unknown event types from crafted share links (previously rendered an "undefined …" headline) - Backing out of the ESI heads-up fully resets the answer so the summary no longer shows "Job coverage: Yes" - test_compare: fake _run_simulation accepts the new strict kwarg Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
|
Second review round (adversarial pass over this diff) found and fixed in 3d2bef1:
Full backend suite: 34 passed. One deploy-time check for the reviewer: 🤖 Generated with Claude Code |
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.
Fixes the highest-priority findings from a full code review of the app (backend, frontend, and a live walkthrough).
What users see wrong today
$0, so bad input produced a confident all-zeros result instead of an error.maxDuration/timeouts, users sawUnexpected token 'A'...when the proxy tried to JSON-parse an HTML error page.Changes
Backend
Marketplace (full price)for $0-PTC people,Medicarefor 65+ (dual-eligibles surface as Medicare); counterfactual remaps carry the new field through_run_simulationraises on failed core variables (medicaid,chip,premium_tax_credit,slcsp);lcbp/chip_premiumstay soft-default 0 since their absence is a data gaplcbp/chip_premiumadded to metadata with a non-benefit category, sototalBenefitsno longer counts the gross bronze premium as a benefit; also fixes the rawchip_premiumlabel leaking to the APIFrontend
requestSeq): a slow simulation can no longer save a scenario for a household you've already left or rewrite the URL; error card and change wizard are now mutually exclusivemaxDuration = 120, 110s backend fetch timeout with a friendly 504, content-type-checked error parsing, deduplicated intosrc/lib/backendProxy.tsdecodeScenariorestorespregnantMember(pregnancy scenarios previously recomputed against a non-pregnant baseline)app/error.tsxerror boundaryVerification
pytest tests/— 34 passednpm run build+tsc+ eslint clean (3 pre-existing dead-code warnings untouched)Marketplace (full price)pills; 66-year-old showsMedicare; family income drop headlines "qualifies you and your family for Medicaid"; ESI "Yes" blocks at step 5; invalid state returns a clean JSON error🤖 Generated with Claude Code