perf(planning): update plan observations incrementally #283

Closed
opened 2026-10-16 22:39:46 +02:00 by nessar · 1 comment
Owner

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-check is 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.
  • The from-scratch computation stays available as the test oracle and as an opt-in shadow mode that compares both on every scoring call. The shadow mode is off by default and is not a CI gate.
  • The frozen-engine differential check passes, and the seven benchmark scenarios produce identical complete outcomes, explanations and final states. The shadow mode passes across all seven benchmark scenarios.
  • Same-session before/after benchmark measurements are recorded in the benchmark documentation, including a fresh loaded-year CPU profile.
  • The functional coverage suite, type checks, lint and formatting pass.

Blocked by

## 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-check` is 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. - [ ] The from-scratch computation stays available as the test oracle and as an opt-in shadow mode that compares both on every scoring call. The shadow mode is off by default and is not a CI gate. - [ ] The frozen-engine differential check passes, and the seven benchmark scenarios produce identical complete outcomes, explanations and final states. The shadow mode passes across all seven benchmark scenarios. - [ ] Same-session before/after benchmark measurements are recorded in the benchmark documentation, including a fresh loaded-year CPU profile. - [ ] The functional coverage suite, type checks, lint and formatting pass. ## Blocked by - #282
nessar added the ready-for-agent label 2026-10-16 22:39:46 +02:00
nessar added a new dependency 2026-10-16 22:39:46 +02:00
Author
Owner

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: nessar/vac-optimizer#283