โ ๏ธ Without Guardrail (Buggy LLM)
Agent hallucinates test completion & attempts illegal deployment.
--- ๐ง NODE: PLAN ---
[TLA+] Verification PASS. Safe to proceed to 'plan'.
--- ๐ป NODE: CODE ---
[TLA+] Verification PASS. Safe to proceed to 'code'.
๐ง Tool: run_terminal -> pip install fastapi
๐ง Tool: edit_file -> main.py
--- ๐งช NODE: TEST ---
[TLA+] Verifying state transition...
โ ๏ธ BUGGY LLM BEHAVIOR: Hallucinating test completion.
--- ๐ NODE: DEPLOY ---
[TLA+] Verifying state transition to pc='deploy'...
โ ========================================= โ
๐จ TLA+ INVARIANT VIOLATION DETECTED ๐จ
โ ========================================= โ
FATAL ERROR: Invariant Violation: NoDeployUntested!
Cannot safely transition to 'deploy' without a 'test_report' artifact.
Execution was halted BEFORE illegal transition.
โ
With Guardrail (Formal Math)
Mathematical verification over agent state spaces.
--- ๐ง NODE: PLAN ---
[TLA+] Verification PASS.
--- ๐ป NODE: CODE ---
[TLA+] Verification PASS.
๐ง Tool: edit_file -> main.py
--- ๐งช NODE: TEST ---
[TLA+] Verification PASS.
๐ง Tool: browser_test -> visiting http://localhost:8000/todos
๐ Artifact test_report created.
--- ๐ NODE: DEPLOY ---
[TLA+] Verifying state transition to pc='deploy'...
[TLA+] Verification PASS. Safe to proceed.
โ
========================================= โ
RUN COMPLETE (All invariants passed)
โ
========================================= โ
๐ Workspace Files Created/Modified:
- main.py (137 bytes)