burnoff 1.2.0 → 1.4.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/.claude-plugin/plugin.json +11 -0
- package/.github/workflows/burnoff-pr-gate.yml +3 -3
- package/.github/workflows/burnoff-startup-lint.yml +37 -0
- package/README.md +47 -6
- package/bin/burnoff.mjs +123 -5
- package/commands/burnoff.md +16 -0
- package/docs/CLAUDE_CODE_PLUGIN.md +67 -0
- package/docs/DESIGN_PARTNER_INTAKE.md +44 -0
- package/package.json +10 -4
- package/scripts/burnoff-statusline.mjs +104 -0
- package/src/cli/audit.mjs +82 -4
- package/src/cli/startup-audit.mjs +390 -71
- package/src/config/policy.mjs +13 -1
- package/src/guards/loop-breaker.mjs +49 -0
- package/src/guards/phase5-detectors.mjs +727 -0
- package/src/guards/pre-tool-engine.mjs +222 -66
- package/src/guards/snooze.mjs +363 -0
- package/src/storage/antigravity-parser.mjs +18 -1
- package/src/storage/jsonl-parser.mjs +29 -1
- package/src/storage/telemetry-metrics.mjs +703 -0
|
@@ -157,13 +157,30 @@ export function parseAntigravityTranscript(filePathOrContent = '', options = {})
|
|
|
157
157
|
if (tc.name) toolsUsedSet.add(tc.name);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
const finishedAt = entry.finished_at || entry.finishedAt || entry.completedAt || null;
|
|
161
|
+
const rawDur = Number(entry.duration_ms ?? entry.durationMs);
|
|
162
|
+
let durationMs = Number.isFinite(rawDur) && rawDur > 0 ? Number(rawDur.toFixed(2)) : null;
|
|
163
|
+
const createdAt = entry.created_at || entry.createdAt || null;
|
|
164
|
+
if (durationMs === null && createdAt && finishedAt) {
|
|
165
|
+
const startMs = Date.parse(createdAt);
|
|
166
|
+
const endMs = Date.parse(finishedAt);
|
|
167
|
+
if (Number.isFinite(startMs) && Number.isFinite(endMs) && endMs > startMs) {
|
|
168
|
+
durationMs = Number((endMs - startMs).toFixed(2));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const rawTtft = Number(entry.ttft_ms ?? entry.ttftMs);
|
|
172
|
+
const ttftMs = Number.isFinite(rawTtft) && rawTtft > 0 ? Number(rawTtft.toFixed(2)) : null;
|
|
173
|
+
|
|
160
174
|
steps.push({
|
|
161
175
|
stepIndex: Number.isFinite(Number(entry.step_index)) ? Number(entry.step_index) : steps.length,
|
|
162
176
|
type: 'assistant',
|
|
163
177
|
rawType: entry.type,
|
|
164
178
|
client: 'antigravity',
|
|
165
179
|
entrypoint: 'antigravity',
|
|
166
|
-
createdAt
|
|
180
|
+
createdAt,
|
|
181
|
+
finishedAt,
|
|
182
|
+
durationMs,
|
|
183
|
+
ttftMs,
|
|
167
184
|
model,
|
|
168
185
|
freshInputTokens,
|
|
169
186
|
cacheReadTokens,
|
|
@@ -217,11 +217,15 @@ export function stitchClaudeCodeDag(jsonlLinesOrContent = []) {
|
|
|
217
217
|
prevMsg.content ?? prev.content,
|
|
218
218
|
nextMsg.content ?? node.content
|
|
219
219
|
);
|
|
220
|
+
const prevTs = prev.firstChunkAt || prev.timestamp || prev.created_at || prev.createdAt || null;
|
|
221
|
+
const nextTs = node.timestamp || node.created_at || node.createdAt || prev.lastChunkAt || prevTs;
|
|
220
222
|
consolidatedActiveChain[idx] = {
|
|
221
223
|
...prev,
|
|
222
224
|
...node,
|
|
223
225
|
uuid: node.uuid || prev.uuid,
|
|
224
226
|
parentUuid: prev.parentUuid,
|
|
227
|
+
firstChunkAt: prevTs,
|
|
228
|
+
lastChunkAt: nextTs,
|
|
225
229
|
content: msg ? prev.content : mergedContent,
|
|
226
230
|
tool_calls: [
|
|
227
231
|
...(Array.isArray(prev.tool_calls) ? prev.tool_calls : []),
|
|
@@ -500,7 +504,27 @@ export function parseClaudeCodeJsonl(rawContent = '') {
|
|
|
500
504
|
) || 0);
|
|
501
505
|
const model = msg?.model || node.model || null;
|
|
502
506
|
if (model) latestModel = model;
|
|
503
|
-
const createdAt = node.timestamp || node.created_at || node.createdAt || null;
|
|
507
|
+
const createdAt = node.firstChunkAt || node.timestamp || node.created_at || node.createdAt || null;
|
|
508
|
+
const finishedAt = node.finished_at || node.finishedAt || node.completedAt || node.lastChunkAt || null;
|
|
509
|
+
const firstTokenAt = node.first_token_at || node.firstTokenAt || null;
|
|
510
|
+
const rawDur = Number(node.durationMs ?? node.duration_ms ?? node.latencyMs);
|
|
511
|
+
let durationMs = Number.isFinite(rawDur) && rawDur > 0 ? Number(rawDur.toFixed(2)) : null;
|
|
512
|
+
if (durationMs === null && createdAt && finishedAt) {
|
|
513
|
+
const startMs = Date.parse(createdAt);
|
|
514
|
+
const endMs = Date.parse(finishedAt);
|
|
515
|
+
if (Number.isFinite(startMs) && Number.isFinite(endMs) && endMs > startMs) {
|
|
516
|
+
durationMs = Number((endMs - startMs).toFixed(2));
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
const rawTtft = Number(node.ttftMs ?? node.ttft_ms ?? node.firstTokenLatencyMs);
|
|
520
|
+
let ttftMs = Number.isFinite(rawTtft) && rawTtft > 0 ? Number(rawTtft.toFixed(2)) : null;
|
|
521
|
+
if (ttftMs === null && createdAt && firstTokenAt) {
|
|
522
|
+
const startMs = Date.parse(createdAt);
|
|
523
|
+
const firstMs = Date.parse(firstTokenAt);
|
|
524
|
+
if (Number.isFinite(startMs) && Number.isFinite(firstMs) && firstMs >= startMs) {
|
|
525
|
+
ttftMs = Number((firstMs - startMs).toFixed(2));
|
|
526
|
+
}
|
|
527
|
+
}
|
|
504
528
|
const hasUsage = inputTokens > 0 || cacheReadTokens > 0 || cacheCreationTokens > 0 || outputTokens > 0;
|
|
505
529
|
const hadCompactionBefore = hasUsage ? pendingCompaction : false;
|
|
506
530
|
if (hasUsage) {
|
|
@@ -544,6 +568,10 @@ export function parseClaudeCodeJsonl(rawContent = '') {
|
|
|
544
568
|
systemSubtype,
|
|
545
569
|
status: 'DONE',
|
|
546
570
|
createdAt,
|
|
571
|
+
finishedAt,
|
|
572
|
+
firstTokenAt,
|
|
573
|
+
durationMs,
|
|
574
|
+
ttftMs,
|
|
547
575
|
model: model || latestModel || null,
|
|
548
576
|
toolCalls,
|
|
549
577
|
content,
|