# Fictional tariff rules lab — implementation brief Build a small browser prototype with Chinese as the default and an English language switch to teach a data analyst/developer how to use Codex. All countries, goods codes, rules, rates and authority labels below are fictional training data. Do not fetch real tariffs or infer laws. The completed calculator is deterministic and uses no AI at runtime. ## Inputs and outputs Inputs: origin region A or B (origin, not shipping location), goods category Sensor or Textile, declared customs value in USD (positive, at most $1,000,000,000, two decimal places maximum), entry date in 2026, and whether a surcharge-exemption certificate has already been verified. Include unknown origin/category options and a toggle that injects a conflicting rule for demonstration. Show v1 and v2 calculations side by side, a v2-minus-v1 amount, applied and skipped rule IDs with reasons, rule-set version, and a REVIEW state with no payable amount when inputs or rules are unresolved. Format money to cents. ## Rules and resolution contract The demo covers ad valorem duty only. All rates share the declared customs value as their base. Use integer cents and integer basis points; round the combined final duty half up to cents. No fees, quotas, quantity duties or real-world classification decisions. All rules apply from 2026-01-01 through 2026-12-31 inclusive unless stated otherwise. | ID | Fictional source | Conditions | Group / action | Priority | Rate | |---|---|---|---|---:|---:| | B-S | Training Schedule §1 | Sensor, any supported origin | base / replace | 10 | 5% | | B-T | Training Schedule §2 | Textile, any supported origin | base / replace | 10 | 8% | | P-B | Training Preference §1 | Region B, Sensor | base / replace | 20 | 2% | | S-A | Training Surcharge §1 | Region A, Sensor | surcharge / add | 10 | 10% | | X-A | Training Exemption §1 | Region A, Sensor, verified certificate | exempt S-A only | 100 | — | First validate inputs, then match scope and inclusive dates. For each rate group, choose the one highest-priority matching rule. Ties are REVIEW, never break ties by order. The base group and surcharge group are separate; add their selected rates. Apply X-A only to its named surcharge target. It never removes base duty. No matched base means REVIEW. Priority numbers are an explicit teaching convention, not a legal hierarchy. v1 retains S-A at 10% throughout 2026. v2 replaces S-A with two nonoverlapping intervals: 10% through 2026-06-30 and 12% from 2026-07-01. The rule's identity stays S-A so that X-A keeps targeting it. A version label indicates a policy scenario; do not substitute version selection for entry-date matching. Conflict toggle adds C-S: Sensor / any supported origin / base / priority 10 / 7%, same full-year dates. It creates a tie with B-S for Region A. In Region B, P-B wins at priority 20, so the lower-priority tie is irrelevant. ## Acceptance examples (human-provided expected values) For $10,000 on 2026-07-01 unless stated: - A / Sensor, no certificate: v1 $1,500; v2 $1,700; delta +$200. - A / Sensor, verified certificate: $500 in both versions. - B / Sensor: $200 in both versions. - A / Textile: $800 in both versions. - A / Sensor on 2026-06-30: $1,500 in both versions. - A / Sensor on 2026-01-01: $1,500 in both versions. - A / Sensor on 2026-12-31: v2 $1,700. - Missing origin, unknown category, invalid date, dates outside 2026, missing/zero/negative value: REVIEW, no amount. - Conflict on A / Sensor: REVIEW; conflict on B / Sensor: $200. - $0.10 / A / Sensor on 2026-07-01: v1 rounds $0.015 to $0.02; v2 rounds $0.017 to $0.02. ## Deliverable A single self-contained index.html (Chinese by default; full English switch including results, reasons, errors and prompts; preserve inputs when switching) that opens directly in a browser, no dependency downloads, backend or API keys. Include presets for the main acceptance cases, readable rule definitions, and a clear “Fictional training data — not for customs filing” label. Make it usable on a laptop and phone. Report actual validation performed and limitations.