Documentation
¶
Overview ¶
Package media contains graph-native retained-media and attachment-resolution elements. Large payloads cross only explicit retention or resolution edges; trajectories and ordinary context channels carry bounded opaque handles.
Index ¶
- func Descriptors() []element.Descriptor
- func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
- func FetchRequestType() element.Type
- func FetchResultType() element.Type
- func RegisterDescriptors(catalog *resolve.Catalog) error
- func RegisterFactories(registry *graphruntime.Registry) error
- func ReleaseRequestType() element.Type
- func ReleaseResultType() element.Type
- func ResolveAttachmentDescriptor() element.Descriptor
- func ResolveRequestType() element.Type
- func ResolvedAttachmentType() element.Type
- func ResolverOutcomeType() element.Type
- func RetainRequestType() element.Type
- func RetainResultType() element.Type
- func RetainedMediaDescriptor() element.Descriptor
- func RetentionMetricsType() element.Type
- func RetentionOutcomeType() element.Type
- func ReturnLeaseRequestType() element.Type
- func ReturnLeaseResultType() element.Type
- func StoreCancelType() element.Type
- type AttachmentHandle
- type AttachmentKind
- type BlobLease
- type FetchRequest
- type FetchResult
- type ReleaseRequest
- type ReleaseResult
- type ResolveAttachmentConfig
- type ResolveRequest
- type ResolvedAttachment
- type ResolverOutcome
- type ResultKind
- type RetainRequest
- type RetainResult
- type RetainedMediaConfig
- type RetentionMetrics
- type RetentionOutcome
- type ReturnLeaseRequest
- type ReturnLeaseResult
- type StoreCancel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Descriptors ¶
func Descriptors() []element.Descriptor
func FactoryRegistrations ¶
func FactoryRegistrations() ([]graphruntime.FactoryRegistration, error)
func FetchRequestType ¶
func FetchResultType ¶
func RegisterDescriptors ¶
func RegisterFactories ¶
func RegisterFactories(registry *graphruntime.Registry) error
func ReleaseRequestType ¶
func ReleaseResultType ¶
func ResolveAttachmentDescriptor ¶
func ResolveAttachmentDescriptor() element.Descriptor
ResolveAttachmentDescriptor is an explicit, bounded adapter from an opaque handle to untrusted attachment bytes. It does not parse, narrate, or promote content authority; those are separate graph choices downstream.
func ResolveRequestType ¶
func ResolvedAttachmentType ¶
func ResolverOutcomeType ¶
func RetainRequestType ¶
func RetainResultType ¶
func RetainedMediaDescriptor ¶
func RetainedMediaDescriptor() element.Descriptor
RetainedMediaDescriptor owns one bounded retention scope. Retain, fetch, release, and addressed cancellation are separate graph observations. Fetch is intentionally not folded into an ambient service so every raw-byte path remains visible in Graph IR and live traces.
func RetentionMetricsType ¶
func RetentionOutcomeType ¶
func ReturnLeaseRequestType ¶
func ReturnLeaseResultType ¶
func StoreCancelType ¶
Types ¶
type AttachmentHandle ¶
type AttachmentHandle struct {
Handle string `json:"handle"`
Capability string `json:"capability"`
AttachmentID string `json:"attachment_id"`
Kind AttachmentKind `json:"kind"`
Name string `json:"name,omitempty"`
MIMEType string `json:"mime_type"`
SHA256 string `json:"sha256"`
Bytes int `json:"bytes"`
Source string `json:"source"`
Scope string `json:"scope"`
SourceRevision uint64 `json:"source_revision"`
CapturedNS uint64 `json:"captured_ns,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
AttachmentHandle is immutable, bounded metadata plus the opaque capability needed to resolve or release one retained item. Payload-free runtime tracing never records Capability. Callers must still treat it as a secret.
func (AttachmentHandle) MediaRef ¶
func (handle AttachmentHandle) MediaRef() trajectory.MediaRef
MediaRef is the deliberately capability-free trajectory representation. Resolution capability remains on a separately routed AttachmentHandle.
type AttachmentKind ¶
type AttachmentKind string
AttachmentKind is carried in addition to MIME type so policy can distinguish an image shown by a participant from a file or an opaque future attachment.
const ( AttachmentImage AttachmentKind = "image" AttachmentFile AttachmentKind = "file" AttachmentOther AttachmentKind = "attachment" )
type BlobLease ¶
type BlobLease struct {
LeaseID string `json:"lease_id"`
Handle AttachmentHandle `json:"handle"`
// contains filtered or unexported fields
}
BlobLease is an opaque, read-only view of one retained blob. The backing bytes are unexported and copied exactly once when retention crosses its trust boundary. Open returns a reader that copies only into caller-owned read buffers and observes revocation between reads. The consumer must route a ReturnLeaseRequest after it finishes; eviction and handle release stop new fetches but cannot invalidate an already delivered lease silently.
type FetchRequest ¶
type FetchRequest struct {
Handle AttachmentHandle `json:"handle"`
ExpectedSHA256 string `json:"expected_sha256,omitempty"`
ExpectedSourceRevision uint64 `json:"expected_source_revision,omitempty"`
}
type FetchResult ¶
type FetchResult struct {
Kind ResultKind `json:"kind"`
Handle AttachmentHandle `json:"handle,omitempty"`
Lease BlobLease `json:"lease,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
type ReleaseRequest ¶
type ReleaseResult ¶
type ReleaseResult struct {
Kind ResultKind `json:"kind"`
Handle string `json:"handle,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
type ResolveAttachmentConfig ¶
type ResolveAttachmentConfig struct {
MaxPending int `json:"max_pending,omitempty"`
MaxBytes int `json:"max_bytes,omitempty"`
MaxMetadataBytes int `json:"max_metadata_bytes,omitempty"`
AllowedMIMETypes []string `json:"allowed_mime_types,omitempty"`
TerminalMemory int `json:"terminal_memory,omitempty"`
}
type ResolveRequest ¶
type ResolveRequest struct {
Handle AttachmentHandle `json:"handle"`
AcceptMIMETypes []string `json:"accept_mime_types,omitempty"`
MaxBytes int `json:"max_bytes,omitempty"`
ExpectedSourceRevision uint64 `json:"expected_source_revision,omitempty"`
}
type ResolvedAttachment ¶
type ResolvedAttachment struct {
Kind ResultKind `json:"kind"`
Handle AttachmentHandle `json:"handle,omitempty"`
Lease BlobLease `json:"lease,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
ResolvedAttachment stays a media.UntrustedContent reply. A parser or vision element must explicitly turn it into an observer-authority observation; it cannot type-connect to user/system text or executable actions.
type ResolverOutcome ¶
type ResolverOutcome struct {
Kind ResultKind `json:"kind"`
RequestID string `json:"request_id,omitempty"`
Handle string `json:"handle,omitempty"`
Bytes int `json:"bytes,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
FinishedNS uint64 `json:"finished_ns,omitempty"`
}
type ResultKind ¶
type ResultKind string
const ( ResultSucceeded ResultKind = "succeeded" ResultCanceled ResultKind = "canceled" ResultRefused ResultKind = "refused" ResultFailed ResultKind = "failed" ResultExpired ResultKind = "expired" ResultIgnored ResultKind = "ignored" )
type RetainRequest ¶
type RetainRequest struct {
AttachmentID string `json:"attachment_id"`
Kind AttachmentKind `json:"kind"`
Name string `json:"name,omitempty"`
MIMEType string `json:"mime_type"`
Content []byte `json:"-"`
SHA256 string `json:"sha256,omitempty"`
Source string `json:"source"`
Scope string `json:"scope"`
SourceRevision uint64 `json:"source_revision"`
CapturedNS uint64 `json:"captured_ns,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
RetainRequest is the only payload that introduces raw attachment bytes into the retained-media state. SourceRevision binds the bytes to the observation revision that caused retention; Scope prevents a handle from crossing a deployment-selected retention boundary.
type RetainResult ¶
type RetainResult struct {
Kind ResultKind `json:"kind"`
Handle AttachmentHandle `json:"handle,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
type RetainedMediaConfig ¶
type RetainedMediaConfig struct {
Scope string `json:"scope,omitempty"`
MaxItems int `json:"max_items,omitempty"`
MaxBytes int `json:"max_bytes,omitempty"`
MaxItemBytes int `json:"max_item_bytes,omitempty"`
MaxMetadataBytes int `json:"max_metadata_bytes,omitempty"`
MaxActiveLeases int `json:"max_active_leases,omitempty"`
WindowMS int64 `json:"window_ms,omitempty"`
TerminalMemory int `json:"terminal_memory,omitempty"`
CancelMemory int `json:"cancel_memory,omitempty"`
}
type RetentionMetrics ¶
type RetentionMetrics struct {
Retained uint64 `json:"retained"`
Resolved uint64 `json:"resolved"`
Released uint64 `json:"released"`
Evicted uint64 `json:"evicted"`
Misses uint64 `json:"misses"`
Leases uint64 `json:"leases"`
Returned uint64 `json:"returned_leases"`
Revoked uint64 `json:"revoked_leases"`
ActiveLeases int `json:"active_leases"`
LeasedBytes int `json:"leased_bytes"`
MaxActiveLeases int `json:"max_active_leases"`
LiveItems int `json:"live_items"`
LiveBytes int `json:"live_bytes"`
MaxItems int `json:"max_items"`
MaxBytes int `json:"max_bytes"`
WindowMS int64 `json:"window_ms"`
}
type RetentionOutcome ¶
type RetentionOutcome struct {
Kind ResultKind `json:"kind"`
Operation string `json:"operation"`
RequestID string `json:"request_id,omitempty"`
Handle string `json:"handle,omitempty"`
Crossed bool `json:"crossed_boundary,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
FinishedNS uint64 `json:"finished_ns,omitempty"`
}
type ReturnLeaseRequest ¶
type ReturnLeaseRequest struct {
Lease BlobLease `json:"lease"`
Reason string `json:"reason,omitempty"`
}
ReturnLeaseRequest explicitly ends one delivered read lease.
type ReturnLeaseResult ¶
type ReturnLeaseResult struct {
Kind ResultKind `json:"kind"`
LeaseID string `json:"lease_id,omitempty"`
Handle string `json:"handle,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}