Is BayesPredicts production-ready at 1.0.0?
Yes. 148 tests pass under Vitest 4 with 94% coverage; TypeScript 6 maximum strict mode is clean; Biome 2.5
lint is clean; publint and @arethetypeswrong/cli are clean across all fourteen
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.
How is this different from anomaly detection?
Anomaly detection tells you a metric looks wrong right now; it does not tell you when the component will
fail. BayesPredicts fits a survival model from the lifecycle history and forecasts the time to the next
failure, with a calibrated probability over a future window and a credible interval on the remaining life, so
you can act before the failure rather than alert during it.
What if most of my components have not failed yet?
That is the normal case and it is handled natively. A component still running at observation time is a
right-censored observation that informs the posterior without being counted as a failure. Survival analysis
is built precisely for data where most subjects have not yet experienced the event, so a fleet that is mostly
healthy still produces a useful estimate.
Exponential or Weibull, which model should I use?
Leave the model on auto. It fits the Weibull and keeps the simpler, constant-hazard Exponential
whenever the shape posterior is consistent with a constant hazard, so you do not over-fit wear-out on thin
data. Force either with { model: "exponential" } for memoryless failures or
{ model: "weibull" } for components that age. The choice and its reasoning are returned with the
fit.
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/bayespredicts or @takk/bayespredicts/edge on any runtime with Web Crypto, and
call the tool adapter from a non-human-entity loop. Only @takk/bayespredicts/node requires the
Node standard library, for reading history files from disk.
How does BayesPredicts handle my data?
BayesPredicts records the component identifiers, the durations and censored flags, the lifecycle events, and
timestamps you supply. It never sees your raw logs or payloads and makes no outbound network calls of its
own. With the file loaders, it only reads the history file you point it at; no secrets are involved at any
point.
What happens before any component has failed (cold start)?
The default prior contributes one pseudo-failure, so the rate stays finite and positive even before the
first real failure, while the data sets the time scale. To anchor the estimate to a known base rate, pass
your own Gamma prior; each new failure or censored observation then folds into the posterior in
closed form.
Where does the state live?
The posterior is a small set of numbers, the shape and rate of the fitted model, that you can serialize
wherever you like. History is read from a JSON or CSV file with the loaders in
@takk/bayespredicts/node, or fed in directly as events or observations. For an edge runtime,
keep the history in 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 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 kinds of input can I feed it?
Either raw lifecycle events, start, failure, stop, and
censor per component, which fold into observations, or ready-made observations of a duration and
a censored flag. A later start for the same component is a renewed life, so repeated failures become repeated
observations.
How do I verify a published version's provenance?
Every release is published with npm publish --provenance. Check the attestations with
npm view @takk/bayespredicts@<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.
Does it restart my components for me?
No. BayesPredicts produces the recommendation, restart now or keep monitoring, with the reasoning and the
optimal restart age. Your orchestrator, Kubernetes, ECS, a Hermes runtime hook, or your own controller,
consumes that decision and acts. Turnkey orchestrator integrations are on the roadmap.
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.