Skip to content

Studio: the cost engine — estimates, actuals and the 7-day total in the plan's unit #1059

In review

Description

@danielrispler

Parent

#1056

What to build

The cost engine as a pure module with no I/O: the factors from the trial as one constant (date, plan, run ids, citing docs/studio/research/run-cost.md), the plan ratios (Pro a fifth of Max's dollars per percent, Ultra's weekly percent twice Max's, no 5-hour window), the cost estimate from a list of records (First map per part from lines with units, other kinds per run, last 20 records, interquartile range, trial fallback under 3 records), a run's actual cost, and the 7-day total, each turned into the plan's unit: shares with "about" and "under 1%", dollars for an API key, dollars labelled API price for an unknown plan. Nothing calls it yet.

Acceptance criteria

  • One table test of the estimate covers each kind, too few records (trial fallback), First map lines without units, Ultra (no 5-hour share), API key (dollars), unknown plan (API price) and a share under 1%
  • A table test of the 7-day total over records: dismissed runs, other projects, missing costs, records older than 7 days
  • A table test of the unit conversion for each plan

Reading

Touches

  • Files: new server/src/run_cost.rs, server/src/lib.rs, new server/tests/run_cost.rs
  • Session: auto mode
  • Route: medium · effort medium — a new pure module, every rule settled by the spec, tested by tables

Activity

  1. added
    ready-for-agent
    on Dec 2, 2026
  2. danielrispler commented on Dec 2, 2026

    @danielrispler
    OwnerAuthor

    Built on the integration branch issue-1056-run-cost, PR #1071 (closes on merge).

    Route outcome: medium·medium claude/sonnet → pass | 14m

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

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions