Skip to content

Releases

pemba 0.3.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 09:54
7d0b3c6

Fewer Postgres round trips on deep hierarchies, and a FastAPI helper. No migration is needed
from 0.2.0: public APIs keep working and storage formats are unchanged. A custom ReadStore
keeps compiling, because the new trait methods are provided.

Changed

  • Postgres reads make fewer round trips. A request opens its snapshot in one message, and a
    check fetches what each level of a hierarchy may read in one statement. Answers, errors,
    limits and traces are unchanged (docs/T10.1-READ-AHEAD.md). A check 30 folders deep goes
    from 99 round trips to 33 and from 13.3 ms to 6.7 ms (p50), and lookup_resources over
    10,000 documents from 506 to 8 and from 72 ms to 16 ms (benches/RESULTS.md).
  • Inside a read snapshot, Postgres statements use generic plans, set with SET LOCAL, so they
    are not replanned on every call. The first open-ended read below head returns to the
    server's default, for one more round trip.
  • Not every Postgres scenario got much faster. Over three benchmark runs against the baseline,
    shallow checks stayed about level (median p50: direct_hit -2.2%, direct_hit_below_head
    +1.3%, wide_groups_10k_below_head -3.2%) and writes did not change. No scenario was slower in
    all three runs, at p50 or p99, but a single run can be: wide_groups_10k_below_head ranged from
    +30.5% to -20.6% at p50, and write_batch_1000, whose code did not change, from +9.6% to -9.0%
    (benches/RESULTS.md).

Added

  • pemba.contrib.fastapi.Authz, a permission check for FastAPI routes, with the new extra
    pip install pemba[fastapi]. A deny gets a configurable 4xx (403 by default). A transient
    store failure gets a 503 with a fixed detail, and any other engine error a 500. An id the
    engine refuses gets a 422, an at_least bound ahead of the store a 409, and a request with
    no subject a 401, whose headers you can set with unauthenticated_headers. See
    docs/guides/fastapi.md.
  • ReadStore::batch_read_limit and ReadStore::read_batch, provided methods a store may
    implement to batch reads, with BatchRead and BatchAnswer.

pemba 0.2.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 12:42
7d89075

An additive async Python release; synchronous APIs and storage formats are unchanged.

Added

  • T5.13 async Postgres foreign writes: await Engine.write_async with psycopg
    AsyncConnection, asyncpg, or SQLAlchemy AsyncSession/AsyncConnection over
    either driver. The shared synchronous Rust algorithm uses the approved loop/thread
    bridge; caller-owned transactions still require caller commit/rollback. Cancellation
    drains in-flight work before raising, then the caller must roll back.
  • pemba.aio.check, lookup_resources, lookup_subjects and resolve read helpers.
    They preserve synchronous results and errors through asyncio.to_thread.
    Reproducible per-statement bridge measurements are recorded in benches/RESULTS.md;
    no sans-IO redesign or performance threshold is introduced.

pemba 0.1.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 12:46
41075c3

The first stable API release: embedded Rust/CLI and Python authorization with memory,
SQLite and synchronous Postgres stores. No supported async/Node/WASM distribution
or storage-format change is introduced by stabilization.

Breaking

  • Rust public API audit (T3.9/T7.2): extensible request/filter, response/statistics,
    store result and fixture report structs are now #[non_exhaustive]. Migrate request
    literals to CheckRequest::new, CheckItem::new, WriteRequest::new (or Default),
    and the existing lookup/read/filter constructors, then assign optional public fields.
    Match outputs with ..; custom stores use the new ReverseFilter, RelationCount,
    StoredSchema, GcStats and DeleteResult constructors. Fixture producers use
    Failure::new and Report::default. See docs/PUBLIC_API_AUDIT.md for every decision.
    Existing config defaults/setters, stable tuple/revision value types and storage formats
    are unchanged.
  • Upgrading from alpha.1/alpha.2: foreign writes return PendingRevision, not a
    committed Revision. The caller owns commit/rollback. Commit successfully, then
    call Rust engine.resolve(&pending) or Python pending.revision() and use AtLeast
    / at_least= for subsequent reads. SQLite already knows the number but cannot detect
    rollback; Postgres reports pending/rolled-back states. Engine reads do not see the
    app transaction's uncommitted writes. See the alpha.3 migration below and
    docs/guides/transactional-tutorial.md.
  • Upgrading from alpha.3: Python int(pending) and index conversion were removed in
    alpha.4 and remain unavailable. Resolve after commit or pass the token to at_least=.

Added

  • Rust Engine::check_str(resource, permission, subject, consistency) -> Result<bool, Error>:
    canonical parsing, then the existing typed check. The specified Error::Parse is now
    implemented with code PARSE; other check errors propagate unchanged. Python preserves
    built-in ValueError for malformed arguments; its stubs/signatures are unchanged.
  • OQ-044 is complete: only check_str is implemented. Use typed write/delete APIs and
    pemba_schema::compile instead of the removed promises of Rust write_str, delete_str
    and static Engine::validate_schema. Python schema validation remains available.
  • Installation, schema, consistency, transaction, troubleshooting and developer guides;
    runnable Rust/Python SQLite/Postgres app-row-plus-permission commit/rollback tutorial;
    stable/development documentation trees in the existing Pages assembly. Security
    reporting policy, safe issue forms, triage process and scoped roadmap are prepared;
    launch activation and final announcement text remain human gates.

Fixed

  • Playground deployment: tags dispatch deployment through main so GitHub Pages does
    not silently retain the pre-release artifact. Distinct Pages artifact names make
    reruns unambiguous. Deployment now verifies public page and asset bytes, including
    every versioned directory and its WASM, instead of trusting the deployment status.

pemba 0.1.0-alpha.4

pemba 0.1.0-alpha.4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 Oct 22:49
10ad07a

The first release with the browser playground.

Breaking

  • Python: removed the deprecated PendingRevision.__int__ and __index__
    conversions announced in alpha.3. int(pending) and operator.index(pending)
    now raise TypeError. Migration: call pending.revision() after commit when
    you need the revision number, or pass pending directly as at_least=.

Added

  • Browser playground at https://joshua-fields.github.io/pemba/: the real
    engine compiled to WebAssembly, running locally in a Web Worker. Edit schemas
    with syntax highlighting and inline diagnostics, run checks and both lookups,
    run fixture assertions, and inspect a collapsible explain tree or copy its text.
  • Playground examples for document sharing, GitHub-like permissions and agent
    authorisation; versioned share links and fixture YAML import/export. A version
    mismatch banner links to the original release when available.
  • Immutable playground-<version>.tar.gz assets attached to GitHub Releases.
    Pages serves the newest playground release at the root, each release at
    /v/<version>/, and development builds at /next/, with version and commit
    shown in the footer. Tag builds create or update the GitHub Release using
    these changelog notes before attaching the playground.
  • Playground CI checks the release WASM against native transcripts for all
    fixtures and 1,000 generated cases, checks generated cases against the reference
    evaluator, and runs frontend unit and browser tests with a 700 KB gzip budget.
  • pemba_fixtures::parse_str splits fixture YAML into its schema, its relationships
    text and its assertion sections, without running anything (the playground's import;
    docs/07-testing.md §3). FixtureError gains Malformed.

Changed

  • pemba-core, pemba-schema, pemba-store-memory and pemba-fixtures build and run on
    wasm32-unknown-unknown, for the browser playground (ADR-016). It is not a supported
    WASM package. On wasm32 only, pemba-core takes Instant from web-time, because
    std's Instant::now traps there. Other targets gain no dependency.

Fixed

  • The scheduled Postgres property-test workflow parses correctly after quoting
    its test command.

0.1.0-alpha.3: Postgres store

Pre-release

Choose a tag to compare

@Joshua-Fields Joshua-Fields released this 28 Oct 13:56
1008e32

[0.1.0-alpha.3] - 2026-10-28

The first release with the Postgres store.

Breaking

  • A write inside your own transaction returns a PendingRevision instead of a
    Revision (ADR-015): Python engine.write(..., conn=) and Rust Engine::write_in.
    Native writes still return Revision. On SQLite it is resolved at once.
    Migration: pass it as at_least=pending, or call pending.revision() after commit
    (Python); in Rust, tx.commit()? then engine.resolve(&pending)?.
    int(pending) and operator.index(pending) keep working for one release with a
    DeprecationWarning; comparisons and arithmetic do not. Rust has no transition aid.
  • For store implementers only: pemba_core::write::delete_matching returns Deleted and
    pemba_core::write::write_schema returns SchemaWritten, which carry an Applied
    (a revision, or a batch a commit trigger maps to one). Migration for stores that
    allocate revisions inside the write: .into_result() and .into_stored(source, hash).
    SqlDialect gains schema_lock, defaulting to none.
  • PendingRevision::resolved() is no longer a const fn. WritableStore gains
    resolve_batch, with a default for stores that number writes inside them.

Added

  • Postgres store (pemba-store-postgres, Postgres 15+): relationships in a schema of
    your database, revisions assigned at commit so concurrent writers stay in commit order,
    writes that join your transaction (Engine::write_in with PgTxn), GC that compacts
    and prunes, TLS through rustls. Wheels include it. See the README's Postgres section;
    benchmarks in benches/RESULTS.md.
  • PendingRevision (Rust and Python) and Engine::resolve. Python's at_least=
    accepts a PendingRevision.
  • Error codes REVISION_PENDING and WRITE_ROLLED_BACK, from Engine::resolve on a
    store that assigns revisions at commit (Python: RevisionPending and
    WriteRolledBack, both ConsistencyErrors).
  • Python: Engine.postgres(dsn, *, schema=None, pool_size=8, auto_migrate=False), whose
    calls release the GIL; write(conn=) on it joins a psycopg 3 or psycopg2 transaction,
    a SQLAlchemy Session / Connection, or django.db.connection, and works from async
    code through AsyncSession.run_sync. pemba.PembaWarning. Engine::store() in Rust.
  • Postgres: a prepared-statement cache per pooled connection (up to 256 statements,
    least recently used evicted and closed on the server). It is emptied on reconnect,
    after a schema write, and on every connection when the server reports a stale plan
    after DDL. It is not used inside your own transaction.
  • Postgres: batched writes. A write sends one statement per kind of operation (creates,
    touches, deletes), however many tuples it holds. If a create hits an existing tuple, the
    write is undone to pemba's savepoint and rerun one operation at a time, so
    AlreadyExists names the same tuple as before and your transaction stays usable. For
    store implementers: SqlDialect gains bulk_rows, defaulting to none (one statement
    per operation, as before; SQLite keeps that).
  • pemba check --color <auto|always|never>. auto, the default, is the previous
    behaviour: colour only on a terminal, and not when NO_COLOR is set. always colours
    even a pipe and overrides NO_COLOR (for less -R); never turns colour off.

Changed

  • --explain and CheckTrace::render(): when an exclusion denies because its subtracted
    side removed a granted base, both sides are now on the granting path, so the tree shows
    where the permission was granted and where it was removed. The base line is no longer
    marked (not needed).
  • --explain colour (CheckTrace::render_ansi()): evaluated nodes off the granting path,
    false ones included, are drawn in the terminal's normal colour instead of dimmed. Only
    skipped nodes and memo references are dimmed. (not needed) is printed in colour too,
    so the coloured text is the plain text plus styling.
  • --explain colour: a line on the granting path is coloured as a whole, not just its
    ✓/✗ mark: green where it granted, red where it denied (so the root of a denial is
    red), still bold. The denied: header is red. --color never output is unchanged.
  • Test-only: the cycle_passes tests read check_bulk stats from one global, always-on
    span recorder filtered to the calling thread, instead of a per-call scoped subscriber,
    the same capture as the lookup tests (#42, #43).
  • The README is written for newcomers: no internal task or decision numbers, the
    specification linked once under "Design documents", and a diagram comparing a separate
    authorisation service (two databases, dual writes) with pemba (one transaction).

Performance

  • On Postgres, latency is round trips. A direct check costs about 5 round trips. Each
    level of hierarchy it walks adds about 3, so a document 30 folders deep costs 99. A
    write costs 10 whatever its size. On a Linux CI runner where one round trip took about
    150 µs, p50 was 0.76 ms for a direct check (1.58 ms without the statement cache),
    16 ms for 30 folders (47 ms) and 19 ms for a 1,000-tuple write (407 ms). Full figures,
    with round trips for every scenario: benches/RESULTS.md. Fewer round trips for deep
    hierarchies is planned.

Fixed

  • Postgres: paging read_relationships at an older revision no longer sorts every tuple
    of the type for each page. The first 500-tuple page over 100,000 tuples went from
    106 ms to under 1 ms, because the planner had misjudged how many rows the
    older-revision filter keeps. Answers are unchanged.

pemba 0.1.0-alpha.1

pemba 0.1.0-alpha.1 Pre-release
Pre-release

Choose a tag to compare

@Joshua-Fields Joshua-Fields released this 20 Oct 10:01

The first public release of pemba: an embedded, Zanzibar-style authorization engine in Rust with Python bindings. It runs inside your process and keeps relationships in your own SQLite database, so a permission write can join your application's transaction and commit or roll back with your data. check, lookup_resources, lookup_subjects, the memory and SQLite stores, transactional writes and the Python bindings are implemented and tested.

This is an alpha. Expect breaking changes before 0.1.0. The 0.1 release gate is not signed off yet.

Install

pip install --pre pemba                      # Python 3.11 or newer (abi3 wheels for Linux, macOS, Windows)
cargo add pemba@0.1.0-alpha.1                # Rust library
cargo install pemba-cli@0.1.0-alpha.1        # `pemba` command-line tool

Only pre-releases exist, so pip needs --pre and cargo needs the explicit version.

Testing

  • 523,138 questions differential-tested against SpiceDB 1.56.2, with 0 unexplained mismatches. Every difference is documented with a repro in KNOWN_DIFFERENCES.md.
  • Mutation testing on the evaluator and schema validator: 202 mutants, 0 survivors (docs/MUTANTS.md).
  • Property tests against a reference evaluator, and three fuzz targets run for 10 minutes each.

Read more

Building pemba: An Embedded Zanzibar-Style Authorization Engine in Rust, on why the engine runs in-process and the two bugs that shaped its design.