Skip to content

feat(event-bus): Platform Event Bus Foundation#50

Merged
selimmujdeci merged 1 commit into
mainfrom
feat/platform-event-bus-foundation
Jul 11, 2026
Merged

feat(event-bus): Platform Event Bus Foundation#50
selimmujdeci merged 1 commit into
mainfrom
feat/platform-event-bus-foundation

Conversation

@selimmujdeci

Copy link
Copy Markdown
Owner

Amaç

Platform modüllerinin birbirini doğrudan çağırması yerine tip-güvenli, bounded, fail-soft, performans-duyarlı ve izole bir olay omurgası üzerinden haberleşmesini sağlayan foundation. İleride Vehicle HAL · Capability Registry · Deep Scan · Vehicle Brain · Navigation · Eagle Eye · Health · Companion AI · Assistant Context · Remote · Fleet · Vision · Media · Platform Kernel · Plugin Runtime · OEM'in ortak iletişim omurgası.

Yalnız foundation. Gerçek modül wiring · event migration · persistence · SystemBoot wiring ayrı PR'lar; mevcut servis davranışı değişmez, native/SQL/UI yok.

Salt-okunur analiz (bugünkü durum)

Olay/abonelik ≥5 ayrı desende parçalı: (a) ≥40 servis kendi _listeners = new Set'ini tutuyor (deepScanRuntimeService, capabilityRegistry, vehicleHal, orchestrator, SafetyBrain, adaptörler…), (b) DOM CustomEvent/window.dispatchEvent, (c) Zustand store.subscribe, (d) mini-bus'lar (errorBus, VehicleEventHub), (e) native plugin listener'ları. Ortak event-adı standardı yok, duplicate-suppression her serviste ayrı.

Model

  • 6 priority: safety/critical/high/normal/low/background
  • 16 domain · 15 source
  • PlatformEvent: id·name·domain·source·priority·timestamp·sequence·payload·correlationId·causationId·vehicleFingerprintHash·replayable·retained·experimental
  • İsim standardı: domain.entity.action (regex zorunlu)
  • ~43 event katalog (isim + type contract) — gerçek modüle bağlı değil

API

publish · publishName · subscribe · subscribeDomain · once · unsubscribe(idempotent) · hasSubscribers · listenerCount · getStats · getRecentEvents · clearRecentEvents · reset · dispose

Davranış

  • Dispatch: subscription-priority (yüksek→düşük) → kayıt sırası; safety event re-entrant kuyrukta önce dispatch; listener exception izole (safety dahil engellenmez)
  • Sequence monotonik (saat-geri'de bile artar); re-entrant/recursion bounded depth 16
  • Retained son değer tutar, yeni abone replayLast opt-in ile alır (varsayılan replay yok), bounded
  • History bounded (256, BASIC_JS düşük config), transient (3Hz vehicle.signal.changed) history dışı, priority-aware eviction (safety korunur), yalnız sanitize özet

Privacy / performans / immutability

  • VIN/MAC/koordinat/ham hex/secret event'e giremez (vehicleFingerprintHash yalnız anonim 8-64 hex; history özeti sanitize)
  • Güvenlik kararı üretmez (yalnız taşır); global singleton yok (factory/class); hiç import yok (tamamen bağımsız); timer yok; import yan etkisiz; Map/Set O(1); hot-path'te JSON stringify yok
  • Event/payload deep-freeze; stats/history frozen; fail-soft (dispose sonrası no-op, listener içinde unsubscribe/dispose güvenli)

Yeni dosyalar

Doğrulama

  • tsc -b · ✅ ESLint · ✅ Hedef 46/46 · ✅ Tam suite 2936/2936 · ✅ Production build

Bilinen eksikler

Capability Registry / Vehicle HAL / Deep Scan wiring + event migration + persistence = ayrı PR'lar. Cihazda doğrulama Ledger #35 🔴.

🤖 Generated with Claude Code

…rgası

Platform modüllerinin birbirini doğrudan çağırması yerine tip-güvenli, bounded,
fail-soft, izole bir olay omurgası üzerinden haberleşmesini sağlayan foundation.
Yalnız foundation — gerçek modül wiring/event migration/persistence ayrı PR'lar;
mevcut servis davranışı değişmez, native/SQL/UI yok, SystemBoot'a bağlanmaz.

Bugün olay/abonelik ≥5 desende parçalı (≥40 servis kendi _listeners Set'i; DOM
CustomEvent; Zustand subscribe; mini-bus errorBus/VehicleEventHub; native listener),
ortak event-adı standardı yoktu. Event Bus bunu birleştirir.

- 6 priority (safety…background) · 16 domain · 15 source · PlatformEvent(sequence/
  correlation/causation/vehicleFingerprintHash/retained/…). İsim standardı
  domain.entity.action. ~43 event katalog (isim+contract, gerçek modüle bağlı değil).
- API: publish/publishName/subscribe/subscribeDomain/once/unsubscribe/hasSubscribers/
  listenerCount/getStats/getRecentEvents/clearRecentEvents/reset/dispose.
- Dispatch: subscription-priority sonra kayıt sırası; safety event re-entrant kuyrukta
  önce; listener exception izole. Sequence monotonik (saat-geri'de bile).
- Retained (opt-in replayLast, bounded), history bounded + transient dışı +
  priority-aware eviction (safety korunur, sanitize özet), recursion bounded (depth 16).
- Gizlilik: VIN/MAC/koordinat/ham hex/secret giremez.
- Yalın: güvenlik kararı üretmez (taşır), global singleton yok, hiç import yok
  (bağımsız), timer yok, import yan etkisiz, Map/Set O(1), hot-path'te stringify yok.
  Bounded, immutable (deep-freeze), fail-soft.
- 46 birim testi (50 senaryo).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PaohAWKE2s1FhB6Hmmcj2p
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
car-launcher-pro Ready Ready Preview, Comment Jul 11, 2026 6:44am
carospro Ready Ready Preview, Comment Jul 11, 2026 6:44am

@selimmujdeci
selimmujdeci merged commit eb5a581 into main Jul 11, 2026
8 checks passed
selimmujdeci pushed a commit that referenced this pull request Jul 12, 2026
Boot crash/ANR yok; iki ardışık boot'ta tek aktif bus + platform.runtime.started
tam bir kez (publishedCount=1, retained=1, dropped/listenerError/recursion=0,
listener=0); cold start delta ~+27ms (<50ms). Ölçüm geçici, commit edilmeyen
instrumentation + CDP ile alındı ve kaldırıldı.

Satır 🔴 KALIYOR: runtime.stopped cihazda tetiklenemedi, low-tier (Mali-400/T507)
doğrulaması ve kalıcı teşhis yüzeyi eksik.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012M8LbxyAqd22EU1rqtTjft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant