bitfab 0.64.7 → 0.64.9
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/cloudReplay.py +121 -12
- package/dist/{chunk-FZ7SSJ7S.js → chunk-7J3XIMC3.js} +3 -3
- package/dist/{chunk-TAGNRN6F.js → chunk-CPRLBQ2W.js} +2 -2
- package/dist/{chunk-TAGNRN6F.js.map → chunk-CPRLBQ2W.js.map} +1 -1
- package/dist/{chunk-DIOPUOV3.js → chunk-EJVBVUH4.js} +32 -8
- package/dist/chunk-EJVBVUH4.js.map +1 -0
- package/dist/{chunk-SZVZU3F6.js → chunk-L3LFRGPX.js} +2 -2
- package/dist/{chunk-RYZO7Q3P.js → chunk-NFMXJT4W.js} +2 -2
- package/dist/{chunk-RYZO7Q3P.js.map → chunk-NFMXJT4W.js.map} +1 -1
- package/dist/{http-YUNQFRQY.js → http-47AVLP6D.js} +2 -2
- package/dist/{http-QVLMJVZT.js → http-UOFHA334.js} +2 -2
- package/dist/index.cjs +28 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.js +3 -3
- package/dist/node.cjs +28 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-PN6MNLGK.js → replay-WLGXE5GZ.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-DIOPUOV3.js.map +0 -1
- /package/dist/{chunk-FZ7SSJ7S.js.map → chunk-7J3XIMC3.js.map} +0 -0
- /package/dist/{chunk-SZVZU3F6.js.map → chunk-L3LFRGPX.js.map} +0 -0
- /package/dist/{http-QVLMJVZT.js.map → http-47AVLP6D.js.map} +0 -0
- /package/dist/{http-YUNQFRQY.js.map → http-UOFHA334.js.map} +0 -0
- /package/dist/{replay-PN6MNLGK.js.map → replay-WLGXE5GZ.js.map} +0 -0
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
serializeValue,
|
|
18
18
|
toJsonSafe,
|
|
19
19
|
toJsonSafeReport
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-L3LFRGPX.js";
|
|
21
21
|
import {
|
|
22
22
|
BitfabError,
|
|
23
23
|
CONTENT_OFF_KEY,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
readEnv,
|
|
37
37
|
recordCallerTraceMetadata,
|
|
38
38
|
retireTraceMetadata
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-CPRLBQ2W.js";
|
|
40
40
|
import {
|
|
41
41
|
__privateAdd,
|
|
42
42
|
__privateGet,
|
|
@@ -1556,6 +1556,30 @@ var GradersClient = class {
|
|
|
1556
1556
|
// src/labels.ts
|
|
1557
1557
|
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
1558
1558
|
var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
|
|
1559
|
+
function assertEveryVerdictNamesAnAssertion(updates) {
|
|
1560
|
+
const unscoped = updates.filter(
|
|
1561
|
+
(update) => !("archive" in update && update.archive === true) && (typeof update.assertionId !== "string" || update.assertionId === "")
|
|
1562
|
+
);
|
|
1563
|
+
if (unscoped.length > 0) {
|
|
1564
|
+
const targets = unscoped.map(
|
|
1565
|
+
(update) => update.traceId ?? update.originalTraceId
|
|
1566
|
+
);
|
|
1567
|
+
throw new BitfabError(
|
|
1568
|
+
`Agent verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.save, saveAll, and skip. Only archive may omit it, to clear an old whole-trace verdict.`
|
|
1569
|
+
);
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
function assertEveryHumanVerdictNamesAnAssertion(updates) {
|
|
1573
|
+
const unscoped = updates.filter(
|
|
1574
|
+
(update) => typeof update.assertionId !== "string" || update.assertionId === ""
|
|
1575
|
+
);
|
|
1576
|
+
if (unscoped.length > 0) {
|
|
1577
|
+
const targets = unscoped.map((update) => update.traceId);
|
|
1578
|
+
throw new BitfabError(
|
|
1579
|
+
`Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.saveHuman and saveHumanAll.`
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1559
1583
|
function labelEvidencePath(traceId, assertionId) {
|
|
1560
1584
|
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
|
|
1561
1585
|
}
|
|
@@ -1568,6 +1592,7 @@ var LabelsClient = class {
|
|
|
1568
1592
|
return outcome;
|
|
1569
1593
|
}
|
|
1570
1594
|
async saveAll(updates, experimentId) {
|
|
1595
|
+
assertEveryVerdictNamesAnAssertion(updates);
|
|
1571
1596
|
const response = await this.httpClient.request(
|
|
1572
1597
|
LABELS_PATH,
|
|
1573
1598
|
{
|
|
@@ -1577,11 +1602,9 @@ var LabelsClient = class {
|
|
|
1577
1602
|
);
|
|
1578
1603
|
return response.labels;
|
|
1579
1604
|
}
|
|
1580
|
-
/** Withhold a verdict for a trace or replay attempt whose check did not run. */
|
|
1581
1605
|
async skip(target, experimentId) {
|
|
1582
1606
|
return this.save({ ...target, skip: true }, experimentId);
|
|
1583
1607
|
}
|
|
1584
|
-
/** Clear a previous verdict for a trace, replay attempt, or assertion. */
|
|
1585
1608
|
async archive(target, experimentId) {
|
|
1586
1609
|
return this.save({ ...target, archive: true }, experimentId);
|
|
1587
1610
|
}
|
|
@@ -1590,6 +1613,7 @@ var LabelsClient = class {
|
|
|
1590
1613
|
return outcome;
|
|
1591
1614
|
}
|
|
1592
1615
|
async saveHumanAll(updates) {
|
|
1616
|
+
assertEveryHumanVerdictNamesAnAssertion(updates);
|
|
1593
1617
|
const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
|
|
1594
1618
|
return response.labels;
|
|
1595
1619
|
}
|
|
@@ -6253,7 +6277,7 @@ var Bitfab = class {
|
|
|
6253
6277
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
6254
6278
|
} finally {
|
|
6255
6279
|
try {
|
|
6256
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
6280
|
+
const { flushTraces: flushTraces2 } = await import("./http-47AVLP6D.js");
|
|
6257
6281
|
await flushTraces2(3e4);
|
|
6258
6282
|
} finally {
|
|
6259
6283
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -6312,7 +6336,7 @@ var Bitfab = class {
|
|
|
6312
6336
|
`Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
|
|
6313
6337
|
);
|
|
6314
6338
|
}
|
|
6315
|
-
const { replay: doReplay } = await import("./replay-
|
|
6339
|
+
const { replay: doReplay } = await import("./replay-WLGXE5GZ.js");
|
|
6316
6340
|
return doReplay(
|
|
6317
6341
|
this.httpClient,
|
|
6318
6342
|
this.serviceUrl,
|
|
@@ -6658,7 +6682,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
6658
6682
|
sessionId: seedCase.sessionId
|
|
6659
6683
|
})
|
|
6660
6684
|
);
|
|
6661
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
6685
|
+
const { flushTraces: flushTraces2 } = await import("./http-47AVLP6D.js");
|
|
6662
6686
|
await flushTraces2(3e4);
|
|
6663
6687
|
return { pipeline, traceFunctionKey, traceIds };
|
|
6664
6688
|
}
|
|
@@ -6703,4 +6727,4 @@ export {
|
|
|
6703
6727
|
reseedFromRegistry,
|
|
6704
6728
|
seedFromRegistry
|
|
6705
6729
|
};
|
|
6706
|
-
//# sourceMappingURL=chunk-
|
|
6730
|
+
//# sourceMappingURL=chunk-EJVBVUH4.js.map
|