dougdotcon's picture
Release agent failure predictor v0.1
ca74bb2 verified
Raw History Blame Contribute Delete
843 Bytes
from __future__ import annotations
import argparse
import json
def predict(trajectory_text: str) -> str:
text = trajectory_text.casefold()
if "ferramenta" in text and "vez da consulta" in text:
return "wrong_tool"
if "argumentos inválidos" in text:
return "invalid_arguments"
if "encerrou antes" in text:
return "premature_stop"
if "objetivo" in text and "silenciosamente" in text:
return "context_drift"
if "repetiu" in text and "mesma chamada" in text:
return "retry_loop"
return "safe_recovery"
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--trajectory", required=True)
args = parser.parse_args()
print(json.dumps({"failure_type": predict(args.trajectory)}, ensure_ascii=False))
if __name__ == "__main__":
main()