@bitfab/sdk 0.62.7 → 0.63.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.
Files changed (36) hide show
  1. package/dist/autoTrace.cjs.map +1 -1
  2. package/dist/autoTrace.js +2 -2
  3. package/dist/{chunk-BAOIRE5T.js → chunk-MT36GJMW.js} +13 -2
  4. package/dist/{chunk-BAOIRE5T.js.map → chunk-MT36GJMW.js.map} +1 -1
  5. package/dist/{chunk-AZ2KO7WO.js → chunk-MV4RDU2G.js} +15 -4
  6. package/dist/chunk-MV4RDU2G.js.map +1 -0
  7. package/dist/{chunk-35RAQIQS.js → chunk-P5NCLTE4.js} +8 -8
  8. package/dist/{chunk-35RAQIQS.js.map → chunk-P5NCLTE4.js.map} +1 -1
  9. package/dist/{chunk-ZHPO4I7L.js → chunk-SXAL4FQV.js} +22 -25
  10. package/dist/chunk-SXAL4FQV.js.map +1 -0
  11. package/dist/{chunk-3L4TQ3RW.js → chunk-TSP6722V.js} +5 -5
  12. package/dist/{chunk-3L4TQ3RW.js.map → chunk-TSP6722V.js.map} +1 -1
  13. package/dist/{chunk-CDMFIVVU.js → chunk-WGQIBPZP.js} +24 -7
  14. package/dist/chunk-WGQIBPZP.js.map +1 -0
  15. package/dist/{chunk-K4XCWQBC.js → chunk-YWXQM6J3.js} +2 -2
  16. package/dist/{http-SI5MKPJC.js → http-7N55SPQM.js} +2 -2
  17. package/dist/{http-TQBXGFHA.js → http-FYNNU6X7.js} +3 -3
  18. package/dist/index.cjs +34 -27
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +3 -7
  21. package/dist/index.d.ts +3 -7
  22. package/dist/index.js +5 -5
  23. package/dist/node.cjs +34 -27
  24. package/dist/node.cjs.map +1 -1
  25. package/dist/node.js +5 -5
  26. package/dist/{replay-6EUUVQTR.js → replay-LZXSZXTQ.js} +10 -6
  27. package/dist/replayCli.js +2 -2
  28. package/dist/seedCli.js +2 -2
  29. package/package.json +1 -1
  30. package/dist/chunk-AZ2KO7WO.js.map +0 -1
  31. package/dist/chunk-CDMFIVVU.js.map +0 -1
  32. package/dist/chunk-ZHPO4I7L.js.map +0 -1
  33. /package/dist/{chunk-K4XCWQBC.js.map → chunk-YWXQM6J3.js.map} +0 -0
  34. /package/dist/{http-SI5MKPJC.js.map → http-7N55SPQM.js.map} +0 -0
  35. /package/dist/{http-TQBXGFHA.js.map → http-FYNNU6X7.js.map} +0 -0
  36. /package/dist/{replay-6EUUVQTR.js.map → replay-LZXSZXTQ.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -697,7 +697,7 @@ declare class HttpClient {
697
697
  * Start a replay session by fetching historical traces.
698
698
  * Blocking call - creates an experiment and returns lightweight item references.
699
699
  */
700
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
700
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
701
701
  resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
702
702
  /**
703
703
  * Fetch an external span by ID.
@@ -2223,11 +2223,7 @@ interface ReplayOptions {
2223
2223
  * replays nothing.
2224
2224
  */
2225
2225
  onlyWithAssertions?: boolean;
2226
- /**
2227
- * Judge every approved assertion on each replay as it finishes and save the
2228
- * verdict as that assertion's agent label. Off unless asked: each judgement
2229
- * costs model calls.
2230
- */
2226
+ skipAssertionJudging?: boolean;
2231
2227
  judgeAssertions?: boolean;
2232
2228
  /**
2233
2229
  * Reshape recorded inputs before they are spread into `fn`.
@@ -3977,7 +3973,7 @@ interface CommitRef {
3977
3973
  /**
3978
3974
  * SDK version from package.json (injected at build time)
3979
3975
  */
3980
- declare const __version__ = "0.62.7";
3976
+ declare const __version__ = "0.63.0";
3981
3977
 
3982
3978
  /**
3983
3979
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -697,7 +697,7 @@ declare class HttpClient {
697
697
  * Start a replay session by fetching historical traces.
698
698
  * Blocking call - creates an experiment and returns lightweight item references.
699
699
  */
700
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
700
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, skipAssertionJudging?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
701
701
  resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
702
702
  /**
703
703
  * Fetch an external span by ID.
@@ -2223,11 +2223,7 @@ interface ReplayOptions {
2223
2223
  * replays nothing.
2224
2224
  */
2225
2225
  onlyWithAssertions?: boolean;
2226
- /**
2227
- * Judge every approved assertion on each replay as it finishes and save the
2228
- * verdict as that assertion's agent label. Off unless asked: each judgement
2229
- * costs model calls.
2230
- */
2226
+ skipAssertionJudging?: boolean;
2231
2227
  judgeAssertions?: boolean;
2232
2228
  /**
2233
2229
  * Reshape recorded inputs before they are spread into `fn`.
@@ -3977,7 +3973,7 @@ interface CommitRef {
3977
3973
  /**
3978
3974
  * SDK version from package.json (injected at build time)
3979
3975
  */
3980
- declare const __version__ = "0.62.7";
3976
+ declare const __version__ = "0.63.0";
3981
3977
 
3982
3978
  /**
3983
3979
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -27,8 +27,8 @@ import {
27
27
  getCurrentTrace,
28
28
  reseedFromRegistry,
29
29
  seedFromRegistry
30
- } from "./chunk-35RAQIQS.js";
31
- import "./chunk-K4XCWQBC.js";
30
+ } from "./chunk-P5NCLTE4.js";
31
+ import "./chunk-YWXQM6J3.js";
32
32
  import {
33
33
  BITFAB_PROGRESS_PREFIX,
34
34
  DbBranchReplayError,
@@ -36,7 +36,7 @@ import {
36
36
  ReplayError,
37
37
  reportReplayProgress,
38
38
  serializeReplayResult
39
- } from "./chunk-ZHPO4I7L.js";
39
+ } from "./chunk-SXAL4FQV.js";
40
40
  import {
41
41
  BitfabError,
42
42
  DEFAULT_SERVICE_URL,
@@ -44,8 +44,8 @@ import {
44
44
  MixedTracingError,
45
45
  __version__,
46
46
  flushTraces
47
- } from "./chunk-3L4TQ3RW.js";
48
- import "./chunk-BAOIRE5T.js";
47
+ } from "./chunk-TSP6722V.js";
48
+ import "./chunk-MT36GJMW.js";
49
49
  export {
50
50
  AssertionCategoriesClient,
51
51
  AssertionGenerationError,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.62.7";
91
+ __version__ = "0.63.0";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -720,6 +720,16 @@ function warnOnce(key, message) {
720
720
  warned.add(key);
721
721
  warn(message);
722
722
  }
723
+ function writeOnce(key, line, write = console.warn) {
724
+ if (warned.has(key)) {
725
+ return;
726
+ }
727
+ warned.add(key);
728
+ try {
729
+ write(line);
730
+ } catch {
731
+ }
732
+ }
723
733
  var warned;
724
734
  var init_warnOnce = __esm({
725
735
  "src/warnOnce.ts"() {
@@ -2892,7 +2902,7 @@ var init_http = __esm({
2892
2902
  * Start a replay session by fetching historical traces.
2893
2903
  * Blocking call - creates an experiment and returns lightweight item references.
2894
2904
  */
2895
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes, metadata) {
2905
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, skipAssertionJudging, experimentalSelectiveReplay, notes, metadata) {
2896
2906
  const payload = { traceFunctionKey };
2897
2907
  if (experimentalSelectiveReplay !== void 0) {
2898
2908
  payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
@@ -2947,7 +2957,7 @@ var init_http = __esm({
2947
2957
  if (onlyWithAssertions) {
2948
2958
  payload.onlyWithAssertions = true;
2949
2959
  }
2950
- if (judgeAssertions) {
2960
+ if (skipAssertionJudging !== true) {
2951
2961
  payload.judgeAssertions = true;
2952
2962
  }
2953
2963
  const git = await resolvedGitState();
@@ -3454,7 +3464,7 @@ async function captureCodeChangeFromGit(cwd, label) {
3454
3464
  if (!resolved2) {
3455
3465
  return null;
3456
3466
  }
3457
- const { base, fromTrunk } = resolved2;
3467
+ const { base, against } = resolved2;
3458
3468
  const blobBytes = async (ref2, path) => {
3459
3469
  const out = await git(root, ["cat-file", "-s", `${ref2}:${path}`]);
3460
3470
  const n = out ? Number.parseInt(out.trim(), 10) : Number.NaN;
@@ -3522,7 +3532,6 @@ async function captureCodeChangeFromGit(cwd, label) {
3522
3532
  const subject = (await git(root, ["log", "-1", "--format=%s", "HEAD"]))?.trim();
3523
3533
  const fileWord = files.length === 1 ? "file" : "files";
3524
3534
  const head = label?.trim() || subject || "Working-tree change";
3525
- const against = fromTrunk ? "vs trunk" : "uncommitted (vs HEAD)";
3526
3535
  return {
3527
3536
  description: `${head} (${files.length} ${fileWord} changed ${against})`,
3528
3537
  files
@@ -3535,18 +3544,9 @@ async function resolveBase(git, root) {
3535
3544
  const forced = process.env?.BITFAB_CODE_CHANGE_BASE;
3536
3545
  if (forced && await refExists(git, root, forced)) {
3537
3546
  const base = (await git(root, ["merge-base", "HEAD", forced]))?.trim() || (await git(root, ["rev-parse", "--verify", forced]))?.trim() || null;
3538
- return base ? { base, fromTrunk: true } : null;
3547
+ return base ? { base, against: `vs ${forced}` } : null;
3539
3548
  }
3540
- for (const candidate of TRUNK_CANDIDATES) {
3541
- if (!await refExists(git, root, candidate)) {
3542
- continue;
3543
- }
3544
- const mb = (await git(root, ["merge-base", "HEAD", candidate]))?.trim();
3545
- if (mb) {
3546
- return { base: mb, fromTrunk: true };
3547
- }
3548
- }
3549
- return await refExists(git, root, "HEAD") ? { base: "HEAD", fromTrunk: false } : null;
3549
+ return await refExists(git, root, "HEAD") ? { base: "HEAD", against: "uncommitted (vs HEAD)" } : null;
3550
3550
  }
3551
3551
  async function refExists(git, root, ref2) {
3552
3552
  return await git(root, ["rev-parse", "--verify", `${ref2}^{object}`]) !== null;
@@ -3580,7 +3580,7 @@ function parseNameStatusZ(raw) {
3580
3580
  function looksBinary(s) {
3581
3581
  return s.slice(0, 8e3).includes(NUL);
3582
3582
  }
3583
- var MAX_FILES, MAX_FILE_BYTES, MAX_TOTAL_BYTES, TRUNK_CANDIDATES, NUL;
3583
+ var MAX_FILES, MAX_FILE_BYTES, MAX_TOTAL_BYTES, NUL;
3584
3584
  var init_codeChange = __esm({
3585
3585
  "src/codeChange.ts"() {
3586
3586
  "use strict";
@@ -3588,13 +3588,6 @@ var init_codeChange = __esm({
3588
3588
  MAX_FILES = 60;
3589
3589
  MAX_FILE_BYTES = 5e5;
3590
3590
  MAX_TOTAL_BYTES = 2e6;
3591
- TRUNK_CANDIDATES = [
3592
- "origin/HEAD",
3593
- "origin/main",
3594
- "origin/master",
3595
- "main",
3596
- "master"
3597
- ];
3598
3591
  NUL = String.fromCharCode(0);
3599
3592
  }
3600
3593
  });
@@ -4049,13 +4042,15 @@ var replay_exports = {};
4049
4042
  __export(replay_exports, {
4050
4043
  BITFAB_PROGRESS_PREFIX: () => BITFAB_PROGRESS_PREFIX,
4051
4044
  DbBranchReplayError: () => DbBranchReplayError,
4045
+ JUDGE_ASSERTIONS_DEPRECATION_WARNING: () => JUDGE_ASSERTIONS_DEPRECATION_WARNING,
4052
4046
  ReplayError: () => ReplayError,
4053
4047
  deserializeInputs: () => deserializeInputs,
4054
4048
  replay: () => replay,
4055
4049
  reportReplayProgress: () => reportReplayProgress,
4056
4050
  serializeReplayResult: () => serializeReplayResult,
4057
4051
  sleepForReplayPersistence: () => sleepForReplayPersistence,
4058
- waitForReplayPersistence: () => waitForReplayPersistence
4052
+ waitForReplayPersistence: () => waitForReplayPersistence,
4053
+ warnJudgeAssertionsDeprecated: () => warnJudgeAssertionsDeprecated
4059
4054
  });
4060
4055
  function expandReplayWork(serverItems, attempts) {
4061
4056
  return Array.from(
@@ -4606,7 +4601,17 @@ async function mapWithConcurrency2(tasks, maxConcurrency, onSettled, onStarted,
4606
4601
  await Promise.all(workers);
4607
4602
  return results.slice(0, nextIndex);
4608
4603
  }
4604
+ function warnJudgeAssertionsDeprecated(write = console.warn) {
4605
+ writeOnce(
4606
+ "judgeAssertions-deprecated",
4607
+ JUDGE_ASSERTIONS_DEPRECATION_WARNING,
4608
+ write
4609
+ );
4610
+ }
4609
4611
  async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, registeredOverrides = []) {
4612
+ if (options?.judgeAssertions !== void 0) {
4613
+ warnJudgeAssertionsDeprecated();
4614
+ }
4610
4615
  if (options?.resume !== void 0) {
4611
4616
  validateResume(options.resume, options);
4612
4617
  } else if (options?.force === true) {
@@ -4683,7 +4688,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
4683
4688
  requestedAttempts,
4684
4689
  options?.adaptInputs !== void 0,
4685
4690
  options?.onlyWithAssertions,
4686
- options?.judgeAssertions,
4691
+ options?.skipAssertionJudging === true || options?.judgeAssertions === false,
4687
4692
  options?.experimentalSelectiveReplay,
4688
4693
  options?.notes,
4689
4694
  options?.metadata
@@ -5058,7 +5063,7 @@ async function writeReplayResultFile(result) {
5058
5063
  }
5059
5064
  }
5060
5065
  }
5061
- var REPLAY_PERSISTENCE_TIMEOUT_MS, MAX_REPLAY_ATTEMPTS, RESUME_CONFLICTING_OPTIONS, CARRIED_OVER_ERROR, BITFAB_PROGRESS_PREFIX, ReplayError, DbBranchReplayError;
5066
+ var REPLAY_PERSISTENCE_TIMEOUT_MS, MAX_REPLAY_ATTEMPTS, RESUME_CONFLICTING_OPTIONS, CARRIED_OVER_ERROR, BITFAB_PROGRESS_PREFIX, ReplayError, DbBranchReplayError, JUDGE_ASSERTIONS_DEPRECATION_WARNING;
5062
5067
  var init_replay = __esm({
5063
5068
  "src/replay.ts"() {
5064
5069
  "use strict";
@@ -5073,6 +5078,7 @@ var init_replay = __esm({
5073
5078
  init_replayInterrupt();
5074
5079
  init_selectiveReplayRuntime();
5075
5080
  init_serialize();
5081
+ init_warnOnce();
5076
5082
  REPLAY_PERSISTENCE_TIMEOUT_MS = 3e4;
5077
5083
  MAX_REPLAY_ATTEMPTS = 100;
5078
5084
  RESUME_CONFLICTING_OPTIONS = [
@@ -5109,6 +5115,7 @@ var init_replay = __esm({
5109
5115
  this.name = "DbBranchReplayError";
5110
5116
  }
5111
5117
  };
5118
+ JUDGE_ASSERTIONS_DEPRECATION_WARNING = "Bitfab: judgeAssertions is deprecated. Assertion judging is on by default; pass skipAssertionJudging: true (--skip-assertion-judging) to turn it off.";
5112
5119
  }
5113
5120
  });
5114
5121