CortexDB 0.9.5 — the Code Intelligence Plane
The largest release since 0.9.0: CortexDB now has a code plane — a
typed, versioned memory of your source code that recall and answers can
draw on, built across four new crates and ~21 new /v1/code/* routes.
Alongside it: the 10X performance campaign (boot in seconds instead of
minutes, ~50 % artifact-compile cost cut, a two-tier LLM response
cache), answer-free context preview, and a tl;dv connector bug-fix
batch in cortexdb-connectors 0.2.15.
Compatibility: the /v1 API surface is purely additive (one new
optional field on POST /v1/answer; everything else lives under the
new /v1/code/* family). 0.9.x data directories load without a
migration step — several stores switched to faster binary snapshot
formats (FSN3, BTP2, LYS3) but all keep legacy read-compat. The code
plane is off by default and free when off: with CORTEX_CODE_PLANE
unset nothing is constructed and /v1/code/* answers
503 CODE_PLANE_DISABLED.
The Code Intelligence Plane (the headline)
CortexDB indexes registered source repositories into a content-addressed,
generation-pinned code graph — definitions, imports, calls,
framework/runtime resources — and serves it with honest precision
labels. Every fact carries a precision tier (Syntax / Manifest /
Compiler / History / Runtime) and a resolution status (Exact,
ImportScoped, Ambiguous{candidates}, Unresolved, Dynamic), and
both travel into the answer. There is no global name-match fallback
anywhere — "never guess" is a permanent regression test, not a
guideline. Reference: docs/CODE_PLANE.md; design
docs/CODE_INTELLIGENCE_PLANE_DESIGN.md; operator quickstart in
PRODUCTION_CONFIG.md.
What's in it:
- Storage + identity kernel: content-addressed store,
gixgit adapter (trees/diffs/renames/blame), an observation pipeline with an adaptive-coalescing file watcher, snapshot manifests with atomic head publication, and new WAL event arms so the plane replays like every other view. - Extraction, 43+ languages: a sandboxed, per-file-budgeted tree-sitter pipeline — deep query packs for the launch languages plus a long-tail bundle, and a universal UTF-8 text fallback so docs/data files stay searchable. Pathological files are skipped with a recorded reason, never silently.
- Never-guess resolution + compiler tier: per-language resolvers (TS/JS tsconfig paths & export maps, Python shadowing/PEP 420, Rust module walking), then SCIP ingest (verified against scip-go and scip-typescript) where compiler facts supersede — never rewrite — syntax-tier facts.
code_indexposting engine: a new RocksDB store with delta segments, Roaring overlays, compaction-stable cursors, and hard query budgets — deep traversal without an explicit plan is refused withTRAVERSAL_REFUSED, never silently truncated.as_oftime-travel materialization, freshness with hash-proof splicing, retention/GC with pins.- Semantic code search (opt-in): one bounded structural
representation per code-bearing file, embedded via
CORTEX_CODE_EMBEDDING_*(OpenAI/Voyage/Cohere/Ollama), stored in a TQ2-compressed HNSW index with persistent-vector reranking and asymmetric query prefixes. Provider failure degrades to path/graph/BM25; a dimension mismatch fails instead of corrupting the index. - Recall fusion: seven code question shapes behind a referent gate
(
CORTEX_CODE_SHAPES=shadow|active), a code-aware lexical namespace with an identifier tokenizer, and a server-side fusion stage doing shape-directed expansion + RRF with hard gating. - Graph query & export:
POST /v1/code/graph/query(bounded: ≤16 roots × 16 predicates, depth ≤6) andgraph/exportin nine formats — JSON, GraphML, Neo4j Cypher, self-contained vis/D3 HTML, SVG, Obsidian vault, Markdown wiki, DOT — all deterministic, no CDN. - Evidence + certified answers: a
code.contextenvelope with verbatim query-centered excerpts (exact line ranges in the citation, hard token ceiling, anuncertainty[]that names every gap), andPOST /v1/code/certifyfor hash-verifiedlist-implementations/count-call-sitesanswers that re-verify every input block and returnincompletereasons rather than overclaim. - History & tests: hunk-precise diff→symbol anchoring with rename
continuity, co-change over a bounded window,
tests/for-changewithstaticvsobserved(lcov import) labeling. - Everywhere it surfaces: a
code-memoryfeature bundle + Admin UI page,cortexdb codeCLI group (ten verbs),client.code.*in both SDKs, four read-only MCP tools (code_explore,code_impact,code_inventory,code_graph) with a compact--tool-profile code, admin-metricscodesection (off-vs-empty is explicit), and hash-verified export/import index bundles. Tenant isolation is absolute: another tenant's repo is 404 and absent from listings. - Benchmarked, honestly: the blind
benchmarks/codeplane/program records SWE-bench file localization atany@10 0.818/all@10 0.754with p50 18 ms queries (strongest no-LLM retrieval in our comparison; the write-up plainly notes LLM localizers still lead), 26/26 on the dynamic-multilang panel at 182 ms cold index, 54K LOC/s and ~22 bytes of index per LOC at production scale, and a 25M-LOC ingest in 93 s. Competitor arms are revision-pinned; manifests are append-only.
10X performance campaign
Boot, RAM, and LLM-cost work across the facts/artifact planes
(docs/ENV_10X.md has the full env-var reference):
- Boot in seconds: layer snapshots + mutation journals (LYS3),
binary fact-store (FSN3) and bitemporal (BTP2) snapshots, an HNSW
journal-replay warm boot (full verify is now opt-in
CORTEX_VECTOR_FULL_VERIFY=1), and all eleven store hydrations in parallel. Gate run: 26 s warm boot at 6.2 M events. - Artifact
liteprofile (CORTEX_ARTIFACT_PIPELINE=lite): ~−50 % compile cost per session; deterministic triage turns signal-free turns into Complete bundles with no LLM call at all. - Two-tier LLM response cache: RAM + persistent RocksDB, model-namespaced — a 48-call recompile replayed 46/48 from cache.
- Provider fleets + per-task routing:
CORTEX_LLM_PROVIDERSJSON fleet with per-lane health rotation,CORTEX_LLM_ROUTE_<TASK>/CORTEX_LLM_TIMEOUT_SECS_<TASK>across 15 task kinds, per-provider cost accounting, and exponential retry cooling-off. - RAM/WAL diet: embeddings moved out of WAL payloads and layer rows into an fp16 side column family; artifact store gained zstd + bloom filters; an O(n²) dedupe fixed.
- Ops: per-stage compiler LLM usage and enrichment call-family
usage on admin metrics;
config_lintnow flags unknown/typo'dCORTEX_*env names at boot. New stress-rig gates (tools/stress-rig/) pin all of the above.
Answers & recall
- Answer-free context preview:
POST /v1/answeracceptsskip_answer_llm: trueand returns the final quota-packedcontext_block+ route/certification diagnostics with zero answer-stage LLM calls (theanswerfield fills only when a certified deterministic reducer succeeds). - Certified deterministic reducers extended: seeded pairwise temporal deltas from ACL-checked sources, unique-explicit-day recovery that fails closed on ambiguity, artifact-route auditing in retrieval scorecards.
- Recall: focused lexical views run concurrently and fuse for noisy code tasks with primary results protected; direct and derived evidence channels interleave; source turns are recovered for untyped recall; derived memory is semantically retrievable at scale via a bounded vector backfill.
Connectors 0.2.15 — code-plane anchors + tl;dv bug fixes
- Code plane bridge: the GitHub connector emits
code_anchorsmetadata (PR file lists, issue↔PR cross-links, push commit shas) that the server turns intodiscussed_in/changed_bybridge facts against file symbols — conversation memory linked to the code graph. - tl;dv fixes from a real-data bug hunt (L1–L6): an expired API key
no longer hard-crashes a one-shot
sync(clean error, cursor held); solo/0-invitee recordings are labeledRESTRICTEDinstead ofORGANIZATION; a 24 h cursor-lookback window stops incremental sync from silently dropping late-transcribed meetings;TranscriptReadywebhooks stamp the meeting's realhappenedAtinstead of the delivery time (and recover full meeting fidelity); episodes carry the real organizer name; JS-date parsing is locale-independent. Full detail inconnectors/CHANGELOG.md.
Compatibility
/v1surface: additive only. New/v1/code/*family (503 when the bundle is off); new optionalskip_answer_llmonPOST /v1/answer.- Data: no migration step. New binary snapshot formats write-forward
with legacy read-compat; the
code_indexstore is only opened when the code plane is enabled. - One behavior note:
CORTEX_ARTIFACT_WORKERSnow gates the artifact compiler/projection workers directly (unset preserves historical behavior;=0yields an immutable read-only artifact mode). - New env vars are all registered with the boot-time config lint; the
code-plane block is in
.env.example, the 10X block indocs/ENV_10X.md.