Documentation
¶
Overview ¶
Package observations keeps bounded, local-only self-observation proposals.
Index ¶
Constants ¶
const CodeProhibitedContent = "observation-prohibited-content"
CodeProhibitedContent identifies a SOL-V0-002 writer-contract refusal.
const KindAdapterDegradation = "adapter-degradation"
KindAdapterDegradation is SOL-V0-010's row kind: one host adapter degradation per host, event, code set and hour window.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
Append is deliberately fail-open. It only writes a bounded JSONL ledger below the repository worktree and never creates an index, trace, or agent-memory file.
func CorvintEntriesIgnored ¶
CorvintEntriesIgnored reports whether one ignore file, the root .gitignore or .corvint/.gitignore, ignores every named .corvint entry by its exact rule or by ignoring all of .corvint, and holds no negation. The unplanned-read ledger shares this conservative check (URE-V0-003).
Types ¶
type Digest ¶
type Digest struct {
Events int
Degradations map[string]int
Misses map[string]int
Unsupported map[string]int
ZeroResults int
BudgetOmit int
Latencies []int64
// Proofs counts `proof` rows; Verdicts sums their counts by falsifier
// then verdict.
Proofs int
Verdicts map[string]map[string]int
// Adapter counts retained `adapter-degradation` rows by host/event/code, and
// AdapterLatest keeps each key's newest hour window (SOL-V0-010).
Adapter map[string]int
AdapterLatest map[string]string
// SkippedRows counts ledger rows over maxRowBytes: self-observation-ledger-v0.md
// SOL-V0-005 (failure modes, "malformed ledger row") requires triage to skip
// an oversized row and keep reading bounded rows rather than abort.
SkippedRows int
}
func (Digest) Falsification ¶
func (digest Digest) Falsification() Falsification
Falsification reports the rate over every falsifier; the digest is meaningful only when Proofs is positive.
type Error ¶
Error is a writer-contract refusal. Error deliberately returns only a stable code: the rejected value may itself be task, source, or command text and must not be echoed into another diagnostic surface.
type Event ¶
type Event struct {
Kind string `json:"kind"`
Event string `json:"event,omitempty"`
ReceiptID string `json:"receiptId,omitempty"`
SessionID string `json:"sessionIdSha256,omitempty"`
TaskSHA256 string `json:"taskSha256,omitempty"`
Support string `json:"support,omitempty"`
Freshness string `json:"freshness,omitempty"`
Degradations []string `json:"degradations,omitempty"`
UncertaintyCount int `json:"uncertaintyCount,omitempty"`
OmittedCount int `json:"omittedCount,omitempty"`
CriticalMissing int `json:"criticalMissingCount,omitempty"`
Authoritative int `json:"authoritativeResultCount,omitempty"`
LatencyMS int64 `json:"latencyMs,omitempty"`
TouchedPaths []string `json:"touchedPaths,omitempty"`
RankedPaths []string `json:"rankedPaths,omitempty"`
MissState string `json:"missState,omitempty"`
Code string `json:"code,omitempty"`
QueryIntent string `json:"queryIntent,omitempty"`
Step string `json:"step,omitempty"`
Status string `json:"status,omitempty"`
Reason string `json:"reason,omitempty"`
// Counts is a `proof` row: the verdict counts of one `prove` document,
// keyed by falsifier then verdict, and nothing else about the document.
Counts map[string]map[string]int `json:"counts,omitempty"`
// Host, AdapterCodes, Window and CorvintVersion belong to an `adapter-degradation`
// row (SOL-V0-010) only.
Host string `json:"host,omitempty"`
AdapterCodes []string `json:"adapterCodes,omitempty"`
Window string `json:"window,omitempty"`
CorvintVersion string `json:"corvintVersion,omitempty"`
}
func AdapterDegradationEvent ¶
AdapterDegradationEvent is the SOL-V0-010 row for one adapter degradation reason. A `corvint-event-rejected:<code>` reason whose code no closed registry names keeps only its `corvint-event-rejected` prefix; any other unadmitted reason is refused by Append.
type Falsification ¶
type Falsification struct {
Proofs int `json:"proofs"`
Judged int `json:"judged"`
Failed int `json:"failed"`
Rate string `json:"rate"`
}
Falsification is the share of judged rows (PASS or FAIL; NOT_RUN and `none` rows are not judgments) whose claim was falsified, over every `proof` row the ledger retains.