fix(runtime): keep supervision and absence retries in container

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-11 09:01:52 +03:00
1 parent 226d93e2aa
commit 3f9fd2f36f
21 files changed
+1056 -137

No files matched your search

+18 -5
View File
@@ -1,8 +1,21 @@
# Прогресс реализации
Срез на **2026-10-10**. Этот файл описывает фактическое состояние кода, а не весь объём требований из `Requirements.md` и `Architecture.md`.
Срез на **2026-10-11**. Этот файл описывает фактическое состояние кода, а не весь объём требований из `Requirements.md` и `Architecture.md`.
## Готово
## Текущий статус
- **2026-10-11 container-owned control (pending working-tree changes):** all technical child restart control belongs to the entrypoint/PID 1 inside the same container, not host systemd. Safe cleanup precedes each retry; three runtime starts per rolling six hours include the initial start, with cancellable 15s/30s backoff capped at 60s. Configuration/safety/DB/journal/rollback/cleanup failures and exhausted retry budget stop fail-closed. SIGTERM cancels and joins the monitor, restores safely, then stops target-local zapret and SS children. No additional dependency or host service installation is required. Compose keeps `restart: "no"` to avoid safety loops and now allows 240s stop grace: 140s sequential cleanup including 45s monitor join, plus room for a deferred 45s startup command/kill grace and overhead. A fresh-shell join watchdog is cancelled promptly on child completion; graceful shutdown never needs its full timeout. Container-platform lifecycle and host-boot policy remain deployment-operator responsibilities.
- **2026-10-11 strategy absence (pending working-tree changes):** genuine validated no-qualified-strategy outcomes in bootstrap/recovery persist a wait of at least two hours in SQLite. Both fresh bootstrap and periodic recovery use the greater of two hours and the configured recovery cooldown, preserving longer settings. The same container continues light probes without scans/apply during the wait; startup respects the persisted expiry, and normal threshold-driven recovery resumes after expiry. Other ordinary outcomes keep the default 30m cooldown. Malformed reports/runner/safety errors are not absence. The separate 90-minute whole-job watchdog plus 30-second restoration reserve remains an abnormal technical ceiling, not a normal no-strategy result or the absence wait.
- Root operator docs now describe this contract, preserving immutable tagged/digest promotion, BuildKit/pinned builds, private `.env`, whole stopped-state backup/restore and exact legacy `managed-test` guards for a new isolated target only. No old target adoption or Xray changes. New runtime changes still need their owners' focused checks and isolated live acceptance (retry/backoff, SIGTERM, durable absence expiry/resume); this documentation update does not claim those checks were run.
## История реализации (не текущие инструкции)
The dated facts below are historical snapshots. In particular, host-systemd unit
installation/restart/start-limit guidance and its acceptance tests are **superseded**
by container-owned control above; they impose no current deployment requirement.
Earlier “not deployed/not verified” snapshots do not override later recorded
isolated-target acceptance. Production acceptance of the new supervision/absence
policy remains pending.
- **2026-10-11 production-candidate update (remote checks dated 2026-10-10 UTC):** `ed4298d` adds one 90-minute budget per managed bootstrap/recovery job, shared across phases. Watchdog expiration is abnormal/fatal, never ordinary nonpass/cooldown continuation; clean timeout permits technical exit 75 only after worker join and bounded 30-second restoration. Any guard/DB/rollback/cleanup or mixed unknown error vetoes restart (78); configuration errors use 64, graceful shutdown 0. Independent review reproduced and closed mixed-timeout, fatal-discovery and fatal-health/deadline races. Preferred frontend seed is now the layout-safe alternative verified in prior 60/60 requests; cached definitions are not rewritten.
- **2026-10-10 restart/startup hardening:** optional `deploy/managed-target/zapret-autotune.service` uses foreground Compose, no blanket Docker restart, systemd allowlisted 75 with bounded starts (3 per 6h); shutdown grace 120s / unit stop budget 180s. `61e6e00` adds guarded fixed-DB `managed reconcile` before initial activation; init/reconcile/start are bounded (45/45/30s plus 5s kill grace), all startup refusals map to 78. Unknown state is not sourced even by cleanup. Actual systemd tests: technical 75 retries bounded, 78 does not retry; killing monitor in final image caused one whole-target restart, preserving both groups and Player API OK. Permanent production service was not installed/enabled; transient acceptance units were stopped.
@@ -65,18 +78,18 @@
- На одном найденном GGC hostname текущая статическая стратегия `fakeddisorder:pos=midsld:tcp_flags_set=SYN` прошла data-transfer check 3/3 для TLS 1.2 и TLS 1.3. Frontend-комбинация на этом GGC hostname не прошла; frontend и GGC требуют отдельных профилей.
- Отдельный Selectel speedtest с SNI `googlevideo` был проверен экспериментально, но **не используется** для ранжирования: принято решение доверять TLS/data-transfer результатам `blockcheckw`.
## Выполняется сейчас
## Исторические незавершённые работы (на момент записи)
- Scan и shortlist check завершены, контейнер `zapret-autotune-googlevideo-scan` остановился с кодом 0. Проверка exact combined args прошла; `tune googlevideo` не запускался end-to-end и результаты вручную в SQLite не импортировались.
- Новый отдельный `tune googlevideo` proposal-only и не меняет frontend-only `tune youtube`; удалённый end-to-end запуск команды ещё не выполнен.
## Не готово
## Исторические ограничения (на момент записи)
- Проверка реального YouTube video-transfer/SABR. Прямой GET `serverAbrStreamingUrl` возвращает `sabr.malformed_config`; hostname discovery и `blockcheckw` data-transfer checks не равны проверке воспроизведения видео.
- Guarded managed CLI/monitor интегрированы внутри designated target: transaction core, bootstrap/recovery callback и deployment definition есть, но нет proven image/runtime compatibility, выполненного container provisioning и реально запущенного managed target. Одноразовый Player API health сам не запускает live automation. Цель: новый отдельный prod-like zapret2-ss контейнер только в тестовой среде; существующий контейнер не трогать. Стабильный настраиваемый loopback SOCKS для Xray; Xray config вне scope. Перед runtime пройти route/rollback gates.
- Полный сервис из требований: YAML-конфигурация сервисов, endpoint-история/покрытие, daemon/периодический мониторинг, API/метрики и multi-service режим.
## Открытые ограничения и следующие шаги
## Исторические следующие шаги (текущие gates указаны выше)
1. Проверить новый `tune googlevideo` и `recover googlevideo` end-to-end на удалённом сервере; отдельно решить, как импортировать или переиспользовать уже полученные scan результаты без повторного перебора.
2. Воспроизводимое описание отдельного prod-like target добавлено в `deploy/managed-target`; orchestrator должен проверить Compose syntax. Build/run отложены. До запуска проверить baseline-конфиг и NFQUEUE внутри container network namespace; текущие mounts, сеть, порты и конфиг не переиспользовать.