Publish or roll back a rule version
What It Does
A publisher releases a draft or republishes an earlier expression, optionally supplying simulation evidence, a skip choice, release dates and force.
The Flow
Collect release choices in the publish dialog and submit the checked draft. Check validation and licensing through referenced expressions and verify any cited simulation belongs to this exact successful draft. Lock and recheck the draft, record dependencies, allocate the release number, supersede an overlapping latest release, fit followers, refuse incompatible uses unless forced, suspend forced incompatibilities, remove affected plans, audit and queue role rechecks. Remove optional cached plans, advance affected display generations and nudge the recheck dispatcher after commit. Have Security process the queued subjects and reconcile derived roles.
When Something Fails
The dialog retains the service error and stays open. No service publication has committed at this step. Reject invalid, foreign, unfinished or stale evidence. Validation leaves the draft and consumers intact. An overlap, race or compatibility failure rolls back the whole transaction. Release, suspensions, plan deletion, audit and queued requests are atomic. Cache errors fall back to misses; failed follow-up does not reverse publication. Display answers can survive for two minutes; queued work can wait for the next dispatcher minute. Queue retry eventually reaches dead-letter handling and its age alarm. Old grants remain until successful reconciliation or expiry.
Open Design Questions
Rollback validates old logic against current declarations, publishes it under a new number and preserves the current draft. A nonoverlapping release can be scheduled alongside another published interval. The API accepts neither simulation nor skip, recording neither choice.