54 Commits
Author SHA1 Message Date
ahp 455faf4e81 docs(readme): drop upstream roadmap from fork README 2026-12-04 16:57:16 +03:30
ahp 254736439a docs(readme): fork notice and fork install instructions v0.3.1-fork.1 2026-12-04 16:49:10 +03:30
ahp 4af4f2c280 feat(prom): auth, TLS and custom headers for the Prometheus datasource
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
2026-12-04 16:42:50 +03:30
Aleks Petrov fed08004c8 docs(examples): fix pilot.yaml run comment port 2026-10-05 13:10:01 +02:00
Aleks Petrov 5914bb26ba docs: add CONTRIBUTING.md 2026-09-07 14:22:53 +02:00
Aleks Petrov ea04ada4fb feat(examples): window success/cost by model to 30d
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.
2026-08-06 16:03:56 +02:00
Aleks Petrov 8422d82639 fix(examples): ci pass rate goes green at 90% (was 95%)
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.
2026-08-06 15:55:38 +02:00
Aleks Petrov eeee2f56eb feat(examples): window ci pass rate to 30d to match delivery rate
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.
2026-08-06 15:41:48 +02:00
Aleks Petrov 55badff1d7 feat(examples): sort success/cost by model bargauges highest-first
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 $).
2026-08-06 15:26:46 +02:00
Aleks Petrov 9caa36a319 refactor(examples): pilot quality+pipeline as a 2x2 block
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.
2026-08-06 15:18:05 +02:00
Aleks Petrov b6fdae6408 fix(examples): apply the >20-exec gate to cost-by-model too
Consistency with success-by-model: drop dead-experiment models
(glm-5.1, claude-opus-4-7[1m]) from the per-model spend bargauge.
2026-08-06 15:12:17 +02:00
Aleks Petrov f8bf711937 fix(examples): gate success-by-model to models with >20 lifetime execs
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.
2026-08-06 15:05:19 +02:00
Aleks Petrov f083ed3fdd fix(examples): wrap pilot_window_* stat queries in max() — window-label churn leaves a dead sibling series the stat card can pick 2026-08-06 13:41:01 +02:00
Aleks Petrov 44817b9261 docs(examples): pilot headline cards → rolling-window gauges (pilot#4735)
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.
2026-08-05 19:50:43 +02:00
Aleks Petrov 8e37acaaba fix(pilot-dashboard): restart-immune windowed queries for hydrated counters
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).
2026-07-23 16:08:42 +02:00
Aleks Petrov 6fd5cf15be fix(render): SegmentMeter track uses hollow glyph so bargauge fill is legible without color
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
2026-07-17 00:25:09 +02:00
Aleks Petrov 9285ec529b feat(examples): drift-watch pilot dashboard — per-model scoring/cost, pipeline p50 latency, guard-counter row 2026-07-16 23:58:49 +02:00
Aleks Petrov 02bc7f043c docs(examples): pin prs/3h until pilot#4134 monotonicity fix — restarts re-poison windows 2026-07-11 15:24:16 +02:00
Aleks Petrov 89368d85da feat(examples): 'this run / right now' row — process view under the business view
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.
2026-07-11 15:23:27 +02:00
Aleks Petrov 7ce89bb042 docs(examples): note the counter monotonicity poisoning in the prs/3h TODO 2026-07-09 20:33:07 +02:00
Aleks Petrov 4fa5b051df fix(examples): prs window 24h -> 3h until the hydration back-fill ages out
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.
2026-07-09 20:01:10 +02:00
Aleks Petrov 77e3f88486 feat(examples): prs merged -> prs / 24h session throughput
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.
2026-07-09 19:55:36 +02:00
Aleks Petrov 966e0b8bd5 fix(examples): tokens/5m chart — increase() so the title means what it says
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.
2026-07-09 19:44:22 +02:00
Aleks Petrov e017d1a52e fix(examples): pilot PR counters are lifetime now — drop (recent), retitle gauge
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.
2026-07-09 19:36:55 +02:00
Aleks Petrov 6c1a9fd06f feat(widget): overlay mode for multi-series timeseries
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.
2026-07-09 19:03:32 +02:00
Aleks Petrov 7e3333f0d9 docs: regenerate demo GIF with grom binary 2026-07-09 18:26:59 +02:00
Aleks Petrov 67994fe98f chore: drop stray pre-rename grot binary from tree 2026-07-09 18:22:00 +02:00
Aleks Petrov e2c65d426e chore: rename project grot -> grom
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.
2026-07-09 18:21:43 +02:00
Aleks Petrov 0afe1708b4 fix(examples): honest metric semantics across pilot.yaml cards
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.
2026-07-09 16:15:39 +02:00
Aleks Petrov 5b50bd236f fix(examples): replace duplicate success gauge with CI pass rate
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).
2026-07-09 16:02:58 +02:00
Aleks Petrov d2e6698cb9 chore(deps): gopkg.in/yaml.v3 -> go.yaml.in/yaml/v3
gopkg.in/yaml.v3 is archived/unmaintained; go.yaml.in/yaml/v3 is the
YAML-org-maintained drop-in fork. Same API, import path change only.
2026-07-08 21:58:57 +02:00
Aleks Petrov 892650a341 fix(examples): pilot.yaml lifetime counter semantics
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
2026-07-08 21:11:08 +02:00
Aleks Petrov d7e49cbabd docs: CI/release/license badges; release + GIF-regen notes 2026-07-07 21:37:16 +02:00
Aleks Petrov 26c13ad1ba docs: status line for the tagged release 2026-07-07 21:07:54 +02:00
Aleks Petrov 2c2317187d ci: test+lint workflow, goreleaser release pipeline, Homebrew cask
- 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)
2026-07-07 20:52:22 +02:00
Aleks Petrov e95546cb45 docs: README for the public repo + VHS demo GIF
Quick start (demo / native YAML / Grafana import / --once), keybindings,
dashboard config reference, Grafana mapping table, terminal color/braille
notes, roadmap. GIF recorded from the live TUI via docs/demo.tape.
2026-07-07 20:39:15 +02:00
Aleks Petrov fc086f1ac9 feat(examples): universal dashboard for any Prometheus
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.
2026-07-07 20:39:15 +02:00
Aleks Petrov b01d806265 feat(stat): sparkline trend bands under stat values
- 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.
2026-07-07 20:24:07 +02:00
Aleks Petrov 9ffacbc6f6 fix(datasource): treat non-finite samples as gaps
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.
2026-07-07 20:24:07 +02:00
Aleks Petrov 34c363cd91 feat(app): help overlay on '?', esc closes zoom
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.
2026-07-07 20:06:18 +02:00
Aleks Petrov 7d8a1b3b17 fix(app): clamp the header line to the viewport width
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.
2026-07-07 19:58:00 +02:00
Aleks Petrov 9ffca6b683 test(render): guard the border-legend width invariant under truncation
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.
2026-07-07 19:58:00 +02:00
Aleks Petrov 4c5cb0262f chore: relax go directive to 1.25.0
The patch-level 1.25.6 directive forces a toolchain download on anyone
building with an older 1.25 point release; nothing depends on the patch.
2026-07-07 19:51:12 +02:00
Aleks Petrov 78de3b283a fix(widget): visual-width math and order-independent thresholds
- 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.
2026-07-07 19:51:12 +02:00
Aleks Petrov bd3cab4dd8 fix(render): terminate CSI at its final byte and reset styles after truncation
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.
2026-07-07 19:51:12 +02:00
Aleks Petrov fa49a2b462 chore(examples): poll every 10s
examples/pilot.yaml: refresh 30s → 10s.
2026-07-07 18:24:08 +02:00
Aleks Petrov 48168660f5 fix(render): NaN-as-gap timeseries + richer example dashboard
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.
2026-07-07 16:11:16 +02:00
Aleks Petrov 54750935a2 feat(grafana): import Grafana dashboard JSON with gridPos layout
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.
2026-07-07 15:51:33 +02:00
Aleks Petrov fbcb245d59 feat(app): interactive Bubble Tea dashboard — grid, focus, zoom, polling
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.
2026-07-07 15:36:54 +02:00
Aleks Petrov 4cfb29e515 feat(datasource): Prometheus queries, YAML config, and query_range braille pipeline
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.
2026-07-07 15:09:48 +02:00