_reanalyze で nav / messenger を async gap 前にキャプチャするよう移動。
showDialog の context 引数を ignore 対象行に統合。
dart analyze: No issues found
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SakeAnalysisResult.isFromCache flag added (not serialized to JSON)
- Both cache-hit paths return result.asCached() to signal caller
- camera_screen: EXP +10 only awarded on fresh API calls, not cache hits
- camera_screen: show '解析済みの結果を使用(経験値なし)' on cache hit
- camera_screen: clear _capturedImages after successful analysis
- camera_screen: catch(_) -> catch(e) with debugPrint logging
- SakeAnalysisResult.fromJson: auto-fill missing tasteStats keys with 3,
clamp all values to 1-5 range to prevent broken charts
- Bump version 1.0.37+44 -> 1.0.38+45
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- name, brand, prefecture: still OCR-strict (no completion/inference)
- alcoholContent, polishingRatio, tasteStats etc: restored from label + sake knowledge
- Overly strict 'no knowledge at all' rule was causing all detail specs to return null
- Sync fallback prompt with same policy
- Bump version 1.0.36+43 -> 1.0.37+44
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rewrote prompt: 'ソムリエ' role -> pure OCR system role
- Explicit prohibition on brand name completion/correction
(e.g. label shows 東魁 -> output 東魁, never 東魁盛)
- prefecture: output null if not written on label; inference from brand knowledge forbidden
- tasteStats: default to mid-value 3 instead of 'reasonable estimate' (was encouraging hallucination)
- Added concrete examples for white-deer, kubota, tokai cases
- Bumped version 1.0.35+42 -> 1.0.36+43
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
secrets.dart: change AI_PROXY_URL defaultValue from 'http://100.76.7.3:8080'
to empty string. Consumer APKs use useProxy=false and never reach this code
path, so there is zero functional impact. Internal network topology is no
longer embedded in distributed binaries.
Made-with: Cursor
Analysis cache redesign:
- Remove Hive persistence from AnalysisCacheService entirely
- Use Map<String, SakeAnalysisResult> in-memory instead of Hive boxes
- Cache now lives only for the duration of an app session; restart always
produces a fresh analysis — no stale misidentifications can persist
- Remove Hive init(), TTL/cleanupExpired(), getCachedByBrand() dead code
- API surface unchanged: callers (gemini_service, dev_menu) need no edits
- main.dart: delete legacy Hive boxes (analysis_cache_v1, brand_index_v1)
from disk on startup for existing users
- dev_menu_screen: update cache description text to reflect new behavior
Rationale:
- Camera captures always produce unique files -> cache hit rate was ~0%
- Each user supplies their own Gemini API key -> no shared cost benefit
- Persistent wrong results (e.g. misrecognized brand names) could survive
up to 30 days under the old design
- Different sake editions photographed separately have different hashes
and were never affected by the cache in the first place
Made-with: Cursor
- draft_service: GeminiService is now passed as a required parameter
to analyzeDraft/analyzeAllDrafts instead of being directly instantiated,
ensuring consistent Riverpod-managed injection
- gemini_provider: correct misleading comment (rate limiting is due to
static field, not Provider; Provider enables future safe refactoring)
- analysis_cache_service: cleanupExpired now also removes orphaned brand
index entries from _brandIndexBox after deleting expired _box entries
- analysis_cache_service: keysToDelete type corrected from List<dynamic>
to List<String>, removing unnecessary as String cast
- analysis_cache_service: _normalizeBrandName comment clarified to note
that .toLowerCase() only affects ASCII characters, not Japanese text
- camera_screen: add explicit ignore comment with rationale for
showDialog after async gap (mounted check immediately precedes it)
- camera_screen: remove leaked Cursor instruction comment from line 96
Made-with: Cursor
When API congestion persists after 3 retries + fallback:
- Mark exception with [CONGESTION] tag
- camera_screen catches it and calls DraftService.saveDraft()
- Shows orange snackbar (same UX as offline) instead of red error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Retry up to 3 times with exponential backoff on 503/UNAVAILABLE
- Fall back to gemini-2.0-flash on final attempt
- Replace raw JSON error with user-friendly Japanese message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- sake_detail_screen: hide SakeMbtiStampSection when isProVersion=false
(consumer APK no longer shows Pro版限定 placeholder at card bottom)
- sake_grid_item / sake_list_item: apply Pressable to actual tap targets
(grid/list cards now animate on press instead of non-interactive LevelTitleCard)
- soul_screen / sommelier_screen: ambient glow alpha 0.07→0.12 for visibility
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A-1 Micro-animation: Pressable wrapper widget (AnimatedScale 0.97 on tap)
applied to LevelTitleCard
A-2 Bold Typography: LevelTitleCard title font 28→36px, 現在の称号 label
demoted to bodySmall for stronger visual contrast
A-3 Ambient Glow: RadialGradient circle behind My Page (top-left, brandPrimary)
and Sommelier screen (top-right, brandAccent) via Stack + IgnorePointer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
My Page:
- LevelTitleCard: show nickname above title when set
- Add section header 成長記録 above gamification widgets
- Split profile card: basic info (nickname/gender) and sake character
(MBTI/sake persona) are now separate named sections
Sommelier:
- Add section headers テイストプロフィール / MBTI風診断 / さけのわ おすすめ
- Widen share button to full width with rounded rect shape
- Remove Dividers between sections, use SizedBox(32) spacing instead
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- soul_screen.dart: pass showBusinessMode: isBusinessApp to OtherSettingsSection
so the toggle is hidden when built with IS_BUSINESS_APP=false
- build_4_apks.sh: rewrite for current strategy (consumer/business x maita/eiji)
Pro variants removed; set_lite_app_id() restores gradle before each build
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove Phase X / Phase D labels from inline comments and imports
- Remove debugPrint calls from CustomPainter.paint() (called every frame)
- Remove commented-out locale entries (fr, de) from main.dart and language_selector
- Remove version header comments (v1.5 etc.) not needed in source
No logic changes. flutter analyze: No issues found.
Change default behavior from Proxy mode to Direct API mode:
- useProxy defaultValue: true -> false
- General distribution: Users provide their own Gemini API key
- Development with Proxy: Use --dart-define=USE_PROXY=true
Rationale:
- Proxy mode requires Tailscale connection (not suitable for public distribution)
- Direct API mode works anywhere with internet connection
- Each user manages their own API quota
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Infrastructure Improvements:
- Add Redis container to tools/proxy/docker-compose.yml with AOF persistence
- Migrate rate limiting from in-memory to Redis-based storage
- Add TTL-based daily quota reset (expires at midnight)
- Implement health checks for Redis and Proxy containers
Proxy Server Changes (tools/proxy/server.js):
- Add redis client with async connection handling
- Replace usageStore object with Redis GET/INCR/EXPIRE operations
- Add responseMimeType: 'application/json' to Gemini client config
(fixes Markdown response bug)
- Add comprehensive debug logging for JSON parsing issues
Flutter App Configuration:
- Change Secrets.useProxy defaultValue from false to true
- Development builds now use local Synology proxy by default
- Release builds can override with --dart-define=USE_PROXY=false
Documentation:
- Add REDIS_MIGRATION_GUIDE.md with step-by-step migration instructions
- Add tools/proxy/README.md with architecture overview
- Create .env.example template for secrets configuration
- Update PROJECT_TODO.md to mark H3 (Proxy永続化) as in progress
Dependencies:
- Add redis@^4.7.0 to package.json
This resolves the critical tech debt where rate limits reset on container restart.
Redis AOF persistence ensures quota tracking survives server reboots.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>