Documentation
¶
Overview ¶
Package gap records a question the vault did not answer.
A gap is a note. The index is a regenerable cache, so a committed note is the only durable home (Principle 7 — one source of truth). Recall never returns it. A weak ask is only a hint, written to local state, and is not a gap.
Index ¶
Constants ¶
const ( // DefaultLogLimit is how many hint records a compaction keeps. The file // may hold twice that many before it is rewritten. app.ask.gap_log_limit // defaults to this number. A non-positive limit uses it too, so a missing // config value cannot wipe the log. DefaultLogLimit = 1000 )
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open records an open gap, or reports the open gap that already asks this question. A closed gap with the same question does not count.
func RecordPossible ¶
RecordPossible appends a weak or no-match ask to the per-user hint log. Strong, moderate, and empty bands are not hints. The raw query is stored only when storeQuery is set; otherwise the line keeps a salted hash and a length.
The log is not vault content. It lives under xdg.StateDir, the same resolver episode cursors and the signer socket use: one 0600 file per vault, named by the sha256 of vault.CanonicalKey. The directory is 0700. An old .vaultmind/possible-gaps.jsonl is not read. It never shipped.
limit is the retained window. When the file grows past twice that, it is rewritten to the newest limit records. The scan keeps at most twice the window in memory, so one write stays bounded even if a previous file is large.
Types ¶
type Hits ¶
Hits lists the note ids ask would return for a question right now. Drafts and gaps are already excluded by that ranking.
type Report ¶
type Report struct {
Notes []OpenNote
Opened, Closed int
Median *float64
Possible int
PossibleSince string
}
Report is the gap meter. Opened counts open and closed gaps. Median is nil when nothing has been closed. Possible is the hint log, not a note.