mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-13 09:53:15 +08:00
Split cbm_write_db's monolithic build into an incremental API: cbm_writer_open / cbm_writer_append_nodes / cbm_writer_finalize. Node rows are written to the table B-tree across append calls via a persistent page builder, so callers can flush and free node batches (including the heavy properties column) without materializing every record at once. Everything after the nodes table — edges, vectors, metadata, indexes, and the sqlite_master page — is emitted at finalize, as before. cbm_write_db is now a one-shot wrapper (open, append all nodes, finalize) producing byte-identical output; the full test suite and PRAGMA integrity_check confirm the on-disk format is unchanged.