Design an AI Agent Rule Configuration Domain
Model editable agent rules, saved drafts, immutable deployments and rollback for an external Renderer.
Customers configure textual instructions for AI agents, such as being polite, limiting response length, or avoiding a topic. They can create, edit and delete rules, save drafts, publish a configuration, and roll back to an earlier deployment. A separate Agent Renderer retrieves the active rules and executes them.
Design the data models, APIs and data flow; scalability and the Renderer implementation are outside this exercise.
For this exercise, assume each customer has one current editable draft and at most one active deployment. Several authorized editors may work on the same customer. Rule text is an opaque, nonempty string; do not evaluate its meaning or implement an AI model.
Editing or deleting a draft rule must not change any already published deployment. Rollback selects a previously published deployment for that customer and leaves the current draft available for later editing.
For this exercise, assume the Renderer must read one consistent active configuration. Publish and rollback must either make the intended configuration active or report a clear failure; a partially updated list must never become active. Customer configurations must be isolated.
Explain how stale edits and competing activation requests are detected or serialized.
Produce a design only: responsibilities and relationships, method/API contracts, and an ordered interaction walkthrough. You may choose in-memory or persisted representations if their behavior is consistent with these requirements.