feat(sensors): Orientation Sensor Subscription Gate foundation (PR 1/3)#56
Merged
Conversation
Cihaz yön/hareket Web event'leri (deviceorientationabsolute / deviceorientation / devicemotion) için MERKEZİ, ref-count'lu abonelik kapısı (multiplexer). Bugün bu event'lere ≥6 servis AYRI addEventListener ile abone; ikisi kök layout'ta app-ömrü bağlı → Ayarlar dahil her ekranda sensör aktif (QA: samplingPeriod 60Hz, SensorsHandlerThread ~%24 + CrRendererMain ~%21). Gate: - Event türü başına TEK fiziksel window listener (dedup) - Callback Set ile ref-count (ilk consumer→bağla, son→sök) - visibilityState!=='visible' → fiziksel listener sökülür; görünür+aktif consumer → yeniden bağlanır (background pause temeli) - Deterministik fan-out (insertion order, kararlı dizi); event başına YENİ array/object allocation YOK - Callback exception İZOLE (fail-soft); public API throw ETMEZ - Bounded (kanal başı 64, aşım fail-soft no-op + droppedCount) - dispose zero-leak + sonrası güvenli no-op; reset yeniden kullanılabilir - HİÇ import YOK (bağımsız, import yan etkisiz); timer/rAF/polling YOK; Generic Sensor API YOK; JS throttle YOK; permission tüketicide kalır KAPSAM: foundation — HİÇBİR tüketici bu kapıya bağlanmadı (wiring YOK). Bu PR tek başına CPU/samplingPeriod DÜŞÜRMEZ; gerçek kazanım PR 2 (on-demand tüketiciler) ve PR 3 (always-on talep-güdümlü + background pause) wiring'inden SONRA ölçülür. Legacy event API aktifken native sampling 60 Hz olabilir (frekans parametresi yok). Yeni: platform/sensors/orientationSensorGate.ts, platform/sensors/index.ts Test: 30 birim testi + regression guard (zero-leak + bağımsızlık kilidi) Ledger: #40 🔴 (Mali-400 cihaz doğrulaması bekliyor) tsc -b temiz · ESLint temiz · tam suite 3141 yeşil · prod build OK Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KKAPmfBwMTjsd5ft26GmXf
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
selimmujdeci
pushed a commit
that referenced
this pull request
Jul 12, 2026
sourceHealth teşhis raporunda görünüyor (can:false/obd:false/gps:true — araçsız doğru). Sahte disconnect yok (ingestedSignalCount=3 sabit), tek abonelik korunuyor (activeSubscriptionCount=1), bridge dropped=0, boot/CPU/RAM regresyonu yok. Background 45 sn testi: dönüşte gps:true kaldı ve HAL'e düşüş yansımadı; ancak lastChangeAt taşındı → arka planda geçici gps:false DIŞLANAMADI (risk sürüyor). Satır 🔴 KALIYOR: gerçek araç (can=false/reconnect/connection) ve low-tier eksik. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012M8LbxyAqd22EU1rqtTjft
selimmujdeci
pushed a commit
that referenced
this pull request
Jul 12, 2026
…TH görünürlük gating PR #72 (source health → HAL fail-closed) arka planda YANLIŞ-POZİTİF üretebiliyordu: watchdog canlılığı monotonik saat farkıyla ölçer (_alive, VehicleCompute.worker.ts:409-411); bu saat arka planda ilerler ama WebView timer'ı kısılır ve adaptör frame'leri durur → foreground dönüşündeki ilk tikte now-lastSeen >> timeout → kaynak SAĞLAMKEN can=false. Araç bağlıyken bu, CAN-özel sinyalleri gereksiz unsupported yapar ve bridge'ten sahte connection.changed=false/true çifti üretirdi. ÇÖZÜM (minimum, yeni timer YOK): - sourceHealthGate.ts (yeni, SAF: timer/DOM/store yok, zaman enjekte edilir) hidden → sağlık GEÇİŞİ dondurulur (lastSeen BOZULMAZ) foreground→ timeout SAATİ yeniden tabanlanır (arka plan süresi timeout'a YAZILMAZ) taze frame→ true · görünür zamanda gerçek timeout → false (gerçek kayıp MASKELENMEZ) ikisi de değilse → KARAR YOK (son bilinen değer korunur; yoksa unknown) - worker: bounded VISIBILITY {visible:boolean} kontrol mesajı; kapı YALNIZ SOURCE_HEALTH kararını etkiler — fusion/reverse/SAB ham _alive() kullanmaya devam eder. - resolver: TEK visibilitychange dinleyicisi (mevcut proje deseni), stop()'ta sökülür, duplicate durum POSTLANMAZ. Kapsam dışı bırakıldı: Event Bus/bridge/HAL/Kernel/Capability/DeepScan foundation, UI, SQL, throttle/coalescing, timer sayısı (worker setInterval 4 → 4). Testler: +27 (sourceHealthVisibilityGating) — visible alive→dead, hidden'da false yok, arka plan süresi timeout'a yazılmıyor, dönüşte anında false yok, taze frame → true, görünür timeout → false, CAN/OBD/GPS bağımsız, duplicate visibility pencereyi uzatmıyor, background→foreground event fırtınası yok, zero-leak cleanup. Suite 3571 yeşil · lint 0 hata · build OK · guard 113/113. Ledger #56 🔴 (gerçek araç + low-tier hâlâ eksik). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012M8LbxyAqd22EU1rqtTjft
selimmujdeci
pushed a commit
that referenced
this pull request
Jul 12, 2026
…Xiaomi) Gerçek "Tanı Gönder" rapor gövdesinden (enstrümantasyonsuz): - Premise teyit: arka planda WebView `document.visibilityState === 'hidden'` döndürüyor. - SAHTE DEAD YOK: ~20 dk arka plan sonrası `sourceHealth.lastChangeAt` boot değerinde KALDI (1026.6) → arka planda SIFIR sağlık geçişi. (Düzeltme öncesi 45 sn arka plan aynı cihazda 3171 → 699171 taşımıştı.) - activeSubscriptionCount=1, halBridge.droppedCount=0, sahte connection.changed YOK. - 🟡 Foreground dönüşünde gps false→true çifti: arka plan saatinden DEĞİL, görünür zamandaki 5 sn GPS sessizliğinden (OS akışı geç başlıyor); ölçümsüz eşik eklenmedi. Ledger #56 🔴 KALIR — gerçek araç + low-tier hâlâ eksik. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012M8LbxyAqd22EU1rqtTjft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Amaç
Gerçek cihaz profillemesinde kanıtlanan uygulama-geneli 60 Hz cihaz yön/hareket sensörü yükünü azaltmaya yönelik 3-PR'lık sıranın 1. adımı (foundation). Bu PR yalnız merkezi abonelik kapısını (gate) kurar — hiçbir tüketici bağlanmaz.
Kök neden (kanıt)
deviceorientationabsolute/deviceorientation/devicemotionevent'lerine ≥6 servis AYRIaddEventListenerile abone:İki always-on tüketici her ekranda (Ayarlar dahil) sensörü açık tutuyor → QA:
dumpsys sensorservicesamplingPeriod 16.67ms=60Hz, SensorsHandlerThread ~%24 + CrRendererMain ~%21.Bu PR ne yapar
platform/sensors/orientationSensorGate.ts— 3 ham event'in tek sahibi:visibilityState!=='visible'→fiziksel listener sökülür; görünür+aktif consumer→yeniden bağlanırPR 3 predikatları (şimdiden kilitlendi, bu PR'da uygulanmadı)
Doğrulama
tsc -b --noEmit: temizDosyalar
platform/sensors/orientationSensorGate.ts(yeni)platform/sensors/index.ts(yeni)__tests__/orientationSensorGate.test.ts(yeni, 30 test)__tests__/regression.guards.test.ts(gate zero-leak + bağımsızlık kilidi)docs/DEVICE_VALIDATION_LEDGER.md(docs(validation): Renault Trafic saha doğrulama planı (P2-1→P2-5 + PR #11) #40 🔴)🤖 Generated with Claude Code