OutlabsTaskq
Concepts

SQL-first contract

Why PL/pgSQL functions are the source of truth.

The protocol is a set of functions in schema taskq. The Python library, the HTTP facade, and psql are equal clients.

Schema and migrations

ItemValue
Schema nametaskq (fixed — ADR-002)
Packaged migrations0001_initial, 0002_contract_0_1_1, 0003_contract_0_1_2
Drift oracletaskq verify / verify() / verify_sync()

Capability roles

RoleRights
taskq_ownerOwns schema objects; migration target ownership
taskq_producerEXECUTE enqueue paths
taskq_runnerClaim, heartbeat, settle
taskq_observerStats / read views
taskq_operatorRedrive, cancel, control
taskq_housekeeperTick / reaper

Functions are owned by taskq_owner, pin search_path, revoke PUBLIC execute, and grant to a capability role. Because raw table DML is denied to runners, every documented flow has a function.

What lives where

LayerOwns
PostgresClaim, fencing, retry budget, uniqueness, concurrency admission
PythonModels, worker loop, handler DX, optional HTTP transport
Host appJob handlers, domain side effects, IAM wiring

Typed results everywhere

Enqueue and settle never return silent null success. Expected races return structured statuses so network retries are safe.