Documentation
¶
Overview ¶
Package pack turns ranked candidates into a budgeted injection envelope. Granularity ladder per card: body (≤400 tok) → summary → hook line. The budget is under-filled to ~90% so token-estimation error can never blow the hard cap (C3).
Index ¶
Constants ¶
const PointerHeader = `` /* 189-byte string literal not displayed */
PointerHeader is the one-time SessionStart preface that teaches the model what ▸ pointer lines are and how to pull them (plan §6). Without it a fresh session sees bare pointers with no in-band instruction and tends to ignore them. Its token cost is charged against the baseline budget by the caller.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyLoader ¶
BodyLoader hydrates bodies for the few cards packed at body granularity — the hot-path scan deliberately omits bodies.
type Injection ¶
Injection is the rendered result. Empty Items ⇒ inject nothing.
func Pack ¶
func Pack(cands []retrieve.Candidate, injected map[string]int, budget int, load BodyLoader) (Injection, error)
Pack fills the budget greedily in rank order. injected holds the session's prior granularity levels (monotonic dedup: a card re-emits only at a strictly higher level).
func (Injection) Records ¶
func (inj Injection) Records() []store.InjectionRecord
Records converts packed items into injection-log rows.
func (Injection) RenderWith ¶
RenderWith prefaces the envelope with a non-card header line (e.g. PointerHeader). Header text is never recorded in the injection log — it is instruction, not knowledge, so 14.43's dedup does not apply.