# 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](https://github.com/averykhoo/graph-reachability-zanzibar-index/blob/master/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** {py:exc}`zanzibar.UndeclaredTypeOrRelation`, a `ValueError`, where 0.1.2 answered `False` or an empty result. That covers `check`, `lookup`, `lookup_reverse` and `expand` on a {py:class}`~zanzibar.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](tuple-strings.md#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](tuple-strings.md) 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 {py:class}`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 {py:exc}`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](tuple-strings.md#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. - {py:meth}`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 {py:exc}`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 not`s 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](../how-to/upgrade-0.1.md) walks through every step. Breaking: - `zanzibar.connectedstore.ConnectedStore` is now {py:class}`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 {py:exc}`zanzibar.SchemaError` (still a `ValueError`). `ShapeRefusedSinceTK137` is renamed {py:exc}`zanzibar.ShapeNoLongerAccepted`. - {py:exc}`zanzibar.UnsupportedByGraphIndex` and {py:exc}`zanzibar.DoublyBridgedShapeError` are now `ValueError`s, 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 {py:exc}`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 ({py:exc}`zanzibar.TablesNotCreated`) and a SQLite file created by 0.0.x ({py:exc}`zanzibar.TablesOutdated`). - A `SetEngine` raises {py:exc}`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: - {py:meth}`zanzibar.Store.expand` (Zanzibar Expand) and {py:meth}`zanzibar.Store.adopt`. - Filters on lookups: `object_type` / `relation` on `lookup`, and `subject_type` / `subject_predicate` on `lookup_reverse`. - The OpenFGA tuple form, `add_tuple("user:alice", "viewer", "doc:d1")`, and OpenFGA JSON models as `schema=`. - {py:meth}`zanzibar.Store.result_keys` and {py:meth}`zanzibar.Store.excluded_keys`, and `LookupResult.implicit_keys` / `implicit_excluded_keys` for answers that have no node id (a userset that is a member of itself before any tuple names it). - {py:exc}`zanzibar.ZanzibarError`, the base of every exception the library raises on purpose, plus new specific exceptions such as {py:exc}`zanzibar.StoreNotFound`, {py:exc}`zanzibar.StaleLookupIds` and {py:exc}`zanzibar.ForeignToken`. - Public types and helpers: {py:class}`zanzibar.graphindex.DeltaProcessor`, {py:func}`zanzibar.store.open_set_engine`, and the schema types that appear in public signatures ({py:class}`zanzibar.schema.SchemaInfo`, {py:class}`zanzibar.schema.CompiledBooleans`, {py:class}`zanzibar.schema.Entity`, {py:class}`zanzibar.schema.RelationalTriple`). Fixed: - With paranoia `full` or `fixpoint`, a failed post-commit check now raises {py:exc}`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](../explanation/limits.md#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 {py:exc}`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 {py:exc}`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](../how-to/stall-recovery.md). - A user string with a `:` in its relation part, such as `"user:a#b:c"`, raises {py:exc}`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_*`.