fix(planning): prioritize complete holiday weeks

This commit is contained in:
nessar committed 2026-08-30 17:16:30 +02:00
1 parent 5a81e38b95
commit 31314f3969
7 files changed
+355 -25

No files matched your search

+9 -8
View File
@@ -74,7 +74,7 @@ All planning dates are normalized as `YYYY-MM-DD` calendar values in the Europe/
## Optimization pipeline
The core is a deterministic, constraint-first heuristic rather than a mathematical solver. It applies these objectives in order, never improving a lower objective by degrading a higher one:
The core is a deterministic, constraint-first heuristic rather than a mathematical solver. It applies these objectives in order, never improving a lower objective by degrading a higher one; complete public-holiday weeks are selected before broader calendar-gain and work-sequence optimization:
### Planner state machine
@@ -87,7 +87,7 @@ stateDiagram-v2
state "Solve obligations jointly" as Obligations
state "Place at-risk balances" as AtRisk
state "Resolve ordered preferences and earned chains" as Preferences
state "Run lexicographic quality passes" as Quality
state "Run lexicographic quality passes<br/>(complete holiday weeks, then non-working-day gain)" as Quality
[*] --> Snapshot
Snapshot --> Validation: canonical request
@@ -121,12 +121,13 @@ stateDiagram-v2
2. find joint obligation assignments;
3. minimize unplaced at-risk leave;
4. satisfy each preference in user order, including shared placements and earned-entitlement chains;
5. maximize adjacent weekend and public-holiday gain;
6. minimize the longest work sequence;
7. minimize deficits caused by internal work sequences shorter than five days;
8. minimize supporting placements;
9. prefer earlier-expiring balances;
10. prefer earlier placement dates.
5. maximize completed public-holiday week value (Wednesday holidays outrank Tuesday/Thursday, which outrank Monday/Friday);
6. maximize adjacent weekend and public-holiday gain;
7. minimize the longest work sequence;
8. minimize deficits caused by internal work sequences shorter than five days;
9. minimize supporting placements;
10. prefer earlier-expiring balances;
11. prefer earlier placement dates.
Every placement records its source balance and all rules it satisfies. Remaining balances are classified as unavoidable expiry, at risk, or deferred.