Commit Graph

13 Commits

Author SHA1 Message Date
kk0t9 32ba1136c7 test(v0.4): integration — thermal-trip/abort + MCU fail-safe-cut (session-шина)
+ фикс B09-таймера: last_heartbeat Option<u64> вместо сентинела 0 (monotonic_secs() стартует
с 0 → первый heartbeat попадал на 0, guard !=0 ложно трактовал как «не было» → cut не срабатывал).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:42:20 +03:00
kk0t9 cd2442f672 feat(v0.4): проводка thermal+coprocessor циклов + D-Bus ThermalState/ThermalChanged + dev-mock
spawn_loops (thermal-монитор + coprocessor heartbeat/wait/safe-to-cut/B09) в main после
регистрации интерфейса; PowerService += thermal_state + хендлы fsm/thermal_state + mock(temp,copro);
dev-mock += SetTemp/HangSoc/McuLinkLoss; proxy.rs += thermal_state/thermal_changed. Existing
integration-тесты подогнаны под mock(temp,copro).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:36:19 +03:00
kk0t9 2e6144c54f feat(v0.4): TempSource/Throttler-абстракции + ThermalMonitor (A12/B10)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:32:53 +03:00
kk0t9 860a591f16 feat(v0.4): Coprocessor trait + MockCoprocessor (B09-модель) + клиент (B08)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:31:55 +03:00
kk0t9 147b20ddb6 feat(v0.4): SoC↔MCU протокол + кодек (CRC/replay/desync-guard, B08)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:30:55 +03:00
kk0t9 e54a34cd64 feat(v0.4): FSM ThermalCleared (abort thermal) + FailsafeCut (MCU cut)
+ Action::Cut и его хендлер в apply_event (нужен для компиляции крейта — P8.6 шаг 2 сделан здесь).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:29:36 +03:00
kk0t9 b9ae2f23d5 feat(v0.4): чистый ThermalPolicy (банды + гистерезис, A12/B10)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
2026-06-25 15:27:29 +03:00
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 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 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