feat: add private S3 storage (SeaweedFS) with bootstrap and client

- s3 and s3-bootstrap services: SeaweedFS 4.48 pinned by digest,
  internals on loopback, signing key, private bucket, API user policy,
  privacy checks on every bootstrap
- [s3] settings and aiobotocore client in src/infra/s3: deadline per
  call, no retries, 503 on outage or rejected credentials
- make start_s3, stop_s3, s3_check; run_dev, test_isolated, wipe_data
  and restart hook include S3
- failure_checks with own S3 and readiness check without it; bench
  generates S3 secrets and filters them out of the passport
- rules, AGENTS.md, skill; sync health delta; KNOWN_ISSUES: rollout_from

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 20:12:04 +03:00
co-authored by Claude Opus 5.5
parent 379ac81374
commit 2e997f9b42
41 changed files with 2218 additions and 189 deletions
+14 -2
View File
@@ -1,7 +1,7 @@
"""Проверки отказов: выполняет только `make failure_checks` (маркер `fault`).
Стенд и hook готовит `student-tests/run_failures.py`: свои Postgres и
Valkey, обычный API (`BASE_URL`) и «тесный» (сроки сессии и ключа
Стенд и hook готовит `student-tests/run_failures.py`: свои Postgres,
Valkey и S3, обычный API (`BASE_URL`) и «тесный» (сроки сессии и ключа
идемпотентности 2 с, пул из одного соединения). На хранилища тесты действуют только через фикстуру
`stand` (hook `student-tests/fault_hook.py`) и всегда возвращают их в
рабочее состояние. Решение 4 design change `failure-checks`.
@@ -42,6 +42,9 @@ IDEMPOTENCY_TTL_S = 2
POOL_TIMEOUT_S = 1
# срок проверки Postgres в /health/ready
READINESS_TIMEOUT_S = 2
# health без S3: проверка к S3 не обращается, ответ быстрее секунды (спек
# health, «Хранилище объектов недоступно»); срок вызова S3 — 5 с
OBJECT_STORAGE_HEALTH_S = 1
# сколько секунд hook держит слоты max_connections; clear-connections
# освобождает их раньше
FILL_HOLD_S = 30
@@ -349,6 +352,15 @@ def test_readiness_without_cache(api: Api, stand: Stand) -> None:
assert api.request("GET", "/health/ready").status_code == 200
@pytest.mark.spec("health", "Хранилище объектов недоступно")
def test_readiness_without_object_storage(api: Api, stand: Stand) -> None:
with outage(stand, "stop", "s3"):
for path in ("/health/ready", "/health/live"):
resp, took = timed(lambda path=path: api.request("GET", path))
assert assert_ok(resp, 200, "Health") == {"status": "ok"}
assert took < OBJECT_STORAGE_HEALTH_S, f"{path} took {took:.2f}s"
# ---------------------------------------------------------------------------
# Кэш карточки чата
# ---------------------------------------------------------------------------