Expand description
Per-year return_inputs_draft(year, inputs_json, schema_version, parked) side-table — the input form’s
crash-recovery scratch, INVISIBLE to resolve.rs. parked = 1 marks a parked committed return (C-1).
Plan-2 task 1 built the table + low-level row I/O; task 2 added save_draft (the autosave primitive);
task 3 adds load (the read path: draft ⇒ committed ⇒ fresh, with the §6.3 stale split). Every low-level
item now has a non-test caller — set_draft_row/parked_flag via save_draft, and DraftRow/
get_draft_row via load — so none carries a #[allow(dead_code)] any longer.
Structs§
- Stale
Note - The §6.3 fact that
loaddiscarded a stale work-in-progress draft (schemafound— a version this build does not read — vsexpected). Returned ALONGSIDELoadedso the caller can surface it: a store read fn must noteprintln!the note itself, because its only future caller is plan 3’s raw-mode, alternate-screen TUI, where stderr is invisible/screen-corrupting (I-1).pubso plan 3 can render it.
Enums§
- Active
Source - The source the input form is CURRENTLY displaying/editing for
year— the toggle’s read side. - Commit
Outcome - The outcome of a
commitattempt. - Loaded
- The working return for a year, resolved through the §6.1 precedence: a draft shadows the committed row.
Functions§
- active_
source - Which source is active for
year, mirroringresolve.rsprecedence (committed full return, thentax_profile, then neither). - coherence_
clear_ or_ refuse - §6.2 draft-coherence: reconcile that year’s input-form draft with an authoritative committed-row write.
- commit
- Screen
ri, and ONLY if it passes write the committed row and delete the draft (SPEC §5.7). - discard_
parked_ draft - Discard the parked draft for
year— the ‘X’ path (§9A/M-2), the ONLY deleter of aparked = 1row. - draft_
exists - init_
draft_ table - Create the draft side-table if absent. Idempotent; called first by every fn (safe on an older vault).
- load
- Resolve the working return for
year(§6.1 precedence + §6.3 stale split). - park_
to_ profile - Park the committed return for
yearinto its draft (the “switch to tax-profile” toggle — C-1). - save_
draft - Autosave a mid-entry return to the draft table (the input form’s crash-recovery scratch).
- shadows_
profile - Whether a
tax_profileexists foryear— the TUI’s commit-time shadow warning (§9 create-row amendment): committing a full return for a year that also has atax_profileleaves the profile in place but no longer active, so the form warns before writing.