27 Commits

Author SHA1 Message Date
kk0t9 92a11c3c72 style(v0.3): rustfmt power FSM/service/integration
Прогон cargo fmt (гейт lint): многострочное форматирование match-веток FSM,
PowerMock/PowerService-литералов, integration-вызовов. Без изменений логики.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 23:22:12 +03:00
kk0t9 aaae0508b9 feat(v0.3): Power-сервис на FSM — dev-mock кормит события, grace+durable-barrier
P7.2: service.rs оборачивает PowerFsm — D-Bus state/signals из FSM; apply_event
исполняет действия (эмит сигналов, фоновый grace-таймер, durable-barrier sync).
dev-mock SetAcc/SetIgnition/TriggerShutdown/AbortShutdown кормят входы FSM.
FSM: AccOff → AccChanged(false)+ShutdownImminent (сохранён walking-skeleton-регресс).
Integration: ShutdownImminent + abort. zbus → tokio-executor (default-features=false,
features=["tokio"]) — иначе tokio::spawn в хендлере паникует (async-io). test-integration
--test-threads=1 (тесты владеют одним именем на шине).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 23:17:13 +03:00
kk0t9 d8465c91e4 feat(v0.3): чистый PowerFsm (состояния/переходы B03)
P7.1: State/Event/Action + step (чистый, без I/O) + проекции в PowerState/
IgnitionState/PowerSource. Переходы off↔accessory↔running→shutting_down{abortable→
committed}→off; abort до PONR; sleep/battery_cutoff — каркас. 8 unit-тестов (каждый переход).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 21:12:48 +03:00
kk0t9 62a6f332e2 feat(v0.2): shturman-splash — Stage-0 splash (software-render → PNG)
P6.2: статичный брендовый splash-кадр (wordmark «Штурман» на тёмном),
render_splash через shturman-render; bin с --screenshot. Без чтения шины
(стартует до Power/Settings → «мгновенно»). Визуальные токены — каркас (язык v0.5).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 20:05:22 +03:00
kk0t9 798e5ba14a refactor(v0.2): вынести headless render в shturman-render (shell использует)
P6.1: общий хелпер render_to_png<C: ComponentHandle>(build, w, h, path) поверх
Slint software-renderer (thread_local окно + set_platform once + draw + png).
shturman-shell.render_screenshot теперь зовёт его; плумбинг-дубль удалён.
png в shell → dev-deps (рендер в render-крейте, тест декодирует). Тесты зелёные.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 20:03:16 +03:00
kk0t9 9b87751ab8 feat(v0.6): Lima E2E зелёный с нуля + shell software-render screenshot
План 5 ч.2: поднял Lima-VM и довёл сквозной E2E до зелёного из чистого yaml
(just vm-reset && just e2e — exit 0). Приёмка §9.4 (v0.1 + v0.6 + шагающий скелет).

Shell (lib+bin split):
- режим --screenshot <path>: headless software-render первого кадра в PNG
  (Slint software-renderer, без дисплея/композитора, §6); TDD-тест «кадр не
  пустой + тема отражена», зелёный и на dev-Mac, и в VM (Linux).
- shturman-shell.service → oneshot software-render → /run/shturman/frame.png
  (RemainAfterExit → is-active детерминированно, без хрупкого weston;
  живой weston-shell — v0.5). just shell-frame — инспекция кадра.

E2E (tests/e2e/run.sh, двухфазно pre→reboot→post):
- /data+power-safe опции, volatile-tmpfs, first-boot идемпотентность, per-unit
  active, имена на шине + GetPowerState, fake-ACC SetAcc→AccChanged, первый кадр
  PNG, base-бюджеты (journald volatile / zram / oomd / fake-hwclock→/data /
  eMMC-прокси), персист Settings + machine-id every-boot bind после reboot.

Провижининг (lima/shturman.yaml) — правки по реальным ошибкам Lima:
- build-deps Slint/winit на Linux (libfontconfig1-dev/libxkbcommon-dev/libwayland-dev);
- linux-modules-extra (zram/vcan не в vz-ядре); systemd-oomd; rm стокового
  /etc/fake-hwclock.data (A11); VM-локальный CARGO_TARGET_DIR.

Док-синхронизация (спека §13/§8.1/§7.5 + CLAUDE.md): швы реализации, eMMC-порог
T=4096 сект, fake-hwclock masked-в-Lima, dev-mock policy не нужен.

Перф-вердикт — на RK3588 (в VM — функционально, performance §2). just ci зелёный.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 17:14:31 +03:00
kk0t9 bfe490e899 refactor(review): shell current-thread runtime + единый дефолт; PowerClient parse_enum; тесты на ipc::names
- shell: new_current_thread рантайм (без пула на холодном старте, #11); единый Initial::default().
- PowerClient: generic parse_enum (убрал 3 копии map_err).
- ipc::names::power::MOCK_IFACE; интеграционные тесты — через ipc::names (не хардкод).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 14:36:50 +03:00
kk0t9 69beaad596 fix(review): manifest deny_unknown_fields + каталог сигналов в sdk::vehicle
- deny_unknown_fields: опечатка в ключе capability (граница доверия F §3) не проглатывается.
- VEHICLE_SIGNALS → shturman_sdk::vehicle (single source; валидатор берёт оттуда).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 14:36:50 +03:00
kk0t9 2b06ff749f fix(review): Settings — типизированный SettingValue + лог битого JSON + Error::Failed + чистый reset
- SettingValue{Str,Int,Bool} в сторе: провод-variant теперь честно поддержан (не string-only).
- битый settings.json → WARN в лог (не молча) + откат к дефолтам.
- отказ записи /data → Error::Failed (не InvalidArgument).
- reset ключа без дефолта → no-op + InvalidArgument (без ложного Changed("")).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 14:36:50 +03:00
kk0t9 69e4e06940 feat(validator): manifest-validator (F02) + bad-manifest фикстуры (F04)
Правила: id не ru.shturman.*, shturman_api поддержан, len(tiles)<=ui_tiles, vehicle_read из каталога.
Фикстуры good + bad-{id-reserved,api,tiles-quota,vehicle-read}; 6 тестов.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 13:20:26 +03:00
kk0t9 ca763116d8 feat(shell): первый Slint-кадр на SDK (срезы C03/04/05/07/02) + slint GPL exception
theme::resolve_night (TDD); slint! AppWindow (статус-бар часы+сеть + грид тайлов + тема день/ночь);
main — best-effort чтение Settings/Power через sdk (без шины — дефолты, #4); часы UTC (локаль tz — позже).
deny.toml: GPL-3.0 exceptions для slint-крейтов (вариант A, финал к v4) + BSL-1.0 (error-code).
Slint тянет zbus5/thiserror2 — дубли версий (bans=warn). Реальный screenshot кадра — План 5 E2E.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 13:03:22 +03:00
kk0t9 ce525dd622 test(core): интеграция Settings/Power на session-шине (#[ignore])
Settings round-trip + Changed; Power state + fake-ACC AccChanged — на живой D-Bus.
just test-integration (dbus-run-session). #[ignore] → just ci (unit) не требует шины.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:51:07 +03:00
kk0t9 9aeff2aa7d feat(power): Power1 стаб + dev-mock fake-ACC (feature dev-mocks)
PowerService (Power1, стаб running) + PowerMock (dev.PowerMock1, разделяет State через Arc<Mutex>).
dev-mocks — default-фича; прод (--no-default-features) mock не регистрирует.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:46:22 +03:00
kk0t9 b8f084b1e1 feat(settings): Settings1 стаб + атомарный стор + seed дефолтов
Store (load_or_seed/get/set/reset/list, durable-write) + SettingsService #[interface] + bin.
v0: строковые значения (variant на проводе), сам сеет дефолты.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:41:44 +03:00
kk0t9 b7a76d78f6 feat(firstboot): идемпотентный provision /data + machine-id (A06)
lib provision (idempotent; factory-reset; recover mid-run) + bin; machine-id из /dev/urandom.
Привязка к /etc/machine-id — every-boot юнит (План 5). Дефолты настроек — Settings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:38:21 +03:00
kk0t9 d62ba80755 refactor(ipc): connect() в ipc::conn; sdk ре-экспортит
Сервисам нужен bus-bootstrap, а от sdk они не зависят (граница architecture §3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:37:09 +03:00
kk0t9 52d3a6e2ce feat(sdk): connect + Power/Settings клиенты (bus-тест — План 3)
connect (system/session по SHTURMAN_BUS); PowerClient/SettingsClient — типизированные обёртки proxy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:15:20 +03:00
kk0t9 297970901a feat(sdk): схема манифеста (plugin-sdk §2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:13:13 +03:00
kk0t9 d8eebc96ce feat(ipc): zbus-proxy Power1/Settings1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:11:11 +03:00
kk0t9 0d630dde84 feat(ipc): enum-типы Power/Ignition/Source/Reason (string round-trip)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:10:07 +03:00
kk0t9 d91d218ade feat(ipc): Error (ru.shturman.Error.*) + well-known имена
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:07:29 +03:00
kk0t9 54f17cbf4e chore(dev): justfile (ядро) + CI-гейт (lint/test/deny) + rustfmt
just ci зелёный: fmt + clippy(-D warnings) + 6 unit-тестов common + cargo-deny.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-24 12:01:04 +03:00
kk0t9 e8576a0196 feat(common): init_tracing -> journald (A10) + re-exports
journald на Linux, stderr-fallback иначе (cfg-gate).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:56:52 +03:00
kk0t9 70045e2544 feat(common): монотонные часы (B §8)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:55:47 +03:00
kk0t9 ab012381d0 feat(common): durable atomic write (power-safe #5)
write-temp -> fsync -> rename -> fsync(dir); тесты целостности.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:55:12 +03:00
kk0t9 334faeb000 feat(common): Layout — канонические пути /data
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:54:14 +03:00
kk0t9 4ee012127f chore(workspace): Rust-воркспейс + скелет shturman-common
- workspace (resolver 2; members растут по планам)
- rust-toolchain 1.96.0; tracing-journald cfg-gated на Linux (кросс-платформенность)
- shturman-common: модули-скелеты paths/atomic/clock/log

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:53:13 +03:00