Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-cost-tracker): 0.28.0, flag Grok list prices approximate

r3b58ab7de717
diff --git a/plugins/ruflo-cost-tracker/.claude-plugin/plugin.json b/plugins/ruflo-cost-tracker/.claude-plugin/plugin.json
index 6b48dadba1..55d008f6e3 100644
--- a/plugins/ruflo-cost-tracker/.claude-plugin/plugin.json
+++ b/plugins/ruflo-cost-tracker/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-cost-tracker",
"description": "Token usage tracking, model cost attribution per agent, budget alerts, and optimization recommendations β€” uses memory_* (namespace-routed) for cost-tracking and cost-patterns; pairs with federation budget circuit breaker (ADR-097)",
- "version": "0.27.2",
+ "version": "0.28.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
diff --git a/plugins/ruflo-cost-tracker/CHANGELOG.md b/plugins/ruflo-cost-tracker/CHANGELOG.md
index a4b414085d..e5158bf6c0 100644
--- a/plugins/ruflo-cost-tracker/CHANGELOG.md
+++ b/plugins/ruflo-cost-tracker/CHANGELOG.md
@@ -2,6 +2,10 @@
Newest first. One `## <version> β€” <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-cost-tracker`.
+## 0.28.0 β€” 2026-10-08
+- feat: read Grok CLI sessions (usage.json) into the cost ledger (`--provider grok`)
+- fix: Grok prices are list prices and are flagged approximate in the ledger output (subscription billing may differ)
+
## 0.27.2 β€” 2026-10-07
- fix: run the installed ruflo CLI before `npx @claude-flow/cli@latest` in cost-tracker, adr and metaharness
- chore: 3.55.0 versions, leaf pins, lockfiles, plugin bumps, changelog
diff --git a/plugins/ruflo-cost-tracker/README.md b/plugins/ruflo-cost-tracker/README.md
index fff9e8cf68..c999c261d9 100644
--- a/plugins/ruflo-cost-tracker/README.md
+++ b/plugins/ruflo-cost-tracker/README.md
@@ -47,6 +47,8 @@ claude --plugin-dir plugins/ruflo-cost-tracker
| `cost-summary` | `/cost-summary [--format json\|markdown]` | Single-shot programmatic dump of all cost data (stable JSON contract for inter-plugin consumption) |
| `cost-compact-context` | `/cost-compact-context <query>` | Wrap `getTokenOptimizer().getCompactContext()` for retrieval-compacted analysis (graceful fallback when agentic-flow not installed) |
+Grok prices are xAI list prices, not what a subscription bills; every Grok row is flagged **approximate** in the ledger output.
+
## Commands (23 subcommands)
```bash
diff --git a/plugins/ruflo-cost-tracker/data/prices.json b/plugins/ruflo-cost-tracker/data/prices.json
index b3513aaa1e..bb7a18f96f 100644
--- a/plugins/ruflo-cost-tracker/data/prices.json
+++ b/plugins/ruflo-cost-tracker/data/prices.json
@@ -22,8 +22,8 @@
{ "id": "grok-4.7-build", "provider": "grok", "match": "grok-4.7-build", "unit": "usd", "input": 4, "output": 12, "cache_read": 1, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” Grok 4.7 Fast (Cursor/Grok Build only), <200k prompt; subscription billing may differ from API list" },
{ "id": "grok-4.6-build", "provider": "grok", "match": "grok-4.6-build", "unit": "usd", "input": 4, "output": 12, "cache_read": 1, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” Grok Build Fast rates aligned with Grok 4.7 Fast (<200k); subscription billing may differ" },
- { "id": "grok-4.7", "provider": "grok", "match": "grok-4.7", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "source": "https://docs.x.ai/developers/pricing β€” grok-4.7 <200k prompt tokens" },
- { "id": "grok-4.6", "provider": "grok", "match": "grok-4.6", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "source": "https://docs.x.ai/developers/pricing β€” grok-4.6 <200k prompt tokens" },
+ { "id": "grok-4.7", "provider": "grok", "match": "grok-4.7", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” grok-4.7 <200k prompt tokens" },
+ { "id": "grok-4.6", "provider": "grok", "match": "grok-4.6", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "approx": true, "source": "https://docs.x.ai/developers/pricing β€” grok-4.6 <200k prompt tokens" },
{ "id": "grok", "provider": "grok", "match": "grok", "unit": "usd", "input": 2, "output": 6, "cache_read": 0.5, "approx": true, "source": "family fallback: grok-4.7 <200k list price from https://docs.x.ai/developers/pricing" }
],
"tiers": {
diff --git a/plugins/ruflo-cost-tracker/scripts/_pricebook.mjs b/plugins/ruflo-cost-tracker/scripts/_pricebook.mjs
index d81f53da96..6564637ddc 100644
--- a/plugins/ruflo-cost-tracker/scripts/_pricebook.mjs
+++ b/plugins/ruflo-cost-tracker/scripts/_pricebook.mjs
@@ -53,7 +53,7 @@ export function priceUsage(model, usage, provider) {
const w1 = entry.cache_write_1h ?? w5;
const cost = per(usage.input, entry.input) + per(usage.output, entry.output) + per(usage.cache_read, read)
+ per(usage.cache_write_5m, w5) + per(usage.cache_write_1h, w1);
- if (entry.approx) notes.push(`family fallback (${entry.id}): approximate`);
+ if (entry.approx) notes.push(`approximate price (${entry.id}): family fallback or list price`);
return { cost, unit: entry.unit, priced: true, approx: entry.approx === true, notes, entry };
}
diff --git a/plugins/ruflo-cost-tracker/scripts/ledger.mjs b/plugins/ruflo-cost-tracker/scripts/ledger.mjs
index c271c29bdb..7d32e3fefe 100644
--- a/plugins/ruflo-cost-tracker/scripts/ledger.mjs
+++ b/plugins/ruflo-cost-tracker/scripts/ledger.mjs
@@ -63,7 +63,7 @@ function markdown(summary, meta) {
for (const [provider, cache] of Object.entries(summary.cache)) lines.push('', `Cache hit ratio Β· ${provider}: ${cache.hitRatio === null ? 'n/a' : `${(cache.hitRatio * 100).toFixed(1)}%`}`);
const dark = Object.entries(summary.unpriced);
if (dark.length > 0) lines.push('', `Unpriced (NOT counted as $0): ${dark.map(([model, u]) => `${model} (${u.messages} msgs)`).join(', ')} β€” add them to data/prices.json`);
- if (summary.approx.length > 0) lines.push('', `Approximate (family fallback price): ${summary.approx.join(', ')}`);
+ if (summary.approx.length > 0) lines.push('', `Approximate (family fallback or list price; Grok subscription billing may differ): ${summary.approx.join(', ')}`);
lines.push('', 'Claude output tokens come from the transcript, which can under-count streamed output; /usage is authoritative for the live session.');
return lines.join('\n');
diff --git a/plugins/ruflo-cost-tracker/scripts/smoke.sh b/plugins/ruflo-cost-tracker/scripts/smoke.sh
index 8e8fdfe30e..eefbd47e5c 100755
--- a/plugins/ruflo-cost-tracker/scripts/smoke.sh
+++ b/plugins/ruflo-cost-tracker/scripts/smoke.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Structural smoke test for ruflo-cost-tracker v0.27.2.
+# Structural smoke test for ruflo-cost-tracker v0.28.0.
set -u
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
PASS=0
@@ -8,10 +8,10 @@ step() { printf "β†’ %s ... " "$1"; }
ok() { printf "PASS\n"; PASS=$((PASS+1)); }
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
-step "1. plugin.json declares 0.27.2 with new keywords"
+step "1. plugin.json declares 0.28.0 with new keywords"
v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
-if [[ "$v" != "0.27.2" ]]; then
- bad "expected 0.27.2, got '$v'"
+if [[ "$v" != "0.28.0" ]]; then
+ bad "expected 0.28.0, got '$v'"
else
miss=""
for k in namespace-routing mcp agentic-flow agent-booster tier1-routing model-routing benchmarking verified telemetry budget projection forecast counterfactual drift-detection trend-alert anomaly-detection outlier-detection health-check composite-gate auto-track stop-hook snapshot-diff pr-regression git-context traceability drill-down per-message; do