changelog
0.7.0-beta.1
Promotes the alpha.13 code to beta. Changes across the 0.7.0 alphas:
- feat:
zat.spaceadds permissioned Spaces URIs, delegation tokens, credentials, HTTP signatures, HPKE-derived MAC secrets, commit and record MACs, LtHash, and STAR archives. Space URIs and archive metadata now useat:space/{spaceDid}/{spaceType}/{skey}. Commit MACs useatproto-space-commitand commit JSON writes unpadded$bytes. - feat: typed OAuth scopes parse, construct, and canonically format repo,
blob, RPC, account, identity, include, and marker values. Permission matching
is allocation-free. Strict percent decoding preserves literal
+and decodes each escape once. - feat: server-side DPoP and private-key JWT assertion verification, public EC JWK and compact JWT helpers, and inter-service JWT creation and verification. JWT parsing fixes cleanup on short signatures, and OAuth signing helpers escape JSON claim values.
- feat: PLC operation encoding and signing, private multikeys, DID service
lookup, and DNS-backed lexicon authority resolution. Handle resolution rejects
reserved TLDs and
did:webrejects malformed percent escapes. - feat: firehose identity, account, info, sync, and error frame encoders, configurable CAR commit import limits, atproto JSON/CBOR conversion and blob discovery, prehashed CID construction, and millisecond datetime helpers.
- breaking: STAR uses the published pair and end markers. Earlier STAR-lite archives require regeneration. Ordered STAR writes and MST prefix matching are faster, and commit verification handles a delete followed by a recreate at the same path.
- breaking: deadlined HTTP requests require concurrency-capable Zig
Io. Zat no longer requests libc linkage. zttp 0.4.1 improves connection shutdown, credential handling across redirects, header forwarding, and idle socket cleanup. websocket 0.3.1 replaces zlib with pure Zig permessage-deflate.
0.7.0-alpha.13
-
breaking:
zat.space.SpaceUriparses and formats space references asat:space/{spaceDid}/{spaceType}/{skey}and appends the author DID, collection, and record key for record URIs. STAR readers require the new space reference in archive metadata. -
feat:
zat.oauth.permissionsparses, constructs and canonically formats individual OAuth scope tokens. Validated repo, blob, RPC, account and identity permissions match concrete operations without allocating. Include references and OAuth markers are typed scope values.
0.7.0-alpha.12
- fix:
HttpTransport(zttp 0.4.1) destroys idle pooled connections the peer has closed before each request. A long-lived transport talking to origins that reap idle connections used to hold them in CLOSE_WAIT.
0.7.0-alpha.11
- fix:
HttpTransportsends everyextra_headersentry. It is zttp'sClient, and zttp 0.4.0 removes the eight-header limit anderror.TooManyHeaders, which PDS proxies hit when forwarding Bluesky client headers.
0.7.0-alpha.10
- fix: strict percent decoding rejects signed, non-hex and truncated escapes
in
did:webauthorities.zat.percent.decodeAllocand allocation-freedecodedEqlshare the same decoder for downstream scope values, preserving literal+and single decoding. Extracted from Brooke's ZDS RPC audience fix (PR #33).
0.7.0-alpha.9
- feat:
loadCommitFromCARWithOptionstakescar.ReadOptions, so a whole repo CAR (an account import, a fullgetRepo) can be loaded pastloadCommitFromCAR's firehose-frame defaults of 2 MB and 10,000 blocks.
0.7.0-alpha.8
- fix:
space.archive.commitJsonwrites the commit'sdataas unpadded$bytes, as the reference and zat's CBOR-to-JSON conversion do.
0.7.0-alpha.7
- fix:
space.mactags commit MACsatproto-space-commit, the name the 2026-11-12 spaces release settled on.atproto-space-repowas a draft name, and a request under it is now ignored like any other tag.
0.7.0-alpha.6
- fix:
HandleResolver.resolvefails a handle under a reserved TLD witherror.DisallowedTldbefore any lookup, as the handle spec requires. - feat:
DidDocument.serviceEndpoint(id)finds a service written as#fragmentordid#fragment, as documents list it either way. - feat: lexicon authority resolution.
Nsid.authorityDomaingives the reversed authority domain (app.bsky.feed.post->feed.bsky.app), andHandleResolver.resolveLexiconAuthorityresolves an NSID to the DID that publishes its lexicons from thedid=TXT record at_lexicon.<domain>, over the same DoH path as handle resolution. No other name is tried, as the lexicon spec requires. - feat:
Handle.hasDisallowedTldflags handles under the handle spec's disallowed TLDs (Handle.disallowed_tlds:.alt,.arpa,.example,.internal,.invalid,.local,.localhost,.onion), ignoring case.Handle.parsestill accepts them, as the spec requires of syntax validation; registration and resolution are where to check.Handle.topLevelDomainreturns the final segment. - feat:
Datetime.toStringMillisrenders the millisecond form (2026-10-01T00:00:00.000Z) that JavaScript'stoISOStringand the reference PDS emit, andDatetime.fromSeconds/Datetime.fromMillisbuild an instant from unix time, returning null outside years 0000-9999 instead of clamping or overflowing. Instants before 1970 render as dates before 1970. - feat:
zat.plc, did:plc operations.plc.Operationbuilds aplc_operationand encodes it as DAG-CBOR (unsigned or signed) and as JSON in the reference field order;Operation.signsigns it with a rotation key and returns the signature, signed DAG-CBOR and JSON. For operations held as JSON (updates,plc_tombstone, legacycreate),signJson,verifyJson,cidForJsonanddidForJson;cidForCboranddidForCborwork on encoded bytes. Tests reproduce every CID, signature and the DID of real plc.directory audit logs, one starting from a legacycreate. - feat: private-key multikeys.
zat.multicodec.parsePrivateMultikey/formatPrivateMultikey(and the byte-levelparsePrivateKey/encodePrivateKey) read and writesecp256k1-priv(0x1301) andp256-priv(0x1306) keys in the base58btc form indigo and@atproto/cryptoexport;Keypair.fromPrivateMultikeyandKeypair.privateMultikeyconvert to and from aKeypair. - feat:
zat.oauth.percentEncode(to a writer) andzat.oauth.percentEncodeAllocexpose the RFC 3986 unreserved-set percent-encoder the OAuth helpers already used, so callers building query strings and path segments stop carrying their own copy. - fix:
cbor.fromJsonaccepts$byteswith=padding as well as without, as the atproto data model allows, and still rejects=anywhere but the padding that completes the final group. - feat:
cbor.toJson(writer, value)andcbor.toJsonAlloc(allocator, value)write atproto JSON, the inverse offromJson:$bytesas unpadded standard base64, as the reference PDS writes it, and$linkfor CIDs. - feat:
Cid.fromSha256Digest(allocator, codec, &digest)builds a raw or dag-cbor CIDv1 from a SHA-256 digest already computed, such as a blob's hashed while it streamed to storage. - feat:
firehose.encodeIdentityEvent,encodeAccountEventandencodeInfoEventencode the othersubscribeReposframes besideencodeCommitEvent. They reject an invalid DID, astatuson an active account, and an#infowithout thenamethe lexicon requires. - feat:
firehose.encodeSyncEvent(allocator, .{ .seq, .commit, .time })encodes a#syncframe from the signed commit block:didandrevcome from the commit, andblocksis a CAR whose first root is the commit CID, as the lexicon requires. - feat:
firehose.encodeErrorFrame(allocator, error_name, message)encodes a stream error frame: an{op: -1}header with not, then{error, message?}, such asFutureCursororConsumerTooSlow. - feat:
cbor.collectBlobRefs(allocator, value, &list)appends therefCID of every{$type: "blob"}map in a record, at any depth. The legacy{cid, mimeType}blob form has no$typeand is not found. - feat:
jwt.decodeandjwt.decodeLeakysplit a compact JWS into its header and payload as JSON objects, the signing input and the signature, for verifiers that check their own claims (DPoP proofs, client assertions, HS256 session tokens). They accept what the reference SDKs accept: parts decode like Node'sBuffer.from(part, "base64url")(jwt.base64UrlDecodeLenient), and a repeated member takes its last value as withJSON.parse.Decoded.claimNumericDatereads a numeric claim the way a JavaScript comparison does.Jwt.parseis unchanged. - feat:
jwkparses public EC JWKs (P-256 and secp256k1) into ajwk.PublicKeyusable withjwt.verifyJose, reading coordinates as leniently as Node's JWK import but rejecting points off the curve and keys carryingd;jwk.selectFromJwkspicks a client's key bykidandalg;jwk.thumbprintcomputes the RFC 7638 thumbprint of a JWK as given, as jose does, andPublicKey.thumbprintthat of a parsed key.Keypair.publicJwkreturns a keypair's public half as ajwk.PublicKey. - feat:
oauth.verifyDpopProofverifies a DPoP proof (RFC 9449) on the server: typdpop+jwt, a public headerjwkwhose JOSE signature verifies,htmandhtu(compared throughoauth.normalizeHtu), theiatwindow,athfor a given access token, accepted nonces and the boundjkt. It returns the thumbprint of thejwkas sent and thejti; replay tracking and nonce issuance stay with the server. - feat:
oauth.verifyClientAssertionverifies aprivate_key_jwtclient assertion (RFC 7523) against the client's JWKS:iss=sub= client,aud,expor a freshiat, ajtifor the caller's replay store, and the JOSE signature of the keykidandalgselect.typ,require_kidandmax_lifetimecover client attestations;oauth.parseClientAssertionchecks everything but the signature, for a server that fetches the JWKS of the client the assertion names. - feat:
service_auth.createmints an inter-service auth JWT with every claim JSON-encoded:iss,aud, optionallxmandsub, andiat,exp(60 s by default) and a randomjtiunless given. - feat:
service_auth.verifyverifies an inter-service auth JWT the way the referenceverifyJwtdoes: forbiddentyps,exp, accepted audiences, exactlxm(no*),issas a DID with an optional single#fragment, and a JOSE signature under the issuer's key from a caller-supplied resolver, asked once more withforce_refreshwhen the first key fails. It returns the issuer DID,aud,lxmandjti.service_auth.issuerDidstrips the fragment. - fix:
Jwt.parseno longer frees a short signature twice, and no longer leaks the parsed claims, when it rejects the signature part. A token whose signature decodes to other than 64 bytes hit the double free. - fix:
oauth.createDpopProofandoauth.createClientAssertionJSON-encodehtm,htu,nonce,ath, the client ID and the audience; a quote or backslash in one of them produced invalid JSON before.
0.7.0-alpha.5
- feat:
zat.space, the permissioned-spaces primitives of thepermissioned-databranch's@atproto/space: space URIs, delegation tokens and space credentials, credential-use HTTP signatures found by their tag, the HPKE-exported MAC secret, commit and record MACs requested withAccept-Signature, LtHash, and repo and space meta STAR archives. ZDS kept its own copies until now.
0.7.0-alpha.4
- deps: websocket is pinned to
v0.3.1, whose pmdeflatev0.1.1decodes permessage-deflate about 1.7x faster thanv0.1.0on relay frames. zat's stream clients do not negotiate compression, so their behavior is unchanged; code that enables websocket.zig's compression alongside zat gets the faster decoder.
0.7.0-alpha.3
- breaking: zat no longer links libc. Linux, Windows and wasi builds make
no libc calls and Linux binaries are static; macOS and the BSDs link their
system libc through Zig's std as before. A consumer that made its own libc
calls through zat's linkage, or that runs websocket.zig's server on Linux,
sets
link_libcon its own module. - deps: zttp and websocket are back on tagged releases, zttp
v0.3.0and websocketv0.3.0. websocket compresses with pmdeflatev0.1.0, pure Zig, in place of zlib, so the dependency tree no longer builds C. - fix: the repo stress test and
publish-docsread their environment through Zig's std instead of libcgetenv.
0.7.0-alpha.2
- breaking: the pinned zttp no longer sends a deadlined request through
an
Iothat cannot run concurrent tasks; it fails witherror.ConcurrencyUnavailablewhere 0.2.0 warned and sent the request without its deadline. Give HTTP, XRPC, identity and stream clients a concurrency-capableIo, such asinit.iofromstd.process.Init, notstd.Options.debug_io. - perf:
star.Writerwithordered_keysfinds the shared prefix with the previous key once, decides the order from the next byte, and copies only the bytes after it. Ordered writes of a 100k-record repository archive go from about 30M to 49-50M records/s. - perf:
mst.commonPrefixLencompares eight bytes at a time; MST node serialization calls it for every entry. - deps: zttp and websocket are pinned to unreleased commits, zttp
a5509d3and websocketa1b85b8. The same websocket commit is already pinned by jetstream, stream, labelz, zds, httpz and prefect-server; prefect-server also pins the zttp commit. zttp: bounded TLS retirement and explicit client shutdown, connection retirement that keeps pool reuse and eviction, deadline watchers woken as soon as a request completes, and credentials stripped when a redirect crosses origins. websocket: bounded client shutdown, network cancellation preserved through readers and writers, a handshake header split across reads, and server shutdown ordering. Both return to tagged releases before 0.7.0.
0.7.0-alpha.1
- breaking: STAR follows the published spec (dasl.ing, 2026-11-03).
star.Writerwrites a0x01control byte before each pair andfinish()writes a0x00end byte;star.Readerrequires both and rejects bytes after the end (error.BytesAfterEnd) and unknown control bytes (error.InvalidControlByte). STAR-lite and earlier zat archives no longer parse. Length varints may be up to 9 bytes again. - fix: a truncated archive fails at the framing (
error.EndOfStream) before any profile reads its pairs. - fix:
verifyCommitDiffundoes a commit's operations in reverse message order instead of sorting them by path, so a commit that deletes and recreates the same record verifies instead of failing witherror.DuplicatePath.mst.normalizeOpskeeps its behavior for other callers. - test: interop fixtures from cobalt a0b7ece (19 valid, 37 invalid); the 300-record MST fixture is rewritten to the new framing.
- docs: devlog 017.
0.6.4
- fix:
encodeCommitEventalways writessince(null on a repo's first commit),rebaseandtooBig, whichcom.atproto.sync.subscribeRepos#commitrequires. Strict consumers such as hydrant rejected commits that left them out.
0.6.3
Labeler streams. The library is 0.6.3-alpha.2 unchanged.
- feat:
LabelClientfollows a labeler'scom.atproto.label.subscribeLabelsstream;Labelencodes, signs and verifiescom.atproto.label.defs#label;DidDocument.labelerKeyandlabelerEndpointfind a labeler's key and service. Verified against Bluesky's moderation labeler, a labelz round trip, and Typeahead's production consumer. - fix: the package ships
scripts/check_imports.zig, whichbuild.zigimports; 0.6.3-alpha.1 could not be built as a dependency.
0.6.3-alpha.2
- fix: ship
scripts/check_imports.zigin the package.build.zigimports it, so 0.6.3-alpha.1 could not be built as a dependency; the check now skips directories a dependency's copy does not include.
0.6.3-alpha.1
- feat:
LabelClientreads a labeler'scom.atproto.label.subscribeLabelsstream with the firehose client's reconnect, backoff, idle watchdog and cursor-after-accept behaviour. - feat:
Labeldecodes and encodescom.atproto.label.defs#labelas DAG-CBOR, signs as a labeler and verifies against adid:key;labelsdecodes and encodes#labels,#infoand error frames. - feat:
DidDocument.labelerKey(#atproto_label) andDidDocument.labelerEndpoint(#atproto_labeler). - refactor:
FirehoseClientisSubscriptionClient(RepoStream); its API is unchanged. - docs:
examples/07_follow_a_labeler.zigfollows Bluesky's moderation labeler and verifies each label's signature.
0.6.2
- fix: reuse the canonical
Datetimeimport during module discovery. The stale lowercase path broke 0.6.1 builds on case-sensitive filesystems. - fix: stop docs publishing immediately when its build fails.
0.6.1
- refactor: store
Tidin 64 bits while preserving timestamp and clock ID wire encoding;Tid.str()now returns[13]u8instead of a borrowed slice. - refactor: simplify datetime parsing and calendar arithmetic;
Datetime.toString()now returns[27]u8instead of taking a caller buffer. - feat: add
car.writeEphemeralandcar.writeEphemeralAllocfor writing multiple block slices without concatenating them.car.writenow takes*std.Io.Writer. - refactor: encode complete base32 chunks with packed vector operations.
0.6.0
First stable release of the Zig 0.17 line. The library is 0.6.0-alpha.7 unchanged; this release moves the two network dependencies off prereleases.
- refactor: adopt zttp 0.2.0 and websocket 0.2.0, both identical in code to the alpha.5 builds zat already shipped with.
- The 0.6.0 prereleases added, in order: the Zig 0.17 requirement (alpha.1),
STAR v1 reading (alpha.1) and writing (alpha.7), the websocket
permessage-deflate setup fix (alpha.3),
Mst.deleteReturnatomicity anderror.Canceledpropagation (alpha.4), TLS validation time refresh (alpha.5), and distrust of the compromised eMudhra keys (alpha.6). 0.5.x stays on Zig 0.16.
0.6.0-alpha.7
- feat:
star.Writerframes STAR v1 archives: canonical metadata header,writePairorbeginPair+writeValuefor streamed values,finishto flush, andordered_keysto enforce strict bytewise key order. It rejects metadatastar.Readerwould reject. - fix: STAR length prefixes are capped at 6 varint bytes, following the spec at eb0c078. Readers previously accepted up to 9.
- test: the STAR reader and writer run bryan newbold's interop fixtures from cobalt/star: 13 valid archives round-trip byte for byte, 31 invalid archives are rejected.
0.6.0-alpha.6
- fix: adopt zttp 0.2.0-alpha.5 and websocket 0.2.0-alpha.5, which
distrust the compromised eMudhra roots and intermediates by SPKI digest.
zig build trust-probechecks that a compromised handle and DID are rejected whileatproto.comstill resolves.
0.6.0-alpha.5
- fix: adopt zttp 0.2.0-alpha.3 on Zig 0.17. Long-lived HTTP transports refresh TLS validation time before new connections, so a certificate rotation cannot be rejected using a timestamp from process startup. Explicitly resolved HTTPS connections initialize trust before connecting.
- Also picks up zttp 0.2.0-alpha.2: deadline watchers use
io.concurrent, response-head cancellation propagates, buffered streaming bytes are delivered promptly, and idempotent requests replay pooled connections reset by the peer.
0.6.0-alpha.4
- fix:
Mst.deleteReturnleaves the tree unchanged when it fails. Deleting the root's only entry removed it before loading the node that becomes the new root, so a partial tree, or a block reader that failed, returnederror.PartialTreewith the entry already gone and a differentrootCid. - fix:
JetstreamClient.subscribereturnserror.Canceledinstead of treating it as a dropped connection and reconnecting, which left the canceller waiting forever. - fix:
HandleResolverpasseserror.Canceledanderror.OutOfMemorythrough instead of renaming them to resolution failures, and no longer falls back to DNS on them.
0.6.0-alpha.3
- fix: adopt websocket 0.2.0-alpha.3. Its server created pooled permessage-deflate state without the connection manager's lock, so connections set up at the same moment could share one compressor: corrupted frames, then a crash. Affects any server built on websocket.zig through zat.
0.6.0-alpha.2
- fix: builds on the zig 0.17.0 release. Adopts websocket 0.2.0-alpha.2;
websocket 0.2.0-alpha.1 does not compile on 0.17.0 because
net_readnow returnsnet.Stream.ReadResult. - chore: CI and docs publishing install zig 0.17.0.
0.6.0-alpha.1
- breaking: requires zig 0.17. Built and tested against
0.17.0-dev.2384+ac77c23af; 0.16 users stay on 0.5.x. - feat: STAR v1 archives.
star.zigreads a STAR-lite stream with bounded working memory, reconstructs the MST, and verifies the root; commit authentication is a separate step. Seeexample-verify-star. - refactor: adopt zttp 0.2.0-alpha.1 and websocket 0.2.0-alpha.1 (zig 0.17).
- fix: the build-time guard for test files missing from
root.zigdeclares the files and directories it reads, so zig 0.17's cached configure step re-runs it whensrc/changes.
0.5.2
- fix: adopt zttp 0.1.2, preserving signed
RateLimit-Resettimestamps. The re-exportedRateLimitHeaders.resetfield is now?i64. - fix: compare retry reset timestamps with signed arithmetic before converting positive delays to milliseconds.
0.5.1
- fix: adopt zttp 0.1.1 for legacy HTTP-date support in
Retry-Afterand rejection of invalid calendar dates. - fix: resolve the user’s PDS in the renamed search-your-follows example.
- fix: retry dependency downloads in CI and documentation publishing.
- docs: archive design records outside the site navigation and simplify the search example.
0.5.0
- change: the HTTP transport now comes from zttp.
zat.HttpTransportiszttp.Client; the transport's own tests moved with it. what changed for callers:FetchOptions.redirect_behavior(a std type) ison_redirect: .follow | .surface | .refuse.capture_response_headersandOAuthHeadersare gone; name the headers you want incapture_headersand read them withresult.headers.get(name).- a payload without
content_typeiserror.MissingContentType. zat's xrpc layer setsapplication/jsonitself; the transport no longer assumes it. HttpTransport.initidentifies as zttp. applications should name themselves withinitWithUserAgent, which zat's own clients now do.- and everything zttp hardened since the split:
authorizationnever follows a redirect to another origin, a trailing-window rate guard, per-request deadlines, streamed response caps, CR/LF validation of urls and headers, http-dateRetry-After, andopen/streamfor bodies that belong on disk.
0.4.5
- fix: the default
User-Agentreads its version frombuild.zig.zoninstead of a string literal. the literal was written for 0.3.30 and never followed later bumps, so every release since has introduced itself as 0.3.30 to the PDSes it called.build.zignow exposes the zon version through abuild_optionsmodule that consumers inherit with thezatmodule. - fix:
HttpTransport.fetchreturnserror.TooManyHeaderswhenacceptplusextra_headersexceed its 8-slot buffer. it used to keep the first eight and drop the rest without a word, which would have surfaced as an unrelated auth failure. - test: the did:plc integration test runs on
testing.allocatordirectly and its duplicate leak-repro twin is gone.
0.4.4
- fix: zat compiles for 32-bit targets without native 64-bit atomics (ARMv6, e.g. a
Raspberry Pi 1 running zds). the three
std.atomic.Value(u64)counters — the jetstream and firehoseframes_this_connectionidle detectors and the xrpcStreamProgress.bytesstall detector — only ever ask "did this change since last tick", so they areusizenow. thecbor.Value/MapEntrysize asserts pin 64-bit layouts only, andCid.digest()rejects a varint digest length that does not fitusizeinstead of failing to coerce. - ci: compile the test module for
arm-linux-musleabihf(arm1176jzf_s) on every push so 32-bit support cannot regress silently;skip_foreign_checkskeeps the run step from trying to execute the foreign binary. - docs: tidy stray root docs, refresh the downstream list.
- test: cover pruning an empty node stranded as a left child.
0.4.3
- fix:
Mst.collectBlocksnow emits the block for an empty node instead of skipping it.collectNodeBlocksbails onisUnloadedStub, and afternodeCidserializes a node it clearsdirtyand caches the encoding without emitting — so a genuinely empty node ends up not-dirty, cid-set, no left, no entries, which is byte-for-byte the shape of an unloaded stub. Skipping a stub is right (its block is already stored); skipping an empty node strands it, because nothing else ever writes one. Content addressing separates the two: only an empty node hashes to the empty-node cid. Ordinary nodes were never at risk — they reach the emit path and reuse the cached encoding, which is what that cache is for. Empty nodes are the one shape that cannot, and the same stub/empty ambiguity0.3.19guarded in the delete path was still open here. Found in production: two repos on pds.zat.dev carried an empty subtree node minted by a pre-0.3.19writer, its block was never stored, and the first tree walk that reached it returnedPartialTree— everycreateRecord500,getRepo404, for any collection. The fix is self-healing:nodeCidreturns a stub's cid without loading it, so a write that does not descend into the stranded branch still commits, and the collect pass puts the missing block back. New coverage: the collect-closure invariant (every node cid a collected block points at is itself collected) and the production repair path (store missing the block, lazy load, write, assert it returns). Seedocs/incident-2026-08-18-empty-mst-node.mdin zds.
0.4.2
zat.cboraccepts finite 64-bit floats, matching the reference implementation (atmos cbor): decode takes additional-info 27 (rejecting NaN/Infinity/float16/float32 exactly as atmos does),Valuegains a.floatvariant (deliberately last — the hot dispatch keeps its tag order), and encode writes the canonical 9-byte form. non-finite floats are asserted unreachable in encode rather than widening the hot-path error set: no producing path (fromJson, decode) can construct one. benchmarked flat vs 0.4.1 on atproto-bench (decode/decode+verify/CID/ MST). the old "DAG-CBOR forbids floats in AT Protocol" comment was wrong about the CBOR layer — the lex data model discourages floats, but they occur in the wild and atmos accepts them.zat.cbor.fromJson: ATProto JSON -> CBOR data-model conversion (the atmoscbor.FromJSONport):{"$bytes"}/{"$link"}single-key sentinels, whole numbers within ±2^53 become integers, other numbers stay floats. needed by zat.dev/jetstream to canonicalize live records to DAG-CBOR (upstream jetstream client parity).
0.4.1
- bump vendored websocket.zig to v0.1.12:
Client.handshake_failureexposes non-101 upgrade rejections (status + bounded body), which the zat.dev/jetstream v2 live client needs for the typed pre-upgrade error contract (400 CursorTooOld / UnknownZstdDictionary / InvalidRequest). no zat API changes.
0.4.0
The protocol/service split. network.bsky.jetstream.* is a Bluesky service
API, not atproto — the same line Bluesky drew splitting @bsky/sdk out of
@atproto/api at the Jetstream v2 launch (2026-08-13). zat is now the
protocol side of that line.
- BREAKING:
zat.ArchiveBackfill(released through 0.3.30) moved to zat.dev/jetstream, the zig jetstream service SDK, along with the streamplace example, the archive smoke script, and the vendored decode-only libzstd (zat links no zstd at all now). Archive consumers: depend on thejetstreampackage; it delivers the samezat.JetstreamEvents through the same handler. zat.JetstreamClient(the v1/subscribewire) remains here, functional and deprecated-in-home, until its consumers migrate; the subscribeEvents v2 client lands in the jetstream repo.- feat:
zat.Datetime— the atproto datetime profile as a first-class syntax type next to Tid/Did/Nsid/Rkey:parse(offsets normalized to UTC, arbitrary fractional digits truncated at microseconds, the spec's year-zero floor enforced on the normalized instant) andtoString(canonicalYYYY-MM-DDTHH:MM:SS.ffffffZ). The atproto interop datetime fixtures now drive this parser directly. Civil math is Hinnant's days_from_civil/civil_from_days — signed and exact over 0000..9999, unlike std.time.epoch. Deliberate divergences from general RFC 3339 parsers (reject leap-second:60, reject-00:00, upper-case T/Z only) are the atproto spec's, cross-checked against rust's jiff and chrono and documented in the type. Replaces four hand-rolled formatters in stream and the SDK example's 45-line parser.
0.3.30
Every phase of an HTTP fetch is now bounded. The 2026-08-13 zlay authority stall showed that StallGuard only guards the response body: a peer that accepts a connection and never answers held callers in receiveHead indefinitely, and a wedged connect rode the kernel's ~2min SYN timeout.
- feat:
HttpTransport.head_deadline_ns(default 10s, 0 disables) bounds connect, TLS, request send, and the wait for the response head, surfacingerror.ResponseHeadTimeout. StallGuard remains the trickle guard for unbounded-size bodies. Mirrors indigo's identity client, which deadlines every phase. - fix:
default_user_agentnames the released version again (was frozen at 0.3.22).
zat.ArchiveBackfill works against post-proposal-0015 jetstream archives —
including Bluesky's token-gated hosted instances (Jetstream v2 launched
officially 2026-08-13 as Bluesky Protocol Services) — and can bound a plan
to a time window instead of draining the world.
-
feat:
Options.api_keysendsAuthorization: Bearer <key>on planSnapshot/listSegments/getSegment/getBlock (mirrors the Go client'sWithAPIKey);fetchSeqBoundstakes the same optional key. The live tail never needs one, matching upstream's "live stays open" contract. -
fix: the plan endpoint is
network.bsky.jetstream.planSnapshot— upstream renamed it fromplanBackfill(bluesky-social/jetstream PR #330) and removed the old name, so everyArchiveBackfill.runagainst a current archive failed withPlanFaileduntil this rename. -
feat:
Options.after_seq/Options.before_seqbound the plan (exclusive lower / inclusive upper, upstream's semantics). NewfetchSeqBounds(io, allocator, host, start_us, end_us)maps a witnessed-time window to those bounds vialistSegmentsmetadata; itscovered=falseresult is the honest signal that a window predates the archive's live capture. Measured against stream.waow.tech: a two-hour recent window plans ~25 blocks where the unbounded plan reads the whole collection's scatter. -
feat:
runlogs one progress line per 256 decoded blocks — a bounded but large plan (a session inside the merged bootstrap region) must not look like a hang. -
fix:
zig buildcompiles again: thecbor-benchtarget importedcbor.zigas a file, whose../crypto/multibase.zigimport escapes the bench module's path since 0acbedf; it now imports thezatmodule. -
example 07 (streamplace chat) replays historical sessions from the archive instead of relying on Jetstream cursor retention, then finishes the unsealed tail over the live socket, deduping the seam by rkey.
0.3.29
Idle-connection failover works on both streaming clients: a connection that stays open but delivers nothing is now a fault the consumer can bound.
- feat:
FirehoseClientgainsidle_timeout_ms, mirroringJetstreamClient's option. A relay that holds the socket open but goes silent — TCP-healthy, stream stalled — is detected and failed over instead of waited out. Observed live 2026-08-11: bsky.network went quiet for ~2.5 minutes before closing the connection itself; consumers ate the whole gap. Off by default (reconnect policy belongs to the consumer; a filtered jetstream consumer may be legitimately quiet). jcalabro/atmos has no equivalent — this is a deliberate, opt-in divergence. - fix: the idle-timeout mechanism no longer uses
SO_RCVTIMEO, which panics understd.Io.Threadedin debug builds (the EAGAIN from a receive timeout on a blocking socket is treated as a programmer bug). Both clients now run the blocking read loop as a concurrent task with a watchdog that compares a frame counter across quiet windows and cancels the read when a full window passes with no frames. Fires between 1x and 2x the timeout.JetstreamClient.idle_timeout_ms/replay_idle_timeout_mswere affected; verified live against a silent local server (fires, control blocks forever), the live firehose (13,322 events in 30s, zero false fires), and a DID-filtered truly-quiet jetstream subscription (fires on schedule).
0.3.28
OAuth requests can be pinned to validated addresses, DPoP nonces are optional, and identity resolution rejects the full special-purpose address space.
- feat: OAuth requests accept an optional
resolved_connection, carrying theHttpTransport.ResolvedConnectionalready produced during identity resolution through PAR, token exchange, refresh, and arbitrary DPoP requests. Connecting to the addresses that were validated, rather than re-resolving the host, closes a DNS-rebinding window between the safety check and the request.discoverAuthorizationServerResolvedandfetchAuthorizationServerMetadataResolvedtake the pin explicitly; the existingdiscoverAuthorizationServerandfetchAuthorizationServerMetadataare unchanged wrappers that passnull. - fix: a DPoP nonce is no longer required. Previously any server that never
issued a
DPoP-Nonceheader failed withMissingDpopNonce; the nonce is now retained until replaced and only demanded when the server actually issues ause_dpop_noncechallenge. - fix: identity resolution rejects the IETF special-purpose ranges it
previously allowed — CGNAT
100.64.0.0/10(including the cloud-metadata address100.100.100.200),192.0.0.0/24, TEST-NET, benchmarking,192.88.99.0/24, multicast, and reserved space. IPv6 now requires globally routed unicast, carving out2001::/23,2001:db8::/32, and2002::/16; IPv4-mapped addresses inherit the full IPv4 policy.
0.3.27
Reconnect backoff resets after a connection that was established.
- fix:
FirehoseClient.subscribeandJetstreamClient.subscribereset the reconnect backoff once a connection has been established, not only when the host rotates. A single-host consumer could never satisfy the host-switch condition, so its delay doubled 1→2→4…→60s and stayed at the ceiling for the life of the process, however healthy each connection had been. Against a relay that closed every ~113s this left a consumer's tail down 33% of the time. Measured live with forced disconnects: gaps held at ~1.38s across seven reconnects, versus 1.4/2.4/4.4/8.4/16.4/32.6s before. Matches the reset point in jcalabro/atmos (streaming/client.go); keying it on delivered events instead would leave an idle-but-healthy filtered consumer compounding its backoff.
0.3.26
Strict CID parsing and formatting, following atmos's hardened profile.
- feat:
Cid.fromBytes/Cid.fromString— strict validation against the atproto-blessed profile: CIDv1 only, dag-cbor/raw codec, SHA-256 with a 32-byte digest, canonical (minimal) varints, no trailing bytes.fromBytesborrows and does not allocate.Cid.toStringformatsb+base32lower in a single allocation. Re-exported aszat.Cid. - fix:
Cid.createrejects hash codes it does not compute — previously it wrote the given code into the header over an unconditional SHA-256 digest. - fix:
mst.parseCidStringnow validates via the strict parser instead of accepting any base32-decodable bytes. - feat:
readUvarintMinimal— rejects overlong varint encodings, capped at 9 bytes per the multiformats spec. - perf:
multibase.base32lowerencodes 5-byte chunks at a time (~2.6× faster CID toString; 31.6 ns/op vs atmos 49.6 ns/op).
0.3.25
The archive backfill release: consume a jetstream archive's full-history API (stream.waow.tech and compatible instances) through the same handler the live client uses.
-
feat:
zat.ArchiveBackfill— planBackfill → getBlock/getSegment → zstd decompress → jss v1 columnar decode →JetstreamEvents through the existingonEventhandler; a consumer's live-tail code replays history unmodified. Delivery is at-least-once, in plan order. Includes bounded per-fetch retries (5xx/429/transport errors),start_after/Result.positionresume so a transient failure never discards a multi-GB run, opt-in whole-segment checksum verification (xxh3 self-checksum cross-checked against the plan),max_blocksfor bounded exploratory runs, and opt-inconcurrency— an ordered FIFO fetch window measured 7.2x faster than serial on WAN block fetches, with delivery order unchanged.replaySegmentdecodes a sealed jss segment already in memory. The module doc records the measured scope boundary: block-granular reads are ~1,300x amplified for sparse scattered collections; those belong to a collection directory + listRecords. -
feat: vendored libzstd v1.5.7, decode-only subset (same pin as stream; 10 C files, pinned by url+hash, no system library, cross-compiles with
-Dtarget). Zig std's zstd decompressor measured ~20x slower than libzstd on real jss blocks (457ms → 19ms for a 58-block segment — ahead of the Go reference implementation at 37ms; atproto-benchbench-jsslane) and its checksum verification is unimplemented, so frame content checksums went unchecked. Every jss block's content checksum is now verified during decompression. -
feat:
JetstreamClientprimary failback — after a connection that delivered events drops, the next attempt starts athosts[0]instead of sticking to the fallback rotation until process restart. -
feat:
JetstreamClient.idle_timeout_ms— fail over from a host that holds the socket open but goes silent, which TCP keepalive never fires on.
0.3.24
CI and examples housekeeping: docs deployment hardening (Wisp retries, credential fixes, PDS-recovery retry), a Streamplace chat history replay example and its session-replay fix, and tolerating undeclared fields in DoH safety-check responses.
0.3.23
Three transport failures found in stream's whole-network backfill, all of them
the same shape: HttpTransport accepted whatever the origin did and had no
opinion about time.
-
fix: gzip responses now decode.
streamResponseBodycalledreaderDecompressingwith a zero-length decompress buffer, which cannot hold a flate window, so any compressed body failed — and a.accept_encoding = "identity"override sat above it attributing that to a "zig stdlib issue". The buffer is now sized from the negotiated encoding (ContentEncoding.minBufferCapacity, still 0 bytes foridentity, so the uncompressed path allocates nothing) and the override is gone. PDSes honour gzip at roughly 2.5x on repo listings; every consumer was paying full price for bytes it could have compressed. -
feat:
HttpTransport.stallaborts a transfer that stops making progress —idle_nsfor a peer that goes silent,min_bytes_per_saftergrace_nsfor one that trickles. Both default on. A wall-clock check placed after a read cannot fire, because a peer that simply stops sending leaves that read blocked in the kernel indefinitely; the body read therefore runs as anio.asynctask whose byte counter the caller watches, canceling when progress dies. Measured in stream: 1.3% of repo fetches took 10-41s and consumed ~94% of all worker-seconds, at rates around 35 KB/s — workers that looked busy while moving almost nothing. -
fix: a connection the origin closed before answering is replayed on a fresh one (
dead_connection_attempts, default 3) instead of surfacing. Zig's connection pool evicts by count, never by age, so a pooled connection idle long enough for the origin to reap it gets reused and fails on first read. Replay is gated on the request provably not having taken effect — idempotent method, no payload. Go'snet/httptreats this same case (errServerClosedIdle) as retryable. Downstream this appeared aslistReposfailing every ~3.5 hours, exactly the interval between calls. -
fix:
response.bodyErr().?no longer panics. It is null when a read is canceled rather than failing on its own; it now falls back toerror.ReadFailed.
Still absent, and deliberately so until something downstream demands them: dial and TLS-handshake deadlines, a response-header deadline, and a per-host connection cap.
0.3.22
- fix:
cbor.encodeAllocandcar.writeAlloctranslate the allocating writer'sWriteFailedback intoOutOfMemory. Both write intostd.Io.Writer.Allocating, whose only failure mode is allocation, butstd.Io.Writerreports it asWriteFailed— so exhaustion reached callers wearing the name of a data problem. Same class as 0.3.21, one layer down: found when stream's allocation-failure sweep walked past the CAR header fix and landed here. The remainingAllocatingusers in oauth/xrpc/streaming share the shape but not the consequence, and are untouched.
0.3.21
- fix: CAR header parsing no longer reports allocation failure as
InvalidHeader. BothreadWithOptionsandstreamBlockswrappedcbor.decodeAllin a barecatch return error.InvalidHeader, collapsingOutOfMemoryinto a structural verdict about the file. Consumers treat a malformed CAR as a permanent property of the source and retire it, so under memory pressure a perfectly good repository was discarded and its PDS blamed. Found downstream in stream, where the same class of bug inprepareReporetired repositories permanently at whole-network scale; an allocation-failure sweep overreadnow pins the classification.
0.3.20
- fix: fetch websocket.zig from tangled.org (
v0.1.11) instead of the GitHub mirror. The73429dfcrash fix shipped in 0.3.18 had been pushed only to GitHub, so the dependency URL pointed off-forge and dragged GitHub into every consumer's module graph.v0.1.11tags that same commit on tangled.org — identical content hash, no code change.
0.3.19
- fix:
Mstdelete now prunes subtree nodes it empties.deleteFromNoderecursed into a child and marked the parent dirty but never dropped the child when the delete emptied it; MST nodes are content-addressed, so the emptied node serialized as a real block and changed every ancestor CID. The tree therefore no longer equalled the tree that never contained the key — the equality commit-proof inversion depends on.verifyCommitDiffconsequently returnedPrevDataMismatchfor valid second commits from a real PDS; any repo with two records whose keys differ in height hits it, since the lower key lives alone in a subtree. We only trimmed at the root; the TS reference and atmos both prune here (atmos cites indigo'sremoveChild/IsEmptyinvariant). Found downstream in zlay via the atmoq relay-conformance corpus, where thesync11/commit2-validcontrol was being dropped. Post-delete roots now match atmos byte-for-byte over 25,000 deletes in atproto-bench; costs ~3% on a pure-delete microbenchmark. New coverage: a pure-MST prune test, a golden@atproto/repopartial-proof fixture throughverifyCommitDiff, plus canonicality and lazy-stub guards ported from atmos. Seedevlog/archive/mst-inversion-prevdata.md.
0.3.18
- fix: bump websocket.zig to
73429df— the client set socket timeouts throughstd.posix.setsockopt, which mapsBADF/NOTSOCK/INVALtounreachable("always a race condition"). those are reachable on a connection socket: an upstream that resets around the handshake aborted the whole process from insideFirehoseClient.connectAndRead, andunreachablecannot be caught by the reconnect loop. found downstream in stream, where a full test suite aborted roughly one run in seven; clean across 27 runs after. client-side counterpart of the same fix websocket.zig already applied server-side.
0.3.17
- fix: align websocket.zig at 0.1.10, preserving a single Zig 0.16 module graph for consumers that use the new stable, port-free peer-IP API directly.
0.3.16
- feat: optional
shouldStophandler hook onFirehoseClient.subscribe— checked before every frame and around every reconnect; returning true makes subscribe return cleanly instead of reconnecting forever (bounded consumers: bootstrap capture, tests, graceful shutdown). comptime-gated likeonError/onRawFrame; existing handlers unchanged. - fix: CAR block verification now covers the full CID (atmos parity): CIDv0 must be exactly the 34-byte sha2-256 multihash, CIDv1 must declare version 1 with the digest ending the CID exactly, and identity-hash digests are compared against content (previously accepted unchecked). valid CARs are unaffected; only forged or malformed CIDs are newly rejected.
0.3.15
- feat: optional
onRawFramehandler hook onFirehoseClient— delivers raw frames for callers that decode on their own threads; reconnect cursor tracked via newfirehose.peekSeq(cheap, no CAR hydration).
0.3.14
- fix: bump websocket.zig 0.1.8 → 0.1.9 (fixes a segfault in the server's Io accept loop with allocator-taking clientMessage handlers).
0.3.13
- feat:
FirehoseClienthost entries accept fullws(s)://URLs (scheme carries tls, port in the URL, path ignored), matching ecosystem norms (atmosstreaming.Options.URL, jetstream--relay-url). Bare hostnames remain implicit wss, so existing callers are unchanged. Newfirehose.Endpoint.parseexposed. Enables non-TLS local upstreams like the jetstream simulator (ws://localhost:7777).
0.3.12
- fix: CBOR decode accepts RFC 8949 bytewise map key order alongside RFC 7049 length-first. The production firehose (indigo/cbor-gen) emits length-first, but current DAG-CBOR spec encoders (e.g. bluesky's jetstream simulator) emit bytewise; decode now accepts either while still rejecting duplicates and orders satisfying neither. Canonical-form enforcement is unchanged on the encode/verify side.
0.3.11
- refactor: remove
verifyRepoandVerifyResultfrom the public API. Nothing called it — no downstream consumer, and even atproto-bench assembles the resolve/fetch/verify pipeline from the primitives. Real consumers verify withverifyCommitCar(zdsimportRepo) andverifyCommitDiff(firehose diffs), which are unchanged. ThefetchRepohelper and the verifyRepo-onlyVerifyErrormembers (InvalidIdentifier,SigningKeyNotFound,PdsEndpointNotFound,FetchFailed) go with it. - docs: deepen the five example recipes — zig 0.16
std.process.Initentry point,orelse return error.Xat fetched-doc boundaries, and verify-don't-trust framing throughout; README "what's here" now showcases commit verification grounded in the real zds call site; refresh roadmap and benchmark numbers (atproto-bench@20636e1); addllms.txt. - site: accessibility pass (skip link, SPA route announcements, focus management, AA contrast), sticky desktop sidebar with heading toc, syntax highlighting, sidebar restyle.
- repo:
.agents/skills/is the canonical skills directory;.claude/skillsis a symlink to it.
0.3.10
- feat:
zat.signCommit(allocator, params, keypair)builds and signs a canonical AT Protocol repo commit (did/version:3/data/rev/prev), returning the signed block bytes and its CID. This is the produce-side mirror ofverifyCommitCar; a round-trip test signs a real MST-backed commit and verifies it back through the verifier. Downstream PDS-shaped consumers no longer need to hand-roll the commit CBOR. - fix: harden AT URI parsing in
internal/syntax/at_uri.zig. - fix: adopt recent Atmos-inspired hardening in DID resolution, handle resolution, and XRPC retry behavior.
- refactor: rename
internal/repo/repo_verifier.zigtointernal/repo/repo.zignow that the file holds both the produce (signCommit) and verify sides. Public export names are unchanged. - test: wire the full Bluesky syntax interop corpus into the suite.
- bench: add
zig build commit-sign-benchfor the PDS commit-sign hot path. - docs: add devlog 014 on post-shaped files.
0.3.9
- fix: harden MST node decoding by rejecting duplicate or non-canonical node and entry keys, trailing bytes, oversized entry arrays, and oversized prefix lengths.
- fix: full
verifyReponow rejects incompletecom.atproto.sync.getRepoCARs whose MST references missing node or record blocks, including boundary-truncated CARs that otherwise parse cleanly. - feat:
verifyCommitCaraddsrequire_complete_repofor callers that need full-repo completeness checks without changing the permissive default for firehose and diff CARs. - feat:
zat.mst.collectReachableBlockscollects all MST and record blocks reachable from a block-backed MST root for full repo export and audit paths. - docs: move the ZDS perspective note into the docs archive.
0.3.8
- feat: firehose
#commitevents now have structural validation for repo DID, rev/since TIDs, commit CIDs, op paths, and create/update/delete CID nullability. The newzat.firehose.encodeCommitEventhelper builds validated commit event frames from typed params so producers can passsince_revexplicitly instead of hand-assembling raw CBOR. - fix: firehose encoding now preserves op CIDs when records are not decoded locally, carries
prevData: nullexplicitly, and round-trips therebaseflag. - refactor: trim low-level public surface by hiding
repo_verifier, OAuth implementation submodules, and the raw firehose frame encoder while preserving the curated top-level verifier, OAuth, and firehose codec APIs used by downstream consumers. - fix: pin websocket to the canonical Tangled
websocket.zigv0.1.8release, aligning Zat with the first-party websocket/httpz dependency graph used by ZDS and zlay. - docs: add
ZDS_PERSPECTIVE.mdand release/zen agent notes documenting the ZDS-driven boundary work and verification loop.
0.3.7
- feat: expand
zat.oauthfrom low-level PKCE/DPoP/client-assertion helpers into a framework-neutral ATProto OAuth client toolkit. New helpers cover client metadata JSON, authorization-server discovery, authorization URL construction, PAR, code exchange, refresh-token exchange, DPoP nonce retry, and DPoP-authenticated resource requests while leaving cookies, redirects, sessions, and storage policy to applications. - fix: enforce ATProto OAuth profile requirements for metadata discovery, scopes, DPoP nonces, and DPoP
htunormalization, with focused tests for the new correctness surface. - feat:
HttpTransport.FetchResultcan capture OAuth-relevant response headers (Content-Type,DPoP-Nonce,WWW-Authenticate) and has adeinithelper so OAuth clients can stay on the shared transport path instead of dropping to rawstd.http.Client. - fix:
HandleResolverDNS-over-HTTPS resolution no longer fails for handles in DNSSEC zones. Cloudflare appends aCommentfield to DoH JSON for those zones (e.g.dholms.at), which the strict parse rejected witherror.InvalidDnsResponse; the parse now ignores unknown fields. Added a network-free regression test using a real Cloudflare DNSSEC body. - perf: MST
collectBlockscaches node encodings across passes and keeps the(cid, encoded)cache consistent innodeCid, avoiding redundant DAG-CBOR re-serialization when gathering commit blocks.
0.3.6
- feat: firehose
#commitevents now expose the rawblocksCAR bytes,prevData, operationprevCIDs, and atoMstOperations()helper so consumers can callverifyCommitDiff/verifyCommitCarwithout re-decoding raw frames. Added#syncevent decoding and a namedLoadedCommitCarreturn type forloadCommitFromCAR. - bench: added
zig build firehose-decode-bench -- <atproto-bench firehose-frames.bin>for measuringFirehoseClient.decodeFramedirectly against the atproto-bench fixture corpus.
0.3.5
- perf: align MST hot paths with Atmos while preserving AT Protocol root parity. The tree now uses nullable child pointers with CID-only lazy stubs, direct DAG-CBOR node serialization, cached clean-node CIDs, chunked key comparison, borrowed-key insertion for benchmark/import paths, and Atmos-style ordered-tree lookup that loads only selected lazy child nodes. The atproto-bench apples-to-apples MST run now has Zat ahead of Atmos on both insert+root and lookup while producing the same root bytes.
- feat:
Mst.collectBlocksandMst.walkadd the missing middle layer for consumers that need commit-CAR MST blocks or ordered repo traversal without reaching throughNodeinternals. This is additive public API; existing callers should not break. - test: ZDS main now consumes the new MST middle layer in record writes and repo import, pinned to Zat commit
485f1d485a9b8e7b703e8627a6b6a8c3e3c36a0e, and is deployed asatcr.io/zat.dev/zds:latestfrom merged ZDS commit8d1a8182dace. - docs: devlog 012 captures the Atmos comparison, the MST representation changes, the lookup diagnosis, and the ZDS adoption proof. Ran
zig zenduring release prep; the relevant guidance here is "Communicate intent precisely", "Edge cases matter", "Avoid local maximums", and "Together we serve the users."
0.3.4
- fix: bump websocket.zig to v0.1.4 — best-effort
setsockopton connection sockets. when a peer resets or another thread closes a socket mid-flight, the RCVTIMEO/SNDTIMEO/TCP_NODELAY calls hitEBADF/ENOTSOCK, whichstd.posix.setsockoptmaps tounreachable("always a race condition"), panicking the worker thread (SIGSEGV); the priorcatchcould not swallow it. also folds in v0.1.2 (deferInvalidConnection/InvalidUpgradepast the handshake body-completeness check) and v0.1.3 (close socket in nonblockingcleanupConn, fixing an FD leak).
0.3.3
- feat:
jwt.verifyJose(alg, message, signature, public_key)— lenient ES256/ES256K verification for JOSE/JWT contexts (OAuth client assertions, DPoP), accepting high-S signatures per RFC 7515. - fix:
Jwt.verifynow verifies leniently (accepts high-S). a JWT is a JOSE token, where the atproto low-S requirement does not apply and WebCrypto-based signers routinely emit high-S signatures; the previous strict verification rejected valid service-auth and OAuth tokens. matches the reference SDKs (@atproto/cryptoallowMalleableSig, atmosHashAndVerifyLenient). strict low-S enforcement is unchanged for content-addressed signatures —verifyCommitCar,verifyCommitDiff, andverifyDidKeySignaturestill reject high-S viaverifyP256/verifySecp256k1. - docs: README "used by" section listing downstream consumers.
0.3.2
- feat: bump websocket.zig to v0.1.1 — streaming
Handshake.parseontostd.http.HeadParserplus RFC 7230 strictness, fixing the recurring class of TCP-fragmentation parser bugs. two new error variants (WhitespaceBeforeColon,AmbiguousBodyLength) surface as 400 responses.
0.3.1
- feat:
XrpcClient.queryCheckedandXrpcClient.procedureCheckedreturn a checked union of successfulResponseor structuredXrpcError, preserving AT Protocolerror/messageenvelopes for non-2xx responses. - feat:
XrpcClient.RetryPolicyadds status-driven retries for transient transport errors plus HTTP 429/5xx responses, withretry-afterand rate-limit header support. - feat:
HttpTransport.fetchcapturesratelimit-limit,ratelimit-remaining,ratelimit-reset, andretry-afterheaders on responses. - fix: DID and handle resolution now reject unsafe network targets by default, including private, loopback, link-local, multicast, documentation, and unspecified IP ranges.
- fix: identity resolution validates DNS and redirect targets before issuing HTTP requests, reducing SSRF exposure when resolving untrusted AT Protocol identifiers.
0.3.0
- breaking: zig 0.16 — all networking APIs take
io: std.Ioas first parameter - breaking: streaming clients use
subscribe(handler)pattern instead ofconnect()+next()loop - breaking: websocket.zig bumped — Io-native server accept loop, client write lock, TLS stream support
- fix:
DidResolver.resolveandHttpTransport.fetchpropagate the underlyingstd.http.Client.fetcherror instead of collapsing every transport-layer failure (DNS, connect, TLS) toerror.DidResolutionFailed/error.RequestFailed— callers can distinguish failure modes via@errorName(err). soft-breaking: the inferred error set widens - feat:
Io.Timestampreplaces libcgettimeofdayin JWT/OAuth - feat:
io.sleep()replaces libcnanosleepin reconnect backoff (cancellation-aware) - feat:
car.streamBlocks+BlockIterator— pull-style, zero-allocation CAR iteration for large repos (sync.getRepo). shares parser helpers withread/readWithOptions; yields slices into the input buffer and exposesoffset()so callers can build their own CID → byte-offset index. strictly additive, no existing consumers affected. passmax_size = data.lenfor sync.getRepo responses — the 2 MB default targets firehose frames. - docs: devlog 008 — the 0.16 migration
0.2.18
- feat: export
HttpTransportfrom root module — consumers can now usezat.HttpTransportfor direct HTTP access without going throughXrpcClient
0.2.17
- feat:
Keypair.jwk(),Keypair.jwkThumbprint(),Keypair.uncompressedPublicKey()— JWK export and RFC 7638 thumbprints for both P-256 and secp256k1 - feat:
oauthmodule — stateless PKCE, DPoP proofs, client assertions, form encoding, and related helpers for AT Protocol OAuth flows (based on OAuth 2.1) - feat:
jwt.base64UrlEncode,jwt.base64UrlDecodenow public - test: interop tests for did:key derivation and data model fixtures
0.2.16
- fix: bump websocket.zig to
395d0f4— reads full HTTP body on TCP split writes (fixes empty body when headers and body arrive in separate TCP segments)
0.2.15
- feat:
parseDidKey,verifyDidKeySignature— parsedid:keystrings back to key type + raw bytes, verify signatures bydid:keywith automatic curve dispatch - feat:
Keypairstruct — unified abstraction over secp256k1/P-256 for sign, publicKey, did:key formatting - feat: optional
onConnectcallback onJetstreamClient— exposes which host the client connected to
0.2.14
- fix: memory leak in
HttpTransport.fetch()—toArrayList()transferred buffer ownership without freeing; usewritten()instead to keep ownership with the deferreddeinit()
0.2.13
- docs: devlog 007 — up and to the right (corrections to 006, sync 1.1 verification, lightrail collection index)
0.2.12
- feat: configurable
keep_aliveonHttpTransportandDidResolver.initWithOptions— allows disabling HTTP connection reuse for memory leak investigation
0.2.11
- fix: enable TCP keepalive on websocket connections — detect dead peers in ~20s instead of blocking forever
0.2.10
- deps: bump websocket.zig to fork commit
9e6d732— TCP split guard for HTTP body reads behind reverse proxies
0.2.9
- fix: SPA fallback routing for standard.site deep links —
_redirects,<base href="/">, devlog short-name aliases - fix: add glibc to nixery deps for wisp-cli patchelf in CI
- docs: devlog 006 — building a relay in zig (zlay architecture, deployment war stories, backfill)
- fix: publish-docs.zig missing devlog entries 004-006
0.2.8
- feat: sync 1.1 —
ChildRefunion,loadFromBlocks,putReturn/deleteReturn,verifyCommitDiff - feat:
loadCommitFromCARreturns unsigned commit bytes
0.2.7
- feat:
Value.getUint()— extract unsigned integers as?u64from CBOR maps.getInt()truncates values >i64max; upstream AT Protocol firehose seq numbers now exceed this limit.
0.2.6
- feat: specialized MST decoder —
decodeMstNode()parses known MST CBOR schema directly, zero-copy byte slicing, avoids genericValueunion construction - feat: in-walk MST structure verification —
walkAndVerifyMstchecks key heights during traversal instead of full tree rebuild. MST step: 218ms → 39ms (5.5x), compute total: 300ms → 123ms (2.4x) - docs: devlog 005 — updated benchmark numbers and chart
0.2.5
- feat: O(1) block lookup in CAR parser —
StringHashMapindex built duringread()/readWithOptions(),findBlock()uses index instead of linear scan - fix:
verifyRepobypasses default 2 MB / 10k block limits so large repos (e.g. pfrazee.com at 70 MB / 243k blocks) actually work - docs: devlog 005 — clarify Rust ecosystem (rsky, jacquard, hand-rolled RustCrypto)
0.2.4
- feat: configurable CAR size limits —
max_sizeandmax_blocksoptions inreadWithOptionsfor large repo verification - feat: export
jwtmodule (not justJwttype) for direct access toverifySecp256k1/verifyP256 - docs: devlog 005 — three-way trust chain verification (zig vs Go vs Rust)
- docs: README rewrite — added CBOR, CAR, MST, firehose, jetstream, signing, repo verification
0.2.3
- docs: devlog 004 — the sig-verify saga (k256 5×52-bit field, Fermat scalar inversion, three-way bench with rsky)
- changelog backfill for 0.2.1 and 0.2.2
0.2.2
- feat: CAR parser enforces size limits — 2MB max on blocks field, max block count. matches indigo's limits for production parity.
0.2.1
- feat: CID hash verification in CAR parser —
car.read()SHA-256 hashes each block and compares against the CID digest. proves block content wasn't corrupted or tampered with.readWithOptions(.{ .verify_block_hashes = false })to skip for trusted local data. - fix: remove pfrazee.com from default test suite (network-dependent)
0.2.0
- feat: end-to-end repo verification —
verifyRepo(allocator, identifier)exercises the full AT Protocol trust chain: handle → DID → DID document → signing key → fetch repo CAR → verify commit signature → walk MST → rebuild tree → CID match - refactor: organize
src/internal/into domain subdirectories following the TypeScript SDK:syntax/,crypto/,identity/,repo/,xrpc/,streaming/,testing/
0.1.9
- feat: merkle search tree (MST) —
mst.Mstwithput,get,delete,rootCid - feat: ECDSA signing —
signSecp256k1,signP256with low-S normalization (RFC 6979) - feat:
did:keyconstruction —multicodec.formatDidKey,multicodec.encodePublicKey - feat: multibase encoding — base58btc encode, base32lower encode/decode
- interop tests: MST common prefix (13 vectors), commit proofs (6 fixtures)
0.1.8
- fix: NSID parser rejects TLD starting with digit (e.g.
1.0.0.127.record) - fix: AT-URI parser validates authority (DID/handle), collection (NSID), and rkey components; rejects
#,?, spaces - fix: reject high-S ECDSA signatures — atproto requires low-S normalization (BIP-62 style)
verifySecp256k1andverifyP256are nowpub- atproto interop test suite: syntax validation (6 types), crypto signature verification (6 vectors), MST key heights (9 vectors)
0.1.7
- slim
Cidstruct from 56 to 16 bytes — store only raw bytes, parse version/codec/digest lazily on demand Valueunion shrinks from 64 to 24 bytes,MapEntryfrom 80 to 40 bytes- zero-cost CID decode — tag 42 handler stores a byte slice reference instead of parsing varint fields
- inline map key reading in CBOR decoder — skips full
decodeAt+ union construction per key - comptime size assertions for
ValueandMapEntry - breaking:
Cidfields (version,codec,hash_fn,digest) are now accessor methods returning optionals — e.g.cid.version→cid.version().? parseCidsimplified to a trivial raw-bytes wrapper
0.1.6
- round-robin host rotation for jetstream and firehose clients
Options.host→Options.hostswith sensible defaults (bsky + community relays)- backoff resets on host switch, jetstream rewinds cursor by 10s
- default jetstream hosts: 4 official bsky, waow.tech, fire.hose.cam, 6 firehose.stream regions
- default firehose hosts: bsky.network + 3 firehose.network regions
0.1.5
- align firehose event types with AT Protocol sync spec
0.1.4
- firehose support: DAG-CBOR codec, CAR codec, CID creation, firehose client
- encode and decode
com.atproto.sync.subscribeReposbinary frames
0.1.3
- jetstream WebSocket client with typed events, reconnection, and cursor tracking
extractAtignores unknown JSON fields by default- HTTP I/O isolated behind
HttpTransportfor 0.16 prep - websocket dependency pinned to specific commit
0.1.2
extractAtlogs diagnostic info on parse failures (enable with.zatdebug scope)
0.1.1
- xrpc client sets
Content-Type: application/jsonfor POST requests - docs published as
site.standard.documentrecords on tag releases
0.1.0
sync types for firehose consumption:
CommitAction-.create,.update,.deleteEventKind-.commit,.sync,.identity,.account,.infoAccountStatus-.takendown,.suspended,.deleted,.deactivated,.desynchronized,.throttled
these integrate with std.json for automatic parsing.
0.0.2
- xrpc client with gzip workaround for zig 0.15.x deflate bug
- jwt parsing and verification
0.0.1
- string primitives (Tid, Did, Handle, Nsid, Rkey, AtUri)
- did/handle resolution
- json helpers