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.4.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:
λ Polyglot Foil (E2): Pre/Post SHA-256 Read-Only Isolation Guard & Borrow Checking
1. Formal Specification & Python:Guard(f): H_pre == H_expected ∧ H_post == H_pre
with ReadOnlyIsolationGuard(cfg.read_only_files) as guard:
    run_pipeline()
λ Guile Scheme (Z-Combinator):
((lambda (pre post) (and (= pre 282) (= pre post))) 282 282)
=> [Select Lens to evaluate]
TS TypeScript (Strict AST):
((pre: number, post: number): boolean => pre === 282 && pre === post)(282, 282)
=> [Select Lens to evaluate]
Rs Rust (Option/Iterator AST):
isolation_guard_ok(282_u32, 282_u32)
=> [Select Lens to evaluate]
Guided Micro-Challenge (4-Ring Zero-Escape Sandbox): Compare Scheme's predicate, TypeScript's typed arrow guard, and Rust's Result<bool, Error>.

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 →