@feigi/fleet-ctl 3.124.0 → 3.124.1
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/package.json +1 -1
- package/scripts/member-record.mjs +11 -5
package/package.json
CHANGED
|
@@ -357,7 +357,6 @@ function createdPrNumbers(text) {
|
|
|
357
357
|
// numbers in first-seen order.
|
|
358
358
|
export function foldOmpTranscript(jsonlText, filePath) {
|
|
359
359
|
let model = null, thinking = null, task = null, resolvedModelIdentity = null, agent = null;
|
|
360
|
-
let firstTs = null;
|
|
361
360
|
// For the `work_s` column (member-outcomes.mjs): every timestamped entry's
|
|
362
361
|
// instant, and the member's working parts — each run of timestamped entries
|
|
363
362
|
// between two `session_exit` entries, as [first, last] in epoch ms. The
|
|
@@ -368,6 +367,9 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
368
367
|
let input = 0, cacheWrite = 0, cacheWrite1h = 0, cacheRead = 0, output = 0, cost = 0, turns = 0;
|
|
369
368
|
let sawCost = false, unsplit = false, unpriced = false;
|
|
370
369
|
let malformedNonLastLines = 0;
|
|
370
|
+
// Entries that carry a `timestamp` from which no finite instant was read;
|
|
371
|
+
// an entry with no `timestamp` at all is ordinary and not counted.
|
|
372
|
+
let unparseableStamps = 0;
|
|
371
373
|
// What the transcript's END says, read for the `ending` column: the last
|
|
372
374
|
// assistant turn's stopReason, whether a model fell back, whether the
|
|
373
375
|
// session exited cleanly, whether a budget notice reached the member, and
|
|
@@ -390,9 +392,9 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
390
392
|
try { d = JSON.parse(raw); }
|
|
391
393
|
catch { if (i !== lines.length - 1) malformedNonLastLines++; continue; }
|
|
392
394
|
assertOmpShaped(d, filePath);
|
|
393
|
-
|
|
394
|
-
if (typeof d.timestamp === "string") { firstTs ??= d.timestamp; ms = Date.parse(d.timestamp); }
|
|
395
|
+
const ms = typeof d.timestamp === "string" ? Date.parse(d.timestamp) : NaN;
|
|
395
396
|
if (Number.isFinite(ms)) stamps.push(ms);
|
|
397
|
+
else if (Object.hasOwn(d, "timestamp")) unparseableStamps++;
|
|
396
398
|
if (d.type === "custom" && d.customType === "session_exit") {
|
|
397
399
|
sessionExit = true;
|
|
398
400
|
if (partFirst !== null) workParts.push([partFirst, partLast]);
|
|
@@ -449,10 +451,12 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
449
451
|
if (partFirst !== null) workParts.push([partFirst, partLast]);
|
|
450
452
|
// `wall_s` is the span of the parseable stamps, latest minus earliest, so it
|
|
451
453
|
// does not depend on file order and cannot go negative; an unparseable
|
|
452
|
-
// stamp is skipped, and a transcript with none spans 0.
|
|
454
|
+
// stamp is skipped, and a transcript with none spans 0. `startedAt` is the
|
|
455
|
+
// same earliest stamp as an ISO string, or null when none parsed.
|
|
453
456
|
let earliest = Infinity, latest = -Infinity;
|
|
454
457
|
for (const t of stamps) { if (t < earliest) earliest = t; if (t > latest) latest = t; }
|
|
455
458
|
const span = stamps.length ? (latest - earliest) / 1000 : 0;
|
|
459
|
+
const startedAt = stamps.length ? new Date(earliest).toISOString() : null;
|
|
456
460
|
return {
|
|
457
461
|
model, thinking, task, resolvedModelIdentity, agent,
|
|
458
462
|
input, cacheWrite, cacheRead, output,
|
|
@@ -470,8 +474,9 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
470
474
|
wallS: Math.round(span),
|
|
471
475
|
entries,
|
|
472
476
|
malformedNonLastLines,
|
|
477
|
+
unparseableStamps,
|
|
473
478
|
openedPrs: [...openedPrs],
|
|
474
|
-
startedAt
|
|
479
|
+
startedAt,
|
|
475
480
|
stamps, workParts,
|
|
476
481
|
reportWrites,
|
|
477
482
|
lastStopReason, providerFallback, sessionExit, budgetNotice,
|
|
@@ -915,6 +920,7 @@ export function readOmpSession(sessionDir, activity = null) {
|
|
|
915
920
|
lastStopReason: folded.lastStopReason, providerFallback: folded.providerFallback,
|
|
916
921
|
sessionExit: folded.sessionExit, budgetNotice: folded.budgetNotice,
|
|
917
922
|
malformedNonLastLines: folded.malformedNonLastLines,
|
|
923
|
+
unparseableStamps: folded.unparseableStamps,
|
|
918
924
|
hasYield: existsSync(file.replace(/\.jsonl$/, ".md")),
|
|
919
925
|
timed: folded.stamps.length > 0, workParts: folded.workParts,
|
|
920
926
|
} });
|