Documentation
¶
Overview ¶
Package compress implements the first real transform: head/tail elision of verbose machine output, under the quality contracts.
Contracts enforced here:
- never-elide: lines that look like failures/errors survive the middle cut, up to Params.MaxKept. Past the cap the marker discloses how many failure lines were dropped — silent loss of failure signal is the one outcome this package must never produce
- idempotency: an already-elided blob is never compressed again (provider prompt caches see a stable body across turns)
- savings floor: if the squeeze saves less than 10%, skip it — breaking a prefix for pocket change is a net loss
Index ¶
Constants ¶
const RefHexLen = 12
RefPrefix is how much of the original's SHA256 hex is embedded in markers.
Variables ¶
var Default = Params{
MinBytes: 2048,
HeadLines: 20,
TailLines: 20,
MaxKept: 50,
ContextAfter: 2,
Marker: "[... squoze: %d middle lines elided · full text kept locally as %s ...]",
}
Default is the standard preset.
Functions ¶
Types ¶
type Params ¶
type Params struct {
MinBytes int // blobs below this size pass through
HeadLines int // leading lines kept verbatim
TailLines int // trailing lines kept verbatim (most recent signal)
MaxKept int // max middle error-lines rescued
ContextAfter int // extra trailing lines rescued with each error line
Marker string // elision marker line
}
Params controls one compression pass.