feat(arch): implement 'Code as Thought' architecture and formalize PSF Consensus Loop
This commit is contained in:
31
projects/org-skill-agent-identity/tests/simulate_identity.py
Normal file
31
projects/org-skill-agent-identity/tests/simulate_identity.py
Normal 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'}")
|
||||
Reference in New Issue
Block a user