Computation
The grid previews calculations locally. Each editable column saves a scenario; Apply Final Results selects and stores the authoritative result through a command.
Columns and state
| Column | Data |
|---|---|
| Eligibility | CAO scenario: local draft if present, otherwise saved inputs. |
| Comp I / Comp II | Examiner scenarios, independently drafted and saved. |
| Final SAQC | Saved selected inputs, combined income, calculation result and signed error; not editable. |
| Error magnitude split | Optional read-only calculations isolating individual input differences. |
Final input cells can show a selection preview before apply, but Final result cells
require a saved result. Saved Final becomes stale when its
inputsRevision differs from the current inputs. Apply is blocked while any
scenario has unsaved drafts.
Save and apply
Cell edit → computationDrafts → local calculate preview Save column → scenario command → flush → saved inputsRevision increases Apply Final Results → apply_final command → selectFinal(saved review) calculate Eligibility and populated examiner columns choose examiner benefit closest to Eligibility; tie goes to Comp I copy inputs, combine income, store result and errorCents
The server repeats selectFinal; the client cannot supply a final allotment.
If no examiner column is populated, selection fails. Draft synchronization keeps edits
made while a column save is in flight. Column Reset discards that column’s local draft;
section Clear/Reset is a different workspace operation.
Money and comparisons
Stored money is integer cents. Dollar input parsing and display live in helpers;
calculation rounding belongs to the program implementation. Positive
errorCents = Eligibility benefit − examiner benefit means overissuance,
negative means underissuance. The reportable threshold comes from the bound policy.
Income grid alignment and discrepancy pairing have different jobs: alignment arranges source rows across columns; discrepancy analysis measures a changed input’s benefit effect. The split shows up to six differences and is not additive because benefit formulas interact. Both difference highlighting and split calculation are optional.
When changing the grid
Preserve column draft/save boundaries, stale Final display, and locked-role behavior. For math changes, edit the program function and version handling, then test the grid integration. A successfully saved scenario can still produce a calculation warning; scenario persistence is not itself Apply Final Results.