mirror of
https://github.com/kuhyx/diet-guard.git
synced 2026-11-19 05:24:20 +01:00
The narrow pull, the log write and the publish each read, merge and write the food log. Run at once (a publish in flight while a second request logs) they lose the append: the phone is told "logged" and the only copy is gone. The new race test lost an entry before this change (1 of 2) and keeps both after it; the shared temp-file name of the log writer also collided between threads. One asyncio lock now covers the pull, "resolve slot + log" and the publish. A request arriving during a publish waits for it (up to one full tick); the model call stays outside the lock. Also: a test that the relay unlocks the header diet_guard's devices store wrote (same key, a blob sealed by one opens on the other), the skill returns grams 0 for nothing to estimate (parse fails closed, nothing is logged), and the doc's session note is corrected: the pull and publish refresh the gate's session file as the CLI's publish does. Failure paths: a lost append is now impossible in-process (fail closed by waiting); the pull failure, locked key, estimator and cleanup paths are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZHWP4KZ6x5TcXDBFC |
||
|---|---|---|
| .. | ||
| explanations | ||
| DOCS-body.md | ||
| DOCS-claude-relay.md | ||
| DOCS-design.md | ||
| DOCS-flutter-rules-design.md | ||
| DOCS-flutter-rules-language.md | ||
| DOCS-flutter-rules-state-and-data.md | ||
| DOCS-flutter-rules-testing-and-assets.md | ||
| DOCS-flutter-rules-ui.md | ||
| DOCS-kuchnia-wikinga-phone.md | ||
| DOCS-kuchnia-wikinga.md | ||
| DOCS-meal-schedule.md | ||
| DOCS-sick-days.md | ||
| DOCS-sync-latency.md | ||
| DOCS-textgate-keep.md | ||