feat: extract versioned YouTube service adapter

Wire pure Player parsing and strict qualification planning through a compiled-in kind/version registry. Fail closed before discovery requests when the required module is absent or mismatched.

Require sealed module-bound v2 evidence for new writes while preserving fresh trusted v1 apply eligibility and historical rollback. Keep legacy SOCKS5h routing, separate suffix/asset policy and public configuration unchanged; generic controller cutover and field acceptance remain pending.

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-15 16:23:54 +03:00
1 parent d324b4137b
commit f4853173b3
21 files changed
+1176 -74

No files matched your search

+34
View File
@@ -125,3 +125,37 @@ within a 90-second Docker stop limit (the supplied Compose grants 240 seconds).
Bounded final reaps/worst-case cleanup were verified offline; measured remote
normal stops were 1.45s, 0.59s and 0.57s, not an 80-second runtime worst-case test.
These changes do not claim to fix legacy YouTube exit 78.
### Internal service-adapter boundary (local extraction, field acceptance pending)
Legacy YouTube execution now explicitly selects compiled-in `youtube/1` via
`cmd/zapret-autotune/service_adapters.go`. `internal/adapter/youtube` parses
bounded Player media JSON and supplies signed-MP4 freshness/diversity semantics
and the owned qualification plan. Unknown/absent kind or version fails closed,
without a generic HTTP fallback. The shared `internal/adapter` DTOs are internal
only: signed URLs/inventory and plan caps have `json:"-"` fields.
The existing controller still owns discovery requests/retries, transport,
origin/SNI/certificate/TLS checks, worker guards/cleanup and sealing after join.
Legacy probes retain SOCKS5h and the owned encrypted-resolver guard; they do not
run the generic all-A/AAAA approval/connect-to IP pinning path. Full request-policy
capabilities (including future metadata POST) and parity are prerequisites before
generic cutover, not guarantees supplied by this minimal extraction.
Public generic checks and their HMAC/state formats have not migrated to this
module interface. Suffix/experimental authorization is separate from measured
endpoints, and avatar/thumbnail health remains independent. A module plan is
neither proof nor permission to claim READY.
New adaptive proof v2 seals adapter kind/version/policy digest along with the
measured facts. Unknown identities, mismatched policy, missing attestation and
unsealed DTOs cannot publish adaptive evidence. Legacy v1 is explicitly the
immutable historical YouTube policy for journal reconstruction, not a request
to reinterpret old evidence using the latest module. Expired historical proofs
can reconstruct their owned config. Fresh trusted stored v1 retains its original
apply eligibility; expiry still blocks fresh apply. Only new producer writes
require sealed module-bound v2; public/unsealed DTOs cannot publish evidence.
Discovery/asset/health entrypoints preflight the required kind/version/policy
before requests. Missing/mismatched modules are fatal configuration failures,
not retryable inventory absence or a genuine-no-strategy cooldown.
No public module field, dynamic plugin ABI, controller cutover, same-UID sandbox,
remote YouTube acceptance, or fix for legacy exit 78 is claimed here.