feat(mobile+api): KI-Foundation Phase 1 RC2–RC18 — semantic search wireup #445
No reviewers
Labels
No labels
app/archiv
app/einkaufslisten
app/imap-client
app/wissensbasis
arch-answered
arch-question
area/api
area/auth
area/infra
area/mobile
area/shared
area/ui
area/web
portfolio-status
prio/high
prio/low
prio/medium
roadmap/public
size/l
size/m
size/s
size/xl
size/xs
status/blocked
status/needs-info
type/bug
type/chore
type/docs
type/feature
type/idea
type/refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
admin-mrrm/mrrmlabapp!445
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wireup/ai-foundation-phase1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
49 Commits über RC2..RC18 — die on-device semantic-search-Foundation kommt produktreif rüber:
4 Quellen → 1 Chunks extrahiert · 1 indexed · 0 Fehler · embedder: readyin Maestro phase1-indexing-smoke).useCreateList/Update/DeleterufenonSourceChange-Callback imonSuccess. Mobile-Bootstrap fängt das ab und publisht in Shopping-List- und Note-DataSources — Index füllt sich inkrementell.apps/mobile/__tests__/mutation-observer.test.tsxlösen den fragilen Phase2-Maestro-Flow ab. Code-Level-Verkabelung ist damit reproduzierbar geprüft.JwtAuthGuardakzeptiertX-Dev-User: <sub>nur wennNODE_ENV !== 'production'. Mobile sendet den Header automatisch wennauth === null. Stellt die in den Code-Kommentaren dokumentierte Dev-Passthrough-Semantik wieder her — der no-Keycloak-Mobile-Build kann jetzt echte Mutationen gegen dev.api absetzen.Why now
Die Phase2-Validierung der Mutation→Publish→Indexer-Kette war auf dev.api durch 401 blockiert (Backend hat Keycloak, Mobile-Dev hat keinen Token). Mit X-Dev-User + Test-Seam ist beide Lücken geschlossen.
Risk
NODE_ENV !== 'production'-gated, Prod-Deploy bleibt unverändert. 4 Guard-Tests inkl. Prod-Bypass-Blocker.Test plan
deploy-devtriggert → dev.api hat X-Dev-User-Bypass → rc18 APK auf rpi5 installieren → phase2-mutation-observer-smoke (sollte jetzt durchlaufen)Refs #122 KI-Assistent Epic
scripts/maestro-pi.sh rsyncs apps/mobile/.maestro/ to the rpi5 host and runs `maestro test` against the USB-tethered phone — gives us a fast e2e loop during development without going through the Drone Android-emulator pipeline. The wrapper auto-detects which mrrmlab flavor is installed (release `de.mrrm.mrrmlab` vs dev `de.mrrm.mrrmlab.dev`) and passes it through as the APP_ID env var. The three smoke flows now reference `appId: ${APP_ID}` so they work against either flavor; the existing Drone maestro-test step pins it to the dev flavor since build-debug-apk produces that one.rc9 confirmed native tokenizer downloads work, but AutoTokenizer.from_pretrained hangs again at the same point as rc6. Hypothesis: transformers.js hits HF URLs that don't match HF_BASE (e.g. /api/models/<repo>/tree/main) before the /resolve/main/* file fetches — those pass through to origFetch and hang on Hermes. rc10 catches every huggingface.co URL: known /resolve/main/<file> reads from disk, anything else returns a synthetic 404 so transformers.js falls through cleanly instead of waiting on a dead socket. Per-fetch status emit makes the hanging URL attributable in the debug bar ("fetch#3 api/models/..."). Refs #122.rc10 device test confirmed the fetch interceptor was never invoked — the debug bar showed 'embedder: loading tokenizer' without the per-call 'fetch#N <path>' suffix the rc10 wrapper would have emitted on any HF request. The runtime- patch approach (globalThis.fetch = interceptor inside initialize()) was likely defeated by @huggingface/transformers capturing the original fetch at module evaluation. rc11 moves the interceptor into its own module 'hf-fetch-interceptor.ts' with a top-level side effect, and imports it BEFORE '@huggingface/transformers' so the patched fetch is the one transformers closes over. The interceptor exposes setHfLocalPath() for the downloader to register on-disk paths and onHfFetch() so embedding-service can surface each invocation in the debug bar. A '[awaiting from_pretrained]' marker is emitted right before the await on AutoTokenizer.from_pretrained. The on-device behaviour is now diagnostic: - debug bar updates to 'fetch#1 ...' → transformers IS hitting our wrapper; inspect which URL is the hang - bar stays at '[awaiting from_pretrained]' → from_pretrained hangs synchronously before its first fetch and the pivot off @huggingface/ transformers becomes unavoidable Tests split: hf-fetch-interceptor.spec.ts covers the wrapper in isolation (disk read, query-string strip, 404 for unknown HF paths, passthrough, listener events). embedding-service.spec.ts loses the 3 interceptor tests (moved) and stops touching globalThis.fetch in beforeEach. Refs #122.Adds an optional `onSourceChange(event)` prop to `<ListsApiClientProvider>`. Every mutation hook in feature-lists (`useCreateList`, `useUpdateList`, `useDeleteList`, `useAddListItem`, `useUpdateListItem`, `useDeleteListItem`) now invokes the callback inside `onSuccess` with `{ sourceType: 'list', sourceId, kind }`. The mobile bootstrap supplies a callback that fans the event out to the shopping-list and note data sources — extractChunks gates by `list.type`, so publishing to the wrong source is a cheap no-op. Data sources are constructed eagerly via a new `data-source-bundle` singleton so the mutation path doesn't require the search route to have rendered first (native vector store + embedder remain lazy). With this, lists/items created or edited on-device flow into the semantic-search index incrementally — the debug "Jetzt indexieren" button is no longer the only way to fill the index. Tests: - new `data-source-bundle.spec.ts` (5 tests) locks the singleton + publish routing - existing 185 mobile tests still pass Closes #85Neue Drone-Pipeline `publish-debug-apk` (custom-event-trigger): baut die Mobile-App mit APP_VARIANT=development → de.mrrm.mrrmlab.dev (eigenes Package, kollidiert nicht mit der Release-Variante) und ohne EXPO_PUBLIC_KC_* — `app/login.tsx` ueberspringt OIDC, `useAuthState` returnt direkt { isAuthenticated: true }. Damit laufen Maestro-Flows ohne OAuth-Intent- Picker, was beim phase2-mutation-observer-Flow auf rc17 geblockt hat. Output: ueberschreibt idempotent die Gitea-Release `debug-rpi5` (prerelease=true). Vom rpi5 abgegriffen via neuem `scripts/install-debug-apk-pi.sh` (SSH → curl → adb install -r). `scripts/maestro-pi.sh` praeferiert jetzt `de.mrrm.mrrmlab.dev` ueber die Release-Variante, falls beide installiert sind — die .dev-Variante ist die designed-fuer-Maestro Variante.