runartifact

package
v0.10.257 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package runartifact owns per-run artifact paths and run-kind markers shared by review lifecycle commands.

Index

Constants

View Source
const (

	// KindReview marks artifacts for a full review run.
	KindReview = "review"
	// KindThreadResponse marks artifacts for a response-only thread lifecycle run.
	KindThreadResponse = "thread_response"
)

Variables

View Source
var ErrMarkerInvalid = errors.New("runartifact: marker invalid")

ErrMarkerInvalid reports that an artifact marker is missing or malformed.

Functions

func MarkerMatches

func MarkerMatches(artifactPath, kind, runID string) bool

MarkerMatches reports whether an artifact root carries a valid marker for the expected run kind and run ID.

func MarkerPath

func MarkerPath(artifactPath, kind string) string

MarkerPath returns the marker path for an artifact root and run kind.

func WriteMarker

func WriteMarker(artifactPath, kind, runID string) error

WriteMarker persists the run-kind discriminator for an artifact root.

Types

type Marker

type Marker struct {
	SchemaVersion int    `json:"schema_version"`
	Kind          string `json:"kind"`
	RunID         string `json:"run_id"`
}

Marker identifies the lifecycle kind attached to one run artifact root.

func ReadMarker

func ReadMarker(artifactPath, kind string) (Marker, error)

ReadMarker reads and validates the marker for the requested run kind.

type Paths

type Paths struct {
	Dir              string `json:"dir"`
	DiffPatch        string `json:"diff_patch"`
	SlicesDir        string `json:"slices_dir"`
	FindingsJSON     string `json:"findings_json"`
	RollupMarkdown   string `json:"rollup_markdown"`
	AgentSourcesJSON string `json:"agent_sources_json"`
	AgentLogsDir     string `json:"agent_logs_dir"`
	LLMTasksDir      string `json:"llm_tasks_dir"`
	DossierDir       string `json:"dossier_dir"`
	WorkbenchDir     string `json:"workbench_dir"`
	WorkbenchRepoDir string `json:"workbench_repo_dir"`
	WorkbenchScratch string `json:"workbench_scratch_dir"`
}

Paths contains per-run artifact paths. The artifact root owns these fixed child names, so methods on this type return lifecycle-owned paths rather than arbitrary user input.

func ForRun

func ForRun(layout statepaths.Layout, ref gitprovider.PRRef, pr gitprovider.PR, profile, postingIdentity, runID string) (Paths, error)

ForRun returns the artifact paths for a generated run ID.

func FromDir

func FromDir(dir string) Paths

FromDir returns the artifact path set rooted at dir.

func (Paths) AgentLog

func (p Paths) AgentLog(agentID string) (string, error)

AgentLog returns the tailable LLM log path for an agent.

func (Paths) DossierFinalPath

func (p Paths) DossierFinalPath(name string) (string, error)

DossierFinalPath returns a reviewer-facing dossier artifact path by file name.

func (Paths) DossierIndexPath

func (p Paths) DossierIndexPath() string

DossierIndexPath returns the dossier index artifact path.

func (Paths) DossierRawPath

func (p Paths) DossierRawPath(name string) (string, error)

DossierRawPath returns a raw dossier artifact path by file name.

func (Paths) DossierSummaryPath

func (p Paths) DossierSummaryPath(name string) (string, error)

DossierSummaryPath returns a summary dossier artifact path by file name.

func (Paths) LLMTaskDir

func (p Paths) LLMTaskDir(taskID string) (string, error)

LLMTaskDir returns the artifact directory for one durable LLM task.

func (Paths) LLMTaskMetadata

func (p Paths) LLMTaskMetadata(taskID string) (string, error)

LLMTaskMetadata returns the metadata artifact path for one durable LLM task.

func (Paths) LLMTaskRawAttempt

func (p Paths) LLMTaskRawAttempt(taskID, attempt string) (string, error)

LLMTaskRawAttempt returns the raw structured output path for a failed attempt.

func (Paths) LLMTaskValidatedOutput

func (p Paths) LLMTaskValidatedOutput(taskID string) (string, error)

LLMTaskValidatedOutput returns the validated structured output path for one task.

func (Paths) SlicePatch

func (p Paths) SlicePatch(agentID, filePath string) (string, error)

SlicePatch returns the artifact path for an agent/file diff slice.

func (Paths) WorkbenchMetadataPath

func (p Paths) WorkbenchMetadataPath() string

WorkbenchMetadataPath returns the workbench metadata artifact path.

Jump to

Keyboard shortcuts

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