Documentation
¶
Overview ¶
Package providerreads implements the closed ovdb-provider-read/1 evidence contract. Evidence records consumed transient bytes, never bodies or rows.
Index ¶
- Constants
- func Canonical(value any) ([]byte, error)
- func Digest(value any) (string, error)
- func ObservationDigest(ex Execution, b Binding, o Observation) (string, error)
- func RequestDigest(r Request) (string, error)
- func RightsDigest(right license.SourceRight) (string, error)
- func Validate(e Envelope, p Plan, used []string) error
- func ValidateMetadata(metadata Metadata, plan Plan, admittedUsed []string) error
- type Binding
- type Collector
- type Envelope
- type Execution
- type Metadata
- type Observation
- type Plan
- type Request
- type Usage
Constants ¶
const Format = "ovdb-provider-read/1"
const MaxItems = 64
const MaxMetadataBytes = 256 * 1024
Variables ¶
This section is empty.
Functions ¶
func Canonical ¶
Canonical returns RFC 8785 JSON, with ECMAScript numbers and UTF-16 key order. No Unicode normalization or recursive field removal is performed.
func ObservationDigest ¶
func ObservationDigest(ex Execution, b Binding, o Observation) (string, error)
func RequestDigest ¶
func RightsDigest ¶
func RightsDigest(right license.SourceRight) (string, error)
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector owns only observation metadata for one execution. It cannot fetch, retain source bytes or deduplicate network reads. Callers must reuse the actual transient response for any admitted self-join; joins remain unsupported here.
func NewCollector ¶
type Envelope ¶
type Envelope struct {
Format string `json:"format"`
Execution Execution `json:"execution"`
Bindings []Binding `json:"bindings"`
Reads []Observation `json:"reads"`
Usage []Usage `json:"usage"`
}
type Metadata ¶
type Metadata struct {
SourceRights []license.SourceRight `json:"sourceRights"`
UsedSourceIDs []string `json:"usedSourceIds"`
ProviderReads *Envelope `json:"providerReads"`
}
Metadata captures only response evidence. Rows and other parent response fields must not be accessed or cloned by the evidence gate.
type Observation ¶
type Observation struct {
ObservationID string `json:"observationId"`
ResourceID string `json:"resourceId"`
RequestDigest string `json:"requestDigest"`
FetchedAt string `json:"fetchedAt"`
UpstreamURL string `json:"upstreamUrl"`
Status int `json:"status"`
ContentType string `json:"contentType"`
SHA256 string `json:"sha256"`
Bytes int64 `json:"bytes"`
ReferenceDate string `json:"referenceDate,omitempty"`
LastModified string `json:"lastModified,omitempty"`
ETag string `json:"etag,omitempty"`
Attestation string `json:"attestation"`
}
type Plan ¶
type Plan struct {
Execution Execution
Bindings []Binding
Requests []Request
SourceRights []license.SourceRight
MaxReads *int
MaxMetadataBytes int
}
Plan is trusted admission input, detached before reads. DefinitionDigest must resolve a verified immutable definition that binds exact model/meaning artifacts.