Skip to content

Spec: Console Metrics view for Run metrics, Fleet trends, and failure attribution #2036

Closed
5 of 5 issues completed

Description

@JacobStephens2

Settled in a grill-with-docs session (PR #2064, Q1.1–Q4.2; ADR 0016, ADR 0018, ADR 0026).

Problem Statement

Today the Console gives the Day shift rich live views of active work (Inbox, Lanes, Stages, Waterfall, Logs, Cron jobs, Resources) and specialized evaluation pages (Experiments, Scores, Bug origins), while historical Run metrics sit behind an unlinked page that dumps raw JSON in a <pre> block and a weekly CLI summary with active blind spots:

  • There is no visual or tabular Metrics page in Console navigation to see whether factory Commands are succeeding or failing over time, whether reliability, churn, or post-merge quality is improving or regressing compared with the preceding period, or where runs are breaking.
  • Outcome-blind averaging in weekly trends averages duration, Repairs, and CI rounds across all outcomes, so a wave of 30-second startup crashes makes speed and repair averages look better, while crashed runs with no recorded outcome are lumped together with currently live runs.
  • Pass-through Pickup run dispatchers appear beside the Ticket runs and Spec runs they dispatched, inviting double-counted outcomes.
  • Neither thirdshift's own version nor structured stopping stages and failure categories are recorded on the Command record, making it hard to correlate spikes to a release or spot systemic failure clusters without opening dozens of individual logs.
  • Trends read only the serving OS account on one machine: configured Other-account Commands are omitted, paired Fleet machines cannot be viewed together, offline or retired Fleet machines vanish from history, and a sleeping or NATted laptop machine cannot report its Run metrics outward to an always-on Fleet Console.

Solution

Turn Metrics into a first-class Console view (with a matching m keyboard jump), paired with the metrics CLI command and local Console API endpoint under ADR 0016 and ADR 0026. Keep every signal in its own units—never combined into a composite score—and keep live "health" reserved for per-Command Slow and Silent observations.

Organize Metrics around four survivorship-safe signal groups in tension—(1) yield and kept pull-request survival, (2) post-merge quality (Bug origins and weekly Scores criterion pass rates) and human-attention load (Stop and Needs you counts), (3) succeeded-run efficiency, first-pass clean rate, effective time/cost per succeeded delivery, and wasted-effort share, and (4) stage bottlenecks against repository Usual ranges and session friction—backed by daily and weekly time buckets, window presets paired with preceding-window deltas, release/configuration correlation (thirdshift version, Harness, Model, repository, Command kind, OS account), structured failure-stage and failure-category breakdowns that link straight to the offending Commands, Other-account Command inclusion, client-side Fleet aggregation with per-peer snapshot caching, and holder-bound report-scoped outbound reporting so a sleeping or NATted worker machine appears read-only on an always-on Console without any external database server.

User Stories

  1. As the Day shift, I want a Metrics link in Console navigation with keyboard shortcut m, so that I can reach historical factory Run metrics from any Console page in one keystroke or click.
  2. As the Day shift, I want every Run metrics signal kept separate in its own units rather than collapsed into a synthetic score, so that improvements in one dimension never disguise regressions in another.
  3. As the Day shift, I want the Console Metrics page to default to my whole Fleet whenever paired Fleet machines or reported peer snapshots exist, while letting me switch to This machine or any individual Fleet machine, so that one Console shows my entire factory at once.
  4. As a CLI or script user, I want metrics --fleet to aggregate across my paired Fleet machines and cached/reported peer snapshots while keeping each machine's Console API endpoint strictly local, so that CLI and Console behavior match without lending saved Fleet credentials over the API.
  5. As the Day shift, I want single-Command metrics <command> inspection to keep working unchanged in text, JSON, and the Console API, so that existing per-Command inspection workflows do not break.
  6. As the Day shift, I want Metrics to support window presets (7d daily, 30d daily, 12w weekly, and All weekly) alongside explicit date bounds and daily or weekly grain selection, so that I can inspect both 24-hour regressions and multi-month trajectories.
  7. As the Day shift, I want each window paired with an explicit comparison against the immediately preceding equal-length window showing deltas, sample sizes (n), and observed / missing coverage, so that I can tell immediately whether a signal is getting better or worse and how much evidence backs it.
  8. As the Day shift, I want work Commands (Ticket run, Spec run, Base fix, Review run, Fix run, Triage run, Architect run, Security run) counted by their own Command kind without pooling child Ticket runs and parent Spec runs into one combined denominator, so that short high-volume runs cannot mask failures in heavier workflows.
  9. As the Day shift, I want pass-through Pickup run dispatchers excluded from outcome denominators unless a Pickup run itself failed or died before dispatching work, and skipped idle Passes excluded completely, so that picked-up runs are never double-counted and idle cron ticks never dilute ratios.
  10. As the Day shift, I want ended runs classified into four explicit visible stacks—Succeeded, Failed (including crashed/died runs, kept distinct from currently Live runs), Paused (Paused Command on plan/quota limits), and Stopped (human Stop)—with success/failure ratio computed as Succeeded / (Succeeded + Failed) and exact sub-outcomes preserved on drilldown, so that quota pauses and manual Stops remain visible without counting as factory failures.
  11. As the Day shift, I want kept pull-request survival (merged versus unmerged closed, read locally from the Console's kept GitHub state with zero live GitHub calls during metrics) shown alongside run outcomes, so that runs whose pull requests were later closed unmerged do not look indistinguishable from durable deliveries.
  12. As the Day shift, I want confirmed Bug origins per merged cohort, weekly calibrated Scores criterion pass rates from Scoring runs, and Stop / Needs you counts surfaced alongside run yield, so that post-merge quality and human-attention load balance throughput.
  13. As the Day shift, I want duration, Repairs, and CI rounds averaged over succeeded runs rather than across early crashes, alongside first-pass clean rate (Repairs == 0 among succeeded runs), effective time and cost per succeeded delivery (all attempts divided by succeeded runs, separated by Model and Harness), and wasted time/spend share on failed, crashed, or stopped runs, so that startup crash waves never flatter speed or repair averages and wasted effort is directly visible.
  14. As the Day shift, I want stage bottleneck rates (share of stages exceeding their repository Usual range, already excluding Suspended time) and per-session trajectory friction (repeated_tool_calls, tool_errors, permission_denials, killed_work, non-zero destructive_commands, and security-finding holds) surfaced without vanity metrics (lines of code, raw context-free token totals, pooled cross-kind pass rates, or raw review-finding counts as quality proxies), so that every displayed number points to an actionable improvement.
  15. As the Day shift, I want each Command record to persist the thirdshift version at startup—falling back to service.version in historical Session traces when absent—and I want Metrics to mark version transitions on the timeline and slice by thirdshift version alongside Harness (and harness version), Model, repository, Command kind, and OS account, so that I can correlate improvements or regressions to specific releases or configuration shifts.
  16. As the Day shift, I want CommandRecord completion to persist the structured stopping stage and deterministic failure category (falling back to the last recorded stage on historical records) and render a "Where runs failed" breakdown on Metrics, so that systemic failure clusters (such as worktree acquisition, CI watch, or Self-merge holds) stand out without opening individual logs.
  17. As the Day shift, I want clicking any failure bucket or "Where runs failed" row on Metrics to link through to matching History or Command detail views, so that investigating a spike takes one click from aggregate trend to the offending Commands.
  18. As the Day shift running multiple OS accounts on one server, I want configured readable Other-account Commands included in metrics and the Console API with OS-account tagging and filtering, so that Metrics covers the same local factory scope as Inbox and status.
  19. As the Day shift watching a Fleet, I want the watching Console to cache each paired peer's last-fetched bucket summary locally on disk so that when a Fleet peer is temporarily unreachable or retired, its past history stays visible in Fleet Metrics (explicitly marked cached/offline with its last-seen timestamp) without needing a centralized PostgreSQL server.
  20. As the Day shift running additional compute on a sleeping or NATted laptop VM alongside a 24/7 Console, I want to issue a narrow report-scoped Console API token bound to that worker's machine name (console token create <holder> --scopes report), so that the worker can upload only its own named Run metrics snapshot over HTTPS and cannot read private data, act on Commands, administer the host, or overwrite another machine's slot.
  21. As the Day shift running Commands on my laptop VM, I want both an explicit metrics --push <peer> CLI command and automatic best-effort outbound push when a Command finishes (when configured in User config, logging a warning and never failing the Command if offline), so that even ad-hoc manual laptop runs appear read-only on my 24/7 Console before I close the laptop lid.
  22. As the Day shift viewing a pushed or offline peer's metrics on my 24/7 Console, I want to see its pushed_at / cached age and compact failure summaries cleanly, with read-only messaging where live inbound Command logs cannot be reached, so that unreachable workers never produce broken detail links.
  23. As the Day shift reading Metrics on a desktop monitor or a 390px phone across built-in and custom Themes, I want server-rendered HTML tables paired with lightweight static inline SVG/CSS stacked outcome bars, compact sparklines, and version-transition markers styled through Theme tokens with zero client-side charting library and zero motion, so that trends are scannable at a glance on any device without breaking ADR 0018.
  24. As a maintainer pruning multi-gigabyte raw Session traces months later, I want compact Command records and Scoring checkpoints to retain everything Metrics needs, so that multi-year factory history occupies tens of megabytes per machine with zero external database maintenance.

Implementation Decisions

  • Route, CLI twin, and API parity. Keep the existing /metrics page route, /api/v1/metrics local API endpoint, and metrics CLI command. Add Metrics (data-jump="m") to Console navigation alongside Experiments, Scores, and Bug origins. Preserve single-Command metrics <command> inspection unchanged. All top-of-page GET query filters on /metrics mirror CLI flags on metrics: scope (machine=fleet|<name> / --fleet / --machine), window preset (window=7d|30d|12w|all / --window), time grain (grain=day|week / --grain), date bounds (from, through), repository (repo, repeatable), Command kind (kind), Harness (harness), Model (model), thirdshift version (version), and OS account (account). Register metrics --fleet and metrics --push in the CLI-only parity exclusions inventory in lockstep with ADR 0026 so local /api/v1/metrics never relays saved Fleet or push credentials.
  • Durable local storage and Fleet snapshot cache (no external database). Per-machine Command records, Scoring run checkpoints, and local kept GitHub state remain the sole durable source of truth; metrics makes zero live GitHub calls. When a Console or CLI aggregates Fleet metrics, it fetches compact bucketed /api/v1/metrics summaries from reachable paired Fleet machines and writes each peer's latest snapshot atomically to a per-machine peer-metrics snapshot under the watching account's logs directory. When a paired peer is unreachable or only has a saved snapshot (offline, sleeping, or retired), its cached buckets remain included in Fleet views and explicitly badged as cached/offline with their last-seen/pushed timestamp.
  • Outbound report token scope and worker push. Extend Console API token scopes with report. A token created for <holder> with report scope validates <holder> as a Fleet machine name and authorizes only HTTPS uploads to a dedicated Fleet-metrics report endpoint that atomically writes that holder's own named peer-metrics snapshot (rate-limiting failed tokens under existing token rules, granting zero read, security, act, run, or admin permissions, and refusing writes to any other machine name). Add User config and Credentials support on a worker machine to configure one or more outbound report targets (address + saved report token), exercised explicitly via metrics --push [<peer>] and triggered automatically on a best-effort bounded timeout when a Command finishes (emitting a warning and never failing the Command if the network or target Console is unreachable). Snapshots include compact per-failure summary metadata (Command name, kind, repository, timestamp, stopping stage/category, pull request/issue URL if public) so a watching Console can display read-only failure context when live inbound Command logs are unreachable.
  • Command record enrichment and historical fallback. Persist thirdshift_version on every new Command record at Command startup; when reading older records lacking thirdshift_version, recover service.version from their referenced Session traces when available (reusing existing trace-signal caching so unchanged traces are not re-parsed on every read). At Command completion, persist optional structured stopped_at stage and deterministic failure category (held, waiting, crashed, or stage_failed) from the structured recovery and failure-ending values rather than discarding them into free-text cause; older failed/dead records fall back to their last recorded stage and died versus failed status, reporting observed and missing counts honestly.
  • Other-account Commands. Update metrics snapshot loading to merge configured readable Other-account Commands on the machine alongside the serving OS account, tagging rows and buckets with their owning account and supporting account filtering, matching Inbox and status.
  • Hierarchy, deduplication, and outcome taxonomy. Count work Commands (Ticket run, Spec run, Base fix, Review run, Fix run, Triage run, Architect run, Security run) in separate per-kind series/rows (never summing parent Spec runs and child Ticket runs into one pooled pass rate). Exclude pass-through Pickup run dispatchers from outcome denominators unless the Pickup run itself failed or died before dispatching a child Command; exclude skipped idle Passes altogether. Separate live runs from crashed died records (outcome absent and writer dead). Classify ended runs into four explicit classes—Succeeded, Failed (including died), Paused, and Stopped—preserving raw sub-outcomes for breakdown/hover, and define success rate as Succeeded / (Succeeded + Failed).
  • Four-pillar signal calculations, windows, and version markers. Support both UTC/local-consistent daily buckets and Monday weekly buckets across presets (7d daily, 30d daily, 12w weekly, All weekly) plus custom from/through ranges, computing an equal-duration preceding-window comparison (delta, current n, prior n, and observed/missing coverage) when a bounded window is active:
    1. Yield & pull-request survival: per-kind Succeeded, Failed (with Died), Paused, Stopped, Live, success/failure rate, and kept pull-request merged versus unmerged closed counts from local kept GitHub state.
    2. Post-merge quality & human load: confirmed Bug origins per merged cohort, weekly Scores criterion pass rates from local Scoring run checkpoints, and Stop / Needs you counts.
    3. Efficiency, wasted effort & Repair churn: duration, Repairs, and CI rounds computed strictly over Succeeded runs; first-pass clean rate (Repairs == 0 among succeeded runs); effective time and cost per succeeded delivery (total time or priced/observed spend across all ended attempts divided by succeeded runs, broken down by Model and Harness so missing pricing on one Harness never distorts another); and wasted time/spend share on failed, died, and stopped runs.
    4. Stage bottlenecks & session friction: per-stage share above repository Usual range (Position::Above), per-session repeated_tool_calls, tool_errors, permission_denials, killed_work, non-zero destructive_commands incidence, and security > 0 Unaddressed findings holds. Omit lines of code, pooled cross-kind pass rates, context-free token totals, and raw standards/spec finding counts as quality proxies. Detect bucket boundaries where observed thirdshift_version (or Harness / Model under a filtered slice) changes and attach timeline transition markers.
  • Server-rendered Console presentation and drilldown (ADR 0018). Render /metrics through server-side HTML templates paired with static inline SVG/CSS stacked outcome bars, compact sparklines, preceding-window delta summaries, version-change markers, and a "Where runs failed" table. Style visuals exclusively with existing semantic Theme custom properties, zero client-side charting libraries, and zero motion, collapsing cleanly without horizontal page overflow at a 390px mobile viewport. Link failure counts, buckets, and "Where runs failed" rows to filtered History or Command detail views (forwarding --machine / machine= for reachable Fleet peers, and showing inline read-only summary rows when a pushed/cached peer is not reachable inbound). Update the generated user manual and hand-written site architecture/workflow pages where metrics and Fleet reporting are described.

Testing Decisions

  • Good tests assert observable behavior at public CLI, HTTP API, filesystem-artifact, and rendered-DOM boundaries—never internal helper shapes or private aggregation structs—and make zero real sleeps or live network calls to GitHub.
  • CLI and Command-lifecycle seam: test thirdshift_version and structured stopped_at / failure-category persistence on scripted Runs, historical service.version Session-trace recovery without re-parsing unchanged traces, Other-account Command inclusion, Pickup run wrapper exclusion versus pre-dispatch failure inclusion, died versus live separation, survivorship-safe succeeded-run duration/Repairs/CI-round math, first-pass clean rate, wasted-effort share, weekly Scores + confirmed Bug origins + kept pull-request survival with zero gh invocations, daily/weekly window presets and preceding-window deltas, and metrics --fleet / metrics --push + best-effort post-Command push (verifying offline targets warn without failing the Run). Prior art: existing CLI metrics, run-metrics, scoring, and failed-run integration suites.
  • Console HTTP, auth, and parity seam: test /metrics HTML versus local /api/v1/metrics JSON parity, route/OpenAPI/CLI inventory parity (including metrics --fleet and metrics --push reasoned exclusions), report token creation and enforcement (accepting holder-matching HTTPS/loopback snapshot uploads while rejecting cross-holder writes and every read/security/act/run/admin endpoint), Fleet fan-out merging with cached fallback when a paired Console stops answering, and URL-to-CLI filter equivalence. Prior art: Console metrics, API parity, Fleet, Cron jobs, token-scope, and other-accounts integration suites.
  • Console browser seam: test Metrics navigation and m keyboard jump, Fleet default versus single-machine selection, filter submissions, inline SVG/CSS bars, sparklines, and version markers across built-in/custom Themes with zero motion, 390px mobile layout fit alongside desktop layout, and one-click drilldown links from failure buckets and "Where runs failed" rows to History / Command details (plus graceful read-only display for pushed offline peers). Prior art: Playwright Console suites for Fleet, Cron jobs, Scores, and stage/lane time views.

Out of Scope

  • Centralized PostgreSQL or any external database/daemon dependency (rejected in Q2.1 and ADR 0026).
  • Any composite "factory health score" combining distinct signals into one number (rejected in Q1.2 and GLOSSARY.md).
  • Renaming live Command "health" (Slow / Silent) or moving live operational queues off Inbox, Cron jobs, and Resources (Q1.1, Q1.4).
  • Vanity metrics: lines of code, commit counts, pooled cross-kind pass rates, context-free token volume headlines, or raw standards/spec review-finding counts treated as quality scores (Q2.6).
  • Outbound worker push for live Inbox (status) and active Command control from NATted/sleeping machines (to be tracked as a separate follow-up issue building on report tokens, Q4.1).
  • Client-side JavaScript charting libraries or animated charts (Q3.2, ADR 0018).

Further Notes

Sub-issues

Sub-issues

5 of 5 Issues completed
Loading 5 sub-issues

Activity

  1. added
    enhancement
    ready-for-human
    on Nov 11, 2026
  2. added a commit that references this issue on Nov 11, 2026
  3. added
    needs-triage
    and removed
    ready-for-human
    on Nov 11, 2026
  4. changed the title [-]add thirdshift health view to console web ui[/-] [+]Spec: Console Metrics view for Run metrics, Fleet trends, and failure attribution[/+] on Nov 11, 2026
  5. added
    ready-for-agent
    and removed
    needs-triage
    on Nov 11, 2026
  6. added
    in-progress
    and removed
    ready-for-agent
    on Nov 12, 2026
  7. removed
    in-progress
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions