ByteNex
ByteNex Docs
BX-System Documentation

ByteNex › Docs › The AST Engine: Rule-Based Code Repair

The AST Engine: Rule-Based Code Repair

The AST engine parses generated code, applies policy rules, writes the corrected version, and updates the signature.

The AST Engine: Rule-Based Code Repair

The AST engine parses generated code, applies policy rules, writes the corrected version, and updates the signature.

What triggers a repair?

Code that violates a defined rule: direct open() calls, os.path usage, missing return contracts, missing decorators, hardcoded paths.

Who reviews the repair?

No manual review. The AST engine applies the policy and writes the corrected code. The process is automatic.

What happens after the repair?

The kernel returns to a stable state and updates the signature of the tool. The corrected code is verified.

How does the AST engine differ from the LLM?

The AST engine applies deterministic rules. The LLM generates code. The engine ensures the generated code adheres to the defined policies.

Can the rules be changed?

Yes. A rule is policy. Adding a rule does not require a rewrite of the engine. The policy is applied automatically.

wak · 2017-04-19