Documentation
¶
Overview ¶
Package nativetask contains engine-free internal draft protocol primitives. It does not resolve or execute task sources, register a public profile, or certify the authenticity, accounting, runtime or assurance of supplied data.
Index ¶
- Constants
- func CollectionRequestDigest(req *execution.ExecutionRequest) (models.EvidenceDigest, error)
- func MatchCollectionSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, ...) error
- func MatchSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, ...) error
- func MatchVerifiedCollectionSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, ...) error
- type Accounting
- type Admission
- type Admitted
- type ArmPlan
- type Capabilities
- type CapturedSource
- type Diagnostic
- type Event
- type EventModels
- type Lifecycle
- type Message
- type Output
- type Phase
- type Prefix
- func InspectCollectionPrefix(ctx context.Context, events, payload []byte, admissions []*Admitted) (*Prefix, error)
- func InspectPrefix(ctx context.Context, events, payload []byte, admissions []*Admitted) (*Prefix, error)
- func ReadPrefix(ctx context.Context, root *os.Root, admissions []*Admitted) (*Prefix, error)
- type Prepared
- func Prepare(ctx context.Context, arm releasepolicy.Arm, taskID string, ...) (*Prepared, error)
- func PrepareCaptured(ctx context.Context, arm releasepolicy.Arm, taskID string, ...) (*Prepared, error)
- func PrepareVerifiedCaptured(ctx context.Context, arm releasepolicy.Arm, taskID string, ...) (*Prepared, error)
- type Profile
- type Record
- type RequestPlan
- type Response
- type Selection
- type Source
- type Tape
- type VerifiedCollectionSources
Constants ¶
const ( CollectionExecutableBytes = controlledprojection.CollectionExecutableBytes CollectionSourceBytes = controlledprojection.CollectionSourceBytes )
const (
CollectionStreamBytes = 16 << 20
)
Variables ¶
This section is empty.
Functions ¶
func CollectionRequestDigest ¶
func CollectionRequestDigest(req *execution.ExecutionRequest) (models.EvidenceDigest, error)
func MatchCollectionSnapshot ¶
func MatchCollectionSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, req *execution.ExecutionRequest, sources []CapturedSource) error
MatchCollectionSnapshot admits the separately selected 2.0 collection inventory budget, including the retained evaluator executable.
func MatchSnapshot ¶
func MatchSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, req *execution.ExecutionRequest, sources []CapturedSource) error
MatchSnapshot only compares retained inputs. It performs no source reads, preparation, admission, execution, policy allocation or producer acceptance.
func MatchVerifiedCollectionSnapshot ¶
func MatchVerifiedCollectionSnapshot(ctx context.Context, admitted *Admitted, expectedKey releasepolicy.AttemptKey, req *execution.ExecutionRequest, verified VerifiedCollectionSources) error
MatchVerifiedCollectionSnapshot compares a previously verified immutable descriptor inventory. Its CollectionCapture caller still rechecks current rooted source bytes before every attempted execution.
Types ¶
type Accounting ¶
type Accounting struct {
SessionKey *models.EvidenceDigest `json:"session_key"`
Source string `json:"source"`
Complete bool `json:"complete"`
ModelAttributionComplete bool `json:"model_attribution_complete"`
Models []string `json:"models"`
Usage *models.UsageStats `json:"usage"`
ProviderCurrencyState string `json:"provider_currency_state"`
Reason string `json:"reason,omitempty"`
}
type Admission ¶
type Admission struct {
CollectionID string `json:"collection_id"`
PolicyDigest models.EvidenceDigest `json:"policy_digest"`
ProfileDigest models.EvidenceDigest `json:"profile_digest"`
PlanDigest models.EvidenceDigest `json:"resolved_plan_digest"`
RequestDigest models.EvidenceDigest `json:"request_digest"`
Key releasepolicy.AttemptKey `json:"key"`
}
type Admitted ¶
type Admitted struct {
// contains filtered or unexported fields
}
func Admit ¶
func Admit(ctx context.Context, p *Prepared, profile *Profile, key releasepolicy.AttemptKey) (*Admitted, error)
Admit checks internal linkage only, not current policy allocation or sources.
type ArmPlan ¶
type ArmPlan struct {
PlanDigest models.EvidenceDigest `json:"resolved_plan_digest"`
Requests []RequestPlan `json:"requests"`
}
type Capabilities ¶
type Capabilities struct {
FullToolTape, Session, RuntimeVersion, ProviderCurrency, Assurance string
}
Capabilities describe this draft reader, independently of legacy row defaults and received model-attribution completeness. None is a producer attestation.
type CapturedSource ¶
type CapturedSource struct {
Executable bool
Path string
Bytes string
Digest models.EvidenceDigest
}
CapturedSource carries immutable byte values, not roots or supplied seals. Bytes is a string solely to avoid shared mutable byte storage; it is not text. Values supplied directly to MatchSnapshot are not resolver authenticity.
type Diagnostic ¶
type Diagnostic struct {
Stage string `json:"stage"`
Code string `json:"code"`
SessionKey *models.EvidenceDigest `json:"session_key"`
}
Stage and Code are sanitized string projections, not imported native hooks.
type Event ¶
type Event struct {
Kind string `json:"kind"`
Version string `json:"version"`
Sequence int `json:"sequence"`
Type string `json:"type"`
Admission Admission `json:"admission"`
State string `json:"state,omitempty"`
RecordDigest *models.EvidenceDigest `json:"record_digest,omitempty"`
RowDigest *models.EvidenceDigest `json:"row_digest,omitempty"`
}
type EventModels ¶
type Prefix ¶
func InspectCollectionPrefix ¶
func InspectCollectionPrefix(ctx context.Context, events, payload []byte, admissions []*Admitted) (*Prefix, error)
InspectCollectionPrefix selects public 2.0 preparation and stream bounds. It does not widen InspectPrefix's private 1.0 admission limits.
func InspectPrefix ¶
func InspectPrefix(ctx context.Context, events, payload []byte, admissions []*Admitted) (*Prefix, error)
InspectPrefix validates supplied bytes without filesystem access. Nil inputs are unsupplied; nonnil empty inputs are supplied empty tapes. Callers must retain that presence distinction separately from Records and Pending. Torn/orphan data is invalid, and errors never return a partial prefix. This does not establish execution, persistence acknowledgement or authority.
type Prepared ¶
type Prepared struct {
// contains filtered or unexported fields
}
func Prepare ¶
func Prepare(ctx context.Context, arm releasepolicy.Arm, taskID string, req *execution.ExecutionRequest, sources []Source) (*Prepared, error)
Prepare freezes supplied resolved inputs, not their native source resolution. The future producer must independently verify declaration/request equivalence.
func PrepareCaptured ¶
func PrepareCaptured(ctx context.Context, arm releasepolicy.Arm, taskID string, req *execution.ExecutionRequest, sources []CapturedSource) (*Prepared, error)
PrepareCaptured binds a retained inventory's exact source digests without duplicating executable/source bytes per attempt. The collection capture owns those bytes; MatchCollectionSnapshot independently rechecks every one.
func PrepareVerifiedCaptured ¶
func PrepareVerifiedCaptured(ctx context.Context, arm releasepolicy.Arm, taskID string, req *execution.ExecutionRequest, verified VerifiedCollectionSources) (*Prepared, error)
PrepareVerifiedCaptured reuses a descriptor inventory admitted by VerifyCollectionSources. Its opaque source list cannot be changed by callers.
func (*Prepared) RequestDigest ¶
func (p *Prepared) RequestDigest() models.EvidenceDigest
type Profile ¶
type Profile struct {
Kind string `json:"kind"`
Version string `json:"version"`
Digest models.EvidenceDigest `json:"digest"`
Nonce string `json:"nonce"`
Selection Selection `json:"selection"`
PolicyDigest models.EvidenceDigest `json:"policy_digest"`
PermissionMode string `json:"permission_mode"`
Arms map[releasepolicy.Arm]ArmPlan `json:"arms"`
}
func DecodeProfile ¶
type Record ¶
type Record struct {
Kind string `json:"kind"`
Version string `json:"version"`
CollectionID string `json:"collection_id"`
PolicyDigest models.EvidenceDigest `json:"policy_digest"`
ProfileDigest models.EvidenceDigest `json:"profile_digest"`
PlanDigest models.EvidenceDigest `json:"resolved_plan_digest"`
RequestDigest models.EvidenceDigest `json:"request_digest"`
Key releasepolicy.AttemptKey `json:"key"`
Origin models.EvidenceOrigin `json:"origin"`
Lifecycle Lifecycle `json:"lifecycle"`
Response *Response `json:"response"`
Output Output `json:"output"`
Diagnostics []Diagnostic `json:"diagnostics"`
EventModels EventModels `json:"event_models"`
Accounting Accounting `json:"accounting"`
ActualRow releasepolicy.ActualRunRow `json:"actual_row"`
Summary releasepolicy.AttemptSummary `json:"summary"`
}
func DecodeRecord ¶
DecodeRecord validates supplied draft data; success is not producer admission. In particular, no observed runtime, review, billing or assurance is inferred.
func (*Record) Capabilities ¶
func (*Record) Capabilities() Capabilities
type RequestPlan ¶
type RequestPlan struct {
TaskID string `json:"task_id"`
RequestDigest models.EvidenceDigest `json:"request_digest"`
}
type Response ¶
type Response struct {
SessionKey *models.EvidenceDigest `json:"session_key"`
SessionReason string `json:"session_reason,omitempty"`
Success bool `json:"success"`
ErrorMsg string `json:"error_msg"`
FinalOutput string `json:"final_output"`
DurationMS int64 `json:"duration_ms"`
CanonicalEvents []json.RawMessage `json:"canonical_events"`
ToolPolicyMode string `json:"tool_policy_mode"`
ToolPolicyDenials []models.ToolPolicyDenial `json:"tool_policy_denials"`
UsageIsCumulative bool `json:"usage_is_cumulative"`
UsageRevision uint64 `json:"usage_revision"`
Usage *models.UsageStats `json:"usage"`
}
type Tape ¶
type Tape struct {
// contains filtered or unexported fields
}
Tape only acknowledges local payload/event persistence. It does not append a core terminal, publish a final ledger, or prove a producer executed anything.
func CreateCollectionTape ¶
CreateCollectionTape selects the public collection's bounded stream contract. Private tape creation retains its existing admission and persistence behavior.
func CreateTape ¶
type VerifiedCollectionSources ¶
type VerifiedCollectionSources struct {
// contains filtered or unexported fields
}
VerifiedCollectionSources is an immutable descriptor inventory whose byte identities were checked when it was constructed. It is intended for a CollectionCapture that separately rechecks its rooted sources before each attempt; callers with arbitrary inventories must use PrepareCaptured.
func VerifyCollectionSources ¶
func VerifyCollectionSources(ctx context.Context, sources []CapturedSource) (VerifiedCollectionSources, error)
VerifyCollectionSources validates and freezes an immutable descriptor inventory. It does not grant execution permission or replace currentness checks against the source root.