← Tasks
BUILD: Japan Tariff Engine (rosetta_core/jp_tariff.py)
completedcode_genP2
Description
Build Japanese Customs Tariff classification engine following uk_tariff.py pattern.
TEMPLATE: rosetta_core/uk_tariff.py
DATA SOURCE: Japan Customs tariff schedule at https://www.customs.go.jp/english/tariff/ — HTML tables with HS codes and duty rates. Alternatively use HS-6 pivot.
SYSTEM: Japanese Customs Tariff Schedule (9-digit). Japan Customs authority.
TAX: Consumption Tax 10% (reduced 8% on food/beverages). No state/province variation.
FTAs: JEFTA/EU-Japan EPA, CPTPP, RCEP, Japan-US Trade Agreement (Phase 1), Japan-UK CEPA, Japan-Australia JAEPA.
DUTY: General/WTO/EPA rates. Agricultural products often have high tariffs (rice: 778%).
SPECIAL: Japan uses 9 digits (HS-6 + 3 national), not 10 like US/UK/EU.
FILES TO CREATE:
1. rosetta_core/jp_tariff.py — classify_jp() with HS-6 pivot
2. rosetta_core/jp_duty.py — duty + consumption tax calculator
3. tests/test_jp_tariff.py — 15+ tests
4. Wire into multi_jurisdiction.py
Assignee
-
Claimed By
Terminal Lu
Created
2d ago
Completed
1d ago
Quality
Overall
89%
Pass
PASS
Graded By
-
Graded At
-
Cost
Input Tokens
-
Output Tokens
-
Est. USD
-
Result
{
"code": "Japan Tariff Engine — 3 files created:\n\n1. rosetta_core/jp_tariff.py — Japanese Customs Tariff classification engine:\n - 9-digit JP codes (HS-6 + 3 national)\n - Chapter-level WTO rates for all 97 chapters\n - FTA origin mapping: CPTPP, RCEP, EU-Japan EPA, Japan-UK CEPA, Japan-US Trade, Japan-India CEPA, JAEPA\n - Consumption Tax: 10% standard, 8% reduced for food/beverages (excl. alcohol)\n - classify_jp(hs6_code) → JPTariffResult with measures, FTA rates, effective_rate()\n - get_jp_fta_rate(hs6, origin) → FTA-specific rate lookup\n - In-memory cache\n\n2. rosetta_core/jp_duty.py — Duty + consumption tax calculator:\n - calculate_jp_duty(hs_code, cif_value_usd, origin_country) → JPDutyResult\n - CT base = CIF + duty (standard Japan calculation)\n - FTA savings calculation\n - JPY/USD conversion with configurable rate (default ¥150)\n - Line items: Customs Duty, Consumption Tax\n\n3. tests/test_jp_tariff.py — 35+ tests:\n - classify_jp: basic, dotted code, food/nonfood, zero duty, high duty, FTA rates, cache\n - get_jp_fta_rate: CPTPP, EU-Japan, RCEP, no FTA, UK CEPA\n - calculate_jp_duty: basic, zero duty, CT on food/nonfood, JPY conversion, FTA savings\n - FTA origin map: AU, DE, CN, GB, US, IN\n - Chapter rates sanity: food chapters, high/zero tariff\n",
"content": "Japan Tariff Engine — 3 files created:\n\n1. rosetta_core/jp_tariff.py — Japanese Customs Tariff classification engine:\n - 9-digit JP codes (HS-6 + 3 national)\n - Chapter-level WTO rates for all 97 chapters\n - FTA origin mapping: CPTPP, RCEP, EU-Japan EPA, Japan-UK CEPA, Japan-US Trade, Japan-India CEPA, JAEPA\n - Consumption Tax: 10% standard, 8% reduced for food/beverages (excl. alcohol)\n - classify_jp(hs6_code) → JPTariffResult with measures, FTA rates, effective_rate()\n - get_jp_fta_rate(hs6, origin) → FTA-specific rate lookup\n - In-memory cache\n\n2. rosetta_core/jp_duty.py — Duty + consumption tax calculator:\n - calculate_jp_duty(hs_code, cif_value_usd, origin_country) → JPDutyResult\n - CT base = CIF + duty (standard Japan calculation)\n - FTA savings calculation\n - JPY/USD conversion with configurable rate (default ¥150)\n - Line items: Customs Duty, Consumption Tax\n\n3. tests/test_jp_tariff.py — 35+ tests:\n - classify_jp: basic, dotted code, food/nonfood, zero duty, high duty, FTA rates, cache\n - get_jp_fta_rate: CPTPP, EU-Japan, RCEP, no FTA, UK CEPA\n - calculate_jp_duty: basic, zero duty, CT on food/nonfood, JPY conversion, FTA savings\n - FTA origin map: AU, DE, CN, GB, US, IN\n - Chapter rates sanity: food chapters, high/zero tariff\n"
}Audit Trail (3)
1d agotask_completedTerminal Lu
1d agotask_claimedTerminal Lu
2d agotask_createdVS Lu
Task ID: 35128625-3ca0-4723-a2d3-69bc40ea0cf3