Documentation
¶
Index ¶
- func AppendSessionEvent(path string, opts SessionAppendOptions) (schemarunpack.SessionEvent, error)
- func ContainsSessionChainPath(path string) bool
- func EncodeReduceReport(report ReduceReport) ([]byte, error)
- func ReadSessionChain(path string) (schemarunpack.SessionChain, error)
- func ReadSessionJournal(path string) (schemarunpack.SessionJournal, error)
- func ResolveSessionCheckpointRunpack(chainPath string, checkpointRef string) (schemarunpack.SessionCheckpoint, error)
- func WriteSessionChain(path string, chain schemarunpack.SessionChain) error
- type DiffPrivacy
- type DiffResult
- type DiffSummary
- type DigestNormalizationOptions
- type HashMismatch
- type RealReplayOptions
- type RecordOptions
- type RecordResult
- type ReduceOptions
- type ReducePredicate
- type ReduceReport
- type ReduceResult
- type ReplayMode
- type ReplayResult
- type ReplayStep
- type Runpack
- type SessionAppendOptions
- type SessionChainDiffSummary
- type SessionChainVerifyOptions
- type SessionChainVerifyResult
- type SessionCheckpointOptions
- type SessionCheckpointResult
- type SessionCompactionOptions
- type SessionCompactionResult
- type SessionLockContentionError
- type SessionStartOptions
- type SessionStatus
- type VerifyOptions
- type VerifyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSessionEvent ¶
func AppendSessionEvent(path string, opts SessionAppendOptions) (schemarunpack.SessionEvent, error)
AppendSessionEvent appends one deterministic event entry to the journal.
func EncodeReduceReport ¶
func EncodeReduceReport(report ReduceReport) ([]byte, error)
func ReadSessionChain ¶
func ReadSessionChain(path string) (schemarunpack.SessionChain, error)
func ReadSessionJournal ¶
func ReadSessionJournal(path string) (schemarunpack.SessionJournal, error)
func ResolveSessionCheckpointRunpack ¶
func ResolveSessionCheckpointRunpack(chainPath string, checkpointRef string) (schemarunpack.SessionCheckpoint, error)
func WriteSessionChain ¶
func WriteSessionChain(path string, chain schemarunpack.SessionChain) error
Types ¶
type DiffPrivacy ¶
type DiffPrivacy string
const ( DiffPrivacyFull DiffPrivacy = "full" DiffPrivacyMetadata DiffPrivacy = "metadata" )
type DiffResult ¶
type DiffResult struct {
Privacy DiffPrivacy `json:"privacy"`
Summary DiffSummary `json:"summary"`
}
func CompareRunpackOrSessionChain ¶
func CompareRunpackOrSessionChain(leftPath string, rightPath string, privacy DiffPrivacy) (DiffResult, error)
func DiffRunpacks ¶
func DiffRunpacks(leftPath, rightPath string, privacy DiffPrivacy) (DiffResult, error)
type DiffSummary ¶
type DiffSummary struct {
RunIDLeft string `json:"run_id_left"`
RunIDRight string `json:"run_id_right"`
ManifestChanged bool `json:"manifest_changed"`
FilesChanged []string `json:"files_changed,omitempty"`
IntentsChanged bool `json:"intents_changed"`
ResultsChanged bool `json:"results_changed"`
RefsChanged bool `json:"refs_changed"`
LeftOnlyIntents []string `json:"left_only_intents,omitempty"`
RightOnlyIntents []string `json:"right_only_intents,omitempty"`
LeftOnlyResults []string `json:"left_only_results,omitempty"`
RightOnlyResults []string `json:"right_only_results,omitempty"`
ContextDriftClassification string `json:"context_drift_classification,omitempty"`
ContextRuntimeOnlyChanges bool `json:"context_runtime_only_changes,omitempty"`
}
type DigestNormalizationOptions ¶ added in v1.3.6
type DigestNormalizationOptions struct {
IntentArgs map[string]json.RawMessage
ResultPayloads map[string]json.RawMessage
}
type HashMismatch ¶
type RealReplayOptions ¶
type RealReplayOptions struct {
AllowTools []string
}
type RecordOptions ¶
type RecordOptions struct {
Run schemarunpack.Run
Intents []schemarunpack.IntentRecord
Results []schemarunpack.ResultRecord
Refs schemarunpack.Refs
CaptureMode string
SignKey ed25519.PrivateKey
Normalization DigestNormalizationOptions
}
type RecordResult ¶
type RecordResult struct {
RunID string
Manifest schemarunpack.Manifest
ZipBytes []byte
}
func RecordRun ¶
func RecordRun(options RecordOptions) (RecordResult, error)
func WriteRunpack ¶
func WriteRunpack(path string, options RecordOptions) (RecordResult, error)
type ReduceOptions ¶
type ReduceOptions struct {
InputPath string
OutputPath string
Predicate ReducePredicate
}
type ReducePredicate ¶
type ReducePredicate string
const ( PredicateMissingResult ReducePredicate = "missing_result" PredicateNonOKStatus ReducePredicate = "non_ok_status" )
func ParseReducePredicate ¶
func ParseReducePredicate(value string) (ReducePredicate, error)
type ReduceReport ¶
type ReduceReport struct {
SchemaID string `json:"schema_id"`
SchemaVersion string `json:"schema_version"`
CreatedAt time.Time `json:"created_at"`
ProducerVersion string `json:"producer_version"`
RunID string `json:"run_id"`
ReducedRunID string `json:"reduced_run_id"`
Predicate ReducePredicate `json:"predicate"`
SelectedIntentID string `json:"selected_intent_id"`
OriginalIntentCount int `json:"original_intent_count"`
ReducedIntentCount int `json:"reduced_intent_count"`
OriginalResultCount int `json:"original_result_count"`
ReducedResultCount int `json:"reduced_result_count"`
OriginalRefCount int `json:"original_ref_count"`
ReducedRefCount int `json:"reduced_ref_count"`
StillFailing bool `json:"still_failing"`
}
type ReduceResult ¶
type ReduceResult struct {
OutputPath string
RunID string
ReducedRunID string
Report ReduceReport
}
func ReduceToMinimal ¶
func ReduceToMinimal(options ReduceOptions) (ReduceResult, error)
type ReplayMode ¶
type ReplayMode string
const ( ReplayModeStub ReplayMode = "stub" ReplayModeReal ReplayMode = "real" )
type ReplayResult ¶
type ReplayResult struct {
RunID string `json:"run_id"`
Mode ReplayMode `json:"mode"`
Steps []ReplayStep `json:"steps"`
MissingResults []string `json:"missing_results,omitempty"`
}
func ReplayReal ¶
func ReplayReal(path string, options RealReplayOptions) (ReplayResult, error)
func ReplayStub ¶
func ReplayStub(path string) (ReplayResult, error)
type ReplayStep ¶
type Runpack ¶
type Runpack struct {
Manifest schemarunpack.Manifest
Run schemarunpack.Run
Intents []schemarunpack.IntentRecord
Results []schemarunpack.ResultRecord
Refs schemarunpack.Refs
}
func ReadRunpack ¶
type SessionAppendOptions ¶
type SessionAppendOptions struct {
CreatedAt time.Time
ProducerVersion string
IntentID string
ToolName string
IntentDigest string
PolicyDigest string
PolicyID string
PolicyVersion string
MatchedRuleIDs []string
TraceID string
TracePath string
AgentChain []schemacommon.AgentLink
ActorIdentity string
Verdict string
ReasonCodes []string
Violations []string
SafetyInvariantVersion string
SafetyInvariantHash string
}
type SessionChainDiffSummary ¶
type SessionChainDiffSummary struct {
SessionIDLeft string `json:"session_id_left"`
SessionIDRight string `json:"session_id_right"`
CheckpointCountL int `json:"checkpoint_count_left"`
CheckpointCountR int `json:"checkpoint_count_right"`
ChangedIndexes []int `json:"changed_indexes,omitempty"`
LeftOnlyIndexes []int `json:"left_only_indexes,omitempty"`
RightOnlyIndexes []int `json:"right_only_indexes,omitempty"`
ChangedCheckpoints bool `json:"changed_checkpoints"`
}
func DiffSessionChains ¶
func DiffSessionChains(left, right schemarunpack.SessionChain) SessionChainDiffSummary
type SessionChainVerifyResult ¶
type SessionChainVerifyResult struct {
SessionID string `json:"session_id"`
RunID string `json:"run_id"`
CheckpointsChecked int `json:"checkpoints_checked"`
LinkageErrors []string `json:"linkage_errors,omitempty"`
CheckpointErrors []string `json:"checkpoint_errors,omitempty"`
}
func VerifySessionChain ¶
func VerifySessionChain(path string, opts SessionChainVerifyOptions) (SessionChainVerifyResult, error)
type SessionCheckpointOptions ¶
type SessionCheckpointOptions struct {
Now time.Time
ProducerVersion string
SignKey ed25519.PrivateKey
}
type SessionCheckpointResult ¶
type SessionCheckpointResult struct {
Checkpoint schemarunpack.SessionCheckpoint `json:"checkpoint"`
Chain schemarunpack.SessionChain `json:"chain"`
}
func EmitSessionCheckpoint ¶
func EmitSessionCheckpoint(journalPath string, outRunpackPath string, opts SessionCheckpointOptions) (SessionCheckpointResult, error)
func SessionCheckpointAndWriteChain ¶
func SessionCheckpointAndWriteChain(journalPath string, runpackOut string, opts SessionCheckpointOptions) (SessionCheckpointResult, string, error)
type SessionCompactionResult ¶
type SessionCompactionResult struct {
JournalPath string `json:"journal_path"`
OutputPath string `json:"output_path"`
DryRun bool `json:"dry_run"`
Compacted bool `json:"compacted"`
EventsBefore int `json:"events_before"`
EventsAfter int `json:"events_after"`
Checkpoints int `json:"checkpoints"`
LastCheckpointSequence int64 `json:"last_checkpoint_sequence"`
BytesBefore int64 `json:"bytes_before"`
BytesAfter int64 `json:"bytes_after"`
}
func CompactSessionJournal ¶
func CompactSessionJournal(path string, opts SessionCompactionOptions) (SessionCompactionResult, error)
type SessionLockContentionError ¶
type SessionLockContentionError struct {
LockPath string
Waited time.Duration
Attempts int
Timeout time.Duration
Retry time.Duration
Profile string
}
func (SessionLockContentionError) Error ¶
func (err SessionLockContentionError) Error() string
type SessionStartOptions ¶
type SessionStatus ¶
type SessionStatus struct {
SessionID string `json:"session_id"`
RunID string `json:"run_id"`
CreatedAt time.Time `json:"created_at"`
StartedAt time.Time `json:"started_at"`
EventCount int `json:"event_count"`
CheckpointCount int `json:"checkpoint_count"`
LastSequence int64 `json:"last_sequence"`
}
func GetSessionStatus ¶
func GetSessionStatus(path string) (SessionStatus, error)
func StartSession ¶
func StartSession(path string, opts SessionStartOptions) (SessionStatus, error)
StartSession creates a new append-only session journal or returns the existing session status.
type VerifyOptions ¶
type VerifyResult ¶
type VerifyResult struct {
RunID string `json:"run_id,omitempty"`
ManifestDigest string `json:"manifest_digest,omitempty"`
FilesChecked int `json:"files_checked"`
MissingFiles []string `json:"missing_files,omitempty"`
HashMismatches []HashMismatch `json:"hash_mismatches,omitempty"`
SignatureStatus string `json:"signature_status"`
SignatureErrors []string `json:"signature_errors,omitempty"`
SignaturesTotal int `json:"signatures_total"`
SignaturesValid int `json:"signatures_valid"`
}
func VerifyZip ¶
func VerifyZip(path string, opts VerifyOptions) (VerifyResult, error)
Click to show internal directories.
Click to hide internal directories.