fix(dev): start session ingest worker and drop harness faults from Sentry - #6623
Conversation
…ntry Surface: mobile-app The workflow's own development environment is broken, and it makes every e2e run fail or flake. Fix the development environment, not the production app. ## The evidence 1. Session ingest is not configured in the dev backend. Every e2e run that asks for a web ticket gets HTTP 412 `PRECONDITION_FAILED`: ``` POST http://127.0.0.1:4200/api/trpc/activeSessions.createWebTicket -> 412 trpc.code: PRECONDITION_FAILED message: "Session ingest is not configured" thrown at mintWebTicket (apps/web/.next/dev/server/chunks/...) ``` This is the largest single cause of noise in the kilo-app project: before the 24 hour merge, 64 issues carried this tRPC failure. It is a development configuration gap, not a product defect. 2. The Metro development server returns 500. `KILO-APP-1X1`: `DebugServerException: The development server returned response error code: 500` from `com.facebook.react.devsupport.BundleDownloader in processBundleResult`. 3. A workflow e2e test injects a fault that reaches the project as an issue. `KILO-APP-2D3`: `Error: E2E secure-store fault window is open: read of gateway-transcription-model rejected`. A test fault is not a product defect. ## What to build 1. Configure session ingest in the development environment so `activeSessions.createWebTicket` answers without `PRECONDITION_FAILED`. If the correct answer is "this endpoint is optional in development", then return a documented success or
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Reviewed the session-ingest dev dependency, the E2E fault tagging, and the Sentry Files Reviewed (10 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
|
This description names a scenario the proof did not capture:
A repeated proof run rebuilds the same evidence, so no proof run is dispatched for a named gap. Merging with this gap open is your decision. |
Changelog for users
activeSessions.createWebTicketandgetTokenanswer in development instead of failing with HTTP 412PRECONDITION_FAILED.E2eInjectedFaultError.DebugServerExceptionHTTP 500.Changelog for maintainers
lib/telemetry/e2e-fault.tsaddsE2eInjectedFaultError,INJECTED_FAULT_ERROR_NAME, andisE2eInjectedFault; the predicate matches the class or the name marker, so a fault that loses class identity across a boundary is still recognized.E2eInjectedFaultErrorwhile the fault window is open, tagging the harness fault at its single throw site.lib/telemetry/sentry-before-send.tsaddsbeforeSendScrubbedEvent, which drops an injected fault and otherwise returnsscrubEvent(event);sentry-init.tsnow uses it asbeforeSend.beforeSendScrubbedEventnever throws: a malformed hint keeps the event, so the gate cannot drop a real crash.nextjsnow depends oncloudflare-session-ingestin the dev service graph, sodev:start appstarts the worker (services/session-ingest, port 8800 + port offset) and the web app's mint fetch reaches a live listener.E2eInjectedFaultErrorname is a stable contract reporters match on, so do not rename it; the name-only match means an app error deliberately named that value would also be dropped.beforeSenddrop, the generated session-ingest dev URL, and the app start targets.E2E proof
[e2] dev build loads from the dev Metro server (no DebugServerException 500) — After a cold start on android emulator-5554 the Metro log copy has 0 matches for DebugServerException|BundleDownloader|response error code and ends 'Android Bundled 105ms apps/mobile/src/lib/persist/drafts.ts (1 module)' then 'LOG [screen-tracking] (app)/(tabs)/(0_home)', with the digest showing Home rendered (e2-metro.log, e2-digest.txt, e2-home.png for the visual reviewer); UX-DEFECT: none observed from the Home digest.
[e2] dev build loads from the dev Metro server (no DebugServerException 500) — e2e-mobile-app/e2-home.png (capture not retained)
[e1] With the E2E secure-store fault window open, the injected read failure carries Error.name 'E2eInjectedFaultError' and no new Sentry issue is filed for it (beforeSend drops the event). — On android emulator-5554, in the live dev bundle (Metro CDP inspector, shipped module 2651), the fault window was open ('FAULT-WINDOW-E2E_SECURE_STORE_FAULT_MS: 60000') and the real read helper rejected with '"name":"E2eInjectedFaultError"' / 'E2E secure-store fault window is open: read of gateway-transcription-model rejected'; the installed Sentry client's beforeSend returned '"beforeSendResult":"null (DROPPED)"' for that error, and the transport sink shows 'FAULT-CASE: {"readOk":false,"readName":"E2eInjectedFaultError",...} envelopesSent=0' against 'CONTROL-CASE: envelopesSent=1…
[e2] dev build loads from the dev Metro server (no DebugServerException 500)
E2E proof — log excerpts
/home/igor_kilocode_ai/.local/share/kwf/sections/req-dev-env-53e6/e2e-mobile-app/e1-injected-read.logRan on android; the request asked for android.
/home/igor_kilocode_ai/.local/share/kwf/sections/req-dev-env-53e6/e2e-web/e1-sentry-drop.logOwner request
Follow-ups (not changed here)