Documentation
¶
Index ¶
- Constants
- func AdmissibleCurrentPaths(values, trackedPaths []string) ([]string, error)
- func AdmissionFailureReason(err error) string
- func CandidateRevisions(root string) ([]string, error)
- func CandidateRevisionsForAppend(root string) ([]string, error)
- func Encode(record Record) ([]byte, error)
- func IsDrift(err error) bool
- func RecoverInterruptedAppend(root string, checkStable func() error, validateBeforeMutation func() error) (resultErr error)
- func StorePath(root, revision string) string
- func TransformLegacy(data []byte, treeRevision, commitRevision string, trackedPaths []string) ([]byte, error)
- func VerificationFailureReason(err error) string
- type Input
- type MigrationAuthority
- type MigrationEntry
- type MigrationPlan
- type MigrationResult
- type Record
- type Revision
- type Store
Constants ¶
const ( SchemaVersion = 1 MaxTraces = 1_000 MaxTraceFiles = 1_000 MaxTraceRowBytes = 256 * 1_024 MaxTraceStoreBytes = 16 * 1_024 * 1_024 MaxTracePaths = 200 MaxAdmissionCandidates = 200_000 MaxVerificationCommands = 50 MaxCommandCharacters = 512 MaxTaskCharacters = 2_000 )
const ( StateAbsent = "absent" StateReady = "ready" )
Variables ¶
This section is empty.
Functions ¶
func AdmissibleCurrentPaths ¶
AdmissibleCurrentPaths classifies a bounded complete changed-path set through the same per-path admission primitive NewRecord uses. Malformed input fails; valid paths outside the exact tracked source set are filtered.
func AdmissionFailureReason ¶
AdmissionFailureReason returns the bounded reason for an exact changed-path admission failure. It is empty for errors outside that classifier.
func CandidateRevisions ¶
CandidateRevisions returns the bounded, pinned revision filenames currently in the store.
func CandidateRevisionsForAppend ¶
CandidateRevisionsForAppend permits only the single persistent operation-lock overage that an interrupted exact-cap append can leave after recovery.
func IsDrift ¶
IsDrift reports a candidate-set, file-byte, pathname, or directory-binding change observed while a pinned trace read was in flight.
func RecoverInterruptedAppend ¶
func RecoverInterruptedAppend(root string, checkStable func() error, validateBeforeMutation func() error) (resultErr error)
RecoverInterruptedAppend resolves retention residue for the explicit record path before strict candidate discovery. Read paths never call it. Validation runs only when recovery would mutate the trace store.
func TransformLegacy ¶
func TransformLegacy(data []byte, treeRevision, commitRevision string, trackedPaths []string) ([]byte, error)
TransformLegacy rewrites validated tree-named rows to a commit revision.
func VerificationFailureReason ¶
VerificationFailureReason returns the bounded reason for an exact verification-command failure. It is empty for other errors.
Types ¶
type Input ¶
type Input struct {
Revision string
TreeRevision string
Task string
OpenedPaths []string
ChangedPaths []string
Verification []string
Outcome string
}
Input contains the caller-controlled fields of a new trace record.
type MigrationAuthority ¶
type MigrationAuthority struct {
CommitRevision string
TreeRevision string
ObjectFormat string
DirtyPaths []string
ProfileID string
Commits map[string]Revision
Trees map[string][]string
TrackedPaths func(string) ([]string, error)
}
MigrationAuthority is the immutable repository evidence used to classify trace files.
type MigrationEntry ¶
type MigrationEntry struct {
TreeRevision string `json:"tree_revision"`
CommitRevision string `json:"commit_revision"`
SourceSHA256 string `json:"source_sha256"`
TargetSHA256 string `json:"target_sha256"`
RowCount int `json:"row_count"`
// contains filtered or unexported fields
}
MigrationEntry is one legacy tree file and its canonical commit replacement.
type MigrationPlan ¶
type MigrationPlan struct {
Authority MigrationAuthority
Digest string
Entries []MigrationEntry
Candidates []migrationCandidate
}
MigrationPlan is a fully validated, byte-bound trace migration plan.
func ApplyMigration ¶
func ApplyMigration(root string, authority MigrationAuthority, digest string, checkStable func() error) (MigrationPlan, error)
ApplyMigration validates the digest before mutation, locks, replans, and publishes verified files.
func PlanMigration ¶
func PlanMigration(root string, authority MigrationAuthority, checkStable func() error) (MigrationPlan, error)
PlanMigration validates the entire trace store without writing it.
func (MigrationPlan) Result ¶
func (plan MigrationPlan) Result(apply bool) MigrationResult
Result converts a plan to the public command result.
type MigrationResult ¶
type MigrationResult struct {
Mutates bool
Mode string
PlanDigest string
CommitRevision string
TreeRevision string
CandidateTraceFiles int
LegacyTraceFiles int
TraceRows int
Entries []MigrationEntry
}
MigrationResult is the Python-compatible public command result.
type Record ¶
type Record struct {
SchemaVersion int
Revision string
TraceID string
Task string
OpenedPaths []string
ChangedPaths []string
Verification []string
Outcome string
}
Record is the schema-version 1 JSONL record shared with the Python runtime. Slices are always normalized to non-nil values by constructors and decoders.
func DecodeStore ¶
DecodeStore validates one revision file and preserves its row order.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store owns bounded, stable reads and appends beneath .context-corvint/traces. checkStable must revalidate the caller's clean commit/tree snapshot.