Repository navigation
Releases
pgokf 0.7.0
A companion release: one pooled connection lifecycle shared by the
long-running companions, so pgokf-mcp survives a dropped link to
PostgreSQL. The catalog is unchanged - no SQL object or data differs from
0.6.0 - so the receipt-only pgokf--0.6.0--0.7.0.sql edge carries an
installed 0.6.0 catalog to 0.7.0 through an ordinary
ALTER EXTENSION pgokf UPDATE, and the committed pgokf--0.7.0.sql install
script is the 0.6.0 one regenerated under the new version.
Security
url2.5.9 for RUSTSEC-2026-0592 (a stack overflow in
Url::origin()on a URL nested in manyblob:prefixes).
pgokf-confluencecallsUrl::origin(), but only on http, https and
mailto links and on API links of at most 16 KiB, too short to nest deeply
enough to overflow, so it was not exploitable; the update keeps the
advisory gates passing and removes the flaw. The lockfile changesurl
and theform_urlencoded1.2.3 it requires, and the third-party notices
follow.quinn-proto0.11.19 andquinn-udp0.5.16 for RUSTSEC-2026-0523,
RUSTSEC-2026-0524 and RUSTSEC-2026-0538 (a peer opening streams beyond
the stream limit, a long Retry token that can panic or exhaust a client's
memory, and a receive loop that can spin on a truncated datagram).
quinnis in the lockfile only throughreqwest's optional HTTP/3
support, which no pgokf crate enables, so no pgokf binary links it. The
lockfile changes those two entries, socargo auditpasses again.- Two unmaintained-crate notices are accepted, not fixed.
RUSTSEC-2026-0543 markschronounmaintained and RUSTSEC-2026-0542
markshumantimeunmaintained; neither reports a vulnerability.chrono
comes in through arrow and parquet (the extension's Parquet export) and
humantimethroughobject_store(pgokf-ingest), and the latest
releases of both still require them.deny.tomland the new
.cargo/audit.tomlignore exactly those two IDs, each with its reason,
socargo deny checkandcargo auditpass again and any other advisory
still fails.
Fixed
pgokf-mcpreconnects instead of exiting. It held its catalog
connections for its whole life and stopped when any of them closed,
leaving the restart to a supervisor. Anything that closes idle
connections turned that into a restart loop with a growing back-off:
Azure Container Apps' TCP ingress closes a connection idle for 300
seconds, so an idle server exited every five minutes. Its reader, writer
and token-lookup connections now come from pools that replace a closed
connection on the next request. The health check asks on a connection of
its own, so/healthzreports 503 only while the catalog cannot be
reached, not while every reader is busy.
Changed
-
pgokf-pgconnowns the connection lifecycle. Besides the connect
step and TLS policy it now provides:Session: the tenant and the statement and lock bounds applied to
every new connection.Pool: the poolpgokf-webused, set up from aSession.Borrowed: the guard for one piece of work.finishtakes the guard and returns the connection at once, so
finished work cannot keep a connection while it borrows another.transactioncommits or rolls back and returns the connection only
once the transaction has ended cleanly.- Work abandoned mid-flight closes its connection instead of returning
it, and every pooled connection has the server check each second that
its client is still there (client_connection_check_interval), so
the abandoned statement stops too and the pool's backends stay within
its size.
pgokf-webandpgokf-mcpbuild their pools through it, and
pgokf-confluencesets its import session up throughSession. -
pgokf-mcpconnections.- Plugin builds no longer queue behind one another: each borrows a
reader connection of its own. Writes still run one at a time. - A request waits at most a minute for a free connection.
- A refused read (a bad cursor or limit) rolls back and hands its
connection back rather than closing it. - Each process opens at most twelve connections: eight readers, one for
the health check, two for token lookups and one writer.
- Plugin builds no longer queue behind one another: each borrows a
-
PostgreSQL 19 is tested as the GA 19.0. PostgreSQL 19.0 shipped on
2026-11-20 and the pinned 19 RC 2 base image and packages no longer
exist, so CI's PG19 leg (clippy, the in-database suite, an image smoke
test) now builds frompostgres:19and PGDG's19.xpackages exactly as
15-18 do, and the verifier refuses a prerelease tag or package for any
major. PG19 packages and images are still not published.
pgokf 0.6.0
A companion release: pushed Confluence events through a private Forge app,
and a supply-chain advisory fix. The catalog is unchanged - no SQL object or
data differs from 0.5.0 - so the receipt-only pgokf--0.5.0--0.6.0.sql
edge carries an installed 0.5.0 catalog to 0.6.0 through an ordinary
ALTER EXTENSION pgokf UPDATE, and the committed pgokf--0.6.0.sql
install script is the 0.5.0 one regenerated under the new version.
Added
- Pushed Confluence events. A private Forge app
(integrations/confluence-forge) has Confluence Cloud push page, comment,
and task events through Forge Remote to a new receiver,
pgokf-confluence-events, in the companions image. The receiver accepts a
delivery only when its Forge Invocation Token verifies against Atlassian's
published keys and names the configured app and no Confluence site but the
configured one, drops events the app caused itself, and writes accepted
events as JSON lines with a key that is identical for redeliveries. A
delivery whose signing key cannot be read yet, or whose sink is slow or
failing, is answered503so Forge retries it; a body declared as anything
but JSON, a body that is not the documented envelope, and an event naming a
page, space, or comment by anything but a canonical Confluence ID are
refused, and refusal reasons are logged one line each. The companions
smoke test runs the new binary. Recording events in the catalog is not part
of this change.
Security
ammonia4.1.9 for RUSTSEC-2026-0533 (mutation XSS through embedded
SVG and MathML). The advisory concerns sanitizers that allow a raw-text
element such asscriptorstyle;pgokf-weballows none (ammonia's
defaults plus heading ids and onespanclass), so it was not exploitable.
The lockfile changes that one entry, socargo deny checkpasses again.
Fixed
- Advance required nonproduction PostgreSQL 19 compatibility from RC 1 to
RC 2 after PGDG's candidate changed. Pin the officialpostgres:19rc2
image index and require RC 2 server and development packages. Stable
distribution remains PostgreSQL 15–18; no stable PG19 artifact is published.
pgokf 0.5.0
pgokf 0.5.0
A companion release: the Confluence Cloud ingestion companion, an enforced
--tls for every companion, and a supply-chain advisory fix. The catalog
is unchanged - no SQL object or data differs from 0.4.0 - so the
receipt-only pgokf--0.4.0--0.5.0.sql edge carries an installed 0.4.0
catalog to 0.5.0 through an ordinary ALTER EXTENSION pgokf UPDATE, and
the committed pgokf--0.5.0.sql install script is the 0.4.0 one
regenerated under the new version.
Added
pgokf-confluence, a Confluence Cloud ingestion companion. One run
reads every current page visible to one token in one selected space,
converts the complete space to OKF Markdown (pages/<page-id>.md, so
renames keep concept identity; links between imported pages become
relative links and graph edges), and - only with--apply- replaces a
dedicated content bundle in one transaction through
register_bundle_content_with_context. Without--applyit is a read-only
preview that never connects to PostgreSQL and can export the converted
bundle for review. Safety model: the token comes only from a file or
CONFLUENCE_API_TOKEN, never an argument; the crawl inventories the space
before and after reading bodies and refuses an empty, changing, partial or
over-limit snapshot; conversion is bounded per page (input bytes, depth,
nodes, table cells, rendered size); a durable, locked checkpoint binds runs
to one source, bundle, tenant and database endpoint, refuses foreign or
externally modified bundles, and turns page removals into an explicit,
reviewed--allow-deletions; the per-bundle advisory lock spans the crawl
and the transaction. The snapshot being committed is recorded in a
.pendingcheckpoint just before COMMIT and promoted after it, so a run
that dies in between is settled against the catalog by the next one even
when pages changed meanwhile. Untrusted storage cannot produce live
Markdown: code text stays inside its code span, headings and link labels
stay on one line, and frontmatter escapes the characters YAML forbids. A
whole-snapshot byte budget (--max-snapshot-bytes) keeps one import within
a single PostgreSQL message, and a scoped token's cloud ID is verified
against the site's public tenant record; the source identity is the site
and space alone. Each import records producer provenance
(producerpgokf-confluence, the space asorigin, a manifest hash, and
a source generation over page versions) in the change-event outbox and a
new bundle's freshness row. It follows the shared companion conventions
(OKF_PG_URL,OKF_BUNDLE_NAME,OKF_TENANT,OKF_PG_TLS; empty means
unset). Shared-audience only: Confluence page restrictions are not
reproduced. The companions image now ships the binary, the companions smoke
test runs it, CI runs its catalog workflow against PostgreSQL 18, and
docs/confluence-integration.md plus
deploy/confluence/cover individual setup and a scheduled Azure Container
Apps Job.
Security
--tls(OKF_PG_TLS) can no longer fall back to plaintext. Every
companion (pgokf-ingest,pgokf-embed,pgokf-mcp, andpgokf-web's
connection pool) chose a TLS connector under--tlsbut kept the connection
string'ssslmode. Underprefer- the default when nosslmodeis given -
a server that declined TLS received a plaintext startup message and
authentication exchange; underdisableTLS was never requested. The new
pgokf_pgconn::connection_configraises a weakersslmodetorequire
whenever TLS is forced, and every connection and pool is built from it, so a
declining server is refused before any startup data is sent. Connections
without--tlsare unchanged.rustix1.1.6 for RUSTSEC-2026-0486 (extended-attribute buffers marked
initialized when empty). Only the release verifier and test tooling link
rustix; no shipped extension or companion binary does. The lockfile
changes that one entry, socargo deny checkpasses again.
pgokf 0.4.0
pgokf 0.4.0
pgokf 0.4.0 is the first stable release of the 0.4 line. It brings the MCP server up to the 2026-07-28 protocol revision with structured results, Resources and Skills. It also completes the catalog reconciliation upgrade chain from 0.3.1, clears the open RustSec advisories, and hardens packaging and release verification. Stable artifacts cover PostgreSQL 15–18 on amd64 and arm64. PostgreSQL 19 RC 1 is tested for compatibility only.
Coming from 0.2.0? 0.2.0 is the last release published as packages. 0.3.0 was an unpublished candidate, and 0.3.1 was finalized in source but never published as a release. This release therefore also carries the 0.3 feature set (catalog generations, freshness, a durable change-event outbox, generation-bound typed relationships, and freshness-aware workspace plugins). See the 0.3.1 changelog entry.
ALTER EXTENSION pgokf UPDATEtakes you from 0.2.0 straight to 0.4.0.
Highlights
- MCP 0.4. The server implements MCP
2026-07-28and still accepts the legacy2024-11-05,2025-03-26and2025-06-18initialization revisions. It adds a Tools registry with strict input/output schemas and validatedstructuredContent, stable URI-addressed Resources, and the optionalio.modelcontextprotocol/skillsextension. - Catalog reconciliation upgrade chain. The ordinary update path is
0.3.1 → 0.4.0-dev1 → 0.4.0-dev2 → 0.4.0-dev3 → 0.4.0. It repairs search-function and web-identity drift on catalogs that followed an early 0.3.0-dev build, and leaves factory catalogs unchanged. - Security. The current RustSec advisory set is cleared, including the critical
zipadvisory GHSA-m665-v7pm-7grj and fourrustlsadvisories. - Packaging. Debian packages and multi-architecture server and companion images for PostgreSQL 15–18 on amd64 and arm64. Debian metadata rendering is hardened, and every package ships a deterministic third-party notices file.
- PostgreSQL 19 RC 1. Compatibility testing moves from Beta 3 to RC 1. This is non-production, and no PG19 image or
.debis published. - Release verification. Release gates now run in the Rust
pgokf-verifierwith contained process supervision. Publication happens only through an explicit dispatch.
Upgrading
ALTER EXTENSION pgokf UPDATE; -- from 0.3.1, 0.3.0, 0.2.0 or any earlier 0.1.x / dev point version
SELECT extversion FROM pg_extension WHERE extname = 'pgokf'; -- 0.4.0Every earlier version, including all 0.1.x releases and the 0.3.0-dev and 0.4.0-dev point versions, has an ordinary update path to 0.4.0. Take a backup first (pg_dump, or pgokf-backup in the images). The steps are:
| Step | What it does |
|---|---|
0.3.1 → 0.4.0-dev1 |
Additive. Adds and backfills the exact SKILL.md SHA-256 and byte-size columns, then registers dump relations. |
0.4.0-dev1 → 0.4.0-dev2 |
Reconciles search-function drift on catalogs that followed an early unpublished 0.3.0-dev build. It drops the superseded 0.2.0 concept_search_semantic / concept_search_hybrid overloads, whose overlapping defaults made defaulted calls ambiguous. It also replaces the 11-argument bm25_hits helper with the 12-argument one and restores fresh-install ACLs, comments and initial privileges. Each retired object is dropped only in its exact published shape, RESTRICT. Any other shape or custom grant aborts the update with a named diagnostic and changes nothing. |
0.4.0-dev2 → 0.4.0-dev3 |
Restores the seven superseded pgokf_web comments (the schema, pgokf_web.users and five of its columns) verbatim from the fresh-install source, and nothing else. |
0.4.0-dev3 → 0.4.0 |
Receipt-only finalization. Changes no objects or data beyond the standing dump-relation registration. |
Declared catalog exception. A catalog that followed an early 0.3.0-dev build keeps display_name/provider at the end of pgokf_web.users, and provider at the end of pgokf_web.sessions. The physical column order is not rebuilt. Shipped code reads and writes both tables by named columns only, and the upgrade gate replays the product's statements against both orders. See "Declared catalog exceptions" in docs/api-stability.md.
MCP server (pgokf-mcp)
- Implements MCP
2026-07-28. Legacy stdio clients still initialize before calling tools, and legacy HTTP remains sessionless. Successful legacy text payloads keep their shape, with structured content added beside them. - Tools: all 14 legacy tool names plus
traverse_concepts, with strict schemas and structured results. Unknown arguments and wrong-typed optional filters now fail closed. Writer tools are hidden when no usable writer connection is configured. Execution errors carry stable domain codes and safe messages, without SQL error chains. - Resources:
resources/list,resources/templates/listandresources/readover canonicalokf://catalog/...URIs, with exact stored-byte reads. - Skills: the optional
io.modelcontextprotocol/skillsextension (skills/list,skills/get, and per-file bytes viaresources/read) publishes the canonicalpgokf.skillspackages. It is modern-only; legacy clients keepget_skill. Skill manifests are served as baretext/markdown, and the exactSKILL.mdSHA-256 and byte size now persist through upgrades. - Transports: newline-delimited stdio, and authenticated POST JSON over HTTP.
- Not implemented: subscriptions, list-change notifications, SSE, Tasks, prompts, completions, sampling, elicitation and OAuth discovery. Details are in docs/mcp-0.4-development.md and spec/pgokf-0.4.0-mcp.md.
Web UI sign-in
The pgokf-web sign-in modes (OKF_WEB_AUTH = none, header for a trusted proxy, users for built-in accounts, and oidc for OpenID Connect with PKCE) are unchanged in 0.4.0, and existing configurations keep working. The only 0.4.0 change touching their tables is the 0.4.0-dev3 comment restoration and the declared column-order exception described under Upgrading.
Packaging and distribution
Artifact status: the images below are published to ghcr.io/logicocean (amd64 + arm64) and the eight .deb files are attached to this release, produced by the v0.4.0 tag CI run and the publish dispatch. PostgreSQL 19 RC 1 remains compatibility-testing only.
- Debian packages:
postgresql-<N>-pgokf_0.4.0-1_<arch>.debfor N = 15, 16, 17, 18 and arch = amd64, arm64. Each depends onpostgresql-<N>and installs the extension library, control file, install script and full upgrade chain. The license andTHIRD-PARTY-NOTICES.txtgo under/usr/share/doc/postgresql-<N>-pgokf/. - Build hardening:
packaging/deb/build-deb.shnow validates theMAINTAINERandDEB_REVISIONoverrides before any build step. They are rendered as pure data through a fixed-format token renderer, which closes a sed-program injection. A maintained 12-assertion suite (packaging/deb/test-build-deb.sh) must pass before CI runs the production.debbuild. - Server images:
ghcr.io/logicocean/pgokf:0.4.0-pg15…0.4.0-pg18(linux/amd64+linux/arm64). Each is a drop-inpostgresimage with pgokf, pgvector and pg_cron, plus the pinned, checksum-verifiedpg_textsearch1.4.0 BM25 provider on PostgreSQL 17 and 18. - Companions image:
ghcr.io/logicocean/pgokf-companions:0.4.0(pgokf-ingest,pgokf-embed,pgokf-mcp,pgokf-web). - Third-party notices:
THIRD-PARTY-NOTICES.txtis generated deterministically by a checksum-pinnedcargo-about0.9.2 plus an authenticated inventory of the vendored JavaScript. CI fails on any drift. - PostgreSQL 19: RC 1 (
postgres:19rc1, pinned by index digest, and PGDG19~rc1) is a required compatibility leg in CI. It is non-production, and no PG19 image or.debis published. GA support will need its own reviewed change. - Homebrew: the formula stays on 0.2.0 inside this tag by design, because a formula cannot contain the digest of its own archive. The
LogicOcean/homebrew-pgokftap moves to 0.4.0 in a separate step after the tag.
Security
- RustSec/GHSA updates:
zip9.4.1 (GHSA-m665-v7pm-7grj, critical) andrustls0.23.46 (GHSA-vp88-798v-h67f, GHSA-c8m5-c952-6cm4, GHSA-w44r-93j7-qv28, GHSA-h2v8-394m-p7vv). Patch-line updates also cover Arrow/Parquet, QUIC, the sanitizer, TLS, async, Markdown, WebPKI and Zstandard. - The deprecated
serde_yaml/unsafe-libyamlstack is replaced with the maintainedyaml_serde/libyaml-rs. Askama's unused external-config feature is disabled, so the unmaintainedbasic-tomlparser is no longer linked. - MCP cursor and resource digests use the workspace's HMAC 0.13 and SHA-2 0.11 generations, and the fixed wire and digest vectors are preserved.
Release engineering
- Images can only be published from an explicit
workflow_dispatchof thepackagesworkflow naming the current tag. The resolver proves the checked-out source is that tag's commit before any registry write. Branch and tag pushes only build and smoke-test. - Documentation-site (GitHub Pages) deployment is manual-only, through a default-false dispatch input.
- Release, packaging and compatibility gates run in the Rust
pgokf-verifier. This includes source-guard, workflow execution-context digests, deterministic notices, Debian and image smoke tests, and reconciliation mutation campaigns. Child processes are contained with Linuxpidfdand macOS launchd supervision, and CI shells are bound to the system Bash without startup hooks.
Full changelog: CHANGELOG.md · Source diff since the last tag: [v0.3.0...v0.4.0](https://github.com/LogicOcean/...
pgokf 0.2.0
Skill packages are catalog content, and a web UI to work with them.
A bundle may now carry Agent Skills packages whose exact bytes the catalog stores and serves back. pgokf-web puts a UI and a JSON API over the whole catalog, with an optional human workflow — upload, edit, review — once an identity mode and a writer connection are configured. pgokf-workspace turns a catalog selection into an agent-harness tree for twelve named harnesses. And pgokf-mcp speaks HTTP as well as stdio, with bearer tokens and four roles.
ALTER EXTENSION pgokf UPDATE TO '0.2.0' is additive: it creates the new tables empty. A bundle that already carried a SKILL.md projects into pgokf.skills / pgokf.scripts / pgokf.reference_documents on its next refresh_bundle.
Highlights
- Skill packages, byte for byte. The sync classifies every file of a package, projects the manifest as a virtual
type: Skillconcept, and keeps exact bytes regardless ofstore_source. Three audited, reader-level, tenant-scoped readers return them, and the plugin builder copies packages through those readers whole — scripts still executable. - A web UI over the whole catalog. Search with facets, a 3D link graph, bundle and concept browsing, an operations page, and a five-step plugin builder. Roles are a ladder — viewer, uploader, editor, approver, admin — with identity from a password kept in the catalog, an authenticating proxy, or any number of OpenID Connect providers and GitHub, all set up from the Admin page rather than a config file.
- The human workflow, and the rule behind it. A verification is granted by an approver reviewing a document; it is never something a contributor types into one. A
verifiedlist in an upload or an edit is set aside undersuperseded_verifications, with who set it aside and why, so the derived trust tier cannot be claimed. - MCP for agents, over stdio or HTTP, with four token roles:
reader,builder,writer,admin. Awritertoken may add or replace documents in a content bundle and anadmintoken may manage bundles — and what an agent writes arrives unverified whatever it claims, for a person to review. The two writing roles need the server to hold a writer connection of its own (OKF_PG_WRITER_URL); without one their tools are listed and say so. - The web UI's identity state lives in the catalog, in four extension-owned
pgokf_webtables granted topgokf_writeronly: people, sessions, MCP token digests, and identity providers. Transactional, shared by every instance, and carried bypg_dump. - Sessions can be ended, not merely left to expire. Every issued session is a row; a cookie the catalog does not list is refused. Signing out ends it everywhere, and an admin can end anyone's.
Security
This release includes fixes for issues found in review before it shipped, several in code that predated it: a cross-tenant content write, a content rewrite that silently dropped a bundle's index.md and log.md, concurrent writers overwriting each other, an unbounded sign-in throttle, a symlink-following temp write, and an OIDC login that accepted an unverified email claim. See the changelog for the full list.
Install
docker pull ghcr.io/logicocean/pgokf:0.2.0-pg18
docker pull ghcr.io/logicocean/pgokf-companions:0.2.0Images are multi-architecture (linux/amd64, linux/arm64) for PostgreSQL 15–18. The extension builds from source on 15–19.
The full changelog is in CHANGELOG.md.
pgokf 0.1.16
Deny-by-default tenancy, on demand. The new durable policy key
require_tenant (default false) makes a session that has not set
pgokf.tenant see nothing and refuse to ingest, instead of the see-all
behavior every earlier release had. Nothing changes until an administrator
turns it on; ALTER EXTENSION pgokf UPDATE TO '0.1.16' adds one column and
rewrites the thirteen tenant-isolation policies in place.
Added
require_tenantpolicy key and the reader-level
pgokf.tenant_required()function every row-level-security policy consults
(as an uncorrelated sub-select: one evaluation per statement, never a
per-row call). With the policy on, an unscoped session sees no rows through
the policies and every reader built on them, theSECURITY DEFINERreaders
apply the same rule (health()counts,list_sync_log,list_sync_changes,
list_access_log, and the ParadeDBbm25_hitspath come back empty;
get_concept_sourceraises the same not-found22023a foreign tenant
gets), and the ingestion tier, the bundle-addressed writers and exports, and
purge_retiredrefuse it with SQLSTATE42501.set_config/reset_confignever need a
tenant, so the policy can always be turned off again.health()gains
tenant_required. The function is executable by any role withUSAGEon
schemapgokf, because the policies depend on it.- Companions:
pgokf-ingestaccepts--tenant/OKF_TENANTlike
pgokf-embedandpgokf-mcp; all three apply it through one shared
pgokf-pgconnhelper. The compose stack passesOKF_EMBED_TENANTand
OKF_INGEST_TENANTthrough (next to the existingOKF_MCP_TENANT).
Changed
schedule_refreshpins the bundle's tenant into the pg_cron job command
(set_config('pgokf.tenant', ...)beforerefresh_bundle), so the cron
worker's own, tenant-less session satisfies the tenant rules. Jobs
scheduled by earlier releases run the bare call; re-schedule them
(schedule_refreshupdates a job in place) before turningrequire_tenant
on, or pin the job role's tenant withALTER ROLE ... SET pgokf.tenant.- The write-side tenant rule (
enforce_bundle_tenant) now also refuses an
unscoped session when a tenant is required, with a distinct42501message
naming the fix, rather than the unknown-bundle22023used for cross-tenant
ids.
Images: ghcr.io/logicocean/pgokf:0.1.16-pg{15,16,17,18} and ghcr.io/logicocean/pgokf-companions:0.1.16 (linux/amd64 + linux/arm64). Homebrew: brew tap logicocean/pgokf && brew install pgokf.
pgokf 0.1.15
A PostgreSQL-licensed BM25 backend. The bm25 search backend now runs on
a selectable provider, and Tiger Data's pg_textsearch (PostgreSQL license,
PostgreSQL 17 and 18) joins ParadeDB's pg_search. The Docker image bundles
pg_textsearch on the 17 and 18 images and no longer bundles pg_search by
default. ALTER EXTENSION pgokf UPDATE TO '0.1.15' adds one policy column
with its default and touches no existing row.
Added
bm25_providerpolicy key (auto|pg_textsearch|pg_search,
defaultauto, which preferspg_textsearchwhen installed). Both
providers name their index access methodbm25and cannot coexist in one
database, so resolution is unambiguous.rebuild_search_index()builds the
resolved provider's index;search_index_status()reportsbm25.provider
andbm25.provider_setting;health().bm25_readyaccepts either provider.pg_textsearchbackend. One expression index over title, description,
and body with the catalog's text-search configuration (baked into the
index; rebuild after changing it). A page is served by the provider's
index-ordered top-k scan (ORDER BY <expr> <@> to_bm25query(...) LIMIT n)
with the structured filters, the keyset predicate, and row-level security
applied as ordinary quals on that scan - inline with invoker rights, no
privileged helper - then orderedrank DESC, bundle_id, concept_idin SQL.
Rows tying the page's last rank are read past the page so keyset pages
tile exactly, up to 256 tied rows per boundary (beyond that aWARNING
and approximate paging). Query text is plain terms, as it already was on
pg_search(neither provider interprets web-search operators). Covered by
new in-database tests (the query shape is asserted to plan as abm25
index scan) that run whereverpg_textsearchis preloaded, including CI's
PostgreSQL 17 and 18 legs.- Image:
WITH_PG_TEXTSEARCH(defaultauto: installed on 17 and 18 from
the pinned, checksum-verified release package via the shared
fetch-pg-textsearch.sh, with its PostgreSQL-license notice under
/usr/share/doc; skipped elsewhere). CI builds the 17/18 images with
WITH_PG_TEXTSEARCH=1and the smoke test requires a provider there, so a
stale checksum table fails the build rather than publishing a provider-less
image.WITH_PG_SEARCHnow defaults to0; the ParadeDB build path remains
available.pgokf-restoreskips apg_textsearchextension entry the
target cannot replay, as it already did forpg_search. The compose stack
preloadspg_textsearch.
Changed
search_index_status().bm25.availableandhealth().bm25_readynow
follow the providerbm25_providerresolves to (they were "pg_search
installed"), so a pinned provider that is missing shows as unavailable
even when the other one is present, and the fallback warning names what
is installed instead.concept_search,find_similar, andconcept_search_hybridare now
PARALLEL RESTRICTED(executed in the leader of a parallel plan, never in
a worker): the BM25 providers declare their scoring parallel-unsafe, and
these functions run it through SPI. Results and signatures are unchanged;
the upgrade script relabels the installed functions.- Documentation for search backends, configuration, packaging, and the
compose deployment covers provider selection and the licensing difference. - Compose stack:
shared_preload_librariesnow namespg_textsearch
instead ofpg_search(overridable through the newPGOKF_PRELOAD
variable, e.g.pgokf,pg_cronfor a 15/16/19 image), and the ParadeDB-only
paradedb.planner_warningssetting is gone. An older compose file that still preloadspg_search
will not start the 0.1.15 image (the library is no longer in it): update
the preload line, or build the image withWITH_PG_SEARCH=1 WITH_PG_TEXTSEARCH=0to keep ParadeDB. A database that haspg_search
created must drop it (on the old image,DROP EXTENSION pg_search CASCADE)
beforepg_textsearchcan be created; the step-by-step migration is in
docs/compose-deployment.md. - Test harness: the in-database tests that need a preloaded BM25 provider
now run whenPGOKF_TEST_PRELOADnames it (pgrx starts its own instance,
so the operator's cluster configuration never reached them, and they had
been skipping silently), and fail instead of skipping when the requested
provider is unusable.
Images: ghcr.io/logicocean/pgokf:0.1.15-pg{15,16,17,18} and ghcr.io/logicocean/pgokf-companions:0.1.15 (linux/amd64 + linux/arm64). Homebrew: brew tap logicocean/pgokf && brew install pgokf.
pgokf v0.1.14
[0.1.14] - 2026-09-04
Complete logical backups, production container packaging, and native
arm64. The one in-database change makes pg_dump actually capture the
catalog; everything else is packaging, deployment, companion, and CI work.
ALTER EXTENSION pgokf UPDATE TO '0.1.14' adds a trigger and the backup
registrations and touches no existing row; a catalog upgraded with it is
identical to a fresh 0.1.14 install.
Fixed
- BM25 search works for non-superuser readers. With
search_backend = bm25, any session that is not the table owner - every production reader -
gotUnsupported query shapefrom pg_search: row-level security wraps
pgokf.conceptsin a security-barrier subquery its custom scan cannot plan.
The hit query now runs throughpgokf.bm25_hits, aSECURITY DEFINER
helper (pinnedsearch_path, execute granted topgokf_readeronly) that
applies the same explicitpgokf.tenantpredicate the policies enforce, so
concept_searchand the hybrid search keep their invoker-rights contract
and the result set is unchanged. Covered by a new in-database test that runs
wherever pg_search is preloaded. pg_dumpnow captures the catalog. PostgreSQL skips the contents of
extension-owned tables unless the extension registers them with
pg_extension_config_dump; pgokf never did, so every archive carried only
theCREATE EXTENSIONstatement and a restore came back empty - despite the
operations guide describing dumps as complete. Everypgokf.*and
pgokf_private.*table and sequence is now registered (discovered from the
extension's dependency graph, so future tables are covered automatically),
and aBEFORE INSERTtrigger on the singletonpgokf_private.configrow
folds the restored policy row into the oneCREATE EXTENSIONseeds instead
of failing on a duplicate key. Registered relations and the trigger are
asserted by new in-database tests, and the image smoke test restores a real
archive.
Added
- Server image with the optional extensions built in. The Docker image
now ships pgvector, pg_cron, and ParadeDB pg_search (each aWITH_*build
argument; pg_search is fetched from its pinned upstream release and verified
against a committed SHA256 table), aHEALTHCHECK, an OCI version label,
and first-init hooks that create the extensions when preloaded, create
least-privilege login roles fromPGOKF_{ADMIN,WRITER,READER}_PASSWORD, and
apply a JSONPGOKF_POLICYthroughpgokf.set_config. It also carries
pgokf-backup(a verifiedpg_dump+ roles-dump tool with retention) and
pgokf-restore(a single-transaction restore that skips the archive entries
an initialized target cannot replay: pg_search's unownedparadedbschema
and, for a differently named database, pg_cron's objects). - Companions image (
Dockerfile.companions):pgokf-ingest,
pgokf-embed, andpgokf-mcpin one non-root image. - Multi-architecture images. CI builds and smoke-tests both images
natively on amd64 and arm64 runners and merges them into one manifest per
tag (ghcr.io/logicocean/pgokf:<version>-pg<major>,
ghcr.io/logicocean/pgokf-companions:<version>), so they run on x86 and
arm64 servers and on Apple Silicon. The.debmatrix gained arm64 legs. - Reference compose deployment (
deploy/compose/, documented in
docs/compose-deployment.md): server, embedding daemon, cron-driven
backups, and optional ingestion and MCP services, all configured from one
.env. pgokf-embed --watch/--interval: the embedder runs as a daemon that
embeds newly registered or refreshed concepts every interval, reconnecting
per pass and surviving transient outages. The loop and its SIGINT/SIGTERM
shutdown live in the newpgokf-companioncrate, shared withpgokf-ingest
(which therefore now also stops cleanly on SIGTERM, i.e.docker stop).- Packaging lint in CI (hadolint, shellcheck,
docker build --check, compose
render), a.dockerignore, and reusable smoke scripts
(packaging/docker/smoke-test.sh,smoke-test-companions.sh).
Changed
- The image's first-init SQL creates
vectorwhenever present andpg_search
/pg_cronwhen preloaded, instead of onlypgokf. - Documentation: new compose deployment guide; packaging, operations, search,
and deployment-topology guides updated for the bundled extensions, the
backup tool, the embedder daemon, and multi-arch publishing.
pgokf v0.1.13
[0.1.13] - 2026-08-29
Relicensed to AGPL-3.0 plus commercial, and the first public release. This
release also fixes a set of audited defects in the shipped catalog and
companions. The in-database SQL surface is
unchanged from 0.1.12 - no table, type, function signature, index, grant,
comment, role, or configuration key is added, dropped, renamed, or rewritten, so
ALTER EXTENSION pgokf UPDATE TO '0.1.13' is a documented no-op that yields a
catalog identical to a fresh 0.1.13, with every bundle, concept, embedding, link,
history version, and provenance record intact. Every fix is internal code, a new
input validation, companion behavior, or documentation; loading the 0.1.13
shared library is what activates the corrected code paths. api_stability and
the no-data-loss upgrade guarantees are preserved.
Changed
- Relicensed to dual AGPL-3.0 + commercial (previously MIT). Every crate in
the workspace - the extension, theokf-parser/okf-synclibraries, and
the companion tools (pgokf-ingest,pgokf-embed,pgokf-mcp,
pgokf-pgconn) - is nowAGPL-3.0-only, and a commercial license is
available for use the AGPL does not permit. SeeLICENSING.md
andCOMM-LICENSE.md.
Security
- Denial-of-service in
concept_neighborsclosed (HIGH). The recursive
traversal previously enumerated every simple path from the seed
(≈O(N^hops)), so a reader callingconcept_neighbors(seed, 5)on a dense
bundle could spin the backend on millions of walk rows for a tiny answer. The
traversal is rewritten as a set-based, cycle-safe breadth-first search that
records the first (minimum-hop) visit of each neighbor and never re-expands a
visited node -O(V + E)work - returning identical results (distinct
neighbors, shortest hop distance, cycle-safe, active-bundle-scoped) for normal
graphs. A denseK30bundle that formerly timed out now answers in
milliseconds. - Embedding poisoning rejected at write (HIGH).
set_concept_embeddingnow
validates that every element of the supplied vector is finite, raising SQLSTATE
22023(naming the offending index) for aNaN/Infinityelement before the
upsert. Storage isreal[], so such a value inserted silently but was rejected
by pgvector at every query/index cast - one bad write could break semantic and
hybrid search andrebuild_embedding_indexcatalog-wide until the row was found
and fixed. purge_retireddata-loss race closed (HIGH).purge_retiredsnapshotted
the eligible bundles and then hard-deleted each without re-checking, so a
concurrentunretire_bundlethat committed in between could have its restored
bundle (and its concept history) silently deleted. The per-bundle delete now
re-evaluates the eligibility predicate (retired_at IS NOT NULL AND retired_at < now() - older_than) atomically under the bundle advisory lock, skipping - never
deleting - a bundle that is no longer eligible.- Multi-tenancy trust model documented honestly.
docs/security.mdand
docs/multi-tenancy.mdnow state plainly that thepgokf.tenantGUC is a
scoping selector, not a hard security boundary against a tenant who can run
arbitrary SQL (any session canSET/RESETit, and a pinnedALTER ROLE
default is overridable in-session), that the unset default fails open to
see-all, and that a hard boundary requires a constrained access layer that
pins the GUC or a per-tenant-role model.
Fixed
log.mdmidnight-timestamp corruption (MED). A space-separated
YYYY-MM-DD HH:MM[:SS]leading timestamp in a reservedlog.mdentry parsed to
midnight (only the first whitespace token was read). It now parses to the
real instant, while an untimestamped line still yields aNULLlogged_atand
the entry text stays lossless.concept_neighborsNULL-bundle disambiguation counted inactive bundles
(LOW). With nobundle_id, disambiguation now counts only active bundles
(enabled AND retired_at IS NULL), so a disabled/retired duplicate of a concept
id no longer raises a spurious22023that blocked the only active bundle.- Self-linked seed excluded from its own neighbor set (LOW). A concept that
links to itself is no longer returned as its own neighbor. - Deterministic tiebreak for semantic/hybrid search (LOW).
concept_search_semanticandconcept_search_hybridnow break equal
distance/fused-score ties on(bundle_id, concept_id)for a stable order.
Companions
- Optional TLS to PostgreSQL for all three companions (MED).
pgokf-ingest,
pgokf-embed, andpgokf-mcpnow share a smallpgokf-pgconnhelper crate and
accept a--tlsflag (envOKF_PG_TLS); TLS is also enabled by
sslmode=requirein the connection string. When enabled, the link usesrustls
(reusing the stack already pulled byobject_store/reqwest, socargo deny
stays green) and verifies the server certificate against the platform trust
store.NoTlsremains the default for a local socket / trusted network. pgokf-ingestunit tests. Added AAA unit tests for the companion's
path-derivation (prefix strip) and change-detection (content-hash) helpers.
Internal
- New
crates/pgokf-pgconnworkspace crate centralizes the companions'
PostgreSQL connect step. Version bumped to0.1.13across the workspace,
pgokf.control, andMETA.json; a documented no-op
pgokf--0.1.12--0.1.13.sqlupgrade script ships. Regression tests (Rust unit
tests and in-database#[pg_test]s) cover every fix above.