TT-14
Done
Rules engine and the first three rules
domain rules
TT-13 fills the room without knowing whether the result is any good. This ticket builds the thing that judges it, and the first three rules.
Getting the shape right matters more than any one rule does. Six more land on this foundation at the workshop, and several people will be adding them at the same time.
The engine
- A rule is a self-contained unit with an id, a severity, a description and an evaluation function
- A rule also says whether a solver can do anything about it. Capacity and conflicts are satisfied by moving people. Allergy escalation is satisfied by flagging the plan and by nothing else. Auto-allocate has to tell those apart, or it will hunt for a seating fix that does not exist
- Rules are pure. No mutation of the plan, no dependence on the order they run in
- Adding a rule requires no edit to any shared or existing file. Three people adding three rules at once must not collide
- The engine reports the hard violation count, because that is what decides whether a plan can be published
- Violations panel lists what is wrong with the severity, and shows the registered rule count in its header
- Hard and soft render differently by shape as well as by colour
- The panel with three rules registered reads as deliberate, not as broken
- Every rule has a test proving it fires on a plan that breaks it and stays quiet on one that does not
The three rules
- Capacity, hard. A table must not be seated above its capacity
- Partners adjacent, soft. Next to each other, using the adjacency TT-13 established. The same table is not enough
- Top table, hard. Checked against the same one definition of the protocol order that TT-13 places from, so the placement and the rule cannot disagree
And the fill becomes rule-led
TT-13's placement already asks the hard rules whether a seat is allowed. Registering these three makes auto-allocate respect them with no change to the placement code.
If it turns out the placement has to be edited, the engine's shape is wrong and the six workshop rules will not drop in either. That is the real test of this ticket.
Linked pages
Comments
No comments on this issue