Skip to content

Releases

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 19 Sep 20:23

The first stable release of typesafe-go, a community Go SDK for TypeSafe's System One API and its model, Jev.

Send one piece of content and a map of typed questions; get back calibrated probabilities your code can branch on. No dependencies, verified against the live API, and with the parts that usually go wrong — question design, context limits, confidence handling — checked at build time rather than discovered in production.

Install

go get github.com/nibir1/typesafe-go@v1.0.0
go install github.com/nibir1/typesafe-go/cmd/typesafe@v1.0.0
resp, err := client.SystemOne(ctx, &typesafe.SystemOneRequest{
    State: "Help! My payouts have been failing for 3 days.",
    Questions: typesafe.Questions{
        "is_urgent": typesafe.Noul{Instructions: "Does this convey urgency?"},
    },
})

urgent, _ := resp.Noul("is_urgent")
if urgent.Bool(0.8) { escalate() }

What you get

The client. Typed errors for every documented failure, retries with backoff and jitter honouring Retry-After, an optional circuit breaker, and a wire contract established against the live API rather than from prose — nineteen corrections are recorded in docs/WIRE_CONTRACT.md, including a Score minimum the documentation gets wrong and a maximum it never mentions.

Three primitives. Noul, Choice and Score, with typed answers. A Noul correctly has no confidence field, because the probability is the uncertainty.

A decision layer. Probability algebra, weighted policies with an audit trace, confidence bands, and weight calibration from labelled data. The trace matters: a verdict without its arithmetic is an assertion, and an appeals process needs the arithmetic.

Build-time checks. Three go/analysis analyzers catch compound questions, documented Jev failure modes, and decisions made without consulting confidence. Nothing in a response says a question was unsuitable, so build time is the only place these can be caught.

Scale. A batch API with per-item error isolation, input ordering and globally adaptive concurrency. It batches states, never questions — Jev ingests the state once and evaluates every question in parallel, so a second question is nearly free while a second state is a whole request.

Testing without a key. Mocks, a test server, and cassettes that record once against the live API and replay offline forever. Every example in the repository is tested this way.

Optional modules, each with its own go.mod: a response cache, OpenTelemetry tracing, Prometheus metrics, and integrations for net/http, Gin, Echo, Fiber, LangChainGo, Temporal and MCP.

Three things worth knowing

The state is the expensive part. Only input tokens are billed and the whole state is sent every call. Pack every question about one piece of content into a single request and fan out across content — this shapes the batch API, the cache, and most of the advice in the manual.

Low confidence means your options overlap, not that the input was vague.
Measured: "hey" scores 1.00 for unclear, because unclear is the right answer. A catch-all option raises confidence (1.00 with one, 0.47 without) by absorbing ambiguity — include one when "none of these" is actionable, leave it out when you would rather see ambiguity surface.

The SDK costs about 35 µs against an API documented at 70–500 ms — 0.05% of the fastest possible response. Measured, with the methodology, in docs/PERFORMANCE.md.

Compatibility

Go 1.23 and later for the core, the CLI and the decision package. Optional modules sit higher where a dependency forces it — 1.24 for LangChainGo, 1.25 for OpenTelemetry, Prometheus, the web frameworks and MCP, 1.26 for Temporal and the analyzers. That constrains those modules, not you.

v1.0.0 follows Semantic Versioning strictly. No exported symbol outside internal/ is removed, renamed or changed in signature during 1.x. The full statement, including what is deliberately not covered, is in the README.

Known gaps

Stated plainly, because finding them yourself later is worse:

  • The analyzers match composite literals only. Questions built with NewChoice(…), TypedChoice[T](…) or generated by typesafe-gen are not linted. Struct literals are fully covered.
  • Temporal replay is verified in the test environment, not against a recorded event history. Determinism is asserted across repeated runs with the activity mocked; a true replay test needs a real cluster.
  • No machine-applicable fixes. Splitting a compound question needs a human decision about what the two questions should be.

Verify this release

cosign verify-blob checksums.txt \
  --certificate checksums.txt.pem \
  --signature checksums.txt.sig \
  --certificate-identity-regexp 'https://github\.com/Nibir1/typesafe-go/\.github/workflows/ci\.yml@.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

gh attestation verify <archive> --repo Nibir1/typesafe-go

Getting started

Not affiliated with, endorsed by, or sponsored by TypeSafe AI.