Add --prom-bearer-file, --prom-basic-auth-user/--prom-basic-auth-password-file,
--prom-ca-file and repeatable --prom-header to grom run, backed by a new
prom.NewWithOptions. Secrets are read from files only and re-read per request.
With no new flags the existing prom.New path is used unchanged.
Standard library only; go.mod is unchanged.
Refs #2
Both per-model bargauges were lifetime (hydrated counters blend eras).
Window with max_over_time - min_over_time over 30d (not increase(): the
counters are store-hydrated and dip on restart). The >20-exec gate is
now also windowed. Fleet has consolidated to one model in-window, so
both currently render a single bar; more return automatically when other
models run in-window. Titles gain (30d) to match delivery/ci cards.
Green threshold was 0.95, so the honest 30d figure (~94.8%) sat in the
yellow band and read as a warning. Lower the green cutoff to 0.9; red
<0.8 and yellow 0.8-0.9 unchanged.
pilot_ci_runs_total is a lifetime hydrated counter, so the gauge read
all-time (92.8%). Window it to 30d with max_over_time - min_over_time
(the hydrated-counter pattern used across this config) for the honest
94.8%; increase() would inflate to 96.3% by re-adding the hydration base
on each of the 5 restart dips/30d. Pilot exposes no pilot_window_ci_*
gauge, so this is a client-side window; note in-config that true parity
would need a server-computed gauge from Pilot.
Wrap both per-model queries in sort_desc(). Bargauges run as instant
queries and grom preserves Prometheus's returned vector order, so the
bars now rank by value top-to-bottom (success by %, cost by $).
Regroup row 2 into a 2x2:
ci pass rate | pipeline latency
success by model | cost by model
Two 12-col Y-bands (y:4, y:11) at h:7 keep the same y:4->18 footprint,
so rows below don't shift. pipeline latency drops from full-width to
half-width (noted in-config). Downstream row comments renumbered.
pilot_executions_total is a lifetime hydrated counter, so every model
ever run is exported forever. Tiny-sample dead experiments (glm-5.1 = 7
execs, claude-opus-4-7[1m] = 1 exec) pegged the panel at a meaningless
100%. Gate the series to >20 lifetime executions so only real,
comparable models render.
delivery rate + cost/shipped now read pilot_window_delivery_rate /
pilot_window_cost_per_delivered_usd instead of the lifetime era-blended
aggregates (~79.9% / ~$0.80 forever). Cards read 0 until the daemon
carries the pilot#4739 aggregate fix — noted in the panel comments.
Store-hydration re-bases pilot_* counters at daemon boot; when the base
lands below the pre-restart live value, Prometheus reads a counter reset
and increase() adds the full lifetime base as new activity (observed:
prs/3h rendered 1236 vs a true value of 3 after the 2026-07-23 12:18Z
restart). Replace increase() with max_over_time - min_over_time on the
four hydrated-counter panels (prs/3h, execs by result, breaker trips,
tokens/5m) and document the finalize-time token counting + lifetime
per-model panels (April glm-5.1 experiment rows are real data).
Filled and track cells both used the solid ■ glyph, encoding the fill
fraction in color alone. With ANSI stripped (--once piped to a non-TTY,
NO_COLOR, frames pasted into an issue) every bar collapsed to a uniform
full-width bar. Render the track with □ instead, matching the function's
documented output. Also fixes the gauge widget.
Fixes#1
execs-this-run (session-scoped by nature; sparkline sawtooth marks
daemon restarts), queue depth, active PRs, api error rate. Answers
'what is the daemon doing' without re-polluting the lifetime rows.
The 2026-07-09 17:28 deploy back-filled +976 pre-ledger merges;
increase() reads that as throughput for a full trailing window. 3h
window exits the artifact tonight; TODO in-file to widen back to 24h
after 2026-07-10 ~17:30.
Rolling-day increase() answers 'how many PRs do we merge per session';
the lifetime total stayed readable via the pr delivery gauge. decimals:
0 because increase() extrapolates fractionally.
rate()[5m] plots tokens per SECOND (5m-smoothed); the title promised
tokens per 5 minutes. increase()[5m] delivers exactly that, ~300x
larger values, and the area under the curve is total tokens.
Pilot 2f25dcd0 hydrates pilot_prs_merged/failed from executions
(lifetime), so the window caveats are obsolete. The merged/(merged+
failed) gauge reads 99% on lifetime data — that's PR delivery, not a
plausible CI pass rate, so retitle honestly until pilot#4134 ships the
real pilot_ci_runs_total counter.
Multi-series charts previously always stacked — the stacked flag was
parsed but never honored. Now stacked: false (the default) overlays on
a shared y-scale via render.BrailleMulti: first series as filled area,
later ones as lines on top, one color per series. This matches
Grafana's default timeseries rendering, so imported dashboards look
right too. Solid (--ascii) mode keeps stacking: no block overlay
primitive exists.
examples/pilot.yaml grows a full-width 'time / issue' row overlaying
avg PR time-to-merge (area) with avg execution duration (line), both
1h windows. exec durations are session-scoped upstream (hydration
asked in pilot#4134), so that series starts sparse.
Grafana's mascot and AI helper are both named Grot
(grafana.com/grot) — a name collision flagged on the r/grafana
launch thread. grom (Polish: thunder) keeps the short Slavic name
without squatting on Grafana's brand.
Renames the Go module, cmd dir, binary, brew cask, docs, examples,
and dev docs. Old repo URL redirects; module path is new as of
v0.2.0.
Corrections from the Pilot-side agent review:
- success rate -> pilot_issue_level_success_rate (shipped/attempted,
deduped across retries), matching the web pilot-dashboard.json incl.
its 50/80 thresholds. The per-attempt pilot_success_rate reads higher
(retries count in its favor) and is deprecated for delivery health.
- cost / issue -> cost / shipped: issues_processed_total counts attempt
outcomes, not unique issues — a third denominator on one row.
- prs merged / ci pass rate labeled '(recent)': GH-4093 hydrates PR
counters from the execution_events ledger (~2026-07 on), so they are
not lifetime like the cost/token cards beside them. True lifetime
hydration + a real ci_runs counter are upstream Pilot asks.
Row 1 stat and row 2 gauge both showed pilot_success_rate. The gauge now
tracks PR delivery instead: merged / (merged + failed), the closest proxy
Pilot exports (no CI-specific pass/fail counter; failed also counts
approval rejections and merge escalations).
Also drop the stale 'reads 0' caveat on the prs-merged card — upstream
PR instrumentation is live since GH-4093 (54 merged on the live board).
pilot#4029 shipped (store-hydrated counters survive daemon restarts), so
raw pilot_*_total sums are now lifetime totals:
- 'prs / session' stat -> 'prs merged' (lifetime); note that the upstream
PR instrumentation currently exports 0 (tracked on pilot#4029)
- cumulative cost chart comment: curve is all-time spend, not since-restart
- ci.yml: gofmt/vet/build/test -race + golangci-lint on push and PR
- release.yml: goreleaser on v* tags (tests gate the release)
- goreleaser: CGO-free darwin/linux amd64+arm64, version ldflags,
conventional-commit changelog, cask published to qf-studio/homebrew-tap
(quarantine hook for the unsigned binary)
Uses only 'up' and the scrape_* metrics Prometheus attaches to every target,
so it renders out of the box on a stock install — no exporters, no
self-scrape job required. Covers all four widget types.
- config: 'sparkline: true' on stat widgets routes their queries through
query_range, so the existing value+trend rendering receives history.
- grafana import: stat graphMode maps 1:1 — absent/'area' (Grafana default)
→ sparkline on, 'none' → off.
- examples/pilot.yaml row 1 reworked: success rate, tokens, cost/issue
(zero-denominator guarded), prs/session — all with trend bands.
- demo gallery: all four row-1 cards carry the subdued band.
Expressions like sum(a)/sum(b) return +Inf when the denominator is 0.
Instant queries now drop non-finite values (no data, not a $+Inf stat);
range queries normalize ±Inf to NaN so charts render a gap instead of a
broken y-scale.
A quiet centered panel listing the keybindings, btop-style. The overlay is
modal — any key dismisses it (quit still works) — and esc now closes the
zoomed panel, matching what fingers expect.
The header (title · clock · theme · range · stale list) had no width bound; a
long stale-widget list on a narrow terminal would wrap and shift the entire
grid below it by a line.
Sweeps PanelInfo with a styled legend across panel widths 6–80 and asserts
every line stays exactly w cells. An over-wide or escape-mangled top border
wraps in the terminal and cascade-breaks the whole frame below it — the
resize corruption fixed in the previous CSI truncation commit. Fails on the
pre-fix TruncateVisual; raw ANSI input because lipgloss strips color off-TTY.
- gauge scale line, bargauge value column, and timeseries y-gutter sized
labels with len(); FormatValue can emit µs (2 bytes, 1 cell), skewing the
layout by a cell. Use lipgloss.Width.
- thresholdColor picked the last matching step, assuming ascending order —
Grafana exports steps sorted, hand-written YAML may not be. Resolve the
highest matching threshold regardless of slice order.
- drop the dead 'var _ = lipgloss.Width' import keeper.
TruncateVisual ended escape mode at the first byte in 0x40–0x7e, but the CSI
introducer '[' (0x5b) is itself in that range — real SGR sequences dropped out
of escape mode immediately and their parameter bytes counted as visible text.
Masked in tests because lipgloss strips color off-TTY; now covered with raw
ANSI input.
Also re-emit a reset when truncation cuts a styled string before its closing
reset, so the ellipsis and following text don't inherit the open style.
The live dashboard's charts collapsed into solid blocks jammed against the right
edge, unlike the demo gallery's airy full-width braille. Two causes:
- prom.go QueryRange dropped NaN samples, and scaleToDots/resampleCols
right-align when points < columns — so a sparse series (p95: ~60/90 buckets
NaN) lost its time axis and got shoved right as a filled block. Now QueryRange
keeps NaN positionally; the braille scalers render NaN as a gap (height 0) and
ignore it in min/max; Series.Last() and TimeSeries.collect() skip NaN. Sparse
ranges now render at their true timestamps with gaps, and stacked multi-series
stay index-aligned. Regression tests in render + prom.
- examples/pilot.yaml was thin and used sparse query shapes. Rebuilt to mirror
the demo: 24-col gridPos layout (4 stats / gauge + bar gauge / two charts),
tokens-by-direction as a bar gauge, and always-defined cumulative/rate charts.
go test -race and golangci-lint clean; demo gallery unchanged.
Phase 5 of the v0.1 MVP — reproduce a Grafana dashboard in the terminal.
- internal/grafana: Import/Convert map a Grafana export (bare or {"dashboard":{}}
wrapped) to a normalized config.Dashboard + warnings. stat/gauge/bargauge/
timeseries map 1:1; fieldConfig defaults (unit/decimals/min/max/thresholds),
stacking, reduceOptions, and targets (expr/legendFormat/instant) carry over;
time.from now-<dur> -> range, refresh -> refresh. Row panels drop but promote
their children; unsupported types become a placeholder in their grid slot with
a warning.
- config: TypePlaceholder (query-less) + exported Dashboard.Normalize so the
importer runs the loader's validation/defaults.
- widget: Placeholder panel ("unsupported: <type>").
- app/grid: GridLayout now honors 24-col gridPos (scale to termW, group by
Grafana row) when present, else auto-flows; composeGrid is Y-grouped, X-sorted,
and gap-aware so tiled dashboards reproduce faithfully.
- cli: run --grafana-json <file>; new `grot import <file> [--check]`.
Verified: `run --grafana-json pilot-dashboard.json --once` @ :9093 reproduces the
Grafana 4x4 layout with correct titles/units/thresholds/charts; synthetic fixture
covers gauge/bargauge/row-promotion/placeholder. Golden tests (real + synthetic +
wrapped + parseNowRange) + gridPos layout test; go test -race and lint clean.
Phase 4 of the v0.1 MVP. Consolidates layout/fetch/render into internal/app and
adds the interactive TUI; cmd/grot/run.go is now thin CLI wiring.
- grid.go: Rect + GridLayout (auto-flow, absolute cells, reflow breakpoints
<80/80-139/>=140) + focusMove (overlap-gated geometric hjkl).
- fetch.go: FetchWidget/useRange/FetchAll moved out of run.go.
- render.go: header, grid compositor, StaticFrame, and safeRender (never renders
a widget below its MinSize).
- model.go: Bubble Tea Model + RunTUI. tick -> batched per-widget fetch Cmds with
an in-flight guard so slow queries never block Update or stack; keys for hjkl
focus, Enter zoom, +/- range presets, r refresh, t theme, q quit; WindowSizeMsg
reflow; vertical scroll; widget-local errors keep the grid intact.
- run.go: default launches the TUI; --once renders one static frame.
Fix: an aggressive resize could lay a widget out below its chrome, underflowing
width math to a negative strings.Repeat count and panicking in TruncateVisual.
TruncateVisual/Center/PadOrTruncate now clamp non-positive widths, and safeRender
gates widget sizes — "live resize never breaks the grid".
Verified: full interactive TUI against live Prometheus (real PTY) renders all
widgets and handles all keys without panic; 12 model tests + grid/step tests;
go test -race and golangci-lint clean.
Phase 2 + Phase 3 of the v0.1 MVP.
Phase 2 — instant queries + native config:
- internal/datasource: Datasource interface at the consumer boundary
(QueryInstant/QueryRange) with Instant/Range request types.
- internal/datasource/prom: client_golang-backed impl; {{label}} legend
expansion; NaN samples dropped.
- internal/config: canonical Dashboard/WidgetSpec model + strict YAML loader
(KnownFields, validation, defaults).
- internal/app: BuildWidget spec→widget factory.
- cmd/grot run: --config/--prom/--theme/--watch; per-widget ctx timeout so one
slow/failing query never breaks the grid.
Phase 3 — query_range + braille timeseries:
- internal/app/step: StepFor(range, chartWidth) — chartWidth×2 dots → step
rounded up a clean ladder, 10s floor; sample count never exceeds the dot
budget (table + invariant tests).
- cmd/grot run: layout planned once per tick so fetch (step sizing) and draw
share widths; timeseries routed through QueryRange; --ascii block fallback.
- examples/pilot.yaml: p95 execution + stacked tokens-by-model timeseries.
Known gap: range NaN points are dropped rather than
kept as positional gaps, which collapses the time axis for sparse series and
would misalign stacked multi-series. To be addressed before stacked ships.