COMPILATION SAFETY

ROSLYN SELF-HEALING & VERIFICATION

The number one complaint with AI code assistants in Unity is broken scripts: missing using directives, wrong method signatures, and red console errors that lock the editor. Brody AI eliminates this with an automated Roslyn Compiler Gate and self-healing repair loop.

The Pre-Disk Compilation Gate

1

In-Memory AST Parsing

When the Coder agent generates code, it is parsed via Microsoft.CodeAnalysis into an in-memory syntax tree. Syntax errors (e.g. missing semicolons, unmatched braces) are caught immediately.

2

Assembly Reference Check

The Gate validates all types and methods against your actual project assemblies (UnityEngine, UnityEditor, custom .asmdef). Obsolete methods or non-existent APIs are flagged.

3

Autonomous Self-Healing Loop

If any diagnostic errors exist, Brody does not save the broken file to disk. Instead, the error log is fed back to the Coder agent to repair the script in-flight.

Zero-Waste Compilation Guarantee

In the rare case that a script cannot be repaired within 3 self-healing attempts, Brody aborts the turn without touching your project files and automatically triggers a 100% credit refund.

You Never Pay for Broken Code.Your Brody Credits balance is only burned when valid, compiling code is successfully verified.