feat(planning): explain and trace planning decisions
This commit is contained in:
1 parent
609b3dece9
commit
d7a13b0b1e
24 files changed
+6073
-342
No files matched your search
@@ -8,6 +8,8 @@ The planner answers four distinct questions:
|
||||
- Can all mandatory rules be satisfied together?
|
||||
- What is the best plan found by the ordered heuristic?
|
||||
- If calculation stops early, what valid incumbent is available?
|
||||
- Why did each displayed placement survive the objective order?
|
||||
- Which alternatives were considered, and what would another date change?
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -18,7 +20,7 @@ flowchart LR
|
||||
subgraph Browser
|
||||
UI["Angular standalone components"]
|
||||
State["Signals and localStorage-backed settings"]
|
||||
Facade["planLeave(request)<br/>async public boundary"]
|
||||
Facade["Planning calculation context<br/>immutable snapshot + async artifacts"]
|
||||
Worker["Leave-planner Web Worker"]
|
||||
Core["Synchronous planner core"]
|
||||
Holidays["date-holidays<br/>French public calendar"]
|
||||
@@ -28,7 +30,7 @@ flowchart LR
|
||||
Facade --> Worker
|
||||
Worker --> Core
|
||||
Core --> Holidays
|
||||
Worker -- "progress, checkpoints, outcome" --> Facade
|
||||
Worker -- "progress, checkpoints, outcome, then artifacts" --> Facade
|
||||
Facade --> UI
|
||||
end
|
||||
```
|
||||
@@ -38,12 +40,12 @@ Leave calculation stays in the browser. The production Express process serves th
|
||||
### Main execution path
|
||||
|
||||
1. `CalendarYear` takes a snapshot of leave balances and ordered rules.
|
||||
2. `CalendarService` supplies the Europe/Paris planning horizon and exposes the single `planLeave` operation.
|
||||
2. `CalendarService` supplies the Europe/Paris planning horizon and opens one immutable planning calculation context.
|
||||
3. `leave-planner.service.ts` copies the request into a canonical transport shape and starts the worker.
|
||||
4. `leave-planner.worker.ts` runs the framework-free core and sends progress, valid checkpoints, and the final outcome.
|
||||
4. `leave-planner.worker.ts` runs the framework-free core, sends progress and valid checkpoints, publishes the outcome first, then delivers its stable explanation and original trace.
|
||||
5. `CalendarYear` ignores stale calculations, renders the selected dates, and reports remaining balances or errors.
|
||||
|
||||
The public boundary has a default and hard maximum wall-clock limit of ten seconds. If it expires after a valid checkpoint, the result is `PlanningIncomplete` with that incumbent; it is not reported as a constraint conflict.
|
||||
Planning work has a default and hard maximum wall-clock limit of ten seconds. If it expires after a valid checkpoint, the result is `PlanningIncomplete` with that incumbent; it is not reported as a constraint conflict. Explanation and trace delivery happen after the outcome and do not consume that planning budget.
|
||||
|
||||
## Planning model
|
||||
|
||||
@@ -193,7 +195,7 @@ Open <http://localhost:4200>. The development server reloads when source files c
|
||||
|
||||
## Performance benchmark
|
||||
|
||||
Build or start the application, then open `/benchmark`. The isolated harness covers a representative year, typed obligations, chained earned entitlements, a deliberate conflict, and a loaded year. It reports preparation time, calculation time, total wall time, outcome, last completed stage, placement count, and determinism.
|
||||
Build or start the application, then open `/benchmark`. The isolated harness covers a representative year, typed obligations, chained earned entitlements, a deliberate conflict, and a loaded year. It reports preparation time, planning latency, separate trace-delivery latency, total wall time, outcome, last completed stage, placement count, determinism, and trace size/status.
|
||||
|
||||
The release protocol and reference-phone thresholds are documented in [docs/benchmark/README.md](docs/benchmark/README.md). Phone timings are release evidence, not CI assertions.
|
||||
|
||||
@@ -222,3 +224,4 @@ GitLab CI runs independent validation, test, build, security, and image stages:
|
||||
- [ADR 0001](docs/adr/0001-ordered-heuristic-optimization.md) records the ordered heuristic decision.
|
||||
- [ADR 0002](docs/adr/0002-personal-client-side-planner-for-now.md) records the client-side scope.
|
||||
- [ADR 0003](docs/adr/0003-constraint-first-lexicographic-planning.md) records the constraint-first planner architecture.
|
||||
- [ADR 0004](docs/adr/0004-stable-explanation-original-trace-counterfactual.md) separates the outcome, stable explanation, original trace, and hypothetical analysis.
|
||||
Reference in new issue
Block a user