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>
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
// 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)
|
|
}
|