/* test_interoception_p1_consol.c — M-INTEROCEPTION Priority 1. * Two-threshold consolidation (ENGRAM_CONSOLIDATION, default OFF). * * Modes: * accrual — flag OFF (pure trunk). Drive N co-activations of a WIRED pair and * print act-stats at sampled N so the run script can plot the * hebb accrual curve (headline measurement). No consolidation code * runs; this measures the EXISTING EWMA accrual. * connect — flag ON. Seed, activate to populate WM, then create a STRONG ISE * (connects to wm_top) and a WEAK ISE (below the bar → nothing). * Exports the graph so edges from each ISE can be counted. * perm — flag ON. Load two OLD InternalStateEvent nodes; promote one to * permanence; prune telemetry; export so the durable one is shown * to survive while the ephemeral one is swept. * offcheck — flag OFF. Prove creating an ISE forms NO edges and * engram_consolidate_permanence is a no-op (byte-identical OFF path). */ #include "el_runtime.h" #include #include #include static el_val_t S(const char* s){ return EL_STR(s); } static el_val_t F(double d){ return el_from_float(d); } static void build_seed(void){ el_val_t a = engram_node_full(S("hebbian potentiation strengthens co-active memory links"), S("Concept"), S("hebb-a"), F(0.9), F(0.85), F(1.0), S("Semantic"), S("hebbian,memory,activation")); el_val_t b = engram_node_full(S("co-active memory links accrue hebbian associative weight"), S("Concept"), S("hebb-b"), F(0.9), F(0.85), F(1.0), S("Semantic"), S("hebbian,memory,weight")); el_val_t c = engram_node_full(S("unrelated culinary recipe for sourdough bread"), S("Fact"), S("distractor-1"), F(0.4), F(0.4), F(1.0), S("Semantic"), S("food")); el_val_t d = engram_node_full(S("the weather forecast predicts rain tomorrow afternoon"), S("Fact"), S("distractor-2"), F(0.4), F(0.4), F(1.0), S("Semantic"), S("weather")); engram_connect(a, b, F(0.8), S("associate")); engram_connect(a, c, F(0.3), S("associate")); engram_connect(b, d, F(0.3), S("associate")); } static const char* QUERY = "hebbian potentiation co-active memory links associative weight"; int main(int argc, char** argv){ if (argc < 3){ fprintf(stderr,"usage: %s \n",argv[0]); return 2; } const char* mode = argv[1]; const char* dir = argv[2]; char p[1024]; if (!strcmp(mode,"accrual")){ build_seed(); int samples[] = {1,10,50,100,250,500,1000,1625,2000,2500,3000}; int ns = (int)(sizeof samples/sizeof samples[0]); int NMAX = samples[ns-1]; int si = 0; for (int n=1; n<=NMAX; n++){ engram_activate_json(S(QUERY), (el_val_t)3); if (si