mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-10 20:27:11 +01:00
`_local_credential_log` fell back to the hand-written `kuchnia_credentials` and used its **mtime** as the edit clock. That clock is not trustworthy: `git checkout`, a backup restore, and re-running the `install -m 600` setup line all bump it forward without the credential changing. Reproduced before fixing: a PC whose file had merely been touched, syncing against a phone that had set a new password an hour earlier, resolved to the PC's stale password. The phone user would have seen their edit silently revert. The bootstrap is still needed -- someone has to publish first, and the PC is where the password is typed -- so it moves to `_bootstrap_credential_log` and runs only when the merge came back completely empty. It can no longer outrank a real edit from a peer; it can only fill a vacuum. Once anything has been published, the synced cache (which carries a real edit time) takes over permanently. `test_a_touched_handwritten_file_cannot_clobber_a_peer` pins it, and was checked against the pre-fix code: reintroducing the fallback fails it. Also rewrites the two remaining places that still claimed a credential "must never leave the machine it was entered on" -- `_constants.py`'s comment and the doc's Credentials section, which now has a table of which of the three files syncs and which does not. Rewritten rather than given an exception clause. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QQpCiPaSbyRpwsLkH3dgsX |
||
|---|---|---|
| .. | ||
| explanations | ||
| design.md | ||
| flutter-rules-design.md | ||
| flutter-rules-language.md | ||
| flutter-rules-state-and-data.md | ||
| flutter-rules-testing-and-assets.md | ||
| flutter-rules-ui.md | ||
| kuchnia-wikinga.md | ||
| meal-schedule.md | ||
| sync-latency.md | ||