Is BayesDecide production-ready at 1.0.0?
Yes. 106 tests pass under Vitest 4 with 96% coverage; TypeScript 6 maximum strict mode is clean; Biome 2.5
lint is clean; publint and @arethetypeswrong/cli are clean across all sixteen
subpaths. The suite and the distribution smoke test are run on the Node 20, 22, and 24 matrix. Every
published release carries SLSA provenance produced by GitHub Actions.
Why not just run a fixed-N A/B test?
A fixed-N A/B test holds an even split for the whole run, so it keeps paying the cost of every losing
variant until it hits a preset sample size. BayesDecide uses Thompson sampling to send more traffic to the
variant that looks best while staying calibrated, and a stopping rule promotes a winner when the evidence is
strong. In the 2-variant large-gap benchmark that cuts the uniform A/B test's regret by up to 99.5%, regret
4.4 against 800.
Does it auto-route my production traffic to the winner?
No. The promotion engine is advisory: decide returns a recommended winner with the probability
it is best and the reason, but it does not move traffic itself. You stay in control of the rollout, a
deliberate seam so a human or a non-human entity owns the promotion rather than a silent auto-route.
What is the difference between the two stopping modes?
The default stopping rule is a Bayesian decision heuristic: it fires when the probability the best variant
is best clears a threshold. The anytime-valid mode is an error-controlled confidence-sequence test that
stays valid even under unlimited peeking, so you can check it as often as you like without inflating the
false-positive rate. The docs are explicit about which guarantee each one gives.
Does this work in Cloudflare Workers, Vercel Edge, Bun, or Deno?
Yes. The core is node-free; the audit seal uses the Web Crypto API, not node:crypto. Import
@takk/bayesdecide on any runtime with Web Crypto, and bind the prompt router to Vercel AI SDK,
Mastra, Genkit, raw fetch, or a non-human-entity loop. Only @takk/bayesdecide/node requires the
Node standard library.
How does BayesDecide handle my data?
BayesDecide records the variant identifiers and cohort labels you choose, the posterior parameters, the
observed reward counts, and timestamps. It never sees your prompts or model outputs and makes no outbound
network calls of its own. With the file store, only that experiment state reaches disk; no secrets are
involved at any point.
What happens with a brand-new variant (cold start)?
A new variant starts at its prior, the uniform Beta(1, 1) by default, so it is explored early before the
data can write it off. To start from a better belief, pass OPTIMISTIC_PRIOR or a
perVariantPrior override so a promising new prompt gets sampled until it has data of its own.
Where does the state live?
In-process memory by default, with portable JSON snapshots via snapshot() and
load(). For durability across restarts, use createFileStore from
@takk/bayesdecide/node. For an edge runtime, snapshot to your own KV store between invocations.
Is the audit trail a digital signature?
No, and the docs are explicit about it. The seal is a SHA-256 hash-chain root that proves a log was not
altered after sealing. It is an integrity seal, not a signature: it does not prove who produced the log.
Signed and timestamped seals for stronger third-party evidence are on the roadmap.
What unit is the reward in?
For the Beta-Bernoulli arm, a reward in [0, 1]: a binary success or a fractional LLM-as-judge
score. For unbounded metrics like latency or cost in dollars, use the Gaussian arm, which models a real
value with a Normal posterior. Pick the arm that matches the signal you are optimizing.
How do I verify a published version's provenance?
Every release is published with npm publish --provenance. Check the attestations with
npm view @takk/bayesdecide@<version> --json | jq .dist.attestations. The attestation
links the tarball you installed to the GitHub Actions workflow that built it from a specific source commit.
Can I plug in my own store backend?
Yes. Snapshot the posteriors to portable JSON with snapshot() and restore them with
load(), persisting that JSON wherever you like, SQLite, Postgres, Redis, or a KV store. The
createFileStore file store is the zero-dependency reference for Node.
What is the policy on breaking changes?
Strict SemVer 2.0.0, starting from 1.0.0. The binding stability surface is documented in SPEC.md section
5. Major bumps require a deprecation cycle; security fixes follow the disclosure flow in SECURITY.md.