Skip to content

feat(ci): eval cost self-reporting rates + E-3a diagnostic record#1017

Merged
BigSimmo merged 3 commits into
mainfrom
claude/clinical-kb-pwa-review-asi3wb
Jul 21, 2026
Merged

feat(ci): eval cost self-reporting rates + E-3a diagnostic record#1017
BigSimmo merged 3 commits into
mainfrom
claude/clinical-kb-pwa-review-asi3wb

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Phase E-3a delivery (issue I8 from the approved plan) plus the wave's diagnostic record.

  • Cost self-reporting: eval-canary.yml gains the three RAG_EVAL_*_USD_PER_MILLION env rates (gpt-5.6-terra standard tier — input $2.50 / cached $0.25 / output $15.00 per 1M — verified from the live OpenAI pricing page 2026-07-21), so estimated_cost_usd in eval summaries stops reading n/a in CI. The comment documents it as a lower bound: the strong model (gpt-5.6-sol) costs 2× and the estimator applies one rate set. Public list prices, not secrets; no behaviour change to any eval.
  • E-3a diagnostics banked in the ledger row: the discarded-generation histogram (fast-fails-extractive-wins ×6 dominates), the route-ceiling root cause (routeCeilingExceeded keys on the runtime's own route_budget_ms, not the cross-region eval gates), and the fixture↔corpus MHSP naming-drift triage — the corpus has zero MHSP* files; the alias tier bridges most cases; the three expected-doc failures split into one real retrieval-coverage gap (protected path, awaiting explicit go-ahead) and two labeling-vs-ranking decisions (presented to the user; no fixture/alias edits in this PR — ground truth needs sign-off).

RAG impact: no retrieval behaviour change — env rates + documentation only; no eval gates, fixtures, aliases, or retrieval code touched.

Verification

  • npm run check:github-actions — pass
  • npm run check:ci-scope — pass
  • npm run check:gate-manifest — pass
  • npx prettier --check on both files — clean
  • Supabase access during E-3a was read-only (documents/document_chunks SELECTs); no live mutations anywhere

Risk and rollout

  • Risk: minimal — three env vars consumed only by the eval cost estimator (scripts/eval-utils.ts:236-238); unset ⇒ prior n/a behaviour, set ⇒ arithmetic on token counts. No gate reads them.
  • Rollback: revert.
  • Provider or production effects: none from this diff.

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use — no behaviour change
  • No patient-identifiable document workflow was introduced or expanded
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy) — read-only access only
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked: no clinical decision-support behaviour changed — cost telemetry only

🤖 Generated with Claude Code

https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Evaluation canary reports estimated costs in USD using configured input, output, and cached-input rates.
  • Documentation

    • Added a review record documenting evaluation diagnostics, instrumentation updates, gate outcomes, and triage notes.

Sets the three RAG_EVAL_*_USD_PER_MILLION env rates in eval-canary
(gpt-5.6-terra standard tier, verified from the OpenAI pricing page
2026-07-21) so estimated_cost_usd stops reading n/a in CI summaries.
Documented as a lower bound: the strong model costs 2x and the estimator
applies one rate set. Ledger row records the completed E-3a diagnostics:
discarded-generation histogram, the route-ceiling root cause, and the
fixture-corpus MHSP naming drift triage (no fixture/alias edits - ground
truth changes await user sign-off).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9
@supabase

supabase Bot commented Jul 21, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 21, 2026 00:05
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 21, 2026 00:05
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The eval-canary workflow now defines input, cached-input, and output USD token rates for cost estimation. The branch review ledger records the associated instrumentation update and Phase E-3a diagnostic findings.

Changes

Eval cost instrumentation

Layer / File(s) Summary
Configure and record eval cost rates
.github/workflows/eval-canary.yml, docs/branch-review-ledger.md
The canary defines token pricing environment variables, and the review ledger records the Phase E-3a instrumentation and diagnostic results.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately reflects the CI cost-rate update and E-3a diagnostic record.
Description check ✅ Passed The description follows the template with summary, verification, risk, and clinical governance sections filled in.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/clinical-kb-pwa-review-asi3wb

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

@BigSimmo
BigSimmo merged commit c308fdc into main Jul 21, 2026
17 checks passed
@BigSimmo
BigSimmo deleted the claude/clinical-kb-pwa-review-asi3wb branch July 21, 2026 00:16
BigSimmo pushed a commit that referenced this pull request Jul 22, 2026
…ed (#14)

The 44-case eval:quality report printed 'Estimated cost USD: n/a' even with
the RAG_EVAL_*_USD_PER_MILLION rates set (PR #1017): every extractive or
unsupported case makes no provider call, its per-case estimate was null, and
the all-or-nothing total nulled on any null case. A no-usage case costs
exactly $0 when rates are configured — null stays reserved for
rates-unconfigured, so the total keeps meaning 'cannot estimate'. Aggregation
pin added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXsJcLrbZUXwnBeG91cVo9
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