feat(desk): add per-pane accounts/quota telemetry panel - #146
Merged
Conversation
yjuyjuy
force-pushed
the
fm/dash-pr3-per-pane-telemetry
branch
from
August 21, 2026 15:45
a100085 to
70d9ef1
Compare
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
force-pushed
the
fm/dash-pr3-per-pane-telemetry
branch
from
August 24, 2026 03:59
70d9ef1 to
325e0f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
render_pane_telemetryto bin/fm-desk-refresh.sh: reads each live worker pane'sstate/<id>.telemetry(key=value format, same parser style asfm_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 pastFM_DESK_TELEMETRY_MAX_AGE(default 1800s), and no live panes.desk_bar_classas 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 insidesec-accounts, keeping the section spine unchanged.usage()locate the header end dynamically instead of relying on a hardcoded line number.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.