feat(arch): implement 'Code as Thought' architecture and formalize PSF Consensus Loop

This commit is contained in:
2026-03-31 13:03:26 -04:00
parent 5a9129132e
commit 1712b1e4a9
114 changed files with 3652 additions and 2581 deletions

View File

@@ -0,0 +1,31 @@
import os
def simulate_get_name():
return os.getenv("MEMEX_ASSISTANT", "Agent")
def simulate_trigger(text):
keywords = ["who are you", "identify yourself"]
return any(k in text.lower() for k in keywords)
if __name__ == "__main__":
print("--- Test: Identity Retrieval ---")
os.environ["MEMEX_ASSISTANT"] = "FoundryBot"
name = simulate_get_name()
print(f"Name (Env set): {name}")
status1 = "PASS" if name == "FoundryBot" else "FAIL"
del os.environ["MEMEX_ASSISTANT"]
name = simulate_get_name()
print(f"Name (Env unset): {name}")
status2 = "PASS" if name == "Agent" else "FAIL"
print(f"\n--- Test: Identity Trigger ---")
t1 = simulate_trigger("Who are you?")
t2 = simulate_trigger("Identify yourself now.")
t3 = simulate_trigger("Hello there.")
print(f"Trigger 'Who are you?': {t1}")
print(f"Trigger 'Identify yourself': {t2}")
print(f"Trigger 'Hello': {t3}")
status3 = "PASS" if t1 and t2 and not t3 else "FAIL"
print(f"\nFinal Status: {'PASS' if all(s == 'PASS' for s in [status1, status2, status3]) else 'FAIL'}")