Use this file to discover all available pages before exploring further.
The Process Verifier ensures AI-driven workflows follow deterministic process steps — not just correct answers, but correct procedures. It moves verification from “black box” (output only) to “glass box” (reasoning trace).
IRAC (Issue, Rule, Application, Conclusion) is a legal reasoning framework. The Process Verifier checks that all four components are present in a reasoning trace.
from qwed_new.guards.process_guard import ProcessVerifierverifier = ProcessVerifier()reasoning = """The issue presented is whether the contract was breached.The rule governing this matter is Article 2 of the UCC, which statesthat a breach occurs when a party fails to perform as promised.In applying this rule to the facts, the defendant delivered goods two weeks after the agreed date, which constitutes non-performance.In conclusion, the contract was breached due to late delivery."""result = verifier.verify_irac_structure(reasoning)print(result["verified"]) # Trueprint(result["score"]) # 1.0print(result["missing_steps"]) # []
When not all IRAC steps are present, the verifier returns a decimal score and lists missing steps:
incomplete_reasoning = """The question is whether damages should be awarded.Based on my analysis, the plaintiff is entitled to compensation."""result = verifier.verify_irac_structure(incomplete_reasoning)print(result["verified"]) # Falseprint(result["score"]) # 0.5 (2 of 4 steps)print(result["missing_steps"]) # ["rule", "application"]
def review_legal_memo(memo: str) -> dict: result = verifier.verify_irac_structure(memo) if not result["verified"]: raise ValueError(f"Missing steps: {result['missing_steps']}") return result