bitfab 0.61.1 → 0.62.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49768c67671b66ea8066cfa078dbba13ac3548b83b9a0abaa628ab864a61b99f
4
- data.tar.gz: 76e711a41258fa421a69cd6a0475a793698f3bdd001f60d0104ec47a5096e8da
3
+ metadata.gz: 4a04ce4c6087bca4125aeb03947b00facce1f8b1f8da0ab35973c110ef1f40ae
4
+ data.tar.gz: c66fec4e4390bbdfa35f1a12a010bc070400309b874c2531f48930729754712f
5
5
  SHA512:
6
- metadata.gz: bdef7ec071b9740bd8183056b68b84e9ab2c8004f0918678c604e9e35d6426144891bd5df0e476a59f8198e1f17459a4e0e48c08e3eab78061b119146e38b3f1
7
- data.tar.gz: d441d62917aaa84b3dfbc88f6544e1630645fc5a595a7a3cf9b3e111bdbf62b43059b971ecb9f51001d45c8f28ecf7322afc07537307231fab71736f3852c80a
6
+ metadata.gz: 5c0d3bf2b9f187c8e0ec6e9ce99cf28b81cf992377e4621e9636d77cd79a027a15f857e3572ba0bf8ebf5a4912cbd4fd8da8cd652ab1d2ad5f77e43073ba8c6e
7
+ data.tar.gz: 64eef7e076828f8ab95c4b53f0f2c95061b142819d8e705ac59417a6b2df95da6ed6f4e5100627881e8de8582f769a6cf557e99b9a3ad3185eeb2e1e9f247ece
data/lib/bitfab/client.rb CHANGED
@@ -120,6 +120,13 @@ module Bitfab
120
120
  # Passed alongside dataset_id or dataset_ids it pins which members of that
121
121
  # selection replay, and the server rejects any ID none of those datasets
122
122
  # contains
123
+ # @param name [String, nil] What this run is testing, in a few words, such
124
+ # as 'baseline' or 'shorter system prompt'. Bitfab records the commit,
125
+ # branch, tree state, datasets, and who ran it with every experiment, so
126
+ # do not repeat them here.
127
+ # @param notes [String, nil] Run conditions Bitfab cannot see on its own,
128
+ # such as an environment override or a forced feature flag. Kept on the
129
+ # experiment next to its name (max 10,000 characters).
123
130
  # @param max_concurrency [Integer, nil] max threads for parallel replay (default: 10)
124
131
  # @param code_change_description [String, nil] optional rationale for the
125
132
  # code change being tested in this replay (stored on the experiment).
@@ -190,7 +197,7 @@ module Bitfab
190
197
  # @return [Hash] with :items, :experiment_id, :experiment_url, and the
191
198
  # deprecated aliases :test_run_id and :test_run_url carrying the same values
192
199
  def replay(receiver, method_name = nil, trace_function_key:, limit: nil, trace_ids: nil, concurrency: nil, max_concurrency: ReplayConcurrency::UNSET,
193
- name: nil, code_change_description: Replay::CODE_CHANGE_UNSET, code_change_files: Replay::CODE_CHANGE_UNSET, experiment_group_id: nil, dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, judge_assertions: false, dry_run: false,
200
+ name: nil, notes: nil, code_change_description: Replay::CODE_CHANGE_UNSET, code_change_files: Replay::CODE_CHANGE_UNSET, experiment_group_id: nil, dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, judge_assertions: false, dry_run: false,
194
201
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
195
202
  on_experiment_start: nil, experimental_selective_replay: nil)
196
203
  Replay.run(
@@ -201,6 +208,7 @@ module Bitfab
201
208
  limit:,
202
209
  trace_ids:,
203
210
  name:,
211
+ notes:,
204
212
  concurrency:,
205
213
  max_concurrency:,
206
214
  attempts:,
@@ -261,7 +261,7 @@ module Bitfab
261
261
  # runnable graders at completion; each must be an active/live grader in the
262
262
  # same org and trace function or the server rejects the replay
263
263
  def start_replay(trace_function_key, limit, trace_ids: nil, code_change_description: nil,
264
- code_change_files: nil, experiment_group_id: nil, name: nil, include_db_branch_lease: false, dataset_ids: nil,
264
+ code_change_files: nil, experiment_group_id: nil, name: nil, notes: nil, include_db_branch_lease: false, dataset_ids: nil,
265
265
  grader_ids: nil, db_branch_settings: nil, attempts: 1, only_with_assertions: false, judge_assertions: false, include_original_metadata: false, experimental_selective_replay: nil)
266
266
  payload = {
267
267
  "traceFunctionKey" => trace_function_key
@@ -271,6 +271,7 @@ module Bitfab
271
271
  payload["limit"] = limit unless limit.nil?
272
272
  payload["traceIds"] = trace_ids if trace_ids
273
273
  payload["name"] = name unless name.nil?
274
+ payload["notes"] = notes unless notes.nil?
274
275
  payload["codeChangeDescription"] = code_change_description unless code_change_description.nil?
275
276
  payload["codeChangeFiles"] = normalize_code_change_files(code_change_files) unless code_change_files.nil?
276
277
  payload["experimentGroupId"] = experiment_group_id unless experiment_group_id.nil?
data/lib/bitfab/replay.rb CHANGED
@@ -205,7 +205,13 @@ module Bitfab
205
205
  # already determines how many traces replay. Supplying trace_ids also
206
206
  # emits a warning.
207
207
  # @param trace_ids [Array<String>, nil] optional list of trace IDs to replay (max 100)
208
- # @param name [String, nil] optional display name for the resulting experiment
208
+ # @param name [String, nil] What this run is testing, in a few words, such
209
+ # as 'baseline' or 'shorter system prompt'. Bitfab records the commit,
210
+ # branch, tree state, datasets, and who ran it with every experiment, so
211
+ # do not repeat them here.
212
+ # @param notes [String, nil] Run conditions Bitfab cannot see on its own,
213
+ # such as an environment override or a forced feature flag. Kept on the
214
+ # experiment next to its name (max 10,000 characters).
209
215
  # @param max_concurrency [Integer, nil] max threads for parallel replay (default: 10)
210
216
  # @param code_change_description [String, nil] optional rationale for the
211
217
  # code change being tested in this replay (stored on the experiment).
@@ -274,7 +280,7 @@ module Bitfab
274
280
  # crashes the run.
275
281
  # @return [Hash] with :items, :experiment_id, :experiment_url, and the
276
282
  # deprecated aliases :test_run_id and :test_run_url carrying the same values
277
- def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, name: nil,
283
+ def run(client, receiver, method_name, trace_function_key:, limit: nil, trace_ids: nil, name: nil, notes: nil,
278
284
  concurrency: nil, max_concurrency: ReplayConcurrency::UNSET, code_change_description: CODE_CHANGE_UNSET, code_change_files: CODE_CHANGE_UNSET, experiment_group_id: nil,
279
285
  dataset_id: nil, dataset_ids: nil, grader_ids: nil, mock: "marked", attempts: ReplayConcurrency::UNSET, only_with_assertions: false, judge_assertions: false, dry_run: false,
280
286
  adapt_inputs: nil, mock_override: nil, db_branch: nil, on_item_start: nil, on_item_finish: nil, on_progress: nil,
@@ -371,6 +377,7 @@ module Bitfab
371
377
  effective_limit,
372
378
  trace_ids:,
373
379
  name:,
380
+ notes:,
374
381
  code_change_description:,
375
382
  code_change_files:,
376
383
  experiment_group_id:,
@@ -458,8 +465,6 @@ module Bitfab
458
465
  # run's tokens (span-aggregated server-side), used below to fill each
459
466
  # item's :tokens.
460
467
  replay_tokens = complete_response&.dig("tokens") || {}
461
- replay_outlines = complete_response&.dig("traceOutlines") || {}
462
- original_outlines = complete_response&.dig("originalTraceOutlines") || {}
463
468
 
464
469
  # trace_id_map maps each item's client-side correlation id (:_sdk_trace_id,
465
470
  # which tagged that item's spans during the run) to the server's trace row
@@ -483,11 +488,7 @@ module Bitfab
483
488
  completed_count += 1
484
489
  missing << local_id if mapped.nil?
485
490
  end
486
- if mapped
487
- item[:tokens] = normalize_tokens(replay_tokens[mapped])
488
- item[:trace_outline] = replay_outlines[mapped]
489
- end
490
- item[:original_trace_outline] = original_outlines[item[:original_trace_id]] if item[:original_trace_id]
491
+ item[:tokens] = normalize_tokens(replay_tokens[mapped]) if mapped
491
492
  end
492
493
  # ALL completed items missing: systemic (the replayed method is not
493
494
  # traced, or uploads are wholesale broken). Raise; the run's traces
@@ -880,9 +881,7 @@ module Bitfab
880
881
  tokens: result[:tokens],
881
882
  model: result[:model],
882
883
  db_snapshot_ref: result[:db_snapshot_ref],
883
- db_branch_timings: result[:db_branch_timings],
884
- trace_outline: result[:trace_outline],
885
- original_trace_outline: result[:original_trace_outline]
884
+ db_branch_timings: result[:db_branch_timings]
886
885
  }
887
886
  })
888
887
  rescue => e
@@ -1084,9 +1083,7 @@ module Bitfab
1084
1083
  source_trace_id: original_trace_id,
1085
1084
  source_span_id: original_span_id,
1086
1085
  db_snapshot_ref:,
1087
- db_branch_timings:,
1088
- trace_outline: nil,
1089
- original_trace_outline: nil
1086
+ db_branch_timings:
1090
1087
  }
1091
1088
  ensure
1092
1089
  release_db_branch_lease(http_client, lease) if lease
@@ -1396,9 +1393,7 @@ module Bitfab
1396
1393
  source_trace_id: source_bitfab_trace_id,
1397
1394
  source_span_id: input_source_span_id,
1398
1395
  db_snapshot_ref:,
1399
- db_branch_timings:,
1400
- trace_outline: nil,
1401
- original_trace_outline: nil
1396
+ db_branch_timings:
1402
1397
  }
1403
1398
  end
1404
1399
  end
@@ -19,7 +19,7 @@ module Bitfab
19
19
  # Project-owned registry of production replay roots.
20
20
  class ReplayRegistry
21
21
  OPTION_NAMES = %i[
22
- limit trace_ids name concurrency max_concurrency code_change_description
22
+ limit trace_ids name notes concurrency max_concurrency code_change_description
23
23
  code_change_files experiment_group_id dataset_id dataset_ids grader_ids mock
24
24
  mock_override adapt_inputs db_branch attempts only_with_assertions judge_assertions dry_run on_item_finish
25
25
  ].freeze
@@ -186,7 +186,7 @@ module Bitfab
186
186
  options[:limit] = bound || 10
187
187
  end
188
188
 
189
- %i[name max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions dry_run].each do |key|
189
+ %i[name notes max_concurrency experiment_group_id dataset_ids grader_ids mock attempts only_with_assertions dry_run].each do |key|
190
190
  options[key] = args[key] unless args[key].nil?
191
191
  end
192
192
 
@@ -284,7 +284,13 @@ module Bitfab
284
284
  options.on("--seed PATH", "--cases PATH") { |value| args[:seed] = value }
285
285
  options.on("--run") { args[:run] = true }
286
286
  options.on("--from-trace IDS") { |value| args[:from_trace] = comma_separated("--from-trace", value) }
287
- options.on("--name NAME") { |value| args[:name] = value }
287
+ options.on("--name NAME",
288
+ "What this run is testing, in a few words, such as 'baseline' or 'shorter system prompt'. " \
289
+ "Bitfab records the commit, branch, tree state, datasets, and who ran it with every experiment, " \
290
+ "so do not repeat them here.") { |value| args[:name] = value }
291
+ options.on("--notes TEXT",
292
+ "Run conditions Bitfab cannot see on its own, such as an environment override or a forced feature flag. " \
293
+ "Kept on the experiment next to its name.") { |value| args[:notes] = value }
288
294
  options.on("--concurrency N", Integer) do |value|
289
295
  args[:max_concurrency] = positive_integer("--concurrency", value)
290
296
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.61.1"
4
+ VERSION = "0.62.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.61.1
4
+ version: 0.62.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team