Expand description
v2.76.0 — Phase 1 of the Epistemic Module System: .axi interfaces.
A CognitiveInterface is the public surface of one module — every
top-level named declaration (the design decision, via crate::ast::declaration_surface)
reduced to its signature: what an importer must know to type-check
and to trust, never the implementation (ask text, step bodies, PID
gains, endpoint literals).
§The dual-hash scheme (GHC ABI hash)
CognitiveInterface::content_hash— SHA-256 of the source bytes; changes on ANY edit.CognitiveInterface::interface_hash— SHA-256 of the canonical.axiJSON (with the hash field itself excluded); changes only when the PUBLIC surface changes. A comment-only edit keeps it stable — the precondition for early cutoff (v2.76.0).
§Where the soundness line sits (AST-merge architecture)
Signatures deliberately hide bodies. That is sound because the linked program is built by merging the module ASTs (v2.76.0): the merged semantic revalidation and the single IR generation always see full declarations. Per-module validation consumes ONLY what the signature carries (name + kind + the fields below), so a body-only edit never invalidates a dependent’s per-module pass — and can never make it stale, because nothing body-derived is ever cached per-dependent.
Hashing honors the crate’s zero-runtime-dep discipline: SHA-256 is the
v1.31.0 hand-rolled FIPS 180-4 crate::store_schema_manifest::sha256_hex.
Structs§
- Cognitive
Interface - The
.axi— a module’s compiled cognitive interface. - Module
Registry - The resolved interfaces of every module in a compilation, keyed by module path. What the type-checker’s module mode (v2.76.0) and the ECC (v2.76.0) consume. Deterministic by construction.
Enums§
- Epistemic
Floor - The module-level epistemic guarantee, derived from content — never from an annotation an author could forget.
- Export
Signature - One exported declaration’s signature. Six kinds carry structured
fields (the ones cross-module validation and trust decisions consume);
every other named kind exports as
Other { kind }— name + kind is exactly what the checker’s symbol table needs for it, and nothing body-derived is ever consumed cross-module before the merged revalidation (which sees full declarations).
Constants§
- AXI_
FORMAT_ VERSION .axiformat version. Bumping it busts every compilation cache wholesale (v2.76.0 law 6) — a shape change may never meet stale bytes.
Functions§
- compute_
floor - Floor rules, highest wins (recursing into epistemic blocks):
anchors ⇒ know · shields ⇒ believe ·
know|believe|doubt|speculateblock ⇒ its level · otherwise unspecified. - generate_
interface - Extract the
.axiinterface of one module (Phase 1).