{
  "anchors": [],
  "capability": "ai_infrastructure.trade",
  "codebooks": {
    "commodity": {
      "codes": {
        "8542": {
          "label": "Electronic integrated circuits and microassemblies; parts thereof"
        }
      },
      "coverage": "HS-8542 at the HS4 heading",
      "note": "HS-8542 is 'Electronic integrated circuits and microassemblies; parts thereof' \u2014 ALL integrated circuits (processors, memory, amplifiers, parts). It does NOT isolate GPUs / AI accelerators.",
      "semantics": "hs_commodity_heading",
      "source": "U.S. Census Bureau Harmonized System (HS) heading, verbatim."
    },
    "country_level": {
      "codes": {
        "country": {
          "label": "An individual country of origin"
        },
        "grouping": {
          "label": "A Census country grouping / continent (overlaps \u2014 never summed)"
        },
        "total": {
          "label": "All countries (the published U.S. total)"
        }
      },
      "coverage": "every served row is exactly one level",
      "note": "total = the all-countries TOTAL (CTY_CODE '-'); grouping = a Census bloc/continent (ASIA, APEC, EU, OECD, ASEAN, the '<n>XXX' continents) that OVERLAPS other rows; country = an individual country of origin. The groupings overlap each other and the countries \u2014 never sum across rows; the served TOTAL is the only national figure.",
      "semantics": "census_intltrade_country_level",
      "source": "Derived from the Census CTY_CODE structure."
    }
  },
  "data_point": {
    "does_not_answer": [
      "AI-accelerator / GPU imports specifically \u2014 HS-8542 is ALL integrated circuits (processors, memory, amplifiers, parts); it does not isolate AI chips",
      "summing across country rows \u2014 Census's groupings (ASIA, APEC, EU, OECD, ASEAN, Pacific Rim, the continents) OVERLAP each other and the individual countries; the served \"TOTAL FOR ALL COUNTRIES\" (country_level=total) is the only valid total, never a sum the agent computes",
      "quantity, unit count, or weight of chips \u2014 HS-8542 reports no meaningful quantity at this level; the measure is customs value (USD) only",
      "landed / CIF / duty-paid cost \u2014 general imports value is customs value; CIF, charges, and calculated duty are separate Census fields not served here",
      "where a chip is consumed, installed, or which U.S. state/county/operator/facility \u2014 country is the country of ORIGIN (Census attribution), not a U.S. location; this series carries no U.S. geographic anchor",
      "exports (this block serves IMPORTS only) or trade in non-IC goods",
      "finality (recent months are preliminary and revised in later Census releases)"
    ],
    "grain": "commodity_country_monthly",
    "id": "ai_infrastructure.trade",
    "note": "This is the monthly customs value (USD) of U.S. imports of HS-8542 \u2014 ALL integrated circuits (processors, memory, amplifiers, parts), NOT AI-accelerator/GPU-specific \u2014 by country of origin. NEVER SUM across country rows: Census's groupings (ASIA, APEC, EU, OECD, ASEAN, the continents) overlap each other and the individual countries, and the all-countries TOTAL contains everything. Filter country_level=total for the U.S. national figure; the measure is customs value (USD), not quantity.",
    "product_spec": "blocks/ai_infrastructure_trade/card.md",
    "represented_fact": "Census International Trade reports the monthly customs value (USD) of U.S. IMPORTS of HS-8542 \"Electronic integrated circuits and microassemblies; parts thereof\" \u2014 ALL integrated circuits (processors, memory, amplifiers, parts), NOT AI-accelerator-specific \u2014 by country of origin and as Census's own published country GROUPINGS and TOTAL. Served as two value series exactly as Census publishes: general imports value and imports-for- consumption value. Value only \u2014 HS-8542 carries no meaningful quantity unit at this level. Each row is served verbatim + cited; the country groupings overlap and are never summed.",
    "source_basis": [
      "trade.census.intltrade_imports_hs"
    ],
    "source_decisions": [
      "docs/sources/trade/census_intltrade_hs/build-plan.md"
    ]
  },
  "input": {
    "controls": [
      "include_records",
      "include_evidence",
      "limit",
      "order_by",
      "top_n",
      "order",
      "rollup_other"
    ],
    "date_range_params": [
      "data_month_from",
      "data_month_to"
    ],
    "date_ranges": [
      "data_month"
    ],
    "field_metadata": {},
    "filters": [
      "as_of",
      "country",
      "cty_code",
      "country_level",
      "data_month",
      "data_month_from",
      "data_month_to",
      "year"
    ],
    "group_by": [
      "country",
      "cty_code",
      "country_level",
      "data_month",
      "year"
    ],
    "ranking": {
      "no_ranking": "Omit order_by and top_n to return all groups in group-key order.",
      "order": {
        "default": "desc",
        "valid_values": [
          "desc",
          "asc"
        ]
      },
      "order_by": {
        "accepts": "one of output.metrics",
        "note": "Ranks the groups by a metric (a measure). Not a group_by dimension \u2014 rows already come back grouped by each group_by field.",
        "requires": [
          "group_by"
        ],
        "valid_values": [
          "general_value_usd",
          "consumption_value_usd",
          "source_record_count"
        ]
      },
      "top_n": {
        "note": "Keeps the top N groups by order_by; the rest fold into one (other) remainder (additive metrics sum into it, non-additive ones are nulled) so the result still reconciles to summary.totals.",
        "requires": [
          "group_by",
          "order_by"
        ],
        "type": "positive integer"
      }
    }
  },
  "output": {
    "aggregate_citation_fields": [
      "source_id",
      "publisher",
      "source_url",
      "source_file",
      "raw_file_sha256",
      "as_of",
      "source_rows_count",
      "source_rows_sample",
      "verify",
      "lineage_filter"
    ],
    "citation_fields": [
      "source_id",
      "source_url",
      "source_file",
      "sheet",
      "source_row",
      "raw_file_sha256",
      "as_of"
    ],
    "detail_fields": [
      "source_id",
      "sheet_name",
      "source_record_key",
      "report_period",
      "commodity",
      "commodity_desc",
      "cty_code",
      "country",
      "country_level",
      "data_month",
      "year",
      "general_value_usd",
      "consumption_value_usd",
      "source_row_number",
      "as_of",
      "raw_file_sha256",
      "citation"
    ],
    "metric_groups": {
      "consumption_value_usd": [
        "consumption_value_usd"
      ],
      "general_value_usd": [
        "general_value_usd"
      ],
      "records": [
        "source_record_count"
      ]
    },
    "metric_metadata": {
      "consumption_value_usd": {
        "additive_across_groups": false,
        "aggregation": "sum",
        "authoritative_total_path": "summary.totals.consumption_value_usd",
        "category": "consumption_value_usd",
        "definition": "The total customs value (USD) of imports FOR CONSUMPTION of HS-8542 for the country row in scope, exactly as Census publishes it (CON_VAL_MO).",
        "description": "Census's OWN published customs value (USD) of U.S. imports of HS-8542 (all integrated circuits) for the country row in scope, served verbatim. NONADDITIVE across country rows: the groupings (ASIA, APEC, EU, OECD, ASEAN, the continents) overlap each other and the individual countries, and the all-countries TOTAL contains everything \u2014 a cross-row sum double-counts. A result spanning more than one country row without grouping by country carries a country_aggregation scope note and ranking remainders omit the metric \u2014 filter country_level=total for the national figure, country_level=country for individual countries, or group_by country for the per-country series.",
        "display_name": "Imports-for-consumption value",
        "display_precision": "Values are in USD, rounded to 6 decimal places in JSON to remove binary floating-point noise.",
        "grain": "commodity country month",
        "null_handling": "A (commodity, country, month) cell Census did not publish is absent (a country with no imports that month is simply not a row), never zero; an empty-query summary returns zero.",
        "rollup_behavior": "non_additive_measure",
        "row_metric_path": "rows[].metrics.consumption_value_usd",
        "source_fields": [
          "consumption_value_usd"
        ],
        "unit": "USD"
      },
      "general_value_usd": {
        "additive_across_groups": false,
        "aggregation": "sum",
        "authoritative_total_path": "summary.totals.general_value_usd",
        "category": "general_value_usd",
        "definition": "The total customs value (USD) of GENERAL imports of HS-8542 for the country row in scope, exactly as the U.S. Census Bureau publishes it (GEN_VAL_MO).",
        "description": "Census's OWN published customs value (USD) of U.S. imports of HS-8542 (all integrated circuits) for the country row in scope, served verbatim. NONADDITIVE across country rows: the groupings (ASIA, APEC, EU, OECD, ASEAN, the continents) overlap each other and the individual countries, and the all-countries TOTAL contains everything \u2014 a cross-row sum double-counts. A result spanning more than one country row without grouping by country carries a country_aggregation scope note and ranking remainders omit the metric \u2014 filter country_level=total for the national figure, country_level=country for individual countries, or group_by country for the per-country series.",
        "display_name": "General imports value",
        "display_precision": "Values are in USD, rounded to 6 decimal places in JSON to remove binary floating-point noise.",
        "grain": "commodity country month",
        "null_handling": "A (commodity, country, month) cell Census did not publish is absent (a country with no imports that month is simply not a row), never zero; an empty-query summary returns zero.",
        "rollup_behavior": "non_additive_measure",
        "row_metric_path": "rows[].metrics.general_value_usd",
        "source_fields": [
          "general_value_usd"
        ],
        "unit": "USD"
      },
      "source_record_count": {
        "additive_across_groups": true,
        "aggregation": "count source records",
        "authoritative_total_path": "summary.totals.source_record_count",
        "category": "records",
        "definition": "Count of normalized source records (commodity \u00d7 country \u00d7 month rows) contributing to the current result scope.",
        "description": "Number of normalized Census import rows (commodity \u00d7 country \u00d7 month) contributing to the value.",
        "display_name": "Source record count",
        "display_precision": "Integer.",
        "grain": "source row",
        "null_handling": "Always an integer count.",
        "rollup_behavior": "additive_partition_metric",
        "row_metric_path": "rows[].metrics.source_record_count",
        "source_fields": [
          "source_record_key"
        ],
        "unit": "count"
      }
    },
    "metrics": [
      "general_value_usd",
      "consumption_value_usd",
      "source_record_count"
    ],
    "summary_fields": [
      "group_count",
      "totals"
    ]
  },
  "primitive": "query_ai_infrastructure_trade_v1",
  "status": "available"
}
