Гостовый puml

This commit is contained in:
2026-05-30 18:25:54 +03:00
parent 7bb62d0152
commit ee2c3a198c
41 changed files with 16484 additions and 18317 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 KiB

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 68 KiB

34
Report/puml/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Диаграммы PlantUML для ПЗ
## Что требует ГОСТ 7.32 (и чек-лист)
| Пункт | Требование |
|-------|------------|
| 6.5.2 | Чертежи, схемы, диаграммы — по **ЕСКД**; для блок-схем ПО — **ГОСТ 19.701-90** (аналог ISO 5807) |
| 6.5.3 | Без «объёмных» рисунков, только по делу |
| 6.5.7 | Подпись **в Typst**: «Рисунок N Наименование» (среднее тире), не внутри PNG |
| 6.5.8 | Наименование с прописной буквы, без точки в конце |
**ГОСТ 19.701-90 (кратко):** процесс — прямоугольник; решение — ромб; начало/конец — овал; линии — сплошные со стрелками; ч/б контуры; без декоративной заливки.
## Оформление в репозитории
- `plantuml-gost.cfg` — ч/б, прямоугольные блоки activity, шрифт с засечками, без тени (подключается в `render_puml.sh`).
- `_gost-theme.inc.puml` — напоминание не дублировать `title` в `.puml`.
- `scripts/normalize_puml_gost.py` — перед рендером убирает локальные `skinparam`/`title`, добавляет `!include _gost-theme.inc.puml`.
Подписи к рисункам задаются только в `includes/*.typ` через `pz-fig(...)`.
## Сборка
```bash
cd Report/scripts
./render_puml.sh
```
PNG: `Report/images/fig_*.png`.
## Ограничения PlantUML
- **BPMN**, **CJM**, **DFD** в `.puml` — упрощённые схемы; строгий ГОСТ 19.702 (схемы данных) или ЕСКД 2.x вручную в Visio/draw.io при необходимости нормоконтроля.
- Ввод/вывод (параллелограмм по ГОСТ) в activity-диаграмме PlantUML не выводится автоматически — для I/O используются обычные блоки процесса.

View File

@@ -0,0 +1,3 @@
' Подключать после @startuml: !include _gost-theme.inc.puml
' Базовые параметры задаёт plantuml-gost.cfg (-config в render_puml.sh).
' Не используйте title в .puml — подпись «Рисунок N …» только в Typst (pz-fig).

View File

@@ -1,18 +1,7 @@
@startuml fig_01_start_sync
!include _gost-theme.inc.puml
' Увеличенный растр для вставки в отчёт (Word / печать)
scale 3
title
Wallenc — старт приложения и фоновая синхронизация
end title
skinparam defaultFontName "DejaVu Sans"
skinparam activity {
BackgroundColor #F8F8F8
BorderColor #333333
DiamondBackgroundColor #E8F4FF
}
skinparam noteBackgroundColor #FFFDE7
skinparam noteBorderColor #F9A825
start

View File

@@ -1,17 +1,6 @@
@startuml fig_02_vault_lifecycle
!include _gost-theme.inc.puml
scale 3
title
Wallenc — жизненный цикл storage (IStorage)
внутри IVault; журнал синхронизации
end title
skinparam defaultFontName "DejaVu Sans"
skinparam state {
BackgroundColor #F8F8F8
BorderColor #333333
}
skinparam noteBackgroundColor #E3F2FD
skinparam noteBorderColor #1565C0
state "(Б) Список storage (LocalVault / VaultBrowser)" as List

View File

@@ -1,15 +1,6 @@
@startuml fig_03_navigation_hub
!include _gost-theme.inc.puml
scale 2
title
Wallenc — навигация (Main) и доменная иерархия
VaultsManager → IVault → IStorage → файлы
end title
skinparam defaultFontName "DejaVu Sans"
skinparam activityBackgroundColor #F8F8F8
skinparam activityBorderColor #333333
skinparam noteBackgroundColor #FCE4EC
skinparam noteBorderColor #C2185B
start

View File

@@ -1,11 +1,6 @@
@startuml fig_04_domain_class
title Модуль :domain — IVaultsManager / IVault / IStorage
!include _gost-theme.inc.puml
scale 1.15
skinparam shadowing false
skinparam classFontSize 10
skinparam packageStyle rectangle
skinparam nodesep 12
skinparam ranksep 18
' render_puml.sh: PLANTUML_LIMIT_SIZE=16384

View File

@@ -1,11 +1,6 @@
@startuml fig_11_room_schema
!include _gost-theme.inc.puml
scale 3
title Схема служебных сущностей Room (AppDb)
skinparam defaultFontName "DejaVu Sans"
skinparam class {
BackgroundColor #F8F8F8
BorderColor #333333
}
class AppDb <<Database>> {
storageKeyMapDao

View File

@@ -1,7 +1,6 @@
@startuml fig_14_context_system
!include _gost-theme.inc.puml
scale 3
title Контекстная диаграмма Wallenc
skinparam defaultFontName "DejaVu Sans"
actor "Пользователь" as User
rectangle "Wallenc (Android)" as App {

View File

@@ -1,11 +1,6 @@
@startuml fig_15_bpmn_vault
!include _gost-theme.inc.puml
scale 2
title BPMN: жизненный цикл storage (IStorage)
skinparam defaultFontName "DejaVu Sans"
skinparam activity {
BackgroundColor #F8F8F8
BorderColor #333333
}
start
:Создать **storage** в vault

View File

@@ -1,7 +1,6 @@
@startuml fig_16_dfd_level0
!include _gost-theme.inc.puml
scale 2
title DFD уровень 0: Wallenc
skinparam defaultFontName "DejaVu Sans"
actor User
rectangle "Процесс 0 — Wallenc" as P0 {

View File

@@ -1,7 +1,6 @@
@startuml fig_17_use_case
!include _gost-theme.inc.puml
scale 3
title Диаграмма прецедентов Wallenc
skinparam defaultFontName "DejaVu Sans"
left to right direction
actor "Пользователь" as User

View File

@@ -1,7 +1,6 @@
@startuml fig_18_deployment
!include _gost-theme.inc.puml
scale 3
title Развёртывание Wallenc
skinparam defaultFontName "DejaVu Sans"
node "Устройство Android" {
artifact "Wallenc.apk" as App

View File

@@ -1,7 +1,6 @@
@startuml fig_19_clean_architecture
!include _gost-theme.inc.puml
scale 3
title Clean Architecture и модули Gradle
skinparam defaultFontName "DejaVu Sans"
package ":ui" as UI {
[Compose экраны]

View File

@@ -1,7 +1,6 @@
@startuml fig_20_oauth_sequence
!include _gost-theme.inc.puml
scale 3
title OAuth 2.0: авторизация Яндекс
skinparam defaultFontName "DejaVu Sans"
actor User
participant "Wallenc UI" as UI

View File

@@ -1,11 +1,6 @@
@startuml fig_21_encrypt_flow
!include _gost-theme.inc.puml
scale 3
title Поток enableEncryption → checkKey → openStorage
skinparam defaultFontName "DejaVu Sans"
skinparam activity {
BackgroundColor #F8F8F8
BorderColor #333333
}
start
:Пользователь включает шифрование;

View File

@@ -1,7 +1,6 @@
@startuml fig_22_cjm_vault
!include _gost-theme.inc.puml
scale 3
title Customer Journey Map: защита storage
skinparam defaultFontName "DejaVu Sans"
|Этап|
|Осознание|

View File

@@ -1,8 +1,6 @@
@startuml fig_23_module_deps
!include _gost-theme.inc.puml
scale 3
title Зависимости модулей Gradle
skinparam defaultFontName "DejaVu Sans"
skinparam componentStyle rectangle
component ":app" as app
component ":ui" as ui

View File

@@ -1,13 +1,6 @@
@startuml fig_35_sync_merge_algorithm
!include _gost-theme.inc.puml
scale 2.5
title Wallenc — алгоритм согласования журналов синхронизации (StorageSyncEngine)
skinparam defaultFontName "DejaVu Sans"
skinparam activity {
BackgroundColor #F8F8F8
BorderColor #333333
DiamondBackgroundColor #E8F4FF
}
start

View File

@@ -1,9 +1,6 @@
@startuml fig_36_ml_on_device
!include _gost-theme.inc.puml
scale 2.5
title Wallenc — гипотетический контур on-device ML (без расшифровки на сервере)
skinparam defaultFontName "DejaVu Sans"
skinparam componentStyle rectangle
package "Приложение Wallenc" {
[UI / use cases] as UI

View File

@@ -0,0 +1,63 @@
' Глобальные параметры PlantUML для ПЗ (ГОСТ 7.32 п. 6.5.2 → ГОСТ 19.701-90 / ISO 5807).
' Подключается в scripts/render_puml.sh через -config.
skinparam monochrome true
skinparam shadowing false
skinparam roundcorner 0
skinparam defaultFontName "Liberation Serif"
skinparam defaultFontSize 12
skinparam defaultFontColor black
skinparam backgroundColor white
skinparam ArrowColor black
skinparam ArrowThickness 1
skinparam activityStyle rectangle
skinparam activity {
BackgroundColor white
BorderColor black
FontColor black
BorderThickness 1
DiamondBackgroundColor white
DiamondBorderColor black
BarColor black
}
skinparam activityDiamond {
BackgroundColor white
BorderColor black
}
skinparam note {
BackgroundColor white
BorderColor black
FontColor black
}
skinparam partition {
BackgroundColor white
BorderColor black
FontColor black
}
skinparam rectangle {
BackgroundColor white
BorderColor black
}
skinparam component {
BackgroundColor white
BorderColor black
}
skinparam package {
BackgroundColor white
BorderColor black
}
skinparam database {
BackgroundColor white
BorderColor black
}
skinparam cloud {
BackgroundColor white
BorderColor black
}
skinparam actor {
BorderColor black
FontColor black
}
skinparam usecase {
BackgroundColor white
BorderColor black
}

View File

@@ -0,0 +1,78 @@
#!/usr/bin/env python3
"""Приводит fig_*.puml к оформлению под ГОСТ: !include темы, без title и локальных skinparam."""
from __future__ import annotations
import re
from pathlib import Path
PUML_DIR = Path(__file__).resolve().parents[1] / "puml"
INCLUDE_LINE = "!include _gost-theme.inc.puml\n"
def strip_title_and_skinparam(text: str) -> str:
lines = text.splitlines(keepends=True)
out: list[str] = []
i = 0
while i < len(lines):
line = lines[i]
stripped = line.strip()
if stripped.startswith("skinparam"):
if "{" in stripped and "}" not in stripped:
i += 1
while i < len(lines) and "}" not in lines[i]:
i += 1
if i < len(lines):
i += 1
else:
i += 1
continue
if stripped.startswith("title"):
if stripped == "title":
i += 1
while i < len(lines) and lines[i].strip() != "end title":
i += 1
if i < len(lines):
i += 1
continue
i += 1
continue
if stripped in ("BackgroundColor", "BorderColor", "FontColor") or stripped.endswith(
("#F8F8F8", "#333333", "#E8F4FF", "#FFFDE7", "#F9A825")
):
i += 1
continue
if stripped == "}" and out and out[-1].strip().startswith("!include"):
i += 1
continue
out.append(line)
i += 1
return "".join(out)
def normalize_file(path: Path) -> bool:
text = path.read_text(encoding="utf-8")
original = text
text = strip_title_and_skinparam(text)
if INCLUDE_LINE.strip() not in text:
m = re.match(r"(@startuml\s+\S+\s*\n)", text)
if m:
text = text[: m.end()] + INCLUDE_LINE + text[m.end() :]
text = re.sub(r"\n{3,}", "\n\n", text)
if text != original:
path.write_text(text, encoding="utf-8")
return True
return False
def main() -> int:
changed = 0
for path in sorted(PUML_DIR.glob("fig_*.puml")):
if normalize_file(path):
changed += 1
print(f"updated: {path.name}")
print(f"Done. {changed} file(s) changed.")
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -6,6 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPORT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
PUML_DIR="$REPORT_DIR/puml"
IMG_DIR="$REPORT_DIR/images"
GOST_CFG="$PUML_DIR/plantuml-gost.cfg"
mkdir -p "$IMG_DIR"
@@ -26,6 +27,10 @@ if [[ ! -f "$JAR" ]]; then
exit 1
fi
if [[ -f "$GOST_CFG" ]]; then
python3 "$SCRIPT_DIR/normalize_puml_gost.py" >/dev/null
fi
shopt -s nullglob
PUML_FILES=("$PUML_DIR"/fig_*.puml)
if ((${#PUML_FILES[@]} == 0)); then
@@ -39,6 +44,8 @@ export PLANTUML_LIMIT_SIZE="${PLANTUML_LIMIT_SIZE:-16384}"
-DPLANTUML_LIMIT_SIZE="$PLANTUML_LIMIT_SIZE" \
-Xmx3g \
-jar "$JAR" \
-charset UTF-8 -tpng -o "$IMG_DIR" "${PUML_FILES[@]}"
-charset UTF-8 -tpng \
${GOST_CFG:+-config "$GOST_CFG"} \
-o "$IMG_DIR" "${PUML_FILES[@]}"
echo "Done. $(ls -1 "$IMG_DIR"/fig_*.png 2>/dev/null | wc -l) PNG in images/"

File diff suppressed because one or more lines are too long