Documentation
¶
Overview ¶
Package artifact persists base indexes — ngram (KURNIDX1: magic header, JSON meta, then length-prefixed gram/bitmap pairs) and exact (KURNEXA1, see exact.go). Saves are atomic (temp+rename, fsynced) and deterministic (keys written in sorted order, so identical indexes produce byte-identical files). Corruption rejection is structural only (no checksum): a bit-flip inside a payload can deserialize as different valid data — acceptable for the experiment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildInfo ¶ added in v0.2.0
type BuildInfo struct {
// BaseID is the content-addressed identity of the base.jsonl the index
// was built from (the version stamp's hash half). An index is a map
// from grams to ORDINAL POSITIONS in that specific file: against any
// other content of the same length every check can pass while the
// postings point at different entities, so a query returns entry X
// carrying entry Y's matching evidence. Counts cannot detect that;
// only identity can.
BaseID string `json:"base_id"`
Entries int `json:"entries"`
DroppedKeys int `json:"dropped_keys"`
KeylessEntries int `json:"keyless_entries"`
}
BuildInfo travels with an index so its loss counters survive a reload, and — the load-bearing half — binds the index to the exact base content whose ordinal assignments it encodes.
func LoadExact ¶
LoadExact reads a KURNEXA1 file back into an exact.Index, also returning the analyzer digest recorded in the header ("" for pre-digest artifacts). Any structural problem — bad magic, implausible header, short section, trailing bytes, inconsistent lengths — is an error; the caller falls back to a rebuild.