Released version: 2.19.0 (see VERSION). Last reviewed: 2026-10-13.
2.11.5 was prepared but never released on its own: its work (event actors,
removeAs()) ships inside 2.12.0. There is no 2.11.5 package.
This is the single authoritative statement of what exists and what does not. If any other document in this repository disagrees with this one, this one is right and the other is stale - report it.
Feature-level detail lives in CLAUDE.md. This file covers only status:
shipped, pending, or abandoned.
docs/ tree| Path | What it is | Trust it? |
|---|---|---|
docs/ROADMAP.md |
This file - current status | Yes |
CLAUDE.md |
Per-release feature notes and hard-won lessons | Yes |
docs/integration-guide.md |
Consumer-facing API guide | Yes |
docs/superpowers/specs/ |
Design decisions, each with a status banner | Read the banner first |
docs/superpowers/plans/ |
Implementation plans for work not yet done | Yes, but re-validate against current code |
docs/superpowers/plans/archive/ |
Plans for work already shipped | Historical only - do not execute |
docs/incidents/ |
Post-mortems of resolved production incidents | Historical, lessons folded into CLAUDE.md |
Older documents refer to "Phase A/B/C". That vocabulary comes from the 2026-05-15 storage-engine roadmap and is retained only for reading old comments. Do not plan new work in these terms.
| Phase | Shipped | What actually happened |
|---|---|---|
| A | v1.10.0 | yyjson became the parser on hot paths. Document::data stayed nlohmann::json. Done. |
| B | v1.11.0 | Documents hold a binary doc_binary::Doc (yyjson mut_doc) with a lazy nlohmann view. Done. |
| C | v2.0.0 | Superseded in flight. Phase C as designed meant writing our own engine: 16 KB slotted pages, a BPlusTree, an LRU buffer pool, page-level WAL redo - 2-3 months at high risk. The build-vs-buy spike chose LMDB instead (~2 weeks). Phase C's goal was met (bounded RSS, disk-backed B+ tree) but none of its named components were built. |
Consequences of that substitution, which trip up readers:
BufferPool, no Page, no BPlusTree in this codebase. LMDB
provides all three internally.buffer_pool_size_mb does not exist. A comment in database_service.cpp
once promised max_memory_mb would be renamed to it "in v2.1". That never
happened and is not planned; max_memory_mb still configures MemoryStore
eviction, which no longer bounds RSS. LMDB mapsize plus OS page cache does.document_store_lmdb.cpp:9, "Stage 4 may optimise to a binary frame later" -
part of the write-handler migration below.Every item below is in the installed product as of 2.19.0. CLAUDE.md has the
detail and the failure modes.
<project>:<collection>)sensitive_fields, sensitive names at any depth, a one-time migration with
a seal, encryption-verify, comparisons on ciphertext refused (2.17.0);
verify without the global history lock, a streamed history rewrite, an
atomic compaction swap, info showing the enforced rule and versioning,
project:_name refused, history pruned when maxVersions is lowered (2.17.1);
per-file history locks, a reseal only where something was rewritten,
vectors accepted in encrypted collections (2.17.2)_expires_at on get/find/export),
filterable, and reserved in write bodies (2.19.0)GetServerInfo capability
negotiation, decoupled packages, build.sh --only, packaging/compat.sh (2.15.0)find()'s filters (2.14.0)DescribeDelete, relations check, per-collection
enforcement switches, and TTL expiry running the same policy as a manual deleteindex-create --unique, unique-create, unique-dropClient::FailureDetail,
Client::errorDetail()AlreadyExists,
reason duplicate_id (2.12.1)dropIndex / dropCollection repair a name left poisoned by an
older version (2.12.2)dropProject deletes the project's files, the upload size limit
refuses mid-stream with file_too_large, downloads stream from disk (2.12.3)Client::Error with its code instead of answering
empty/nullopt/false/0, on every read whose empty value is also a valid
answer; update() reports an outage with its real code, not NotFound
(2.12.4)get/find with Client::WithVector) and a
streaming per-collection export (ExportCollection, exportCollection())
with an exact-snapshot cursor, a resume cursor and a per-row VectorState;
a document and its vector commit in one LMDB transaction; write bodies can no
longer store the six read-metadata names; deleteFile/setFileTtl take a
Failure&; a throwing event handler no longer terminates the process (2.13.0)document_too_large, incl. patch
growth); a timed-out write says outcome_unknown and is retried only when
idempotent; update() retries only version conflicts; connect() reports an
unreachable server (2.13.1)patchIfVersion) and atomic increment
(increment) (2.12.0)DatabaseEvent, removeAs(),
subscribeEvents() (2.12.0); client batch delete removeManyAs() (2.12.0)indexes, index-create, index-drop,
index-values(?i), an
invalid pattern refused with invalid_pattern (2.20.0)storage.consistency repair knobs (2.21.0). WAL replay records no history,
and max_versions is enforced as history grows (2.21.1)Ordered by what a reader is most likely to need next. Nothing here has a committed date.
Served from an index: equality, IN, CONTAINS, EXISTS=true, numeric and
string ranges, two-list intersection, result ORDERING, filtered TOTALS, and
distinct values / min / max. Remaining:
NE and REGEX would need a full walk either way. A prefix-anchored
REGEX (^abc) could become a range over the string tag - the one real
opportunity here.SEARCH reads whole documents by definition.total_matched requires visiting every match, which is precisely what
stopping early avoids. Changing it means making the total approximate - a
contract decision, not an optimisation._id exists in a posting. Would need an ids-only
response mode.encode_document still serialises with nlohmannstorage/document_store_lmdb.cpp writes documents via doc.toJson().dump().
Measured, nlohmann::dump() is ~11x slower than yyjson_write on a large
document (27.5 ms vs 2.5 ms on 2.91 MB). Swapping it to
doc_binary::to_json_text is one function and no API change, but it alters the
bytes every write produces, so it needs round-trip equivalence tests against an
existing corpus before it can be trusted.
Three subsystems still persist outside LMDB:
| Subsystem | Where it lives now | Target |
|---|---|---|
| History | persistence/history_store.cpp, .hlog files |
_history_<coll> sub-db keyed <doc_id>:<version>; delete history_store.cpp |
| File metadata | on-disk JSON at <filesDir>/records/<2-char-prefix>/<id>.meta.json |
_files sub-db (blobs stay on disk) |
| View definitions | MemoryStore _views system collection |
_views sub-db keyed by qualified view name |
Each is independently shippable. History is the largest.
Handlers would call doc_store_->put() directly, with id generation, timestamps
and versioning moved out of MemoryStore into a WriteCoordinator. On completion
MemoryStore, persistence/wal.cpp, persistence/snapshot.cpp and the eviction
config knobs all delete, and the recovery-mode enum collapses.
This is the v2.x arc's architectural endpoint. It touches the write path that produced the v2.4.3, v2.4.4 and v2.8.0 LMDB handle incidents, so it wants to land in small reviewable pieces with the sub-db identity sentinel kept intact.
Shipped in v2.11.0; see the CLAUDE.md entry for the full surface. Remaining,
all deliberate and none blocking:
restrict is checked one level deep. A cascade that would destroy a
restrict-protected grandchild is refused rather than recursing. Recursion
needs an unbounded transaction and its own WAL-first story.relation_cascade.hpp and the error.cascade/set_null relation whose
parent collection carries a TTL and is renewed after expiry. The fix is a
per-document claim flag that makes the concurrent write lose visibly - not a
versioned delete, which does not close it (no version-checked delete primitive
exists, and the cascade never goes through remove())._relations has no direct-document-write interception, unlike _policies, so
an admin editing the declaration by hand has no effect until restart. A
replication follower likewise does not re-arm until restart._-prefix check on relation names.Raised by a consumer running against 2.11.0 and NOT fixed in 2.11.1, with the reason each was left:
nodes[].config.credentialId). Path resolution descends objects only, so
there is no way to name "this field of every element". An array of scalars is
supported and contributes one posting per element. Supporting the object case
needs a path syntax and a reverse-index maintenance story for element-level
changes; nobody has asked for it twice yet.validate_on_write is all-or-nothing per relation. null and an absent
field are already exempt (they are not references), so "no parent" IS
expressible - but an empty STRING is rejected, and a consumer with legitimately
empty-string references cannot opt those rows out while validating the rest.
The clean answer is for the consumer to write null; a per-relation
"treat empty string as absent" flag is the fallback if that is impossible.RestoreVersion does not reject a write that touches a masked column,
unlike Insert/Update/Upsert (rejectMaskedWrite). Same family as the two
version-read holes 2.11.1 closed, and latent for the same reason: no deployment
has enabled security. Fix when security is first armed for real.vectorapi's requests (/tmp/db-changes-for-vectorapi.md, D1-D7) are all in
2.12.0; the answers were appended to that file. What remains is theirs: move
the loop guard to Client::Event::actor, delete with removeAs() /
removeManyAs(), claim with patchIfVersion() using the _version that
find() already returns (no history call), count with increment(), and map
FailureDetail::reason to HTTP. Their package floor becomes
libsmartbotic-db-client (>= 2.12.0), and the database must be deployed first.
patch. Measured on the
scratch server with send = receive = 100 MB: insert 60 MiB, then patch +20,
+10, +10 MiB - every request small and accepted - and get then fails
message_too_large; the export names it row_too_large. Nothing at write
time compares the RESULTING row with what can be sent back. Fix: refuse a
write whose stored row would exceed the listener's send limit (less framing),
with a reason, before applying it.DeadlineExceeded after it was applied, and the
client then retries it (writeRetries). Seen on those patches: the client's
per-call deadline expired while the server completed the write. Harmless for
an idempotent patch, wrong for increment or an id-less insert. Options: a
deadline scaled by request size, not retrying DEADLINE_EXCEEDED for
non-idempotent writes, or a request id the server de-duplicates.document_too_large), including the RESULT of a
patch; a write that timed out is retried only when idempotent and otherwise
reports reason outcome_unknown, with a size-scaled deadline. Also closed:
connect() now waits for a real connection (reported by smartbotic). A
server-side request id that de-duplicates retries remains possible future
work; it is not needed for correctness now.Two reports from smartbotic-vectorapi produced v2.11.4. Left open, with reasons:
error_code on UpdateResponse/PatchDocumentResponse.FAILED_PRECONDITION,
but since 2.12.0 FailureDetail::reason (read_only / missing_parent /
delete_restricted) tells them apart. Changing the code itself would change
what older clients see; the reason is the supported way to branch.updated_by of an actor-less patch is still the previous
writer (patchDocument keeps it; insert and update overwrite it). Since
2.12.0 the EVENT reports the patch's own, empty, actor, so a loop guard is
correct; version history still shows the previous writer for that version.
Changing it changes what the audit trail has always said.removeManyAs().increment() does not create a missing document. Deliberate (an upsert
needs a full initial body); the documented pattern is increment, insert on
NotFound, increment again on AlreadyExists.BatchInsert reports failed items only as a count, with no per-item code;
a duplicate id there is not distinguishable from any other failure.uploadFile takes, downloadFile returns a full std::vector). Streaming
both ends needs new client methods; nobody has asked yet.false. createRelation,
configureCollection, createIndex, createCollection and the like log the
reason and return false. The Failure& overloads cover the five document
writes only. createRelation is the one a consumer is most likely to want
next, since its refusals (cross-project, missing collection) are caller faults.relations_enforced has no "never configured" state, by decision. The
report asked for one. It was declined: unset and explicitly-on behave
identically, the server stores one bool, and every config record written since
2.11.0 already carries the key, so the distinction could not be recovered for
existing data even if it were added.getRelationsEnforced() still answers true against a pre-2.11.0 server,
which enforces nothing. Left alone because it is the fail-toward-enforced read
by contract; tryGetRelationsEnforced() reports no value there.grpcurl, which tests/load_test/test_relations.sh
needs for its third phase. Debian does not package it, so it cannot simply be
added to the apt-get install list in packaging/Dockerfile.base.
packaging/dev.sh mounts the host's grpcurl into the container when there is
one; on a host without it that suite stops and says so. The proper fix is a
pinned, checksummed release binary in the base image.packaging/Dockerfile.build cannot fail at its build step. The RUN ends
cmake --build ... && ccache --show-stats || true, and the || true applies
to the whole chain, so a compile error is swallowed there and surfaces one step
later as "test_vector_storage: not found". Nothing wrong ships, but the error
is misleading. Found while reworking build.sh; not changed, since it is the
release build and wants its own verification.The Subscribe unwind is instant (0 ms measured). What remains in a stop, neither caused nor worsened by v2.11.2, both bounded, neither yet investigated:
grpc::Server::Shutdown() when a client is still connected,
draining that connection's transport. With the client killed first, Shutdown
returns in 1 ms. Lowering the 5 s grace would cut the tail, but it would also
cancel legitimately long streaming calls sooner (DownloadFile chunks a whole
file), so it is not a free change.stop() appears to run some component stops twice ("FileManager stopped" is
logged again after "Database service exited cleanly"). Harmless, noisy, worth
a look when either of the above is picked up.Verifying the v2.11.3 unwind in a container deployment showed docker stop taking 10.5 s, i.e.
hitting Docker's default 10 s timeout and SIGKILLing the process mid
teardown - Database service stopped and exited cleanly were absent from the
log. The final snapshot happened to land first, so nothing was lost, but that is
luck: a slower snapshot would be killed before it renamed into place, leaving the
next boot on WAL-only replay and read-only mode - the exact failure v2.11.2 was
fixing, reintroduced by the container runtime rather than by the code.
A full teardown is ~10 s today (~4 s gRPC transport drain + ~4-5 s component
joins; see 5c), which does not fit in 10 s. Run the container with
--stop-timeout 120, matching the unit file's TimeoutStopSec=300 in spirit.
Any future docker run for this service must carry --stop-timeout, and any
docker stop in a script wants -t to match. The deb/systemd path is unaffected.
A production instance on a 2 GB host could not boot: recovery loads the snapshot and replays the WAL into MemoryStore, which holds every document, and the boot was killed with ~1.5 GB anonymous memory before READY (measured with swap: ~1.7 GB at least, during init). The streaming snapshot writer (2.20.1) removes the condition that grew the WAL without bound, but a large WAL after an unrelated crash, or a store that simply outgrows the host, still cannot boot. Cheaper steps first: stream the snapshot LOAD as the writer now streams the write (it still holds the decompressed body during deserialization); then measure what the WAL replay retains. The real fix is item 4 (MemoryStore stops being a full copy of LMDB).
Explained for the bulk (fixed on main for 2.21.0): the production
instance's first 2.20.2 boot reported 7,219 disk-only rows and none the other
way, after loading its whole store from one snapshot with no WAL replayed and
nothing evicted. So the snapshot lacked them. Cause: a snapshot read an evicted
document back only from the WAL; the WAL rotates at 100 MB and a snapshot
deletes rotated files it covers, so a document still evicted at the next
snapshot was written as absent ("will be missing from the snapshot"). That is
candidate (2) below, with the mechanism. Reproduced on the released 2.20.2
(tests/load_test/test_snapshot_keeps_evicted.sh with SERVER_BIN: 600 rows,
3 lost). Fixed by reading evicted documents from LMDB and failing a snapshot
that still cannot read one; failed LMDB copies are now logged durably and
repaired at boot; storage.consistency repairs what already diverged.
2.20.2 makes a disk-only row writable and the boot audit reports every
disagreement. Before the 2026-10-22 production numbers, the cause was open:
Candidates, none proven: (1) the pre-2.20.1 snapshot writer listed resident
documents and evicted ids in two separate steps, so a document evicted between
them was in neither and dropped from the snapshot, then the WAL holding it was
truncated (closed by 2.20.1's copyDocuments); (2) the old writer skipped an
evicted document it "could not load"; (3) a delete that reached MemoryStore
and the WAL but not LMDB (then the row is a resurrected delete, and the first
write to it keeps it). The audit's output on an affected instance, read
against its snapshot times, is what can separate them.
One instance's own audit (2026-10-22, a nightly backup, 149 collections):
100 rows on disk only and 21 in memory only. Two of the disk-only counts match
exactly what the v2.4.4 offline placement repair (reconcile-subdbs) moved
into those collections: 23 in image_hashes and 1 in workflows. That fits
a fourth candidate, (4) an offline LMDB-only rewrite: the misbound handle wrote these rows into a stranger's sub-db while
MemoryStore filed them correctly; a later delete reached MemoryStore and the
WAL, but in LMDB it found nothing in the home sub-db; the repair then moved the
stray copy home, i.e. those rows may be DELETED rows the repair resurrected.
Not yet checked against the history files. The other disk-only rows, and every
memory-only one (incl. one default:vectorapi_keys row), are unexplained. The reverse
("in memory only") is reported by the same audit; 2.21.0's
storage.consistency.memory_only can write or remove them but defaults to
report, because the repair must not be automatic by default (raised by
smartbotic-vectorapi): a memory-only row is either a
write that never reached LMDB (repair = write it) or a DELETE that never
reached MemoryStore (repair = remove it), and nothing in the row tells which.
For an API-key collection the second is a revoked credential, so writing it to
LMDB at boot, or letting reads fall back to memory, would put it back into
service. Report, then an operator decision per row.
The boot key audit's "not adoptable (collection exists only on disk)" rows are usually litter (one instance: 75 rows in 29 sub-dbs whose names were qualified twice, from old test suites) and stay reported every boot. The line should say "benign unless you expect that collection", and an operator needs a supported way to drop such a sub-db.
Policy management has no dedicated RPCs; _policies is edited through the
ordinary document API with server-side interception.
Service-wide operations (GetStats, SetReadOnly, Create/DropProject) can
only be gated coarsely - they have no project to evaluate a policy against.
Listener separation is the real boundary there.
event.data->dump() and filter-echo f.value.dump() in
database_grpc_impl.cpp are the last nlohmann serialisers on warm paths.
_orphans_* sub-dbs from the v2.4.4 placement repair still await manual
comparison.
TTL is not retro-applied: rows written before a default TTL existed keep no expiry.
Encryption at rest - FIXED in 2.17.0 (the collection encrypted flag and
sensitive_fields did nothing, the patterns matched nested fields only,
patch / migration ops never encrypted, strings in arrays were never
encrypted). See CLAUDE.md v2.17.0. What a database cannot fix: copies made
before the upgrade (backups, pre-upgrade-*, nightly backup archives)
still hold the plaintext.
Prune under the global lock and reseal compaction cost - FIXED
in 2.17.2: history locks are per collection file and
the prune streams in two passes outside MemoryStore's locks; a reseal is
requested only when an online upgrade rewrote plaintext, and compacts only
that project.
Encrypted collection with vectors - FIXED in 2.17.2: _vector is exempt from encryption, so an encrypted collection
accepts, searches and exports vectors. Since 2.17.0 every such insert had
been refused.
The server postinst calls systemctl start/restart directly, so policy-rc.d
cannot hold a start; switching to deb-systemd-invoke would let an
operator stage an install without triggering a boot-time migration (today:
mask the unit).
Sort and filter disagree about an ABSENT field: a sort places rows
without the field last ascending (first descending), while every filter but
EXISTS false excludes them. A paginated, sorted and filtered list view can
surface rows its filter would reject at the edges. Decide one rule for both
(e.g. absent sorts like null, first ascending) - a behaviour change.
History administration has no dedicated call. Pruning rides on
createCollection(existing, maxVersions=N), which also re-applies the TTL
and other options (a TTL of 0 clears an existing default - a trap a consumer
nearly hit on prod), and nothing can discard a live collection's history or
the history of deleted documents. A pruneHistory(collection, keep) /
discardHistory(collection) RPC would close both. (2.18.1 added the CLI
configure command, which avoids the TTL trap by passing the current value
back; the API itself still has the trap.)
The CLI package pins the shared client library. FIXED in 2.18.1-2:
the library ships a symbols file and the CLI's Depends is computed by
dpkg-shlibdeps (CLI 2.18.1 needs libsmartbotic-db-client (>= 2.17.0)).
The CLI stays dynamically linked, so it keeps exercising the shared library.
Partial-update APIs where an unset field's default is a real value.
createCollection(existing, ...) re-applies defaultTtlSeconds (0 clears
it) and CollectionConfig::timestampPrecision defaults to "ms" (resets
precision unless set to ""). Both bit the 2.18.1 CLI work; the CLI guards
them, the API does not. A future API change should make "leave alone"
expressible for every field (optional or presence-based).
Collection schemas cannot be declared in a migration file yet (the existing-row check lives in the SetCollectionSchema handler).
Bogus index declarations on a production instance (found 2026-10-09, predates 2.14.0): removed
the same day; kept for the record.
smartbotic-automation holds two declarations on collections literally named
users email and sessions refreshToken, each a unique index on a field
named --unique - the shape of index-create "users email" --unique with the
collection and field quoted as one argument. The real unique indexes
(users.email, sessions.refreshToken) exist and hold postings. The bogus
ones hold nothing, but because their collections were never written, their
sub-db never persists and every boot logs rebuilt ... over 0 row(s). Two
small gaps behind it: the CLI accepted an argument starting with -- as a
field name (fixed in 2.15.0: index-create refuses it),
and a collection name may contain a space (open). Cleanup (index-drop of
both) was handed to the smartbotic session on 2026-10-09 at the owner's
request.
nlohmann::json. It is the public client API vocabulary type -
insert, get, Filter::value, QueryResult::documents. Removing it breaks
every consumer call site and needs a soname bump. It is header-only, so it is
not a runtime dependency of any shipped package and costs nothing at runtime.
The remaining ~453 internal references are cold paths (config, migrations,
policies, views) where its exceptions and value semantics are an asset.smartbotic-database-migrate-v1 in v2.5; v2.5 never shipped and the in-binary
path is harmless.