Documentation
¶
Overview ¶
Package brief computes the morning "what to fix" digest: the pulse (last N days vs the N before), the per-product portfolio split, and the verdict engine's findings. One struct feeds the CLI text, JSON, webhook, and the cloud's email renderings, so they can never disagree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Brief ¶
type Brief struct {
GeneratedAt time.Time `json:"generated_at"`
Days int `json:"days"`
Visitors int `json:"visitors"`
Events int `json:"events"`
PriorVisitors int `json:"prior_visitors"`
PriorEvents int `json:"prior_events"`
Sites []SiteLine `json:"sites,omitempty"`
Findings []insight.Finding `json:"findings"`
// Investigation is the PM half: conclusions, each with a size, a cause and a next move,
// ranked so the most expensive thing leads.
//
// The pulse above tells you traffic moved. That is the raw material a PM would then spend a
// morning slicing. This is the slicing, already done — which is the difference between a
// digest someone skims and one they act on.
Investigation investigate.Investigation `json:"investigation"`
}
Brief is the computed digest.
type Context ¶ added in v0.85.2
type Context struct {
Flags []flag.Flag
Deploys []deploys.Deploy
Acted func(string) (time.Time, bool)
// Planned is the tracking-plan lookup. Without it the emailed brief would report
// "checkout fell 100%" about the very event the dashboard is calling a tracking break —
// the same split this type was created to close, one finding kind later.
Planned investigate.PlanLookup
}
Context is the optional instance state the investigation reads beyond the events: recorded flags (the kill list), deploy markers (cause attribution), and the outcome ledger (the acted/verified overlay). All optional, all nil-safe.
It exists because the brief was the one surface built from investigate.Run while the dashboard used WithContext — so on an instance that records deploys, the emailed finding said "no deploy recorded near this day" while the desk named the ship. Same events, two answers; the email even invites the reader to record deploys they already record.
type SiteLine ¶
type SiteLine struct {
Site string `json:"site"`
Visitors int `json:"visitors"`
Events int `json:"events"`
PriorVisitors int `json:"prior_visitors"`
PriorEvents int `json:"prior_events"`
}
SiteLine is one product's slice of the pulse. The SDK stamps every event's `site` (hostname) — the same key the dashboard's site selector filters on — so one instance carrying several products splits cleanly per site.