add runtime/engram.el, manifest.el; register seed builtins in codegen arity table

- runtime/engram.el: thin El wrappers over all __engram_* and __generate
  seed primitives (16 functions), matching the el_seed.c API exactly
- runtime/manifest.el: build manifest documenting module load order and
  the cat+compile+cc command for runtime builds
- el-compiler/src/codegen.el: add 77 __-prefix seed primitive entries to
  builtin_arity, covering str, fs, http, thread, exec, env, time, uuid,
  math, state, html, json, and engram seeds
This commit is contained in:
Will Anderson
2026-05-03 15:37:05 -05:00
parent 9d0e1f64d4
commit 33af4ed09e
3 changed files with 198 additions and 0 deletions
+86
View File
@@ -0,0 +1,86 @@
// runtime/engram.el El wrapper for the engram graph store
//
// Thin wrappers over the __engram_* seed primitives defined in el_seed.c.
// Each function delegates directly to the corresponding seed no logic here.
// The seed layer owns all storage, indexing, and graph traversal.
//
// Dependencies: runtime/string.el, runtime/json.el
// --- Node creation ---
fn engram_node(content: String, node_type: String, salience: Float) -> String {
return __engram_node(content, node_type, salience)
}
fn engram_node_full(content: String, nt: String, sal: Float, imp: Float,
source: String, lang: String, ts: Int, tags: String) -> String {
return __engram_node_full(content, nt, sal, imp, source, lang, ts, tags)
}
// --- Node retrieval ---
fn engram_get_node(id: String) -> String {
return __engram_get_node(id)
}
fn engram_node_count() -> Int {
return __engram_node_count()
}
// --- Node lifecycle ---
fn engram_strengthen(id: String) -> Bool {
return __engram_strengthen(id)
}
fn engram_forget(id: String) -> Bool {
return __engram_forget(id)
}
// --- Search and scan ---
fn engram_search(query: String, limit: Int) -> String {
return __engram_search(query, limit)
}
fn engram_scan_nodes(limit: Int, offset: Int) -> String {
return __engram_scan_nodes(limit, offset)
}
fn engram_scan_nodes_json(limit: Int, offset: Int) -> String {
return __engram_scan_nodes_json(limit, offset)
}
// --- Graph edges ---
fn engram_connect(from: String, to: String, rel: String, weight: Float) -> Bool {
return __engram_connect(from, to, rel, weight)
}
fn engram_edge_between(a: String, b: String) -> String {
return __engram_edge_between(a, b)
}
// --- Graph traversal ---
fn engram_neighbors(id: String) -> String {
return __engram_neighbors(id)
}
fn engram_neighbors_filtered(id: String, rel: String, min_w: Float) -> String {
return __engram_neighbors_filtered(id, rel, min_w)
}
fn engram_activate(query: String, depth: Int) -> String {
return __engram_activate(query, depth)
}
fn engram_activate_json(query: String, limit: Int) -> String {
return __engram_activate_json(query, limit)
}
// --- Generation ---
fn generate(form: String) -> String {
return __generate(form)
}
+34
View File
@@ -0,0 +1,34 @@
// runtime/manifest.el El runtime module manifest
//
// Load order for runtime compilation. Each module may depend on modules
// listed before it. The build system concatenates these in this order,
// then compiles the combined source.
//
// Modules:
// 1. runtime/string.el string operations (no dependencies)
// 2. runtime/math.el numeric/float operations (no dependencies)
// 3. runtime/state.el in-process key-value (no dependencies)
// 4. runtime/env.el environment, process, args, uuid
// 5. runtime/fs.el filesystem operations (depends: string)
// 6. runtime/exec.el subprocess execution (depends: string)
// 7. runtime/time.el time, date, calendar (depends: string, math)
// 8. runtime/json.el JSON operations (depends: string)
// 9. runtime/http.el HTTP client+server (depends: string, json)
// 10. runtime/engram.el graph store (depends: string, json)
// 11. runtime/thread.el threading, parallel_map (depends: all above)
// 12. runtime/collections.el list/map higher-level ops (depends: string)
//
// Build command (from el/ root):
// cat runtime/string.el runtime/math.el runtime/state.el runtime/env.el \
// runtime/fs.el runtime/exec.el runtime/time.el runtime/json.el \
// runtime/http.el runtime/engram.el runtime/thread.el \
// runtime/collections.el \
// <user-program.el> > combined.el
// ./dist/platform/elc combined.el > output.c
// cc -std=c11 -I el-compiler/runtime -lcurl -lpthread \
// -o output output.c el-compiler/runtime/el_seed.c
// This file itself is not compiled it is documentation only.
fn runtime_version() -> String {
return "2.0.0-el-native"
}