{
  "openapi": "3.1.0",
  "info": {
    "title": "Auto Investment AI API",
    "version": "0.5.2",
    "description": "Express API with Taiwan Company Intelligence, Taiwan Procurement & Supplier Signals, Taiwan Semiconductor & Supply Chain, Taiwan Entity Relationship Graph fixture endpoints, and paid-data gateway integration points for AI agents."
  },
  "servers": [
    {
      "url": "https://api.sourcestrand.com",
      "description": "Production SourceStrand paid-data gateway"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "API health status"
          }
        }
      }
    },
    "/v1/products/tw-company/lookup": {
      "get": {
        "summary": "Resolve a Taiwan company by business id, name, or alias",
        "description": "Fixture-only resolver over synthetic demo-fixture companies. Responses include data_lineage, limitations, and advice-boundary flags.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company resolution result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwCompanyLookupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-company/brief": {
      "get": {
        "summary": "Return an AI-ready Taiwan company brief",
        "description": "Returns a stable synthetic demo-fixture company brief with data_lineage, limitations, not_legal_advice, and not_financial_advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company brief with data lineage and limitations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwCompanyBriefResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-company/signals": {
      "get": {
        "summary": "Return normalized Taiwan company signals",
        "description": "Returns fixture government signals with evidence, confidence, signal_level, and none_found_in_connected_sources when this fixture index has no matching records.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Normalized company signals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwCompanySignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-company/government-signals": {
      "get": {
        "summary": "Return environment and labor public-data signals",
        "description": "Returns fixture environment and labor signals only. Government procurement remains roadmap-only in v0.5.1.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Government signals; procurement is marked as future roadmap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwCompanyGovernmentSignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/samples/tw-company-brief.json": {
      "get": {
        "summary": "Return sample Taiwan company brief JSON",
        "description": "Returns a synthetic demo-fixture sample brief for agent integration tests.",
        "responses": {
          "200": {
            "description": "Sample JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwCompanyBriefResponse"
                }
              }
            }
          }
        }
      }
    },
    "/samples/tw-company-brief.csv": {
      "get": {
        "summary": "Return sample Taiwan company brief CSV",
        "description": "Returns a synthetic demo-fixture sample CSV with UTF-8 BOM, CRLF rows, quoting, and spreadsheet formula-injection protection.",
        "responses": {
          "200": {
            "description": "Sample CSV with BOM and CRLF",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "\"business_id\",\"company_name\",\"fixture_label\",\"status\""
              }
            }
          }
        }
      }
    },
    "/samples/tw-procurement-supplier-signal.json": {
      "get": {
        "summary": "Return sample Taiwan procurement supplier signal JSON",
        "description": "Returns a synthetic fixture supplier activity pack. This is not official procurement coverage and is not procurement advice.",
        "responses": {
          "200": {
            "description": "Sample supplier activity JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementSupplierSignalsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/samples/tw-semiconductor-supply-chain.json": {
      "get": {
        "summary": "Return sample Taiwan semiconductor supply-chain signal JSON",
        "description": "Returns a synthetic fixture company pack for Taiwan Semiconductor & Supply Chain Signals. This is not investment, legal, procurement, credit, or operational advice.",
        "responses": {
          "200": {
            "description": "Sample semiconductor supply-chain JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwSemiconductorCompanyPackResponse"
                }
              }
            }
          }
        }
      }
    },
    "/samples/tw-entity-relationship-graph.json": {
      "get": {
        "summary": "Return sample Taiwan entity relationship graph JSON",
        "description": "Returns a synthetic fixture relationship pack connecting company nodes, privacy-safe person signals, and procurement network context. This is not legal, investment, procurement, credit, or vendor-selection advice.",
        "responses": {
          "200": {
            "description": "Sample entity relationship graph JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwEntityRelationshipGraphResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-semiconductor/company-pack": {
      "get": {
        "summary": "Return a Taiwan semiconductor company supply-chain pack",
        "description": "Local fixture contract for a Taiwan semiconductor company pack keyed by business_id. Responses include supply-chain roles, role evidence, trade exposure context, infrastructure context, data lineage, limitations, and advice-boundary flags.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Semiconductor company pack response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwSemiconductorCompanyPackResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-semiconductor/supply-chain-map": {
      "get": {
        "summary": "Search Taiwan semiconductor supply-chain fixture rows",
        "description": "Local fixture contract for searching semiconductor company names, aliases, science parks, segments, source stream refs, and supply-chain role labels. Responses are factual research summaries only.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "foundry": {
                "value": "foundry"
              },
              "park": {
                "value": "Southern Taiwan Science Park"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Semiconductor supply-chain map response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwSemiconductorSupplyChainMapResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-entity-graph/relationship-pack": {
      "get": {
        "summary": "Return a Taiwan entity relationship graph pack",
        "description": "Local fixture contract for a Taiwan company relationship graph keyed by business_id. Responses include graph nodes, relationship edges, procurement links, privacy-safe person signals, evidence, data lineage, limitations, and advice-boundary flags.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "55990001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity relationship graph response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwEntityRelationshipGraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-entity-graph/company-network": {
      "get": {
        "summary": "Return company-to-company relationship signals",
        "description": "Local fixture view focused on company relationship edges such as branch-style, subsidiary-style, industry-context, and privacy-safe shared-person signals. Raw person names are not returned.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "55990001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company network graph response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwEntityRelationshipGraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-entity-graph/procurement-network": {
      "get": {
        "summary": "Return procurement-linked relationship signals",
        "description": "Local fixture view focused on award and agency links connected to one Taiwan business_id. Outputs are factual graph context only and not procurement advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "55990001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Procurement network graph response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwEntityRelationshipGraphResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-company/brief": {
      "get": {
        "summary": "Paid Taiwan company brief by business id",
        "description": "x402-protected Cloudflare Worker endpoint for company enrichment after a Taiwan business_id is known. Responses include company context, generated_at, valid_until, source_hash, data_lineage, limitations, and metadata.source_model=taiwan_company_intelligence_snapshot_v1 for agent trust and caching. Informational context only; not legal, financial, credit, tax, investment, or procurement advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "24888323"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid company brief with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-semiconductor/company-pack": {
      "get": {
        "summary": "Paid Taiwan semiconductor company pack by business id",
        "description": "x402-protected Cloudflare Worker endpoint for deeper Taiwan semiconductor company context after a business_id is known. Responses include supply-chain roles, match basis, confidence, generated_at, valid_until, source_hash, data_lineage, limitations, and metadata.source_model=taiwan_semiconductor_company_pack_v1. Not supplier ranking, investment, legal, procurement, or credit advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "55990001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid semiconductor company pack with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-entity-graph/relationship-pack": {
      "get": {
        "summary": "Paid Taiwan entity relationship graph by business id",
        "description": "x402-protected Cloudflare Worker endpoint for relationship graph context after a business_id is known. Responses include company nodes, edges, procurement links, privacy-safe person-reference signals, generated_at, valid_until, source_hash, data_lineage, limitations, and metadata.source_model=taiwan_entity_relationship_graph_v1. Not beneficial-ownership certification, legal advice, procurement advice, or credit decisioning.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "demo": {
                "value": "55990001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid entity relationship graph with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tw-data-catalog": {
      "get": {
        "summary": "Human-readable Taiwan data coverage catalog",
        "description": "Free Cloudflare Worker discovery page for Taiwan product readiness, coverage, limitations, sample links, preview links, resolver handoff, and checkout entrypoints. This page is additive and does not change paid endpoint contracts.",
        "responses": {
          "200": {
            "description": "HTML catalog page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/tw-resolver": {
      "get": {
        "summary": "Human-readable Taiwan company resolver",
        "description": "Free Cloudflare Worker resolver page that maps company names, aliases, or business IDs to available Taiwan data products before x402 purchase. Resolver output is routing metadata only.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "alias": {
                "value": "Aurora AI"
              },
              "semiconductor": {
                "value": "23300001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "HTML resolver page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/data-products/tw-products-status.json": {
      "get": {
        "summary": "Return Taiwan data product readiness metadata",
        "description": "Free machine-readable status document for Taiwan data products. This additive discovery endpoint reports product readiness, endpoint templates, source groups, freshness contracts, limitations, and safety boundaries without changing paid routes.",
        "responses": {
          "200": {
            "description": "Taiwan products status metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProductsStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-resolver/resolve": {
      "get": {
        "summary": "Resolve a Taiwan company query across available data products",
        "description": "Free cross-product resolver over connected local fixture/snapshot contracts. It maps a business_id, company name, alias, supplier name, or semiconductor company label to business_id candidates and available product endpoints. It is routing metadata only, not legal, financial, procurement, credit, or supplier-ranking advice.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "alias": {
                "value": "Aurora AI"
              },
              "semiconductor": {
                "value": "23300001"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cross-product resolver candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwUnifiedResolverResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-semiconductor/supplier-search": {
      "get": {
        "summary": "Preview Taiwan semiconductor supplier search by keyword",
        "description": "Free buyer-validation endpoint on the Cloudflare Worker. Searches Taiwan semiconductor supplier candidates by role, segment, science park, city, company name, or keyword before a business_id is known. Responses include paid_unlock metadata and remain factual research summaries without ranking suppliers.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "foundry": {
                "value": "foundry"
              },
              "equipment": {
                "value": "equipment"
              },
              "sciencePark": {
                "value": "Hsinchu Science Park"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quota-free preview response with candidate companies, buyer_path, paid_unlock metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-semiconductor/supplier-shortlist": {
      "get": {
        "summary": "Preview Taiwan semiconductor supplier shortlist by role",
        "description": "Free buyer-validation endpoint on the Cloudflare Worker. Returns a limited shortlist for a supplier role such as foundry, fabless, OSAT, equipment, wafer materials, or science park context before a business_id is known.",
        "parameters": [
          {
            "name": "role",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "foundry": {
                "value": "foundry"
              },
              "osat": {
                "value": "osat"
              },
              "waferMaterials": {
                "value": "wafer materials"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Role-first preview response with candidate companies, buyer_path, paid_unlock metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-semiconductor/supplier-search": {
      "get": {
        "summary": "Paid Taiwan semiconductor supplier search by keyword",
        "description": "x402-protected Cloudflare Worker endpoint. Returns all matched supplier candidates for a keyword, role, segment, science park, city, or company name before a business_id is known. Candidate business_ids can be used with the company-pack endpoint for deeper context. Outputs include metadata.source_model=taiwan_semiconductor_supplier_search_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Factual public-record-shaped research only; not supplier ranking or procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "foundry": {
                "value": "foundry"
              },
              "equipment": {
                "value": "equipment"
              },
              "sciencePark": {
                "value": "Hsinchu Science Park"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid supplier search response with candidates, role buckets, coverage summary, metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-semiconductor/supplier-shortlist": {
      "get": {
        "summary": "Paid Taiwan semiconductor supplier shortlist by role",
        "description": "x402-protected Cloudflare Worker endpoint. Returns all matched supplier candidates for a role-first Taiwan semiconductor shortlist before a business_id is known. Outputs include metadata.source_model=taiwan_semiconductor_supplier_search_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Factual research summaries only; not supplier, investment, legal, procurement, or credit advice.",
        "parameters": [
          {
            "name": "role",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "foundry": {
                "value": "foundry"
              },
              "osat": {
                "value": "osat"
              },
              "waferMaterials": {
                "value": "wafer materials"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid supplier shortlist response with candidates, role buckets, coverage summary, metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-procurement/company-activity": {
      "get": {
        "summary": "Return Taiwan procurement supplier activity by business id",
        "description": "Local fixture contract for supplier activity signals linked by Taiwan business_id. The live paid Edge gateway uses the same buyer-facing product boundary with official-source procurement rows where loaded. Responses summarize public-record-shaped data only and do not provide procurement, legal, investment, or credit advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Supplier activity response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementSupplierSignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-procurement/tender-search": {
      "get": {
        "summary": "Search Taiwan procurement tender and award fixtures",
        "description": "Local fixture contract for keyword search over procurement notices and awards. This route does not call external networks; the live paid Edge gateway endpoint searches currently loaded official-source procurement rows.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Procurement search response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementTenderSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/tw-procurement/supplier-pack": {
      "get": {
        "summary": "Return Taiwan procurement supplier activity pack",
        "description": "Local fixture contract for a supplier pack with supplier profile, notices, awards, activity summary, lineage, limitations, and advice-boundary flags. The live paid Edge gateway exposes the official-source version at /v1/paid/tw-procurement/supplier-pack.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Supplier activity pack",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementSupplierSignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/ai-offer.json": {
      "get": {
        "summary": "Machine-readable Taiwan procurement paid-data offer",
        "description": "Cloudflare Worker discovery endpoint for AI assistants and marketplaces. Returns product positioning, coverage, source trust, free preview URL, paid endpoints, x402 purchase behavior, purchase rationale, and advice boundaries.",
        "responses": {
          "200": {
            "description": "Machine-readable buyer offer for Taiwan Procurement & Supplier Signals.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/agent-tools.json": {
      "get": {
        "summary": "Agent tool catalog for preview-first paid-data integration",
        "description": "Machine-readable SourceStrand tool catalog for AI assistants. Lists route-intent, free preview endpoints, paid x402 endpoint templates, input schemas, cache/freshness fields, and advice boundaries so agents can preview before paying.",
        "responses": {
          "200": {
            "description": "Agent tool catalog with free previews and paid endpoint templates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/assistant-compatibility.json": {
      "get": {
        "summary": "Assistant-specific integration compatibility manifest",
        "description": "Machine-readable setup guide for the five common AI assistant surfaces this gateway targets: ChatGPT, Google Gemini, Perplexity, Claude, and Microsoft Copilot. Returns assistant_profiles, function_call_tools, preview-first payment safety rules, OpenAPI URLs, and MCP readiness notes.",
        "responses": {
          "200": {
            "description": "Compatibility manifest with assistant profiles and function-call tool declarations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/openapi.copilot.json": {
      "get": {
        "summary": "Copilot-friendly OpenAPI 2.0 connector schema",
        "description": "Compact Swagger/OpenAPI 2.0 subset for Microsoft Copilot Studio and Power Platform custom connectors. Focuses on free previews, route-intent, and payment-intent handoff rather than direct x402 signing.",
        "responses": {
          "200": {
            "description": "OpenAPI 2.0 document suitable for Microsoft custom connector import.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent/route-intent": {
      "get": {
        "summary": "Route a buyer question to the best first preview and paid endpoint",
        "description": "Free AI-agent routing endpoint. Accepts a natural-language buyer question and returns ranked preview-first routes, paid endpoint templates, required fields to inspect before paying, and x402 handoff guidance.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 240
            },
            "examples": {
              "semiconductor": {
                "value": "Taiwan semiconductor supplier packaging"
              },
              "trade": {
                "value": "HS 8542 Taiwan export demand"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked route plan for preview-first agent data access.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payment/intent": {
      "get": {
        "summary": "Create x402 payment-intent handoff for a paid resource",
        "description": "Free safety handoff endpoint for AI assistants and browsers. Accepts a selected paid resource URL and returns approval_url, payment_intent_url, budget_check, retry_contract, smoke_client_command, and x402 accepts. Agents without explicit buyer payment authority should return approval_url to the human buyer instead of paying automatically.",
        "parameters": [
          {
            "name": "resource_url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "flow_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Payment intent with human approval and agent handoff.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-company/dossier": {
      "get": {
        "summary": "Preview cross-product Taiwan company dossier routing",
        "description": "Free preview endpoint showing how an AI assistant can stitch company brief, procurement activity, entity graph, semiconductor company context, trade, compliance, and factory operational context after resolving a business_id or company name. Routing preview only; does not fetch paid sections.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160
            },
            "examples": {
              "businessId": {
                "value": "24888323"
              },
              "name": {
                "value": "Aurora AI"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dossier route plan with join keys and paid section templates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/changes/tw-data-packs": {
      "get": {
        "summary": "Preview Taiwan data-pack change-feed contract",
        "description": "Free preview endpoint for repeat-refresh and watchlist workflows. Returns diffable fields, fixture-safe sample changes, cache policy, and paid pack follow-up for a Taiwan data-pack slug.",
        "parameters": [
          {
            "name": "pack",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "supplier-discovery",
                "trade-import-export",
                "regulated-supplier-compliance",
                "export-control-screening",
                "factory-operational-risk",
                "public-company-signals",
                "compliance-risk"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Change-feed preview contract and sample changes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/watchlist/tw-data-products": {
      "get": {
        "summary": "Preview Taiwan data watchlist routing",
        "description": "Free preview endpoint that turns a company or sector query into suggested watch keys, repeat-refresh checks, and paid follow-ups for retention-oriented agent workflows.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Watchlist preview with route seed and follow-up endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/asset-signal": {
      "get": {
        "summary": "Paid crypto asset signal by symbol",
        "description": "x402-protected Cloudflare Worker endpoint and primary Crypto Agent Signal Pack entrypoint. Function-calling agents can call it with asset=BTC, ETH, SOL, SUI, or ADA to receive freshness-aware market context, multi-window trend fields, lineage, limitations, source_hash, and metadata.source_model / metadata.last_updated_at. Informational context only; not trading, investment, tax, legal, or accounting advice.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(BTC|ETH|SOL|SUI|ADA)$"
            },
            "examples": {
              "btc": {
                "value": "BTC"
              },
              "eth": {
                "value": "ETH"
              },
              "sol": {
                "value": "SOL"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid crypto asset signal with metadata.source_model=crypto_asset_signal_v1, metadata.last_updated_at, generated_at, valid_until, source_hash, data_lineage, limitations, and not_financial_advice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/dirty-work-pack": {
      "get": {
        "summary": "Paid crypto dirty-work pack by symbol",
        "description": "x402-protected endpoint for AI-agent preflight. Resolves mainstream crypto asset identity, freshness, answerability, evidence availability, and declared data gaps before downstream drafting. Responses include metadata.source_model=crypto_dirty_work_pack_v1, metadata.last_updated_at, source_hash, lineage, limitations, and not_financial_advice.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(BTC|ETH|SOL|SUI|ADA)$"
            },
            "examples": {
              "btc": {
                "value": "BTC"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid dirty-work pack with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/token-risk-snapshot": {
      "get": {
        "summary": "Paid crypto token risk snapshot by chain and address",
        "description": "x402-protected endpoint for token-level crypto context when an agent has a chain and contract address. Responses include freshness-aware signal context, generated_at, valid_until, source_hash, data_lineage, limitations, metadata.source_model=crypto_asset_signal_v1, and metadata.last_updated_at. Informational context only; not trading, investment, legal, tax, or accounting advice.",
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 40
            },
            "examples": {
              "base": {
                "value": "base"
              }
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[a-fA-F0-9]{40}$"
            },
            "examples": {
              "demo": {
                "value": "0x1111111111111111111111111111111111111111"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid token snapshot with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/agent-effort-metrics": {
      "get": {
        "summary": "Paid crypto agent effort metrics by symbol",
        "description": "x402-protected endpoint returning a precomputed scorecard for answerability, missing-data burden, review priority, x402 fit, and agent effort saved. Useful for AI agents deciding whether a crypto context request is answerable. Responses include metadata.source_model=crypto_agent_effort_metrics_v1, output_hash, source_hash, lineage, and limitations; not trading advice.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(BTC|ETH|SOL|SUI|ADA)$"
            },
            "examples": {
              "btc": {
                "value": "BTC"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid scorecard with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/quant-research-bundle": {
      "get": {
        "summary": "Paid crypto quant research bundle by symbol",
        "description": "x402-protected single-payment bundle returning the asset signal, materialized data-quality and answerability checks, and agent-effort metrics. The current records are fixture-backed integration context, not live market data or trading advice.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(BTC|ETH|SOL|SUI|ADA)$"
            },
            "examples": {
              "btc": {
                "value": "BTC"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Three-layer paid research bundle with provenance and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/workbench-pack": {
      "get": {
        "summary": "Paid crypto workbench pack",
        "description": "x402-protected endpoint for precomputed cross-asset workbench packs. Use pack=asset-coverage-readiness, market-regime-digest, or liquidity-volatility-watchlist. Responses include metadata.source_model=crypto_workbench_pack_v1, metadata.last_updated_at, source_hash, output_hash, lineage, limitations, and not_financial_advice.",
        "parameters": [
          {
            "name": "pack",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "asset-coverage-readiness",
                "market-regime-digest",
                "liquidity-volatility-watchlist"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid workbench pack with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/workbench/asset-coverage-readiness": {
      "get": {
        "summary": "Paid crypto asset coverage readiness workbench",
        "description": "Direct x402 resource for the Asset Coverage Readiness workbench stream. Returns the same agent trust metadata contract as /v1/paid/crypto/workbench-pack with metadata.source_model=crypto_workbench_pack_v1.",
        "responses": {
          "200": {
            "description": "Paid workbench stream with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/workbench/market-regime-digest": {
      "get": {
        "summary": "Paid crypto market regime digest workbench",
        "description": "Direct x402 resource for the Market Regime Digest workbench stream. Includes metadata.source_model, metadata.last_updated_at, source_hash, output_hash, lineage, limitations, and not_financial_advice.",
        "responses": {
          "200": {
            "description": "Paid workbench stream with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/workbench/liquidity-volatility-watchlist": {
      "get": {
        "summary": "Paid crypto liquidity volatility watchlist workbench",
        "description": "Direct x402 resource for the Liquidity Volatility Watchlist workbench stream. Includes metadata.source_model, metadata.last_updated_at, source_hash, output_hash, lineage, limitations, and not_financial_advice.",
        "responses": {
          "200": {
            "description": "Paid workbench stream with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/crypto/x402-ecosystem-brief": {
      "get": {
        "summary": "Paid crypto x402 ecosystem brief",
        "description": "x402-protected endpoint returning compact x402 resource mix, network, price, and stablecoin payment context for AI agents. Responses include metadata.source_model=crypto_x402_ecosystem_brief_v1, metadata.last_updated_at, source_hash, lineage, limitations, and not_financial_advice.",
        "responses": {
          "200": {
            "description": "Paid x402 ecosystem brief with agent trust metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-data-packs/{pack}": {
      "get": {
        "summary": "Preview a Taiwan record-backed buyer data pack",
        "description": "Free preview endpoint for AI assistants. Returns limited stream contracts, fixture-safe sample rows, concrete_sample_records, agent_specific_contracts, entity_linking_contract, change_feed_preview, freshness_policy, agent_cache, data_lineage, limitations, and paid_unlock metadata before x402 payment.",
        "parameters": [
          {
            "name": "pack",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "supplier-discovery",
                "trade-import-export",
                "regulated-supplier-compliance",
                "export-control-screening",
                "factory-operational-risk",
                "public-company-signals",
                "compliance-risk"
              ]
            }
          },
          {
            "name": "buyer_hint",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Free preview buyer pack with agent trust metadata, sample rows, cache policy, lineage, limitations, and paid unlock.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/supplier-discovery": {
      "get": {
        "summary": "Paid Taiwan supplier discovery record-backed buyer pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks the full Taiwan Supplier Discovery Pack with stream contracts, sample record shapes, English buyer fields, source lineage, limitations, source_hash, and metadata.source_model=taiwan_record_backed_buyer_pack_v1. Designed as a buyer workflow router before supplier lead, company enrichment, or semiconductor calls; not supplier ranking or procurement advice.",
        "responses": {
          "200": {
            "description": "Paid record-backed buyer pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/trade-import-export": {
      "get": {
        "summary": "Paid Taiwan trade import/export buyer pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks a Taiwan Trade Import/Export Buyer Pack with importer/exporter registry, customs monthly, HS-country trade, factory, and public-company stream contracts. Responses include metadata.source_model=taiwan_record_backed_buyer_pack_v1, metadata.last_updated_at, source_hash, data_lineage, limitations, and buyer workflow routing. Not customs, trade compliance, tax, procurement, or investment advice.",
        "responses": {
          "200": {
            "description": "Paid trade buyer pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/regulated-supplier-compliance": {
      "get": {
        "summary": "Paid Taiwan regulated supplier compliance pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks food business, medical-device vendor, imported food nonconformity, product-safety nonconformity, factory, labor, and environment stream contracts for regulated supplier preflight. Responses include metadata.source_model=taiwan_record_backed_buyer_pack_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Public-record context only; not legal clearance, certification, vendor acceptance decisioning, or compliance advice.",
        "responses": {
          "200": {
            "description": "Paid regulated supplier pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/export-control-screening": {
      "get": {
        "summary": "Paid Taiwan export-control screening pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks SHTC export-control entity notices, importer/exporter context, product-safety, public-company, labor, and environment stream contracts for public-record counterparty screening. Responses include metadata.source_model=taiwan_record_backed_buyer_pack_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Not sanctions advice, customs advice, legal advice, compliance clearance, or a permitted-trade determination.",
        "responses": {
          "200": {
            "description": "Paid export-control screening pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/factory-operational-risk": {
      "get": {
        "summary": "Paid Taiwan factory operational risk pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks factory registry, power-grid margin, drought stress, air-quality exposure, environmental site flags, labor events, and importer/exporter stream contracts for supplier site context. Responses include metadata.source_model=taiwan_record_backed_buyer_pack_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Public context only; not facility uptime guarantee, production certification, site audit, insurance risk score, or safety clearance.",
        "responses": {
          "200": {
            "description": "Paid factory operational context pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/public-company-signals": {
      "get": {
        "summary": "Paid Taiwan public company signals pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks listed-company profile, monthly revenue, ESG, patent IPC trends, risk-policy translation, trade, and environment stream contracts for AI research enrichment. Responses include metadata.source_model=taiwan_record_backed_buyer_pack_v1, metadata.last_updated_at, source_hash, data_lineage, limitations, and not_financial_advice boundaries. Informational data only; not financial advice, valuation output, allocation guidance, ESG score, credit score, or trading advice.",
        "responses": {
          "200": {
            "description": "Paid public-company signals pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-data-packs/compliance-risk": {
      "get": {
        "summary": "Paid Taiwan compliance and public-risk record-backed buyer pack",
        "description": "x402-protected Cloudflare Worker endpoint. Unlocks the full compliance and public-risk buyer pack with official-source stream contracts, sample record shapes, English buyer fields, lineage, limitations, source_hash, and metadata.source_model=taiwan_record_backed_buyer_pack_v1. Informational packaging only; not legal, compliance, credit, procurement, or risk-clearance advice.",
        "responses": {
          "200": {
            "description": "Paid record-backed buyer pack with agent trust metadata, record_backed_pack, stream_readiness, sample_records, data_lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaidAgentDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-procurement/tender-search": {
      "get": {
        "summary": "Paid Taiwan procurement tender and award search",
        "description": "x402-protected Cloudflare Worker endpoint. Searches currently loaded official-source Taiwan procurement notices and awards by keyword, case number, agency, supplier name, or case name. Outputs include metadata.source_model=taiwan_procurement_tender_search_v1, metadata.last_updated_at, source_hash, data_lineage, and limitations. Factual supplier activity summaries only; not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "caseNo": {
                "value": "110A-134"
              },
              "keyword": {
                "value": "IT services"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid search response with product metadata, agent trust metadata, result records, lineage, limitations, and advice-boundary flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementTenderSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-procurement/agent-research": {
      "get": {
        "summary": "Paid agent-ready Taiwan procurement research package",
        "description": "x402-protected Cloudflare Worker endpoint. Converts one procurement keyword into an agent_summary, supplier_candidates, sample_records, paid_unlock metadata, marketplace metadata, lineage, and limitations for agent and marketplace workflows. Responses include metadata.source_model=taiwan_supplier_lead_pack_by_keyword_v1 and metadata.last_updated_at for Function Calling clients. Outputs are factual public-record discovery only and not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "keyword": {
                "value": "IT services"
              },
              "caseNo": {
                "value": "110A-134"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid agent research package with summary, supplier candidates, sample records, product metadata, agent trust metadata, lineage, limitations, and advice-boundary flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementAgentResearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-procurement/supplier-lead-pack": {
      "get": {
        "summary": "Paid Taiwan supplier lead pack by keyword",
        "description": "x402-protected Cloudflare Worker endpoint. Converts one procurement keyword into a supplier lead pack with agent_summary, supplier_candidates, sample_records, paid_unlock metadata, marketplace metadata, lineage, and limitations for agent and marketplace workflows. Responses include metadata.source_model=taiwan_supplier_lead_pack_by_keyword_v1 and metadata.last_updated_at for Function Calling clients. Outputs are factual public-record discovery only and not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "keyword": {
                "value": "IT services"
              },
              "caseNo": {
                "value": "110A-134"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid supplier lead pack with summary, supplier candidates, sample records, product metadata, agent trust metadata, lineage, limitations, and advice-boundary flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementAgentResearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-procurement/tender-search": {
      "get": {
        "summary": "Preview Taiwan procurement tender and award search",
        "description": "Free buyer-validation preview endpoint on the Cloudflare Worker. Returns a limited official-source preview plus paid_unlock metadata for the x402 tender search endpoint. Responses are factual supplier activity data only and not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "caseNo": {
                "value": "110A-134"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Limited preview response with paid_unlock endpoint metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-procurement/agent-research": {
      "get": {
        "summary": "Preview agent-ready Taiwan procurement research package",
        "description": "Free buyer-validation test endpoint on the Cloudflare Worker. Converts one procurement keyword into an agent_summary, supplier_candidates, sample_records, paid_unlock metadata, and marketplace_test_metadata. This is factual public-record discovery only and not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "keyword": {
                "value": "IT services"
              },
              "caseNo": {
                "value": "110A-134"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent-ready preview response with buyer-facing summary, supplier candidates, sample records, paid unlock metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementAgentResearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-procurement/supplier-lead-pack": {
      "get": {
        "summary": "Preview Taiwan supplier lead pack by keyword",
        "description": "Free buyer-validation endpoint on the Cloudflare Worker. Converts one procurement keyword into an agent_summary, supplier_candidates, sample_records, paid_unlock metadata, and marketplace_test_metadata. This is factual public-record discovery only and not procurement advice.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            },
            "examples": {
              "keyword": {
                "value": "IT services"
              },
              "caseNo": {
                "value": "110A-134"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Supplier lead preview response with buyer-facing summary, supplier candidates, sample records, paid unlock metadata, lineage, and limitations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementAgentResearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/preview/tw-procurement/company-activity": {
      "get": {
        "summary": "Preview Taiwan procurement company activity",
        "description": "Free buyer-validation preview endpoint on the Cloudflare Worker. Returns a limited company-level supplier activity preview plus paid_unlock metadata for the x402 company activity endpoint.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "company": {
                "value": "24888323"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Limited supplier activity preview with paid_unlock endpoint metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-procurement/company-activity": {
      "get": {
        "summary": "Paid Taiwan procurement supplier activity by business id",
        "description": "x402-protected Cloudflare Worker endpoint. Resolves a Taiwan Company Intelligence business_id into supplier-name candidates where needed, then summarizes matching official-source procurement activity. This is not procurement, legal, investment, or credit advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "company": {
                "value": "24888323"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid company activity response with supplier resolution, activity summary, lineage, limitations, and advice-boundary flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementSupplierSignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/paid/tw-procurement/supplier-pack": {
      "get": {
        "summary": "Paid Taiwan procurement supplier pack",
        "description": "x402-protected Cloudflare Worker endpoint. Returns a richer buyer-ready supplier activity pack with activity summary, related notices, awards, supplier signals, lineage, limitations, and search hints. This is factual data only, not supplier ranking or procurement advice.",
        "parameters": [
          {
            "name": "business_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{8}$"
            },
            "examples": {
              "company": {
                "value": "24888323"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paid supplier pack response with product metadata, supplier profile, pack details, lineage, limitations, and advice-boundary flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementSupplierSignalsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "x402 payment required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/admin/api/tw-company/data-sources": {
      "get": {
        "summary": "Return Taiwan company ingestion source health",
        "description": "Admin-only endpoint listing official-source registry metadata and scaffold health. Production source fetching is disabled by default.",
        "security": [
          {
            "adminToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Data source registry and health status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwDataSourcesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/admin/api/tw-procurement/data-sources": {
      "get": {
        "summary": "Return Taiwan procurement ingestion source health",
        "description": "Admin-only endpoint listing official-source registry metadata and scaffold health for the Express ingestion surface. Production source fetching remains guarded by explicit runner flags; paid procurement reads are exposed separately by the Cloudflare Worker gateway.",
        "security": [
          {
            "adminToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Procurement source registry and health status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwProcurementDataSourcesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/admin/api/growth/usage": {
      "get": {
        "summary": "Return paid data gateway usage funnel metrics",
        "description": "Admin-only endpoint summarizing paid endpoint contacts, payment-required responses, successful reads, payment events, top requested business IDs, and data build progress. It never returns service role keys, Authorization headers, private keys, or full payment signatures.",
        "security": [
          {
            "adminToken": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 5000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Growth usage funnel summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrowthUsageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Stable error response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "adminToken": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {},
          "agent_error": {
            "type": "object",
            "additionalProperties": true,
            "description": "Machine-actionable next-step hints for AI assistants, including retryable, required_input, example_valid_request, and next endpoint guidance."
          }
        }
      },
      "AgentTrustMetadata": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "schema_version",
          "product_id",
          "source_model",
          "source_system",
          "source_dataset",
          "last_updated_at",
          "provenance_fields"
        ],
        "properties": {
          "schema_version": {
            "const": "sourcestrand-agent-trust-metadata-v1"
          },
          "product_id": {
            "type": "string"
          },
          "source_model": {
            "type": "string",
            "description": "Stable SourceStrand data model identifier for Function Calling and agent routing, for example crypto_asset_signal_v1 or taiwan_supplier_lead_pack_by_keyword_v1."
          },
          "source_system": {
            "type": "string",
            "description": "SourceStrand pipeline or catalog that generated the response."
          },
          "source_dataset": {
            "type": "string"
          },
          "last_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Agent-readable freshness anchor. Mirrors generated_at for snapshot products or retrieved_at for query products."
          },
          "generated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retrieved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "source_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "output_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "cache_ttl_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "stale_after_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "safe_to_cache": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "freshness": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "provenance_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields an agent should preserve when quoting or storing the paid response."
          },
          "data_lineage_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "limitation_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "trust_note": {
            "type": "string"
          }
        }
      },
      "PaidAgentDataResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "metadata",
          "source_hash",
          "data_lineage",
          "limitations"
        ],
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "source_hash": {
            "type": [
              "string",
              "null"
            ]
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_financial_advice": {
            "type": "boolean"
          },
          "not_legal_advice": {
            "type": "boolean"
          },
          "not_procurement_advice": {
            "type": "boolean"
          }
        }
      },
      "TwProductsStatusResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "schema_version",
          "generated_at",
          "product_family",
          "architecture_boundary",
          "safety_boundaries",
          "summary",
          "products",
          "open_data_streams"
        ],
        "properties": {
          "schema_version": {
            "const": "tw-products-status-v1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "product_family": {
            "const": "Taiwan Company & Government Signals"
          },
          "architecture_boundary": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "additive_only",
              "existing_paid_routes_unchanged",
              "payment_flow_changed",
              "ingestion_flow_changed"
            ],
            "properties": {
              "additive_only": {
                "const": true
              },
              "existing_paid_routes_unchanged": {
                "const": true
              },
              "payment_flow_changed": {
                "const": false
              },
              "ingestion_flow_changed": {
                "const": false
              }
            }
          },
          "safety_boundaries": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "not_legal_advice",
              "not_financial_advice",
              "not_procurement_advice",
              "not_credit_rating"
            ],
            "properties": {
              "not_legal_advice": {
                "const": true
              },
              "not_financial_advice": {
                "const": true
              },
              "not_procurement_advice": {
                "const": true
              },
              "not_credit_rating": {
                "const": true
              }
            }
          },
          "summary": {
            "type": "object",
            "additionalProperties": true
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "open_data_streams": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "TwUnifiedResolverResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "schema_version",
          "generated_at",
          "query",
          "resolution_status",
          "candidate_count",
          "candidates",
          "limitations",
          "not_legal_advice",
          "not_financial_advice",
          "not_procurement_advice",
          "not_credit_rating"
        ],
        "properties": {
          "product": {
            "const": "tw_unified_company_resolver"
          },
          "schema_version": {
            "const": "tw-unified-resolver-v1"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "query"
            ],
            "properties": {
              "query": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              }
            }
          },
          "resolution_status": {
            "enum": [
              "exact",
              "candidate",
              "ambiguous",
              "not_found"
            ]
          },
          "candidate_count": {
            "type": "integer",
            "minimum": 0
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          },
          "not_credit_rating": {
            "const": true
          }
        }
      },
      "GrowthUsageResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "generated_at",
          "window",
          "totals",
          "funnel",
          "top_business_ids",
          "traffic_sources",
          "payment_diagnostics",
          "data_inventory",
          "dataset_health",
          "ingestion_progress"
        ],
        "properties": {
          "product": {
            "const": "paid_data_gateway_growth"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "window": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "days": {
                "type": "integer"
              },
              "since": {
                "type": "string",
                "format": "date-time"
              },
              "row_limit": {
                "type": "integer"
              },
              "timezone": {
                "type": "string",
                "example": "Asia/Taipei"
              },
              "utc_offset": {
                "type": "string",
                "example": "+08:00"
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "paid_endpoint_events_in_window": {
                "type": "integer"
              },
              "unpaid_402_events": {
                "type": "integer"
              },
              "successful_200_events": {
                "type": "integer"
              },
              "payment_events": {
                "type": "integer"
              },
              "unique_business_ids": {
                "type": "integer"
              },
              "read_conversion_rate": {
                "type": "number"
              },
              "payment_conversion_rate": {
                "type": "number"
              }
            }
          },
          "traffic_sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "source": {
                  "type": "string",
                  "enum": [
                    "internal_test",
                    "external_identified",
                    "unknown"
                  ]
                },
                "events": {
                  "type": "integer"
                },
                "unpaid_402_events": {
                  "type": "integer"
                },
                "successful_200_events": {
                  "type": "integer"
                },
                "payment_events": {
                  "type": "integer"
                },
                "unique_business_ids": {
                  "type": "integer"
                }
              }
            }
          },
          "payment_diagnostics": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "payment_wall_contacts": {
                "type": "integer"
              },
              "missing_payment_header_events": {
                "type": "integer"
              },
              "legacy_payment_required_events": {
                "type": "integer"
              },
              "trial_quota_exceeded_events": {
                "type": "integer"
              },
              "payment_failure_events": {
                "type": "integer"
              },
              "external_identified_402_events": {
                "type": "integer"
              },
              "external_missing_payment_header_events": {
                "type": "integer"
              },
              "external_legacy_payment_required_events": {
                "type": "integer"
              },
              "external_payment_client_missing_events": {
                "type": "integer"
              },
              "external_identified_failure_events": {
                "type": "integer"
              },
              "unknown_error_402_events": {
                "type": "integer"
              },
              "by_error_code": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true,
                  "properties": {
                    "error_code": {
                      "type": "string"
                    },
                    "events": {
                      "type": "integer"
                    },
                    "external_identified_events": {
                      "type": "integer"
                    },
                    "latest_seen_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "dataset_health": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "dataset_key",
                "dataset_stream",
                "label",
                "table",
                "status",
                "records_count",
                "expected_records"
              ],
              "properties": {
                "dataset_key": {
                  "type": "string"
                },
                "dataset_stream": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "table": {
                  "type": "string"
                },
                "resource_type": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "healthy",
                    "watch",
                    "action"
                  ]
                },
                "status_reason": {
                  "type": "string"
                },
                "records_count": {
                  "type": "integer"
                },
                "expected_records": {
                  "type": "integer"
                },
                "latest_generated_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "latest_valid_until": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "age_hours": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ttl_remaining_hours": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          }
        }
      },
      "DataLineage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "dataset",
          "license",
          "attribution",
          "source_url",
          "retrieved_at",
          "source_record_hash"
        ],
        "properties": {
          "provider": {
            "const": "demo-fixture"
          },
          "dataset": {
            "type": "string"
          },
          "license": {
            "type": "string"
          },
          "attribution": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_record_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          }
        }
      },
      "Limitation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "severity"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "info",
              "caution"
            ]
          }
        }
      },
      "LookupCandidate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "business_id",
          "company_name",
          "aliases",
          "fixture_label",
          "status",
          "match_method",
          "confidence"
        ],
        "properties": {
          "business_id": {
            "type": "string",
            "pattern": "^\\d{8}$"
          },
          "company_name": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fixture_label": {
            "const": "demo-fixture"
          },
          "status": {
            "type": "string"
          },
          "match_method": {
            "enum": [
              "business_id_exact",
              "name_exact",
              "alias",
              "contains"
            ]
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "TaxRegistration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tax_registration_status",
          "business_address",
          "organization_type",
          "uses_uniform_invoice",
          "industry_codes"
        ],
        "properties": {
          "tax_registration_status": {
            "type": "string"
          },
          "business_address": {
            "type": "string"
          },
          "organization_type": {
            "type": "string"
          },
          "uses_uniform_invoice": {
            "type": "boolean"
          },
          "industry_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TwCompany": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "business_id",
          "company_name",
          "normalized_name",
          "aliases",
          "fixture_label",
          "status",
          "registration_date",
          "capital_amount",
          "address",
          "industry_codes",
          "tax_registration"
        ],
        "properties": {
          "business_id": {
            "type": "string",
            "pattern": "^\\d{8}$"
          },
          "company_name": {
            "type": "string"
          },
          "normalized_name": {
            "type": "string"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fixture_label": {
            "const": "demo-fixture"
          },
          "status": {
            "type": "string"
          },
          "registration_date": {
            "type": "string"
          },
          "capital_amount": {
            "type": "number",
            "minimum": 0
          },
          "address": {
            "type": "string"
          },
          "industry_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tax_registration": {
            "$ref": "#/components/schemas/TaxRegistration"
          }
        }
      },
      "TwCompanySignal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "signal_id",
          "business_id",
          "signal_type",
          "source_category",
          "signal_level",
          "confidence",
          "event_date",
          "title",
          "summary",
          "agency",
          "law_reference",
          "amount_twd",
          "evidence",
          "source_record_hash",
          "raw_ref"
        ],
        "properties": {
          "signal_id": {
            "type": "string"
          },
          "business_id": {
            "type": "string",
            "pattern": "^\\d{8}$"
          },
          "signal_type": {
            "enum": [
              "environment_penalty",
              "labor_penalty"
            ]
          },
          "source_category": {
            "enum": [
              "environment",
              "labor"
            ]
          },
          "signal_level": {
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "event_date": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "agency": {
            "type": "string"
          },
          "law_reference": {
            "type": "string"
          },
          "amount_twd": {
            "type": "number",
            "minimum": 0
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "label",
                "value"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "source_record_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "raw_ref": {
            "type": "string"
          }
        }
      },
      "TwCompanyLookupResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "query",
          "resolution_status",
          "candidates",
          "data_lineage",
          "limitations",
          "not_legal_advice",
          "not_financial_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_company_intelligence"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "query"
            ],
            "properties": {
              "query": {
                "type": "string"
              }
            }
          },
          "resolution_status": {
            "enum": [
              "exact",
              "candidate",
              "ambiguous",
              "not_found"
            ]
          },
          "match_method": {
            "enum": [
              "business_id_exact",
              "name_exact",
              "alias",
              "contains",
              "none"
            ]
          },
          "company": {
            "$ref": "#/components/schemas/LookupCandidate"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookupCandidate"
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataLineage"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Limitation"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          }
        }
      },
      "TwCompanyBriefResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "query",
          "company",
          "tax_registration",
          "signals_summary",
          "data_lineage",
          "limitations",
          "not_legal_advice",
          "not_financial_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_company_intelligence"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "business_id"
            ],
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "company": {
            "$ref": "#/components/schemas/TwCompany"
          },
          "tax_registration": {
            "$ref": "#/components/schemas/TaxRegistration"
          },
          "signals_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "environment_signal_count",
              "labor_signal_count",
              "last_signal_date",
              "absence_note"
            ],
            "properties": {
              "environment_signal_count": {
                "type": "integer",
                "minimum": 0
              },
              "labor_signal_count": {
                "type": "integer",
                "minimum": 0
              },
              "last_signal_date": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "absence_status": {
                "const": "none_found_in_connected_sources"
              },
              "absence_note": {
                "type": "string"
              }
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataLineage"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Limitation"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          }
        }
      },
      "TwCompanySignalsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "query",
          "company",
          "record_status",
          "signals",
          "data_lineage",
          "limitations",
          "not_legal_advice",
          "not_financial_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_company_signals"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "business_id"
            ],
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "company": {
            "$ref": "#/components/schemas/LookupCandidate"
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwCompanySignal"
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataLineage"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Limitation"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          }
        }
      },
      "TwCompanyGovernmentSignalsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "query",
          "company",
          "record_status",
          "environment_penalties",
          "labor_penalties",
          "procurement",
          "data_lineage",
          "limitations",
          "not_legal_advice",
          "not_financial_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_company_government_signals"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "business_id"
            ],
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "company": {
            "$ref": "#/components/schemas/LookupCandidate"
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "environment_penalties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwCompanySignal"
            }
          },
          "labor_penalties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwCompanySignal"
            }
          },
          "procurement": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "roadmap_status",
              "message"
            ],
            "properties": {
              "roadmap_status": {
                "const": "not_enabled_in_v0_5_1"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataLineage"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Limitation"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          }
        }
      },
      "TwDataSourceHealth": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "dataset",
          "fetch_mode",
          "production_enabled",
          "last_success_at",
          "last_error_at",
          "last_error_message",
          "attribution",
          "license",
          "source_url",
          "update_frequency"
        ],
        "properties": {
          "provider": {
            "type": "string"
          },
          "dataset": {
            "type": "string"
          },
          "fetch_mode": {
            "enum": [
              "api",
              "csv",
              "manual_download",
              "fixture"
            ]
          },
          "production_enabled": {
            "const": false
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "attribution": {
            "type": "string"
          },
          "license": {
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "update_frequency": {
            "type": "string"
          }
        }
      },
      "TwDataSourcesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "data_sources"
        ],
        "properties": {
          "product": {
            "const": "tw_company_intelligence"
          },
          "mode": {
            "const": "ingestion_scaffold"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "data_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TwDataSourceHealth"
            }
          }
        }
      },
      "TwSemiconductorCompanyPackResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "generated_at",
          "valid_until",
          "source_hash",
          "query",
          "record_status",
          "company",
          "coverage_summary",
          "supply_chain_roles",
          "role_evidence",
          "trade_exposure",
          "infrastructure_context",
          "english_summary",
          "data_lineage",
          "limitations",
          "not_financial_advice",
          "not_legal_advice",
          "not_procurement_advice",
          "not_credit_rating"
        ],
        "properties": {
          "product": {
            "const": "tw_semiconductor_supply_chain_signals"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "business_id"
            ],
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "company": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "coverage_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "science_park_company_count",
              "non_park_company_count",
              "coverage_scopes",
              "confidence_labels"
            ],
            "properties": {
              "science_park_company_count": {
                "type": "integer",
                "minimum": 0
              },
              "non_park_company_count": {
                "type": "integer",
                "minimum": 0
              },
              "coverage_scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confidence_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "supply_chain_roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "role_evidence": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "trade_exposure": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "infrastructure_context": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_financial_advice": {
            "const": true
          },
          "not_legal_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          },
          "not_credit_rating": {
            "const": true
          }
        }
      },
      "TwSemiconductorSupplyChainMapResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "generated_at",
          "valid_until",
          "source_hash",
          "query",
          "record_status",
          "result_count",
          "companies",
          "coverage_summary",
          "role_buckets",
          "trade_pulse",
          "infrastructure_context",
          "english_summary",
          "data_lineage",
          "limitations",
          "not_financial_advice",
          "not_legal_advice",
          "not_procurement_advice",
          "not_credit_rating"
        ],
        "properties": {
          "product": {
            "const": "tw_semiconductor_supply_chain_signals"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "q"
            ],
            "properties": {
              "q": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              }
            }
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "result_count": {
            "type": "integer",
            "minimum": 0
          },
          "companies": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "coverage_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "science_park_company_count",
              "non_park_company_count",
              "coverage_scopes",
              "confidence_labels"
            ],
            "properties": {
              "science_park_company_count": {
                "type": "integer",
                "minimum": 0
              },
              "non_park_company_count": {
                "type": "integer",
                "minimum": 0
              },
              "coverage_scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confidence_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "role_buckets": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "trade_pulse": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "infrastructure_context": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_financial_advice": {
            "const": true
          },
          "not_legal_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          },
          "not_credit_rating": {
            "const": true
          }
        }
      },
      "TwEntityRelationshipGraphResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "generated_at",
          "valid_until",
          "source_hash",
          "query",
          "record_status",
          "graph_scope",
          "root_company",
          "nodes",
          "edges",
          "relationship_summary",
          "procurement_network",
          "privacy_boundary",
          "data_lineage",
          "limitations",
          "english_summary",
          "not_financial_advice",
          "not_legal_advice",
          "not_procurement_advice",
          "not_credit_rating"
        ],
        "properties": {
          "product": {
            "const": "tw_entity_relationship_graph"
          },
          "mode": {
            "const": "fixture"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "valid_until": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "business_id"
            ],
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "graph_scope": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "focus",
              "depth",
              "node_count",
              "edge_count",
              "connected_source_sets"
            ],
            "properties": {
              "focus": {
                "enum": [
                  "relationship_pack",
                  "company_network",
                  "procurement_network"
                ]
              },
              "depth": {
                "type": "integer",
                "minimum": 1,
                "maximum": 2
              },
              "node_count": {
                "type": "integer",
                "minimum": 0
              },
              "edge_count": {
                "type": "integer",
                "minimum": 0
              },
              "connected_source_sets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "root_company": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "node_id",
                "node_type",
                "label",
                "business_id",
                "attributes",
                "source_refs"
              ],
              "properties": {
                "node_id": {
                  "type": "string"
                },
                "node_type": {
                  "enum": [
                    "company",
                    "government_agency",
                    "procurement_case"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "business_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^\\d{8}$"
                },
                "attributes": {
                  "type": "object",
                  "additionalProperties": true
                },
                "source_refs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "edges": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "edge_id",
                "edge_type",
                "from_node_id",
                "to_node_id",
                "confidence",
                "confidence_label",
                "evidence"
              ],
              "properties": {
                "edge_id": {
                  "type": "string"
                },
                "edge_type": {
                  "enum": [
                    "branch_of",
                    "subsidiary_signal",
                    "same_responsible_person_signal",
                    "same_chairperson_signal",
                    "awarded_to",
                    "procured_by",
                    "co_award_context",
                    "industry_context_signal"
                  ]
                },
                "from_node_id": {
                  "type": "string"
                },
                "to_node_id": {
                  "type": "string"
                },
                "confidence": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                },
                "confidence_label": {
                  "enum": [
                    "source_confirmed",
                    "strong_signal",
                    "candidate_signal"
                  ]
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "relationship_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "direct_relationships_found",
              "procurement_links_found",
              "privacy_safe_person_signals_found",
              "confidence_label",
              "summary_bullets"
            ],
            "properties": {
              "direct_relationships_found": {
                "type": "integer",
                "minimum": 0
              },
              "procurement_links_found": {
                "type": "integer",
                "minimum": 0
              },
              "privacy_safe_person_signals_found": {
                "type": "integer",
                "minimum": 0
              },
              "confidence_label": {
                "type": "string"
              },
              "summary_bullets": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "procurement_network": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "award_count",
              "total_award_amount_twd",
              "agencies",
              "awards"
            ],
            "properties": {
              "award_count": {
                "type": "integer",
                "minimum": 0
              },
              "total_award_amount_twd": {
                "type": "integer",
                "minimum": 0
              },
              "agencies": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "awards": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "privacy_boundary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "person_names_redacted",
              "person_signal_method",
              "excluded_fields"
            ],
            "properties": {
              "person_names_redacted": {
                "const": true
              },
              "person_signal_method": {
                "type": "string"
              },
              "excluded_fields": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "not_financial_advice": {
            "const": true
          },
          "not_legal_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          },
          "not_credit_rating": {
            "const": true
          }
        }
      },
      "TwProcurementSupplierSignalsResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "generated_at",
          "retrieved_at",
          "source_hash",
          "query",
          "record_status",
          "activity_summary",
          "english_summary",
          "global_buyer_context",
          "data_lineage",
          "limitations",
          "not_legal_advice",
          "not_financial_advice",
          "not_procurement_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_procurement_supplier_signals"
          },
          "mode": {
            "enum": [
              "fixture",
              "snapshot",
              "official"
            ]
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "business_id": {
                "type": "string",
                "pattern": "^\\d{8}$"
              }
            }
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "supplier_resolution": {
            "type": "object",
            "additionalProperties": true
          },
          "activity_summary": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "award_count",
              "tender_notice_count",
              "total_award_amount_twd",
              "agencies",
              "procurement_types",
              "latest_award_date",
              "absence_note"
            ]
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "one_liner",
              "key_findings",
              "search_terms_en",
              "source_language",
              "summary_language",
              "translation_method"
            ]
          },
          "global_buyer_context": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "market",
              "market_scope",
              "buyer_language",
              "source_language",
              "best_for",
              "caveats"
            ]
          },
          "notices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "awards": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "supplier_signals": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          }
        }
      },
      "TwProcurementTenderSearchResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "generated_at",
          "retrieved_at",
          "source_hash",
          "query",
          "record_status",
          "result_count",
          "english_summary",
          "global_buyer_context",
          "not_procurement_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_procurement_supplier_signals"
          },
          "mode": {
            "enum": [
              "fixture",
              "snapshot",
              "official"
            ]
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "q"
            ],
            "properties": {
              "q": {
                "type": "string"
              }
            }
          },
          "record_status": {
            "enum": [
              "records_found",
              "none_found_in_connected_sources"
            ]
          },
          "result_count": {
            "type": "integer",
            "minimum": 0
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "global_buyer_context": {
            "type": "object",
            "additionalProperties": true
          },
          "notices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "awards": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_procurement_advice": {
            "const": true
          }
        }
      },
      "TwProcurementAgentResearchResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "endpoint",
          "retrieved_at",
          "source_hash",
          "query",
          "package_scope",
          "why_buy_paid",
          "paid_response_delta",
          "recommended_paid_call",
          "agent_summary",
          "supplier_candidates",
          "sample_records",
          "english_summary",
          "global_buyer_context",
          "agent_handoff",
          "paid_unlock",
          "marketplace_test_metadata",
          "data_lineage",
          "limitations",
          "not_procurement_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_procurement_supplier_signals"
          },
          "mode": {
            "enum": [
              "agent_research_preview",
              "agent_research_paid",
              "fixture"
            ]
          },
          "endpoint": {
            "type": "string"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "q"
            ],
            "properties": {
              "q": {
                "type": "string"
              },
              "limit": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "package_scope": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "tier",
              "matched_award_count",
              "matched_notice_count",
              "supplier_candidate_count",
              "sample_record_count",
              "result_limit",
              "paid_upgrade_note"
            ],
            "properties": {
              "tier": {
                "enum": [
                  "free_preview",
                  "paid_agent_research",
                  "local_fixture"
                ]
              },
              "matched_award_count": {
                "type": "integer",
                "minimum": 0
              },
              "matched_notice_count": {
                "type": "integer",
                "minimum": 0
              },
              "supplier_candidate_count": {
                "type": "integer",
                "minimum": 0
              },
              "sample_record_count": {
                "type": "integer",
                "minimum": 0
              },
              "result_limit": {
                "type": "integer",
                "minimum": 1
              },
              "sample_record_limit": {
                "type": "integer",
                "minimum": 1
              },
              "supplier_candidate_limit": {
                "type": "integer",
                "minimum": 1
              },
              "paid_upgrade_note": {
                "type": "string"
              }
            }
          },
          "why_buy_paid": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "paid_response_delta": {
            "type": "object",
            "additionalProperties": true
          },
          "recommended_paid_call": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "endpoint",
              "price",
              "buyer_hint_header"
            ],
            "properties": {
              "endpoint": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "buyer_hint_header": {
                "type": "string"
              }
            }
          },
          "agent_summary": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "one_liner",
              "key_findings",
              "top_agencies",
              "best_used_for",
              "action_boundary"
            ],
            "properties": {
              "one_liner": {
                "type": "string"
              },
              "key_findings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "top_agencies": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "best_used_for": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "action_boundary": {
                "type": "string"
              }
            }
          },
          "supplier_candidates": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sample_records": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "global_buyer_context": {
            "type": "object",
            "additionalProperties": true
          },
          "agent_handoff": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "primary_paid_endpoint",
              "buyer_hint_header",
              "recommended_next_steps",
              "copy_ready_fields"
            ]
          },
          "paid_unlock": {
            "type": "object",
            "additionalProperties": true
          },
          "marketplace_test_metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          }
        }
      },
      "TwProcurementPreviewResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "product",
          "mode",
          "endpoint",
          "retrieved_at",
          "source_hash",
          "query",
          "preview",
          "english_summary",
          "global_buyer_context",
          "paid_unlock",
          "data_lineage",
          "limitations",
          "not_procurement_advice"
        ],
        "properties": {
          "product": {
            "const": "tw_procurement_supplier_signals"
          },
          "mode": {
            "const": "official_preview"
          },
          "endpoint": {
            "type": "string"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          },
          "source_hash": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "metadata": {
            "$ref": "#/components/schemas/AgentTrustMetadata"
          },
          "query": {
            "type": "object",
            "additionalProperties": true
          },
          "preview": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "limit",
              "result_count",
              "summary"
            ]
          },
          "english_summary": {
            "type": "object",
            "additionalProperties": true
          },
          "global_buyer_context": {
            "type": "object",
            "additionalProperties": true
          },
          "paid_unlock": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "endpoint",
              "price",
              "buyer_hint_header",
              "includes"
            ]
          },
          "data_lineage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "not_legal_advice": {
            "const": true
          },
          "not_financial_advice": {
            "const": true
          },
          "not_procurement_advice": {
            "const": true
          }
        }
      },
      "TwProcurementDataSourcesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product",
          "mode",
          "generated_at",
          "data_sources",
          "paid_endpoints_enabled",
          "rollout_note"
        ],
        "properties": {
          "product": {
            "const": "tw_procurement_supplier_signals"
          },
          "mode": {
            "const": "ingestion_scaffold"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "data_sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "source_id",
                "provider",
                "dataset",
                "license",
                "attribution",
                "source_url",
                "update_frequency",
                "fetch_mode",
                "production_enabled"
              ]
            }
          },
          "paid_endpoints_enabled": {
            "const": false
          },
          "rollout_note": {
            "type": "string"
          }
        }
      }
    }
  }
}