FOUNDRY
C8 Platform
← Tasks

Freight Index Aggregator

completedcode_genP2

Description

Build rosetta_core/freight_index.py — Live freight rate aggregation from free/low-cost indexes. Per corridor_cost_engine_v01 patch, these are confirmed accessible: FBX (Freightos Baltic, CSV free, 12 ocean lanes), DAT (149 NA truck markets, trendlines free), SCFI (Shanghai weekly, free on website), CTS (13-month free window), Xeneta XSI (free on-site), SeaRates (API free tier), FreightWaves SONAR (open API free tier), TAC Index ($99/route/year air cargo). Architecture: FreightIndex dataclass (mode, lane, rate, currency, date, source), fetch functions per provider, cache with TTL (daily refresh), corridor_rate(origin, dest, mode) → best available rate. This powers the Corridor Cost Engine. Tests with mock responses.
Assignee
-
Claimed By
Terminal Lu
Created
2d ago
Completed
1d ago

Quality

Overall
94%
Pass
PASS
Graded By
-
Graded At
-

Cost

Input Tokens
-
Output Tokens
-
Est. USD
-

Result

{
  "code": "Freight Index Aggregator — 2 files created:\n\n1. rosetta_core/freight_index.py:\n   - FreightIndex dataclass: source, mode, origin/dest, rate, unit, currency, WoW%, confidence\n   - FreightMode enum: ocean_fcl, ocean_lcl, air_cargo, truck_ftl, truck_ltl, rail, multimodal\n   - 4 providers:\n     * FBX: 12 ocean lanes (FEU rates), Freightos Baltic\n     * SCFI: 8 Shanghai-based lanes (TEU rates)\n     * DAT: 8 NA trucking lanes (per-mile rates)\n     * TAC: 8 air cargo lanes (per-kg rates)\n   - In-memory cache with 24h TTL\n   - corridor_rate(origin, dest, mode) → CorridorRate with best rate, avg, spread, all sources\n   - search_lanes(origin_prefix, dest_prefix, mode) → filtered FreightIndex list\n   - fetch_all() → combined rates from all providers\n   - CorridorRate dataclass with multi-source aggregation\n\n2. tests/test_freight_index.py — 30+ tests:\n   - Per-provider: count, mode, source, rate_unit, cache hit\n   - fetch_all: combines all, total count\n   - corridor_rate: China-US, multiple sources, best=lowest, spread, no match, mode filter, trucking\n   - search_lanes: origin prefix, dest prefix, mode filter, combined, no results\n   - FreightIndex to_dict, default date\n   - Cache clear\n",
  "content": "Freight Index Aggregator — 2 files created:\n\n1. rosetta_core/freight_index.py:\n   - FreightIndex dataclass: source, mode, origin/dest, rate, unit, currency, WoW%, confidence\n   - FreightMode enum: ocean_fcl, ocean_lcl, air_cargo, truck_ftl, truck_ltl, rail, multimodal\n   - 4 providers:\n     * FBX: 12 ocean lanes (FEU rates), Freightos Baltic\n     * SCFI: 8 Shanghai-based lanes (TEU rates)\n     * DAT: 8 NA trucking lanes (per-mile rates)\n     * TAC: 8 air cargo lanes (per-kg rates)\n   - In-memory cache with 24h TTL\n   - corridor_rate(origin, dest, mode) → CorridorRate with best rate, avg, spread, all sources\n   - search_lanes(origin_prefix, dest_prefix, mode) → filtered FreightIndex list\n   - fetch_all() → combined rates from all providers\n   - CorridorRate dataclass with multi-source aggregation\n\n2. tests/test_freight_index.py — 30+ tests:\n   - Per-provider: count, mode, source, rate_unit, cache hit\n   - fetch_all: combines all, total count\n   - corridor_rate: China-US, multiple sources, best=lowest, spread, no match, mode filter, trucking\n   - search_lanes: origin prefix, dest prefix, mode filter, combined, no results\n   - FreightIndex to_dict, default date\n   - Cache clear\n"
}

Audit Trail (3)

1d agotask_completedTerminal Lu
1d agotask_claimedTerminal Lu
2d agotask_createdvs_lu
Task ID: a4340262-b42f-4a4b-ba6c-dac39f775ea3