Knowledge Base & Glossary

Core Concepts & Architecture Glossary

Reference definitions for MCP, AST verification, epistemics, provenance, and write drift—covering why each matters for AI reliability and how Nesatz enforces it.

Showing 21 of 21 concepts

MCP (Model Context Protocol)

@nesatz/mcp

A universal plug that lets AI apps like Claude, Cursor, and Antigravity use external tools safely.

Just like USB-C lets any laptop talk to any monitor or keyboard, MCP lets AI assistants connect to local folders, search tools, or databases using one standard format—without you having to write custom integration code.

How Nesatz Solves / Uses It

Nesatz ships @nesatz/mcp, an official MCP server over stdio. Instead of giving an AI raw write access to your files or database, Nesatz gives it governed tools (propose_mutation, commit_mutation, transition_claim_status) that persist locally in .nesatz/ (or Neo4j) and require human sign-off for major promotions.

Hallucination

Gates 2 & 4

When an AI confidently invents a fact, number, or citation that isn't in the real source.

Language models predict plausible-sounding words rather than checking truth. In dense research or financial reports, an AI can easily swap two percentages, invent a fake clinical trial ID, or fabricate a quote while sounding 100% certain.

How Nesatz Solves / Uses It

Nesatz stops hallucinations at the write boundary: Gate 2 (DeclarativeFormulaEvaluator) checks that numbers actually obey their equations, and Gate 4 (SourceVerifier hooks + SHA-256 excerpt hashes) blocks claims that cite nonexistent registry IDs or altered quotes.

Epistemics & Epistemic Governance

Core Principle

Tracking how we know something is true, how certain it is, and what evidence backs it up.

Epistemology is the study of knowledge and evidence. In AI systems, 'epistemic governance' means keeping track of whether a statement is an unverified guess, a cautious early finding, an approved fact, or an outdated claim that has since been replaced.

How Nesatz Solves / Uses It

Every record in Nesatz moves through an 8-state lifecycle (DRAFT → UNDER_REVIEW → ACTIVE, plus NARROWED, STALE, SUSPENDED, REVOKED, SUPERSEDED) and binds assertions to primary source locators and audit logs so unverified guesses never mix with verified facts.

AST (Abstract Syntax Tree)

Gate 1 & Gate 2

Breaking a formula or query into a strict tree of pieces so a computer can check it safely without guessing.

Instead of reading a math formula or database query as plain text (or running dangerous eval() code), an AST parser breaks an expression like 'completeResponses + partialResponses === objectiveResponseCount' or 'letterSentYear <= authorDeathYear' into structured numbers, operators, and variable names.

How Nesatz Solves / Uses It

Gate 1 (QueryValidator) inspects Cypher queries against banned labels and allowed relationships, and Gate 2 (DeclarativeFormulaEvaluator) uses a safe recursive-descent AST parser—never eval()—to verify balance sheets, clinical tallies, contract totals, bounds, and chronology orderings deterministically.

Provenance & Span-Level Excerpt Hashing

Gate 4

A permanent receipt showing the exact source document, page/table location, and digital fingerprint of a quote.

Saying 'Source: PubMed' or 'Source: Archive Box 4' isn't enough if an AI subtly rewords a historical quote or misquotes a filing. Span-level provenance records both where the fact came from (e.g., 'Section 3.2, Table 1' or 'Folio 14r') and a SHA-256 cryptographic hash of the exact excerpt text.

How Nesatz Solves / Uses It

SpanProvenanceManager normalizes verbatim quotes with Unicode NFC and computes deterministic sha256:<hex> digests verified atomically via CanonicalMutation.provenance or immutable span_provenance payloads (preserving comparators like P<0.0001). Changing even one character triggers GATE4_SPAN_HASH_MISMATCH.

Write Drift & Read-Back Parity

Gate 5

When what actually gets saved to your database silently differs from what was approved.

Databases and file converters sometimes silently round decimals, drop unknown fields, truncate long strings, or coerce data types during a write. Everything looks fine until downstream users read corrupted values.

How Nesatz Solves / Uses It

Gate 5 runs an immediate post-write read-back check right after storage commits. If any persisted property differs from the authorized payload, Nesatz raises DRIFT_DETECTED, quarantines the record to UNDER_REVIEW, and opens an :Incident record.

Deterministic vs. Probabilistic

Architecture

Deterministic rules give the exact same answer 100% of the time; probabilistic AI guesses based on odds.

LLMs are probabilistic—ask the same question twice and you can get two different answers. A deterministic rule (like 3 + 43 = 46, or blocking '<script>' tags) always behaves identically and can be audited step-by-step.

How Nesatz Solves / Uses It

@nesatz/core v1.0 is 100% deterministic with zero machine-learning dependencies inside the firewall itself. You let probabilistic AI draft ideas, while deterministic TypeScript gates enforce math, syntax, state rules, and provenance before saving.

Semantic Overreach & Modality Hedging

Gate 2

Turning cautious scientific or business evidence into absolute claims like 'cures', 'proves', or 'guarantees'.

A study showing partial tumor shrinkage in 37% of patients does not 'cure all cancer.' Language models frequently drop hedging words ('preliminary', 'associated with', 'estimated') and write absolute statements.

How Nesatz Solves / Uses It

EpistemicAuditor scans text against configurable overreach verbs, directive language, and maturity/uncertainty qualifiers. Unhedged absolute claims are flagged with EPISTEMIC_OVERREACH before reaching canonical records.

Temporal Prophecy

Gate 2

Stating future predictions as guaranteed facts (e.g. 'will definitely eradicate disease by 2027').

Agents summarizing roadmaps or forecasts often convert speculative projections into certainty without attaching uncertainty qualifiers or confidence bounds.

How Nesatz Solves / Uses It

EpistemicAuditor detects prophecy patterns configured in NesatzProfile and blocks or flags uncalibrated future guarantees unless properly hedged.

Prompt Injection & Zero-Width Unicode

Gate 1

Hidden text tricks—including invisible characters—that hijack an AI into ignoring its instructions.

Attackers can hide invisible Unicode characters (like zero-width spaces \u200B), HTML <script> tags, or phrases like 'Ignore all previous instructions' inside web pages or uploaded documents so the AI obeys the attacker instead of you.

How Nesatz Solves / Uses It

Gate 1 (InputSanitizer) runs automatically inside SovereignWriter on string properties (and standalone before calling an LLM), stripping invisible Unicode and HTML scripts while failing closed on untrusted jailbreak patterns before any API tokens are spent.

Two-Phase Mutation (Propose → Commit)

@nesatz/mcp

Separating 'check if this change is valid' from 'actually save it to storage.'

If an AI writes directly to a database in one step, bad data is already stored before anyone notices. Splitting writes into Propose (dry-run check + issue token) and Commit (consume token + atomic write) ensures broken writes never touch disk.

How Nesatz Solves / Uses It

MCP agents call propose_mutation first (running Gates 1–4 side-effect-free and minting a 256-bit proposalToken bound to the exact payload). commit_mutation reads the persisted proposal directly so the agent cannot tamper with it between steps.

Out-of-Band Human Approval

Security Boundary

Requiring a real person outside the AI chat to approve high-stakes changes before they become official.

If an AI could approve its own edits inside the same chat session, prompt injection or model confusion could rubber-stamp dangerous changes. 'Out-of-band' means approval comes from a separate trusted channel.

How Nesatz Solves / Uses It

Stdio MCP agents are locked to unprivileged AUTOMATED_AGENT identities. Promoting a claim to ACTIVE or touching high-stakes fields requires a human curator to run `nesatz-mcp approve <token> --rationale "..."` in their own terminal.

Zero Answer Leakage

Gate 2

Telling an AI which fields contradict each other without handing it a pre-calculated answer to blindly copy.

If a validator says 'Error: ORR should be 46, not 45,' a lazy AI can parrot '46' without re-reading the source table. Reporting the contradiction instead forces the model to re-verify against the primary document.

How Nesatz Solves / Uses It

DeclarativeFormulaEvaluator returns participating variable names, the failed invariant expression, and the discrepancy delta—never a pre-computed target number.

Preflight Dry-Run

Gate 3

Testing a proposed change through all safety rules with zero side effects before writing anything.

Like a pilot's pre-flight checklist before takeoff, a dry-run checks syntax, math, schema rules, conflicts, and citations without creating files, log entries, or database rows.

How Nesatz Solves / Uses It

SovereignWriter.preflightMutation() executes Gates 1–4 in read-only mode (0 graph writes, 0 Merkle ledger writes, 0 incidents) and returns a PreflightReport with a single normalized blockingErrors: GateDiagnostic[] array.

Fail-Closed vs. Fail-Open

Security Posture

When something is missing, broken, or unconfigured, block the write instead of letting it sneak through.

A 'fail-open' system waves traffic through whenever a check errors or isn't configured yet. A 'fail-closed' system refuses unsafe actions by default until explicit trust or verification succeeds.

How Nesatz Solves / Uses It

InputSanitizer.sanitize(input) defaults to 'user_input' and fails closed ('untrusted')—production profiles keep 'user_input': 'untrusted' and pass explicit keys (e.g., 'curated_internal') for trusted paths; InputSanitizer.isAllowedUrl() denies all domains until configured; and @nesatz/mcp boots read-only unless --enable-mutations is passed.

8-State Monotonic Absorbing Lifecycle

Gate 3

Strict status rules ensuring claims only move through allowed stages and retired claims stay retired.

Without status rules, an AI might overwrite an approved fact, publish an unverified museum auction rumor, or silently revive a retracted claim. 'Monotonic' means transitions follow a controlled one-way matrix, and 'absorbing' means final states cannot loop back.

How Nesatz Solves / Uses It

Claims progress across DRAFT, UNDER_REVIEW, ACTIVE, guarded downward states (NARROWED, STALE, SUSPENDED), and terminal absorbing states (REVOKED, SUPERSEDED requiring supersededBy). In-place UPDATEs on ACTIVE claims are rejected (DIRECT_ACTIVE_MUTATION_FORBIDDEN), while verified pipelines can use idempotentIfUnchanged or REVISE_ACTIVE with CAS + SourceVerifier checks.

Merkle Audit Ledger

Gate 5

A tamper-evident chain of SHA-256 fingerprints recording every change so silent edits are immediately detectable.

Each new audit entry includes the cryptographic hash of the previous entry plus a Merkle tree root. If anyone alters an older record, every hash downstream stops matching.

How Nesatz Solves / Uses It

MerkleAuditLedger records every committed mutation with per-entity monotonic prevHash chaining, verifyLedgerIntegrity(), and generateInclusionProof() using zero external dependencies.

Compare-and-Set (CAS) & Optimistic Concurrency

Storage

Preventing two agents from accidentally overwriting each other's work at the same time.

When two agents read record version v1 and both try to save edits, the first one succeeds and advances the record to v2. When the second tries to save expecting v1, CAS sees the mismatch and rejects it instead of clobbering the first edit.

How Nesatz Solves / Uses It

All EpistemicStore adapters (GraphStoreAdapter, DocumentStoreAdapter) implement patchEntity(id, expectedVersion, patch, newVersion) returning APPLIED or VERSION_MISMATCH, forcing stale agents to re-propose against fresh state.

Knowledge Graph & Cypher

Storage

Storing facts as connected entities and relationships (like Drug → TARGETS → Gene) instead of isolated text.

A knowledge graph stores nodes (e.g., ClinicalTrial, Drug, Biomarker) linked by named edges (e.g., INDICATES, SUPERSEDES). Cypher is the query language used by graph databases like Neo4j to read and traverse those connections.

How Nesatz Solves / Uses It

Nesatz runs zero-infra out of the box with InMemoryGraphExecutor and .nesatz/ local files, or connects to Neo4j via Neo4jExecutor—while QueryValidator inspects Cypher ASTs and GraphStoreAdapter enforces CAS and layer separation.

Quarantine & :Incident Nodes

Gate 5

Automatically isolating suspicious or drifted records into review so users never cite corrupted data.

If a storage engine drops a property or an integrity check fails after commit, leaving the record marked ACTIVE would poison downstream answers.

How Nesatz Solves / Uses It

Whenever Gate 5 detects read-back drift, Nesatz automatically moves the entity to UNDER_REVIEW and logs an immutable :Incident node alongside the Merkle audit trail.

Circuit Breaker & Rate Limiting

@nesatz/mcp

An automatic shutoff switch that freezes a misbehaving AI agent if it triggers repeated security violations.

If a compromised prompt or runaway loop keeps trying forged tokens or unauthorized actions, a circuit breaker cuts off mutation access until a human inspects what happened.

How Nesatz Solves / Uses It

@nesatz/mcp enforces 50 commits/hour and 500 reads/hour per curator, trips after 15 security signal failures/hour, and stays paused until a human runs `nesatz-mcp reset-breaker --curator <id>`.

Ready to see these concepts in action?

Walk through the live 5-Gate Simulator or connect Nesatz directly to Claude, Cursor, or Antigravity via MCP.