@bitfab/sdk 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.
Files changed (31) hide show
  1. package/cloudReplay.py +121 -12
  2. package/dist/{chunk-QJGDYXNC.js → chunk-5VAPDLCY.js} +32 -8
  3. package/dist/chunk-5VAPDLCY.js.map +1 -0
  4. package/dist/{chunk-54JYZXMF.js → chunk-FGGLYMZD.js} +2 -2
  5. package/dist/{chunk-54JYZXMF.js.map → chunk-FGGLYMZD.js.map} +1 -1
  6. package/dist/{chunk-MIRJGPJE.js → chunk-GGS5YCPE.js} +2 -2
  7. package/dist/{chunk-MIRJGPJE.js.map → chunk-GGS5YCPE.js.map} +1 -1
  8. package/dist/{chunk-G3KS5PSV.js → chunk-MGQ6V3CE.js} +2 -2
  9. package/dist/{chunk-GASCMFJR.js → chunk-Z3C5PXTK.js} +3 -3
  10. package/dist/{http-BBVZZ35K.js → http-7K4MGDNE.js} +2 -2
  11. package/dist/{http-LRU3UOPD.js → http-WXBCXZ33.js} +2 -2
  12. package/dist/index.cjs +28 -3
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +13 -11
  15. package/dist/index.d.ts +13 -11
  16. package/dist/index.js +3 -3
  17. package/dist/node.cjs +28 -3
  18. package/dist/node.cjs.map +1 -1
  19. package/dist/node.d.cts +1 -1
  20. package/dist/node.d.ts +1 -1
  21. package/dist/node.js +3 -3
  22. package/dist/{replay-52GEIAYO.js → replay-Q5W67C7L.js} +3 -3
  23. package/dist/replayCli.js +2 -2
  24. package/dist/seedCli.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunk-QJGDYXNC.js.map +0 -1
  27. /package/dist/{chunk-G3KS5PSV.js.map → chunk-MGQ6V3CE.js.map} +0 -0
  28. /package/dist/{chunk-GASCMFJR.js.map → chunk-Z3C5PXTK.js.map} +0 -0
  29. /package/dist/{http-BBVZZ35K.js.map → http-7K4MGDNE.js.map} +0 -0
  30. /package/dist/{http-LRU3UOPD.js.map → http-WXBCXZ33.js.map} +0 -0
  31. /package/dist/{replay-52GEIAYO.js.map → replay-Q5W67C7L.js.map} +0 -0
@@ -8,7 +8,7 @@ import {
8
8
  replayContextReady,
9
9
  runWithReplayContext,
10
10
  unrefTimer
11
- } from "./chunk-54JYZXMF.js";
11
+ } from "./chunk-FGGLYMZD.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-G3KS5PSV.js.map
2034
+ //# sourceMappingURL=chunk-MGQ6V3CE.js.map
@@ -2,7 +2,7 @@ import {
2
2
  BitfabError,
3
3
  warnOnce,
4
4
  writeOnce
5
- } from "./chunk-MIRJGPJE.js";
5
+ } from "./chunk-GGS5YCPE.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-LRU3UOPD.js");
351
+ const { flushTraces: flushTraces2 } = await import("./http-WXBCXZ33.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-GASCMFJR.js.map
1045
+ //# sourceMappingURL=chunk-Z3C5PXTK.js.map
@@ -7,7 +7,7 @@ import {
7
7
  flushTraces,
8
8
  parseRetryAfterMs,
9
9
  serializePayloadBody
10
- } from "./chunk-54JYZXMF.js";
10
+ } from "./chunk-FGGLYMZD.js";
11
11
  import "./chunk-MT36GJMW.js";
12
12
  export {
13
13
  BitfabError,
@@ -19,4 +19,4 @@ export {
19
19
  parseRetryAfterMs,
20
20
  serializePayloadBody
21
21
  };
22
- //# sourceMappingURL=http-BBVZZ35K.js.map
22
+ //# sourceMappingURL=http-7K4MGDNE.js.map
@@ -7,7 +7,7 @@ import {
7
7
  flushTraces,
8
8
  parseRetryAfterMs,
9
9
  serializePayloadBody
10
- } from "./chunk-MIRJGPJE.js";
10
+ } from "./chunk-GGS5YCPE.js";
11
11
  export {
12
12
  BitfabError,
13
13
  HttpClient,
@@ -18,4 +18,4 @@ export {
18
18
  parseRetryAfterMs,
19
19
  serializePayloadBody
20
20
  };
21
- //# sourceMappingURL=http-LRU3UOPD.js.map
21
+ //# sourceMappingURL=http-WXBCXZ33.js.map
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ var __version__, __packageName__;
42
42
  var init_version_generated = __esm({
43
43
  "src/version.generated.ts"() {
44
44
  "use strict";
45
- __version__ = "0.64.7";
45
+ __version__ = "0.64.9";
46
46
  __packageName__ = "@bitfab/sdk";
47
47
  }
48
48
  });
@@ -7046,9 +7046,34 @@ var GradersClient = class {
7046
7046
  init_http();
7047
7047
 
7048
7048
  // src/labels.ts
7049
+ init_errors();
7049
7050
  init_http();
7050
7051
  var LABELS_PATH = "/api/sdk/traces/labels";
7051
7052
  var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
7053
+ function assertEveryVerdictNamesAnAssertion(updates) {
7054
+ const unscoped = updates.filter(
7055
+ (update) => !("archive" in update && update.archive === true) && (typeof update.assertionId !== "string" || update.assertionId === "")
7056
+ );
7057
+ if (unscoped.length > 0) {
7058
+ const targets = unscoped.map(
7059
+ (update) => update.traceId ?? update.originalTraceId
7060
+ );
7061
+ throw new BitfabError(
7062
+ `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.`
7063
+ );
7064
+ }
7065
+ }
7066
+ function assertEveryHumanVerdictNamesAnAssertion(updates) {
7067
+ const unscoped = updates.filter(
7068
+ (update) => typeof update.assertionId !== "string" || update.assertionId === ""
7069
+ );
7070
+ if (unscoped.length > 0) {
7071
+ const targets = unscoped.map((update) => update.traceId);
7072
+ throw new BitfabError(
7073
+ `Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.saveHuman and saveHumanAll.`
7074
+ );
7075
+ }
7076
+ }
7052
7077
  function labelEvidencePath(traceId, assertionId) {
7053
7078
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
7054
7079
  }
@@ -7061,6 +7086,7 @@ var LabelsClient = class {
7061
7086
  return outcome;
7062
7087
  }
7063
7088
  async saveAll(updates, experimentId) {
7089
+ assertEveryVerdictNamesAnAssertion(updates);
7064
7090
  const response = await this.httpClient.request(
7065
7091
  LABELS_PATH,
7066
7092
  {
@@ -7070,11 +7096,9 @@ var LabelsClient = class {
7070
7096
  );
7071
7097
  return response.labels;
7072
7098
  }
7073
- /** Withhold a verdict for a trace or replay attempt whose check did not run. */
7074
7099
  async skip(target, experimentId) {
7075
7100
  return this.save({ ...target, skip: true }, experimentId);
7076
7101
  }
7077
- /** Clear a previous verdict for a trace, replay attempt, or assertion. */
7078
7102
  async archive(target, experimentId) {
7079
7103
  return this.save({ ...target, archive: true }, experimentId);
7080
7104
  }
@@ -7083,6 +7107,7 @@ var LabelsClient = class {
7083
7107
  return outcome;
7084
7108
  }
7085
7109
  async saveHumanAll(updates) {
7110
+ assertEveryHumanVerdictNamesAnAssertion(updates);
7086
7111
  const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
7087
7112
  return response.labels;
7088
7113
  }