Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce3c3873c5 |
+10
-25
@@ -91,44 +91,29 @@ jobs:
|
|||||||
echo "El SDK ready"
|
echo "El SDK ready"
|
||||||
/opt/el/dist/platform/elc --version || true
|
/opt/el/dist/platform/elc --version || true
|
||||||
|
|
||||||
- name: Generate ELP master declarations header
|
|
||||||
run: |
|
|
||||||
{
|
|
||||||
printf '/* Auto-generated C forward declarations for ELP cross-module calls */\n'
|
|
||||||
printf '#pragma once\n'
|
|
||||||
printf '#include "el_runtime.h"\n'
|
|
||||||
printf '\n'
|
|
||||||
grep -h -E '^(el_val_t|void|int|char\*|const char\*)[[:space:]]+[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]*\(' dist/*.c 2>/dev/null \
|
|
||||||
| grep ';$' | sort -u
|
|
||||||
} > dist/elp-c-decls.h
|
|
||||||
echo "Generated elp-c-decls.h with $(grep -c ';' dist/elp-c-decls.h 2>/dev/null || echo 0) declarations"
|
|
||||||
|
|
||||||
- name: Build neuron soul binary
|
- name: Build neuron soul binary
|
||||||
run: |
|
run: |
|
||||||
ELB=/opt/el/dist/bin/elb
|
ELB=/opt/el/dist/bin/elb
|
||||||
ELC=/opt/el/dist/platform/elc
|
ELC=/opt/el/dist/platform/elc
|
||||||
RUNTIME=/opt/el/runtime
|
RUNTIME=/opt/el/runtime
|
||||||
|
|
||||||
# Compile all El modules to C.
|
# Compile all El modules to C via elb.
|
||||||
# This step will fail at link on Linux: the El compiler inlines imported
|
# elb fails at link on Linux (GNU ld rejects duplicate strong symbols that
|
||||||
# modules into each module's .c file, producing duplicate strong symbol
|
# macOS ld accepts silently) — that's expected and captured with || true.
|
||||||
# definitions. GNU ld rejects these; macOS ld accepts them silently.
|
# The important output is dist/soul.c: the El compiler inlines all imported
|
||||||
# We capture the link failure and re-link manually below.
|
# modules into the entry-point file, so soul.c is a self-contained
|
||||||
|
# translation unit. We never link the other dist/*.c files — they contain
|
||||||
|
# the same symbols inlined again, plus capability-violation #error guards
|
||||||
|
# that fire when compiled outside the cgi entrypoint.
|
||||||
$ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true
|
$ELB --elc=$ELC --runtime=$RUNTIME/el_runtime.c || true
|
||||||
|
|
||||||
# Re-link with soul.c listed first so its real main() (from the cgi block)
|
# Link only soul.c + the runtime. No --allow-multiple-definition needed.
|
||||||
# wins over the stub main()s generated in every other module.
|
|
||||||
# --allow-multiple-definition tells GNU ld to pick the first definition
|
|
||||||
# for each duplicate symbol — safe here because all duplicates are identical
|
|
||||||
# (same El source compiled independently into multiple .c files).
|
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
OTHER_C=$(ls dist/*.c | grep -v '/soul\.c$' | sort | tr '\n' ' ')
|
|
||||||
cc -O2 -DHAVE_CURL \
|
cc -O2 -DHAVE_CURL \
|
||||||
-I$RUNTIME \
|
-I$RUNTIME \
|
||||||
dist/soul.c $OTHER_C \
|
dist/soul.c \
|
||||||
$RUNTIME/el_runtime.c \
|
$RUNTIME/el_runtime.c \
|
||||||
-lssl -lcrypto -lcurl -lpthread -lm \
|
-lssl -lcrypto -lcurl -lpthread -lm \
|
||||||
-Wl,--allow-multiple-definition \
|
|
||||||
-o dist/neuron
|
-o dist/neuron
|
||||||
|
|
||||||
ls -lh dist/neuron
|
ls -lh dist/neuron
|
||||||
|
|||||||
@@ -95,24 +95,6 @@ fn init_soul_edges() -> Void {
|
|||||||
engram_connect(val_hope, val_trust, el_from_float(0.7), "co-value")
|
engram_connect(val_hope, val_trust, el_from_float(0.7), "co-value")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure_self_canonical_bridge — link the public self anchor (the graph API's
|
|
||||||
// traversal_root, kn-efeb4a5b, which carries only incidental tag edges) to the
|
|
||||||
// curated self node (015644f5, where the real identity / value / co-value edges
|
|
||||||
// live). Without this, public self-traversal (name=self / neuron) reaches tags
|
|
||||||
// instead of the curated identity. Idempotent: connects only if the edge is
|
|
||||||
// missing, so it is safe to run every boot — including on an already-populated
|
|
||||||
// graph where init_soul_edges() is skipped by the <100-edge gate.
|
|
||||||
fn ensure_self_canonical_bridge() -> Void {
|
|
||||||
let pub_self: String = "kn-efeb4a5b-5aff-4759-8a97-7233099be6ee"
|
|
||||||
let curated_self: String = "015644f5-8194-4af0-800d-dd4a0cd71396"
|
|
||||||
let nbrs: String = engram_neighbors_json(pub_self, 1, "out")
|
|
||||||
if !str_contains(nbrs, curated_self) {
|
|
||||||
engram_connect(pub_self, curated_self, el_from_float(0.95), "canonical-self")
|
|
||||||
engram_connect(curated_self, pub_self, el_from_float(0.95), "canonical-self")
|
|
||||||
println("[soul] canonical-self bridge built: kn-efeb4a5b <-> 015644f5")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// load_identity_context — pull key identity nodes from engram into working state.
|
// load_identity_context — pull key identity nodes from engram into working state.
|
||||||
// Called at boot after engram_load. These nodes contain values, intellectual-dna,
|
// Called at boot after engram_load. These nodes contain values, intellectual-dna,
|
||||||
// memory-philosophy — the graph-stored self that chat.el can include in prompts.
|
// memory-philosophy — the graph-stored self that chat.el can include in prompts.
|
||||||
@@ -416,9 +398,6 @@ if is_genesis && safe_to_seed {
|
|||||||
} else {
|
} else {
|
||||||
println("[soul] edges already present (" + int_to_str(edge_count_now) + ") - skipping init")
|
println("[soul] edges already present (" + int_to_str(edge_count_now) + ") - skipping init")
|
||||||
}
|
}
|
||||||
// Canonical-self bridge is idempotent — run it regardless of edge count so an
|
|
||||||
// already-populated graph still gets the public->curated self link.
|
|
||||||
ensure_self_canonical_bridge()
|
|
||||||
// Genesis saves to its local snapshot file (it manages its own Engram).
|
// Genesis saves to its local snapshot file (it manages its own Engram).
|
||||||
state_set("soul_snapshot_path", snapshot)
|
state_set("soul_snapshot_path", snapshot)
|
||||||
engram_save(snapshot)
|
engram_save(snapshot)
|
||||||
|
|||||||
Reference in New Issue
Block a user