diff --git a/MANAGED_TARGET.md b/MANAGED_TARGET.md index 84ae15d..0f761a1 100644 --- a/MANAGED_TARGET.md +++ b/MANAGED_TARGET.md @@ -1,4 +1,4 @@ -# Fresh managed-test target contract (not deployed) +# Fresh managed-test target contract (isolated acceptance, not production approval) `managed init|reconcile|status|active-ids|apply` is exclusively for a **new dedicated container** which owns its entire config. The existing/dev/production container must refuse @@ -27,8 +27,9 @@ deliberately forging a provisioned runtime. The managed `config` is a standalone **full config only in this fresh volume**. Never replace, adopt, or symlink over `/opt/zapret2/config` or any existing -service config. The new deployment entrypoint must ensure the base daemon -actually honors the exact `ZAPRET_CONFIG` path; compatibility remains unproven. +service config. The deployment entrypoint must ensure the base daemon actually +honors the exact `ZAPRET_CONFIG` path; isolated RC acceptance does not waive +that check for a new image. Existing services would require a separately designed managed **include fragment**, not this full-config adapter. No such integration is implemented. @@ -104,15 +105,15 @@ Directories must not be writable by untrusted processes; hostile concurrent filesystem mutation is outside the transaction boundary. Shell config safety and exact GGC filtering are unchanged. -The isolated [Compose definition](deploy/managed-target/README.md) now supplies -the marker, mount and ordered startup; it has not been built or deployed. -No Docker socket, remote/container operations, old target paths, Xray edits, -or host firewall provisioning are included. Before deployment, +The isolated [Compose definition](deploy/managed-target/README.md) supplies +the marker, mount and ordered startup; isolated deployments are recorded below. +No Docker socket, old target paths, Xray edits or host firewall provisioning +are included. Before each new deployment, provisioning must verify the pinned image honors `ZAPRET_CONFIG`, supports all listed variables, and starts ss-local while the baseline leaves nfqws2 disabled. Start the fresh target with that baseline, then verify active apply installs target-local nft NFQUEUE rules and starts nfqws2, and rollback restores both. -These image/startup/routing gates remain unverified: if any is unsupported or +If any image/startup/routing requirement is unsupported or uncertain, deployment must fail closed, not substitute `restart-daemons` or alter an old config. Persistent volume durability is a provisioning requirement; mountinfo alone cannot establish the storage lifecycle. @@ -131,9 +132,9 @@ Cancelled/failed downtime restores the committed configuration and runs fixed target `start` with an independent 30-second cleanup deadline. Failed cleanup or rollback is fatal to the supervisor; unresolved journal state is never started. The callback caller must hold the monitor singleton; the wiring repeats runtime -identity/SOCKS guards. Fake-only checks are added, but tests/build are deferred -to the orchestrator. `managed monitor` now binds those callbacks and only the -dedicated target entrypoint starts it; no live/runtime validation has occurred. +identity/SOCKS guards. `managed monitor` binds those callbacks and only the +dedicated target entrypoint starts it; local and isolated runtime validation +results, with their limits, are recorded in [PROGRESS.md](PROGRESS.md). ## Dedicated monitor integration (isolated clean-run acceptance passed) @@ -211,6 +212,8 @@ Example (replace registry and release; never reuse a release tag): ```sh IMAGE=registry.example/team/zapret-autotune-managed-target:2026-10-10-r1 docker build --pull -f Dockerfile.target -t "$IMAGE" . +test "$(docker image inspect --format '{{json .Config.Entrypoint}}' "$IMAGE")" = '["/bin/sh","/opt/managed-target-entrypoint.sh"]' +docker run --rm --network none --entrypoint /bin/sh "$IMAGE" -ec 'test "$(cat /etc/zapret-autotune/target-id)" = zapret-autotune-managed-v1; test -f /opt/managed-target-entrypoint.sh' docker push "$IMAGE" docker image inspect --format '{{index .RepoDigests 0}}' "$IMAGE" ``` @@ -230,6 +233,11 @@ docker compose --env-file deploy/managed-target/.env -f deploy/managed-target/co docker compose --env-file deploy/managed-target/.env -f deploy/managed-target/compose.yaml pull target ``` +Do not omit `-f Dockerfile.target`: root `Dockerfile` builds the proposal/prototype, +not the PID-1-managed target. Assert both entrypoint and provisioned marker on the +exact selected image before promotion; the assertions above are image-contract +checks, not live resource qualification. A managed-looking tag is insufficient. + Start the selected container image with Compose `up --no-build`; no host service installation is required. Keep the selected digest and private configuration together for upgrades and rollback. Never run a build @@ -453,13 +461,21 @@ is not image-transfer qualification or a guarantee of full-family coverage. `googlevideo_scope` to its JSON. An experimental Googlevideo profile can be covered yet qualification-unresolved; one image profile does not establish full asset-inventory success. Status is read-only and reports live health NOT CHECKED. -Reported `a60f62d` field checks passed restart/recreation and status coverage checks. -A live upgrade hit runner `BrokenPipe` and automatically rolled back to the same -last-good image; successful autonomous media recovery remains unaccepted. Fresh -Range media passed once on TLS1.2, then failed on repeat; no TLS1.3 media PASS is -claimed, and the field failure's cause is unknown. Reported watch metadata had an -allowed avatar URL absent from the homepage, but this new conditional fallback -is source-only and neither field-deployed nor avatar-image-qualified. See -[PROGRESS.md](PROGRESS.md) for the remaining gates. Generic production +Historical `a60f62d` restart/recreation and status checks passed, but its upgrade +hit `BrokenPipe` and rolled back; that run did not accept media recovery. Later +supplied final field results for source `fd25cb8`, managed image +`sha256:73e955e7fdc6efaef88c62ebe4f7afeab71c29d29ba3c88b2a2b7547bb647da5` +on SOCKS11082 completed a 15-minute watch with restart count0 and a live monitor. +Validated rejection/no-qualified-strategy recovery continued with naturally +advanced cooldown and unchanged experimental profiles; it did not repair avatars. +Three fresh media hosts across two roots passed post-warmup 3/3 on each TLS +protocol (18 actual HTTP206/65536-byte MP4 transfers). This is field evidence, +not persisted family qualification, a cold/all-host claim or candidate promotion. +Watch fallback discovered allowed avatar metadata, but both-TLS curl28 transfers +had zero samples: avatar evidence/profile qualification is still absent and +overall health is **DEGRADED / NOT READY**. Automatic durable multi-host family +qualification remains unimplemented. See [PROGRESS.md](PROGRESS.md) for exact +hosts, separate warmup results, timestamps, private proof and remaining gates. +No new network checks accompany this documentation. Generic production media behavior and signed-URL/SS secret privacy remain unchanged, as do the persisted minimum two-hour strategy-absence pause and 90-minute whole-job budget. diff --git a/PROGRESS.md b/PROGRESS.md index 39f6d9c..c247a40 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -4,7 +4,26 @@ ## Текущий статус -### Peer TLS rejection classification fix (2026-10-12) +### Final managed RC field acceptance (2026-10-12): DEGRADED, not READY + +- Supplied final field results, not network checks rerun by this docs update: source `fd25cb89398300bb9849db4b5511af75bf86eccf`, correct managed image `sha256:73e955e7fdc6efaef88c62ebe4f7afeab71c29d29ba3c88b2a2b7547bb647da5`, active container `a4e845a6d7…`, official managed PID 1, isolated SOCKS `127.0.0.1:11082`. The earlier `37823…` prototype image is **not active** and is not this acceptance image. Private sanitized proof: `/home/agent/zapret2-autotune-rc-fd25cb8/proof/final.safe.json`. The later docs commit is not the tested image source. +- Watch started `2026-10-12T20:15:07.686Z`; check at `2026-10-12T20:30:54.826Z` completed over 15 minutes with DockerRestartCount0 and monitor alive. A fresh orchestrator check after the report returned SOCKS greeting `0500` and WWW HTTP200 with SSLVerifyResult0. Managed `socks5h` probes respect native SS DNS `-d 8.8.8.8`; no local-resolution bypass or certificate bypass is claimed. +- At this observation, experimental journal generation9, IDs [1,3,9], hash prefix `0e34…` and covered scope were retained unchanged. Saved candidate3 remains experimental, without qualification/evidence. These are snapshot values, not universal IDs/generation. Runtime recovery classification accepted validated peer-TLS/payload rejections as nonpass, with writable-store/ownership guards and the current job-bound transaction hooks intact. Genuine no-qualified-strategy recovery advanced its cooldown **naturally** while the monitor stayed alive; no cooldown reset or fabricated ERROR/source result was used. This validates degraded recovery continuation, not successful avatar repair or family promotion. +- Fresh actual Range media results, **post-warmup**, not cold qualification: + + | Sampled hostname | TLS1.2 | TLS1.3 | + | --- | --- | --- | + | `rr4---sn-axq7sn7z.googlevideo.com` | 3/3 | 3/3 | + | `rr5---sn-n8v7kn76.googlevideo.com` | 3/3 | 3/3 | + | `rr18---sn-axq7sn7z.googlevideo.com` | 3/3 | 3/3 | + + All **18** transfers verified HTTP206, 65536 bytes, MP4 `ftyp` and valid Range `0..65535`. Separately, initial TLS1.2 warmup had three timeouts; initial TLS1.3 warmup had three passes. Three hosts across two roots provide representative field transfer evidence only; no cold/all-host or durable family qualification was created. The older rr5 `sn-ixh` counterexample was **not tested** here and is not resolved by the new rr5 `sn-n8v7kn76` sample. +- Thumbnail `i.ytimg.com`: JPEG, 2888 bytes, SSLVerifyResult0, decoded 3/3 on each TLS protocol. Fresh watch metadata discovered an allowed exact `yt3.ggpht.com` avatar URL, but actual avatar transfers returned curl28 on both TLS protocols, zero samples. No saved avatar evidence or qualified avatar profile exists. Overall live health remains **DEGRADED / NOT READY**; URL discovery and successful media do not close the avatar gate. +- Other production/test targets on 1080/11080/11081 retained their IDs/start times; Xray was untouched. No further remote operations accompany this docs update. Build explicitly with `-f Dockerfile.target` and assert the managed entrypoint plus target marker **before promotion**: a tag alone previously mistook root `Dockerfile`'s prototype for the managed image. + +Remaining work: actual avatar transfer/strategy qualification, then durable representative multi-host family qualification and mode acceptance. Automatic family qualification is not implemented; no experimental candidate was promoted. Restart/recreation observations from older RCs remain separate from this final 15-minute watch. The historical open-media/fallback/deployment labels below are superseded only by the specific final results above, not by blanket production approval. + +### Earlier peer TLS rejection classification fix (2026-10-12) - Follow-up independent production repro exposed a separate decoder rejection bug: a bounded/origin-verified truncated image degraded live health but failed owned verification as infrastructure before remaining seeds. Image decoding now emits typed payload rejections (invalid magic/dimensions, truncated PNG/JPEG/GIF, body budget and content-type mismatch); both live health and candidate verification share that class, without accepting any payload or fabricating evidence. Missing/corrupt normalized evidence, malformed transfer metrics/Player JSON, arbitrary same-text errors, explicit guards and mixed cancellation remain fatal; image rejection cannot become media absence. Permanent production monitor tests cover joined workers, seed exhaustion/two-hour pause and a later seed's fresh both-TLS 3/3 evidence with preserved frontend/GGC profiles. The independent overlay repro, affected Go tests and race tests, vet, CLI build and diff checks passed locally; no remote deployment was performed. @@ -25,7 +44,7 @@ - Avatar discovery now conditionally falls back from a homepage with absent metadata/no allowed avatar to one fresh watch page for the validated configured video ID, on the same trusted HTTPS WWW origin and proxy. Malformed JSON, request failures, cancellation and safety failures do not authorize fallback. Reported watch metadata contained an allowed avatar URL where the homepage did not; the updated fallback has not been field-deployed or image-qualified. URL discovery alone does not qualify the avatar route/profile or close a family gate. - Local source verification for the watch fallback: fresh `go test ./... -count=1 -timeout=180s`, focused avatar inventory/parser/classifier, experimental production-probe and private-inventory regression tests under `-race`, and `git diff --check` passed. These are unit/fixture checks only, not new field evidence. -Remaining acceptance gates (not asserted defects): +Historical acceptance gates at that RC (updated by final field results above): 1. Representative fresh signed media evidence: at least three unique hosts across at least two roots/prefixes, post-warmup 3/3 for both TLS protocols plus actual media transfer. Do not impose uniform static/cold behavior on the accepted learning experiment or label it normally qualified without evidence. 2. Qualify the avatar route/profile: only the thumbnail image profile is currently active; browser-visible images do not close this gate. diff --git a/deploy/managed-target/README.md b/deploy/managed-target/README.md index 5eea637..49e095b 100644 --- a/deploy/managed-target/README.md +++ b/deploy/managed-target/README.md @@ -7,6 +7,41 @@ frontend/API strategy, then discovers and applies an exact-host GGC strategy. ## Recorded Googlevideo suffix experiment (2026-10-12) +### Final field follow-up: DEGRADED / NOT READY + +Supplied results for source `fd25cb89398300bb9849db4b5511af75bf86eccf`, correct +managed image `sha256:73e955e7fdc6efaef88c62ebe4f7afeab71c29d29ba3c88b2a2b7547bb647da5`, +container `a4e845a6d7…`, official managed PID 1 and SOCKS11082 supersede the +earlier pending media/fallback labels below. The `37823…` prototype is not active. +Watch `20:15:07.686Z` → `20:30:54.826Z` on 2026-10-12 completed over 15 minutes: +restart count0, monitor alive; a fresh post-report check returned SOCKS `0500`, +WWW HTTP200/SSLVerifyResult0. Native `socks5h` probes respect SS `-d 8.8.8.8`. + +Post-warmup TLS1.2 and TLS1.3 each passed 3/3 on +`rr4---sn-axq7sn7z.googlevideo.com`, `rr5---sn-n8v7kn76.googlevideo.com`, and +`rr18---sn-axq7sn7z.googlevideo.com`: **18 actual HTTP206, 65536-byte MP4 `ftyp` +transfers**, valid Range `0..65535`. Initial warmup is separate: TLS1.2 three +timeouts, TLS1.3 three passes. No cold/all-host claim; the old rr5 `sn-ixh` +counterexample was not retested. Thumbnail JPEG decoding passed 3/3 per TLS +(2888 bytes, SSLVerifyResult0). Watch metadata found an allowed `yt3.ggpht.com` +avatar URL, but actual both-TLS avatar transfers returned curl28, zero samples. +There is no saved avatar evidence or qualified avatar profile. + +Recovery now continued through validated peer-TLS/payload nonpasses with current +job-bound transaction/store/ownership guards: genuine no-qualified-strategy +cooldown advanced naturally while the monitor stayed alive, without a reset. +Snapshot generation9/IDs[1,3,9]/hash `0e34…`/experimental scope were unchanged; +candidate3 has no qualification/evidence. This is degraded recovery acceptance, +not successful avatar repair, durable family qualification or promotion. +Actual avatar transfer/strategy qualification and durable representative +multi-host family/mode qualification remain unfinished; automatic family +qualification is not implemented. Other targets on 1080/11080/11081 and Xray +were unchanged. No remote operations are performed by this docs update. +Private sanitized proof: `/home/agent/zapret2-autotune-rc-fd25cb8/proof/final.safe.json`. +Exact results and limits: [PROGRESS.md](../../PROGRESS.md). + +### Historical initial experiment + Source RC `eade051c2bc335b71b1616d697326ca4c8019d70`, immutable image `sha256:fdb60593e29d7c337a413a47aaddfbcaaeabdeb877042c58f506d4abdc98a13b`, isolated SOCKS `127.0.0.1:11082`: recorded journal generation3, active [1,2,3], @@ -30,9 +65,10 @@ replace this approved profile. Remaining acceptance is representative signed media coverage (at least three hosts across two roots/prefixes, post-warmup 3/3 on both TLS protocols plus media), avatar qualification, actual restart/recreation recovery of this suffix RC, and autonomous experimental recovery/autoqualification -policy with accurate covered-versus-qualified status. See -[PROGRESS.md](../../PROGRESS.md) for the five remaining gates. The older clean-run -PASS below does not close them. +policy with accurate covered-versus-qualified status. These were that initial +RC's pending gates; see the final follow-up above for later field results and +[PROGRESS.md](../../PROGRESS.md) for current remaining work. The older clean-run +PASS below does not close family/avatar qualification. ## Provisioning @@ -67,6 +103,22 @@ in the private `.env` and pull that immutable image before starting the target. Use a managed target image, not the generic image. Do not deploy production with a tag or local default. +Build from the repository root with an explicit Dockerfile and assert the +image contract **before promotion**, even if its tag says managed-target: + +```sh +IMAGE=zapret-autotune-managed-target:local +docker build --pull -f Dockerfile.target -t "$IMAGE" . +test "$(docker image inspect --format '{{json .Config.Entrypoint}}' "$IMAGE")" = '["/bin/sh","/opt/managed-target-entrypoint.sh"]' +docker run --rm --network none --entrypoint /bin/sh "$IMAGE" -ec 'test "$(cat /etc/zapret-autotune/target-id)" = zapret-autotune-managed-v1; test -f /opt/managed-target-entrypoint.sh' +``` + +Root `Dockerfile` is the proposal/prototype image, not the managed PID 1 service; +omitting `-f Dockerfile.target` previously produced a mistagged prototype. +These positive entrypoint/marker assertions do not replace live acceptance. +Promote the same immutable image as described in +[MANAGED_TARGET.md](../../MANAGED_TARGET.md#build-once-promote-the-same-image). + Offline static guard (from repository root): `python3 deploy/managed-target/check_static.py`. Offline real pre-launch validation and private Compose forwarding fixtures: