Unit E2: 6-Gate 388-Node Knowledge Graph Compiler, ReadOnlyIsolationGuard & Quiescent SQLite + FTS5 Engine

Cartridge E2 • Non-Sequentially Revertible via hs-eng-docs --disable knowledge-graph-and-sqlite • v2.1.0

Prerequisite Track for Novices • Required Expertise: Level 3-4: Databases, Cryptographic Hashing & OS Concurrency (15-25 hrs study)

If any concepts on this page are unfamiliar, occupy your study time with these free foundational resources first:

Core Concepts Required:
  • Cryptographic hash functions (SHA-256) and Python context managers (with / __exit__)
  • Relational schemas, inverted full-text search indices (SQLite FTS5), and graph representations
  • ACID transactions, Write-Ahead Logging (WAL), and BEGIN EXCLUSIVE file locking
Curated Free Public Study Resources:

1. ReadOnlyIsolationGuard Context Manager (hyperstitionstud_io.glossary)

Every compiler, MCP tool, and REST v1 handler executes inside with ReadOnlyIsolationGuard(cfg.read_only_files) as guard:. Before and after the block runs, SHA-256 digests of taxonomy/glossary-registry.json and encyclopedia/encyclopedia-manifest.json are verified against baseline constants, raising RuntimeError immediately on any byte mutation.

2. 6-Gate Multi-Format Graph Compiler & Quiescent 100M SQLite Logrotate (db/sqlite_meta.py)

build_encyclopedia_knowledge_graph.py compiles 388 nodes and 1,282 edges into JSON, JS, GraphML, GEXF, Obsidian Canvas, and 3 1600x1060 PNG atlases. sqlite_meta.py hydrates hyperstition-catalog.db (FTS5) and records /api/v1/* and /mcp telemetry in /var/lib/hyperstitionstud.io/api-telemetry.db, while deploy/logrotate.d/hyperstition-sqlite-meta acquires BEGIN EXCLUSIVE at 100M, snapshots .1.gz, and runs PRAGMA wal_checkpoint(TRUNCATE); VACUUM;.

← Prev: E1: Ciphers & Phonetics Next: E3: Quant, Macro & Bayesian →