perf(planning): update plan observations incrementally #283
Notifications
Due Date
No due date set.
Blocks
Depends on
#284 perf(planning): prune candidates that cannot beat the protected prefix
nessar/vac-optimizer
#282 refactor(planning): consolidate plan observations in one module
nessar/vac-optimizer
Reference: nessar/vac-optimizer#283
Reference in new issue
Block a user
Parent
#279
What to build
Make the observations module incremental. When a candidate adds, removes or retypes a leave placement, the module updates the affected time-off periods, work sequences, public-holiday weeks, balance observations and tie key, instead of rebuilding them from the whole plan. Candidate scoring gets much faster, and planning results stay identical. A model-based property test with
fast-check(a new dev dependency) proves the incremental observations always equal a from-scratch recompute.Acceptance criteria
fast-checkis added as a dev dependency. A property test applies random sequences of add, remove and retype operations, including at horizon edges, next to declared non-working days and public holidays, and across year boundaries. After every operation it asserts that the incremental observations equal a from-scratch recompute. Failures shrink to minimal operation sequences.Blocked by
Done in PR #287 (
7890a03): incremental observations derived per placements map, fast-check property test against the from-scratch oracle, opt-in shadow mode (VAC_OBSERVATION_SHADOW=1) passing on the frozen-engine check and all seven scenarios. Loaded year 66.5 s -> 48.5 s. Details: docs/benchmark/issue-279.md.