f71d132fa3
[03-Developer] #218 Dev round 2 — AC-6 RAM 4GB gate + AC-10 docs cleanup
...
QA round 1 (commit 9a9eb2a ) FAIL 시 누락된 두 AC 보강.
AC-6: device_info_plus 만으론 4GB 임계 측정 불가 (isLowRamDevice 는
~1GB 기준). MethodChannel `life_helper/device_caps` 신설 + MainActivity.kt
에서 ActivityManager.MemoryInfo.totalMem 노출. data/ai/device_capabilities.dart
는 DeviceCapabilities abstract + PlatformDeviceCapabilities + 4 GiB
임계. deviceMeetsAiRamProvider (FutureProvider<bool>, fail-closed).
SettingsScreen 토글 disabled + "RAM 부족" 안내 (RAM < 4GB).
AC-10: docs/reference/215-ai-frame-suggest.md 의 OQ-1/placeholder
6곳을 실 구현 표현으로 갱신. §8 알려진 제약 = AC-6 device gate +
AC-7 실 단말 E2E + F1 unload + #221 corpus 평가. §9 다음 단계 =
#219~#222 follow-up 목록. 신규 테스트 합계 41 / 전체 88 통과.
테스트: device_capabilities_test.dart 7 신규 (kAiMinRamBytes 동등,
null/0/3.9GB/4GB-1/4GB/8GB 경계). flutter analyze 무이슈, 전체 88 통과
(71 기존 + 10 gemma + 7 RAM gate).
Architect 설계서 §4 의 "RAM 4GB 차단 = AC-9 재활용" 문구는 사실 #215
미구현 사항이라 본 라운드에서 신규 추가했음을 README 에 명기.
Refs #218
2026-06-12 15:45:14 +09:00
9a9eb2abd5
[Developer] #218 Real Gemma 4 E2B integration via flutter_gemma 0.16.5
...
Implements the OQ-1 follow-up to #215 v0.2.0: replace the placeholder
GemmaLlmService stub with a real flutter_gemma 0.16.5 backend driving
Gemma 4 E2B (litert-community/gemma-4-E2B-it-litert-lm, 2.41GB).
Highlights:
- GemmaLlmService.load → FlutterGemma.initialize + installModel.fromFile +
getActiveModel; idempotent + FileSystemException on missing file.
- generateStructured uses Gemma 4 native function calling via
createChat(tools: [Tool(...)], toolChoice: required). Stream parsed by
collectFunctionCall — first FCR wins, ParallelFCR first-call wins,
TextResponse/ThinkingResponse skipped, errors sanitized to prevent
prompt leakage.
- main.dart wires _LazyLlmService adapter that resolves to GemmaLlmService
when ModelLifecycle reports ready, MockLlmService otherwise.
- ai_providers.dart pins real model URL + SHA-256 (181938...39a63c).
- F2 hardening: ModelLifecycle.purge wraps each delete + meta remove in
try/catch so a single OS-level flake cannot block opt-out.
- Android: INTERNET / FOREGROUND_SERVICE / POST_NOTIFICATIONS permissions
+ R8 proguard-rules.pro keeping MediaPipe / LiteRT / TFLite / protobuf
JNI entry points (release builds otherwise crash on first inference).
Design-First: fn-gemma_llm_service.md updated to v2 — §C
(_appendSchemaInstruction) deprecated after reading flutter_gemma
0.16.5 source (Gemma 4 SDK injects tool declarations via template;
prompt-side append would double-wrap).
Tests:
- 10 new unit tests for collectFunctionCall covering all 8 fn-spec
cases + 2 ParallelFunctionCallResponse paths.
- All 81 existing tests still pass.
- flutter analyze: 0 issues.
Refs #218
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-06-12 15:18:08 +09:00
8fe6a8f378
[Developer] #204 Phase 1 MVP — Flutter app skeleton complete
...
- Drift 21 tables (8 catalog + 11 user + habit_dose_variants + meta_kv)
with R1~R10 CHECK constraints and 19 indexes
- 8 hand-crafted seed JSON catalogs in app/assets/seed/
(refs 84, protocols 34, methodologies 21, frame_patterns 30,
reward_menu_items 30, break_protocols 8, common_frames 5, diet_patterns 5)
- 6 domain functions: recommend_variant, compute_streak,
validate_frame_level, active_habit_quota, weekly_minimum_ratio,
seed_importer (transactional, idempotent)
- 4 vertical-slice Riverpod screens: HabitList, HabitCreate, CheckIn, Streak
- 31 unit tests passing; flutter analyze clean
- OQ-5 streak semantics: missing entry ≠ explicit blank
(missing = end of history; only TrackerValue.blank triggers Never-miss-twice)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-06-12 10:33:03 +09:00