Skip to content

feat(kernel): Platform Kernel / Service Lifecycle Foundation#55

Merged
selimmujdeci merged 2 commits into
mainfrom
feat/platform-kernel-lifecycle-foundation
Jul 12, 2026
Merged

feat(kernel): Platform Kernel / Service Lifecycle Foundation#55
selimmujdeci merged 2 commits into
mainfrom
feat/platform-kernel-lifecycle-foundation

Conversation

@selimmujdeci

Copy link
Copy Markdown
Owner

Amaç

Platform servislerinin (Vehicle HAL · Capability Registry · Event Bus · Deep Scan · Navigation · AI · Fleet · Remote · Health · Vision) yaşam döngüsünü, bağımlılıklarını, başlatma/durdurma sırasını, sağlık durumunu ve hata izolasyonunu yöneten merkezi çekirdek. Foundation — gerçek servisleri BAĞLAMAZ (yalnız DI); SystemBoot wiring / auto-start YOK (ayrı PR).

Model

  • State (11): registered → initializing → ready → starting → running / degraded / paused → stopping → stopped / failed / disposed
  • Criticality (6): safety · critical · important · normal · optional · background
  • StartPolicy (6): eager · lazy · on_demand · capability_gated · device_tier_gated · manual
  • RestartPolicy (4): never · manual · on_failure · bounded_auto — Health (4): healthy · degraded · unhealthy · unknown
  • PlatformServiceDescriptor + PlatformService contract — tüm method opsiyonel (eksik → no-op).

Dependency

Directed-acyclic. Cycle kayıt anında reddedilir. Topolojik başlatma (tie-break = id), ters topolojik durdurma. Eksik required → başlamaz · eksik optional → degraded başlar · dependency failed → dependent bloke · bağımsız servis çökmeden devam eder.

Gate (DI)

Capability Registry doğrudan import edilmez (isAvailable/getStatus/subscribe contract). Required capability unknown/unavailable/unsupported → başlamaz · degraded → degraded başlar. minimumDeviceTier sağlanmazsa başlamaz → Mali-400/low'da optional ağır servis gate edilir.

Timeout / Restart / Health

  • Timeout: proje 5s konvansiyonundan türetildi (magic yok). Timer yalnız aktif lifecycle çağrısı boyunca (settle'da temizlenir) — steady-state timer/polling YOK.
  • Restart: bounded (safety=1, diğer=2); max aşımında circuit-open; retry timer döngüsü YOK (backoff yalnız saf computeKernelBackoffMs).
  • Health: service.health() varsa fail-soft çağrılır, yoksa state'ten türetilir; result state'i mutate etmez.

Event (DI opsiyonel)

publishName ile platform.runtime.started/stopped/degraded · platform.service.started/stopped/failed. Event Bus yoksa lifecycle sürer, publish hatası izole.

İnvaryantlar

  • Fail-soft: servis exception izole · unknown servis güvenli · dispose sonrası no-op · partial-start + stopAll güvenli · public API throw etmez.
  • Immutable snapshot/status (nested dahil) · descriptor girdi mutate edilmez · iç Map/graph dışa verilmez.
  • Privacy: degradedReasons/lastErrorCode sanitize (VIN/MAC/koordinat/secret sızmaz).
  • YALIN: SystemBoot'a bağlanmaz · gerçek servis auto-start yok · HAL/Registry/Bus'ı kendisi yaratmaz (DI) · persistence/SQL/cloud yok · global singleton yok · yeni bağımlılık yok · import yan etkisiz (yalnız DeviceTier TYPE). Bounded (servis 128 · listener 32). Kernel servis iş mantığını bilmez.

Doğrulama

  • tsc -b --noEmit ✅ · ESLint ✅
  • Hedef testler: 53 ✅ (register/dep-order/cycle/gate/timeout/restart/circuit/health/immutability/privacy/fail-soft/bounded)
  • Tam suite: 3164 test yeşil (186 dosya) ✅ regresyon yok · Production build ✅

Saha doğrulama

docs/DEVICE_VALIDATION_LEDGER.md #40🔴 cihazda test edilmedi. Gerçek servis + SystemBoot wiring ayrı PR olduğu açıkça belirtildi.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QpXTwq5gqubmnaDWbra5MX

Platform servislerinin yaşam döngüsünü, bağımlılıklarını, başlatma/durdurma sırasını,
sağlık durumunu ve hata izolasyonunu yöneten merkezi çekirdek. Gerçek servisleri BAĞLAMAZ
(yalnız DI ile yönetir); SystemBoot wiring/auto-start YOK (ayrı PR).

Model: 11 state · 6 criticality · 6 startPolicy · 4 restartPolicy · 4 health.
Descriptor + PlatformService contract (tüm method opsiyonel → eksik no-op).

API: register/unregister/has/getServiceStatus/list/resolveStartOrder/initialize/start/
startAll/pause/resume/stop/stopAll/restart/markDegraded/runHealthCheck/getKernelSnapshot/
subscribe/reset/dispose.

Dependency: directed-acyclic; cycle kayıt anında reddedilir; topolojik başlatma (tie-break
id), ters topolojik durdurma; eksik required→başlamaz; eksik optional→degraded; dep failed→
dependent bloke. Gate (DI): Capability Registry doğrudan import edilmez; unknown/unavailable→
başlamaz; degraded→degraded; minimumDeviceTier sağlanmazsa başlamaz (Mali-400 optional gate).

Timeout proje 5s konvansiyonundan (magic yok); timer yalnız aktif çağrı boyunca (settle'da
temizlenir); steady-state timer/polling YOK. Restart: never/manual/on_failure/bounded_auto;
bounded (safety=1/diğer=2); max aşımında circuit-open; retry timer döngüsü YOK (backoff saf
fonksiyon). Health fail-soft, state mutate etmez. Event publisher DI opsiyonel (yoksa lifecycle
sürer, publish hatası izole).

Fail-soft (servis exception izole, unknown güvenli, dispose no-op, partial-start+stopAll);
immutable snapshot/status; privacy (reason/error sanitize); global singleton yok; import yan
etkisiz (yalnız DeviceTier TYPE); bounded (servis 128/listener 32). Kernel servis iş mantığını
bilmez; HAL/Registry/Bus'ı kendisi yaratmaz (DI).

Testler: platformKernel (53). Tam suite 3164 yeşil, tsc/eslint temiz, production build OK.
Ledger #40 → 🔴.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QpXTwq5gqubmnaDWbra5MX
@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 12, 2026 9:08am
carospro Ready Ready Preview, Comment Jul 12, 2026 9:08am

// Required capabilities (DI gate).
if (this._caps) {
for (const cap of (d.requiredCapabilities ?? [])) {
let st = 'unknown';
…lifecycle-foundation

# Conflicts:
#	docs/DEVICE_VALIDATION_LEDGER.md
@selimmujdeci selimmujdeci merged commit 299c5a1 into main Jul 12, 2026
8 checks passed
selimmujdeci pushed a commit that referenced this pull request Jul 12, 2026
Sahte disconnect yok: ingestedSignalCount=3 (değişmedi), tek abonelik, bridge
dropped=0 → bilgi taşıması HAL/bridge davranışını değiştirmedi. Boot/CPU/RAM
regresyonu yok.

Satır 🔴 KALIYOR: canAlive=false/reconnect gerçek araç gerektiriyor; low-tier yok;
sourceHealth henüz teşhis raporunda değil (ADB'siz okunamıyor) → PR-2'de eklenmeli.

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.

2 participants