# PIXIESPROUT HANDOFF — 2026-08-07 (evening) — USB DEBUGGING SESSION

## STATUS: APK has the fixes, but phone shows NONE of them. Root cause UNKNOWN — needs device-side diagnosis.

## THE PUZZLE (verified on server, live)
- Source code HAS all fixes (IdentifyScreen.tsx multi-photo flow, SettingsPanel.tsx care-prefs chips)
- APK bundle HAS the fix strings ("Analyze together", "Organic-first", "Pet-safe caution", etc.)
- Phone reports running 1.0.112 (versionCode 138)
- OTA server has NO 1.0.112 update (manifest returns "No uploads found" for 1.0.112)
- => A 1.0.112 app CANNOT load an OTA; it must run its embedded bundle, which has the fixes
- YET phone shows NONE of the fixes. Contradiction. Cannot be resolved from server.

## KEY DIAGNOSTIC FINDING (this session)
- The generated bundle md5 is BYTE-IDENTICAL (739026dd372be4143e2d847e1b751bb3) across every build,
  even after `gradlew clean` AND clearing /tmp/metro-cache. The bundler is serving a fixed result.
- BUT: string-literal checks show the bundle DOES contain new-code strings ("Analyze together"=1,
  "What are you noticing"=1, "Organic-first"=1, "Pet-safe caution"=1, "DIY-first"=1, "Store-bought"=1).
- Variable names like `problemScanStep` show 0 in bundle because Hermes bytecode MINIFIES variable names.
  Do NOT use variable names as bundle markers — use STRING LITERALS only.
- "Take Photo"/"Choose Photo"/"Add another photo" = 0 in bundle, but those strings only exist in a
  COMMENT in source (line 301), not as actual UI labels. The real + button uses a "+" glyph. So 0 is expected.

## WHAT'S NEEDED (tomorrow morning, with Dana)
1. Phone: enable Developer Options (tap Build number 7x), enable USB debugging, plug into computer
2. adb is INSTALLED on this machine at:
   C:\Users\danam\AppData\Local\Microsoft\WinGet\Packages\Google.PlatformTools_Microsoft.Winget.Source_8wekyb3d8bbwe\platform-tools\adb.exe
3. Once connected, run:
   - adb devices (confirm device)
   - adb shell pm list packages | grep -i pixie (find package: com.danaman123.leafylanedemo)
   - adb shell dumpsys package com.danaman123.leafylanedemo | grep -E "versionCode|versionName|lastUpdateTime"
   - adb pull the installed APK: adb shell pm path com.danaman123.leafylanedemo -> pull base.apk
   - Check the pulled APK's bundle for string markers (grep -a "Analyze together")
   - Inspect expo-updates cache: adb shell run-as com.danaman123.leafylanedemo ls (or /data/data/.../files)
   - adb logcat | grep -iE "expo|updates|ReactNative|bundle" (see what loads at startup)

## HYPOTHESES TO TEST
A) Device is serving a STALE CACHED OTA from an older install (most likely) — expo-updates cache
   holds an old bundle and serves it instead of the embedded one. Fix: clear app data OR uninstall+reinstall.
B) The APK didn't actually replace the old one (install failed silently / wrong APK). Check lastUpdateTime.
C) The fixes don't change what Bekky is looking at (e.g., multi-photo UI only at a specific step).

## BUILD STATE (UPDATED — build HUNG, killed)
- The clean rebuild (gradlew clean + build-and-sign.sh, Metro cache cleared) started 14:01 UTC.
  It HUNG — ran 48 min, APK output dir not updated since 14:04 (last normal build = 3m33s). Killed 14:49.
- Stuck gradle wrapper PID killed server-side. Do NOT blindly retry this build — it's not the fix.
- The APK Bekky already has (pixiesprout-1.0.112-arm64.apk) contains the fixes in its bundle.
  The problem is DEVICE-SIDE (phone not showing fixes), not the build. Focus on USB debug, not rebuilds.
- APK output: /root/sgt_code_workspace/PixieSprout/android/app/build/outputs/apk/release/app-release.apk
- File server copy: /opt/fileserver/files/pixy/VoiceFlow/pixiesprout-1.0.112-arm64.apk
- Backup of pre-rebuild APK: pixiesprout-1.0.112-arm64.apk.bak-20260807_pre-cleanrebuild
- Share link (from earlier, may be stale): https://files.46-4-121-190.sslip.io/s/Le5ZdrZeiUkhDNMY2fzstPXk_NqsRvMO43N7LiVde4k

## DATA SAFETY
- Bekky has NOT cleared data (good). Do NOT recommend clearing data until device diagnosis confirms it's needed.
- Export is currently broken on her phone (one of the fixes she can't see). Once fixes load, export should work.
- APK installs over the top with same keystore — data preserved.

## SERVER ACCESS
- ssh root@46.4.121.190 (sgt-germany)
- Project: /root/sgt_code_workspace/PixieSprout
- OTA server: expo-ota-api container, port 4300, mongo creds in /opt/expo-ota/mongoinit/init.js
- File server: /opt/fileserver, share API via https://files.46-4-121-190.sslip.io/api/share/create
