feat: 0.7 serialization, scalar indexes, and server functions - #380
Open
jamals86 wants to merge 4 commits into
Open
feat: 0.7 serialization, scalar indexes, and server functions#380jamals86 wants to merge 4 commits into
jamals86 wants to merge 4 commits into
Conversation
Preserve the current working tree: routine runtime, serialization extraction, semantic catalog reconcile, deferred JSON registration, and related dialect/CLI changes. Co-authored-by: Cursor <cursoragent@cursor.com>
One host spec crate drives V8 bootstrap, runtime.d.ts, and nested CALL so inline SQL and project TypeScript share the same frozen ctx, logging, and catalog-backed schema methods. Co-authored-by: Cursor <cursoragent@cursor.com>
…e2e can land. Inline procedures now dispatch nested CALL on the callee isolate, module activate is served under /v1/api, and safe Int64 values stay JSON numbers so `input + 1` is arithmetic. Adds kobj e2e coverage for CREATE TYPE, inline and project-backed procedures, typed nested CALL, and ctx.log. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
0.7 is not three independent projects. It is one release whose product bar is: typed nested data that persists and executes correctly, equality lookups that stay prefix scans as tables grow, and SQL-defined server procedures that use those same types.
Source of truth:
docs/plans/2026-09-01-kalamdb-0.7.md. File-level steps:docs/plans/2026-09-05-kalamdb-0.7-implementation.md.kalamdb-serializationcrate. NestedSTRUCT/CREATE TYPE/Listpersist through that crate only. Live USER/SHARED/STREAM row values are ordinal KOBJ (identity is not repeated in the payload).CREATE INDEX, hot prefix seek, cold bloom/min-max prune, CLI schema-diff, RLS membership bind.CALL, transactional topics, durable triggers.Do not ship 0.7 with only one of these. Nested procedure types without a central codec fork persistence. Indexes that keep JSON PK lists fight the serialization migration. Functions that scan
WHERE conversation_id = ?stay too slow for the chat/RLS workloads 0.7 is supposed to carry.Not in 0.7: Vortex-as-Parquet, schedules/
CREATE EVENT, extra function runtimes, unique-by-default scalar indexes, ANN answering scalar equality, changing RocksDB ordered key encoding.Status now (2026-09-06)
Wave 1 is met for dialect + nested codec tests. Wave 1 is not met for leftover non-indexed store paths.
KOBJ(identity on the storekey).StorageSchemafromTableDefinition.SharedTableRowin commons. Indexed stores useEntityCodec; other entities useencode_object. Commons FlatBuffers codecs and serverdecode_*_compatare gone. Codec benches live inkalamdb-serialization.UserTableStore/SharedTableStorestill use the object envelope.CREATE INDEXcatalog + hot prefix seek + cold prune + CLI schema-diff + RLS membership bind. Chat bench and example schemas create conversation/membership indexes.CALL/ REST / PGWire; nested CALL; staged topic publish; durable topic triggers;kalam deploy/kalam dev; EXECUTE ACL, metrics, SQL/CLI/skill docs. Checkpoint C: SQL/REST CALL → nested INSERT + typed topic + GRANT/REVOKE + rollback.cli/run-tests.shagainst a running 0.7 server (wipe-required on-disk format).On-disk / upgrade policy
0.7 is a breaking on-disk format. The server will not dual-decode old RocksDB row/object bytes on the hot path.
decode_*_compatfor production reads.KENV/ name-keyed rows / unenveloped payloads are not readable by 0.7.KOBJ.SeqIdencoding.kalamdb-serializationowns values only.Target USER/SHARED/STREAM row value:
Drop
user_id/_seqfrom the value; reconstruct them from the key. Keep_commit_seqand_deletedfor MVCC.0.7 release gate
Ship 0.7 only when all of the following are true.
Serialization
kalamdb-serializationis the only internal persisted-object codec crate.STRUCT/ namedCREATE TYPE/Listround-trip without JSON intermediates orScalarTag::Fallback.user_id/_seq).Scalar secondary indexes
CREATE INDEX/DROP INDEXparse, persist onsystem.schemas, and round-trip throughkalam-schema-diff.messages/conversation_membersfor the documented equality filters.Functions V1
ContractSnapshot, typedCALL, nested calls/context, transactional topics, durable triggers, CLI deploy/dev.Together
CREATE TYPE, scalar indexes, andCREATE PROCEDUREcompiles locally, deploys, serves indexed SQL, and executes typedCALL/ nested procedures on those types.Test plan
STRUCT/Listround-trip throughkalamdb-serializationwith no string fallback (cargo nextest run -p kalamdb-serialization)cli/run-tests.sh(oldKENV/ name-keyed rows are unreadable)CREATE TYPE,CREATE INDEX,CREATE PROCEDURE, typedCALL/ REST / PGWire,GRANT/REVOKE EXECUTEkalam-schema-diffemitsCREATE TYPE/CREATE INDEX/CREATE PROCEDURE; local generate does not need a live serverWHERE conversation_id = ?seeks the hot scalar index and cold scan does not visit every flushed segment