feat(benchmark): deterministic cost/round-trip attribution + reproducible exhibit (#85, #86)#87
Merged
Conversation
…ible exhibit (#85, #86) Patent-support: quantify the resolve-before-context savings in dollars + round-trips for the §101 technical-effect argument. #85 — Per-call cost/round-trip metering: - plutus_agent/benchmark_cost.py: CallRecord / ApproachRun / attribute() model a benchmark run as metered model calls per approach (agentic baseline vs resolve-before-context). attribute() emits per-approach round-trips, tokens, and USD cost plus the reduction deltas (round-trips eliminated, % round-trips, $ saved, % cost). Cost uses Plutus's existing frozen PRICE_TABLE. - to_csv() / write_exhibit() export JSON + CSV the Perseus exhibit suite embeds. #86 — Reproducible cost-attribution exhibit: - Deterministic pricing path: cost is a pure function of the frozen price table (pricing.PRICE_TABLE_AS_OF) + token counts — no wall-clock, no network. attribute() and to_csv() are byte-identical for identical inputs; emit_exhibit() confines non-determinism to a single generated_at field that can be pinned. - docs/exhibits/SAMPLE-cost-attribution.{json,csv}: committed reproducible reference (6 round-trips -> 1 = 83.33% eliminated; $0.39 -> $0.12 = 69.23% cost reduction for the canonical six-directive task). - docs/benchmark-cost-attribution.md: integration + reproduction guide. Tests: tests/test_benchmark_cost.py (7 tests; exact cost math, determinism, round-trip counts, exhibit reproducibility). Full suite: 269 passed locally. Closes #85, closes #86.
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.
Patent-support: quantify resolve-before-context savings in dollars + round-trips for the §101 technical-effect argument. Closes #85, #86.
#85 — Per-call cost/round-trip metering
plutus_agent/benchmark_cost.py:CallRecord/ApproachRun/attribute()model a benchmark run as metered model calls per approach (agentic baseline vs resolve-before-context).attribute()emits per-approach round-trips, tokens, USD cost + reduction deltas. Uses Plutus's existing frozenPRICE_TABLE.to_csv()/write_exhibit()export the JSON + CSV the Perseus exhibit suite embeds.#86 — Reproducible cost-attribution exhibit
PRICE_TABLE_AS_OF) + token counts — no wall-clock, no network.attribute()/to_csv()are byte-identical for identical inputs;emit_exhibit()confines non-determinism to a single pinnablegenerated_atfield.docs/exhibits/SAMPLE-cost-attribution.{json,csv}:Verification
tests/test_benchmark_cost.py— 7 tests (exact cost math, determinism, round-trip counts, exhibit reproducibility).Closes #85, closes #86.