tracerecordrepo

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Overview

Package tracerecordrepo binds trace recording to stable Git repository authority.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DogfoodFailureReason

func DogfoodFailureReason(err error) string

DogfoodFailureReason returns the bounded coordination reason retained by the hidden dogfood producer. It is empty for errors outside that transaction.

func Read

func Read(ctx context.Context, root string, index *contextindex.Index) ([]trace.Record, string, error)

Read returns the pinned local traces without creating or changing trace state.

func ReadObserved

func ReadObserved(ctx context.Context, root string, index *contextindex.Index, opening contextindex.Observation) ([]trace.Record, string, error)

ReadObserved is Read checking stability against the observation the index was loaded under instead of spawning the pair before and after its files. The opening comparison is the concurrent path's first check verbatim; the closing one is deferred to the query's shared bracket (contextindex.EvalQueryShared), which closes the same window once.

func TruncatedAncestryOf

func TruncatedAncestryOf(err error) (int, bool)

TruncatedAncestryOf returns the number of ancestry rows omitted from the bounded Git result attached to a failed read. It also reaches through a *contextindex.Error that a downstream mapper rebuilt from this package's error (via its Cause field), so the count survives that flattening without parsing it back out of formatted error text.

Types

type DogfoodResult

type DogfoodResult struct {
	Base, Target, Tree              string
	CandidateSHA256, AdmittedSHA256 string
	Candidates, Admitted            []string
	State                           string
	Recorded                        *Result
}

DogfoodResult binds the complete Git change set to the exact subset supplied to the shared record producer.

func RecordDogfood

func RecordDogfood(ctx context.Context, root, baseArg, targetArg string, input Input) (DogfoodResult, error)

RecordDogfood classifies and records one base-to-target change under a single pinned authority. It returns no-source-paths without opening the trace store.

type Input

type Input struct {
	Task         string
	OpenedPaths  []string
	ChangedPaths []string
	Verification []string
	Outcome      string
}

Input is the public record command payload after argument parsing.

type ReadFailure

type ReadFailure string

ReadFailure classifies a failed trace read without changing its diagnostic bytes. The query adapter maps these categories to its stable refusal codes.

const (
	ReadFailureTraceState   ReadFailure = "trace-state"
	ReadFailureReplayWindow ReadFailure = "replay-window"
	ReadFailureDrift        ReadFailure = "drift"
	ReadFailureHistory      ReadFailure = "history"
	ReadFailureRepository   ReadFailure = "repository"
)

func ReadFailureOf

func ReadFailureOf(err error) (ReadFailure, bool)

ReadFailureOf returns the stable failure category attached by Read.

type Result

type Result struct {
	Record            trace.Record
	Store             string
	TruncatedAncestry int
}

Result is the canonical trace, its resolved store path, and the number of ancestry rows the bounded replay probe truncated while binding revisions. A non-zero count discloses that candidate revisions beyond the window were not examined; it is derived disclosure, never an input to admission.

func Record

func Record(ctx context.Context, root string, input Input) (Result, error)

Record validates against frozen repository authority and atomically records one trace.

Jump to

Keyboard shortcuts

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