feat(sensors): always-on compass & smartDriving accel'i talep-güdümlü yap (PR 3/3)#58
Merged
Merged
Conversation
… yap (PR 3/3) İki always-on tüketiciyi Orientation Sensor Gate üzerinden talep-güdümlü hale getirir. Yalnız gpsService + smartDrivingEngine değişti. ACCEL (gerçek foreground demand-gate): - _accelMagnitude YALNIZ detectDrivingMode Kademe 4'te (OBD+GPS+decayed hepsi yok/stale) okunuyor → yardımcı son-çare fallback. - _evaluateAccelDemand(): yalnız TAZE güvenilir hız kaynağı YOKKEN gate'ten subscribeMotion ile abone; taze kaynak (OBD veya GPS — recordSpeed'in beslediği _lastSpeedEstimate, yaş>DECAY_MAX_SEC=stale) varken release. - attachAccelerometer fail-safe (kaynak yoksa acquire), recordSpeed re-eval, detachAccelerometer release. Accel tek başına safety-critical karar üretmez. Magic number yok (DECAY_MAX_SEC mevcut sabit). COMPASS (gpsService): - _startCompassListener ham window.addEventListener → gate subscribe. - Mevcut JS throttle + heading/smoothing/blend davranışı KORUNUR. - Kazanım: background auto-pause (gate) + dedup. DÜRÜST SINIRLAMALAR (raporlandı): - Compass Settings ekranında KAPATILMADI: foreground Settings-gating "harita ekranda mı" tüketici sinyali gerektirir (global görünüm store'u yok; tüketiciye dokunmak kapsam dışı). Foreground davranışı bilinçli korundu (map-heading-while-not-navigating bozulmasın). - Accel mid-drive kaynak kaybı re-acquire'ı sonraki recordSpeed/attach döngüsünde (timer yok) — non-critical fallback, decay+Kademe5 kapsar. - Bu PR native samplingPeriod düşüşü İDDİA ETMEZ. YALIN: yeni timer/rAF/polling yok, Generic Sensor API yok, yeni JS throttle yok, yeni bağımlılık yok, import yan etkisiz. Test: 26 demand-gating testi + PR2 #21/#22 scope-kilidi yeni davranışa güncellendi (CLAUDE.md: kilidi kaldırma, güncelle). tsc temiz, ESLint temiz, tam suite 3200 yeşil, prod build OK. Ledger #42 🔴 (Mali-400 bekliyor). 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
…fied, cihaz bekliyor providers→adapter→registry ayna modu host-dogrulandi (32 test, suite 3603, tsc/lint/build temiz). Cihazda started/providerCount/resolvedCount + regresyon yoklugu dogrulanmali. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0141GKY1eQru4Ap1PWN4VVst
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ç
Orientation Sensor Gate 3-PR sırasının son adımı. İki always-on tüketiciyi gate üzerinden talep-güdümlü hale getirir. Yalnız
gpsService+smartDrivingEnginedeğişti.ACCELEROMETER (smartDrivingEngine) — gerçek foreground demand-gate
Salt-okunur analiz:
_accelMagnitudeYALNIZdetectDrivingModeKademe 4'te okunuyor — yani OBD+GPS+decayed hız kaynaklarının hepsi yok/stale iken. Yardımcı son-çare fallback._evaluateAccelDemand(): yalnız TAZE güvenilir hız kaynağı YOKKEN gate'tensubscribeMotionile abone olur; taze kaynak varken release._lastSpeedEstimate—recordSpeedhem OBD hem GPS için çağrılıyor (kanıt: smartEnginep.obdSpeed ?? p.gpsSpeedKmh+ OBD/GPS effect'leri). Yaş >DECAY_MAX_SEC→ stale → fallback gerekli. Magic number yok (mevcut sabit).attachAccelerometerfail-safe (kaynak yoksa acquire),recordSpeedher çağrıda re-eval,detachAccelerometerrelease.Öncelik = kullanıcının HAL→GPS→accel modeli: OBD(araç)/GPS taze → accel açılmaz; ikisi de yok/stale → accel fallback.
COMPASS (gpsService)
_startCompassListenerhamwindow.addEventListener→ gatesubscribeOrientationAbsolute/subscribeOrientation. Mevcut JS throttle (COMPASS_THROTTLE_MS) + heading/smoothing/blend KORUNUR. Kazanım: background auto-pause (gatevisibilityState hidden→ fiziksel listener söker) + dedup.drawerstate'i); tüketiciye dokunmak kapsam dışı.isNavigating'e gate'lemek "harita açık ama navigasyon yok" heading durumunu kırar (davranış ihlali). Bu yüzden compass foreground davranışı bilinçli korundu; Settings-gating ayrı iş (tüketici demand API'si).recordSpeed/attach-döngüsünde olur (timer yok) — accel non-critical fallback, decay(20s)+Kademe5 kapsar. Yaygın senaryo (hiç kaynak yok) fail-safe ile mükemmel çalışır.Background / Settings davranışı
Test & Doğrulama
#21/#22scope-kilidi yeni doğru davranışa güncellendi (CLAUDE.md: kilidi kaldırma, güncelle).tsc -btemiz · ESLint temiz · tam suite 3200/3200 yeşil (regresyon yok) · prod build OK.Değişen dosyalar
platform/gpsService.ts·platform/smartDrivingEngine.ts·__tests__/orientationDemandGating.test.ts(yeni) ·__tests__/orientationGateConsumerMigration.test.ts(2 kilit güncellendi) ·docs/DEVICE_VALIDATION_LEDGER.md(#42 🔴)🤖 Generated with Claude Code