Allow cross-date route additions with exclusive ownership and scoped endpoint evidence - #478
Merged
Merged
Conversation
Manual additions preserve stored delivery dates while enforcing tenant, terminal-state, coordinate and exclusive route ownership checks. Scope lifecycle evidence to the active execution before showing endpoint times. Constraint: Toll-road policy is research only; no runtime or production changes. Rejected: Removing all grouping date checks | New planning still owns its date range. Confidence: high Scope-risk: moderate Tested: 3014 unit tests; 40 PostgreSQL integration tests including concurrent additions; lint, typecheck, build and Prisma generation. Not-tested: Production writes and deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dispatchers can manually add another delivery date or a Date Pending order to an existing route without rewriting the order date or route date. New-group planning keeps its date validation. Manual additions retain tenant, cancellation, terminal-status, coordinate and ownership checks, and concurrent claims leave exactly one route owner with a complete rollback for the losing request.
Route tracking now rejects lifecycle evidence outside the execution window or completion evidence older than the latest start, so the companion Shopify Start/End rows do not reuse an earlier execution. The included toll-road feasibility note is research only; it makes no routing or infrastructure changes.
Validation
Exact-head GitHub CI passed.
Prisma client generation, full API lint, final changed-file lint, typecheck and build passed.
API suite: 3,014 passed; 232 DB-dependent cases skipped by the ordinary runner.
Isolated PostgreSQL route-grouping suite: 40/40 passed, including cross-date/Date Pending save and reload, concurrent ownership, and late ineligibility.
Independent code review: no remaining findings.
No production deployment or order mutation performed.
The Shopify companion EVNSolution/shopify-clever#318 must be released after this server change to enable cross-date additions end to end. Operational deployment remains a separate action.