Documentation
¶
Overview ¶
Package propose turns a finding into a reviewable draft, and accepts that draft.
The agent supplies the question and the finding. VaultMind chooses the note, the id, and the formatting. A person promotes the draft with note accept.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hit ¶
type Hit struct {
ID, Path, Type, Title, Band string
}
Hit is the closest note ask would have ranked first, plus the relevance band ask already computed for it. Band is empty when that judgement is withheld or there is no band.
type QuestionRank ¶
QuestionRank is one pass of the question through the ranking ask uses. Mode is "hybrid" or "keyword". Window is the hit limit of that pass. Zero means the caller asked for no cut.
type QuestionRanker ¶
type QuestionRanker interface {
RankQuestion(ctx context.Context, question string, includeDrafts bool) (QuestionRank, error)
}
QuestionRanker ranks a question. includeDrafts is the only difference between the two passes: false is what an agent gets today, true is the draft counted as if it had been accepted.
type RankCheck ¶
type RankCheck struct {
Mode string `json:"mode,omitempty"`
Window int `json:"window"`
Before RankPlace `json:"before"`
After RankPlace `json:"after"`
MeasuredOn string `json:"measured_on,omitempty"`
OutrankedBy []string `json:"outranked_by,omitempty"`
// Decision is the hit that chose patch or new: the closest note on the
// question and the finding. Rank is 1 when that note was found. The zero
// value means the retrieval named nothing. Before stays the question-only
// rank stored as rank_before.
Decision RankPlace `json:"decision,omitempty"`
// DecisionOn is the text that comparison used.
DecisionOn string `json:"decision_on,omitempty"`
// CloseBand is the weakest band the decision treated as close enough.
CloseBand string `json:"close_band,omitempty"`
}
RankCheck is the before/after measurement stored on the draft and reported to the caller. MeasuredOn is "proposal" when the finding lives on the proposal note rather than on the note it patches.
type RankPlace ¶
type RankPlace struct {
ID string `json:"id,omitempty"`
Rank int `json:"rank"`
Band string `json:"band,omitempty"`
}
RankPlace is one side of the retrieval check. Rank 0 means the note was not inside the window.
type RankedHit ¶
type RankedHit struct {
ID, Band string
}
RankedHit is one note in a ranking window, rank 1 first. Band is empty when ask would not show one for that hit.
type Request ¶
type Request struct {
Question, Finding, CloseBand string
// GapID, when set, stores closes_gap on the draft. An empty question
// uses the gap's stored question.
GapID string
// DraftsDir is where a draft goes when it must not sit in an import
// folder. Empty means notes. "." is the vault root.
DraftsDir string
Sources []string
JSON bool
Now time.Time // zero means time.Now().UTC()
ID string // accept: the draft id
Stdout, Stderr io.Writer
// Embed runs after a note is re-indexed. rel is the note this command
// just wrote, so the caller can avoid warning about other notes.
Embed func(vaultPath, rel string)
WorkDir string
// Ranker re-runs the original question after the draft is on disk.
// Nil skips the check. The command sets it; tests that only place a
// draft leave it nil so their output stays the placement report.
Ranker QuestionRanker
// contains filtered or unexported fields
}
Request is one propose or accept call.