Documentation
¶
Overview ¶
Package changewitness is the experimental pure evaluator for the `ocm-change-witnessed-v0` relation (docs/specs/change-witness-relation-v0.md).
It decides, for one OCM obligation, whether a referenced hunk changes lines inside the unique Go definition its requirement span names. It reads no path, index, network, or worktree: every input is bytes the caller took from verified Git objects. No Frontier profile consumes it yet; `frontier/0` neither emits nor recognises the relation (CWR-V0-001).
Index ¶
Constants ¶
const ( Relation = "ocm-change-witnessed-v0" AuthorityClass = "VERIFIER_DERIVED" )
Relation is the CWR-V0-001 relation string; AuthorityClass is CWR-V0-003's.
const ( Witnessed = "witnessed" Withheld = "withheld" Abstained = "abstained" )
Outcomes (CWR-V0-015).
const ( ReasonNotLinked = "OBLIGATION_NOT_LINKED" SelfAuthoredObligation = "SELF_AUTHORED_OBLIGATION" ReasonSourceUnparsed = "RESOLVER_SOURCE_UNPARSED" ReasonNoNamedIdentifier = "NO_NAMED_IDENTIFIER" ReasonNoIntersection = "NO_MATERIAL_INTERSECTION" ReasonIneligibleHunk = "INELIGIBLE_WITNESS_HUNK" IdentifierUnresolved = "IDENTIFIER_UNRESOLVED" IdentifierAmbiguous = "IDENTIFIER_AMBIGUOUS" LanguageUnsupported = "RESOLVER_LANGUAGE_UNSUPPORTED" )
Reasons and diagnostic codes (CWR-V0-015). Only SelfAuthoredObligation is a Frontier reason; an abstained obligation keeps its frontier/0 reason.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
Diagnostic is a value-free count (CWR-V0-011).
type Hunk ¶
Hunk is one canonical CEM hunk. Changed holds its target-side changed line ranges; WhitespaceOnly marks a hunk the verifier reverified as whitespace-only or line-ending-only (CF-V0-008).
type Input ¶
type Input struct {
Disposition string // OCM obligation disposition
IntentPath string // OCM intent path
TargetSpan []byte // requirement span bytes at the target revision
BasePresent bool // intent path and obligation ID both exist at the expected base
BaseSpan []byte // requirement span bytes at the expected base
Sources []Source // every blob of the target tree; only `.go` paths are read
Hunks []Hunk // hunks the obligation structurally references
}
Input is one obligation's verified relation inputs.
type LineRange ¶
type LineRange struct{ Start, Count int }
LineRange is a 1-based start and a line count; a zero count is empty.
type Result ¶
type Result struct {
Outcome, Reason string
HunkIDs []string
Witnesses []Witness
Diagnostics []Diagnostic
}
Result is one evaluation. Witnesses is set only when Outcome is Witnessed; HunkIDs only when Withheld (CWR-V0-009 keeps the referenced hunk IDs).