lrf

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: 9 Imported by: 0

Documentation

Overview

Package lrf implements the frozen Lexical Relevance Floor V0 projection.

Index

Constants

View Source
const (
	Profile        = "lrf/0"
	AuthorityClass = "producer-declared"
	OCMSpec        = "ocm/0.1-experimental"
)

Variables

This section is empty.

Functions

func CanonicalBytes

func CanonicalBytes(result Result) []byte

CanonicalBytes returns sorted-key compact UTF-8 JSON with one terminal LF.

Types

type Context

type Context struct {
	CEMSpec          string
	CEMMapSHA256     string
	PatchSource      string
	BaseRevision     string
	TargetRevision   *string
	PatchSHA256      string
	ExcludedPath     *string
	OCMSpec          *string
	OCMMapSHA256     *string
	IntentPath       *string
	IntentBlobOID    *string
	IntentStart      *int64
	IntentEnd        *int64
	IntentSpanSHA256 *string
}

Context is the successful structural-verification envelope bound into every LRF result.

type Error

type Error struct {
	Code    string
	Message string
}

Error is a structural, compatibility, or operational failure for which no LRF result bytes may be emitted.

func (*Error) Error

func (e *Error) Error() string

type Evidence

type Evidence struct {
	ID   string
	Path string
	Span []byte
}

Evidence is a verified evidence identity paired with its exact pinned span.

type Hunk

type Hunk struct {
	ID          string
	OldPath     *string
	NewPath     *string
	Added       []byte
	Disposition string
	Basis       []wire.Basis
	Ordinal     int
}

Hunk is a verified patch hunk paired with its admitted added payload. Basis reuses the CEM wire relation type.

type IssueTuple

type IssueTuple [5]string

type Limits

type Limits struct {
	LexicalBytes  int
	Terms         int
	Edges         int
	Results       int
	Issues        int
	OutputBytes   int
	EvidenceBytes int
	EvidenceLines int
}

Limits are the frozen deterministic evaluation bounds. Values may be tightened by internal conformance callers but never raised above DefaultLimits.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns a fresh copy of the frozen profile maxima.

type Obligation

type Obligation struct {
	ID         string
	Statement  []byte
	HunkIDs    []string
	ClaimPaths []string
	Ordinal    int
}

Obligation is one verified linked OCM obligation projection.

type Request

type Request struct {
	Context     Context
	Hunks       []Hunk
	Evidence    []Evidence
	Obligations []Obligation
}

Request is an immutable post-structural projection; it performs no Git or network access.

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result is the complete canonical LRF result.

func Evaluate

func Evaluate(request Request) (Result, error)

Evaluate applies the frozen default profile bounds.

func EvaluateWithLimits

func EvaluateWithLimits(request Request, limits Limits) (Result, error)

EvaluateWithLimits is the internal conformance seam. Limits may only be tightened relative to the frozen defaults.

func (Result) BoundExceeded

func (r Result) BoundExceeded() bool

BoundExceeded reports whether this is the single-issue aggregate bound document.

func (Result) CanonicalBytes

func (r Result) CanonicalBytes() []byte

CanonicalBytes returns a copy of the sealed canonical document. A zero, caller-constructed Result has no issued bytes.

func (Result) ExitCode

func (r Result) ExitCode() int

func (Result) Inputs

func (r Result) Inputs() [14]any

Inputs returns the fixed 14-slot structural authority tuple.

func (Result) Issues

func (r Result) Issues() []IssueTuple

Issues returns a copy of the canonical issue tuples.

func (Result) Results

func (r Result) Results() []ResultTuple

Results returns a copy of the canonical result tuples.

type ResultTuple

type ResultTuple [6]string

Jump to

Keyboard shortcuts

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