Repository navigation
Data correctness: real backups, empty-lane detection, habits race, and honest docs - #37
Merged
Merged
Conversation
…er overwrite one another, and are pruned to five
… raising MissingGreenlet
…ng error, not 'up to date'
…er fails a completed call
…s all SQLite does
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 correctness/data findings from the whole-project review. One commit each, each with a regression test that fails on
main.The
.bakwas not a backup (HIGH). One fixed<db>.bakwas rewritten at the top of every upgrade, so a no-opdb migratereplaced the snapshot, and a crash-restart after a bad partial migration overwrote the only good copy with the half-migrated state. Now:<db>.bak-<UTC timestamp>, and the newest five are kept;upgrade_databasetakes one backup per run instead of one per tier;Restart=always/RestartSec=5against a migration that always fails takes a backup every 5s, and the prune deletes the clean copy within ~25s. While anything is pending the startup gate refuses to run, so an unchanged migration state means an unchanged database. A crash loop now leaves at most two backups: the clean one, plus one half-migrated copy if a revision did apply.README covers the backup location, the retention, and how to restore; both
.gitignores match the new names.A suite lane resolving to no revisions raised nothing and read as "up to date". Every shipped suite lane has revisions, so an empty one is a packaging error: it now raises, naming the app and the directory, and doctor and the startup gate surface it.
habits.tick_habit's race backstop raisedMissingGreenletbecause rollback expiredhabit.name. The name is now read before thetry.app.db()read isolation is documented, not changed. Reads are autocommit under pysqlite; the docstring and README now say so and show the atomic-UPDATE / unique-constraint alternatives. I audited the three suite apps' read-modify-writes and all are safe: idempotent writes, deletes of immutable rows, or the unique-constraint backstop.llm/client.pynow catchesSQLAlchemyErrorlike its siblings, so a shutdown-raceInterfaceErrorno longer fails a completed call.search_notesnow says its case-insensitivity is ASCII-only, which is all SQLite'sLIKEdoes. Folding in Python would mean an unbounded scan, since the query has noLIMIT.Fast suite: 1134 passed locally; ruff check and format --check clean.