Loading...
Loading...
Apply a simple code transform via agent-booster's WASM engine — sub-millisecond, deterministic, $0 (no LLM call). Companion to cost-booster-route.
npx skill4agent add ruvnet/ruflo cost-booster-editagent-booster.apply()agent-boosteragentic-flow/agent-boostercost-booster-routevar → constadd-typesremove-consoleadd-error-handlingasync-awaitadd-loggingintentfileeditv3/agent-boosternode --input-type=module -e '
import("agent-booster")
.then(async ({ AgentBooster }) => {
const booster = new AgentBooster();
const r = await booster.apply({
code: process.argv[1],
edit: process.argv[2],
language: process.argv[3] || "javascript",
});
console.log(JSON.stringify({
success: r.success, output: r.output, latency: r.latency,
confidence: r.confidence, strategy: r.strategy,
tokens: r.tokens,
}));
})
.catch(e => console.log(JSON.stringify({ success: false, error: String(e.message) })));
' -- "$CODE" "$EDIT" "$LANG"0.5outputsuccess && confidence >= 0.5memory_store --namespace cost-tracking --key "booster-edit-..." --value '{"intent":..., "latency":..., "confidence":..., "strategy":..., "applied":true}'hooks_model-outcomecost-optimizeAgentBooster.apply()| intent | latency (ms) | wall (ms) | confidence | strategy | success |
|---|---|---|---|---|---|
| var-to-const | 5 | 5 | 0.65 | fuzzy_replace | true |
| add-types | 1 | 1 | 0.64 | fuzzy_replace | true |
| remove-console | 0 | 0 | 0.70 | fuzzy_replace | true |
| add-error-handling | 0 | 0 | 0.85 | exact_replace | true |
| async-await | 0 | 0 | 0.85 | exact_replace | true |
docs/benchmarks/0002-baseline.md| Claim | Status here |
|---|---|
| 100% win rate | Verified — 12/12 on |
| Sub-millisecond latency | Verified — avg 0.67 ms, p50 0 ms, p99 6 ms, max 6 ms. |
| $0 per edit | Verified structurally — no API call, no token billing. |
| Deterministic AST-based merge | Verified — same inputs reproduce the same |
| Confidence ≥ 0.5 ⇒ correct | Verified on this corpus — 12/12 above 0.5 (min 0.551), all correct. |
| Verified — exceeded against every tier: 1000.9× vs Gemini 2.0 Flash, 1838.7× vs Claude Sonnet 4.6, 2634.1× vs Claude Opus 4.7. Run |
| Cost saved per edit | Measured: $0.000020 vs Gemini, $0.000722 vs Sonnet 4.6, $0.004720 vs Opus 4.7 (the booster side is $0 in all cases). |
| Win parity with frontier LLMs | Verified — Booster, Gemini 2.0 Flash, Sonnet 4.6, Opus 4.7 all scored 12/12 on this corpus. Booster matches LLM accuracy structurally for deterministic transforms. |
bench/booster-corpus.json( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/bench.mjs )BENCH_LLM_BASELINE=1runs/latest.jsonBENCH_LLM_MODEL='claude-sonnet-4'api.anthropic.comBENCH_LLM_MODEL='models/gemini-2.5-flash'BENCH_LLM_PRICE_INBENCH_LLM_PRICE_OUTfuzzy_replaceexact_replacecost-booster-routeagent-booster