Pages
- TypeScript SDK Reference:
@bitfab/sdknpm package - Python SDK Reference:
bitfab-pyPyPI package - Ruby SDK Reference:
bitfabRubyGem - Go SDK Reference:
github.com/Project-White-Rabbit/bitfab-gomodule - Span Types: common
SpanTypeenum - HTTP Endpoints: trace ingestion and lookup endpoints the SDKs call
- OpenTelemetry Transport Architecture: batching, delivery, and replay persistence boundaries
Instrumentation Primitives
The client exposes three instrumentation primitives, not just spans. A span is an explicit boundary you write yourself. A trace records a root plus every first-party call beneath it, with no decorators on those calls. A node applies trace-owned policy (name, type, capture, replay mocking) to one call the trace discovered, and never creates a span or trace on its own.
Subtree capture is experimental. TypeScript needs a compatible
@bitfab/transform adapter and Python needs 3.12 or newer. Without them the root span still records and descendants are skipped.
Trace Seeding
Seeding writes a replayable trace from a case you already hold, soreplay has something to select before production has produced a trace for it. A seeded trace carries ingestion_type: seeded and no database pin, so a database branch is refused for it.
Seeding records its one call whether capture is on or off, so a seeding script can run against a capture-off client and record exactly the calls it seeds and nothing else. A run-seeded trace has a full recorded subtree, so replay mocking works on it as it does on a captured trace. A case-seeded trace (TypeScript only) has no child spans, so there is nothing recorded to mock. See the TypeScript and Python guides.
Datasets
Every SDK exposes the dataset operations the Bitfab MCP tools give a coding agent. Scripts and CI jobs use them to build or maintain datasets with no agent in the loop. All four namespaces cover the same ten operations over the same HTTP routes.
These semantics hold across all four SDKs.
saveis an upsert. It reports whether it created the dataset.- Adds are idempotent and accept 1 to 100 ids.
- An id from outside the organization, or under another trace function, comes back as skipped rather than failing the call.
- Removing a trace drops its membership and never deletes the trace.
- A grader re-run waits up to 90 seconds by default. Pass an option to return immediately instead.
- A dataset id from another organization is a 404.
Assertions and labels
An assertion says what a trace SHOULD do the next time it is replayed. A label is the verdict on a run that already happened. TypeScript and Python expose both. A replay process can read what the case was supposed to do, judge its own run, and write the verdict back, with no coding agent in the loop. Ruby and Go expose neither namespace.client.labels keys a replay verdict by attempt, and neither SDK has replay attempts, so there is nothing for the surface to express there.
These semantics hold across TypeScript and Python.
- Assertions are written against the original trace. A replay with none of its own reads its original’s assertions, naming that trace in
inheritedFrom. - Saving with an entry’s id edits that assertion in place.
saveAssertionsAll/save_assertions_alltakes one update per trace, so covering many traces is one request in one transaction. A rejected batch writes nothing. The singular delegates to it.- A field omitted from that save keeps its previous value.
- Editing an assertion never changes its original author, which is always the API key’s user.
- A verdict is keyed by
traceId, or byoriginalTraceIdplustestRunIdandattemptfor a replay. skipwithholds a verdict for a crashed or punctured attempt, and for an assertion whose target could not be resolved. A FAIL in either case would read as a behavior regression rather than a check that never ran.
Replay execution and results
Every SDK returns a common set of fields on each replay result.- The replayed output and the original output.
- Distinct trace-code and replay-setup errors.
- Duration and token comparisons.
- Source lineage.
- Database branch metadata.
- Original and replayed trace outlines.