Documentation
¶
Overview ¶
Package transform defines the pipeline contract for gitrakz templates: an ordered chain of primitives that reshape a selected timeline into a typed display document. Each primitive reads and writes a shared State; the boss precomputes which State fields each primitive touches so primitives compose without knowing about each other.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownPrimitive = errors.New("unknown transform primitive")
ErrUnknownPrimitive is returned by Registry.Build when a template's transform step names a primitive that was never registered.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
Factory builds a primitive from its JSON parameters (a step entry in a template's transform definition). Params is the raw step config.
type Pipeline ¶
type Pipeline struct {
Steps []Primitive
}
Pipeline is an ordered list of primitives run left to right over one State.
type Primitive ¶
A Primitive is one deterministic (or, for LLM-backed steps, cached) step in a template's transform pipeline. Apply mutates s in place.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps a primitive name to its factory. The template engine looks each pipeline step up here, so an unknown step fails loudly instead of silently doing nothing.
type Row ¶
type Row struct {
Key string `json:"key"`
Values map[string]float64 `json:"values"`
Labels map[string]string `json:"labels"`
}
Row is the generic tabular intermediate primitives produce and consume: a grouping key plus named numeric and string values. Example keys in Values: "seconds", "hours", "count", "dollars"; in Labels: "description".
type State ¶
type State struct {
Timeline types.Timeline
Sessions []types.Session
Rows []Row
Blocks blocks.Document
Form types.FormValues
}
State is the working state threaded through a pipeline. A primitive mutates the fields its contract names and leaves the rest untouched.
- Timeline: the selected events (pipeline input).
- Sessions: work sessions (sessionize writes; downstream reads).
- Rows: tabular intermediate (group/aggregate/split write; rate reads).
- Blocks: accumulated display output (terminal primitives append).
- Form: the run's form values (read-only).