record

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactCaptureReport added in v0.9.0

type ArtifactCaptureReport struct {
	SchemaVersion    string             `json:"schema_version"`
	Status           string             `json:"status"`
	Method           string             `json:"method"`
	Candidates       *int               `json:"candidates"`
	Stored           int                `json:"stored"`
	Omitted          int                `json:"omitted"`
	Failed           int                `json:"failed"`
	StoredBytes      int64              `json:"stored_bytes"`
	ReadBytes        int64              `json:"read_bytes"`
	FileLimit        int                `json:"file_limit"`
	PerFileByteLimit int64              `json:"per_file_byte_limit"`
	TotalByteLimit   int64              `json:"total_byte_limit"`
	Reason           string             `json:"reason,omitempty"`
	Issues           []string           `json:"issues,omitempty"`
	Ref              string             `json:"ref,omitempty"`
	Files            []CapturedArtifact `json:"files,omitempty"`
}

ArtifactCaptureReport describes post-execution snapshots, not every version written during a run. Limits and omissions are evidence, not silent skips.

type CapturedArtifact added in v0.9.0

type CapturedArtifact struct {
	Path         string `json:"path"`
	SourceBytes  *int64 `json:"source_bytes"`
	ReadBytes    int64  `json:"read_bytes"`
	ContentState string `json:"content_state"`
	ContentRef   string `json:"content_ref,omitempty"`
	ContentBytes *int64 `json:"content_bytes"`
	SHA256       string `json:"sha256,omitempty"`
	Redacted     bool   `json:"redacted"`
	Reason       string `json:"reason,omitempty"`
	ReasonCode   string `json:"reason_code,omitempty"`
	CapturedAt   string `json:"captured_at"`
	Method       string `json:"capture_method"`
	Ref          string `json:"ref,omitempty"`
}

type ObservedProcess

type ObservedProcess struct {
	PID          int64  `json:"pid"`
	PPID         int64  `json:"ppid"`
	Command      string `json:"command"`
	FirstSeen    string `json:"first_seen"`
	LastSeen     string `json:"last_seen"`
	OutlivedRoot bool   `json:"outlived_root"`
}

type Request

type Request struct {
	RunID            string   `json:"run_id"`
	Name             string   `json:"name"`
	Workdir          string   `json:"workdir"`
	Command          []string `json:"command"`
	SampleIntervalMS int64    `json:"sample_interval_ms"`
	PostRootGraceMS  int64    `json:"post_root_grace_ms"`
	// DisableSnapshot skips the pre-exec base-directory copy and the post-exec
	// file diff. `record` keeps it off (file diff is core zero-SDK evidence), but
	// `launch` turns it on: wrapping an interactive agent in a real repo would
	// otherwise copy the entire working tree (node_modules, build output, ...) on
	// every run, dominating startup and disk. On Linux the kernel sensor's
	// file_write events already capture what changed at higher fidelity.
	DisableSnapshot bool      `json:"disable_snapshot"`
	Stdout          io.Writer `json:"-"`
	Stderr          io.Writer `json:"-"`
}

type Result

type Result struct {
	RunID            string                `json:"run_id"`
	RolloutID        string                `json:"rollout_id"`
	BaseSnapshotID   string                `json:"base_snapshot_id"`
	AttemptID        string                `json:"attempt_id"`
	SessionID        string                `json:"session_id"`
	ToolCallID       string                `json:"tool_call_id"`
	ProcessID        string                `json:"process_id"`
	Workdir          string                `json:"workdir"`
	Command          string                `json:"command"`
	ExitCode         int                   `json:"exit_code"`
	Status           string                `json:"status"`
	WallMS           int64                 `json:"wall_ms"`
	ChangedFiles     []string              `json:"changed_files"`
	RootPID          int64                 `json:"root_pid"`
	Observed         []ObservedProcess     `json:"observed"`
	OrphanPolicy     string                `json:"orphan_policy"`
	SampleIntervalMS int64                 `json:"sample_interval_ms"`
	PostRootGraceMS  int64                 `json:"post_root_grace_ms"`
	CWD              string                `json:"cwd"`
	StartedAt        string                `json:"started_at"`
	EndedAt          string                `json:"ended_at"`
	FailureReason    string                `json:"failure_reason"`
	ArtifactCapture  ArtifactCaptureReport `json:"artifact_capture"`
}

type Service

type Service struct {
	DB    *sql.DB
	Paths store.Paths
}

func (Service) Run

func (s Service) Run(req Request) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL