Files
shturman/docs/specs/plans/05-devtools-systemd-lima-e2e.md
2026-06-24 13:19:08 +03:00

47 lines
3.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# План 5 — dev-tools + systemd + Lima + E2E
> REQUIRED SUB-SKILL: `executing-plans` + TDD. Часть 1 (код/конфиги) — сейчас; часть 2 (поднятие Lima + прогон E2E) — по явному «ок» (тяжёлое: установка limactl + ГБ-образ + провижининг).
**Goal:** закрыть dev-харнесс v0.6 — валидатор манифеста (F02) + scaffolding + bad-manifest фикстуры (F04);
systemd-оркестрация (A15) + Lima-конфиг + сквозной E2E (boot → сервисы → первый кадр).
---
## Часть 1 (сейчас — хостовое/файлы)
### P5.1: `manifest-validator` (F02) + фикстуры (F04)
- `crates/tools/shturman-manifest-validator` (bin): `validate(&Manifest) -> Vec<String>` + `validate_yaml`;
правила (plugin-sdk/F §3): `id` не `ru.shturman.*`; `shturman_api` поддержан; `len(tiles) ≤ ui_tiles`;
`vehicle_read` ⊆ каталог data-model. CLI: путь → вывод + exit-код.
- `fixtures/manifests/`: `good.yaml` + `bad-id-reserved` / `bad-api` / `bad-tiles-quota` / `bad-vehicle-read`.
- Тесты валидатора по фикстурам (good → пусто; bad → ожидаемая ошибка; битый YAML → Err).
### P5.2: scaffolding + justfile-таргеты
- `templates/plugin/` (валидный `manifest.yaml` + `locales/ru.yaml` + минимальный README); `just new-plugin <name>`.
- `justfile`: `validate-manifest <path>`, `new-plugin <name>`, `plugin-dev-run <path>` (каркас — «нужен App-Host, v3»),
`sim` (плейсхолдер Vehicle Sim, v2).
### P5.3: systemd-юниты + Lima-конфиг + E2E-харнесс (файлы)
- `systemd/`: `shturman.target`, `data.mount`, `shturman-firstboot.service`, `shturman-machineid.service`,
`shturman-{power,settings,shell}.service`, `dbus/ru.shturman.conf` (+ dev-only `ru.shturman.dev.conf`),
`journald-shturman.conf`, `zram-generator.conf`, `oomd-shturman.conf`. Ordering: `data.mount` → firstboot →
machineid → dbus → power+settings → shell; `Requires=`+`After=firstboot` у сервисов; `RequiresMountsFor=/data`.
- `lima/shturman.yaml`: vz, Ubuntu ARM64, 4CPU/6GiB/20GiB, repo writable mount; provision: пакеты
(systemd/dbus/weston+screenshooter/can-utils/rustup/python/zram-generator/fake-hwclock/шрифты), `modprobe vcan`+`vcan0`,
loopback-`/data` + постоянный mount + tmpfs-overlay, fake-hwclock→`/data`, разложить `systemd/`, включить target.
- `justfile`: `vm-up`/`vm-down`/`vm-reset`/`vm-shell`, `run`, `e2e`, `shell-frame`.
- `tests/e2e/run.sh` (в VM): per-unit `is-active`; `findmnt /data` опции; `busctl` имена Power/Settings;
fake-ACC `SetAcc``AccChanged`; Settings set→reboot→персист + machine-id стабилен; кадр (software-render PNG не пустой);
journald volatile / zram / eMMC-прокси.
## Часть 2 (по явному «ок» — тяжёлое)
- `just vm-up` (limactl start: установка limactl + Ubuntu-образ + провижининг) → `just e2e` (сквозная приёмка).
- По прохождении — `finishing-a-development-branch` (merge/PR — спросить пользователя).
---
## Acceptance
- Часть 1: `just ci` зелёный; `validate-manifest` good→ok / bad→fail; `new-plugin foo` → проходит валидатор;
юниты/Lima-yaml/E2E-скрипт на месте (lint shell-скрипта — `shellcheck` опц.).
- Часть 2: `just e2e` в Lima зелёный (приёмка v0.1/v0.6 + шагающий скелет, спека §9.4).