generatePackage (lib/game/seed.ts) drew a flat 6–72 h expiry window (priority ×0.5 → 3–36 h) independent of leg distance, so some deadlines were shorter than the flight itself and could never be completed. The drawn deadline is now clamped up to:
deadline ≥ now + travelDurationMs(legKm, FASTEST_CATALOG_SPEED_KMH) + EXPIRY_BUFFER_MS (flat 1 h buffer), reusing travelDurationMs from lib/sim/movement.ts. Speed reference is the fastest catalog plane (b777 @ 920 km/h — a job must be finishable with the best available aircraft, not the starter's 510). Short legs are byte-identical to before; forced deadlineOffsetMs still skips the floor.
Tests: +5 unit in lib/game/seed.test.ts (constants pinned; 200-seed sweep over the real dataset asserting the invariant for every package; ~9000 km pair forced with priority/null across 50 seeds each proving the clamp engages; short legs pinned byte-identical to a replay of the pre-v0.54.0 draw order) and +1 e2e in e2e/expiry.spec.ts (existing create-package hook forces EDDB→KSMF ~9000 km with priority; 10 packages, every one asserted to expire ≥ travel time at max speed + buffer).
Fixed in **v0.54.0** (PR #125, merge commit `d53ad41`).
`generatePackage` (lib/game/seed.ts) drew a flat 6–72 h expiry window (priority ×0.5 → 3–36 h) independent of leg distance, so some deadlines were shorter than the flight itself and could never be completed. The drawn deadline is now clamped up to:
`deadline ≥ now + travelDurationMs(legKm, FASTEST_CATALOG_SPEED_KMH) + EXPIRY_BUFFER_MS` (flat 1 h buffer), reusing `travelDurationMs` from lib/sim/movement.ts. Speed reference is the fastest catalog plane (b777 @ 920 km/h — a job must be finishable with the best available aircraft, not the starter's 510). Short legs are byte-identical to before; forced `deadlineOffsetMs` still skips the floor.
Tests: +5 unit in lib/game/seed.test.ts (constants pinned; 200-seed sweep over the real dataset asserting the invariant for every package; ~9000 km pair forced with priority/null across 50 seeds each proving the clamp engages; short legs pinned byte-identical to a replay of the pre-v0.54.0 draw order) and +1 e2e in e2e/expiry.spec.ts (existing create-package hook forces EDDB→KSMF ~9000 km with priority; 10 packages, every one asserted to expire ≥ travel time at max speed + buffer).
Deployed: https://flight.dev.kkhost.pl (`/api/version` → 0.54.0)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixed in v0.54.0 (PR #125, merge commit
d53ad41).generatePackage(lib/game/seed.ts) drew a flat 6–72 h expiry window (priority ×0.5 → 3–36 h) independent of leg distance, so some deadlines were shorter than the flight itself and could never be completed. The drawn deadline is now clamped up to:deadline ≥ now + travelDurationMs(legKm, FASTEST_CATALOG_SPEED_KMH) + EXPIRY_BUFFER_MS(flat 1 h buffer), reusingtravelDurationMsfrom lib/sim/movement.ts. Speed reference is the fastest catalog plane (b777 @ 920 km/h — a job must be finishable with the best available aircraft, not the starter's 510). Short legs are byte-identical to before; forceddeadlineOffsetMsstill skips the floor.Tests: +5 unit in lib/game/seed.test.ts (constants pinned; 200-seed sweep over the real dataset asserting the invariant for every package; ~9000 km pair forced with priority/null across 50 seeds each proving the clamp engages; short legs pinned byte-identical to a replay of the pre-v0.54.0 draw order) and +1 e2e in e2e/expiry.spec.ts (existing create-package hook forces EDDB→KSMF ~9000 km with priority; 10 packages, every one asserted to expire ≥ travel time at max speed + buffer).
Deployed: https://flight.dev.kkhost.pl (
/api/version→ 0.54.0)