Skip to content

Insights is the analytics surface: fold the costs and graph surfaces into it, add the budget lever and trend lines #181

Description

@edgehero

What

Issue #175 added insights ON TOP of the costs and graph surfaces, so the deployment now answers the same two questions in five places: the COSTS view (c), the GRAPH view (g), /dispatch costs, /dispatch graph [html], and /dispatch insights html. That is four surfaces too many for one story. Insights should BE the analytics surface, not sit beside its parents. And two things the page still lacks: the budget caps are the operator's only real lever on cost, so the page that shows what everything costs must also show the dial; and trends read better as lines than as one column chart.

Change

  • Remove the COSTS and GRAPH dashboard views and their keys, refresh policies, and renderers. The dashboard returns to four views; a new i key writes and opens the insights page (overlay closes, artifact opens, panel reopens).
  • Remove the costs and graph subcommands. insights is the umbrella, and the artifact is the answer everywhere:
    • bare /dispatch insights [7d|30d|mtd] [--no-open] [--full-paths] writes AND opens the page (no html verb; insights html answers usage rather than half-working);
    • /dispatch insights whatif <provider/model> --flow <flow> carries the what-if forward (the interactive w layer dies with the COSTS view);
    • no plain-text form: over SSH the artifact still writes and the file:// URL still prints, and dispatch_costs remains the machine-readable path.
  • dispatch_costs stays. It returns the cost fold only; a model-callable insights tool stays off the table (topology assembly spawns git per folder).
  • Budgets join the page (no replacement of the existing surfaces). A budget panel beside the spend data: reserved-vs-cap facts for the day/week/month job-slot windows and the daily token counter, states computed by the worker's own classifier and carried as words, an overlay-unset cap rendering as unknown or off with no bar and no invented denominator, and the lever named (/dispatch set dailyCap …, the panel's s). Display stays GET-only: observing the budget never consumes a slot.
  • Line charts in the cost section: per-flow daily spend as small multiples (one panel per top flow, one shared dollar scale, dashed segments over estimated days, series identity carried by the panel title, never by hue), plus a cumulative window-spend mini chart under the daily columns (its own scale, never a second axis on one plot).
  • The pure layers stay whole: foldCosts (gains a dailyByFlow series), buildGraphModel, buildGraphScene, buildGraphHtml and their suites are what insights is made of. graph.html itself no longer ships; REQ-GRAPH-HTML-EXPORT's discipline lives on under REQ-INSIGHTS-HTML-EXPORT, the ID kept as an address.
  • Specs in the same PRs: REQ-ADMIN-VIA-PI-EXTENSION, REQ-COST-ANALYTICS and REQ-TOPOLOGY-GRAPH restate their surfaces (labeling and honesty rules untouched), DES-ADMIN-VIA-PI-EXTENSION drops to four views, OQ-024 rescopes to the insights export.
  • READMEs tell one analytics story: the insights screenshot, the graph close-up kept as topology art, the standalone costs screenshot gone, and the dashboard mock's footer gains i insights and loses c costs.

Explicitly NOT proposed

  • Removing the folds or the artifact emitters. Only the duplicate operator surfaces go.
  • A model-callable insights tool. Unchanged posture.
  • Burn-down or "remaining" arithmetic anywhere: the budget panel renders used-vs-cap facts, and an unknown cap draws no bar (the meter doctrine, applied to the page).
  • Touching enforcement: the budget read stays GET-only, and the caps keep being checked where they always were.

Acceptance

/dispatch costs and /dispatch graph answer unknown-subcommand usage; c and g are inert and the footer advertises i insights instead; i opens the page and the panel returns; bare /dispatch insights writes and opens the artifact and insights html answers usage; insights whatif behaves as costs whatif did; dispatch_costs unchanged; the page gains the budget panel (facts only, states as words, no bar without a known cap) and the two line-chart forms (dashed over estimated days); the suite is green with the COSTS/GRAPH view tests replaced, not silently dropped where they pinned fold or renderer behaviour; both READMEs carry one analytics story.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions