Release notes

What changed in each release, newest first, in short. The complete list, with every reworded message and every fixed edge case, is the project’s CHANGELOG.md. Read it before you upgrade: any 0.x release may change the API, including a patch release.

0.1.3 (2026-11-20)

The fixes from the 0.1.2 install trial, and one behaviour change: a read that names a type or relation the schema does not declare is now an error. No answer changes for a read that names only declared types and relations.

  • A read that names an undeclared type or relation raises zanzibar.UndeclaredTypeOrRelation, a ValueError, where 0.1.2 answered False or an empty result. That covers check, lookup, lookup_reverse and expand on a Store or a set engine, their type and relation filters, a typo such as check("user:a", "veiwer", "doc:1"), and a subject relation its type does not declare. A result key passed back as check(*key, ...) is refused too, and the message shows the call that was meant. Names are not checked: doc:999 still answers False. A test that reads undeclared names and expects False now gets the refusal. See What a read checks.

  • object_wildcard_shapes accepts a 2-item list such as ["folder", "viewer"] as a pair, as a JSON-loaded configuration gives; any other entry that cannot be a set member is a TypeError naming the argument and the entry. A refused entry’s message ends with the rewrite.

  • The set engine’s check, lookup, lookup_reverse, expand, add_tuple and remove_tuple, called with the wrong number of arguments, say which form they take instead of giving Python’s “missing 3 required positional arguments”.

  • Docs: what None means as the subject predicate in each call, and the order of a result key, are on the tuple strings page; the 0.1.2 note below names the two cases that stay AdmissionRejected; “Test your permission model” says it needs pytest.

0.1.2 (2026-10-30)

The fix from the 0.1.1 install trial, plus argument checking on every public call. No permission answer changes for a well-typed call.

  • sync= on zanzibar.Store takes only True or False. sync=None or sync=0 used to give async mode without a word; any other value is now a TypeError. ops= takes only PySets or RoaringSets, and says so.

  • Every public argument is type-checked before any SQL runs, and a wrong type is a TypeError naming the argument, with two exceptions that stay zanzibar.AdmissionRejected, as in 0.1.0. One is a write’s identifier: the relation, and every one of the six parts in the parts form, so add_tuple("user:a", None, "doc:1") is refused like any other bad identifier (a non-string user or object string is still a TypeError). The other is a store id, so Store(session, 123, ...) is refused the same way. A read with a part that is not a string, such as check("user:a", None, "doc:1"), now raises TypeError where it used to answer False; None as a read’s subject predicate still means the bare subject (None as the subject predicate gives its meaning in each call). bulk= and enable_boolean= take only True / False, and object_wildcard_shapes must be (type, relation) pairs.

  • A refused tuple is quoted the way you wrote it (robot:r viewer doc:1), and the cycle refusal says how to get out of it.

  • Each docs page deletes its SQLite file first, so running a page twice gives the same output.

0.1.1 (2026-10-30)

Fixes from the 0.1.0 install trial and one crash found in testing; no permission answer changes.

  • zanzibar.Store.lag() sees another instance’s catch_up() without a refresh(). It used to keep reporting the old backlog (it never under-reported).

  • A tuple that makes an object its own parent (doc:d1 parent doc:d1) under a from chain could fail with a raw IntegrityError and, in async mode, stall the index. Where the schema accepts such a tuple, it is written normally now; a from chain that recurses through parent still refuses it as a cycle, as documented for zanzibar.AdmissionRejected. No wrong answer was served.

  • Clearer errors: an old 0.0.x keyword such as s_type= is named with its 0.1 name; ops=PySets() says to pass ops=PySets; a trailing # comment, [user: *] and a chain of two but nots say what to write instead; a SchemaMismatch says when swapped or / and / but not operands are the difference.

  • Each docs page uses its own SQLite file, so two pages run in one folder no longer clash.

0.1.0 (2026-10-30)

A deliberate break of the 0.0.x API, with no compatibility aliases. Code written for 0.0.5 stops importing until you rename a few things; Upgrade from 0.0.x to 0.1 walks through every step.

Breaking:

  • zanzibar.connectedstore.ConnectedStore is now zanzibar.Store, importable from the top level. The graph index’s bookkeeping table model is now IndexStore, and the set engine’s result type is SetLookupResult.

  • Keyword names are subject_type, subject_name, object_type and object_name.

  • build_index and rebuild_index take index_store_id by keyword only.

  • The Python Ellipsis is refused as a subject predicate; a bare subject is the string "...".

  • Each subpackage’s __all__ lists only its public names, and exceptions are exported from zanzibar only: write from zanzibar import StaleRead, not from zanzibar.store import StaleRead.

  • The parsers raise zanzibar.SchemaError (still a ValueError). ShapeRefusedSinceTK137 is renamed zanzibar.ShapeNoLongerAccepted.

  • zanzibar.UnsupportedByGraphIndex and zanzibar.DoublyBridgedShapeError are now ValueErrors, so an except ValueError that let them through now catches them.

  • at_least must be None or an int of 0 or more.

  • A freshness token from another store is refused on every tokened read with the new zanzibar.ForeignToken (a StaleRead); before, one at or below the store’s own writes was accepted without error.

  • A Store refuses a Session with unsaved changes of yours, a database without the zanzibar_* tables (zanzibar.TablesNotCreated) and a SQLite file created by 0.0.x (zanzibar.TablesOutdated).

  • A SetEngine raises zanzibar.PersistedSchemaRefused for a store whose saved schema this version refuses, as every other entry point does.

  • An object_wildcard_shapes entry must name a declared relation.

  • Some answers change. A userset such as doc:1#banned is now a member of itself, as in OpenFGA, so one previously allowed check on a but not relation is now denied, and lookup_reverse results include the object’s own userset.

  • Many messages are reworded; code that matches on message text may need updating.

Added:

Fixed:

  • With paranoia full or fixpoint, a failed post-commit check now raises zanzibar.InvariantViolation after the commit, saying the write is committed, and the Store stays usable. It used to surface as SQLAlchemy’s InvalidRequestError and leave the Store unusable.

  • Public docstrings no longer cite internal task ids or repository paths, and the ones that were missing were written.

  • A lookup result held across a write could translate to the wrong subjects; it is now refused with StaleLookupIds.

  • A write refused by the fan-out cap is cheap to refuse: the graph index counts the rows it would touch and refuses before loading them, and a Store no longer rebuilds its set engine after the refusal. See A refused write is not free.

  • A direct graph-index write on a schema with and / but not that is committed without running the delta processor’s cascade is refused at the commit with the new zanzibar.CascadeNotRun, instead of committing derived relations that disagree with the set engine. A Store is not affected.

  • With ZANZIBAR_PARANOIA=full or fixpoint, releasing a savepoint (session.begin_nested()) ran the after-commit check, which on an in-memory SQLite database rolled back the caller’s whole open transaction. The check now runs only when the outermost transaction commits.

  • A stall recorded while nothing was pending is cleared by the next successful catch_up(), even one that applies nothing; until then untokened lookups raised zanzibar.IndexStalled.

  • A sync write refused because an earlier backlog row cannot be applied now says so, names that row, and gives the recovery, instead of reading as if your own write was too big. See Recover from a stalled index.

  • A user string with a : in its relation part, such as "user:a#b:c", raises zanzibar.MalformedTupleString on reads as well as writes.

  • The StaleRead and WatermarkGap messages say “set engine” where they said “evaluator”.

0.0.5 (2026-10-14)

  • Breaking: four schema shapes that OpenFGA refuses are refused here too: a schema version other than 1.1, extra words on a model, schema or relations line, but not beside or / and without parentheses, and a restriction naming an undeclared type. A store saved by 0.0.4 or earlier with one of them no longer opens.

  • SetEngine.excluded_keys was added.

  • Fixed: under a wildcard grant, a standalone set engine’s lookup_reverse did not list the users a but not refuses as excluded; a set engine opened on a store that a ConnectedStore owns answered under whatever schema it was given and could write past the tuple log; a relations line with a define on it silently dropped the relation.

0.0.4

  • A malformed OpenFGA JSON model is refused with a message that names the field.

  • Reopening a store with its own schema no longer fails over formatting: the parsed schema is compared, not the text.

  • The residue runtime check covers one more kind of index corruption.

0.0.3

  • The graph index serves x from parent when x uses and or but not.

  • Several crashes on unusual schemas and on non-string write fields are now clear refusals.

0.0.2

The first release published to PyPI: the same library as 0.0.1, with a test-only fix.

0.0.1

Tagged but never published. It introduced the package: the schema parser and compiler, the set engine, the graph index and the composed store, under the Apache-2.0 licence, with every database table named zanzibar_*.