ЛР 2: закрыть уровень 4

Завершить PostgreSQL, Redis-сессии, миграции, таймауты и диагностику. Зафиксировать собственные тесты и доказательства финального прогона: 43 PASS, 0 FAIL, 0 SKIP; 768 HTTP-запросов без ошибок. Добавить официальный отчёт с запуском, архитектурой, SQL-планами и ограничениями. PR отложен до завершения уровня 5.
This commit is contained in:
2026-10-28 13:30:26 +03:00
parent 65003b6119
commit 834876c938
288 changed files with 107634 additions and 19 deletions
@@ -0,0 +1,84 @@
# Проверка новых тестовых заготовок lab2 — 14.10.2026
Результат: **новый инструментарий проверен на синтетических фикстурах**.
Это не полный повторный прогон последней версии приложения и не приёмка на 5.
## Добавлено
В student-tests/lab2: 16 выбираемых suites, конфигурация без секретов,
дополнительные business/cursor/read-after-write сценарии, переиспользование
существующих auth/expiry/persistence/dependency проверок, явные адаптеры
кэша/отказов/бюджетов, SQL probe с реальным repository SQL, пример application CI
и документация/матрица покрытия всех блоков LAB2_CHECKLIST.md.
Нереализованные hooks/отсутствующий Redis/невыбранный трек не дают PASS:
результат BLOCKED, exit 2. Ошибка сценария — FAIL, exit 1. Exit 0 относится
только к успешно выполненным выбранным сценариям. Включение инфраструктурных
hooks требует явного --allow-hooks. Без --suite ничего не запускается.
## Выполненные проверки
| Проверка | Результат |
| --- | --- |
| Python self-tests инструментария | 9 PASS |
| Go SQL probe self-tests с -race | 2 PASS |
| make check | PASS |
| Python AST и ссылки документации | PASS |
| Пример application CI YAML | Синтаксис проверен; на CI не запускался |
| business-boundaries | PASS |
| business-cursors | PASS |
| concurrent read-after-write | PASS |
| sql-plan, 10 000 сообщений | PASS, реальный SQL и scan budget |
| sql-experiment, 100 000 сообщений | Два варианта измерены; выводы требуют ручного анализа |
| Backup → пустая новая БД → сравнение | PASS: количества и полные ordered SHA-256 всех пяти таблиц |
| Переносимый Compose restart adapter + существующий auth persistence | PASS |
| Cleanup только собственного тестового стенда | PASS, exit 0 |
SQL compare создал распределение чатов 70/20/6/3/1%, сравнил chat_id и
(chat_id,created_at,id), сохранил планы, размеры индексов, read и insert+COMMIT
latency. Измерение прототипное: прогретые планы, один host, cleanup может
оставлять bloat. Оно проверяет работоспособность генератора/методики, а не
доказывает готовый исследовательский вывод для отчёта студента.
SQL plan на финальной версии адаптера дополнительно проверил фактическое число
строк/распределение; данные, версии PostgreSQL/Go и планы — в final-plan.json.
## Область стенда
Проект highload-lab2-test-b3695867: новые синтетические secrets, новые собственные
порты/volume, отдельные lab2_test_* схемы. HTTP API — свежесобранный на начало
проверки образ. Для проверки restore создана пустая lab2_restore_fixture БД
в этом же временном PostgreSQL. Это функциональная проверка восстановительного
адаптера, не доказательство восстановления отдельного физического volume.
Дамп временно сохранялся приватно в /tmp и после проверки удалён; в evidence
не копировались dump, DSN, пароли или bearer-токены.
После проверки удалены только временные контейнеры/сеть/volume этого проекта.
Индексные/плановые режимы сами создавали и удаляли исключительно свои схемы;
сохраняемый seed использован явно только для backup/restore и удалён вместе
с тестовым volume. Рабочая БД не использовалась.
## Что НЕ проверено и потребует адаптации
- Реальное использование Redis/Valkey, critical/fallback и детерминированные
cache baseline/protected: кэш пока не подключён к выбранным adapters.
- Реальные hooks SQL lock и насыщения APPLICATION pool; эти suites ждут
реализации hooks и выбранных бюджетов.
- Работа example job на площадке CI, чистый clone и реальные scripts/restart.sh.
- Интерпретация SQL-планов и результатов, hardware/ресурсы/повторы, допустимая
потеря данных, REPORT/PR/защита. Это вручную проверяемая часть критериев.
## Параллельные изменения приложения
Во время подготовки тестов изменились internal/transport/http/handler/auth.go
и health.go. Ассистент эти файлы не редактировал. Это зафиксировано сравнением
с source-before.json. HTTP-результаты выше относятся к образу, собранному в начале
проверки; актуальное содержимое этих двух файлов требует отдельного полного
прогона. Других изменений защищённых исходников/контракта в этом сравнении нет.
Изменены только новые файлы тестового набора, ссылки в AUTH_TESTS.md/
LAB2_CHECKLIST.md и эта evidence. Реальные workflows, Compose, migrations,
go.mod/go.sum, обязательные docs/contracts/tests не правились.
Инструкция запуска и точки адаптации:
[student-tests/lab2/README.md](../../student-tests/lab2/README.md).
@@ -0,0 +1 @@
{"action": "restart-stack", "project": "highload-lab2-test-b3695867", "before": {"api": {"id": "bf951fe9c4b16ce2e2cf1954b10d95d0f02bf9c48f3063a216a3102af0ad5ebe", "started_at": "2026-10-14T13:51:21.754674552Z", "running": true, "volumes": []}, "postgres": {"id": "79192692e09dc01294e3c9667d6c1c6412acb461b83b70fcc8a1fa051381e65f", "started_at": "2026-10-14T13:51:15.455132924Z", "running": true, "volumes": ["highload-lab2-test-b3695867_postgres_data"]}}, "after": {"api": {"id": "bf951fe9c4b16ce2e2cf1954b10d95d0f02bf9c48f3063a216a3102af0ad5ebe", "started_at": "2026-10-14T13:57:13.242987548Z", "running": true, "volumes": []}, "postgres": {"id": "79192692e09dc01294e3c9667d6c1c6412acb461b83b70fcc8a1fa051381e65f", "started_at": "2026-10-14T13:57:13.326973923Z", "running": true, "volumes": ["highload-lab2-test-b3695867_postgres_data"]}}}
@@ -0,0 +1,189 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "sql-plan",
"status": "PASS",
"observation": {
"actual_rows": 10000,
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"chat_message_counts": [
7000,
2000,
600,
300,
100
],
"deep_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.01,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.007,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = 'ade9231d-bd50-45a8-ab91-d5229d8655f8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:08.001+00'::timestamp with time zone, 'ceafc4d1-54f8-47f0-bb6c-d29e86fd1fea'::uuid)))",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 1399,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 532.21
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.68
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.017,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.014,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = 'ade9231d-bd50-45a8-ab91-d5229d8655f8'::uuid)",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 7000,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 838.5
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.39
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.015,
"Triggers": []
},
"max_visited_rows": 51
},
"go_version": "go1.27.1",
"mode": "plan",
"postgres_version": "18.6 (Debian 18.6-1.pgdg13+2)",
"rows": 10000,
"scan_budget_rows": 1000,
"schema": "lab2_test_a499cc3457d14c849676491389ae64c2"
},
"duration_seconds": 2.2296
}
]
}
@@ -0,0 +1,5 @@
{
"api": "sha256:c0b747596f4d384bc4abfb67f3efa02ee2b407ec9ba0fdbbd149bcf5d8a3a734",
"migrate": "sha256:9530d537957334e57539c00d875af55c8213825d73301239dddb11480383f1b4",
"postgres": "sha256:5a5a84b19854a9ffaa54082c166ff4ec27473a361e496e5ea167f298f2da9722"
}
@@ -0,0 +1,657 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "business-boundaries",
"status": "PASS",
"observation": null,
"duration_seconds": 0.5468
},
{
"suite": "business-cursors",
"status": "PASS",
"observation": null,
"duration_seconds": 0.3711
},
{
"suite": "read-after-write",
"status": "PASS",
"observation": null,
"duration_seconds": 0.2571
},
{
"suite": "sql-plan",
"status": "PASS",
"observation": {
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"deep_page": {
"explain": {
"Execution Time": 0.023,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.005,
"Actual Total Time": 0.011,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.005,
"Actual Total Time": 0.008,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = 'cd6e5042-e5d2-4b71-8176-e748fd41f21f'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:08.001+00'::timestamp with time zone, 'fbc37ac5-9496-44b7-8620-b2313300477d'::uuid)))",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 1399,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 532.2
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.68
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.025,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = 'cd6e5042-e5d2-4b71-8176-e748fd41f21f'::uuid)",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 7000,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 838.49
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.39
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.02,
"Triggers": []
},
"max_visited_rows": 51
},
"mode": "plan",
"rows": 10000,
"scan_budget_rows": 1000,
"schema": "lab2_test_bc2da9b009ef42c4aa229287d6fd3e94"
},
"duration_seconds": 2.3235
},
{
"suite": "sql-experiment",
"status": "PASS",
"observation": {
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"limitations": "Warm single-host prototype; write cleanup can leave bloat. Repeat under fixed resources and review plans, cold/generic plans and loss boundaries.",
"mode": "compare",
"rows": 100000,
"schema": "lab2_test_5e728af09de041f1bcdff95b11004870",
"variants": [
{
"columns": "chat_id",
"deep_page": {
"explain": {
"Execution Time": 4.711,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 4.7,
"Actual Total Time": 4.705,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 4.7,
"Actual Total Time": 4.702,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Sort",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14289,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 13999,
"Actual Startup Time": 2.868,
"Actual Total Time": 3.934,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Filter": "((chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:01:20.001+00'::timestamp with time zone, '966344f0-9534-4e3e-ae17-ed4c5f2591f8'::uuid)))",
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Seq Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14289,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Filter": 86001,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3122.31
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Startup Cost": 3599.02,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3634.75
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 3599.02,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3599.15
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.033,
"Triggers": []
},
"max_visited_rows": 100000
},
"first_page": {
"explain": {
"Execution Time": 8.291,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 6.657,
"Actual Total Time": 8.282,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 6.656,
"Actual Total Time": 8.278,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Gather Merge",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 70871,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 2,
"Actual Rows": 51,
"Actual Startup Time": 4.668,
"Actual Total Time": 4.671,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Sort",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 41689,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 2,
"Actual Rows": 35000,
"Actual Startup Time": 0.005,
"Actual Total Time": 2.648,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Filter": "(chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid)",
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Seq Scan",
"Parallel Aware": true,
"Parent Relationship": "Outer",
"Plan Rows": 41689,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Filter": 15000,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 2094.67,
"Workers": []
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Startup Cost": 3485.5,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3589.73,
"Workers": [
{
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Worker Number": 0
}
]
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 4485.51,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 12562.72,
"Workers Launched": 1,
"Workers Planned": 1
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 4485.51,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 4491.33
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.035,
"Triggers": []
},
"max_visited_rows": 100000
},
"index_bytes": 737280,
"insert_200_with_commit_ms": {
"p50": 2.584,
"p95": 3.59,
"p99": 3.59
},
"read_ms": {
"p50": 5.141,
"p95": 5.686,
"p99": 5.686
}
},
{
"columns": "chat_id,created_at,id",
"deep_page": {
"explain": {
"Execution Time": 0.025,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.013,
"Actual Total Time": 0.019,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.013,
"Actual Total Time": 0.016,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:01:20.001+00'::timestamp with time zone, '966344f0-9534-4e3e-ae17-ed4c5f2591f8'::uuid)))",
"Index Name": "lab2_history_variant",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14170,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 1,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 5311.89
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 1,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.53
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.041,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid)",
"Index Name": "lab2_history_variant",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 71060,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 8044.12
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.19
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.044,
"Triggers": []
},
"max_visited_rows": 51
},
"index_bytes": 6004736,
"insert_200_with_commit_ms": {
"p50": 2.472,
"p95": 3.016,
"p99": 3.016
},
"read_ms": {
"p50": 4.639,
"p95": 5.091,
"p99": 5.091
}
}
]
},
"duration_seconds": 2.1275
}
]
}
@@ -0,0 +1,11 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "persistence",
"status": "PASS",
"observation": null,
"duration_seconds": 2.1506
}
]
}
@@ -0,0 +1,37 @@
{
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "backup-restore",
"status": "PASS",
"observation": {
"backup_seconds": 0.3176,
"restore_seconds": 0.4366,
"tables": {
"chat_members": {
"rows": 5,
"sha256": "9fe587f3c02843166a424d41262f242d7e39548822ff325d2ab4490ed2e0b5f5"
},
"chats": {
"rows": 5,
"sha256": "18c355e977deaad72cbf7e92b200a68689f7fd94061cea875762b9b4d3e79b59"
},
"messages": {
"rows": 100000,
"sha256": "e5feff13f4ffe5d4334cbfab16f8d32adb71ae10f9841a95dd7c020b7c070c1d"
},
"sessions": {
"rows": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"users": {
"rows": 1,
"sha256": "eb105af647465874ed27717cc6c4e91b45040ece63639993bf530cd346a2f47c"
}
},
"review": "Document recovery/loss boundaries and verify fresh storage scope."
},
"duration_seconds": 1.8915
}
]
}
@@ -0,0 +1,74 @@
{
"internal/.DS_Store": "1585ae06c37a6ef7532657745416b3fd4b62de626153b376060beb7b4e7fdbd7",
"internal/database/.DS_Store": "4b2956f86b6dd1d079e63d442aa22d02c3691919508bfc477b7ca21929af5589",
"internal/database/database.go": "c009ab86a3c1b3ca0a153c12fee3a656be094583c2a811ef972d46d8b3300e70",
"internal/config/config.go": "6fc7c51652850dbd37c27c52170af16375ca8d8ba28110c6889bb37387c635e8",
"internal/security/password.go": "8f74bef9216a2d12aa734e04fa786eac6b31f1378fe42f729fe1b97495c10487",
"internal/model/user.go": "4bfd2d78e72f1c80b12541f2abc8500613e8f4d101575bd5d74fac22b52e3617",
"internal/model/message.go": "b9ce1bdc5fd8ccf20d18033f56ac47c8a64352584ee29ab27915535557003a72",
"internal/model/session.go": "b455d730e4e3efc95c6d1fe74ab43d86153e4bf863c09efd36bfe57efc669bc2",
"internal/model/chat.go": "e0213f8360ea106b3627aa50cc87710153ff8e353475b42c2becdb9a32592660",
"internal/service/user.go": "7e66b883bdbfa7130d999546f4523c7962192cf4b492a6455b1816299bc70a1d",
"internal/service/auth.go": "feb29e6bf3deba85144fa1940c75314e76cc7ff7cc2fd0054feb869d63259018",
"internal/service/message.go": "f673e624e610ab794008bd12c33069a6f3f21fd8c50304bb878a13900b3212b9",
"internal/service/helper.go": "22f9a560c5e15186fd707b3b7bd2f0691e278a082e1b22b058b8d8f7ece48df8",
"internal/service/chat.go": "114dc6e5c3f582be03d44db7ab2d75173f243f33872be11d462798df9ce68993",
"internal/service/errors.go": "5b66aba837168d5e942cbc0bbbc1b61bc9bd8a4dea30b904071660030a5dd197",
"internal/transport/http/router.go": "c452f3d9e9781cdfd45212f901ce286b285f566ade65048a985ea0cdae7c67e4",
"internal/transport/http/handler/chat_types.go": "d181bce0f003749d813c1254df4c8ebcc1b99ff506b61efa6899da4a499e95f4",
"internal/transport/http/handler/user.go": "86fd65ed176e9a83dc27c1112ff8384bc5aa32a92410290fb505d715ca167775",
"internal/transport/http/handler/auth.go": "a0f96ba71fbce27cc0669d40aaae63e78ed46e854aa99b43e1880ee203c08b65",
"internal/transport/http/handler/message.go": "43dfcabbd24fe809e407958fed34bf567bdc6dd45c61f06c2e6d6bdd3d68b3ed",
"internal/transport/http/handler/health.go": "e8909f3c179558d4855a480536bb756cb11e5faa90e69777ec04ba63de94296c",
"internal/transport/http/handler/chat.go": "e5214ebf94ac9b8f37537e1a3fc844a2e8ae4e9b5aa159fe2b6e4da9ab2342f0",
"internal/transport/http/handler/auth_types.go": "5ffcd182606a77d538efb5f1a51df23b8a324a605b5d226026048d34c409ebdb",
"internal/transport/http/handler/health_types.go": "02ee3031e10fbb279e020f409fbd905ae2640aa306b2c558c3f8e6dcfe9efa80",
"internal/transport/http/handler/message_types.go": "b7649808c889cc9518bf5710415550abf4bed9ad5052a327c88181ed3b45aafc",
"internal/transport/http/handler/user_types.go": "0c4450be649afe5edf4e8d3ac9baada79deb9e1423ace56b87aa227ebd0eb998",
"internal/transport/http/middleware/auth.go": "28c1d54da2c371289a3ad2aaeb8365135a38b0afe555a7cffcec0128ee7491b8",
"internal/transport/http/middleware/logging.go": "a477fda512953eb9f46266537c12ace9cc992ba8f036a5b041f9f8295bfd2097",
"internal/transport/http/middleware/context.go": "f6db0e807659f30b05cae91f73c70d87f359760c57110e0d25b49a65bd0394a5",
"internal/transport/http/httputils/helper.go": "a18445ba40cea946e16c07e9da0d790b31492483f482ab5ba7b2ffabc6a1fe47",
"internal/database/repository/user.go": "0c3fc62b808a2f3af7477ac25d412b901658042c853fd7657b56d542e450ab13",
"internal/database/repository/message.go": "16ec89107d038374d92a3e1d7f65f885164d058dc650aabeffd1b18b5c4adedd",
"internal/database/repository/session.go": "eb789a557739cf940f8d1af9319b3f6084bb4cb7ba166f29e362e7dc27ae5ddd",
"internal/database/repository/utils.go": "5fe7073ef5497f4d66b83382e341ade746111ea27093301740a31c6f7ae24afd",
"internal/database/repository/chat.go": "8e5c406508e191680853223c54d86cec617317a084ea8de6c5a5eb70973721b4",
"internal/database/repository/errors.go": "7cfb01e426127dda50abca5b98273091d5ecd27de448f40017520cf000fd4bae",
"internal/database/sqlc/models.go": "3cabe7a22e3871e170d72698b63fabde9e1c3ae2e832be3586fa36052a2c5224",
"internal/database/sqlc/db.go": "3ca71a7f007a39987cae838da64303419dd804d2d1b6227676f47177971d76cf",
"internal/database/sqlc/sessions.sql.go": "3dd798158d7da2c9ac973ed98bf711620c46982c3abf93105c002a43d3b3a84e",
"internal/database/sqlc/chats.sql.go": "3dccf4b0ffa918ec5a3b66026b3dab4027456b499486359881000d184944802c",
"internal/database/sqlc/messages.sql.go": "224d6d8bd21426759ca6500e0eb3563564d51e639f1b6c64db4b3a43a5241c2a",
"internal/database/sqlc/users.sql.go": "b954abd5b5964df39c20d857a60105513af84c8df68ce1ac9421da541a7800f4",
"internal/database/sqlc/chat_members.sql.go": "9e8cd177f6f888c72d19857fd4748fbb2020770c1af772a463fe3d1b813b37ee",
"cmd/migrate/postgres_test.go": "04c0a327b427c0d8729fc9e5013c85c6865290e905aa306e2ac737e7cad4782a",
"cmd/migrate/main.go": "6e9d413a86f53cf5f2e83d5ed0308af9b2c33e69fcb3d061b19bf480e352f257",
"cmd/migrate/main_test.go": "a88f2252d70caf644904331182dc3afd4df48b825a0329a82482798ec90b5d46",
"cmd/api/main.go": "ec0257157d742c5007e4791b27b99432fb4a363fdd50b6df80d6b559e00040fa",
"db/migrations/embed.go": "a42e52ab05bc89b557a5bc6b3f0215883d99c4a039a8b32d6c19e66b2f769508",
"db/migrations/00002_add_created_at_defaults.sql": "e0680838294b93f916d727a3a20d83aca7c3f74077202c9696b1fc73cda14649",
"db/migrations/00001_init_schema.sql": "32223afbc24f8250de055690c9e86299ebf2cd7a0d3ef2c59d3b2a5aaa41e84e",
"db/queries/chat_members.sql": "e70940e35f325550041c290a571901ead4a6f93dece857ffa229f2f1c83eddf8",
"db/queries/users.sql": "0d73a6d46f4d4a1b0af37b750a208c07a38249f76974b41748f32c1949f990df",
"db/queries/messages.sql": "022c9f7aade55345f6cebd31f38084e73cb9a1419d56fa5316eaa36c9da52860",
"db/queries/chats.sql": "8c52c762da78eb3a3eb7402b17ec87bd7fc2e1387f6ddb8e297b4f2d75beca7b",
"db/queries/sessions.sql": "787014f9d5000bddee7f9cf32ff78091491e822afafdc8c81b3252c5c20a535b",
"contracts/examples.json": "0a71cec72903af556df85f939c7e347fc73a86a1a4ffc39fb9c8ded169b7df45",
"contracts/README.md": "72df27a559f88ffa3fd8c3c79d3c32f6db2c5986a0602677c51994c434a3fc4f",
"contracts/openapi.json": "cff3aa6b34855b573401b0ac393fdfe327b6a12da51f315fbbd67168ce3762c4",
"contracts/infrastructure.json": "7efd8b1e6023ddc3ff9747d4f663ee772c1293b782bb9e74bd1c3fbcca9c68d8",
"tests/client.py": "8d50976fc7c7bbb81e88a152f613c61ab25eaf53dba33c6a9dfab19f868d546d",
"tests/README.md": "e0bfa7e196797f6a5bf6e44d8ad2ffeb82651927ff5d8484eb1c2dda1ec7dec5",
"tests/load.py": "6d3511ea719c7a7e841083e73d435c86dcbfd9f4e5c2a07d62eb9614b01d9933",
"tests/resilience.py": "1f96663a174b3978d24eff66f2741f5f8c9b788d3242261d37a972720c52788b",
"tests/smoke.py": "52ac38eb343ff7d43e7543588e1da58ca06c9fce74b2b0d0bf0e4982bc23c1db",
"scripts/check_contract.py": "7c4402c2a6ab80d3b4676e1866d6ecc87b6daea14c080bcb9be9a7e8b959d671",
"scripts/validate_openapi.py": "4e981acbfc10dac58817bf922d5896e996798551fedc1b2385130e1cddb13d54",
"scripts/restart.example.sh": "0328246ba75defbced992104e986fde973f63e3830d83251eced5953263e944b",
"compose.yaml": "1352be71574acf2151c7f5124ac4fa1e71286da9a759467605e787d5cdf0d5eb",
"Dockerfile": "eddd3924e99335ce0253792e85bcabb19b50d684c34073dd3b6ff958d0f7c652",
"Dockerfile.migrate": "0ab04cba4c2bb033c4d7c7d3a5984d8a27e8f355ff90e6023c3b7912d2211dec",
"go.mod": "f704b1f0bb9cd5692924f5d4a6a368a1b6e256b53d8cb3b87af6fb6991891a50",
"go.sum": "f6af2acfc00713570bc0ce2152c034674fff4ab40c42bf4a22d14420741abf64"
}
@@ -0,0 +1,900 @@
{
"date": "2026-10-14",
"scope": "verification of new test scaffolds on synthetic fixtures, not a complete acceptance of the current application",
"project": "highload-lab2-test-b3695867",
"runtime_results": [
{
"suite": "business-boundaries",
"status": "PASS",
"observation": null,
"duration_seconds": 0.5468
},
{
"suite": "business-cursors",
"status": "PASS",
"observation": null,
"duration_seconds": 0.3711
},
{
"suite": "read-after-write",
"status": "PASS",
"observation": null,
"duration_seconds": 0.2571
},
{
"suite": "sql-plan",
"status": "PASS",
"observation": {
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"deep_page": {
"explain": {
"Execution Time": 0.023,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.005,
"Actual Total Time": 0.011,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.005,
"Actual Total Time": 0.008,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = 'cd6e5042-e5d2-4b71-8176-e748fd41f21f'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:08.001+00'::timestamp with time zone, 'fbc37ac5-9496-44b7-8620-b2313300477d'::uuid)))",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 1399,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 532.2
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.68
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.025,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = 'cd6e5042-e5d2-4b71-8176-e748fd41f21f'::uuid)",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 7000,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 838.49
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.39
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.02,
"Triggers": []
},
"max_visited_rows": 51
},
"mode": "plan",
"rows": 10000,
"scan_budget_rows": 1000,
"schema": "lab2_test_bc2da9b009ef42c4aa229287d6fd3e94"
},
"duration_seconds": 2.3235
},
{
"suite": "sql-experiment",
"status": "PASS",
"observation": {
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"limitations": "Warm single-host prototype; write cleanup can leave bloat. Repeat under fixed resources and review plans, cold/generic plans and loss boundaries.",
"mode": "compare",
"rows": 100000,
"schema": "lab2_test_5e728af09de041f1bcdff95b11004870",
"variants": [
{
"columns": "chat_id",
"deep_page": {
"explain": {
"Execution Time": 4.711,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 4.7,
"Actual Total Time": 4.705,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 4.7,
"Actual Total Time": 4.702,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Sort",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14289,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 13999,
"Actual Startup Time": 2.868,
"Actual Total Time": 3.934,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Filter": "((chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:01:20.001+00'::timestamp with time zone, '966344f0-9534-4e3e-ae17-ed4c5f2591f8'::uuid)))",
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Seq Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14289,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Filter": 86001,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3122.31
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Startup Cost": 3599.02,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3634.75
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 3599.02,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3599.15
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.033,
"Triggers": []
},
"max_visited_rows": 100000
},
"first_page": {
"explain": {
"Execution Time": 8.291,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 6.657,
"Actual Total Time": 8.282,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 6.656,
"Actual Total Time": 8.278,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Gather Merge",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 70871,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 2,
"Actual Rows": 51,
"Actual Startup Time": 4.668,
"Actual Total Time": 4.671,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Sort",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 41689,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 2,
"Actual Rows": 35000,
"Actual Startup Time": 0.005,
"Actual Total Time": 2.648,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Filter": "(chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid)",
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Seq Scan",
"Parallel Aware": true,
"Parent Relationship": "Outer",
"Plan Rows": 41689,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Filter": 15000,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1350,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 2094.67,
"Workers": []
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Sort Key": [
"created_at",
"id"
],
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Startup Cost": 3485.5,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 3589.73,
"Workers": [
{
"Sort Method": "top-N heapsort",
"Sort Space Type": "Memory",
"Sort Space Used": 31,
"Worker Number": 0
}
]
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 4485.51,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 12562.72,
"Workers Launched": 1,
"Workers Planned": 1
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 1395,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 4485.51,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 4491.33
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.035,
"Triggers": []
},
"max_visited_rows": 100000
},
"index_bytes": 737280,
"insert_200_with_commit_ms": {
"p50": 2.584,
"p95": 3.59,
"p99": 3.59
},
"read_ms": {
"p50": 5.141,
"p95": 5.686,
"p99": 5.686
}
},
{
"columns": "chat_id,created_at,id",
"deep_page": {
"explain": {
"Execution Time": 0.025,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.013,
"Actual Total Time": 0.019,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.013,
"Actual Total Time": 0.016,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:01:20.001+00'::timestamp with time zone, '966344f0-9534-4e3e-ae17-ed4c5f2591f8'::uuid)))",
"Index Name": "lab2_history_variant",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 14170,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 1,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 5311.89
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 1,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.53
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.041,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 73,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.003,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = '99d0db10-5a08-43d4-9ada-1a3893b58b20'::uuid)",
"Index Name": "lab2_history_variant",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 71060,
"Plan Width": 73,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 8044.12
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.42,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.19
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.044,
"Triggers": []
},
"max_visited_rows": 51
},
"index_bytes": 6004736,
"insert_200_with_commit_ms": {
"p50": 2.472,
"p95": 3.016,
"p99": 3.016
},
"read_ms": {
"p50": 4.639,
"p95": 5.091,
"p99": 5.091
}
}
]
},
"duration_seconds": 2.1275
},
{
"suite": "backup-restore",
"status": "PASS",
"observation": {
"backup_seconds": 0.3176,
"restore_seconds": 0.4366,
"tables": {
"chat_members": {
"rows": 5,
"sha256": "9fe587f3c02843166a424d41262f242d7e39548822ff325d2ab4490ed2e0b5f5"
},
"chats": {
"rows": 5,
"sha256": "18c355e977deaad72cbf7e92b200a68689f7fd94061cea875762b9b4d3e79b59"
},
"messages": {
"rows": 100000,
"sha256": "e5feff13f4ffe5d4334cbfab16f8d32adb71ae10f9841a95dd7c020b7c070c1d"
},
"sessions": {
"rows": 0,
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"users": {
"rows": 1,
"sha256": "eb105af647465874ed27717cc6c4e91b45040ece63639993bf530cd346a2f47c"
}
},
"review": "Document recovery/loss boundaries and verify fresh storage scope."
},
"duration_seconds": 1.8915
},
{
"suite": "persistence",
"status": "PASS",
"observation": null,
"duration_seconds": 2.1506
}
],
"final_sql_plan": {
"scope": "observed automated scenarios, not an automatic grade or manual report/CI review",
"results": [
{
"suite": "sql-plan",
"status": "PASS",
"observation": {
"actual_rows": 10000,
"chat_distribution_percent": [
70,
20,
6,
3,
1
],
"chat_message_counts": [
7000,
2000,
600,
300,
100
],
"deep_page": {
"explain": {
"Execution Time": 0.015,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.01,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.004,
"Actual Total Time": 0.007,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "((chat_id = 'ade9231d-bd50-45a8-ab91-d5229d8655f8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:08.001+00'::timestamp with time zone, 'ceafc4d1-54f8-47f0-bb6c-d29e86fd1fea'::uuid)))",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 1399,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 532.21
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 19.68
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.017,
"Triggers": []
},
"max_visited_rows": 51
},
"first_page": {
"explain": {
"Execution Time": 0.014,
"Plan": {
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.009,
"Async Capable": false,
"Disabled": false,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Limit",
"Parallel Aware": false,
"Plan Rows": 51,
"Plan Width": 72,
"Plans": [
{
"Actual Loops": 1,
"Actual Rows": 51,
"Actual Startup Time": 0.002,
"Actual Total Time": 0.006,
"Alias": "messages",
"Async Capable": false,
"Disabled": false,
"Index Cond": "(chat_id = 'ade9231d-bd50-45a8-ab91-d5229d8655f8'::uuid)",
"Index Name": "idx_messages_chat_created_id",
"Index Searches": 1,
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Node Type": "Index Scan",
"Parallel Aware": false,
"Parent Relationship": "Outer",
"Plan Rows": 7000,
"Plan Width": 72,
"Relation Name": "messages",
"Rows Removed by Index Recheck": 0,
"Scan Direction": "Forward",
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 838.5
}
],
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 4,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Startup Cost": 0.29,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Total Cost": 6.39
},
"Planning": {
"Local Dirtied Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Written Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.015,
"Triggers": []
},
"max_visited_rows": 51
},
"go_version": "go1.27.1",
"mode": "plan",
"postgres_version": "18.6 (Debian 18.6-1.pgdg13+2)",
"rows": 10000,
"scan_budget_rows": 1000,
"schema": "lab2_test_a499cc3457d14c849676491389ae64c2"
},
"duration_seconds": 2.2296
}
]
},
"protected_changes_observed": [
"internal/transport/http/handler/auth.go",
"internal/transport/http/handler/health.go"
],
"application_edited_by_assistant": false,
"cleanup_exit": 0,
"dump_retained": false,
"not_verified": [
"Redis actual cache adapters and both cache policies",
"Real database lock/pool-exhaustion adapters",
"CI example on a CI runner",
"Full acceptance of concurrently edited auth.go/health.go",
"Manual report, experiment methodology, hardware/resource comparison and defense"
]
}