Skip to content

Feature/0.0.0#3

Merged
Cro22 merged 4 commits into
masterfrom
feature/0.0.0
Jun 22, 2026
Merged

Feature/0.0.0#3
Cro22 merged 4 commits into
masterfrom
feature/0.0.0

Conversation

@Cro22

@Cro22 Cro22 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

Cro22 added 4 commits June 21, 2026 21:30
Record agent responses once against the real provider, then replay them
so CI re-runs the gate without spending tokens. Because replay
re-executes the AGENT against the recorded responses (not just the
trace), a cost regression from an agent code change still surfaces — for
free.

- cassette/: a record/replay store keyed by (scenario, run, seq), JSONL
  on disk so it is diffable and committable. Create truncates (a
  recording is a fresh capture); Load reads for replay; Lookup misses
  surface agent divergence.
- proxy/: Mode (live/record/replay) with Record/Replay setters. Record
  forwards and saves each response; replay serves from the cassette and
  never contacts the provider, regenerating an identical trace
  (latency/tokens preserved). A replay miss is a loud 502. seq is now
  assigned up front so record and replay key the cassette identically;
  usage extraction unified (extractUsage) so a buffered/replayed SSE body
  is costed exactly like the live stream.
- augur run: -record / -replay flags (mutually exclusive). Session
  defaults to empty in record/replay so run ids are stable and the
  cassette keys line up; live runs keep the timestamp default.

Tests: cassette round-trip / truncate / miss / malformed; proxy record-
then-replay with the provider shut down (identical trace, zero provider
calls via a failing transport), streaming record/replay, and replay
miss → 502. Verified end-to-end: recorded 6 calls, killed the provider,
replayed all 6, traces match.
Add multiplier knobs that re-cost a recorded trace under hypothetical
agentic cost drivers — no agent re-run, no tokens spent. This is the
systems/control-flow angle: the projection moves because a named driver
moved, not a flat fudge factor.

- cost/: factor out Breakdown (input/cached/output split) so the prompt
  side can be scaled independently of the completion. Cost now sums a
  Breakdown — behavior unchanged.
- aggregate/: Knobs{RetryRate, FanoutFactor, ContextGrowth} and
  AggregateWithKnobs. Retries and fan-out scale the whole call
  ((1+retry)*fanout); context growth scales only the prompt
  (input+cached). Per call: cost' = callMult*(growth*prompt + output).
  The zero Knobs is the identity, so Aggregate delegates to it.
- project/ + gate/: a WhatIf description line surfaces the applied knobs
  in the table and the Markdown report.
- augur project / augur gate: shared --retry-rate / --fanout /
  --context-growth flags. Gate against a pessimistic scenario, not just
  today's happy path.

Tests reconcile the knob math by hand (callMult and prompt-only context
growth), confirm context growth leaves a pure-output call unchanged,
cover Knobs identity, and verify the Breakdown components and that
Total equals Cost. Verified end-to-end: baseline vs what-if projection.
Self-hosted models have no per-token API price — you pay for an instance
by the hour. Derive the effective token price with the standard
benchmark-then-size calculation:

  $/Mtok = instance_$/hr x 1e6 / (tokens_per_sec x 3600 x utilization)

Utilization is the honest knob: you pay for the box 24/7 but it's rarely
saturated, and a half-idle instance doubles the effective price.

- tco/: parse + validate tco.yaml (deployments with instance cost,
  throughput, optional utilization defaulting to 1.0) and derive a
  cost.Pricing where input/output/cached all carry the effective rate
  (self-hosted compute is token-type-agnostic). Plus a table renderer.
- TCO is a pricing SOURCE, so the pipeline is untouched: a shared
  resolvePricing wires a -tco flag into aggregate/project/gate as an
  alternative to -pricing. New `augur tco` command shows the derived
  effective rates.
- examples/tco.yaml documents the format.

Tests reconcile the effective-rate math by hand ($36/hr, 2500 tok/s,
100% -> $4/Mtok; 50% util -> $8), cover validation (zero throughput,
bad utilization, empty config) and the derived Pricing. Verified
end-to-end: tco table + a trace re-costed against self-hosted pricing.
Ship Augur as a composite action that runs the gate on a pull request,
posts the report as a PR comment, and fails the check when the
projection is over budget. Combined with a committed cassette, the PR
check spends no tokens.

- action.yml: composite action — setup-go + build, optional cassette
  replay to regenerate the trace, `augur gate` (exit code captured so the
  comment posts before the job fails), upsert the report comment via
  actions/github-script (deduped by a hidden marker), then enforce the
  budget. Supports --pricing or --tco and pass-through extra-args
  (what-if knobs). Distinguishes an over-budget verdict (report written)
  from an internal error (no report) so CI failures are legible.
- .github/workflows/ci.yml: Augur's own build/vet/test on push + PR.
- examples/github-workflow.yml: a copy-paste consumer workflow.
- .gitignore: ignore the built binary and generated trace/report artifacts.
@Cro22
Cro22 merged commit 39f089e into master Jun 22, 2026
1 check passed
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