Help us shape the future of Go! Take the 2026 Go Developer Survey

model

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OutcomePass    = "pass"
	OutcomeFail    = "fail"
	OutcomeError   = "error"
	OutcomeUnknown = "unknown"
)
View Source
const StableIDPrefix = "0000000000"

StableIDPrefix is the time part of a StableID made with a zero time.

View Source
const Unattributed = "unattributed"

Variables

Functions

func NewID

func NewID() string

func StableID

func StableID(t time.Time, parts ...string) string

StableID is deterministic so re-ingesting a session keeps the IDs that LLM output and review state point to.

Types

type Actor

type Actor struct {
	ID            string
	SessionID     string
	Kind          string
	Name          string
	ParentActorID string
}

type Change

type Change struct {
	ID         string
	RepoID     string
	BaseRef    string
	TargetRef  string
	SessionIDs []string
	CreatedAt  time.Time
}

type ChangeType

type ChangeType string
const (
	ChangeBehavior   ChangeType = "behavior"
	ChangeRefactor   ChangeType = "refactor"
	ChangeTest       ChangeType = "test"
	ChangeConfig     ChangeType = "config"
	ChangeDependency ChangeType = "dependency"
	ChangeDocs       ChangeType = "docs"
	ChangeGenerated  ChangeType = "generated"
	ChangeUnknown    ChangeType = "unknown"
)

type Edit

type Edit struct {
	ID               string
	StepID           string
	FilePath         string
	OldPath          string
	BeforeBlob       string
	AfterBlob        string
	Patch            string
	Added            int
	Removed          int
	RevertedByEditID string
}

type Fidelity

type Fidelity string
const (
	FidelityLive     Fidelity = "live"
	FidelityImported Fidelity = "imported"
)

type Flag

type Flag struct {
	ID              string
	ChangeID        string
	SessionID       string
	RuleID          string
	Severity        Severity
	Detector        string
	TargetKind      string
	TargetID        string
	Line            int
	Message         string
	EvidenceStepIDs []string
	Suppressed      bool
	SuppressReason  string
	Fingerprint     string
}

type HookEvent

type HookEvent struct {
	SessionID string
	Key       string
	Seq       int
	Ts        time.Time
	Event     string
	Payload   string
	Snapshot  string
}

type Hunk

type Hunk struct {
	ID           string
	ChangeID     string
	FilePath     string
	OldStart     int
	OldLines     int
	NewStart     int
	NewLines     int
	Patch        string
	ChangeType   ChangeType
	ReviewUnitID string
	ContentHash  string
}

type HunkIntent

type HunkIntent struct {
	HunkID       string
	IntentItemID string
	Confidence   float64
}

type HunkProvenance

type HunkProvenance struct {
	HunkID string
	StepID string
	Lines  int
}

type IntentItem

type IntentItem struct {
	ID           string
	SessionID    string
	Source       string
	SourceStepID string
	Text         string
	Status       string
}

type QA

type QA struct {
	ID           string
	ChangeID     string
	Question     string
	Answer       string
	CitedStepIDs []string
	CitedHunkIDs []string
	Model        string
	CreatedAt    time.Time
}

type Rationale

type Rationale struct {
	HunkID          string
	AgentClaim      string
	ClaimStepID     string
	Explanation     string
	EvidenceStepIDs []string
	Verified        bool
	Model           string
	CreatedAt       time.Time
}

type Repo

type Repo struct {
	ID        string
	Path      string
	RemoteURL string
	CreatedAt time.Time
}

type ReviewUnit

type ReviewUnit struct {
	ID       string
	ChangeID string
	Title    string
	Ord      int
	Status   string
	Source   string
}

type Session

type Session struct {
	ID              string
	RepoID          string
	Agent           string
	AgentVersion    string
	AgentSessionID  string
	Models          []string
	Fidelity        Fidelity
	BaseCommit      string
	BaseSnapshot    string
	FinalSnapshot   string
	StartedAt       time.Time
	EndedAt         time.Time
	Cwd             string
	Title           string
	ParentSessionID string
	NoGit           bool
	InputTokens     int64
	OutputTokens    int64
	Status          string
}

type Severity

type Severity string
const (
	SevInfo   Severity = "info"
	SevLow    Severity = "low"
	SevMedium Severity = "medium"
	SevHigh   Severity = "high"
)

func (Severity) Rank

func (s Severity) Rank() int

type SnapshotMark

type SnapshotMark struct {
	Commit string
	StepID string
	Base   bool
}

type Step

type Step struct {
	ID           string
	SessionID    string
	ActorID      string
	ParentStepID string
	Seq          int
	TsStart      time.Time
	TsEnd        time.Time
	Kind         StepKind
	Text         string
	Snapshot     string
	Summary      string
}

type StepKind

type StepKind string
const (
	StepUserMessage      StepKind = "user_message"
	StepAssistantMessage StepKind = "assistant_message"
	StepReasoning        StepKind = "reasoning"
	StepPlan             StepKind = "plan"
	StepToolCall         StepKind = "tool_call"
	StepCompaction       StepKind = "compaction"
	StepHumanEdit        StepKind = "human_edit"
)

type TestRun

type TestRun struct {
	StepID    string
	Command   string
	Framework string
	Passed    int
	Failed    int
	Skipped   int
	Outcome   string
}

type ToolCall

type ToolCall struct {
	StepID     string
	ToolUseID  string
	ToolName   string
	Category   ToolCategory
	Input      string
	Output     string
	ExitCode   *int
	OK         bool
	DurationMS int64
}

type ToolCategory

type ToolCategory string
const (
	CatRead   ToolCategory = "read"
	CatSearch ToolCategory = "search"
	CatEdit   ToolCategory = "edit"
	CatShell  ToolCategory = "shell"
	CatTest   ToolCategory = "test"
	CatMCP    ToolCategory = "mcp"
	CatWeb    ToolCategory = "web"
	CatOther  ToolCategory = "other"
)

type Trace

type Trace struct {
	Session   Session
	Actors    []Actor
	Steps     []Step
	ToolCalls []ToolCall
	Snapshots []SnapshotMark
	Edits     []Edit
	Warnings  []string
}

Trace is the output of an agent adapter: one session in canonical form, before redaction and before edits are derived from the snapshots.

Jump to

Keyboard shortcuts

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