interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / milestone-10-spec.md

90 lines · 4738 bytes Raw Blame History Rendered
1# Specification: Milestone 10 — Omega Library V1 (`OMEGA_LIBRARY_V1`)
2
3```text
4Document ID: SPEC-OMEGA-M10
5Milestone: Milestone 10 (OMEGA_LIBRARY_V1)
6Classification: Sovereign Machine Canonical Specification
7Target Substrate: Versioned Procedural Program Library, Provenance Tracking, and Component Catalog
8Status: COMPLETE / RATIFIED (aien-spark/aien-architecture#22, aien-spark/omega#16)
9Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3) -> OMEGA (M4-M10) -> AIEN
10```
11
12---
13
14## 1. Executive Summary & Core Invariants
15
16Milestone 9 established sovereign program synthesis (`OMEGA_SYNTHESIS_V0`), discovering verified programs from input/output specifications.
17Milestone 10 establishes the **sovereign program library substrate** (`OMEGA_LIBRARY_V1`):
18
19> **DISCOVERED MEANINGS ARE ACCUMULATED, NOT FORGOTTEN. EVERY COMPONENT IS IMMUTABLY INDEXED, PROVENANCE-LINKED, AND VERIFIED.**
20
21The `OMEGA_LIBRARY` substrate provides:
221. **Content-Addressed Catalog**: Programs indexed by canonical `SemanticId` (Program ID) and `RealizationId` with constant-time retrieval.
232. **Contract-Based Semantic Query**: Search and filter components by typed signatures (input/output types, bit widths, precondition/postcondition constraints).
243. **Dependency DAG Tracking**: Composite programs declare explicit dependencies on constituent components, forming an acyclic dependency graph with cycle detection.
254. **Immutable Versioned State**: Library evolution is tracked via monotonic versions ($v_1, v_2, \dots$); a SHA-256 state digest seals the library catalog at every version.
265. **Fail-Closed Verification Gate**: Only programs that have passed the full M7 verification ladder ($V_0, V_1, V_2$) with valid receipts are admitted into the library.
276. **Synthesis Reuse**: The synthesis engine can consume an `OmegaLibrary` as its primitive bank, reusing existing verified abstractions to solve higher-level tasks at lower search depths.
28
29---
30
31## 2. Library Data Model & Interfaces
32
33```c
34#define OMEGA_LIB_MAX_PROGRAMS 128
35#define OMEGA_LIB_MAX_DEPS 8
36
37typedef struct {
38 OmegaProgram program;
39 uint32_t version_introduced;
40 uint64_t timestamp_added;
41 size_t dep_count;
42 SemanticId dependency_ids[OMEGA_LIB_MAX_DEPS];
43 uint8_t evidence_receipt_hash[32];
44} OmegaLibraryEntry;
45
46typedef struct {
47 uint32_t version;
48 size_t count;
49 OmegaLibraryEntry entries[OMEGA_LIB_MAX_PROGRAMS];
50 uint8_t state_digest[32];
51} OmegaLibrary;
52
53int omega_library_init(OmegaLibrary *lib);
54void omega_library_destroy(OmegaLibrary *lib);
55
56/* Insert a verified program into the library. Fails if unverified or duplicate. */
57int omega_library_insert(OmegaLibrary *lib, const OmegaProgram *prog,
58 const SemanticId *deps, size_t dep_count,
59 const uint8_t receipt_hash[32]);
60
61/* Content-addressed lookup */
62const OmegaLibraryEntry* omega_library_find_by_id(const OmegaLibrary *lib, const SemanticId *prog_id);
63
64/* Semantic query: find all programs matching input/output types and width */
65size_t omega_library_query_by_type(const OmegaLibrary *lib,
66 TypeTag in_type, uint16_t in_width,
67 TypeTag out_type, uint16_t out_width,
68 const OmegaLibraryEntry **out_results, size_t max_results);
69
70/* Compute cryptographic checksum over entire library catalog */
71int omega_library_compute_digest(OmegaLibrary *lib);
72
73/* Advance version and seal state */
74int omega_library_advance_version(OmegaLibrary *lib);
75```
76
77---
78
79## 3. Qualification Gates for M10
80
811. `OMEGA_LIBRARY_INIT_PASS`: Library initialized with version 1, empty catalog, and zeroed digest.
822. `OMEGA_LIBRARY_INSERT_PASS`: Verified programs inserted into the catalog with complete metadata.
833. `OMEGA_LIBRARY_LOOKUP_ID_PASS`: O(1) content-addressed retrieval by `SemanticId`.
844. `OMEGA_LIBRARY_LOOKUP_TYPE_PASS`: Semantic query by type contracts returns matching component entries.
855. `OMEGA_LIBRARY_DEPENDENCY_DAG_PASS`: Composite program dependencies recorded and topologically validated without cycles.
866. `OMEGA_LIBRARY_IMMUTABILITY_PASS`: Cryptographic state digest seals library contents; tampering is detected.
877. `OMEGA_LIBRARY_UNVERIFIED_REFUSAL_PASS`: Unverified programs or programs lacking verification pass are rejected fail-closed.
888. `OMEGA_LIBRARY_DUPLICATE_REFUSAL_PASS`: Duplicate insertions of identical `SemanticId` rejected fail-closed.
899. `OMEGA_LIBRARY_SYNTHESIS_REUSE_PASS`: Synthesis engine queries library components as primitives to discover solutions at reduced depth.
9010. `OMEGA_LIBRARY_RECEIPT_PASS`: Qualified library demonstration produces cryptographic evidence receipt with full provenance.