Skip to content

feat(dispatch): implement Phase 14 preparation-aware assignment - #19

Merged
404khai merged 1 commit into
mainfrom
feat/preparation-aware-dispatch
Oct 4, 2026
Merged

404khai merged 1 commit into
mainfrom
feat/preparation-aware-dispatch

Conversation

@404khai

@404khai 404khai commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Preparation delays can make the nearest rider spend unnecessary time waiting at pickup. Phase 14 adds preparation_aware_dispatch, which predicts pickup waiting and ranks feasible idle riders by elapsed delivery completion plus a configurable waiting penalty. In the deterministic 18-minute preparation scenario, it selects the rider who waits 3 minutes instead of 13 while preserving the same delivery completion time.

Observed readiness overrides forecasts, missing readiness returns a typed evaluation error, and waiting advances the delivery leg’s routing departure, including FIFO traffic. The implementation reuses Phase 13 eligibility, coverage, feasibility, routing validation, immutable proposals, and atomic commit. Structured evidence records readiness inputs/source, weight, completion duration, waiting, and penalty contributions. The original Basic Dispatch baseline remains available.

Three runnable synthetic scenarios compare fresh equivalent worlds with identical external readiness events and distinguish predictions from executed fulfillment metrics. Documentation includes ADR 0014 and the Phase 14 completion report. A positive waiting penalty may prefer later completion with less idle time; deadlines remain soft-observed. The general simulation engine remains Phase 15 work.

Validation:

  • cargo fmt --all -- --check
  • cargo +1.99.0 clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo +1.99.0 test --workspace --all-features --locked — 108 tests pass, including 12 new Phase 14 fixtures; doc tests pass
  • Both basic_dispatch and preparation_aware_dispatch examples pass on Rust 1.99 and emit valid JSON
  • Documentation file links resolve; git diff --check passes

@404khai
404khai merged commit 8c5315e into main Oct 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant