feat: cost ceilings on receipts from a dated, vendor-cited price snapshot — DSE-1514 round 3 of 4 - #65
Draft
ernestprovo23 wants to merge 6 commits into
Draft
Conversation
…oader (DSE-1514) Claude-Session: https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH
…manifest (DSE-1514) Claude-Session: https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH
…ing (DSE-1514) Claude-Session: https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH
…mat v5 (DSE-1514) Claude-Session: https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH
…ebate receipts cover every round; zero usage is not a cost (DSE-1514 QA C1/C2/I1)
QA C1 (Round 3 half): _price_manifest priced a usage-less receipt via a
flat reservation (prompt_template_token_allowance=4096,
upstream_output_token_ceilings=()) that ignores which phase the call
belongs to, so synthesis/judge/verdict/elite-revision receipts (which
embed upstream output) came out 3-9x low while unpriced_receipts stayed
0 and the run ceiling looked complete. usage is None on a SUCCESSFUL
call too (openai_compat.py returns None when a provider omits usage,
including some streams). This round has no phase-aware call plan to
reserve from, so the honest rule is: a receipt without reported usage
is unpriced (cost_ceiling_usd=None, cost_basis=None, counted in
unpriced_receipts, "unpriced_receipts_present" warning), and the run
ceiling is None (all-or-nothing). Removed the dead reservation branch
and its two flat constants from _price_manifest; a phase-aware
reservation returns in Round 4.
QA I1: an all-zero reported TokenUsage (usage: {} coerced to
TokenUsage(0, 0, 0)) is now treated as "no usage reported" via a new
_usage_is_reported() helper, never priced as $0.000000 -- that would
be a false floor, not a bound.
QA C2 (Critical): debate's manifest receipts were built from
result.answers (the final round only), so rounds 1..R-1 and any
dropped-out member had no receipt and the run ceiling covered a strict
subset of the calls actually made (4 of 7 at N=3/R=2) while reporting
complete. Added Council._build_debate_manifest, which builds one
receipt per answer per round, phase-stamped "round-{n}" (matching
_plan_table's existing debate-round phase naming so a Round 4
phase-aware reservation can map a receipt onto its plan row by plain
equality), in round order, before the debate_final consolidation
receipt is appended. providers_called/model_ids stay full resolved
membership, unchanged.
Claude-Session: https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH
Member
Author
Round 5 — QA / CSO status for this PR's scope (Round 3)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of DSE-1514 (bounded cost receipts) — Round 3 of 4: cost ceilings on receipts and the run manifest, from a dated, vendor-cited price snapshot. Builds on the Round 2 refactor (
conclave.pricing).Ceilings, never estimates.
estimated_coststaysNoneforever. Every number this PR emits is a falsifiable upper bound: reported usage × the snapshot's ceiling rate,Decimalonly,ROUND_CEILING, quantized to a micro-cent, stamped with the snapshot digest and date.PriceSnapshot(frozen,Decimal-only rates,source_urlper entry, digest namespaceconclave_product_prices_v1, staleness threshold 90 days).src/conclave/data/prices-2026-09-04.json+load_default_price_snapshot()(shipped in the wheel). 7 of 9 default models priced from official vendor pages, rounded up, sources cited;groq/llama-3.3-70b-versatile(enterprise-only since Aug 2026) anddeepseek/deepseek-chat(id retired 2026-07-24) are deliberately omitted → alwaysunpriced(follow-up: DSE-1537).cost_ceiling_usd/cost_basis(reported_usage|reservation); manifestcost_ceiling_usd,price_snapshot_digest,priced_as_of,unpriced_models,unpriced_receipts,pricing_warnings(fixed literals only — thesecret_safetystamp stays provable).Council._price_manifest— runs last on every path (all_cached_runbranches, both streamingdoneyields). All-or-nothing: one unpriceable receipt → run ceilingNonewith the reasons populated. Never a partial sum.CACHE_FORMAT_VERSION4 → 5 (old entries miss safely).Verification
None— never a low number; debate manifests carry one receipt per answer per round (round-{n}) beforedebate_final, so the ceiling covers every call made.docs/plans/2026-09-03-bounded-cost-receipts.mdTasks 4–8.Not in this PR
Round 4 (
max_output_tokens,plan_calls,--max-spend-usd, exit code 4) follows.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1dHPjZ1bZcE2GnX3KMMSH