Skip to main content

Module epistemic

Module epistemic 

Source
Expand description

Evidence Layer (Epistemic Layer) for Microscope Memory.

Separates salience (how often something is recalled — driven by Hebbian, Resonance, Thought Graph, Dream) from evidence weight (how much independent factual support exists). Confidence is computed purely from independent Observation/Evidence links — never from recall energy or salience.

Binary format: evidence.bin (EVD1) — ledger; evidence_log.bin (EVL1) — audit.

§Invariants

  1. C1 — Salience isolation: Recall energy never modifies confidence.
  2. C2 — No self-echo: Storing the same text twice from the same source does not increase distinct_sources.
  3. C3 — Support restriction: Only Observation and Evidence classes may appear as supports. Inference and Hypothesis can never support.
  4. C4 — Promotion gate: Inference/Hypothesis blocks with distinct_sources == 0 cannot gain importance via Hebbian promotion.
  5. C5 — Audit integrity: Any modification to evidence_log.bin is detectable via SHA-256 chain verification.

Structs§

AuditChain
Append-only audit chain.
AuditChunk
A single chunk in the hash chain.
AuditRecord
A single audit record (the pre-hash payload).
EvidenceLedger
The in-memory evidence ledger, backed by evidence.bin.
EvidenceRecord
A single evidence record in the ledger.

Enums§

AuditEvent
An event type in the evidence audit chain.
EpistemicClass
Epistemic classification of a memory block.

Constants§

AUDIT_MAGIC
Magic bytes for the audit log.
DEFAULT_SIM_THRESHOLD
Maximum cosine similarity before two texts are considered echoes.
EVIDENCE_MAGIC
Magic bytes for the ledger file.

Functions§

check_promotion_gate
Check whether a block is allowed to promote importance (C4 gate).
class_of_flags
Compute the epistemic class from a flags byte (convenience for build/dream).
confidence
Compute confidence from an evidence record.
content_hash
Content-hash a text for ledger lookup (same FNV-1a as bump_entry_by_text_hash).
flags_with_class
Encode a class into flags byte bits 0-2 (convenience for build).
is_echo_cosine
Check if two texts are echoes using cosine similarity of their embeddings.
link_evidence
Link an independent Observation or Evidence to a claim.
refute
Record a refutation against a claim.