Merged
Conversation
Fix 1+2 — solve_time_ms now measured via Instant::now() around the
solver call; metadata.seed echoes the submitted seed value back to
callers for auditability.
Fix 3 — Problem::validate() extended with time-window, demand sign,
coordinate range, fleet_size, vehicle.capacity and shift-window checks.
submit-problem handler calls validate() before accepting, returning
HTTP 400 with a structured error message on failure.
Fix 4 — client owner_id persisted in localStorage ('loxi_owner_id')
via useMemo so it survives tab refresh without changing.
Fix 5 — PushSolution ticket verification wired end-to-end: LogisticsArchitect
gains a verify_fn field; run_architect() accepts the closure; main.rs
passes the existing verify_ticket Arc; PushSolution handler rejects
submissions with an invalid ticket instead of silently accepting them.
Fix 6 — Multi-vehicle fleet support: FleetVehicle struct added to
types.rs with type_id, count, capacity, speed_mps, locations, shift
window and cost fields. Optional fleet field added to Problem.
to_pragmatic() builds one VehicleType per FleetVehicle entry when fleet
is present, falling back to the existing single-vehicle path. Fleet is
propagated through all sub-problem construction sites in the architect.
Fix 7 — README: replace "auction" with "dispatch" in user-facing
architecture diagram and prose; rephrase "Workers bid on tasks" to
reflect the actual scheduler behaviour.
Fix 8 — Overflow rescue partitions get a prefixed task ID
(overflow_rescue_<uuid>); final solution assembly detects them and
populates solution.violations with type="overflow_rescue" and
magnitude=stop_count so callers can surface the warning.
README — Roadmap section added (near-term / medium-term / long-term)
covering multi-fleet, reproducible solves, geocoding, webhooks, OpenAPI,
WebRTC P2P, real competitive auction and on-chain settlement.
…tecture
Group 1 — Trivial cleanup:
- Remove hardcoded 192.168.0.196 IP fallback from SDK
- Randomize RNG seed (Date.now() * Math.random()) in both loadUpload + generateProblem
- Latency-inverse bidding score: 1_000_000 / max(taskDuration, 1)
- Dynamic depot centroid from stop data instead of hardcoded Buenos Aires
- Polling timeout now emits error log after 10 minutes
- owner_id uses crypto.randomUUID() for high-entropy IDs
- process_solution returns early with eprintln on unknown auction_id
- Matrix guard: && → || so either missing matrix rejects the solve
- WS payload size limit: drop messages > 1 MiB in orchestrator
Group 2 — Focused fixes:
- format_time: Fliegel-Van Flandern proleptic Gregorian; base epoch 2025-01-01
- JWT aud claim validation: verify_fn now returns Option<(sub, aud)>; ClaimTask
and PushSolution handlers compare aud == auction_id before accepting
- Demand/capacity f64 casts: .round() as i32 + eprintln warning on fractional values
- pending_problems eviction: DashMap timestamp per problem; background task
evicts solved problems older than 2 h every 10 minutes
Group 3 — Reliability:
- revealingSolution: 3 attempts with 2s/4s/8s backoff; waits for {"ack":"ok"}
with 5 s timeout per attempt; logs CRITICAL on exhaustion
- server.rs PushSolution path sends {"ack":"ok"} after protocol_tx.send
- Sweep panicking unwrap/expect from architect event loop; use let-else / if-let
Group 4 — Architecture:
- SEARCH_DEPTH: 5 → 20
- O(1) watchdog reverse index: worker_to_auction HashMap in Scheduler; used
in drain_expired and disconnect handler (replaces O(N) DashMap scans)
- LogisticsArchitect now guarded by tokio::sync::Mutex; distribute_tasks
runs H3 partition work via spawn_blocking off the async thread
- cargo fmt: auto-format 5 files (architect/mod.rs, vrp/mod.rs, types.rs, lib.rs, loxi-orchestrator/lib.rs) - Add VerifyFn type alias in loxi-logistics lib.rs to satisfy clippy::type_complexity on the verify_fn Arc<dyn Fn> field - Use VerifyFn alias in architect/mod.rs, server.rs, bin/client.rs, loxi-cli/main.rs - Fix pre-existing noImplicitAny TS errors in App.tsx exportSolution (add explicit string/number types to forEach/map callbacks)
Scheduler tests (7 new): - affinity worker beats higher-score generic worker (tier-2 vs tier-3) - hardware fallback when no affinity match (dynamic loading path) - undersized worker queues task instead of assigning - worker_to_auction reverse index populated on schedule - reverse index cleared on release - drain_expired returns (worker_id, Some(auction_id)) pair - queued task pipes immediately to next available worker Auth tests (5 new): - sign/verify round trip (sub + aud preserved) - aud claim matches auction_id passed to sign_ticket - invalid token rejected - empty public key blocks verify - token signed with key A rejected by key B SDK (item 2): - npm install in sdk/web — tsup was in devDependencies but not installed; npm run build now produces dist/index.js, dist/index.mjs, dist/index.d.ts
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.
No description provided.