Repository navigation
TL-03: dispatch rules and tornado/freeze fixtures - #18
Merged
Merged
Conversation
Refs #3. Pure TypeScript rules in spacetimedb/src/domain/dispatch.ts (readyAt, evaluateOptions -> lane, reason, best option, sorted options). Fixtures reuse A's TL-01 IDs (tornado-1, H17, H22, BAT-01, ana, 08:00Z) and add a freeze incident with distinct IDs. Proof: npx tsx --test fixtures/*.test.ts -> 10 pass, 0 fail. R4 +17..+47 Watch; after the 20-min detour R4 -3..+27, best R4-ALT +6..+36, Act now; +15 Watch / +14 Act now; unknown, open-ended, report-time anchoring, busy driver, no compatible resource, silent. Status: fixture only. A imports evaluateOptions in TL-05 and needs route/travel tables to feed it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #3.
What: Pure TS dispatch rules in
spacetimedb/src/domain/dispatch.ts(readyAt,evaluateOptions→ lane, reason, best option, sorted options). Tornado fixture reuses TL-01 IDs (tornado-1, H17, H22, BAT-01, ana, 08:00Z) plus routes R4 / R4-ALT and the 20-min detour. Freeze fixture (freeze-1) uses distinct IDs. All data synthetic.Check:
npm install && npx tsx --test fixtures/*.test.ts→ 10 pass, 0 fail.Status: fixture only, not wired into the module. Module
tsc --noEmitstill clean.For A (TL-05): import
evaluateOptionsfrom./domain/dispatch. Needs route/travel inputs per option (driverToAssetMin, pickupMin, assetToHomeMin, setupMin, confirmedDelayMin, driverFreeAt, assetFreeAt). Times are epoch ms:Number(ts.microsSinceUnixEpoch / 1000n).For D: expected numbers on the coordinator card: R4 +17 → −3, best option +17 → +6, Watch → Act now.
🤖 Generated with Claude Code