Expand description
System-block graph compiler and append-only 100-node chunk ledger.
Translates the Document Character and Format CSV database into immutable
3-token statement triples, seed classification entities, and deduplicated
value nodes in the System block (8589934592..=12884901887), persisted as
100-node chunk files in assets/data/graph/85899_34592.ctbnodes, etc.
Re-exports§
pub use crate::ctbnbdl::CREATED_NS_COMMENT_PREFIX;pub use crate::ctbnbdl::CTBNBDL_MAGIC;pub use crate::ctbnbdl::CtbnbdlFramingDcs;pub use crate::ctbnbdl::DC_SYSTEM_BLOCK_MOST_RECENT_NODE_ID;pub use crate::ctbnbdl::DCMM_HEADER;pub use crate::ctbnbdl::DurableTransactionOutcome;pub use crate::ctbnbdl::FaultInjectionPoint;pub use crate::ctbnbdl::LEDGER_JOURNAL_REL_PATH;pub use crate::ctbnbdl::LedgerNode;pub use crate::ctbnbdl::LedgerReadGuard;pub use crate::ctbnbdl::MAX_BYTES_PER_BUNDLE;pub use crate::ctbnbdl::MAX_NODES_PER_BUNDLE;pub use crate::ctbnbdl::MAX_NODES_PER_CHUNK;pub use crate::ctbnbdl::PlannedLedgerItem;pub use crate::ctbnbdl::TransactionManifest;pub use crate::ctbnbdl::chunk_filename_for_node_id;pub use crate::ctbnbdl::compile_ctbnodes_dir_to_ctbnbdl;pub use crate::ctbnbdl::compile_ctbnodes_dir_to_ctbnbdl_with_limits;pub use crate::ctbnbdl::compile_ctbnodes_file_to_ctbnbdl_bytes;pub use crate::ctbnbdl::compile_inactive_ctbnodes_dir_to_ctbnbdl;pub use crate::ctbnbdl::compile_inactive_ctbnodes_dir_to_ctbnbdl_with_limits;pub use crate::ctbnbdl::compute_nodes_slice_ledger_sha256;pub use crate::ctbnbdl::consume_atom_dc_with;pub use crate::ctbnbdl::current_unix_timestamp_ns;pub use crate::ctbnbdl::decode_ctbnbdl_bundle_resilient_with;pub use crate::ctbnbdl::decode_ctbnbdl_bundle_with;pub use crate::ctbnbdl::decode_nodes_from_ctbnbdl_bytes_with;pub use crate::ctbnbdl::encode_for_each_statement_tokens_with;pub use crate::ctbnbdl::encode_node_definition_dcmm2_bytes_with;pub use crate::ctbnbdl::encode_node_definition_tokens_with;pub use crate::ctbnbdl::encode_nodes_to_ctbnbdl_bundles_with_limits;pub use crate::ctbnbdl::encode_nodes_to_ctbnbdl_bundles_with_limits_and_most_recent;pub use crate::ctbnbdl::encode_nodes_to_ctbnbdl_bytes_with;pub use crate::ctbnbdl::ensure_ledger_journal_clean;pub use crate::ctbnbdl::execute_durable_ledger_transaction_with_planner;pub use crate::ctbnbdl::format_chunk_bundle_filename;pub use crate::ctbnbdl::format_chunk_filename;pub use crate::ctbnbdl::inspect_ledger_journal;pub use crate::ctbnbdl::is_relationship_verb_with;pub use crate::ctbnbdl::list_chunk_files;pub use crate::ctbnbdl::load_ledger_nodes_from_dir;pub use crate::ctbnbdl::load_ledger_nodes_from_file;pub use crate::ctbnbdl::load_ledger_nodes_from_str;pub use crate::ctbnbdl::parse_chunk_bundle_filename_start_id;pub use crate::ctbnbdl::parse_chunk_filename_start_id;pub use crate::ctbnbdl::parse_for_each_statement_tokens_with;pub use crate::ctbnbdl::parse_statement_tokens_with;pub use crate::ctbnbdl::partition_active_and_inactive_nodes_with;pub use crate::ctbnbdl::push_atom_dc_with;pub use crate::ctbnbdl::resolve_ctbnbdl_framing_dcs_from_nodes;pub use crate::ctbnbdl::sanitize_comment;pub use crate::ctbnbdl::sha256_bytes_hex;pub use crate::ctbnbdl::sync_highwater_shadow_ledgers;pub use crate::ctbnbdl::verify_nodes_append_only_against_baseline;pub use crate::ctbnbdl::verify_repo_graph_append_only;pub use crate::ctbnbdl::write_chunk_file_append_only;pub use crate::ctbnbdl::write_ledger_nodes_to_dir;pub use crate::syntax::ast::NumericBoundValue;pub use inbox::*;
Modules§
- inbox
- Manual and staged
.ctbnode-incomingnode allocation pipeline (nodes/inbox/->nodes/allocated/), dynamic effective-state prevalidation,BATCH_COMMITTEDprovenance verification, and cross-ownership protection betweencsvandmanualgraph nodes.
Structs§
- Ledger
Update Stats - Statistics returned by a ledger update operation.
Enums§
- Seed
Entity Key - Seed entity key identifying a classification entity in the System block.
Functions§
- decode_
ctbnbdl_ bundle - Decodes a
.ctbnbdl(CtbNodeBundle) binary buffer into its optional leadingDc 641system block most recent node ID and its list ofLedgerNodeentries. - decode_
ctbnbdl_ bundle_ resilient - Resiliently decodes a
.ctbnbdl(CtbNodeBundle) binary buffer, quarantining any corrupted or checksum-mismatched node section while recovering all remaining valid nodes and returning diagnostic warning strings. - decode_
integer_ value_ tokens - Decodes a canonical base64 integer value node token sequence (
6 f199 <base64 digits> 7) back into au128(supporting both normalized6 f199 .. 7and legacy6 f199 6 f199 .. 7 7). - decode_
nodes_ from_ ctbnbdl_ bytes - Decodes a
.ctbnbdl(CtbNodeBundle) binary buffer back into a list ofLedgerNodeentries (with empty comments, as.ctbnbdlstores only the semantic Dc stream). - decode_
string_ value_ tokens - Decodes a canonical string value node token sequence back into a
String, if it matches. - default_
ctbnbdl_ framing_ dcs - Returns the canonical
.ctbnbdlframing Document Characters fromctb_formats_dcdata::dc. - default_
vary_ as_ to_ format_ variant - Returns the default mapping from
@vary_asnicknames to.Formats:format_variantshorthands. - encode_
for_ each_ statement_ tokens - Encodes a
Dc 638(For each) statement over a typed[atom_dc]list:638 <inner_verb> [atom_dc: inner_subj] [atom_dc: inner_obj] 310 <list_type> <elem_1> 312 <elem_2> ... 311. - encode_
integer_ value_ tokens - Encodes an unsigned integer into the canonical base64 integer value node token sequence:
6 f199 <base64 digit Dcs 127..=190...> 7. - encode_
node_ definition_ tokens - Encodes a single
LedgerNode(id+tokens) into itsDc 617 .. Dc 618token sequence:617 [atom_dc: l<id>] <escaped body tokens...> 618. - encode_
nodes_ to_ ctbnbdl_ bytes - Compiles a slice of
LedgerNodeentries into a.ctbnbdl(CtbNodeBundle) binary buffer: 8-byteCTBNBDL\x01magic + 21-byteDcMMheader +UTF-8e-128encoded617 .. 618frames. - encode_
statement_ tokens - Encodes a relationship statement
<verb> [atom_dc] [atom_dc], escapingDc 255(Ignore following Dc) andDc 616(Evaluate value as atom) withDc 255. - encode_
string_ value_ tokens - Encodes aUTF-8 string into the canonical string value node token sequence
(
<u<hex> tokens...>). - explain_
ctbnodes_ file - Reads a
.ctbnodesfile frompathand renders it with synthesized human-readable explanation comments. - explain_
ctbnodes_ str - Renders a
.ctbnodestext buffer with synthesized human-readable explanation comments (l<id>: <tokens> # [@created_ns:<ts>] <explanation>). - parse_
for_ each_ statement_ tokens - Parses a
Dc 638(For each) statement over a typed[atom_dc]list back into(inner_verb, inner_subj, inner_obj, list_type, elements). - parse_
statement_ tokens - Parses a relationship statement
<verb> [atom_dc] [atom_dc]back into(verb, subj, obj). - partition_
active_ and_ inactive_ nodes - Partitions
nodesinto(active_nodes, inactive_nodes)usingdefault_ctbnbdl_framing_dcs. - plan_
csv_ reconciliation_ manifest - Plans a
csv_reconciliationtransaction manifest againstrepo_rootunderLedgerReadGuardand writes the resultingTransactionManifestJSON toout_path. - single_
valued_ property_ set - Returns the canonical set of single-valued property Document Characters.
- update_
ledger_ in_ memory - Updates an in-memory list of
LedgerNodes againstdc_defns,format_defns,known_scripts, andnamed_types_bytes. - update_
ledger_ in_ memory_ with_ provenance - Updates an in-memory list of
LedgerNodes againstdc_defns,format_defns,known_scripts, andnamed_types_bytes, enforcingprovenance_mapcross-ownership rules. - update_
system_ graph_ ledger - Loads the CSV dataset from
repo_rootand updatesassets/data/graph/*.ctbnodesusing the append-only revision ledger algorithm inside a durable journaled transaction. - update_
system_ graph_ ledger_ with_ options - Same as
update_system_graph_ledger, with optionalrequired_manifest_path,dry_run, andFaultInjectionPoint.