Skip to content

docs(quality): settle the cost model against the final billing - #2967

Merged
oscharko merged 5 commits into
devfrom
docs/settled-cost-model
Aug 3, 2026
Merged

docs(quality): settle the cost model against the final billing#2967
oscharko merged 5 commits into
devfrom
docs/settled-cost-model

Conversation

@oscharko

@oscharko oscharko commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The cost model (#2962) was written the morning after the expensive day, from readings taken while that day was still billing. The settled meters have since more than doubled it: the credit ledger read ~€96 at 45% materialization; the day closed at €212.62 (verified twice — Cost Management meters and the portal's period figure, which also shows the €130.00 monthly credit at €0.00 remaining). Three planning figures move, and this change corrects them with their derivations written inline:

  1. ~44k input tokens ≈ €0.07 per reviewed file, not 25k. The figure now reconciles three independent ways: 21 completed reviews of the incident change at 5.5–6M tokens each, 21 × ~5.7M + the day's small-change tail = the 133.1M the meters billed, and €212.62 / ~3,000 file reviews = €0.071. Carries the composition caveat: this is the settled average of a heavy, evidence-file-laden mix; no lighter day has settled yet.
  2. The 135-file row is now measured, not modelled: €8–13 per full review (cold cache €12–13, warm repeats €8–9, average €10.1 = €212.62 ÷ 21) — its previous range's floor divided the unsettled €96. The same change consumed essentially the whole 6M allotment, so the truncation threshold moves from "~240 files" to ~135 for heavy changes, and the distance between the two ceiling thresholds is now stated as a property of the change's weight rather than a constant.
  3. The cached/uncached split settled at 56.8M/12.49 € vs 76.3M/165.56 € — the earlier snapshot (7.4M vs 6.5M, cached ahead) inverted as billing completed. The long-context meter family (~€12.25, <6%) is acknowledged and explicitly not planned around.

Also added from production data of 2026-08-03, because the "later push" column was the store's best case presented as the typical case: the measured per-push range runs from a tenth of a first review (32 hits / 3 misses on 35 reviewable) to all of it (cache.context_invalidated: 12 → 19/19 misses on every push — the store working as designed once shared context moves). The troubleshooting entry's saturation warning is strengthened with the settled run counts (21 completed reviews of the incident change; 34 runs on a single branch in one day).

Out of scope: the activation record (docs/qa/keiko-for-quality.md) — its "twenty-one times" is settled-correct as history — and any workflow or config change.

Verification: npm run gates:sonar PASS on this diff; npx prettier --check clean on both files; every changed number cross-checked against the sources named above. Docs-only — no code, no exports, no release impact.

🤖 Generated with Claude Code

The first version was written from same-day readings; the settled meters
more than doubled the day (ledger ~96 EUR at 45% -> 212.62 EUR final).
Per-file moves from 25k to ~44k input tokens (~0.07 EUR) for a heavy mix,
the incident's 135-file change measured 5.5-6M tokens per full review --
at the 6M ceiling's edge, not the comfortable 3.4M previously claimed --
and the per-push cost range is now production-measured (a tenth to all
of a first review, set by context coupling).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 16:10 — with GitHub Actions Inactive
@keiko-for-quality

keiko-for-quality Bot commented Aug 3, 2026

Copy link
Copy Markdown

Keiko for Quality — run summary

✅ complete · head eee2e4f · 2026-08-03T18:23:17Z · engine v1.8.4 · action ec48db94d70d9a07d729d814ea405157652530be

Metric Count
Total paths 3
Reviewable 2
Excluded 1
Mechanically clean 0
Replayed from cache 1
Freshly reviewed 1
Findings published 0
Suppressed (exact duplicate) 0
Suppressed (similar) 0
Suppressed (dispositioned) 0

Budget: 113438 tokens allotted

@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 16:11 — with GitHub Actions Inactive
@oscharko
oscharko enabled auto-merge (squash) August 3, 2026 16:11
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@oscharko, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fb47154c-b902-4123-ba14-7fefdc2f69ff

📥 Commits

Reviewing files that changed from the base of the PR and between 41370eb and eee2e4f.

📒 Files selected for processing (3)
  • .github/workflows/keiko-for-quality.yml
  • docs/qa/review-cost-model.md
  • docs/troubleshooting/model-review-spend.md
📝 Walkthrough

Walkthrough

Changes

Review cost and spend documentation

Layer / File(s) Summary
Settled cost and review estimates
docs/qa/review-cost-model.md
The cost model now uses settled spending, measured token counts, revised per-file estimates, and updated cold and warmed review costs.
Review limits and cache behavior
docs/qa/review-cost-model.md
The document distinguishes allotment from truncation thresholds and adds measured later-push, provider-cache, and memoization results.
Run-count troubleshooting guidance
docs/troubleshooting/model-review-spend.md
The guidance states that twenty runs may be insufficient and cites completed reviews and branch-level run counts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the documentation changes but omits most required template sections, including scope, delivery, impact, risks, and review closure. Complete the required template sections and record issue, delivery-board, impact, risk, review, and verification details.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The description references issue #2962, which matches the documented cost-model scope.
Out of Scope Changes check ✅ Passed The changes are limited to the cost-model and troubleshooting documentation, consistent with the stated scope.
Title check ✅ Passed The title uses an imperative conventional subject and clearly names the delivered cost-model update against final billing.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/qa/review-cost-model.md`:
- Around line 162-164: Update the production-scale example in the review-cost
model documentation to reconcile the 36-file pull request with hits: 32 and
misses: 3: either identify the remaining non-reviewable file or change the
stated total to 35 reviewable files. Ensure the 91% coverage calculation uses 35
as its denominator.
- Around line 99-101: Update the cost-model statement in the paragraph around “A
push costs” to qualify the file-count claim: replace the absolute wording “not
by how many files it touches” with wording that says file count alone does not
determine cost, while preserving the surrounding explanation about coupling.
- Line 56: Update the cost calculation in the review-cost documentation so the
21-run average uses incident-only run-level spend, excluding the small-change
tail included in €212.62; if that data is unavailable, relabel €10.1 as a
daily-spend quotient rather than the average cost of one 135-file review.
- Around line 78-80: Update the heavy-change description in the cost model
documentation by replacing “cutting from about 135” with wording that states it
“truncates at about 135,” while preserving the surrounding threshold
explanation.

In `@docs/troubleshooting/model-review-spend.md`:
- Around line 71-72: Update the run-count guidance in the incident comment to
use conditional wording: replace the absolute “twenty is not enough” statement
with “twenty runs may not cover all completed reviews,” while preserving the
specific observations about twenty-one completed reviews and thirty-four runs on
one branch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dc29e814-5fff-4d90-ac98-8d5852b6b79b

📥 Commits

Reviewing files that changed from the base of the PR and between eb68af9 and 41370eb.

📒 Files selected for processing (2)
  • docs/qa/review-cost-model.md
  • docs/troubleshooting/model-review-spend.md
📜 Review details
⏰ Context from checks skipped due to timeout. (12)
  • GitHub Check: review
  • GitHub Check: ui
  • GitHub Check: Coverage shard (packages 2/3)
  • GitHub Check: Coverage shard (packages 3/3)
  • GitHub Check: Coverage suite (scripts)
  • GitHub Check: Build, scan, SBOM, smoke
  • GitHub Check: Core quality
  • GitHub Check: Coverage shard (packages 1/3)
  • GitHub Check: Coverage suite (keiko-ui)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx,mjs,cjs,json,md,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Use English only in code, comments, identifiers, documentation, commit messages, issues, and pull requests.

Files:

  • docs/troubleshooting/model-review-spend.md
  • docs/qa/review-cost-model.md
docs/troubleshooting/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Document operator failure modes using Symptom, Root Cause, Diagnostic Steps, and Resolution; keep the content redacted with no live endpoints or logs.

Files:

  • docs/troubleshooting/model-review-spend.md
🔇 Additional comments (1)
docs/qa/review-cost-model.md (1)

4-8: LGTM!

Also applies to: 18-26, 33-46, 113-113

Comment thread docs/qa/review-cost-model.md Outdated
Comment thread docs/qa/review-cost-model.md Outdated
Comment thread docs/qa/review-cost-model.md Outdated
Comment thread docs/qa/review-cost-model.md Outdated
Comment thread docs/troubleshooting/model-review-spend.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41370ebb0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/qa/review-cost-model.md Outdated
Comment thread docs/qa/review-cost-model.md Outdated
@oscharko
oscharko disabled auto-merge August 3, 2026 16:58
Review round: the 21-run average no longer divides the whole day by the
incident (the small-change tail and qualification runs are subtracted
first), later-push cost names both of its terms (direct misses plus
context invalidation), the 36-file example carries its reviewable count,
'cutting' becomes 'truncates', and the run-count guidance is scoped to
the incident it records.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 16:58 — with GitHub Actions Inactive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b65807c34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/qa/review-cost-model.md
@oscharko
oscharko disabled auto-merge August 3, 2026 17:04
The token_budget rationale in the workflow still carried the
pre-settlement numbers (240 files at 25k, 'larger than any change this
repository has produced') after the cost model moved to the settled
ones. Same numbers in both places now: the 135-file incident measured
5.5-6M per full review, so a heavy change meets the ceiling around 135.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 17:04 — with GitHub Actions Inactive
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 17:07 — with GitHub Actions Inactive
@oscharko
oscharko enabled auto-merge (squash) August 3, 2026 17:07
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 18:15 — with GitHub Actions Inactive
Comment thread .github/workflows/keiko-for-quality.yml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae06286ef8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/qa/review-cost-model.md Outdated
@oscharko
oscharko disabled auto-merge August 3, 2026 18:23
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 18:23 — with GitHub Actions Inactive
@oscharko
oscharko temporarily deployed to keiko-for-quality August 3, 2026 18:23 — with GitHub Actions Inactive
@oscharko
oscharko enabled auto-merge (squash) August 3, 2026 18:28
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@oscharko
oscharko merged commit fbd771a into dev Aug 3, 2026
29 checks passed
@oscharko
oscharko deleted the docs/settled-cost-model branch August 3, 2026 18:49
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.

1 participant