Skip to content

fix(scanner): preserve review when correcting the sheet week - #15

Merged
davidvornholt merged 1 commit into
mainfrom
fix/preserve-review-on-week-correction
Sep 13, 2026
Merged

fix(scanner): preserve review when correcting the sheet week#15
davidvornholt merged 1 commit into
mainfrom
fix/preserve-review-on-week-correction

Conversation

@davidvornholt

@davidvornholt davidvornholt commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Before. Correcting an unreadable printed week hid all recognized homework and forced another AI analysis. This discarded review edits and made it unnecessarily difficult to save a scan.

Now. Enter the week and choose “Use this week” while keeping recognized entries and edits visible. PaperSync rechecks saved homework for that week without another AI call; failed requests leave the review available for retry.

Implementation

The authenticated action validates the week and entries and only reads saved homework. Saving stays disabled until the selected week has been applied. Duplicate status is recalculated for the new week while preserving entry IDs, text, completion state, and due dates. Dates remain editable and are deliberately preserved because recognition does not record whether each deadline was an absolute date or relative wording; the UI asks the reviewer to check them against the paper.

Screenshots

Same demo scan and text correction after entering 2026-W37, at 1280×800. Before renders main 757da41; after renders this change. The former review disappears; the updated review stays visible beside “Use this week.”

Before After
papersync-week-correction-before papersync-week-correction-after

Verification

Completed checks

  • bun run check:fix at standalone head 1fda556: all 25 tasks passed in 22.011 seconds.
  • Browser regression preserves text, completion, and a manually corrected date through partial-year typing, failed application, and retry, with no additional model requests.
  • Isolated database integration checks duplicate status across weeks, preserved edits, invalid input, and absence of early queue writes.

Check it yourself

Run gh pr checkout fix/preserve-review-on-week-correction, start the app with bun run dev:web, and analyze a sheet whose week is unreadable. Edit an entry, enter its week, and choose “Use this week.” The edit stays visible and saving becomes available without reanalysis.

@davidvornholt

Copy link
Copy Markdown
Owner Author

Review-fix scope: preserve recognized entries and edits while correcting the printed week, recheck saved homework for the applied week without another model call, and prevent saving before application succeeds. Dates remain visible and editable; recognition currently has no absolute/relative deadline provenance, so changing the week preserves dates and asks for review instead of guessing a shift.

Threat model: authenticated daily scan review, partial native week-input edits, duplicate status when moving between weeks, failed requests and retry, and stale responses. No schema migration, new OCR contract, or model-prompt redesign is included.

Astra high will run separate read-only lenses: (1) behavior and invariants, owning browser state, preservation of edits, stale responses, failure/retry, and save gating; (2) premise and integration, owning the authenticated action, input validation, database reconciliation/no early writes, accessibility and architecture, excluding browser race analysis.

Baseline: bun run check:fix passed all 25 tasks at initial head 1fda556 in 22.011 seconds. Base is 757da41. This comment starts the bounded review-fix cycle. Merge and deployment are already authorized by the user if the results support them.

@davidvornholt

Copy link
Copy Markdown
Owner Author
Phase Scope Model / lenses Findings Outcome Duration
Baseline gate 1fda556 deterministic 25 tasks passed 22.011 s
Review 757da411fda556 Astra high × 2 0 block, 0 ask, 0 defer clean 227 s
Fix verification no fix delta skipped; no blockers 0 s
Repair verification no repair delta skipped 0 s
Final gate unchanged 1fda556 deterministic exact-head local gate reused; CI quality, check, and container smoke passed reused

Both required lenses completed. Behavior covered preservation, partial typing, save gating, failure/retry, and stale responses. Premise/integration covered authentication, runtime input validation, SELECT-only reconciliation, IDs and edited wording, notes, accessibility, and dependency boundaries. Lens yield: 0 blockers from 2 lenses.

Discarded concerns: the rendered controls prevent changing the week during application, and clear/upload reset busy state; duplicate actions are reset before reclassification; due dates deliberately remain editable and unchanged because recognition lacks relative/absolute provenance, with persistent copy explaining the review requirement. No automatic date shift is claimed.

Extended the existing browser and database tests without new test machinery. Focused database review passed 1 test and 6 assertions; an initial reviewer command omitted .env.local and failed configuration loading, then passed with the documented environment. All final checks passed. No deferred work or unreviewed repair remains. Total review-cycle wall time: 227 seconds. Merge/deployment may proceed under the user's existing authorization once the companion exception repair is ready.

@davidvornholt
davidvornholt marked this pull request as ready for review September 13, 2026 11:59
@davidvornholt
davidvornholt merged commit 30ae8b1 into main Sep 13, 2026
7 checks passed
@davidvornholt
davidvornholt deleted the fix/preserve-review-on-week-correction branch September 13, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant