Best Practices
Best practices
1. Always treat Averment as an execution gate
Averment is not a validator or logger. It should sit directly before execution.
Wrong

js

Correct

js

2. Write clear, specific summaries
Your summary is used for semantic evaluation, so make it clear and descriptive.
Weak

js

Strong

js

3. Use structured context
Send only the fields that matter for the decision.
Bad

js

Good

js

4. Use rules and behavior controls instead of hard-coded logic
Keep decision rules and behavior controls separate from hard-coded logic for easier updates and centralized control.
Bad

js

Good

5. Centralize Averment in your system
Don't scatter decide() calls randomly. Centralize them for consistent behavior and visibility.
6. Keep rules simple
Simple rules are easier to maintain and debug.
7. Test controls with realistic inputs
Always test with context that reflects real-world usage. Edge cases surface early this way.