{% extends "base.html" %} {% block title %}Costs{% endblock %} {% block head %}{{ super() }} {% endblock %} {% block body %}

Costs

Spend over time, sliced by activity, difficulty, model, harness, phase, task and operator session — the same numbers garden costs prints for the same filters.

Filter
{% if since or bucket != 'day' or by != 'activity' or metric != 'total' or difficulty or model or harness or phase or product or task or session %}Clear{% endif %}
{% if metric == 'per_task' %}Average cost per participating task{% else %}Total cost{% endif %} over time, by {{ by }}
{{ chart|safe }}
{% from "_cost_comparisons.html" import comparisons with context %}
Cost comparisons for this cohort

These use the selected window and applicable task, model, harness and session filters. The spend-over-time chart above is the cost-by-activity view when grouped by activity.

{{ comparisons(comparison, f) }}
Breakdown
{% if series.groups %} {% for g in series.groups %}{% set row = series.totals[g] %} {% endfor %}
{{ by }}runsparticipating taskstotal costtaskless spendaverage/tasksharecache readscache writes
{{ g }}{{ row.runs }}{{ row.task_count }}{% if not row.cost_complete %}partial {% endif %}${{ '%.2f' % row.cost_usd }} {% if row.taskless_runs %}{% if row.taskless_unpriced_runs %}partial {% endif %}${{ '%.2f' % row.taskless_cost_usd }}{% else %}—{% endif %} {% if row.cost_per_task_usd is not none %}${{ '%.2f' % row.cost_per_task_usd }}{% else %}unavailable{% endif %} {% if row.share is not none %}{{ (row.share * 100)|round|int }}%{% endif %} {{ '{:,}'.format(row.cache_read_tokens) }} {{ '{:,}'.format(row.cache_write_tokens) }}

grand total: {% if not series.grand_total.cost_complete %}partial {% endif %}${{ '%.2f' % series.grand_total.cost_usd }} over {{ series.grand_total.runs }} run{{ 's' if series.grand_total.runs != 1 else '' }} and {{ series.grand_total.task_count }} participating task{{ 's' if series.grand_total.task_count != 1 else '' }}. Overall average: {% if series.grand_total.cost_per_task_usd is not none %}${{ '%.2f' % series.grand_total.cost_per_task_usd }} per participating task{% else %}unavailable{% endif %}.

{% if series.grand_total.taskless_runs %}

{{ series.grand_total.taskless_runs }} taskless run{{ 's' if series.grand_total.taskless_runs != 1 else '' }}{% if series.grand_total.taskless_cost_usd %} (${{ '%.2f' % series.grand_total.taskless_cost_usd }}){% endif %} is included in total cost and shown in the taskless-spend column, but excluded from per-task averages.

{% endif %}

The denominator is distinct task IDs with activity in this window and filter, not runs or lifetime completed tasks. Work and revise can have different task cohorts, so their cost ratio does not by itself measure rework.

{% else %}
No cost recorded yet for this filter.
{% endif %}
Accepted-task outcomes
{% set accepted = series.accepted %}

{{ accepted.accepted }} accepted task{{ 's' if accepted.accepted != 1 else '' }} · {{ accepted.priced_tasks }} priced · {{ accepted.unpriced_tasks }} unpriced · cost/accepted: {% if accepted.cost_per_accepted_task is not none %}${{ '%.2f' % accepted.cost_per_accepted_task }}{% else %}unavailable{% endif %}

Acceptance means a base-branch merge completed in the selected half-open time window. Its cost includes every task run through acceptance. A forced done status is not acceptance; one unpriced run makes the average unavailable.

{% if series.unattributed_operator.runs %}

Unattributed operator spend is shown separately: {% if series.unattributed_operator.unpriced_runs %}partial known spend {% endif %}${{ '%.2f' % series.unattributed_operator.cost_usd }} over {{ series.unattributed_operator.runs }} record{{ 's' if series.unattributed_operator.runs != 1 else '' }} ({{ series.unattributed_operator.priced_runs }} priced, {{ series.unattributed_operator.unpriced_runs }} unpriced).

{% endif %} {% for dimension, label in [('by_difficulty', 'tier'), ('by_model', 'model'), ('by_harness', 'harness'), ('by_pool_member', 'pool member')] %} {% set rows = outcomes[dimension] %} {% if rows %}

By {{ label }}

{% for value, row in rows.items() %}{% endfor %}
{{ label }}runsmean/runacceptedcost/acceptedfirst-pass approval
{{ value }}{{ row.runs }} {% if row.mean_cost_usd is not none %}${{ '%.2f' % row.mean_cost_usd }}{% endif %} {{ row.accepted }}{% if row.cost_per_accepted_task is not none %}${{ '%.2f' % row.cost_per_accepted_task }}{% endif %} {% if row.first_pass_rate is not none %}{{ (row.first_pass_rate * 100)|round|int }}%{% endif %}
{% endif %} {% endfor %}
{% endblock %}