Commit Graph

4 Commits

Author SHA1 Message Date
ruv 0403a34279 feat(cost-tracker): wire codemod benchmark into cost-trend (ADR-143 follow-up)
The codemod benchmark now writes its run JSON (tagged summary.benchmark=
"codemod-tier1") into the cost-tracker plugin's runs dir — the exact path
cost-trend reads — instead of a stopgap repo-docs location. cost-trend is now
benchmark-aware: BENCH_NAME=codemod-tier1 shows the codemod series, while the
default trend keeps showing only legacy booster runs (untagged / "booster"),
so the two corpora never conflate.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-29 17:28:27 -04:00
Reuven 9c706d28a8 docs(cost-tracker): ADR-0003 + corpus v3 bench refresh (v0.16.0)
All 11 priorities from this session's implementation list are landed.
ADR-0003 documents the v0.4 → v0.15 arc — what shipped, what's
deferred (real MCP tool registration, upstream memory-store UNIQUE
fix, federation Phase 3 producer), and the riskiest assumptions.

Also persists the freshest measured bench (corpus v3, 25 cases, all
4 endpoints) — strongest verification yet:

| Endpoint        | Tier 1 | Adv  | Avg latency | Cost/edit  | Speedup |
|-----------------|--------|------|-------------|------------|---------|
| Booster (WASM)  | 18/18  | esc  | 0.36 ms     | $0         | —       |
| Gemini 2.0      | 18/18  | 3/7  | 807.56 ms   | $0.000028  | 2243×   |
| Sonnet 4.6      | 18/18  | 2/7  | 1270.64 ms  | $0.000933  | 3530×   |
| Opus 4.7        | 18/18  | 5/7  | 1563.72 ms  | $0.005943  | 4344×   |

New finding: Sonnet 4.6 only solves 2/7 adversarial cases — booster's
"correctly refuse" path beats Sonnet on routing-correctness, not just
speed.

Smoke step 8 now also verifies ADR-0002 + ADR-0003 are Accepted.

Cron c0b44f45 cancelled — implementation list complete.

Version: 0.15.0 → 0.16.0.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 00:16:16 -04:00
Reuven c16114659a feat(cost-tracker): P7 — corpus v3 expansion (16 → 25 cases) (v0.10.0)
Stronger verification — adds 6 Tier 1 + 3 adversarial cases.

Tier 1 added (booster should apply):
- var-to-let-1, double-quote-to-single, add-readonly-prop,
  remove-debugger, import-add-named, remove-trailing-semis

Adversarial added (booster should escalate):
- adversarial-extract-class (class delegation refactor)
- adversarial-callback-to-promise (control-flow rewrite)
- adversarial-deeply-nested-conditional (guard-clause flattening)

Live verified on the 25-case corpus:
- Tier 1 win rate: 100% (18/18)
- Escalation rate: 100% (7/7) — every adversarial case fell below
  0.5 confidence threshold, min 0.000
- Avg latency: 0.32 ms (improvement; new Tier 1 cases are simpler)
- Booster's qualitative win is unchanged: correct apply + correct
  refuse, faster than any LLM

Smoke step 24 now requires 18+ Tier 1, 6+ adversarial, 25+ total.

Corpus version: 2 → 3. Plugin: 0.9.0 → 0.10.0.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 00:01:17 -04:00
Reuven 0fd61e3e5b feat(cost-tracker): ADR-0002 — verified Agent Booster integration (v0.4.0)
Wires `npm agent-booster` (Tier 1, WASM, $0/edit, sub-millisecond) into
the cost-tracker plugin and proves the speedup against frontier LLMs
running on the deployed GCP endpoints — Gemini 2.0 Flash, Claude
Sonnet 4.6, and Claude Opus 4.7.

What lands:

- ADR-0002 (Accepted): 6 decisions covering booster routing, optimizer
  bridge, model-outcome feedback loop, loop-worker consumption,
  tier-aware reporting, and the version+keywords bump.
- 4 new skills: cost-booster-route (router-side classifier),
  cost-booster-edit (direct apply via agent-booster.apply()),
  cost-benchmark (corpus harness), cost-compact-context (token-optimizer
  bridge with graceful fallback).
- Updates to 2 existing skills: cost-optimize closes the
  hooks_model-outcome loop; cost-report now reads measured booster data
  from runs/latest.json and aggregates by tier.
- New `cost benchmark [--llm] [--anthropic]` subcommand.
- 16-case verification corpus (12 Tier 1 + 4 adversarial), bench.mjs
  harness with split metrics (winRate / escalationRate / overallCorrect)
  and gcloud-secret-aware LLM/Anthropic baselines.
- Smoke contract grew 10 → 27 checks, ~85 ms wall-time.

Verified live (16 cases, 4 endpoints, 2026-05-05):

  Endpoint            Tier 1   Adversarial   Avg latency   Cost/edit
  Booster (WASM)      12/12    escalates 4/4 0.50 ms       $0
  Gemini 2.0 Flash    12/12    3/4           762.13 ms     $0.000027
  Claude Sonnet 4.6   12/12    3/4           1158.06 ms    $0.000982
  Claude Opus 4.7     12/12    3/4           1517.94 ms    $0.006049

Measured speedups (booster vs LLM): 1524× / 2316× / 3036× — exceed
upstream's 350× claim against every endpoint. All three LLMs
(including Opus 4.7) failed on the same adversarial case; booster
correctly refused all four with min confidence 0.000.

Proof: https://github.com/ruvnet/ruflo/issues/1743
       https://gist.github.com/ruvnet/15fae7a5495026f025fb3baf721c20ea

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 23:35:52 -04:00