/* test_interoception_p4_afferent.c — M-INTEROCEPTION Priority 4. * Afferent input counters in engram_act_stats_json: additive observability. * Drives KNOWN counts and asserts the emitted counters match and are monotonic. */ #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); } int main(void){ /* 3 plain node creates + 2 ISE creates = 5 node_creates, 2 ise_ingests */ el_val_t a=engram_node_full(S("alpha concept about memory and time"),S("Concept"),S("a"),F(0.9),F(0.8),F(1.0),S("Semantic"),S("x")); el_val_t b=engram_node_full(S("beta concept about memory and links"),S("Concept"),S("b"),F(0.9),F(0.8),F(1.0),S("Semantic"),S("x")); engram_node_full(S("gamma distractor"),S("Fact"),S("c"),F(0.4),F(0.4),F(1.0),S("Semantic"),S("y")); engram_node_full(S("heartbeat internal state one"),S("InternalStateEvent"),S("i1"),F(0.5),F(0.5),F(1.0),S("Working"),S("ise")); engram_node_full(S("curiosity internal state two"),S("InternalStateEvent"),S("i2"),F(0.5),F(0.5),F(1.0),S("Working"),S("ise")); /* 2 edge creates */ engram_connect(a,b,F(0.8),S("associate")); engram_connect(b,a,F(0.3),S("associate")); /* first reading (0 queries so far) */ printf("STATS0 %s\n", EL_CSTR(engram_act_stats_json())); /* 4 queries -> 4 activations */ for(int i=0;i<4;i++) engram_activate_json(S("memory and time and links"), (el_val_t)2); printf("STATS1 %s\n", EL_CSTR(engram_act_stats_json())); /* 3 more queries -> monotonic increase */ for(int i=0;i<3;i++) engram_activate_json(S("memory and time and links"), (el_val_t)2); printf("STATS2 %s\n", EL_CSTR(engram_act_stats_json())); return 0; }