Compare commits

...

5 Commits

Author SHA1 Message Date
Neuron 72e0b829c2 chore: regenerate dist/soul.c after merging the identity accessors (#148)
Neuron Soul CI / build (push) Failing after 14m37s
Neuron Soul CI / deploy (push) Has been skipped
studio.el changed, so the committed build input went stale the moment the merge
landed. CI compiles dist/soul.c, not the .el files. The stamp gate named
studio.el and refused; this is the regeneration it asked for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 14:14:39 -05:00
Neuron 5f0bb67cbf merge: read-only accessors for the compiled identity, and use one (#148)
el_cgi_init loaded the declared identity into runtime globals at startup and
printed it. Nothing read it back out — no accessor existed and it writes no
state, so every consumer still read identity from the mutable state store.
studio.el's dharma_registry read state_get("soul_principal"), a key with no
producer anywhere in the tree, and reported an empty principal under a heading
reading 'Principal Covenant v1'.

Adds cgi_name / cgi_dharma_id / cgi_principal / cgi_network / cgi_engram and
points dharma_registry at the compiled constant.

Read-only on purpose. There is deliberately no setter: publishing these into the
state store would have been one line, passed the same test, and recreated exactly
the runtime-mutable copy IDPROTO claims 1-2 forbid.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 14:13:33 -05:00
Neuron 6934a0e889 chore: the compiler is a build input too, and regenerate under the fixed elc
Neuron Soul CI / build (push) Failing after 14m28s
Neuron Soul CI / deploy (push) Has been skipped
Installing the fixed compiler exposed a blind spot in this gate. On clean main,
with no source changed, soulc-stamp reported OK while the committed amalgam had
gone stale by a line — because the fingerprint covered .el sources and not the
toolchain that turns them into dist/soul.c. That is exactly the class of silent
divergence the gate was written to close, and it had it.

The stamp now fingerprints the elc binary alongside the sources. Demonstrated: with
the old stamp the gate passed after a compiler swap; with this change the same
condition fails, naming __compiler__.

dist/soul.c regenerated under the installed compiler (1,205,027 bytes) and verified:
builds from its own committed input, the declared principal is present in the
resulting binary, interface 110 routes in / 110 out.

Differential evidence that the new compiler is a strict superset — same sources,
both compilers:
  neuron soul        1 differing line, the el_cgi_init emission
  engram server.el   0 differing lines
  mcp-wrapper        0 differing lines
  mcp-proxy          0 differing lines

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 13:56:11 -05:00
Neuron b9e609ee39 feat(runtime): read-only accessors for the compiled identity, and use one
Neuron Soul CI / build (pull_request) Failing after 13m17s
Neuron Soul CI / deploy (pull_request) Failing after 14m38s
el_cgi_init loaded the declared identity into runtime globals and printed it, and
nothing read it back out. No accessor existed and it writes no state, so every
consumer still read identity from the mutable state store. studio.el's registry
read state_get("soul_principal") — a key with no producer anywhere — and reported
an empty principal under a heading reading 'Principal Covenant v1'.

Adds cgi_name/cgi_dharma_id/cgi_principal/cgi_network/cgi_engram. READ-ONLY on
purpose: there is deliberately no setter. Publishing these into the state store
would have been one line and would have recreated exactly the runtime-mutable copy
IDPROTO claims 1-2 forbid ('not modifiable by any runtime mechanism including
environment variables, configuration files, or API calls').

dharma_registry now reads the compiled constant. cgi_id keeps its state read
deliberately — the runtime instance id is a different fact from the compiled
dharma_id, and conflating them would hide a binary running under an id its own
declaration never claimed.

Measured, same corpus, binary the only variable:
  deployed engine  -> "principal":""
  accessor build   -> "principal":"william-christopher-anderson"
  interface: 110 routes in, 110 out, nothing removed

Requires the codegen fix in el (fix/cgi-identity-emission); without it the
declaration is never compiled in and the accessors return empty.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 13:45:37 -05:00
Tim Lingo eb69c40f2d merge: restore the soul_identity producer — three months of empty system prompts (#137)
Neuron Soul CI / build (push) Failing after 38s
Neuron Soul CI / deploy (push) Has been skipped
Five sites in chat.el splice state_get("soul_identity") into the system prompt.
Nothing has written that key since b163fa6 deleted the producer days after 601e0fe
added it on 2026-05-02. Every chat turn since built its prompt with an empty
identity section, and nothing reported it.

Found by the #132 state-key gate within an hour of that gate being rebased onto
main — a read with no producer treated as a build error rather than a silence.

Restored verbatim rather than repointed. soul_identity is an env-configurable
persona line; soul_identity_context is the graph-derived DNA/values/memory-philosophy
block. Aiming the five reads at the latter would have substituted different content
and called it a repair. Whether the chat prompt should also carry that block is a
separate question, left open rather than smuggled in.

Verified by the gate that found it: dead reads 6 -> 1, with the chat.el baseline
entry now reported STALE. Rung: BUILT and gate-verified; not end-to-end chat-verified.

Closes #137. Refs #132.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 12:20:03 -05:00
6 changed files with 59 additions and 5 deletions
Generated Vendored
+2 -1
View File
@@ -29333,7 +29333,7 @@ el_val_t handle_config(el_val_t method, el_val_t body) {
el_val_t dharma_registry(void) {
el_val_t cgi_id = state_get(EL_STR("soul_cgi_id"));
el_val_t principal = state_get(EL_STR("soul_principal"));
el_val_t principal = cgi_principal();
return el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"registry\":[{\"cgi\":\""), cgi_id), EL_STR("\",")), EL_STR("\"principal\":\"")), principal), EL_STR("\",")), EL_STR("\"covenant\":\"Principal Covenant v1\",")), EL_STR("\"registered\":\"2026-05-01\",\"provenance\":\"genesis\",")), EL_STR("\"entry\":1}],")), EL_STR("\"network_status\":\"initializing\",")), EL_STR("\"total_cgis\":1}"));
return 0;
}
@@ -31938,6 +31938,7 @@ el_val_t layered_cycle(el_val_t raw_input, el_val_t session_id, el_val_t utility
int main(int _argc, char** _argv) {
el_runtime_init_args(_argc, _argv);
el_cgi_init(EL_STR("neuron-soul"), EL_STR("ntn-genesis@http://localhost:7770"), EL_STR("william-christopher-anderson"), EL_STR("dharma-mainnet"), EL_STR("http://localhost:8742"));
soul_cgi_id_raw = env(EL_STR("SOUL_CGI_ID"));
soul_cgi_id = ({ el_val_t _if_result_821 = 0; if (str_eq(soul_cgi_id_raw, EL_STR(""))) { _if_result_821 = (EL_STR("ntn-genesis")); } else { _if_result_821 = (soul_cgi_id_raw); } _if_result_821; });
port_raw = env(EL_STR("NEURON_PORT"));
Generated Vendored
+4 -3
View File
@@ -1,7 +1,8 @@
# soul.c.stamp — fingerprint of the .el sources dist/soul.c was generated from.
# Written by tools/soulc-stamp.sh --write. Do not hand-edit.
# generated_amalgam_sha256 ee09798ad93ddd047136577cf324483e5956984d60d06596d34662f315ee0df4
# generated_amalgam_bytes 1204845
# generated_amalgam_sha256 cdc5e716dbfb797faa1b3e080cbd1ac82a75a258809da70cc5fbd02cc8040692
# generated_amalgam_bytes 1205007
7cf5e29d2618db2fca04e6df7aa8954dd6cf9ac5e70aafb8e0b52aa734882131 __compiler__
f8597e10546654bce3fbbe40461b2da59d0e06dbf1b038d1d362d24f949e3911 awareness.el
b6f3d14ca0c26017a2d617399a6d3754dabb0905e4d5f52eb75d25c4ad18d3c5 chat.el
42288c212cbf72fb1e8ecbd4d9900e4e9ee1cfa475b7974295c7637f1bf2939f elp-input.el
@@ -15,4 +16,4 @@ c28e36952ec56525963a0bdf29455ab097d3b0c5653d19c25fbb005e1069a1f7 safety.el
fd3ab91d0ae0ea26639e21bef2f8f94054dc4b02eae68b19e3fe689d2769aad4 sessions.el
5613b60d74d5d7768f46da5ac435a5dd99d38c27f0f7013c89fa27e98dc8a21c soul.el
30337940905171a9645b0929f0a412ce6b3dccb1246495070c553bca0bbae6cd stewardship.el
e105dc5990e6adbf39db9dc0462cd8bcf6e6c3dfd03709059227ecfad2bbab29 studio.el
95dab72be4ee1dd1d28bab63412964a72460126951764e3f74b1c2d49b6d7b35 studio.el
+16 -1
View File
@@ -53,8 +53,23 @@ fn handle_config(method: String, body: String) -> String {
}
fn dharma_registry() -> String {
// COMPILED IDENTITY, not state (2026-08-09). soul_principal had no producer at
// all the #132 gate flagged it as a dead read and the registry reported an
// empty principal under a heading that says "Principal Covenant v1". The value
// was never missing: it is declared in soul.el's cgi block, and as of the
// codegen fix it is compiled into the binary and loaded at startup.
//
// Read it from the compiled constant rather than the state store. The design is
// explicit that this identity is "not modifiable by any runtime mechanism
// including environment variables, configuration files, or API calls" so
// publishing it into state (the cheap fix) would have recreated exactly the
// mutable copy it forbids. cgi_principal() is read-only and has no setter.
//
// cgi_id keeps its state read deliberately: the RUNTIME instance id is a
// different fact from the compiled dharma_id, and conflating them would hide
// the case where a binary runs under an id its declaration never claimed.
let cgi_id: String = state_get("soul_cgi_id")
let principal: String = state_get("soul_principal")
let principal: String = cgi_principal()
return "{\"registry\":[{\"cgi\":\"" + cgi_id + "\","
+ "\"principal\":\"" + principal + "\","
+ "\"covenant\":\"Principal Covenant v1\","
+10
View File
@@ -30,9 +30,19 @@ AMALGAM="$ROOT/dist/soul.c"
# Every .el at the repo root is an input to the amalgam. Sorted so the hash is
# order-independent; content-only so timestamps and checkouts do not perturb it.
# The COMPILER is an input too. Learned 2026-08-09 by installing a fixed elc and
# watching this gate report OK while the committed amalgam had gone stale by a line:
# the sources had not changed, so a source-only fingerprint could not see it. That is
# precisely the blind spot this gate exists to close, and it had it.
fingerprint() {
(
cd "$ROOT" || exit 1
ELC_BIN="${ELC:-$HOME/neuron-dev-stack/src/el/lang/dist/platform/elc}"
if [ -f "$ELC_BIN" ]; then
printf '%s %s\n' "$(shasum -a 256 "$ELC_BIN" | awk '{print $1}')" "__compiler__"
else
printf '%s %s\n' "MISSING" "__compiler__"
fi
for f in $(ls -1 *.el 2>/dev/null | sort); do
printf '%s %s\n' "$(shasum -a 256 "$f" | awk '{print $1}')" "$f"
done
+19
View File
@@ -5634,6 +5634,25 @@ void el_cgi_init(el_val_t name, el_val_t dharma_id, el_val_t principal,
}
/* ── Compiled-identity accessors (2026-08-09) ─────────────────────────────────
* el_cgi_init loads the declaration into these globals at startup and printed
* them, and NOTHING read them back out no accessor existed, and el_cgi_init
* writes no state. So a binary carried its declared identity and every consumer
* still read it from the mutable state store, which is exactly what IDPROTO
* claims 1-2 forbid ("not modifiable by any runtime mechanism including
* environment variables, configuration files, or API calls").
*
* These are READ-ONLY on purpose. There is deliberately no setter: publishing
* the values into the state store would have been one line and would have
* recreated the mutable copy the design prohibits. A caller can read the
* compiled identity; nothing can change it after el_cgi_init.
*/
el_val_t cgi_name(void) { return EL_STR(_el_cgi_name ? _el_cgi_name : ""); }
el_val_t cgi_dharma_id(void) { return EL_STR(_el_cgi_dharma_id ? _el_cgi_dharma_id : ""); }
el_val_t cgi_principal(void) { return EL_STR(_el_cgi_principal ? _el_cgi_principal : ""); }
el_val_t cgi_network(void) { return EL_STR(_el_cgi_network ? _el_cgi_network : ""); }
el_val_t cgi_engram(void) { return EL_STR(_el_cgi_engram ? _el_cgi_engram : ""); }
/* ── Batch 3: Engram in-process graph store ──────────────────────────────── */
/*
* Single global EngramStore allocated lazily on first call. All node and
+8
View File
@@ -782,6 +782,14 @@ el_val_t trace_span_start(el_val_t name);
el_val_t trace_span_end(el_val_t span_handle);
el_val_t emit_event(el_val_t name, el_val_t duration_ms);
/* Compiled-identity accessors — read-only by design (2026-08-09). */
el_val_t cgi_name(void);
el_val_t cgi_dharma_id(void);
el_val_t cgi_principal(void);
el_val_t cgi_network(void);
el_val_t cgi_engram(void);
#ifdef __cplusplus
}
#endif