Files
vac-optimizer/docs/adr/0004-stable-explanation-original-trace-counterfactual.md
nessar bc8570d8ca feat: add PlanningDurationService for estimating planning duration
- Implemented PlanningDurationService to provide an indicative wait time before calculation based on user input and calendar settings.
- Introduced duration estimation logic that considers horizon dates, balances, and rules without triggering a calculation.
- Enhanced user input component to display estimated duration using the new service.
- Updated translation files to include new duration estimate strings in multiple languages.
- Added tests for PlanningDurationService to ensure accurate duration estimation and calibration.
- Refactored leave planner service to remove hardcoded deadlines and improve worker responsiveness.
2026-10-05 17:06:17 +02:00

1.4 KiB

Stable Explanation, Original Trace, and Counterfactuals

The automatic planning deadline referenced below is superseded by ADR 0006, implemented by issue #59. Technical callers can still opt into an explicit planning-work budget; the user flow has no automatic cutoff.

VacOptimizer exposes one client-side calculation context. Its immutable submitted snapshot and planning outcome are independent from three explanation concerns:

  • the stable plan explanation is derived from the final displayed plan and remains useful for complete or incumbent plans;
  • the calculation trace is captured while the producing run executes, grouped by phase and atomic decision, and may become ready after the outcome;
  • counterfactual date analysis is an explicitly hypothetical operation that removes only the selected final placement, or starts from a selected trace decision's exact pre-decision state, and never rewrites the plan or historical trace.

The public planning outcome is delivered as soon as planning work finishes. Trace capture and delivery have separate readiness/failure state, remain local to the latest calculation, and cannot turn a valid outcome into an explanation error. Counterfactual work is cancellable or ignored when its calculation identity is stale. The existing deterministic constraint-first planner and its planning-work deadline remain unchanged.