Skip to content

feat(dispatch): slice 5.3 CandidatesSelected + NoCandidatesAvailable#34

Merged
erikshafer merged 6 commits into
mainfrom
slice/5-3-candidates-selected
Jun 17, 2026
Merged

feat(dispatch): slice 5.3 CandidatesSelected + NoCandidatesAvailable#34
erikshafer merged 6 commits into
mainfrom
slice/5-3-candidates-selected

Conversation

@erikshafer

Copy link
Copy Markdown
Owner

Summary

  • Implements W001 §5.3 end-to-end: CandidateSelectionAutomation reacts to FareQuoted, queries INearbyAvailableDriversSource (stub seam; transport deferred to parking-lot Add Dispatch business-event protobuf contracts #4), and emits CandidatesSelected (≥1 eligible candidate, top N by inverse-distance match score) or NoCandidatesAvailable (NoDriversInRange / NoCapableDriversInRange)
  • Adds DispatchPolicySnapshot DI record (hardcoded defaults; Slice 11 swaps for DispatchPolicyConfigured-fed projection), ICandidateSelectionOutcome marker interface (third occurrence of the pattern), and RequestRoundsProjection inline projection (consumed by Slice 9 re-dispatch)
  • First use of [WriteAggregate] bound to a non-first stream event (FareQuoted is the second event on the stream); verified against Wolverine 5.37 source — attribute is trigger-agnostic
  • Three Alba integration tests (one per W001 §5.3 GWT); 11/11 tests green
  • Retro + spec-delta amendments (narrative 002 v0.2, W001 v0.7) ship in this PR

Test plan

  • 3 new tests pass: candidates_selected_picks_top_five_ordered_by_match_score, no_drivers_in_range_emits_no_candidates_with_no_drivers_reason, accessible_request_with_only_standard_drivers_emits_no_capable_drivers_reason
  • 8 prior tests still pass (1 smoke + 3 slice 5.1 + 1 slice 5.2 happy + 3 slice 5.2 failure) — note: 2 of the 3 failure-path tests updated to expect 3 events now that automation extends the chain through FareQuoted
  • RequestRoundsProjection is declared partial (Marten 9 source-gen requirement)
  • [WriteAggregate] bound to FareQuoted.RideRequestId loads RideRequest correctly from a 2-event stream
  • Spec delta confirmed: narrative 002 ## Document History v0.2 entry + W001 ## Document History v0.7 entry

@erikshafer erikshafer self-assigned this Jun 16, 2026
@erikshafer erikshafer merged commit bda8363 into main Jun 17, 2026
1 check passed
@erikshafer erikshafer deleted the slice/5-3-candidates-selected branch June 17, 2026 00:11
erikshafer added a commit that referenced this pull request Jun 17, 2026
…and next-session candidate

Captures session close after PR #34 squash-merge (`bda8363`). Documents slice 5.3 deliverables (CandidatesSelected automation with marker-interface outcome, RequestRoundsProjection, INearbyAvailableDriversSource stub, 3 Alba tests), current repo state (11 passing tests, clean working tree), and verified knowledge (`[WriteAggregate]` on non-first stream event confirmed working, extend-chain test updates established as in-scope).

Flags skill-file debt at encoding threshold: marker-interface union return pattern and event-triggered automation shape both hit 3 instances—queue for `tidy: skills` PR before slice 5.4. Carries housekeeping items from retro 004/005. Nominates slice 5.4 (OfferSent fan-out) as next candidate with alternative to encode skills first. Notes Marten 9/Wolverine 6 migration incompleteness. Updates artifacts inventory to 11 tests across 3 slices.
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