bitfab 0.23.0 → 0.23.1

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: 26ad3b53b9f3da35c01496ecc236ce0f5d27e7921761c7baca7654d1fb8de31e
4
- data.tar.gz: e653a93c4bf8e5263b22a6114ebcc2a52db6cc3db6eecc7774cb7b6ed07c51c3
3
+ metadata.gz: 3827f24f9f67b8264b588233b5e1eb3ffe6581dca039951a391253a87cf7c10b
4
+ data.tar.gz: 744d87d7188cb454c03242b95ff0ba7e1a0c0d53f131df9aff7449920ec69414
5
5
  SHA512:
6
- metadata.gz: 7c31a1ffd2e8be0cd31fd94941479351176823eabeadf453972bd493aeadbbc7de97002f484787a6e009024a42a6ed1e3a8fc99ded4b94eb3fd842d6e03772e9
7
- data.tar.gz: 01ee591f9c3a51254abc101229ba261bc054acd02bfe7c67471367fd8cb0cc2fa015a1c1affc149358caf7dc5af98c7ea4f5351973153b60c6983befbc4d7ac7
6
+ metadata.gz: 4a376efa4cba26a1aff6728acea5deded7982f12fcc60fe586dbc84850653a2649565bdf88d3ac49eb2ddaac78c4e257533a22aebf5fbe8b559f4dd0699e572f
7
+ data.tar.gz: 726b98d0e1516d621bed5bda08b26fc62a47fbdcc3b3bfd17777208513b3c5979213761aa1175cb7ec18d4351fe729f49562fcbea3ddf73d5d1744f25f308c25
data/lib/bitfab/replay.rb CHANGED
@@ -266,7 +266,7 @@ module Bitfab
266
266
  # SOURCE (historical) trace that was replayed, taken from the server
267
267
  # item: the result's own :trace_id at this stage is the new replay
268
268
  # trace id (assigned in run() after complete_replay), not the source.
269
- report = lambda do |result, source_trace_id|
269
+ report = lambda do |result, source_trace_id, test_run_id|
270
270
  return unless on_progress
271
271
 
272
272
  progress_mutex.synchronize do
@@ -275,8 +275,19 @@ module Bitfab
275
275
  error.nil? ? (succeeded += 1) : (errored += 1)
276
276
  begin
277
277
  on_progress.call({
278
- completed:, total:, succeeded:, errored:,
279
- item: {trace_id: source_trace_id, error:, duration_ms: result[:duration_ms]}
278
+ test_run_id:, completed:, total:, succeeded:, errored:,
279
+ item: {
280
+ trace_id: source_trace_id,
281
+ replay_trace_id: result[:trace_id],
282
+ input: result[:input],
283
+ result: result[:result],
284
+ original_output: result[:original_output],
285
+ error:,
286
+ duration_ms: result[:duration_ms],
287
+ tokens: result[:tokens],
288
+ model: result[:model],
289
+ db_snapshot_ref: result[:db_snapshot_ref]
290
+ }
280
291
  })
281
292
  rescue => e
282
293
  warn "Bitfab: replay on_progress callback raised: #{e.message}"
@@ -288,7 +299,7 @@ module Bitfab
288
299
  server_items.map do |item|
289
300
  result = process_single_item(http_client, item, receiver, method_name, test_run_id, mock_strategy,
290
301
  adapt_inputs, include_db_branch_lease)
291
- report.call(result, item["traceId"])
302
+ report.call(result, item["traceId"], test_run_id)
292
303
  result
293
304
  end
294
305
  else
@@ -306,7 +317,7 @@ module Bitfab
306
317
  result = process_single_item(http_client, item, receiver, method_name, test_run_id, mock_strategy,
307
318
  adapt_inputs, include_db_branch_lease)
308
319
  results_mutex.synchronize { results[idx] = result }
309
- report.call(result, item["traceId"])
320
+ report.call(result, item["traceId"], test_run_id)
310
321
  end
311
322
  end
312
323
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.23.0"
4
+ VERSION = "0.23.1"
5
5
  end
data/lib/bitfab.rb CHANGED
@@ -110,10 +110,9 @@ module Bitfab
110
110
  # line per trace to stderr, which the Bitfab plugin polls to report live
111
111
  # progress while the replay runs in the background, so replay scripts never
112
112
  # hand-format the protocol. stdout stays the ReplayResult JSON. Never raises
113
- # (progress must not crash a run). The progress hash's item ({ trace_id:,
114
- # error:, duration_ms: }) is forwarded verbatim through to_json, so the
115
- # plugin sees the source trace id, error, and duration of the item that just
116
- # settled.
113
+ # (progress must not crash a run). The progress hash's item is forwarded
114
+ # verbatim through to_json, so the plugin sees the source trace id, local
115
+ # replay trace id, outputs, error, and duration of the item that just settled.
117
116
  #
118
117
  # @example
119
118
  # Bitfab.client.replay(..., on_progress: Bitfab.method(:report_replay_progress))
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.23.0
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team