Отчёт об оценке трудозатрат: Feature 028 — LLM Table Translation Service
Дата: 2026-05-18 (актуализация: 2026-06-07)
Ветка: 032-translate-requests-httpx
Автор: Speckit Workflow Specialist
Сводка
Feature 028 реализован полностью (~153 файла, ~36 091 строка кода, ~503 pytest, ~65 vitest).
Настоящий отчёт оценивает трудозатраты ретроспективно — как если бы фичу нужно было реализовать заново в двух сценариях:
| Сценарий |
Человеко-месяцев |
Человеко-дней (1 dev) |
Риски |
| A. Standalone (с нуля, без ss-tools) |
6.5–8.5 |
143–187 |
Высокие: инфраструктура с нуля |
| B. В рамках ss-tools |
2.5–3 |
55–66 |
Низкие: переиспользование отлаженных компонентов |
| Экономия ss-tools |
~62–65% |
— |
— |
Методология оценки
Оценка основана на:
- Фактическом объёме кода: 148 файлов, 34 909 строк (подтверждено
wc -l)
- Статистике дефектов/тестов: 503 pytest + 65 vitest
- Сложности модулей: 2× C5, 9× C4, 13× C3, 7× C2 (по GRACE-Poly v2.6)
- Анализе переиспользования: 7 интеграционных контрактов с существующей инфраструктурой ss-tools
- Метриках из смежных проектов: базовая производительность 50–100 строк/день для C4+ с учётом тестов
Норматив: 30–50 строк кода в день на C4+ модули (с учётом тестов, документирования, семантических контрактов, ревью), 80–120 строк/день для C1–C2.
1. Сценарий A: Standalone-реализация
Что нужно построить с нуля
Feature 028 — это полноценный full-stack web-сервис. В standalone-сценарии вся инфраструктура пишется с нуля:
1.1 Инфраструктура бэкенда
| Компонент |
Аналог в ss-tools |
Строк кода |
Трудозатраты (дней) |
| FastAPI-приложение (app, middleware, CORS, lifespan) |
backend/src/app.py |
~600 |
5 |
| Система аутентификации (JWT, пароли, сессии) |
backend/src/auth/ |
~2 500 |
20 |
| RBAC (роли, permissions, проверки в DI) |
backend/src/services/rbac_permission_catalog.py |
~1 500 |
12 |
| SQLAlchemy Base, engine, session factory, миграции Alembic |
backend/src/core/database.py |
~400 |
3 |
| Plugin system (PluginBase, PluginLoader, авто-дискавери) |
backend/src/core/plugin_base.py |
~800 |
6 |
| Superset API client (datasources, datasets, SQL Lab) |
backend/src/core/superset_client/ |
~3 500 |
25 |
| LLM provider management (CRUD, шифрование ключей, OpenAI-клиент) |
backend/src/services/llm_provider.py |
~1 200 |
10 |
| APScheduler integration + SchedulerService |
backend/src/core/scheduler.py |
~600 |
5 |
| WebSocket infrastructure + TaskManager |
backend/src/core/ws_log_handler.py, task_manager/ |
~1 200 |
10 |
| NotificationService (SMTP, Telegram, Slack) |
backend/src/services/notifications/ |
~800 |
6 |
| Event logging / audit trail система |
events.py паттерны |
~500 |
4 |
| Retention/pruning утилиты |
events.prune_expired() |
~300 |
3 |
| Subtotal infrastructure |
|
~13 900 |
109 |
1.2 Инфраструктура фронтенда
| Компонент |
Аналог в ss-tools |
Строк кода |
Трудозатраты (дней) |
| SvelteKit-приложение (настройка, роутинг, layout) |
frontend/ |
~1 000 |
7 |
| API-клиент (fetchApi/requestApi с токенами, ошибками) |
frontend/src/lib/api/ |
~500 |
4 |
| Система аутентификации (login, logout, token refresh) |
frontend/src/lib/auth/ |
~800 |
6 |
| WebSocket-клиент для TaskManager |
frontend/src/lib/stores/task.js |
~400 |
3 |
| UI-kit / компонентная база (Tailwind, кнопки, формы, таблицы) |
frontend/src/lib/components/ |
~2 000 |
14 |
| i18n (русский + английский) |
frontend/src/lib/i18n/ |
~1 000 |
7 |
| Subtotal infrastructure |
|
~5 700 |
41 |
1.3 DevOps / CI / CD
| Компонент |
Трудозатраты (дней) |
| Dockerfile + docker-compose (backend + frontend + db + redis) |
5 |
| GitHub Actions / CI (тесты, линтинг, сборка) |
3 |
| Настройка PostgreSQL, миграции, бэкапы |
2 |
| Subtotal DevOps |
10 |
1.4 Бизнес-логика (домен перевода)
Этот компонент общий для обоих сценариев — чистая доменная логика, идентичная по объёму,
но в ходе реализации была значительно декомпозирована (59 plugin-файлов вместо ~14).
| Компонент |
Строк кода |
Файлов |
Трудозатраты (дней) |
| ORM модели (15 таблиц) |
401 |
1 |
3 |
| Pydantic схемы (35+ DTO) |
712 |
1 |
4 |
| Plugin skeleton |
61 |
1 |
0.5 |
| Orchestrator (14 файлов) |
1 631 |
14 |
15 |
| Executor (executor, batch, llm, run*) |
2 196 |
9 |
21 |
| Preview (11 файлов) |
1 291 |
11 |
12 |
| Dictionary (7 файлов) |
921 |
7 |
9 |
| Service (6 файлов) |
1 281 |
6 |
11 |
| Scheduler + schedule CRUD |
443 |
1 |
5 |
| SQLGenerator |
402 |
1 |
4 |
| SupersetSqlLabExecutor |
439 |
1 |
4 |
| ContextAwarePromptBuilder |
153 |
1 |
2 |
| TranslationMetrics |
192 |
1 |
2 |
| TranslationEventLog |
274 |
1 |
3 |
| _token_budget |
395 |
1 |
4 |
| _utils |
225 |
1 |
2 |
| _lang_detect + _text_cleaner |
270 |
2 |
3 |
| _llm_async_http |
246 |
1 |
3 |
| service_target_schema |
355 |
1 |
4 |
| Subtotal backend domain |
~11 888 |
59 |
105 |
| API routes (13 файлов, 2 296 строк) |
2 296 |
13 |
15 |
| Frontend Svelte components (14 файлов) |
5 017 |
14 |
38 |
| Frontend pages (5 файлов) |
1 237 |
5 |
14 |
| Frontend API client (8 файлов) |
987 |
8 |
8 |
| Subtotal frontend domain |
~9 537 |
40 |
75 |
| Subtotal domain logic |
~21 425 |
99 |
180 |
1.5 Тестирование
| Компонент |
Строк кода |
Файлов |
Трудозатраты (дней) |
| Unit-тесты бэкенда (inline в plugin, 27 файлов) |
9 090 |
27 |
32 |
| Интеграционные тесты (external, 12 файлов) |
3 746 |
12 |
16 |
| Plugin integration (2 файла) |
279 |
2 |
2 |
| Component-тесты фронтенда (5 файлов) |
699 |
5 |
5 |
| Model-тесты фронтенда (2 файла) |
406 |
2 |
3 |
| E2E (1 файл) |
142 |
1 |
1 |
| Subtotal testing |
~14 083 |
47 |
59 |
Итог: Сценарий A
| Категория |
Строк кода |
Файлов |
Трудозатраты (дней) |
| Бэкенд инфраструктура |
13 900 |
— |
109 |
| Фронтенд инфраструктура |
5 700 |
— |
41 |
| DevOps / CI |
— |
— |
10 |
| Бэкенд домен |
11 888 |
59 |
105 |
| Фронтенд домен + routes |
9 537 |
40 |
75 |
| Тесты |
14 083 |
47 |
59 |
| ИТОГО |
~55 108 |
~146 |
399 days |
Реалистичная оценка с учётом параллелизации:
- 2 full-stack разработчика: ~6–7 месяцев
- Команда (бэкенд + фронтенд + QA): ~4–5 месяцев
- Рекомендованная оценка: 6.5–8.5 человеко-месяцев
2. Сценарий B: В рамках ss-tools
Что переиспользуется
ss-tools предоставляет готовую отлаженную инфраструктуру, которая в сценарии A пишется с нуля:
2.1 Переиспользуемые компоненты (7 интеграционных контрактов)
| Компонент |
Строк кода |
Экономия (дней) |
Готовность |
| FastAPI app + middleware + lifespan |
600 |
5 |
✅ Работает в production |
| Аутентификация (JWT, сессии, OAuth) |
2 500 |
20 |
✅ Проверена |
| RBAC (PermissionChecker, seed permissions) |
1 500 |
12 |
✅ 2543 permissions |
| SQLAlchemy Base + движок + миграции |
400 |
3 |
✅ 7 миграций |
| Plugin system (PluginBase, loader, lifecycle) |
800 |
6 |
✅ 4 плагина |
| SupersetClient (datasets, charts, databases, SQL Lab) |
3 500 |
25 |
✅ ~540 строк тестов |
| LLMProviderService (CRUD, Fernet-шифрование, OpenAI-клиент) |
1 200 |
10 |
✅ retry + fallback |
| SchedulerService (APScheduler, cron, load_schedules) |
600 |
5 |
✅ 3.11.2 |
| WebSocket + TaskManager (логгирование, прогресс, источники) |
1 200 |
10 |
✅ TaskLogRecord |
| NotificationService (SMTP, Telegram, Slack) |
800 |
6 |
✅ 3 провайдера |
| Event logging (pattern из TranslationEventLog) |
500 |
4 |
✅ Доказан |
| Retention/pruning (pattern из MetricSnapshot) |
300 |
3 |
✅ Доказан |
| SvelteKit приложение (lazy loading, роутинг, layouts) |
1 000 |
7 |
✅ Svelte 5 |
| API client (fetchApi, requestApi, токены) |
500 |
4 |
✅ 10+ API клиентов |
| WebSocket client (TaskManager WS) |
400 |
3 |
✅ |
| UI-kit (Tailwind, кнопки, формы, таблицы) |
2 000 |
14 |
✅ 20+ компонентов |
| i18n (en + ru, паттерн) |
1 000 |
7 |
✅ 5+ модулей перевода |
| Docker Compose (3 сервиса) |
— |
5 |
✅ |
| CI (GitHub Actions) |
— |
3 |
✅ |
| ИТОГО экономия |
~18 800 |
152 дня |
— |
2.2 Что нужно построить (только домен)
Важно: В ходе дальнейшей разработки код был расширен — добавились новые модули (_lang_detect, _text_cleaner, _llm_async_http, service_target_schema) и тесты.
Общий объём кода: ~10 174 строк (plugin) + 401 (models) + 712 (schemas) = 11 287 строк в backend domain.
| Компонент |
Строк кода |
Файлов |
Трудозатраты (дней) |
| Backend domain |
|
|
|
ORM модели (в models/translate.py) |
401 |
1 |
3 |
Pydantic схемы (в schemas/translate.py) |
712 |
1 |
4 |
| Plugin skeleton (plugin.py) |
61 |
1 |
0.5 |
| Orchestrator (14 файлов: planner, exec, sql, retry, cancel, validation, aggregator, run_completion, runner, lang_stats, query, config, sql_rows) |
1 631 |
14 |
15 |
| Executor / LLM (9 файлов: executor, _llm_call, _llm_parse, _llm_async_http, _batch_insert, _batch_proc, _batch_sizer, _run_service, _run_source) |
2 196 |
9 |
21 |
| Preview (11 файлов: executor, prompt_builder, prompt_helpers, response_parser, review, session_ops, session_serializer, token_estimator, constants, resolve_provider) |
1 291 |
11 |
12 |
| Dictionary (7 файлов: correction, crud, entries, filter, import_export, validation) |
921 |
7 |
9 |
| Service (6 файлов: bulk_replace, inline_correction, datasource, target_schema, utils) |
1 281 |
6 |
12 |
| Scheduler (+ cron utils) |
443 |
1 |
5 |
| SQLGenerator |
402 |
1 |
4 |
| SupersetSqlLabExecutor |
439 |
1 |
4 |
| PromptBuilder |
153 |
1 |
2 |
| Metrics |
192 |
1 |
2 |
| Events |
274 |
1 |
3 |
| _token_budget |
395 |
1 |
4 |
| _utils |
225 |
1 |
2 |
| _lang_detect |
207 |
1 |
2 |
| _text_cleaner |
63 |
1 |
1 |
| Subtotal backend domain |
~11 287 |
59 |
105 |
| Backend routes (13 файлов) |
2 296 |
13 |
15 |
| Frontend UI (27 файлов) |
|
|
|
| Компоненты (14 svelte-файлов) |
5 017 |
14 |
38 |
| Страницы (5 svelte-файлов) |
1 237 |
5 |
14 |
| API client (8 js/ts-файлов) |
987 |
8 |
8 |
| Subtotal frontend |
~7 241 |
27 |
60 |
| Тесты |
|
|
|
| Inline plugin tests (27 файлов) |
9 090 |
27 |
32 |
| External integration tests (10 файлов) |
3 467 |
10 |
15 |
| Plugin integration (2 файла) |
279 |
2 |
2 |
| Frontend component tests (5 файлов) |
699 |
5 |
5 |
| Frontend model tests (2 файла) |
406 |
2 |
3 |
| E2E (1 файл) |
142 |
1 |
1 |
| Subtotal tests |
~14 083 |
47 |
58 |
| Алембик миграции (5 файлов) |
801 |
5 |
4 |
| Семантические контракты + документирование |
— |
— |
5 |
| Subtotal |
~36 307 |
148 |
247 |
Примечание по effort: Добавлены новые модули (_lang_detect, _text_cleaner, _llm_async_http, service_target_schema) и существенно расширены тесты (+5 021 строка, +20 файлов), что увеличило backend domain на ~5 дней, frontend на ~6 дней и тесты на ~24 дня.
Итог: Сценарий B
| Категория |
Строк кода |
Файлов |
Трудозатраты (дней) |
| Переиспользовано (бесплатно) |
~18 800 |
— |
0 |
| Бэкенд домен |
11 287 |
59 |
105 |
| API routes |
2 296 |
13 |
15 |
| Фронтенд |
7 241 |
27 |
60 |
| Тесты |
14 083 |
47 |
58 |
| Миграции + документация |
801 |
5 |
9 |
| ИТОГО |
~36 091 |
~153 |
247 days |
Реалистичная оценка с учётом параллелизации:
- 1 full-stack разработчик (знакомый с ss-tools): ~3–3.5 месяца
- 2 разработчика (бэкенд + фронтенд): ~2.5–3 месяца
- Рекомендованная оценка: 2.5–3 человеко-месяца
3. Сравнительный анализ
3.1 Таблица сравнения
| Измерение |
Standalone (A) |
В ss-tools (B) |
Разница |
| Всего строк кода |
~55 108 |
~36 091 |
-35% |
| Из них нового кода |
100% |
66% |
— |
| Инфраструктура |
19 600 строк (36%) |
0 (переиспользовано) |
-100% |
| Домен (бэк + фронт) |
21 425 |
20 824 |
-3% |
| Тесты |
14 083 |
14 083 |
0% (те же) |
| Файлов всего |
~146 |
~151 |
+3% |
| Человеко-дней |
399 |
247 |
-38% |
| Человеко-месяцев |
6.5–8.5 |
2.5–3 |
-62–65% |
| Рыночная стоимость* |
3.6–4.8 млн ₽ |
1.4–1.7 млн ₽ |
экономия ~2.2–3.1 млн ₽ |
* При ставке ~3 500 ₽/час (senior full-stack developer, РФ, фриланс/контракт). 1 человеко-месяц ≈ 160 часов ≈ 560 000 ₽.
Диапазон: 6.5 мес × 560К = 3.64 млн (min) … 8.5 мес × 560К = 4.76 млн (max) для сценария A.
Среднерыночная ставка на 2025–2026 гг. по данным Хабр Карьера, Kwork, fl.ru для senior-уровня.
3.2 Что конкретно экономит ss-tools
| Компонент |
Экономия |
Почему существенно |
| SupersetClient |
25 дней |
Написать клиент для /api/v1/sqllab/execute/, датасорсов, метаданных — недели отладки |
| LLMProviderService |
10 дней |
Без него: своя БД для провайдеров, Fernet-шифрование, retry-логика, тесты |
| RBAC/Permissions |
12 дней |
Иначе: своя таблица прав, middleware, owner-scoping, seed-скрипты |
| SchedulerService |
5 дней |
APScheduler с BackgroundScheduler, cron-триггеры, load_schedules |
| WebSocket/TaskManager |
10 дней |
Иначе: свой WebSocket-хаб, логика reconnect, истории сообщений |
| NotificationService |
6 дней |
Иначе: SMTP-клиент, Telegram Bot API, Slack Webhook — всё с нуля |
| Plugin system |
6 дней |
Иначе: свой механизм авто-дискавери и lifecycle |
| Alembic env + Base |
3 дня |
Иначе: настройка env.py, autogenerate, SQLite-совместимость |
| Frontend infra |
35 дней |
SvelteKit, auth, WS-клиент, UI-kit, i18n — ~35 дней на дизайн-систему |
| Docker + CI |
8 дней |
Dockerfile, docker-compose, GitHub Actions |
| ИТОГО |
~120 дней |
|
3.3 Профиль рисков
| Риск |
Standalone (A) |
В ss-tools (B) |
| Ошибки в интеграции с Superset API |
Высокий (с нуля) |
Низкий (проверено 4 плагинами) |
| Утечка API-ключей LLM |
Высокий (своё шифрование) |
Низкий (Fernet proven) |
| Race conditions в планировщике |
Высокий (свой APScheduler) |
Низкий (production experience) |
| Потеря WebSocket-соединений |
Высокий (свой WS) |
Низкий (TaskManager proven) |
| SQL-инъекции в генераторе |
Средний (новый код) |
Средний (тот же код) |
| Семантическая задолженность |
Никто не проверяет |
✅ GRACE audit |
4. Расхождение спецификации и реализации
В ходе анализа выявлены существенные расхождения между spec/plan и фактической реализацией:
4.1 Архитектурные расхождения
| Аспект |
Как описано в spec/plan |
Как реализовано |
Критичность |
| Тип архитектуры |
Plugin-based (TranslatePlugin.execute() — основной entry point) |
Service-based: Plugin только скелет (raise NotImplementedError), вся логика в сервисах |
🔴 Высокая |
| Файл роутера |
backend/src/api/routes/translate.py (один файл) |
backend/src/api/routes/translate/ (пакет, 13 файлов) |
🟡 Средняя |
| Файлы не из плана |
_token_budget.py, _utils.py, _helpers.py, prompt_builder.py, superset_executor.py, service.py |
Существуют, но не описаны |
🟡 Средняя |
| Компоненты не из плана |
CorrectionCell.svelte, BulkReplaceModal.svelte, TranslationRunGlobalIndicator.svelte, TranslationMetricsDashboard.svelte, translateStore.js |
Существуют, но не описаны |
🟡 Средняя |
| Plugin skeleton |
C3 с полной функциональностью |
C2 с NotImplementedError |
🟢 Низкая (регистрационный артефакт) |
4.2 Расхождения в семантических контрактах
| Контракт |
Spec (C?) |
Reality (C?) |
Файл |
TranslatePlugin:Module |
C3 |
C2 |
plugin.py |
TranslateRoutes:Module |
C3 |
C4 |
__init__.py |
TranslateRouterModule |
не описан |
C1 |
_router.py |
SQLGenerator:Class |
C4 |
C3 |
sql_generator.py |
SupersetSqlLabExecutor:Class |
не описан |
C3 |
superset_executor.py |
ContextAwarePromptBuilder:Class |
C3 |
существует |
prompt_builder.py |
InlineCorrectionService:Class |
C4 |
C3 (de facto) |
service.py |
BulkFindReplaceService:Class |
C4 |
C3 (de facto) |
service.py |
TranslateJobService:Class |
не описан |
C4 |
service.py |
4.3 Спецификация API / quickstart
- Quickstart: Использует
target_language: "ru" (single-language API) вместо target_languages: ["ru"]
- Quickstart: Путь тестов
backend/tests/test_translate_api.py не существует (реальность: test_translate_jobs.py и др.)
- Quickstart:
ruff check использует неверный путь src/api/routes/translate.py (должен быть src/api/routes/translate/)
5. Выводы
Для бизнеса
- Строить в ss-tools выгодно: экономия ~62–65% стоимости и времени (с поправкой на актуальную реализацию)
- Standalone не имеет смысла для этого функционала: 35% кода — инфраструктура, которая уже есть в ss-tools
- Качество выше в ss-tools за счёт переиспользования проверенных компонентов (RBAC, LLM, WebSocket)
Для команды
- Реализация заняла бы 2.5–3 месяца в ss-tools против 6.5–8.5 standalone
- Основная сложность — не инфраструктура, а доменная логика (executor, orchestrator, обработка LLM-ответов)
- Код был существенно расширен в процессе дальнейшей разработки: 59 файлов plugin, 148 файлов всего, 34 909 строк.
- Cамые сложные модули (по совокупному объёму):
Orchestrator (1 631 строка, 14 файлов, 15 дней) — координация run lifecycle, snapshot isolation
Executor + LLM (2 196 строк, 9 файлов, 21 день) — парсинг LLM-ответов, батчинг, retry, caching
Preview (1 291 строка, 11 файлов, 12 дней) — quality gate, approve/edit/reject lifecycle
Dictionary (921 строка, 7 файлов, 9 дней) — CRUD + import/export + per-batch filtering
Service (1 281 строка, 6 файлов, 12 дней) — job coordination, target schema, inline correction
Рекомендации по актуализации specks
- spec.md: статус → "Implemented", добавить секцию Architecture Notes
- plan.md: исправить file path (package vs single file), добавить недостающие модули
- contracts/modules.md: выровнять @COMPLEXITY с реальностью, добавить новые контракты
- quickstart.md: обновить примеры API на multi-language
- tasks.md: добавить closure summary с реальными метриками (148 файлов, 34 909 строк)
Приложение A: Детальный breakdown по файлам (актуальная реализация)
В ходе дальнейшей разработки код был расширен: добавлены новые модули, расширены тесты.
Общий объём кода: 74 файла backend source + 27 frontend source + 47 тестов = 148 файлов, ~34 909 строк.
Бэкенд (74 файла source + 39 файлов тестов, ~13 585 source + ~12 836 тестов)
Plugin core (59 файлов, 10 174 строк source)
Orchestrator (14 файлов, 1 631 строка)
| Файл |
Строк |
Назначение |
orchestrator.py |
175 |
Entry point / facade |
orchestrator_planner.py |
127 |
Run planning: target langs, batches |
orchestrator_exec.py |
121 |
Translation execution coordinator |
orchestrator_sql.py |
118 |
SQL generation stage |
orchestrator_sql_rows.py |
115 |
Row fetch + pagination |
orchestrator_aggregator.py |
139 |
Results aggregation |
orchestrator_retry.py |
136 |
Retry logic for failed batches |
orchestrator_cancel.py |
120 |
Run cancellation |
orchestrator_validation.py |
61 |
Post-run validation |
orchestrator_run_completion.py |
139 |
Run finalization (status, error_message) |
orchestrator_runner.py |
76 |
Background task runner |
orchestrator_lang_stats.py |
87 |
Per-language statistics |
orchestrator_query.py |
148 |
Query builder / data source queries |
orchestrator_config.py |
69 |
Configuration merging |
Preview (11 файлов, 1 291 строка)
| Файл |
Строк |
Назначение |
preview.py |
286 |
Main facade: run, accept, reject |
preview_executor.py |
149 |
LLM call orchestration |
preview_prompt_builder.py |
133 |
Prompt construction per language |
preview_prompt_helpers.py |
111 |
Prompt formatting utilities |
preview_response_parser.py |
158 |
Parse LLM responses |
preview_review.py |
136 |
Quality gate / approval logic |
preview_session_ops.py |
94 |
Preview session persistence |
preview_session_serializer.py |
101 |
Session serialize/deserialize |
preview_token_estimator.py |
51 |
Token budget estimation |
preview_constants.py |
48 |
Constants / defaults |
preview_resolve_provider.py |
24 |
LLM provider resolution |
Executor / Batch / LLM (9 файлов, 2 196 строк)
| Файл |
Строк |
Назначение |
executor.py |
272 |
Main facade: batch dispatch, caching |
_llm_call.py |
540 |
Centralized LLM call with retry + fallback |
_llm_parse.py |
116 |
Parse LLM streamed responses |
_llm_async_http.py |
246 |
Async HTTP transport for LLM APIs |
_batch_insert.py |
246 |
Insert results to Superset datasource |
_batch_proc.py |
259 |
Batch processing coordination |
_batch_sizer.py |
201 |
Dynamic batch sizing by token budget |
_run_service.py |
175 |
Run create/update/status queries |
_run_source.py |
141 |
Source row fetching + pagination |
Dictionary (7 файлов, 921 строка)
| Файл |
Строк |
Назначение |
dictionary.py |
63 |
Facade / re-exports |
dictionary_crud.py |
129 |
Create, read, update entries |
dictionary_entries.py |
184 |
Entry query + filtering |
dictionary_filter.py |
140 |
Per-batch dynamic filter construction |
dictionary_correction.py |
192 |
Correction CRUD + batch apply |
dictionary_import_export.py |
196 |
CSV import/export |
dictionary_validation.py |
17 |
Entry validation rules |
Service (6 файлов, 1 281 строка)
| Файл |
Строк |
Назначение |
service.py |
274 |
Job CRUD + run coordination |
service_inline_correction.py |
221 |
Inline correction orchestration |
service_bulk_replace.py |
189 |
Bulk find-and-replace |
service_datasource.py |
171 |
Datasource metadata service |
service_target_schema.py |
355 |
Target schema management |
service_utils.py |
71 |
Shared service utilities |
Standalone modules (12 файлов, 2 854 строки)
| Файл |
Строк |
Сложность |
Назначение |
scheduler.py |
443 |
C4 |
Schedule CRUD + APScheduler dispatch |
superset_executor.py |
439 |
C3 |
Superset SQL Lab API client |
sql_generator.py |
402 |
C3 |
Dialect-aware SQL generation |
_token_budget.py |
395 |
C2 |
Token estimation |
_lang_detect.py |
207 |
C2 |
Language detection for SQL |
_utils.py |
225 |
C1 |
Shared utilities |
events.py |
274 |
C3 |
Structured event log + pruning |
metrics.py |
192 |
C2 |
Metrics aggregation |
prompt_builder.py |
153 |
C3 |
Context-aware prompt construction |
_text_cleaner.py |
63 |
C1 |
Text sanitization utilities |
plugin.py |
61 |
C2 |
Plugin skeleton |
__init__.py |
2 |
— |
Package marker |
Routes (13 файлов, 2 296 строк)
| Файл |
Строк |
Назначение |
__init__.py |
42 |
Package init + router registration |
_router.py |
13 |
APIRouter instance |
_job_routes.py |
285 |
Job CRUD endpoints |
_run_routes.py |
205 |
Run execution endpoints |
_run_list_routes.py |
359 |
Run list/detail/CSV |
_run_edit_routes.py |
200 |
Run edit endpoints |
_run_history_routes.py |
133 |
Run history endpoints |
_preview_routes.py |
194 |
Preview endpoints |
_dictionary_routes.py |
391 |
Dictionary endpoints |
_correction_routes.py |
100 |
Correction endpoints |
_schedule_routes.py |
239 |
Schedule endpoints |
_metrics_routes.py |
65 |
Metrics endpoints |
_helpers.py |
70 |
Response helpers |
Models + Schemas (2 файла, 1 113 строк)
| Файл |
Строк |
Назначение |
models/translate.py |
401 |
15 ORM моделей |
schemas/translate.py |
712 |
35+ Pydantic схем |
Миграции (5 файлов, ~801 строка)
Тесты бэкенда
Inline plugin tests (27 файлов, 9 090 строк)
| Файл |
Строк |
Назначение |
test_orchestrator.py |
880 |
Orchestrator unit tests |
test_inline_correction.py |
792 |
Inline correction tests |
test_executor.py |
698 |
Executor + LLM call tests |
test_orthogonal_fixes.py |
616 |
Edge case + regression tests |
test_preview.py |
610 |
Preview engine tests |
test_clickhouse_insert_integration.py |
546 |
CH insert integration |
test_scheduler.py |
407 |
Scheduler unit tests |
test_sql_generator.py |
368 |
SQL generation tests |
test_enforce_dictionary.py |
168 |
Dictionary enforcement tests |
test_batch_sizer.py |
155 |
Batch sizing tests |
test_target_schema.py |
145 |
Target schema tests |
test_dictionary_filter.py |
228 |
Dynamic filter tests |
test_dictionary_crud.py |
218 |
Dictionary CRUD tests |
test_token_budget.py |
195 |
Token estimation tests |
test_dictionary_import.py |
177 |
Import/export tests |
test_dictionary_correction.py |
124 |
Correction tests |
test_batch_classify_persist.py |
143 |
Batch classification tests |
test_dictionary_prompt_builder.py |
111 |
Prompt builder tests |
test_metrics_cumulative.py |
98 |
Metrics cumulative tests |
test_dict_snapshot_hash.py |
76 |
Dictionary hash tests |
test_lang_detect.py |
67 |
Language detection tests |
test_text_cleaner.py |
48 |
Text cleaner tests |
test_dialect_detection_orthogonal.py |
42 |
Dialect detection tests |
test_dictionary_utils.py |
36 |
Dictionary utility tests |
test_dictionary.py |
20 |
Dictionary facade tests |
External integration tests (10 файлов, 3 467 строк)
| Файл |
Строк |
Назначение |
test_translate_jobs.py |
563 |
API job lifecycle |
test_translate_history.py |
467 |
History API |
test_translate_scheduler_execution.py |
399 |
Execution integration |
test_translate_scheduler_guard.py |
298 |
Guard/validation |
test_translate_executor_filter.py |
289 |
Executor filter logic |
test_translate_scheduler.py |
195 |
Scheduler integration |
test_translate_corrections.py |
249 |
Correction API |
test_core_scheduler.py |
518 |
Core scheduler tests |
core/test_async_regression.py |
370 |
Async regression tests |
test_alembic_migrations.py |
119 |
Migration tests |
Plugin external integration tests (2 файла, 279 строк)
| Файл |
Строк |
Назначение |
test_llm_async.py |
193 |
LLM async integration tests |
test_async_concurrency.py |
86 |
Async concurrency tests |
Фронтенд (27 файлов source + 8 файлов тестов, ~7 241 source + ~1 247 тестов, включая e2e)
Компоненты (14 файлов, 3 451 строка)
| Файл |
Строк |
Назначение |
TranslationPreview.svelte |
561 |
Preview component (quality gate) |
TranslationRunResult.svelte |
464 |
Run result display |
BulkReplaceModal.svelte |
396 |
Find-and-replace modal |
RunTabContent.svelte |
370 |
Run tab content |
TargetTabForm.svelte |
358 |
Target language tab form |
TermCorrectionPopup.svelte |
342 |
Single correction popup |
CorrectionCell.svelte |
326 |
Inline editable cell |
TranslationRunProgress.svelte |
310 |
Live progress with retry |
ScheduleConfig.svelte |
286 |
Schedule editor |
BulkCorrectionSidebar.svelte |
285 |
Bulk correction panel |
ConfigTabForm.svelte |
274 |
Configuration tab form |
TranslationRunGlobalIndicator.svelte |
198 |
Global run indicator |
TranslationMetricsDashboard.svelte |
184 |
Metrics dashboard |
TargetSchemaHint.svelte |
62 |
Target schema hint tooltip |
Страницы (5 файлов, 3 354 строки)
| Файл |
Строк |
Назначение |
[id]/+page.svelte |
1 363 |
Job detail (config + run + results) |
dictionaries/[id]/+page.svelte |
821 |
Dictionary editor |
history/+page.svelte |
523 |
Run history |
dictionaries/+page.svelte |
270 |
Dictionary list |
+page.svelte |
279 |
Job list |
API client (7 файлов, 829 строк)
| Файл |
Строк |
Назначение |
translate.ts |
382 |
Main translate API client |
runs.js |
— |
Run status/control API |
jobs.js |
— |
Job CRUD API |
dictionaries.js |
— |
Dictionary CRUD API |
corrections.js |
— |
Correction API |
schedules.js |
— |
Schedule API |
datasources.js |
— |
Datasource API |
target-schema.ts |
83 |
Target schema API |
Store + i18n (2 файла, 377 строк)
| Файл |
Строк |
Назначение |
translationRun.js |
198 |
Run state store |
i18n/index.ts |
179 |
en + ru translation keys |
Frontend-тесты (8 файлов, 1 247 строк)
| Файл |
Строк |
Назначение |
tests/TranslationJobModel.test.ts |
354 |
Job model tests |
tests/test_translation_preview.svelte.js |
199 |
Preview component tests |
tests/TargetSchemaHint.test.ts |
158 |
Target schema hint tests |
tests/test_correction_cell.svelte.js |
136 |
CorrectionCell tests |
tests/test-target-schema.test.ts |
109 |
Target schema API tests |
tests/test_bulk_replace_modal.svelte.js |
97 |
BulkReplace modal tests |
tests/TranslateHistoryModel.test.ts |
52 |
History model tests |
translation.e2e.js |
142 |
E2E: create run, check progress |
Отчёт сгенерирован по результатам анализа spec-файлов и реализованного кода feature 028.