jonah-fleet 1.33.0 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +280 -43
- package/dist/lib/telemetry.d.ts +30 -0
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/terminal-card.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/prompts/ORCHESTRATION.md +5 -1
- package/templates/prompts/optimizer.md +23 -13
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to `jonah-fleet` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.34.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.33.0...v1.34.0) (2026-10-03)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **optimizer:** harden prompt optimizer and orchestration against token leaks ([#635](https://github.com/Jonah-Projects/jonah-fleet/issues/635)) ([9671650](https://github.com/Jonah-Projects/jonah-fleet/commit/9671650983499fd3517c242d8bb082e4b85a4475))
|
|
14
|
+
|
|
8
15
|
## [1.33.0](https://github.com/Jonah-Projects/jonah-fleet/compare/v1.32.0...v1.33.0) (2026-10-03)
|
|
9
16
|
|
|
10
17
|
|
|
@@ -34,6 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
41
|
* **telemetry,runner,terminal-card,status:** report token consumption and 5-hour/weekly quota percentages on each run, terminal summary card, run report, status pacing section, and persist run usage to artifacts
|
|
35
42
|
* **telemetry,terminal-card,runner:** address peer review findings on PR #617: prioritize artifact timestamp over file mtime, prevent pacing status cross-contamination across rolling windows, render token quota section in error cards, and consolidate canonical `RunUsageMetrics`
|
|
36
43
|
* **runner,daemon:** scope skill discovery by routine to eliminate context bloat, add fast-path merge mode for approved PRs with green CI, and calibrate `peer-review` and `optimizer` to `gemini-3.8-flash-medium`
|
|
44
|
+
* **terminal-card,telemetry:** streamline terminal summary cards by displaying I/O ratio directly on token line, suppressing redundant/alarmist synthetic rolling token limits when real provider plan quota is present, and hiding untouched 100% provider quotas
|
|
45
|
+
* **optimizer,telemetry,prompts:** harden prompt optimizer and orchestration routines against token leaks with Context Asymmetry, Unilateral Re-Review Thrash, Multi-Routine Cannibalization, and Plan Quota Burn Velocity anomaly heuristics, local run artifact ingestion, and I/O ratio scorecard tracking
|
|
37
46
|
|
|
38
47
|
### Bug Fixes
|
|
39
48
|
|
package/dist/index.js
CHANGED
|
@@ -1461,6 +1461,23 @@ import pc from "picocolors";
|
|
|
1461
1461
|
var execFileAsync2 = promisify2(execFile2);
|
|
1462
1462
|
var GLOBAL_WEEKLY_TOKEN_BUDGET = 875e4;
|
|
1463
1463
|
var GLOBAL_5H_TOKEN_BUDGET = 2e6;
|
|
1464
|
+
var TOKEN_ANOMALY_THRESHOLDS = {
|
|
1465
|
+
CONTEXT_ASYMMETRY_RATIO: 35,
|
|
1466
|
+
CONTEXT_ASYMMETRY_MIN_INPUT_TOKENS: 5e4,
|
|
1467
|
+
BUDGET_HOG_PERCENT: 75,
|
|
1468
|
+
MULTI_ROUTINE_CANNIBALIZATION_PERCENT: 80,
|
|
1469
|
+
MULTI_ROUTINE_MIN_ROUTINES: 3,
|
|
1470
|
+
ITERATION_EXHAUSTION_PERCENT: 20,
|
|
1471
|
+
PLAN_QUOTA_WEEKLY_WARNING_PERCENT: 30,
|
|
1472
|
+
PLAN_QUOTA_WEEKLY_CRITICAL_PERCENT: 20,
|
|
1473
|
+
PLAN_QUOTA_5H_CRITICAL_PERCENT: 20,
|
|
1474
|
+
RE_REVIEW_THRASH_THRESHOLD: 2
|
|
1475
|
+
};
|
|
1476
|
+
function formatIoRatio(inputTokens, outputTokens, precision = 0) {
|
|
1477
|
+
const safeOut = Math.max(1, outputTokens);
|
|
1478
|
+
const ratio = inputTokens / safeOut;
|
|
1479
|
+
return `${ratio.toFixed(precision)}:1`;
|
|
1480
|
+
}
|
|
1464
1481
|
function formatQuotaStatusBadge(status) {
|
|
1465
1482
|
if (status === "HEALTHY") return pc.green("[HEALTHY]");
|
|
1466
1483
|
if (status === "WARNING") return pc.yellow("[WARNING]");
|
|
@@ -1782,30 +1799,39 @@ function formatPlanQuotaSummary(quota, options = {}) {
|
|
|
1782
1799
|
}
|
|
1783
1800
|
const parts = [];
|
|
1784
1801
|
const fmt = (pct) => options.markdown ? `\`${pct.toFixed(1)}% remaining\`` : `${pct.toFixed(1)}% remaining`;
|
|
1802
|
+
const geminiUnused = (quota.gemini5hRemainingPct === void 0 || quota.gemini5hRemainingPct === 100) && (quota.geminiWeeklyRemainingPct === void 0 || quota.geminiWeeklyRemainingPct === 100);
|
|
1803
|
+
const claudeUnused = (quota.claude5hRemainingPct === void 0 || quota.claude5hRemainingPct === 100) && (quota.claudeWeeklyRemainingPct === void 0 || quota.claudeWeeklyRemainingPct === 100);
|
|
1804
|
+
const allProvidersUnused = geminiUnused && claudeUnused;
|
|
1805
|
+
const shouldDisplayGemini = !options.hideUnused || !geminiUnused || allProvidersUnused;
|
|
1806
|
+
const shouldDisplayClaude = !options.hideUnused || !claudeUnused;
|
|
1785
1807
|
if (quota.gemini5hRemainingPct !== void 0 || quota.geminiWeeklyRemainingPct !== void 0) {
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1808
|
+
if (shouldDisplayGemini) {
|
|
1809
|
+
const subParts = [];
|
|
1810
|
+
if (quota.gemini5hRemainingPct !== void 0) {
|
|
1811
|
+
subParts.push(`Gemini 5h: ${fmt(quota.gemini5hRemainingPct)}`);
|
|
1812
|
+
}
|
|
1813
|
+
if (quota.geminiWeeklyRemainingPct !== void 0) {
|
|
1814
|
+
const label = quota.gemini5hRemainingPct !== void 0 ? "Weekly" : "Gemini Weekly";
|
|
1815
|
+
subParts.push(`${label}: ${fmt(quota.geminiWeeklyRemainingPct)}`);
|
|
1816
|
+
}
|
|
1817
|
+
if (subParts.length > 0) {
|
|
1818
|
+
parts.push(subParts.join(" \xB7 "));
|
|
1819
|
+
}
|
|
1796
1820
|
}
|
|
1797
1821
|
}
|
|
1798
1822
|
if (quota.claude5hRemainingPct !== void 0 || quota.claudeWeeklyRemainingPct !== void 0) {
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1823
|
+
if (!options.hideUnused || !claudeUnused) {
|
|
1824
|
+
const subParts = [];
|
|
1825
|
+
if (quota.claude5hRemainingPct !== void 0) {
|
|
1826
|
+
subParts.push(`Claude/GPT 5h: ${fmt(quota.claude5hRemainingPct)}`);
|
|
1827
|
+
}
|
|
1828
|
+
if (quota.claudeWeeklyRemainingPct !== void 0) {
|
|
1829
|
+
const label = quota.claude5hRemainingPct !== void 0 ? "Weekly" : "Claude/GPT Weekly";
|
|
1830
|
+
subParts.push(`${label}: ${fmt(quota.claudeWeeklyRemainingPct)}`);
|
|
1831
|
+
}
|
|
1832
|
+
if (subParts.length > 0) {
|
|
1833
|
+
parts.push(subParts.join(" \xB7 "));
|
|
1834
|
+
}
|
|
1809
1835
|
}
|
|
1810
1836
|
}
|
|
1811
1837
|
return parts.join(options.markdown ? "<br>" : "\n");
|
|
@@ -1876,6 +1902,17 @@ function parseLogToTelemetry(content, options = {}) {
|
|
|
1876
1902
|
);
|
|
1877
1903
|
questionsAskedCount = questionLines.length > 0 ? questionLines.length : 2;
|
|
1878
1904
|
}
|
|
1905
|
+
let targetPr;
|
|
1906
|
+
const rawTarget = metadata["target"] || metadata["target / context"] || metadata["pr"];
|
|
1907
|
+
if (rawTarget) {
|
|
1908
|
+
const prMatch = rawTarget.match(/PR\s*#?(\d+)/i);
|
|
1909
|
+
if (prMatch) targetPr = parseInt(prMatch[1], 10);
|
|
1910
|
+
}
|
|
1911
|
+
let commitSha = metadata["commit"] || metadata["commit sha"] || metadata["head sha"] || metadata["sha"];
|
|
1912
|
+
if (!commitSha) {
|
|
1913
|
+
const shaMatch = content.match(/(?:commit|head\s+sha|head\s+commit)[:\s]+`?([0-9a-f]{7,40})`?/i);
|
|
1914
|
+
if (shaMatch) commitSha = shaMatch[1];
|
|
1915
|
+
}
|
|
1879
1916
|
return {
|
|
1880
1917
|
schemaVersion: "1.0.0",
|
|
1881
1918
|
routine,
|
|
@@ -1896,7 +1933,9 @@ function parseLogToTelemetry(content, options = {}) {
|
|
|
1896
1933
|
promptSha,
|
|
1897
1934
|
ambiguityGateTriggered: ambiguityGateTriggered || void 0,
|
|
1898
1935
|
questionsAskedCount,
|
|
1899
|
-
needsInfoApplied: needsInfoApplied || void 0
|
|
1936
|
+
needsInfoApplied: needsInfoApplied || void 0,
|
|
1937
|
+
targetPr,
|
|
1938
|
+
commitSha
|
|
1900
1939
|
};
|
|
1901
1940
|
}
|
|
1902
1941
|
function checkWeeklyBudgetLimit(usedTokens, ceilingTokens = GLOBAL_WEEKLY_TOKEN_BUDGET) {
|
|
@@ -2059,15 +2098,72 @@ function collectLocalTelemetryLogs(dir, repositoryName = "local") {
|
|
|
2059
2098
|
const traverse = (currentDir) => {
|
|
2060
2099
|
if (!fs6.existsSync(currentDir)) return;
|
|
2061
2100
|
const entries = fs6.readdirSync(currentDir, { withFileTypes: true });
|
|
2101
|
+
const filesByBase = /* @__PURE__ */ new Map();
|
|
2062
2102
|
for (const entry of entries) {
|
|
2063
|
-
const fullPath = path6.join(currentDir, entry.name);
|
|
2064
2103
|
if (entry.isDirectory()) {
|
|
2065
|
-
traverse(
|
|
2066
|
-
} else if (entry.isFile()
|
|
2104
|
+
traverse(path6.join(currentDir, entry.name));
|
|
2105
|
+
} else if (entry.isFile()) {
|
|
2106
|
+
if (entry.name.endsWith(".md")) {
|
|
2107
|
+
const base = entry.name.slice(0, -3);
|
|
2108
|
+
const current = filesByBase.get(base) || {};
|
|
2109
|
+
current.md = path6.join(currentDir, entry.name);
|
|
2110
|
+
filesByBase.set(base, current);
|
|
2111
|
+
} else if (entry.name.endsWith(".json")) {
|
|
2112
|
+
const base = entry.name.slice(0, -5);
|
|
2113
|
+
const current = filesByBase.get(base) || {};
|
|
2114
|
+
current.json = path6.join(currentDir, entry.name);
|
|
2115
|
+
filesByBase.set(base, current);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
for (const [, paths] of filesByBase) {
|
|
2120
|
+
let parsed = false;
|
|
2121
|
+
if (paths.json) {
|
|
2067
2122
|
try {
|
|
2068
|
-
const content = fs6.readFileSync(
|
|
2123
|
+
const content = fs6.readFileSync(paths.json, "utf8");
|
|
2124
|
+
const data = JSON.parse(content);
|
|
2125
|
+
if (data.routine && data.timestamp) {
|
|
2126
|
+
const inTokens = data.usage?.inputTokens ?? data.usage?.input_tokens ?? data.inputTokens ?? 0;
|
|
2127
|
+
const outTokens = data.usage?.outputTokens ?? data.usage?.output_tokens ?? data.outputTokens ?? 0;
|
|
2128
|
+
const totTokens = data.usage?.totalTokens ?? data.usage?.total_tokens ?? data.totalTokens ?? inTokens + outTokens;
|
|
2129
|
+
const durationSec = data.durationMs ? Math.round(data.durationMs / 1e3) : data.durationSeconds ?? void 0;
|
|
2130
|
+
const result = data.result ?? (data.success === true ? "SUCCESS" : data.success === false ? "FAILURE" : "UNKNOWN");
|
|
2131
|
+
const targetPr = data.pr ?? data.targetPr ?? (typeof data.target === "string" ? data.target.match(/PR\s*#?(\d+)/i)?.[1] ? parseInt(data.target.match(/PR\s*#?(\d+)/i)[1], 10) : void 0 : void 0);
|
|
2132
|
+
const commitSha = data.commitSha ?? data.headRefOid ?? data.headSha ?? (typeof data.commit === "string" ? data.commit : data.commit?.oid);
|
|
2133
|
+
summaries.push({
|
|
2134
|
+
schemaVersion: "1.0.0",
|
|
2135
|
+
routine: data.routine,
|
|
2136
|
+
repository: repositoryName,
|
|
2137
|
+
timestamp: data.timestamp,
|
|
2138
|
+
result,
|
|
2139
|
+
errorReason: data.errorReason || data.error,
|
|
2140
|
+
failureCategory: data.failureCategory,
|
|
2141
|
+
inputTokens: inTokens,
|
|
2142
|
+
outputTokens: outTokens,
|
|
2143
|
+
totalTokens: totTokens,
|
|
2144
|
+
estimatedCost: data.estimatedCost ?? totTokens / 1e6 * 0.35,
|
|
2145
|
+
durationSeconds: durationSec,
|
|
2146
|
+
iterationsUsed: data.iterationsUsed,
|
|
2147
|
+
maxIterations: data.maxIterations,
|
|
2148
|
+
ambiguityGateTriggered: Boolean(data.ambiguityGateTriggered),
|
|
2149
|
+
questionsAskedCount: data.questionsAskedCount || 0,
|
|
2150
|
+
needsInfoApplied: Boolean(data.needsInfoApplied),
|
|
2151
|
+
targetPr,
|
|
2152
|
+
commitSha
|
|
2153
|
+
});
|
|
2154
|
+
parsed = true;
|
|
2155
|
+
}
|
|
2156
|
+
} catch {
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
if (!parsed && paths.md) {
|
|
2160
|
+
try {
|
|
2161
|
+
const content = fs6.readFileSync(paths.md, "utf8");
|
|
2069
2162
|
const summary = parseLogToTelemetry(content, { repository: repositoryName });
|
|
2070
|
-
if (summary)
|
|
2163
|
+
if (summary) {
|
|
2164
|
+
summaries.push(summary);
|
|
2165
|
+
parsed = true;
|
|
2166
|
+
}
|
|
2071
2167
|
} catch {
|
|
2072
2168
|
}
|
|
2073
2169
|
}
|
|
@@ -2159,6 +2255,129 @@ function renderProgressBar(percentage, width = 25) {
|
|
|
2159
2255
|
if (clamped >= 70) return pc.yellow(filledBar) + pc.gray(emptyBar);
|
|
2160
2256
|
return pc.green(filledBar) + pc.gray(emptyBar);
|
|
2161
2257
|
}
|
|
2258
|
+
function detectTokenAnomalies(telemetry, options = {}) {
|
|
2259
|
+
const anomalies = [];
|
|
2260
|
+
for (const [routineName, r] of Object.entries(telemetry.byRoutine)) {
|
|
2261
|
+
const ratio = r.totalInputTokens / Math.max(1, r.totalOutputTokens);
|
|
2262
|
+
if (ratio > TOKEN_ANOMALY_THRESHOLDS.CONTEXT_ASYMMETRY_RATIO && r.totalInputTokens > TOKEN_ANOMALY_THRESHOLDS.CONTEXT_ASYMMETRY_MIN_INPUT_TOKENS) {
|
|
2263
|
+
anomalies.push({
|
|
2264
|
+
type: "context_asymmetry",
|
|
2265
|
+
severity: "WARNING",
|
|
2266
|
+
routine: routineName,
|
|
2267
|
+
message: `Context Asymmetry on '${routineName}': Input/Output ratio is ${formatIoRatio(r.totalInputTokens, r.totalOutputTokens, 1)} (${r.totalInputTokens.toLocaleString()} input vs ${r.totalOutputTokens.toLocaleString()} output tokens).`,
|
|
2268
|
+
remediation: `Apply progressive disclosure and skill pruning. Scope skills strictly per routine rather than injecting all skills globally.`
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (telemetry.totalTokens > 0) {
|
|
2273
|
+
for (const [routineName, r] of Object.entries(telemetry.byRoutine)) {
|
|
2274
|
+
const share = r.totalTokens / telemetry.totalTokens * 100;
|
|
2275
|
+
if (share > TOKEN_ANOMALY_THRESHOLDS.BUDGET_HOG_PERCENT && Object.keys(telemetry.byRoutine).length > 1) {
|
|
2276
|
+
anomalies.push({
|
|
2277
|
+
type: "budget_hog",
|
|
2278
|
+
severity: "CRITICAL",
|
|
2279
|
+
routine: routineName,
|
|
2280
|
+
message: `Budget Hog on '${routineName}': Consumes ${share.toFixed(1)}% of total fleet token allowance.`,
|
|
2281
|
+
remediation: `Throttle dispatch cadence, introduce stricter pre-qualification filters, or add early exit guards.`
|
|
2282
|
+
});
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
if (telemetry.totalTokens > 0 && Object.keys(telemetry.byRoutine).length >= TOKEN_ANOMALY_THRESHOLDS.MULTI_ROUTINE_MIN_ROUTINES) {
|
|
2287
|
+
const sortedRoutines = Object.values(telemetry.byRoutine).sort(
|
|
2288
|
+
(a, b) => b.totalTokens - a.totalTokens
|
|
2289
|
+
);
|
|
2290
|
+
const top2Spend = (sortedRoutines[0]?.totalTokens || 0) + (sortedRoutines[1]?.totalTokens || 0);
|
|
2291
|
+
const top2Share = top2Spend / telemetry.totalTokens * 100;
|
|
2292
|
+
if (top2Share > TOKEN_ANOMALY_THRESHOLDS.MULTI_ROUTINE_CANNIBALIZATION_PERCENT) {
|
|
2293
|
+
anomalies.push({
|
|
2294
|
+
type: "multi_routine_cannibalization",
|
|
2295
|
+
severity: "WARNING",
|
|
2296
|
+
message: `Multi-Routine Budget Cannibalization: Top 2 routines ('${sortedRoutines[0]?.routine}' and '${sortedRoutines[1]?.routine}') consume ${top2Share.toFixed(1)}% of fleet tokens.`,
|
|
2297
|
+
remediation: `Rebalance dispatch pacing and coordinate candidate skips across authoring and review routines.`
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
const prShaEvaluations = /* @__PURE__ */ new Map();
|
|
2302
|
+
for (const e of telemetry.events || []) {
|
|
2303
|
+
if (e.targetPr && e.commitSha) {
|
|
2304
|
+
const key = `${e.targetPr}:${e.commitSha}`;
|
|
2305
|
+
const existing = prShaEvaluations.get(key);
|
|
2306
|
+
if (existing) {
|
|
2307
|
+
existing.count++;
|
|
2308
|
+
} else {
|
|
2309
|
+
prShaEvaluations.set(key, { pr: e.targetPr, sha: e.commitSha, count: 1, routine: e.routine });
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
for (const { pr, sha, count, routine } of prShaEvaluations.values()) {
|
|
2314
|
+
if (count >= TOKEN_ANOMALY_THRESHOLDS.RE_REVIEW_THRASH_THRESHOLD) {
|
|
2315
|
+
anomalies.push({
|
|
2316
|
+
type: "unilateral_rereview_thrash",
|
|
2317
|
+
severity: "WARNING",
|
|
2318
|
+
routine,
|
|
2319
|
+
message: `Unilateral Re-Review Thrash on PR #${pr}: Evaluated ${count} times on identical commit SHA ${sha.slice(0, 7)} without intervening commits.`,
|
|
2320
|
+
remediation: `Enforce persistent review commit state and failure cooldowns (e.g. daemon.json review state cache).`
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
for (const [routineName, r] of Object.entries(telemetry.byRoutine)) {
|
|
2325
|
+
if (r.runCount >= 3) {
|
|
2326
|
+
const tokenLimitFailures = (telemetry.events || []).filter(
|
|
2327
|
+
(e) => e.routine === routineName && e.failureCategory === "token_limit"
|
|
2328
|
+
).length;
|
|
2329
|
+
const failPct = tokenLimitFailures / r.runCount * 100;
|
|
2330
|
+
if (failPct > TOKEN_ANOMALY_THRESHOLDS.ITERATION_EXHAUSTION_PERCENT) {
|
|
2331
|
+
anomalies.push({
|
|
2332
|
+
type: "iteration_exhaustion",
|
|
2333
|
+
severity: "WARNING",
|
|
2334
|
+
routine: routineName,
|
|
2335
|
+
message: `Iteration Ceiling Exhaustion on '${routineName}': ${failPct.toFixed(1)}% of runs terminate at max iteration/token limit.`,
|
|
2336
|
+
remediation: `Decompose tasks vertically into smaller slices and tighten pre-ready self-audits.`
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
if (options.actualQuota?.available) {
|
|
2342
|
+
const geminiWeekly = options.actualQuota.geminiWeeklyRemainingPct;
|
|
2343
|
+
const gemini5h = options.actualQuota.gemini5hRemainingPct;
|
|
2344
|
+
if (geminiWeekly !== void 0 && geminiWeekly < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_WARNING_PERCENT) {
|
|
2345
|
+
anomalies.push({
|
|
2346
|
+
type: "plan_quota_velocity",
|
|
2347
|
+
severity: geminiWeekly < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_CRITICAL_PERCENT ? "CRITICAL" : "WARNING",
|
|
2348
|
+
message: `Plan Quota Burn Velocity: Gemini weekly plan quota is at ${geminiWeekly.toFixed(1)}% remaining (<${TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_WARNING_PERCENT}% threshold).`,
|
|
2349
|
+
remediation: `Downgrade auxiliary routines ('peer-review', 'optimizer') to medium reasoning effort and standard Flash models (gemini-3.8-flash-medium).`
|
|
2350
|
+
});
|
|
2351
|
+
}
|
|
2352
|
+
if (gemini5h !== void 0 && gemini5h < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_5H_CRITICAL_PERCENT) {
|
|
2353
|
+
anomalies.push({
|
|
2354
|
+
type: "plan_quota_velocity",
|
|
2355
|
+
severity: "CRITICAL",
|
|
2356
|
+
message: `Plan Quota Burn Velocity: Gemini 5h rolling plan quota is at ${gemini5h.toFixed(1)}% remaining (<${TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_5H_CRITICAL_PERCENT}% threshold).`,
|
|
2357
|
+
remediation: `Throttle active agent execution to prevent rate limit lockout during the current 5-hour window.`
|
|
2358
|
+
});
|
|
2359
|
+
}
|
|
2360
|
+
const claudeWeekly = options.actualQuota.claudeWeeklyRemainingPct;
|
|
2361
|
+
const claude5h = options.actualQuota.claude5hRemainingPct;
|
|
2362
|
+
if (claudeWeekly !== void 0 && claudeWeekly < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_WARNING_PERCENT) {
|
|
2363
|
+
anomalies.push({
|
|
2364
|
+
type: "plan_quota_velocity",
|
|
2365
|
+
severity: claudeWeekly < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_CRITICAL_PERCENT ? "CRITICAL" : "WARNING",
|
|
2366
|
+
message: `Plan Quota Burn Velocity: Claude/GPT weekly plan quota is at ${claudeWeekly.toFixed(1)}% remaining (<${TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_WEEKLY_WARNING_PERCENT}% threshold).`,
|
|
2367
|
+
remediation: `Conserve Claude/GPT quota for complex architectural reasoning; route standard tasks to Gemini Flash.`
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2370
|
+
if (claude5h !== void 0 && claude5h < TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_5H_CRITICAL_PERCENT) {
|
|
2371
|
+
anomalies.push({
|
|
2372
|
+
type: "plan_quota_velocity",
|
|
2373
|
+
severity: "CRITICAL",
|
|
2374
|
+
message: `Plan Quota Burn Velocity: Claude/GPT 5h rolling plan quota is at ${claude5h.toFixed(1)}% remaining (<${TOKEN_ANOMALY_THRESHOLDS.PLAN_QUOTA_5H_CRITICAL_PERCENT}% threshold).`,
|
|
2375
|
+
remediation: `Throttle active agent execution to prevent Claude/GPT rate limit lockout during the current 5-hour window.`
|
|
2376
|
+
});
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
return anomalies;
|
|
2380
|
+
}
|
|
2162
2381
|
function renderTelemetryDashboard(telemetry, options = {}) {
|
|
2163
2382
|
if (options.json) {
|
|
2164
2383
|
return JSON.stringify(telemetry, null, 2);
|
|
@@ -2187,8 +2406,9 @@ function renderTelemetryDashboard(telemetry, options = {}) {
|
|
|
2187
2406
|
lines.push("\n" + pc.bold("\u{1F916} Spend by Agent Routine:"));
|
|
2188
2407
|
for (const [routineName, r] of Object.entries(telemetry.byRoutine)) {
|
|
2189
2408
|
const costStr = pc.green(`$${r.totalEstimatedCost.toFixed(2)}`);
|
|
2409
|
+
const ioRatioStr = formatIoRatio(r.totalInputTokens, r.totalOutputTokens);
|
|
2190
2410
|
lines.push(
|
|
2191
|
-
` \u2022 ${pc.cyan(routineName.padEnd(30))} Runs: ${pc.bold(r.runCount.toString().padStart(2))} | Tokens: ${pc.bold(formatTokens(r.totalTokens).padStart(7))} | Cost: ${costStr.padStart(6)} | Avg Iter: ${r.avgIterationsUsed.toFixed(1)}`
|
|
2411
|
+
` \u2022 ${pc.cyan(routineName.padEnd(30))} Runs: ${pc.bold(r.runCount.toString().padStart(2))} | Tokens: ${pc.bold(formatTokens(r.totalTokens).padStart(7))} | I/O: ${ioRatioStr.padStart(5)} | Cost: ${costStr.padStart(6)} | Avg Iter: ${r.avgIterationsUsed.toFixed(1)}`
|
|
2192
2412
|
);
|
|
2193
2413
|
}
|
|
2194
2414
|
if (Object.keys(telemetry.byRepository).length > 0) {
|
|
@@ -2213,6 +2433,15 @@ function renderTelemetryDashboard(telemetry, options = {}) {
|
|
|
2213
2433
|
lines.push(
|
|
2214
2434
|
` \u2022 Est. Wasted Tokens Averted: ~${pc.bold(pc.green(formatTokens(amb.estimatedTokensSaved)))} tokens (avoided speculative builds)`
|
|
2215
2435
|
);
|
|
2436
|
+
const anomalies = detectTokenAnomalies(telemetry, { actualQuota: options.actualQuota });
|
|
2437
|
+
if (anomalies.length > 0) {
|
|
2438
|
+
lines.push("\n" + pc.bold(pc.yellow("\u{1F6A8} Detected Token & Pacing Anomalies:")));
|
|
2439
|
+
for (const anom of anomalies) {
|
|
2440
|
+
const badge = anom.severity === "CRITICAL" ? pc.red("[CRITICAL]") : pc.yellow("[WARNING]");
|
|
2441
|
+
lines.push(` ${badge} ${anom.message}`);
|
|
2442
|
+
lines.push(pc.gray(` \u21B3 Remediation: ${anom.remediation}`));
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2216
2445
|
const failKeys = Object.keys(telemetry.failureCategories);
|
|
2217
2446
|
if (failKeys.length > 0) {
|
|
2218
2447
|
lines.push("\n" + pc.bold(pc.red("\u26A0\uFE0F Failure Categories Breakdown:")));
|
|
@@ -3176,29 +3405,37 @@ function renderTokenQuotaSection(options) {
|
|
|
3176
3405
|
const lines = [];
|
|
3177
3406
|
lines.push(border(`\u251C${horizontal}\u2524`));
|
|
3178
3407
|
if (hasUsage) {
|
|
3179
|
-
const quota = calculateTokenQuotaPercentages(total);
|
|
3180
3408
|
const breakdown = formatTokenBreakdown(options.usage, "prefix");
|
|
3181
|
-
const
|
|
3409
|
+
const inTok = options.usage?.inputTokens;
|
|
3410
|
+
const outTok = options.usage?.outputTokens;
|
|
3411
|
+
let ioStr = "";
|
|
3412
|
+
if (typeof inTok === "number" && typeof outTok === "number" && outTok > 0) {
|
|
3413
|
+
ioStr = ` \xB7 I/O: ${formatIoRatio(inTok, outTok)}`;
|
|
3414
|
+
}
|
|
3415
|
+
const tokenLine1 = ` Tokens: ${pc2.bold(total.toLocaleString())}${breakdown ? pc2.dim(` (${breakdown})`) : ""}${ioStr ? pc2.cyan(ioStr) : ""}`;
|
|
3182
3416
|
lines.push(border("\u2502") + tokenLine1 + " ".repeat(Math.max(1, width - 2 - stripAnsi(tokenLine1).length)) + border("\u2502"));
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
const
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3417
|
+
if (!hasPlan) {
|
|
3418
|
+
const quota = calculateTokenQuotaPercentages(total);
|
|
3419
|
+
const tokenLine2 = ` \u21B3 ${pc2.cyan(quota.pctOf5hLimit.toFixed(2) + "% of 5h limit")} \xB7 ${pc2.cyan(quota.pctOfWeeklyLimit.toFixed(2) + "% of weekly limit")}`;
|
|
3420
|
+
lines.push(border("\u2502") + tokenLine2 + " ".repeat(Math.max(1, width - 2 - stripAnsi(tokenLine2).length)) + border("\u2502"));
|
|
3421
|
+
if (options.repoRoot) {
|
|
3422
|
+
try {
|
|
3423
|
+
const rolling = getRollingWindowTokenUsage(options.repoRoot);
|
|
3424
|
+
if (rolling.windowTokens > 0 || rolling.weeklyTokens > 0) {
|
|
3425
|
+
const badge5h = formatQuotaStatusBadge(rolling.windowStatus);
|
|
3426
|
+
const badgeWeekly = formatQuotaStatusBadge(rolling.weeklyStatus);
|
|
3427
|
+
const rollingLine1 = ` Rolling 5h: ${rolling.windowTokens.toLocaleString()} / ${rolling.windowLimit.toLocaleString()} tokens (${rolling.windowPercentage.toFixed(1)}% \xB7 ${badge5h})`;
|
|
3428
|
+
lines.push(border("\u2502") + rollingLine1 + " ".repeat(Math.max(1, width - 2 - stripAnsi(rollingLine1).length)) + border("\u2502"));
|
|
3429
|
+
const rollingLine2 = ` Rolling 7d: ${rolling.weeklyTokens.toLocaleString()} / ${rolling.weeklyLimit.toLocaleString()} tokens (${rolling.weeklyPercentage.toFixed(1)}% \xB7 ${badgeWeekly})`;
|
|
3430
|
+
lines.push(border("\u2502") + rollingLine2 + " ".repeat(Math.max(1, width - 2 - stripAnsi(rollingLine2).length)) + border("\u2502"));
|
|
3431
|
+
}
|
|
3432
|
+
} catch {
|
|
3195
3433
|
}
|
|
3196
|
-
} catch {
|
|
3197
3434
|
}
|
|
3198
3435
|
}
|
|
3199
3436
|
}
|
|
3200
3437
|
if (hasPlan && plan) {
|
|
3201
|
-
const summary = formatPlanQuotaSummary(plan);
|
|
3438
|
+
const summary = formatPlanQuotaSummary(plan, { hideUnused: true });
|
|
3202
3439
|
if (summary && summary !== "Plan Quota: Unavailable") {
|
|
3203
3440
|
const summaryLines = summary.split("\n");
|
|
3204
3441
|
for (let i = 0; i < summaryLines.length; i++) {
|
package/dist/lib/telemetry.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { GhExecutor } from './fleet-query.js';
|
|
2
2
|
export declare const GLOBAL_WEEKLY_TOKEN_BUDGET = 8750000;
|
|
3
3
|
export declare const GLOBAL_5H_TOKEN_BUDGET = 2000000;
|
|
4
|
+
export declare const TOKEN_ANOMALY_THRESHOLDS: {
|
|
5
|
+
readonly CONTEXT_ASYMMETRY_RATIO: 35;
|
|
6
|
+
readonly CONTEXT_ASYMMETRY_MIN_INPUT_TOKENS: 50000;
|
|
7
|
+
readonly BUDGET_HOG_PERCENT: 75;
|
|
8
|
+
readonly MULTI_ROUTINE_CANNIBALIZATION_PERCENT: 80;
|
|
9
|
+
readonly MULTI_ROUTINE_MIN_ROUTINES: 3;
|
|
10
|
+
readonly ITERATION_EXHAUSTION_PERCENT: 20;
|
|
11
|
+
readonly PLAN_QUOTA_WEEKLY_WARNING_PERCENT: 30;
|
|
12
|
+
readonly PLAN_QUOTA_WEEKLY_CRITICAL_PERCENT: 20;
|
|
13
|
+
readonly PLAN_QUOTA_5H_CRITICAL_PERCENT: 20;
|
|
14
|
+
readonly RE_REVIEW_THRASH_THRESHOLD: 2;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Formats input and output token numbers into a human-readable I/O ratio string (e.g. "35:1").
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatIoRatio(inputTokens: number, outputTokens: number, precision?: number): string;
|
|
4
20
|
export interface RunUsageMetrics {
|
|
5
21
|
totalTokens?: number;
|
|
6
22
|
inputTokens?: number;
|
|
@@ -58,6 +74,13 @@ export interface ActualPlanQuota {
|
|
|
58
74
|
fetchedAt: string;
|
|
59
75
|
error?: string;
|
|
60
76
|
}
|
|
77
|
+
export interface TokenAnomalyReport {
|
|
78
|
+
type: 'context_asymmetry' | 'unilateral_rereview_thrash' | 'budget_hog' | 'multi_routine_cannibalization' | 'plan_quota_velocity' | 'token_surge' | 'iteration_exhaustion';
|
|
79
|
+
severity: 'WARNING' | 'CRITICAL';
|
|
80
|
+
routine?: string;
|
|
81
|
+
message: string;
|
|
82
|
+
remediation: string;
|
|
83
|
+
}
|
|
61
84
|
/**
|
|
62
85
|
* Formats a styled quota status badge.
|
|
63
86
|
*/
|
|
@@ -106,6 +129,7 @@ export declare function fetchActualPlanQuota(options?: {
|
|
|
106
129
|
*/
|
|
107
130
|
export declare function formatPlanQuotaSummary(quota: ActualPlanQuota, options?: {
|
|
108
131
|
markdown?: boolean;
|
|
132
|
+
hideUnused?: boolean;
|
|
109
133
|
}): string;
|
|
110
134
|
export interface RoutineTelemetrySummary {
|
|
111
135
|
schemaVersion: '1.0.0';
|
|
@@ -129,6 +153,8 @@ export interface RoutineTelemetrySummary {
|
|
|
129
153
|
ambiguityGateTriggered?: boolean;
|
|
130
154
|
questionsAskedCount?: number;
|
|
131
155
|
needsInfoApplied?: boolean;
|
|
156
|
+
targetPr?: number;
|
|
157
|
+
commitSha?: string;
|
|
132
158
|
}
|
|
133
159
|
export interface WeeklyBudgetStatus {
|
|
134
160
|
weeklyCeilingTokens: number;
|
|
@@ -204,7 +230,11 @@ export declare function collectRepoTelemetry(repoIdentifier: string, executor?:
|
|
|
204
230
|
maxLogs?: number;
|
|
205
231
|
now?: number;
|
|
206
232
|
}): Promise<RoutineTelemetrySummary[]>;
|
|
233
|
+
export declare function detectTokenAnomalies(telemetry: AggregatedTelemetry, options?: {
|
|
234
|
+
actualQuota?: ActualPlanQuota;
|
|
235
|
+
}): TokenAnomalyReport[];
|
|
207
236
|
export declare function renderTelemetryDashboard(telemetry: AggregatedTelemetry, options?: {
|
|
208
237
|
json?: boolean;
|
|
238
|
+
actualQuota?: ActualPlanQuota;
|
|
209
239
|
}): string;
|
|
210
240
|
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AAIjE,eAAO,MAAM,0BAA0B,UAAY,CAAC;AACpD,eAAO,MAAM,sBAAsB,UAAY,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IAC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Q,CAAC,EAAE,MAAM,EACjB,WAAW,GAAE,OAAO,KAAwB,GAC3C,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB/C;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,GAAE,MAAgB,GAAG,uBAAuB,EAAE,CAqGlH;AAED,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,QAAQ,GAAE,UAA8B,EACxC,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/C,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAgEpC;AAyBD,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,mBAAmB,EAC9B,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,eAAe,CAAA;CAAO,GAC9C,kBAAkB,EAAE,CAoKtB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,mBAAmB,EAC9B,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,eAAe,CAAA;CAAO,GAC9D,MAAM,CAmGR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"terminal-card.d.ts","sourceRoot":"","sources":["../../src/lib/terminal-card.ts"],"names":[],"mappings":"AAKA,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIvE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,Q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AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CA6LR"}
|
package/package.json
CHANGED
|
@@ -179,10 +179,14 @@ Single source of truth for handling routine run failures, context extraction, an
|
|
|
179
179
|
|
|
180
180
|
How token spend, runaway loops, and budget anomalies are detected, triaged, and remediated autonomously across the fleet:
|
|
181
181
|
|
|
182
|
-
1. **Supervised Token Ceiling**: The fleet operates under a global 70% weekly token ceiling (~8.75M tokens/week across all routines). `optimizer.md` evaluates pacing during each scheduled sweep.
|
|
182
|
+
1. **Supervised Token Ceiling & Provider Plan Quota**: The fleet operates under both a global 70% weekly token ceiling (~8.75M tokens/week across all routines) AND real provider plan quotas (`npx jonah-fleet status` / `agy /quota` remaining percentage for 5h and weekly windows). `optimizer.md` evaluates pacing during each scheduled sweep against both synthetic tokens and actual plan quota availability. When actual plan quota falls into warning or critical status (<30% weekly or <20% in 5h window), optimizer flags immediate throttle/prune remediation regardless of raw token counts.
|
|
183
183
|
2. **Anomaly Classification & Heuristics**:
|
|
184
184
|
- **Token Surge**: Average token spend per run for a specific routine increases >50% week-over-week. Trigger: prompt bloat or runaway context accumulation. Remediation: prompt instruction pruning, replacing verbose guidelines with concise leading words and progressive disclosure pointers.
|
|
185
185
|
- **Budget Hog**: A single agent routine consumes >75% of total fleet token allowance. Trigger: unbalanced dispatch frequency or unbounded candidate sweeps. Remediation: throttle cron frequency, introduce stricter candidate batching, or add early exit conditions.
|
|
186
|
+
- **Multi-Routine Budget Cannibalization**: Top-2 routines combined consume >80% of total fleet token allowance or plan quota. Trigger: systemic misallocation across authoring and review routines. Remediation: rebalance dispatch pacing, coordinate candidate skips across authoring and review routines.
|
|
187
|
+
- **Context Asymmetry & Prompt Bloat**: Routine average `inputTokens / outputTokens` ratio exceeds `35:1` (with input tokens > 50,000), or static context overhead exceeds 85% of total tokens on non-trivial routines. Trigger: unconditional injection of entire skill catalog or monolithic guidelines into prompt context. Remediation: scoping skills strictly per routine rather than injecting all skills globally, pruning redundant instructions, and using progressive disclosure.
|
|
188
|
+
- **Unilateral Re-Review Thrash**: A pull request is evaluated $\ge 2$ times on the identical commit SHA without any intervening commits, state changes, or explicit `/review` re-trigger commands. Trigger: daemon/watchdog polling loops or scheduled crons blindly re-evaluating open PRs. Remediation: enforce persistent review commit state and failure cooldowns (e.g. `daemon.json` review state cache).
|
|
189
|
+
- **Plan Quota Burn Velocity**: Actual provider plan quota remaining is <30% for weekly limit or <20% for 5-hour rolling limit. Trigger: high reasoning effort or pro model tiers on auxiliary routines. Remediation: downgrade auxiliary routines (`peer-review`, `optimizer`, `housekeeping`) to medium reasoning effort and standard Flash models (`gemini-3.8-flash-medium`).
|
|
186
190
|
- **Iteration Ceiling Exhaustion**: >20% of runs in a routine terminate at the `token_limit` / max iteration cap. Trigger: tasks too complex for single-flight execution or unbounded looping. Remediation: enforce vertical slicing / umbrella decomposition, tighten pre-ready self-audits, or refine termination bounds.
|
|
187
191
|
- **Review Loop Burn**: Pull requests experiencing $\ge 3$ bounce rounds between autowork and peer-review. Trigger: ambiguous reviewer feedback, pedantic non-blocking findings, or brittle test assertions. Remediation: tighten reviewer trust/noise rules, calibrate reviewer severity thresholds, and engage human escalation via ping-pong caps.
|
|
188
192
|
- **Feedback Loop Stagnation**: A downstream processing routine (e.g. measurement loop, verification, triage) records 0 intake (`filed: 0`) across $\ge 2$ consecutive runs while upstream PRs merge or roadmap/feature issues close in the same window. Trigger: overly broad or qualitative discovery sweeps that falsely claim all items are covered. Remediation: mandate deterministic per-issue matching tables and itemized reconciliation against upstream closed issues/PRs.
|
|
@@ -57,23 +57,31 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
57
57
|
|
|
58
58
|
### 1. Collect signals & analyze logs
|
|
59
59
|
|
|
60
|
-
1. **Query in-window routine issues
|
|
60
|
+
1. **Query in-window routine issues & local run artifacts**:
|
|
61
|
+
- Query remote routine run issues within the window using `gh issue list --label routine-log --state all --limit 100 --json number,title,body,state,labels,createdAt`.
|
|
62
|
+
- Ingest local run artifacts from `.jonah-fleet/runs/*.json` (and `.jonah-fleet/runs/*.md`) or via `npx jonah-fleet telemetry --json`, capturing headless daemon runs, unfiled local executions, and exact per-step usage metrics.
|
|
63
|
+
- Fetch real-time provider plan quota via `npx jonah-fleet status` or `agy --output-format json --print /quota` to inspect cost-weighted 5-hour and weekly quota remaining percentages.
|
|
61
64
|
2. **Extract failure categories**: Categorize runs labeled `status:failure` or logging `FAILURE` (`prompt_unclear`, `data_issue`, `token_limit`, `infeasible_task`).
|
|
62
|
-
3. **Compute efficiency metrics**: Identify PRs experiencing $\ge 3$ review bounce rounds and runs with high iteration usage relative to limits.
|
|
65
|
+
3. **Compute efficiency metrics**: Identify PRs experiencing $\ge 3$ review bounce rounds, PRs evaluated repeatedly on the same commit SHA, and runs with high iteration usage relative to limits.
|
|
63
66
|
4. **Aggregate per-agent token & cost consumption**:
|
|
64
|
-
- Parse the metadata table from each in-window routine issue body: `Routine`, `Input tokens`, `Output tokens`, `Estimated cost`, `Iterations used` (e.g. `26 / 65`), and `Result` (`SUCCESS` or `FAILURE`).
|
|
67
|
+
- Parse the metadata table from each in-window routine issue body and local run artifact: `Routine`, `Input tokens`, `Output tokens`, `Estimated cost`, `Iterations used` (e.g. `26 / 65`), and `Result` (`SUCCESS` or `FAILURE`).
|
|
65
68
|
- Group logs by `Routine` (`autowork`, `peer-review`, `issues-housekeeping`, `dependency-update-security-check`, `optimizer`, `product-planning`).
|
|
66
69
|
- For each routine, compute:
|
|
67
70
|
- **Run count**: total completed runs.
|
|
68
71
|
- **Token volume**: total input tokens, total output tokens, combined total tokens.
|
|
72
|
+
- **Input/Output ratio**: `totalInputTokens / Math.max(1, totalOutputTokens)` to evaluate context efficiency and prompt density.
|
|
69
73
|
- **Cost volume**: sum of estimated costs ($).
|
|
70
74
|
- **Fleet spend share**: `(routine total cost / fleet total cost) * 100` (or token volume share if cost is unmetered).
|
|
71
75
|
- **Token averages & peaks**: average tokens per run and max tokens in a single run.
|
|
72
76
|
- **Iteration efficiency**: average iterations used per run and percentage of budget consumed.
|
|
73
|
-
- **Weekly token ceiling pacing**: Compare total fleet tokens and per-routine volume against the 70% weekly token budget ceiling specified in `ORCHESTRATION.md` (~8.75M tokens/week, and per-routine budget overrides in `agents-manifest.json` if present). Determine burn rate velocity (tokens/day) and projected 7-day total.
|
|
77
|
+
- **Weekly token ceiling & plan quota pacing**: Compare total fleet tokens and per-routine volume against the 70% weekly token budget ceiling specified in `ORCHESTRATION.md` (~8.75M tokens/week, and per-routine budget overrides in `agents-manifest.json` if present). Determine burn rate velocity (tokens/day) and projected 7-day total. Compare against actual provider plan quotas (5h and weekly remaining percentages).
|
|
74
78
|
5. **Evaluate Token Anomaly Heuristics**: Detect actionable anomalies using concrete numerical thresholds:
|
|
75
79
|
- **Token Surge**: Routine average token consumption increases >50% week-over-week (or against baseline).
|
|
76
80
|
- **Budget Hog**: A single agent routine consumes >75% of total fleet token allowance.
|
|
81
|
+
- **Multi-Routine Budget Cannibalization**: Top-2 agent routines combined consume >80% of total fleet token allowance or plan quota, indicating systemic misallocation across routines.
|
|
82
|
+
- **Context Asymmetry & Prompt Bloat**: Routine average `inputTokens / outputTokens` ratio exceeds `35:1` (with input tokens > 50,000), or static context constitutes $>85\%$ of total tokens on non-trivial routines.
|
|
83
|
+
- **Unilateral Re-Review Thrash**: A pull request is evaluated >= 2 times on the same commit SHA without intervening commits, state changes, or explicit `/review` re-trigger commands.
|
|
84
|
+
- **Plan Quota Burn Velocity**: Actual Gemini/Claude plan quota remaining is <30% for weekly limit or <20% for 5-hour rolling limit, indicating cost-weighted compute exhaustion.
|
|
77
85
|
- **Iteration Ceiling Exhaustion**: >20% of runs in a routine terminate at the `token_limit` / max iteration cap.
|
|
78
86
|
- **Review Loop Burn**: Pull requests experiencing >= 3 bounce rounds between autowork and peer-review over unresolved or recurring findings.
|
|
79
87
|
- **Feedback Loop Stagnation**: A downstream processing routine (e.g. impact measurement, verification, or triage) records 0 intake (`filed: 0` or 0 new items processed) across $\ge 2$ consecutive runs while upstream PRs merge or roadmap/feature issues close in the same window. Flags that discovery sweeps have stalled or become overly coarse.
|
|
@@ -86,7 +94,9 @@ If any criterion cannot be met, stop immediately and log FAILURE with the reason
|
|
|
86
94
|
### 2. Formulate preventative improvements
|
|
87
95
|
|
|
88
96
|
Translate findings into concrete preventative improvements and remediation triggers:
|
|
89
|
-
- **Instruction Pruning**: For Token Surge and prompt bloat, prune redundant instructions, anti-patterns, and no-ops in routine prompts following `/writing-for-agents` principles
|
|
97
|
+
- **Instruction Pruning & Skill Scoping**: For Token Surge, Context Asymmetry, and prompt bloat, prune redundant instructions, anti-patterns, and no-ops in routine prompts following `/writing-for-agents` principles, and enforce scoping skills strictly per routine rather than injecting all skills globally.
|
|
98
|
+
- **Model Effort Calibration**: For Plan Quota Burn Velocity, calibrate reasoning effort levels strictly per routine tier (e.g. `gemini-3.8-flash-medium` for review, housekeeping, and optimizer) to prevent high-effort compute exhaustion.
|
|
99
|
+
- **Review Deduplication & State Caching**: For Unilateral Re-Review Thrash, enforce review state caches (e.g. `daemon.json`) and backoff cooldowns to prevent repeat evaluations on unchanged commits.
|
|
90
100
|
- **Early Exit & Candidate Skip**: For Budget Hog and runaway sweeps, add early termination guards, candidate pre-qualification filters, and infeasible evaluation caps.
|
|
91
101
|
- **Iteration Ceiling & Self-Audit Tuning**: For Iteration Ceiling Exhaustion, adjust max iteration bounds or tighten pre-ready self-audits in `autowork.md` to catch defects before review cycles start.
|
|
92
102
|
- **Ping-Pong Convergence**: For Review Loop Burn, tighten reviewer trust & noise filtering, enforce clean-merge gates, and apply ping-pong caps to prevent endless bounce cycles.
|
|
@@ -117,14 +127,14 @@ After completing (SUCCESS or FAILURE), record run execution details to `.jonah-f
|
|
|
117
127
|
```markdown
|
|
118
128
|
### Token & Cost Consumption by Agent
|
|
119
129
|
|
|
120
|
-
| Routine | Runs | Input Tokens | Output Tokens | Total Tokens | Cost | Fleet % | Avg Iterations | Max Iterations | Status / Anomaly |
|
|
121
|
-
|
|
122
|
-
| `autowork` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
123
|
-
| `peer-review` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
124
|
-
| `issues-housekeeping` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
125
|
-
| `dependency-update-security-check` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
126
|
-
| `optimizer` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
127
|
-
| `product-planning` | 0 | 0 | 0 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
130
|
+
| Routine | Runs | Input Tokens | Output Tokens | I/O Ratio | Total Tokens | Cost | Fleet % | Avg Iterations | Max Iterations | Status / Anomaly |
|
|
131
|
+
|---|---|---|---|---|---|---|---|---|---|---|
|
|
132
|
+
| `autowork` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
133
|
+
| `peer-review` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
134
|
+
| `issues-housekeeping` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
135
|
+
| `dependency-update-security-check` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
136
|
+
| `optimizer` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
137
|
+
| `product-planning` | 0 | 0 | 0 | 0:1 | 0 | $0.00 | 0.0% | 0 | 0 | Nominal |
|
|
128
138
|
```
|
|
129
139
|
|
|
130
140
|
- Weekly token budget pacing evaluation (pacing vs 70% ceiling in `ORCHESTRATION.md`)
|