Blame
|
1 | --- |
||||||
| 2 | title: Engineering Ops |
|||||||
| 3 | aliases: [Build & Deploy, Tech Debt] |
|||||||
| 4 | tags: [3netra/wiki, devops, build, tech-debt] |
|||||||
| 5 | product: 3netra Meta Android App |
|||||||
| 6 | source_repository: 3Netra-ai/3n_meta_android |
|||||||
| 7 | source_ref: origin/prod |
|||||||
| 8 | source_revision: b48aada8fd5427b5db0c02945569963c4ae543c8 |
|||||||
| 9 | last_verified: 2026-08-06 |
|||||||
| 10 | up: "[[Home]]" |
|||||||
| 11 | --- |
|||||||
| 12 | ||||||||
| 13 | # Engineering Ops |
|||||||
| 14 | ||||||||
| 15 | ## Build & Run (native app) |
|||||||
| 16 | ||||||||
| 17 | ```bash |
|||||||
| 18 | cd src/frontend |
|||||||
| 19 | # needs: JDK 17 (Android Studio bundled JBR), unset ANDROID_PREFS_ROOT |
|||||||
| 20 | # env: GITHUB_ACTOR + GITHUB_TOKEN (Meta SDK Maven) |
|||||||
| 21 | # local.properties: sdk.dir, SUPABASE_URL, SUPABASE_ANON_KEY, |
|||||||
| 22 | # SARVAM_API_KEY, GOOGLE_WEB_CLIENT_ID, AWS_BACKEND_URL |
|||||||
| 23 | ./gradlew installDebug # physical device required (BLE + Meta SDK) |
|||||||
| 24 | ``` |
|||||||
| 25 | ||||||||
| 26 | - `app/build.gradle` also defines client BuildConfig fields for an OpenAI key and Meta credentials. Do not put server secrets in this app; source contains committed fallback Meta values that need rotation/removal. |
|||||||
| 27 | - Unit tests: `./gradlew testDebugUnitTest` · Instrumented command: `./gradlew connectedDebugAndroidTest`. At the audited ref there are only two weak JVM tests; no instrumented tests were found. |
|||||||
| 28 | - CI: `.github/workflows/android-build.yml` runs only on pushes to `prod`, writes secrets to `local.properties`, builds a **debug** APK, and uploads it. It does not run tests or lint. |
|||||||
| 29 | - Deploy runbook: `skills/prod-local-deploy` — 8-phase diagnose/build/install/verify against device **VortexJK68** (prod branch) |
|||||||
| 30 | ||||||||
| 31 | ## Backend Deploys |
|||||||
| 32 | ||||||||
| 33 | - **AWS SAM:** `src/backend/` has a Lambda prototype, but active Android callers use the Supabase Edge Function. Its workflow triggers only from `main` (not `prod`) and supplies only Supabase parameters even though the template requires an OpenAI parameter; deployment is not verified. |
|||||||
| 34 | - **Supabase:** local dev config identifies project `3nApp-Mobile`; no migrations or seed are committed, and `schema_paths` is empty. Version schema and policies before treating it as deployable. |
|||||||
| 35 | - **Legacy:** Firebase Functions (`npm run deploy` in `functions/`), Vercel (`api/`) |
|||||||
| 36 | ||||||||
| 37 | ## Documentation reliability at the audited revision |
|||||||
| 38 | ||||||||
| 39 | - `README.md` contains unresolved merge-conflict markers and retains K–6 positioning. |
|||||||
| 40 | - `docs/BUILD_AND_DEPLOY.md` describes the obsolete Expo/root `android/` route and a stale configuration key; it is not a runnable guide for the maintained `src/frontend` app. |
|||||||
| 41 | - `docs/TESTING.md` describes PR test/lint behavior that `.github/workflows/android-build.yml` does not implement. |
|||||||
| 42 | - Treat active build files, source, the two test files, and workflow YAML as implementation evidence; treat the remaining docs and PRD as historical/roadmap material until reconciled. |
|||||||
| 43 | ||||||||
| 44 | ## Version History (CHANGELOG) |
|||||||
| 45 | ||||||||
| 46 | | Date | Change | |
|||||||
| 47 | |---|---| |
|||||||
| 48 | | 2026-07-01–2026-08-03 | Historical `CHANGELOG`/documentation entries; not independently verified as end-to-end delivery | |
|||||||
| 49 | | 2026-08-05 | Audited merge PR #11 cleanup (`b48aada8…`); source still contains the fixed AI-response defect and stale documentation | |
|||||||
| 50 | ||||||||
| 51 | ## Known Quirks & Tech Debt (verified in code) |
|||||||
| 52 | ||||||||
| 53 | 1. **Critical:** `SupabaseAiService` invokes `chat-vision` but replaces the returned message with a fixed success string. Scene, chat, and lecture-summary flows cannot supply a verified model answer. |
|||||||
| 54 | 2. `dashboard` route orphaned — `glassesConfig`/`chatHistory` unreachable in normal flow |
|||||||
| 55 | 2. `StudentOnboardingWizard` (voice calibration, emergency contact, battery saver) built but **not wired** into navigation |
|||||||
| 56 | 3. `SettingsScreen.kt` lives in `ui/` but declares package `ui.student` |
|||||||
| 57 | 4. "Classroom" is a valid scene mode but missing from the mode-chip list; falls through to generic scene prompt |
|||||||
| 58 | 5. `SceneDescriptionScreen.gradeLevel` never passed → always "3rd Grade" (pitch 1.1) |
|||||||
| 59 | 6. ClassmatesScreen shows hardcoded "92% confidence"; KDoc describes AWS Rekognition/3-photo flow that differs from implementation |
|||||||
| 60 | 7. AssistantChatScreen: camera-capture launchers wired but no camera button rendered |
|||||||
| 61 | 8. My Story + Chat share one `chatHistory` StateFlow; story timestamps approximated at render |
|||||||
| 62 | 9. SOS: no trigger wired; GPS + recent-summaries are TODO stubs; emergency contact not persisted |
|||||||
| 63 | 10. Wake-word service removed; `WHAT_DO_I_SEE`/`CLASSROOM_MODE` broadcasts have no broadcaster |
|||||||
| 64 | 11. Meta SDK fallback credentials are committed in `src/frontend/app/build.gradle` — rotate + remove defaults; no values are reproduced here |
|||||||
| 65 | 12. Ollama endpoint hardcoded to LAN IP `192.168.0.179` (dev-only service) |
|||||||
| 66 | 13. `OPENAI_API_KEY` BuildConfig is defined but unused client-side; ML Kit dependency unused |
|||||||
| 67 | 14. No Supabase migrations/seed committed; RLS policies not in repo |
|||||||
| 68 | 15. Two Android codebases (native vs Expo/RN shell); RN tree unbuildable (missing JS sources) |
|||||||
| 69 | 16. Teacher PIN is local-only — needs backend role for real multi-device teacher access |
|||||||
| 70 | ||||||||
| 71 | See the severity-ranked register in [[12-Risks-Decisions]]. |
|||||||
| 72 | ||||||||
| 73 | ## Security Notes |
|||||||
| 74 | ||||||||
| 75 | - Never log/commit API keys; `local.properties` is gitignored (but Meta tokens in strings.xml are committed — flag) |
|||||||
| 76 | - Active face flow uses Supabase cloud embeddings; the encrypted 90-day utility is unreferenced. |
|||||||
| 77 | - Active AI traffic uses the Supabase Edge Function, not the Lambda. Keep provider credentials server-side and rotate/remove committed or app-compiled secrets. |
|||||||
| 78 | ||||||||
| 79 | ## Repo Agent Tooling |
|||||||
| 80 | ||||||||
| 81 | - `skills/` synced to `.claude/.gemini/.codex/.openrouter` via `sync_skills.sh` |
|||||||
| 82 | - Installed skill: `supabase` (best practices); project skills: `prod-local-deploy`, `threenetra-vlm-providers` (how to add VLM providers), `sync-agent-skills` |
|||||||
| 83 | - Agent pointers: `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` |
|||||||
| 84 | ||||||||
| 85 | ## Key People & Sources |
|||||||
| 86 | ||||||||
| 87 | - Dev log: Mayukh (Supabase migration, schema design, Phase 5) |
|||||||
| 88 | - Org docs: PRD v1.0 (Feb 2026, `.agent_docs/Assets/`), `docs/` 16-file suite, JIRA AI-chat story (13 pts) — see [[13-Source-Map-Glossary]] |
|||||||
| 89 | ||||||||
| 90 | --- |
|||||||
| 91 | ||||||||
| 92 | > [!tip] Navigation |
|||||||
| 93 | > ⬅️ [[09-Design-System|Design System]] · 🏠 [[Home]] · ➡️ [[11-Security-Privacy-Compliance|Security, Privacy & Compliance]] |
|||||||
