Repository navigation
Make the case-level model the simulator's lever mechanism - #17
Merged
Merged
Conversation
Remove the accounting-bound levers entirely: the four category checkboxes, the suppression-effectiveness dial, and scenarioErrors(), which scaled observed error dollars by finding category. No accounting-suppression path remains reachable from the UI. The one policy scenario is now the standard medical deduction, driven by model_scenarios.json: ticking it applies the state's sparse SMD-flipped per-case parameters (deviation probability and nine quantiles) and simulates both endpoints from the fitted model, levels anchored to the official rate. The control shows the exported paired-bootstrap delta and 95% interval and states it is an association, not a causal estimate. The artifact's base-model SHA-256 pin is verified in the browser before use; integrity failures disable the scenario with the error shown, never a silent fallback. Seven jurisdictions outside the [0.7, 1.4] factor-adjusted level-ratio gate get a disabled control with the reason and their ratio. The no-scenario engine remains the observed QC resample, labeled as such by a persistent sampling-engine line. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The app-side half of the model-primary pivot (data contract landed in #16). Every number a lever produces now comes from the case-level predictive model; the accounting mechanism is gone.
Removed — the four category checkboxes, the suppression-effectiveness dial, and
scenarioErrors(), which scaled observed FY 2024 error dollars by finding category. No accounting-suppression path is reachable from the UI.The lever is now the SMD scenario. Ticking "Adopt/Drop the standard medical deduction" (label follows the state's FY 2024 policy) applies the state's sparse SMD-flipped per-case parameters from
model_scenarios.jsonand simulates both endpoints from the fitted model — same inverse-CDF draw engine, baseline vs patched parameters, levels anchored to the official rate. The control displays the exported paired-bootstrap delta and 95% interval (e.g. Colorado: −0.034pp, CI −0.077 to +0.004, 53 flipped cases) and says plainly it is an association from burden features adding +0.006 ROC AUC, not a causal estimate. Self-employment, heat-and-eat, and BBCE are absent because the export excludes them with reasons; the fine print links the machine-readable export.Integrity checks in the browser. The scenario export is valid only against the exact
model_data.jsonit pins; the app verifies that SHA-256 withcrypto.subtleat load, plus schema, delta-direction, patch-index, monotonicity, and probability-range assertions. Any failure disables the scenario with the error displayed — no silent fallback.Gates honored. AK, HI, ID, MN, SD, VI, WY (factor-adjusted level ratio outside [0.7, 1.4]) get a disabled control showing the reason and the state's own ratio. Shared links to gated states degrade to the observed view.
The no-scenario engine is unchanged: the observed QC resample, centered on the official rate. A persistent sampling-engine line states which mechanism produced what's on screen.
Verified in the browser (localhost, light + dark, desktop + mobile 375px, no console errors): scenario on/off for adopter (CO/GA) and non-adopter (WI) states with hint numbers matching
analysis/MODEL_SCENARIOS.mdrows exactly; gated WY disabled with ratio 0.41; deep links (?state=GA&smd=1&audits=300) restore state including model auto-load; legacylevers/eff/modeparams ignored; all-53 national table computes; no horizontal overflow at 375px.🤖 Generated with Claude Code