ByteNex › Docs › Defining Repair Rules for Generated Code
Defining Repair Rules for Generated Code
A repair rule names a violation and the correction the AST engine applies. Rules are declarative and applied without manual review.
Defining Repair Rules for Generated Code
A repair rule names a violation and the correction the AST engine applies. Rules are declarative and applied without manual review.
What is a repair rule?
A defined violation, such as a direct open() call or a hardcoded path, with the correction the AST engine writes.
Who applies it?
The AST engine. The rule is declarative; the application is automatic. No manual review is required.
Can a rule be added later?
Yes. A rule is policy; adding a rule does not require a rewrite of the engine.
What are examples of rule violations?
Direct open() calls, os.path usage, missing return contracts, missing decorators, and hardcoded paths.
Does the repair require human intervention?
No. The repair is automatic. The AST engine parses the code, applies the policy, and writes the corrected version.