Implement lab2 PostgreSQL messenger, sessions, SQL research and defense guide

This commit is contained in:
2026-10-02 12:49:09 +03:00
parent 65003b6119
commit 6fe56ec642
43 changed files with 12869 additions and 33 deletions
+69
View File
@@ -0,0 +1,69 @@
Compose can now delegate builds to bake for better performance.
To do so, set COMPOSE_BAKE=true.
#0 building with "desktop-linux" instance using docker driver
#1 [api internal] load build definition from Dockerfile
#1 transferring dockerfile: 782B done
#1 DONE 0.0s
#2 [api internal] load metadata for docker.io/library/golang:1.24.4-alpine3.22
#2 DONE 1.4s
#3 [api internal] load metadata for docker.io/library/alpine:3.22.1
#3 DONE 1.4s
#4 [api internal] load .dockerignore
#4 transferring context: 196B done
#4 DONE 0.0s
#5 [api stage-2 1/3] FROM docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
#5 resolve docker.io/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 done
#5 DONE 0.0s
#6 [api build 1/7] FROM docker.io/library/golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a
#6 resolve docker.io/library/golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a done
#6 DONE 0.0s
#7 [api internal] load build context
#7 transferring context: 22.43kB done
#7 DONE 0.0s
#8 [api build 2/7] WORKDIR /src
#8 CACHED
#9 [api build 3/7] COPY go.mod go.sum ./
#9 CACHED
#10 [api build 4/7] RUN go mod download
#10 CACHED
#11 [api build 5/7] COPY cmd/ ./cmd/
#11 CACHED
#12 [api build 6/7] COPY internal/ ./internal/
#12 DONE 0.0s
#13 [api build 7/7] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd/server
#13 DONE 5.8s
#14 [api stage-2 2/3] RUN addgroup -g 10001 app && adduser -D -u 10001 -G app app
#14 CACHED
#15 [api stage-2 3/3] COPY --from=build /out/messenger /usr/local/bin/messenger
#15 DONE 0.0s
#16 [api] exporting to image
#16 exporting layers
#16 exporting layers 0.2s done
#16 exporting manifest sha256:96202f5138f44a4a66b406c8fb3102b90d9c6e7005de409f6e2110413f98e8c7
#16 exporting manifest sha256:96202f5138f44a4a66b406c8fb3102b90d9c6e7005de409f6e2110413f98e8c7 done
#16 exporting config sha256:2b0630b51e8e0691161aaeb84c15b6c5145b1353880c4fb682c0622e9bdaa2c3 done
#16 exporting attestation manifest sha256:b38b86e8e795fcb8db5ec321051e7f9e83ddf405f80d0ccb63f7ed8574334320 done
#16 exporting manifest list sha256:d95606280c8307e47500e4dacd5ab5f9a495e85841260c4c78380ebf565573f1 done
#16 naming to docker.io/library/mtusi-messenger:lab2 done
#16 unpacking to docker.io/library/mtusi-messenger:lab2 0.0s done
#16 DONE 0.3s
#17 [api] resolving provenance for metadata file
#17 DONE 0.0s
api Built
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+5
View File
@@ -0,0 +1,5 @@
python3 student-tests/experiment.py
Measuring chat_only
Measuring composite
Measuring covering
PASS: SQL comparison and restore of 100000 messages
+62
View File
@@ -0,0 +1,62 @@
# SQL-эксперимент: результаты
100 000 сообщений, чаты 80 000 / 15 000 / 4900 / 100. Медианы 3 повторов; warm SQL, без HTTP.
| Индекс | Чат | Страница | Клиенты | latency, ms | TPS | EXPLAIN, ms | Ошибки |
|---|---:|---|---:|---:|---:|---:|---:|
| chat_only | 80000 | first | 1 | 11.530 | 86.7 | 13.284 | 0 |
| chat_only | 80000 | first | 4 | 50.676 | 78.9 | 13.284 | 0 |
| chat_only | 80000 | deep | 1 | 11.053 | 90.5 | 12.858 | 0 |
| chat_only | 80000 | deep | 4 | 23.470 | 170.4 | 12.858 | 0 |
| chat_only | 15000 | first | 1 | 3.003 | 333.0 | 4.196 | 0 |
| chat_only | 15000 | first | 4 | 6.240 | 641.0 | 4.196 | 0 |
| chat_only | 15000 | deep | 1 | 1.300 | 769.0 | 2.495 | 0 |
| chat_only | 15000 | deep | 4 | 1.874 | 2134.1 | 2.495 | 0 |
| chat_only | 4900 | first | 1 | 1.066 | 937.9 | 1.417 | 0 |
| chat_only | 4900 | first | 4 | 1.904 | 2100.7 | 1.417 | 0 |
| chat_only | 4900 | deep | 1 | 0.467 | 2140.9 | 0.816 | 0 |
| chat_only | 4900 | deep | 4 | 0.683 | 5860.5 | 0.816 | 0 |
| chat_only | 100 | first | 1 | 0.120 | 8316.7 | 0.130 | 0 |
| chat_only | 100 | first | 4 | 0.181 | 22044.6 | 0.130 | 0 |
| chat_only | 100 | deep | 1 | 0.092 | 10840.1 | 0.084 | 0 |
| chat_only | 100 | deep | 4 | 0.115 | 34858.4 | 0.084 | 0 |
| composite | 80000 | first | 1 | 0.089 | 11188.2 | 0.054 | 0 |
| composite | 80000 | first | 4 | 0.151 | 26470.8 | 0.054 | 0 |
| composite | 80000 | deep | 1 | 0.090 | 11144.5 | 0.060 | 0 |
| composite | 80000 | deep | 4 | 0.158 | 25392.0 | 0.060 | 0 |
| composite | 15000 | first | 1 | 0.090 | 11157.0 | 0.064 | 0 |
| composite | 15000 | first | 4 | 0.158 | 25258.9 | 0.064 | 0 |
| composite | 15000 | deep | 1 | 0.095 | 10549.6 | 0.070 | 0 |
| composite | 15000 | deep | 4 | 0.164 | 24385.8 | 0.070 | 0 |
| composite | 4900 | first | 1 | 0.090 | 11108.6 | 0.079 | 0 |
| composite | 4900 | first | 4 | 0.163 | 24582.1 | 0.079 | 0 |
| composite | 4900 | deep | 1 | 0.092 | 10917.0 | 0.069 | 0 |
| composite | 4900 | deep | 4 | 0.165 | 24188.2 | 0.069 | 0 |
| composite | 100 | first | 1 | 0.091 | 11027.8 | 0.062 | 0 |
| composite | 100 | first | 4 | 0.155 | 25876.6 | 0.062 | 0 |
| composite | 100 | deep | 1 | 0.081 | 12315.3 | 0.051 | 0 |
| composite | 100 | deep | 4 | 0.104 | 38465.2 | 0.051 | 0 |
| covering | 80000 | first | 1 | 0.094 | 10614.6 | 0.077 | 0 |
| covering | 80000 | first | 4 | 0.163 | 24470.8 | 0.077 | 0 |
| covering | 80000 | deep | 1 | 0.096 | 10378.8 | 0.073 | 0 |
| covering | 80000 | deep | 4 | 0.165 | 24227.7 | 0.073 | 0 |
| covering | 15000 | first | 1 | 0.092 | 10831.9 | 0.068 | 0 |
| covering | 15000 | first | 4 | 0.183 | 21889.0 | 0.068 | 0 |
| covering | 15000 | deep | 1 | 0.121 | 8242.0 | 0.064 | 0 |
| covering | 15000 | deep | 4 | 0.235 | 16992.4 | 0.064 | 0 |
| covering | 4900 | first | 1 | 0.095 | 10571.9 | 0.078 | 0 |
| covering | 4900 | first | 4 | 0.163 | 24564.0 | 0.078 | 0 |
| covering | 4900 | deep | 1 | 0.091 | 10948.1 | 0.101 | 0 |
| covering | 4900 | deep | 4 | 0.169 | 23660.2 | 0.101 | 0 |
| covering | 100 | first | 1 | 0.092 | 10874.3 | 0.085 | 0 |
| covering | 100 | first | 4 | 0.166 | 24061.6 | 0.085 | 0 |
| covering | 100 | deep | 1 | 0.085 | 11830.1 | 0.058 | 0 |
| covering | 100 | deep | 4 | 0.107 | 37334.3 | 0.058 | 0 |
| Индекс | Размер индекса, KiB | INSERT 1000 + COMMIT, ms |
|---|---:|---:|
| chat_only | 704.0 | 8.679 |
| composite | 5776.0 | 5.915 |
| covering | 24416.0 | 7.541 |
Backup: 0.317s; restore: 0.500s; 3021508 bytes; 100000 сообщений, полный fingerprint и 5 выбранных записей совпали. После backup добавлено 1 сообщение: восстановленная БД его не содержит.
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
EXPLAIN (ANALYZE,BUFFERS) SELECT id::text,chat_id::text,sender_id::text,text,created_at FROM messages WHERE chat_id='00000000-0000-4000-8000-000000000001'::uuid AND (created_at,id)>('2026-01-01T00:00:00.072000Z'::timestamptz,'00000000-0000-0000-0000-000000000000'::uuid) ORDER BY messages.created_at,messages.id LIMIT 51;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.42..46.30 rows=51 width=266) (actual time=0.088..0.118 rows=51 loops=1)
Buffers: shared hit=5 read=1
-> Index Scan using messages_history_idx on messages (cost=0.42..5657.00 rows=6288 width=266) (actual time=0.088..0.114 rows=51 loops=1)
Index Cond: ((chat_id = '00000000-0000-4000-8000-000000000001'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.072+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
Buffers: shared hit=5 read=1
Planning:
Buffers: shared hit=113
Planning Time: 0.745 ms
Execution Time: 0.172 ms
(9 rows)
View File
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.016,
"concurrency": 4,
"successful_requests": 7444,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1484.098,
"successful_latency_ms": {
"p50": 2.48,
"p95": 4.003,
"p99": 5.947
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.029,
"concurrency": 4,
"successful_requests": 6949,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1381.845,
"successful_latency_ms": {
"p50": 2.571,
"p95": 4.508,
"p99": 7.954
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.018,
"concurrency": 4,
"successful_requests": 7309,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1456.586,
"successful_latency_ms": {
"p50": 2.524,
"p95": 4.128,
"p99": 6.279
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+51
View File
@@ -0,0 +1,51 @@
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.016,
"concurrency": 4,
"successful_requests": 7444,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1484.098,
"successful_latency_ms": {
"p50": 2.48,
"p95": 4.003,
"p99": 5.947
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.029,
"concurrency": 4,
"successful_requests": 6949,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1381.845,
"successful_latency_ms": {
"p50": 2.571,
"p95": 4.508,
"p99": 7.954
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
{
"lab": 2,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 5.0,
"elapsed_seconds": 5.018,
"concurrency": 4,
"successful_requests": 7309,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 1456.586,
"successful_latency_ms": {
"p50": 2.524,
"p95": 4.128,
"p99": 6.279
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+43
View File
@@ -0,0 +1,43 @@
{
"checks": {
"strict_json_unicode_body_limits": true,
"username_race": [
409,
201,
409,
409
],
"chat_rollback_after_fk_failure": true,
"100_concurrent_messages_and_keyset_scope": true,
"monotonic_chat_clock": true,
"authentication_and_chat_authorization": true,
"password_kdf_and_token_digest_storage": true,
"valkey_real_profile_cache_ttl": 299,
"cache_flush_repopulates_with_same_session": true,
"cache_down_fallback_and_read_after_write": true,
"database_down_fails_closed": {
"live": 200,
"ready": 503,
"request_seconds": 0.073
},
"logout_with_warm_cache": true,
"full_stack_restart_and_cursor": {
"before": {
"api": "2026-10-02T09:42:14.201023758Z",
"postgres": "2026-10-02T09:42:27.938008958Z",
"valkey": "2026-10-02T09:42:27.537210625Z"
},
"after": {
"api": "2026-10-02T09:42:32.330163294Z",
"postgres": "2026-10-02T09:42:29.527737917Z",
"valkey": "2026-10-02T09:42:29.541207376Z"
},
"counts_before": "52|20|22334|40|1",
"counts_after": "55|21|22335|43|1"
},
"session_expiry_ttl_2_seconds": true,
"restart_does_not_shorten_existing_session": true
},
"date_utc": "2026-10-02T09:42:24Z",
"result": "PASS"
}
+2
View File
@@ -0,0 +1,2 @@
python3 student-tests/lifecycle.py --base-url "http://localhost:8082"
PASS: non-root, SIGTERM, same-session recovery, log privacy
+59
View File
@@ -0,0 +1,59 @@
{
"result": "PASS",
"date_utc": "2026-10-02T09:43:36Z",
"non_root_user": "10001:10001",
"pid1": "messenger",
"health": "healthy",
"sigterm_seconds": 0.208,
"exit_code": 0,
"oom_killed": false,
"same_session_and_message_after_api_restart": true,
"sensitive_body_password_token_absent_from_logs": true,
"shutdown_logs": [
{
"time": "2026-10-02T09:43:35.682791128Z",
"level": "INFO",
"msg": "shutdown completed",
"duration_ms": 0
}
],
"images": [
{
"id": "sha256:d95606280c8307e47500e4dacd5ab5f9a495e85841260c4c78380ebf565573f1",
"digests": [
"mtusi-messenger@sha256:d95606280c8307e47500e4dacd5ab5f9a495e85841260c4c78380ebf565573f1"
],
"tags": [
"mtusi-messenger:lab2"
]
},
{
"id": "sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94",
"digests": [
"postgres@sha256:ef257d85f76e48da1c64832459b59fcaba1a4dac97bf5d7450c77753542eee94"
],
"tags": [
"postgres:17.6-alpine"
]
},
{
"id": "sha256:d827e7f7552cdee40cc7482dbae9da020f42bc47669af6f71182a4ef76a22773",
"digests": [
"valkey/valkey@sha256:d827e7f7552cdee40cc7482dbae9da020f42bc47669af6f71182a4ef76a22773"
],
"tags": [
"valkey/valkey:8.1.3-alpine"
]
}
],
"durability": {
"fsync": "on",
"synchronous_commit": "on",
"full_page_writes": "on"
},
"host": "macOS-26.6.2-arm64-arm-64bit",
"docker_vm": {
"cpus": 14,
"memory_bytes": 8217473024
}
}
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://localhost:8082"
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
+88
View File
@@ -0,0 +1,88 @@
docker compose --env-file .env --profile verify run --build --rm tests
Container mtusi-lab2-kraykin-postgres-1 Running
Compose can now delegate builds to bake for better performance.
To do so, set COMPOSE_BAKE=true.
#0 building with "desktop-linux" instance using docker driver
#1 [tests internal] load build definition from Dockerfile
#1 transferring dockerfile: 782B done
#1 DONE 0.0s
#2 [tests internal] load metadata for docker.io/library/golang:1.24.4-alpine3.22
#2 DONE 0.7s
#3 [tests internal] load .dockerignore
#3 transferring context: 196B done
#3 DONE 0.0s
#4 [tests build 1/7] FROM docker.io/library/golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a
#4 resolve docker.io/library/golang:1.24.4-alpine3.22@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a done
#4 DONE 0.0s
#5 [tests internal] load build context
#5 transferring context: 618B done
#5 DONE 0.0s
#6 [tests build 6/7] COPY internal/ ./internal/
#6 CACHED
#7 [tests build 5/7] COPY cmd/ ./cmd/
#7 CACHED
#8 [tests build 3/7] COPY go.mod go.sum ./
#8 CACHED
#9 [tests build 2/7] WORKDIR /src
#9 CACHED
#10 [tests build 4/7] RUN go mod download
#10 CACHED
#11 [tests build 7/7] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/messenger ./cmd/server
#11 CACHED
#12 [tests tests 1/1] RUN apk add --no-cache gcc musl-dev
#12 0.103 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/main/aarch64/APKINDEX.tar.gz
#12 1.303 fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/community/aarch64/APKINDEX.tar.gz
#12 3.740 (1/14) Upgrading musl (1.2.5-r10 -> 1.2.5-r12)
#12 4.071 (2/14) Installing libgcc (14.2.0-r6)
#12 4.168 (3/14) Installing jansson (2.14.1-r0)
#12 4.242 (4/14) Installing libstdc++ (14.2.0-r6)
#12 4.889 (5/14) Installing zstd-libs (1.5.7-r0)
#12 5.156 (6/14) Installing binutils (2.44-r3)
#12 7.022 (7/14) Installing libgomp (14.2.0-r6)
#12 7.162 (8/14) Installing libatomic (14.2.0-r6)
#12 7.365 (9/14) Installing gmp (6.3.0-r3)
#12 7.531 (10/14) Installing isl26 (0.26-r1)
#12 8.107 (11/14) Installing mpfr4 (4.2.1_p1-r0)
#12 8.672 (12/14) Installing mpc1 (1.3.1-r1)
#12 8.772 (13/14) Installing gcc (14.2.0-r6)
#12 34.78 (14/14) Installing musl-dev (1.2.5-r12)
#12 35.52 Executing busybox-1.37.0-r18.trigger
#12 35.53 OK: 163 MiB in 30 packages
#12 DONE 35.7s
#13 [tests] exporting to image
#13 exporting layers
#13 exporting layers 3.7s done
#13 exporting manifest sha256:623b75c2be9321b73ddfcd975dc96154ad76f3479b9957fe2c470536b5e30e45
#13 exporting manifest sha256:623b75c2be9321b73ddfcd975dc96154ad76f3479b9957fe2c470536b5e30e45 done
#13 exporting config sha256:08ba6251faeb9acb4bc701d282a653337653dfba10e48980f21e42f3a188c648 done
#13 exporting attestation manifest sha256:f3e64072d1e6e17c83c1e60b5a7141f210a34107b747bb004b2a10186ff90cf2 done
#13 exporting manifest list sha256:929b7c668c3e0d3e7c73a8e303503541f2202bddc0b481699450bc20f8a87c8e done
#13 naming to docker.io/library/mtusi-lab2-kraykin-tests:latest done
#13 unpacking to docker.io/library/mtusi-lab2-kraykin-tests:latest
#13 unpacking to docker.io/library/mtusi-lab2-kraykin-tests:latest 1.1s done
#13 DONE 4.9s
#14 [tests] resolving provenance for metadata file
#14 DONE 0.0s
? mtusi/messenger/cmd/server [no test files]
? mtusi/messenger/internal/database [no test files]
=== RUN TestDatabaseConcurrentHTTP
database_test.go:119: 100 confirmed messages from 10 clients through real HTTP and PostgreSQL; race detector enabled
--- PASS: TestDatabaseConcurrentHTTP (1.77s)
=== RUN TestPasswordFullUnicodeRange
--- PASS: TestPasswordFullUnicodeRange (2.20s)
PASS
ok mtusi/messenger/internal/messenger 5.009s
+14
View File
@@ -0,0 +1,14 @@
Container mtusi-lab2-kraykin-valkey-1 Running
Container mtusi-lab2-kraykin-postgres-1 Running
Container mtusi-lab2-kraykin-api-1 Recreate
Container mtusi-lab2-kraykin-api-1 Recreated
Container mtusi-lab2-kraykin-postgres-1 Waiting
Container mtusi-lab2-kraykin-postgres-1 Healthy
Container mtusi-lab2-kraykin-api-1 Starting
Container mtusi-lab2-kraykin-api-1 Started
Container mtusi-lab2-kraykin-valkey-1 Waiting
Container mtusi-lab2-kraykin-api-1 Waiting
Container mtusi-lab2-kraykin-postgres-1 Waiting
Container mtusi-lab2-kraykin-valkey-1 Healthy
Container mtusi-lab2-kraykin-postgres-1 Healthy
Container mtusi-lab2-kraykin-api-1 Healthy
+30
View File
@@ -0,0 +1,30 @@
go test -race -count=1 -v ./...
? mtusi/messenger/cmd/server [no test files]
? mtusi/messenger/internal/database [no test files]
=== RUN TestDatabaseConcurrentHTTP
database_test.go:24: run make test-race for real PostgreSQL HTTP integration
--- SKIP: TestDatabaseConcurrentHTTP (0.00s)
=== RUN TestPasswordFullUnicodeRange
--- PASS: TestPasswordFullUnicodeRange (2.02s)
PASS
ok mtusi/messenger/internal/messenger 3.054s
python3 student-tests/integration.py --base-url "http://localhost:8082"
PASS: strict_json_unicode_body_limits
PASS: username_race
PASS: chat_rollback_after_fk_failure
PASS: 100_concurrent_messages_and_keyset_scope
PASS: monotonic_chat_clock
PASS: authentication_and_chat_authorization
PASS: password_kdf_and_token_digest_storage
PASS: valkey_real_profile_cache_ttl
PASS: cache_flush_repopulates_with_same_session
PASS: cache_down_fallback_and_read_after_write
PASS: database_down_fails_closed
PASS: logout_with_warm_cache
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8082"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
PASS: full_stack_restart_and_cursor
PASS: session_expiry_ttl_2_seconds
PASS: restart_does_not_shorten_existing_session
PASS: all student integration checks