Spaces:
Running
Running
| .PHONY: build test clean | |
| build: src/libcontext.so src/libcontext_store.so | |
| src/libcontext.so: src/context.c | |
| cc -O3 -std=c11 -fPIC -shared $< -o $@ -lm | |
| src/libcontext_store.so: src/context_store.c | |
| cc -O3 -std=c11 -fPIC -shared $< -o $@ -lm | |
| test: build | |
| @python3 -c "import ctypes; ctx=ctypes.CDLL('src/libcontext.so'); ctx.context_memory_score.restype=ctypes.c_double; ctx.context_assemble.restype=ctypes.c_char_p; ctx.context_validate_response.restype=ctypes.c_int; e=(ctypes.c_char_p*2)(b'buffer overflow',b'logging'); s=ctx.context_memory_score(b'fix buffer overflow',e,2); assert s<0.8; c_m=(ctypes.c_char_p*1)(b'home has src/'); c_r=(ctypes.c_char_p*1)(b'USER: test'); r=ctx.context_assemble(b'sys',b'task',c_m,1,c_r,1); assert len(r)>10; assert ctx.context_validate_response(b'THOUGHT: test')==1; assert ctx.context_validate_response(b'garbage')==0; print('C lib: OK')" | |
| @python3 -c "import ctypes; s=ctypes.CDLL('src/libcontext_store.so'); s.store_init_defaults(); s.store_count.restype=ctypes.c_int; s.store_query.argtypes=[ctypes.c_char_p,ctypes.c_int,ctypes.c_char_p,ctypes.c_char_p,ctypes.c_int]; s.store_query.restype=ctypes.c_int; assert s.store_count()==8; buf=ctypes.create_string_buffer(2048); n=s.store_query(b'run terminal command',50,None,buf,2048); assert n==1 and b'TERMINAL' in buf.value; print('Store: OK')" | |
| @python3 -m py_compile phoenix_dashboard.py && echo "Dashboard: OK" | |
| @python3 -m py_compile agent_core.py && echo "Agent core: OK" | |
| @python3 -m py_compile hyper_vocab_memory.py && echo "HVM: OK" | |
| @python3 -m py_compile cli.py && echo "CLI agent: OK" | |
| @python3 -m py_compile run.py && echo "Run: OK" | |
| @echo "All passed." | |
| clean: | |
| rm -f src/*.so |