Repository navigation
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.