Documentation
¶
Overview ¶
Package compression implements the file-read compression pipeline that produces a token-optimized rendering of a file given Grove's symbols and the current session state.
Index ¶
Constants ¶
View Source
const MaxTokensPerFile = 50000
MaxTokensPerFile caps the size of any single compressed file response.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Task string
Symbols []grove.SymbolRecord // symbols in this file (from Grove)
Session *session.Tracker
Ledger *session.Ledger
TokenLedgerName string // tool name to bill ledger ("prism_read")
Confidence session.Confidence
Embeddings ranking.SemanticBackend // optional; nil → no semantic signal
}
CompressFileRead produces a fidelity-appropriate rendering of a file based on the symbols Grove has indexed for it, the current task, and the session state.
The "task" is optional context for ranking; if empty, all symbols are treated as equally relevant.
type Result ¶
type Result struct {
FilePath string
Content string
Strategy string // "full-fresh" | "compressed-fresh" | "session-reference" | "session-signature" | "escalated-full"
OriginalTokens int
DeliveredTokens int
SavingsPercent float64
}
Result is the output of CompressFileRead.
func CompressFileRead ¶
CompressFileRead returns the rendered output and ledger metadata.
Click to show internal directories.
Click to hide internal directories.