The problem
NEXO Brain relies on the AI model remembering to call protocol tools like heartbeat, diary, and startup. In practice, the model often skips these — especially during long sessions or complex tasks. There was no mechanical enforcement layer.
The solution
A new tool-enforcement-map.json file in the repo root maps all 247 MCP tools with enforcement metadata. Each tool declares whether it needs enforcement, what type (periodic, event-based, session lifecycle), the trigger threshold, and the prompt to inject when the rule is violated.
16 tools have enforcement rules. The remaining 231 are utility, query, or management tools that don't need mechanical enforcement.
Enforcement types
The map supports 7 enforcement types: on_session_start, on_session_end, periodic_by_messages, periodic_by_time, before_tool, after_tool, and on_event. Each type defines when the enforcer should inject a prompt to force the model to comply.
Drift detection
A new scripts/verify_tool_map.py script scans all tool definitions in server.py and plugins/, compares against the map, and fails if any tool is missing or orphaned. This runs in CI to prevent drift.