bitfab 0.64.7 → 0.64.8

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.
@@ -2,7 +2,7 @@ import {
2
2
  BitfabError,
3
3
  warnOnce,
4
4
  writeOnce
5
- } from "./chunk-RYZO7Q3P.js";
5
+ } from "./chunk-P2SYAT44.js";
6
6
 
7
7
  // src/codeChange.ts
8
8
  var NUL = String.fromCharCode(0);
@@ -348,7 +348,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
348
348
  sessionId: seedCase.sessionId
349
349
  })
350
350
  );
351
- const { flushTraces: flushTraces2 } = await import("./http-QVLMJVZT.js");
351
+ const { flushTraces: flushTraces2 } = await import("./http-CWPHM5T3.js");
352
352
  await flushTraces2(3e4);
353
353
  return { pipeline, traceFunctionKey, traceIds };
354
354
  }
@@ -1042,4 +1042,4 @@ export {
1042
1042
  runRegistryMain,
1043
1043
  runIfEntrypoint
1044
1044
  };
1045
- //# sourceMappingURL=chunk-FZ7SSJ7S.js.map
1045
+ //# sourceMappingURL=chunk-25HVPGSF.js.map
@@ -8,7 +8,7 @@ import {
8
8
  replayContextReady,
9
9
  runWithReplayContext,
10
10
  unrefTimer
11
- } from "./chunk-TAGNRN6F.js";
11
+ } from "./chunk-YGDXDDTX.js";
12
12
  import {
13
13
  runWithCaptureSuppressed,
14
14
  warnOnce,
@@ -2031,4 +2031,4 @@ export {
2031
2031
  warnJudgeAssertionsDeprecated,
2032
2032
  replay
2033
2033
  };
2034
- //# sourceMappingURL=chunk-SZVZU3F6.js.map
2034
+ //# sourceMappingURL=chunk-2U4Y5FHT.js.map
@@ -17,7 +17,7 @@ import {
17
17
  serializeValue,
18
18
  toJsonSafe,
19
19
  toJsonSafeReport
20
- } from "./chunk-SZVZU3F6.js";
20
+ } from "./chunk-2U4Y5FHT.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-TAGNRN6F.js";
39
+ } from "./chunk-YGDXDDTX.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-YUNQFRQY.js");
6280
+ const { flushTraces: flushTraces2 } = await import("./http-JBQTF36K.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-PN6MNLGK.js");
6339
+ const { replay: doReplay } = await import("./replay-LBALXLOM.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-YUNQFRQY.js");
6685
+ const { flushTraces: flushTraces2 } = await import("./http-JBQTF36K.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-DIOPUOV3.js.map
6730
+ //# sourceMappingURL=chunk-2UDEQITO.js.map