bitfab 0.72.0 → 0.73.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 +4 -4
- data/lib/bitfab/assertions.rb +7 -5
- data/lib/bitfab/scenarios.rb +12 -4
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a30e89baf273769afece482948a0ff108d9a1a2481fad9b2edbcbf8169a344f
|
|
4
|
+
data.tar.gz: c6807a2ba664c08f1626b879242fab202a37859f0c8c3af2c833e6fc5df74b0d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fffcdc93382999f0f4e087f8cdeab967768afebfc14ef98d9235257102604d5a9e2203d4953f5fa2f04e77c4656fdd14d08113276c5ccbb34162663bdd9a2180
|
|
7
|
+
data.tar.gz: 123101bb86a8eafa4fb4f89e86f1856a29e9d262adfc134b0fbad9ca505e9bf51b46532df51658509d1d7c54b7d7362c0faa8ebb71cd15b3cc880660eb4707a4
|
data/lib/bitfab/assertions.rb
CHANGED
|
@@ -32,11 +32,13 @@ module Bitfab
|
|
|
32
32
|
# "kind" says who decides the assertion: "judge" (the LLM judge), "code"
|
|
33
33
|
# ("code" decides every replay), or "hybrid" ("code" decides what it can
|
|
34
34
|
# and returns "defer" for the rest). Send "code" or "hybrid" together with
|
|
35
|
-
# "code", {"source" => ..., "spanNames" => [...]}. "source" is the body of
|
|
36
|
-
# TypeScript (or plain JavaScript) function called with spans
|
|
37
|
-
# {name,
|
|
38
|
-
#
|
|
39
|
-
#
|
|
35
|
+
# "code", {"source" => ..., "spanNames" => [...]}. "source" is the body of
|
|
36
|
+
# an async TypeScript (or plain JavaScript) function called with spans
|
|
37
|
+
# (each {name, index, hasData}, in start order, without its data), input,
|
|
38
|
+
# and output. It reads span data with await named("span name") or await
|
|
39
|
+
# span.data(), and returns "pass", "fail", or "defer" (hybrid only), or
|
|
40
|
+
# {result, reason}, with one second of compute and the data of at most 50
|
|
41
|
+
# spans loaded within ten seconds. "spanNames" lists every span a correct run is
|
|
40
42
|
# expected to produce. Code that cannot run on the trace, or that returns
|
|
41
43
|
# "defer" for a "code" assertion, is refused. Omit both to keep them, or
|
|
42
44
|
# pass "kind" => "judge" to remove the code. Returned assertions carry
|
data/lib/bitfab/scenarios.rb
CHANGED
|
@@ -9,14 +9,22 @@ module Bitfab
|
|
|
9
9
|
RECORDS_KEYS_IN_DATA = %w[records sources].freeze
|
|
10
10
|
private_constant :RECORDS_KEYS_IN_DATA
|
|
11
11
|
|
|
12
|
+
# Reads the scenario built from trace_id, in any creation state, and returns its hash. "creationStatus" is
|
|
13
|
+
# "empty" when nothing has started building it, "generating" while Bitfab builds it or waits for the scenario
|
|
14
|
+
# callback to save it, "created" once it is built, and "error" when building failed, with "creationError" saying
|
|
15
|
+
# why. "trigger", "data", "triggerSummary", and "dataSummary" are nil until the scenario is built. After
|
|
16
|
+
# generate_scenario, poll this until "creationStatus" is "created" or "error". A trace with no scenario at all
|
|
17
|
+
# raises an error.
|
|
12
18
|
def get_scenario(trace_id)
|
|
13
19
|
@http_client.get(scenario_path(trace_id))["scenario"]
|
|
14
20
|
end
|
|
15
21
|
|
|
16
|
-
# Starts building the scenario for trace_id and returns at once, without waiting for it.
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
22
|
+
# Starts building the scenario for trace_id and returns at once, without waiting for it. Poll get_scenario until
|
|
23
|
+
# its "creationStatus" is "created" or "error". Returns {"status", "traceId", "scenarioId", "creationStatus"}:
|
|
24
|
+
# "status" is "started" while Bitfab builds it in the background, or "already_generated" when the trace already
|
|
25
|
+
# has a scenario, which is left as it is and named by "scenarioId". A scenario whose build failed is started
|
|
26
|
+
# again. "scenarioId" is nil while the trace has no scenario yet, and "creationStatus" is the scenario's creation
|
|
27
|
+
# status right after the call.
|
|
20
28
|
#
|
|
21
29
|
# A replay, a trace outside the organization, or a trace Bitfab cannot build a scenario for (not
|
|
22
30
|
# noah-agent-turn and no scenario callback) raises an error. Adding a trace to a dataset starts the same build
|
data/lib/bitfab/version.rb
CHANGED