Documentation
¶
Overview ¶
Package diagnostic is the refusal envelope of docs/specs/diagnostic-repair-contract-v0.md (DRC-V0): a refused subject, the facts measured while refusing, and the closed set of registry-owned repairs, carried beside an existing {code, message} error.
Index ¶
Constants ¶
const ( MaxValueBytes = 512 MaxEvidence = 16 // EmptySubject discloses a refused operand spelled as the empty string, since an emitted // subject value is never empty (DRC-V0-001). EmptySubject = "[empty]" )
MaxValueBytes and MaxEvidence are DRC-V0-008's per-value and per-diagnostic bounds.
Variables ¶
var Kinds = []string{"argument", "value", "artifact", "repository-state", "host-capability", "request"}
Kinds is DRC-V0-001's closed subject vocabulary; docs/specs/FIX-REGISTRY.tsv's kind rows and the clause text must equal it.
var TerminalReasons = []string{"missing-authority", "absent-evidence", "unsupported-platform", "owner-decision-required"}
TerminalReasons is DRC-V0-005's closed set of reasons no caller-side repair exists.
Functions ¶
func RepairStop ¶
RepairStop is DRC-V0-009's stop rule, published for an adapter that drives a repair loop; Corvint itself drives none (decision 0201 (h)). outstanding[0] is the count of outstanding diagnostics before any round and outstanding[i] the count after round i. The loop stops when nothing is outstanding, or when each of the last two rounds failed to reach a new minimum below every earlier count; whatever is still outstanding then is unresolved, not a partial success.
Types ¶
type Error ¶
Error carries a Refusal beside the error it annotates; errors.As still reaches the wrapped error, so a consumer keyed on its code is unchanged (DRC-V0-006).
type Refusal ¶
type Refusal struct {
Subject Subject `json:"subject"`
Evidence []Evidence `json:"evidence"`
SupportedFixes []string `json:"supported_fixes"`
Terminal string `json:"terminal,omitempty"`
}
Refusal is the additive diagnostic a covered site attaches to its refusal.
func (Refusal) Bounded ¶
Bounded is the emitted form of refusal (DRC-V0-008): every subject and evidence string is secret-screened, control characters are escaped visibly, and the result is cut to MaxValueBytes with the cut disclosed; evidence beyond MaxEvidence pairs keeps the first MaxEvidence-1 and discloses the dropped count in a final evidence-truncated pair.
func (Refusal) MarshalJSON ¶
MarshalJSON emits an absent evidence or fix list as an empty array, never null or omitted (DRC-V0-002, DRC-V0-005).