# BONE FLOW #024 Calendar — Data Integrity Candidate v1.0.256

Status: DEVELOPMENT / NOT COMPLETED — user acceptance pending.

## Verified only in Linux Node.js 22.16.0

- Runtime no longer replaces a corrupt existing IndexedDB-hosted SQLite blob with a blank template. The original record remains in IndexedDB when validation fails.
- SQLite runtime writes, restores, and resets roll back temporary in-memory bytes on a failed persist operation.
- Calendar DB save preflight reads the existing dataset without swallowing errors, then compares every persisted voucher ID and its full record content. Changes/deletions must have a *single-voucher scoped* permission supplied by the explicit voucher action.
- Persisted payroll pattern IDs cannot disappear from an ordinary auto-save; explicit user-confirmed removal is separately scoped. The voucher popup also checks references before deleting a payroll pattern.
- Full DB reset is deliberately disabled in this candidate. Restore-from-file is still an explicit destructive action; back up and test on a copy before using it.
- The installer stages replaced #024 database integrity JavaScript under `%LOCALAPPDATA%/BoneFlow/024-db-js-backup` with SHA check; this is a **source-code backup, not a backup of user SQLite records**. It does not overwrite schema/template or #029/#048/#054 Frozen components.
- 121 cumulative Node test files PASS offline; new v256 test includes simulated persistence failure, intentional edit/delete, ID loss, payroll pattern loss, simulated reopen, and corrupt database open.

## Not verified / not complete

- The user's actual SQLite export, IndexedDB entries, and Windows physical browser profile are not present; existing voucher and payroll pattern counts cannot be audited.
- Windows PowerShell 5.1, install.bat, Node.js 24.5.0, Edge, real IndexedDB reloading, PDF import with actual payroll file and user acceptance are NOT VERIFIED.
- Test fixture `test/data/calendar-sqlite-qa.sqlite` is unrelated to the user's saved records: 10 tasks, 0 finance vouchers, 0 payroll patterns.

## Safe next sequence on the Windows machine

1. Do **not** clear Edge website storage, create a new Calendar DB, or run a restore/installer before exporting and preserving the current database.
2. Keep the existing site origin (protocol/host/port) and browser profile unchanged. The storage key is under IndexedDB `boneflow.sqlite.runtime`, with Calendar name `boneflow-calendar-standard` or a managed suffixed name.
3. From the currently working Calendar, download the SQLite backup if available, and copy it to a separate location. Compute and retain its SHA256. Browser `localStorage` user-created general patterns require a separate export/inspection; they are not fully covered by the SQLite blob.
4. On a **copy**, inspect SQLite payload metadata, stored voucher IDs, journal lines, payroll pattern IDs, and compare with the live Calendar. Do not run recovery against the original first.
5. After preserving originals, test this candidate on a separate copy/profile/origin before production installation. Then test import → balanced entry → save → list → reload → reopen; and cancel/delete used-pattern guards.

Never call the above user-machine checks PASS unless they have actually been performed and evidenced.
