diet-guard/app/pubspec.yaml
Krzysztof kuhy Rudnicki 642467dc1d Add the Claude relay worker
python -m diet_guard claude-worker serves the phone's meal requests from
RTDB (rtdb_relay RequestServer, one SSE stream, reconnects with backoff):
validate, estimate with Claude, log through the signed log with
source=claude under the oldest due slot (normal mode: nearest slot of the
phone's hint), write the sealed result, delete only the request payload,
then publish in the background. diet-guard-claude.service (Restart=on-failure,
WantedBy=default.target) is installed by install.sh and started once the
worker's own Firebase session exists. Nothing is deployed by this commit.

Failure paths:
- narrow peer pull fails (sync locked/unreachable): fail closed, no claim, no
  answer, no model call; the request stays pending, retried every 30 s
- e2e key locked, no passphrase, no session: fail closed, nothing read or
  written; the worker waits and retries every 60 s
- bad body, request older than 24 h (or no created): fail closed, an error
  result, nothing logged
- Claude failure/timeout/invalid JSON: fail closed, an error result with
  retry, nothing logged
- crash between log and result, or a duplicate event: idempotent, the entry
  id is uuid5 of the rid and is looked up (tombstones included) before the
  model call
- request payload delete, old-answer cleanup and the post-answer publish
  failing: fail open on purpose (logged only); the answer and the local
  entry are already durable
- due mode with nothing due: falls back to slot_for_log, not an error

New log helpers log_meal_as / find_entry; log_meal's body is split into
_entry_fields / _store_entry with the same output. The gate and CLI import
none of the worker's dependencies at load time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZHWP4KZ6x5TcXDBFC
2026-11-17 21:15:08 +01:00

102 lines
3.0 KiB
YAML

name: diet_guard_app
description: "Companion phone app for diet_guard: log meals on the go."
publish_to: 'none'
version: 1.0.168+1
environment:
sdk: ^3.12.2
dependencies:
audioplayers: 6.8.1
crdt_sync:
git:
url: https://github.com/kuhyx/utils
ref: crdt_sync_dart-v0.14.1
path: crdt_sync_dart
# Keystore-backed end-to-end encryption open + the passphrase lock button.
crdt_sync_flutter:
git:
url: https://github.com/kuhyx/utils
ref: crdt_sync_flutter-v0.8.2
path: crdt_sync_flutter
crypto: 3.0.8
cryptography: 2.9.0
# Export/import file plumbing (Save-as picker, open picker), shared.
data_transfer_flutter:
git:
url: https://github.com/kuhyx/utils
ref: data_transfer_flutter-v0.2.2
path: data_transfer_flutter
fl_chart: 1.3.1
flutter:
sdk: flutter
flutter_local_notifications: 23.0.2
flutter_secure_storage: 11.2.0
# One-tap sign-in for the sync account. App-side only: crdt_sync stays pure
# Dart so it keeps working on Linux desktop and headless.
github_device_auth:
git:
url: https://github.com/kuhyx/utils
ref: github_device_auth-v0.5.0
path: github_device_auth
# One-tap Google ID token via the framework AccountManager chooser (FOSS).
google_account_token:
git:
url: https://github.com/kuhyx/utils
ref: google_account_token-v0.1.0
path: google_account_token
health: 13.3.2
http: 1.6.0
idb_shim: 2.11.3
material_ui: 1.11.0
path: 1.9.1
path_provider: 2.1.6
permission_handler: 13.0.2
shared_preferences: 2.5.6
# Shared "Sync settings" screen (Firebase + optional local backup), reused
# across every kuhy app that syncs. GitHub mirror stays app-local (see
# lib/screens/github_mirror_screen.dart) since connecting it here also
# triggers a real log sync, not just a settings save.
sync_settings_ui:
git:
url: https://github.com/kuhyx/utils
ref: sync_settings_ui-v0.8.2
path: sync_settings_ui
url_launcher: 6.3.3
uuid: 4.6.0
web: 1.1.2
workmanager: 0.10.10
dev_dependencies:
# Generates the Android launcher icons from assets/icon/ (see
# python_pkg/app_icons in testsAndMisc for the shared style).
flutter_launcher_icons: 0.14.4
flutter_test:
sdk: flutter
# Exact-pinned like every other dependency: `any` is the one constraint a
# freshness check cannot compare against anything.
plugin_platform_interface: 2.1.8
url_launcher_platform_interface: 2.3.2
very_good_analysis: ^11.0.0
flutter:
uses-material-design: true
assets:
- assets/sounds/log_confirm.ogg
# Launcher icon generation. Source art is produced by the shared generator:
# PYTHONPATH=~/src/testsAndMisc python3 -m python_pkg.app_icons generate --app <key>
# then run: dart run flutter_launcher_icons
flutter_launcher_icons:
android: true
ios: false
image_path: "assets/icon/icon.png"
adaptive_icon_background: "#211D1B"
adaptive_icon_foreground: "assets/icon/icon_foreground.png"
adaptive_icon_monochrome: "assets/icon/icon_monochrome.png"
min_sdk_android: 21