Skip to content

docs: add costs-and-checks.md, one home for the run summary and the measured costs - #298

Merged
goldbarth merged 1 commit into
mainfrom
docs/costs-and-checks
Sep 30, 2026
Merged

goldbarth merged 1 commit into
mainfrom
docs/costs-and-checks

Conversation

@goldbarth

Copy link
Copy Markdown
Owner

Follows #292, which made preview free and shows the calls and prompt characters generate would send.

  • Why: reading a run's cost lived in docs/run-metrics.md, the measured costs in chartula-evals and in pieces of providers.md, and nothing said how to size a run before paying for it. docs/costs-and-checks.md is the one home for all of it: the run summary, both checks, whether the thorough check earns its tokens, estimating cost, comparing run records, and a dated summary of the model comparison.
  • Before a run: the page opens with the size preview shows, and turns its prompt characters into a token estimate (characters / 4, doubled with the thorough check). The divisor rests on the bound in CallValidity.cs, and the page checks it against a real case: 90,489 characters of prompt for ServiceDeskLite v1.9.0, against 21,293 rephrasing tokens in the run of 2026-09-25.
  • Every example is from a real run, not written by hand: the full summary, the retried and the unreadable check, and the check turned off are copied from the chartula.log files of the ServiceDeskLite sweep in chartula-evals (preview.3; the summary code for that case is unchanged since then). The preview output was run on 2026-09-30 with main on the same range. The two jq commands ran against three run records of that sweep. Paths anonymized to /work/my-repo.
  • The lower bound line has no real run to quote, since no provider in the sweep left usage unreported. The page gives its wording from RunReportFormatter.cs in the table instead of inventing an output block.
  • Measurements, dated and sourced: cost, duration and flags per model and thinking level, render × check, the thorough check off, title-only and the local models, from sweeps/servicedesklite-v1.9.0-evaluation.md and -stats/report.md, with the evaluation's own limits (three runs per cell, one release, a flag count says nothing about text quality) and links to the report and the charts. No prices: the page gives the formula and links the price lists. The Anthropic comparison runs are named as pending.
  • Single source: run-metrics.md is deleted and every link to it points to the new page (README, chartula.example.yaml, cli.md, configuration.md, run-record.md, what-goes-into-a-release.md, architecture.md). providers.md keeps its model notes and recommendations in two sentences and links here for the figures; the local-model details and the 62%/4× figures moved here. The one remaining figure there (about 11,000 tokens per call) links its source.
  • Recommendations are stated as of 2026-09-25 and only as far as the data carries them: keep the thorough check on (it was the only check that caught anything), start with thinking: disabled, check with the steadier model, render with the cheaper one if your own reading holds up.
  • README: the index row for Run metrics becomes Costs and checks under "Understanding the output". The README cost table was already gone since docs: turn the README into a landing page #279.
  • Left for later steps: the troubleshooting parts carried over from run-metrics.md (slow run, unreadable check, cut prompt) stay here until troubleshooting.md takes them; run-record.md keeps its purpose section until it becomes schema only.

Verified:

  • Every figure was compared against cells.csv and the evaluation text; each number in the page traces to one of them or to a run log.
  • Every relative link and anchor in all Markdown files of the repository resolves (script, with a negative test for a missing file and a missing anchor). The four chartula-evals links point to files that exist on its main.
  • No code, comment or message changed.

Tests: none, documentation only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No


Generated by Claude Code

…easured costs

Replaces docs/run-metrics.md. Adds sizing a run with preview, estimating
cost from its characters, comparing run records with jq, and a dated
summary of the model comparison in chartula-evals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No
@goldbarth goldbarth self-assigned this Sep 30, 2026
@goldbarth
goldbarth merged commit d9d2388 into main Sep 30, 2026
4 checks passed
@goldbarth
goldbarth deleted the docs/costs-and-checks branch September 30, 2026 14:01
goldbarth added a commit that referenced this pull request Sep 30, 2026
…n stops (#299)

Follows #298, which added `docs/costs-and-checks.md`, the page this one
takes the diagnosis sections from.

- **Why:** the messages a run stops with were spread over `cli.md`,
`github.md`, `configuration.md`, `what-goes-into-a-release.md` and
`run-metrics.md`, each explained where its topic lives, but nothing let
a user start from the message. `docs/troubleshooting.md` is that entry:
message, cause, fix, with a link to the page that explains more.
- **It opens with `chartula doctor`,** which finds most of the setup and
range situations before anything is spent, and says which ones it cannot
find (a spent rate limit, a first tag, everything that only shows once
the model writes a whole release).
- **The situations:** no model key; GitHub cannot read the repository
(404); a rejected token (401); a token that cannot publish, which stops
`generate` before its first model call (#285); the rate limit, with and
without a token; a configuration error; a shallow clone; a first tag
without a terminal; a failed model call by status (404, 401 with and
without a key, 403), an unreachable endpoint, and an answer the SDK
cannot read, kept apart from an unreachable one (#288); an answer that
does not match the facts; an answer cut off at `maxOutputTokens`; a
context window too small; a thorough check that verified nothing; a slow
run, read from the progress lines (#297) and the run summary.
- **Every message is from a real run of the built binary,** in a scratch
repository, with GitHub and the model served by a local stub (a mode per
case: 404, 401, rate limit with `x-ratelimit-remaining: 0`, 403 with
`x-accepted-github-permissions`, model 404/401, an unknown
`finish_reason`, a reported prompt of 120 tokens, prose instead of a
verdict, a cut answer, a 4 s delay per call). Paths are anonymized to
`/work/my-repo`, the stub's address to `https://api.github.com/` and
`http://localhost:11434/v1`. The line after `The endpoint said:` came
from the stub, so the page shows it as `...` and says its wording
depends on the provider. The slow run's summary is the real local run
from the chartula-evals sweep already used in #298.
- **One home per explanation:** a message appears here and, where it has
one, on the page that explains its topic; the explanation itself stays
there and is linked. From `cli.md`, the status-by-status account of a
failed model call and the missing-key example move here and are replaced
by links. From `costs-and-checks.md`, the three diagnosis sections (slow
run, unreadable check, cut prompt) move here; the summary page keeps a
short list of the lines that point to a problem, each linking its
section.
- **A message corrected on the way:** the warning without a GitHub token
said a run spends "roughly one [request] per pull request". It spends
one per commit in the range, as `docs/github.md` says, so a release
merged with merge commits was underestimated. The class comment also
still claimed that an exhausted limit fails with a 403 naming a commit;
the run names the rate limit (`GitHubErrorResponse.cs`). Both are
corrected in `GitHubTokenNotice.cs`.
- **README:** Troubleshooting joins the "Setting it up" index;
`getting-started.md` links it under "Next".

**Verified:**
- Every case ran with the binary built from this branch; the outputs
match the page, and the corrected no-token warning was rerun after the
fix.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).
- `dotnet build -c Release` without warnings, `dotnet format
--verify-no-changes` clean.

Tests: full suite passing (920), no test changed; no test asserts the
warning's wording.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No

---
_Generated by [Claude
Code](https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No)_

Co-authored-by: Claude <[email protected]>
goldbarth added a commit that referenced this pull request Oct 1, 2026
)

Follows #298, which explained the `lower bound` line of the run summary
from its wording in `RunReportFormatter.cs` only.

- **Why:** every other line of the summary on `costs-and-checks.md` is
shown as a run prints it; `lower bound` was described but never shown,
so a reader could not recognize it in their own output.
- **Shown where the other unusual lines are,** under "Lines that point
to a problem", after the thorough check without calls: what the line
means, an output block from a real run, and what to do with such a run.
- **The block is from an endpoint that reports no usage at all,** the
case where the summary says least: every count is zero and all four
calls are unreported. The sentence after it says the summary is then no
measure of the cost, names the provider's usage page instead, and links
`callsWithoutUsage` in the run record.

**Verified:**
- The block is from `generate --no-publish` with the binary from `main`,
against a scratch repository and local GitHub and model stubs on
127.0.0.1, the model stub answering without a `usage` object: two
renderings and two thorough checks, `lower bound, 4 of 4 calls
unreported`.
- Every relative link and anchor in all Markdown files of the repository
resolves (script, with a negative test).

Tests: none, documentation only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants