Skip to content

feat(desk): add per-pane accounts/quota telemetry panel - #146

Merged
yjuyjuy merged 1 commit into
mainfrom
fm/dash-pr3-per-pane-telemetry
Aug 24, 2026
Merged

feat(desk): add per-pane accounts/quota telemetry panel#146
yjuyjuy merged 1 commit into
mainfrom
fm/dash-pr3-per-pane-telemetry

Conversation

@yjuyjuy

@yjuyjuy yjuyjuy commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Intent

Dashboard PR3: add the per-pane accounts/quota telemetry panel to the captain desk (bin/fm-desk-refresh.sh), the CONSUMER side of the state/.telemetry producer that landed in main (PR #144). Fill the per-pane attribution gap the accounts panel (dash-pr2, #142) left explicitly labeled for this PR. render_pane_telemetry reads each live worker pane's state/.telemetry and renders one row per pane: account, runway bar, 429 throttle flag, composer-stuck flag, and a read_ts-driven freshness indicator. Deliberate decision: the design report (data/design-workflow-dashboard/report.md section 4) sketched a JSON telemetry shape, but the producer that actually shipped (bin/fm-telemetry-lib.sh) writes key=value lines, the same shape as state/.meta. The seam contract explicitly allowed this ('if the sibling picks a different shape, one jq path changes'), so this consumer intentionally reads the REAL landed key=value format with the same grep/tail/cut parser fm_meta_get uses, NEVER as JSON. Fail-closed on every gap variant is intentional: an absent or unparseable telemetry file is a visible 'no reading' gap row, an absent key is a dash, and only a numeric runway draws a bar, never a confident-zero bar or a fake-current value; a record older than the staleness bound (FM_DESK_TELEMETRY_MAX_AGE, default 1800s) is marked stale; no live pane at all is a confident empty. composer_stuck is deliberately forward-compatible with the not-yet-built gap-4 producer. The panel is composed UNDER the existing per-account table inside the same sec-accounts section, so the twelve-section spine is intentionally unchanged, and the desk never writes a telemetry file (read-only invariant, asserted by a byte-unchanged test). Also extracted desk_bar_class as the single owner of the runway threshold shared by both tables, and made usage() find the header end dynamically instead of a hardcoded line number. Tests extend tests/fm-desk-refresh.test.sh with fixture-injected telemetry records (populated, absent, unparseable, no-panes, stale, widened-bound) plus read-only and spine-stable checks. This fork (yjuyjuy/firstmate) has no CI, so a clean push+PR that parks at the ci step is the expected done state.

What Changed

  • Add render_pane_telemetry to bin/fm-desk-refresh.sh: reads each live worker pane's state/<id>.telemetry (key=value format, same parser style as fm_meta_get) and renders one row per pane with account, runway bar, 429 throttle flag, composer-stuck flag, and read_ts-driven freshness indicator. Fail-closed on missing/unparseable file, missing key, non-numeric runway, staleness past FM_DESK_TELEMETRY_MAX_AGE (default 1800s), and no live panes.
  • Extract desk_bar_class as the single shared owner of the runway threshold logic used by both the per-account table and the new per-pane panel; panel is composed under the existing per-account table inside sec-accounts, keeping the section spine unchanged.
  • Make usage() locate the header end dynamically instead of relying on a hardcoded line number.
  • Extend tests/fm-desk-refresh.test.sh with fixture-injected telemetry records covering populated, absent, unparseable, no-panes, stale, and widened-staleness-bound cases, plus assertions for read-only behavior (desk never writes a telemetry file) and section-spine stability.

Risk Assessment

✅ Low: Change is well-scoped, read-only over telemetry, fails closed on every gap variant, reuses existing fleet projection and NOW_EPOCH override, and is covered by behavior-driven tests (real bash invocation + output assertions) matching every case named in the intent.

Testing

Ran the targeted fm-desk-refresh test suite, which exercises render_pane_telemetry end-to-end through fixture-injected key=value telemetry files covering every gap variant the intent calls out (populated with fresh/low runway/429/composer-stuck, absent file, unparseable file, no live panes, stale read_ts, widened staleness bound) plus the read-only (byte-unchanged telemetry/registry files) and unchanged-spine invariants; all assertions passed and the worktree is clean with nothing to clean up.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-desk-refresh.test.sh (46 assertions incl. telemetry populated/absent/unparseable/no-panes/stale/widened-bound, read-only byte-unchanged, per-account spine-unchanged) — all passed
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@yjuyjuy
yjuyjuy force-pushed the fm/dash-pr3-per-pane-telemetry branch from a100085 to 70d9ef1 Compare August 21, 2026 15:45
Fill the per-pane attribution gap the accounts panel (dash-pr2) left labeled
for this PR. render_pane_telemetry reads each live worker pane's
state/<id>.telemetry - the shared per-task artifact bin/fm-telemetry-lib.sh
writes (visibility gap-1, PR #144) and the desk only consumes - and renders one
row per pane: account, runway bar, 429 throttle flag, composer-stuck flag, and a
read_ts-driven freshness indicator.

The design report (data/design-workflow-dashboard/report.md section 4) sketched
a JSON telemetry shape, but the producer that actually landed writes key=value
lines, the same shape as state/<id>.meta. The seam contract explicitly allowed
this ('one jq path changes'), so the consumer matches the real landed format and
reads it with the same grep/tail/cut parser fm_meta_get uses, never as JSON.

Fail-closed on every gap variant: an absent or unparseable telemetry file is a
visible 'no reading' gap row, an absent key is a dash, and a numeric runway is
the only thing that draws a bar - never a confident-zero bar or a fake-current
value. A record older than the staleness bound is marked stale. No live pane at
all is a confident empty. composer_stuck is forward-compatible with the not-yet
built gap-4 producer. The panel is composed under the existing per-account table
inside the same sec-accounts section, so the twelve-section spine is unchanged,
and the desk never writes a telemetry file (read-only invariant).

Extract desk_bar_class as the single owner of the runway threshold, shared by
the per-account and per-pane tables so their colorings cannot drift. Make usage()
find the header end dynamically instead of a hardcoded line number that drifted
when the header grew.

Tests: extend tests/fm-desk-refresh.test.sh with fixture-injected telemetry
records (populated, absent, unparseable, no-panes, stale, widened-bound) plus a
read-only byte-unchanged invariant and a spine-stable check.
@yjuyjuy
yjuyjuy force-pushed the fm/dash-pr3-per-pane-telemetry branch from 70d9ef1 to 325e0f1 Compare August 24, 2026 03:59
@yjuyjuy
yjuyjuy merged commit 50fe816 into main Aug 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant