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:
1 parent
d324b4137b
commit
f4853173b3
21 files changed
+1176
-74
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// Package adapter defines the closed internal contract used by compiled-in
|
||||
// service adapters. It is not the public resource-check configuration API.
|
||||
package adapter
|
||||
|
||||
import "time"
|
||||
|
||||
type Binding struct {
|
||||
Kind string `json:"kind"`
|
||||
Version int `json:"version"`
|
||||
PolicySHA256 string `json:"policy_sha256"`
|
||||
}
|
||||
|
||||
// Resource and Plan are ephemeral; neither private inputs nor policy caps belong
|
||||
// in evidence. Only core-validated, measured facts can become a sealed proof.
|
||||
type Resource struct {
|
||||
URL string `json:"-"`
|
||||
Host string `json:"-"`
|
||||
Kind string `json:"-"`
|
||||
}
|
||||
|
||||
type Plan struct {
|
||||
Hosts []string `json:"-"`
|
||||
Protocols [2]string `json:"-"`
|
||||
WarmupLimit int `json:"-"`
|
||||
WarmupTimeout time.Duration `json:"-"`
|
||||
Samples int `json:"-"`
|
||||
MinBytes int64 `json:"-"`
|
||||
}
|
||||
|
||||
type Module interface {
|
||||
Binding() Binding
|
||||
DiscoverResponse([]byte) ([]Resource, error)
|
||||
ValidateHosts([]string) error
|
||||
PlanQualification([]string, []Resource, time.Time) (Plan, error)
|
||||
}
|
||||
Reference in new issue
Block a user