{
  "experiment": "schema-selection-fixture-v1",
  "top_k": 8,
  "scope": "Synthetic SQLite snapshot; T1 / customers C1,C2; amounts in cents.",
  "limitations": [
    "Hand-authored aliases and fixtures; no model or embedding retrieval, no held-out benchmark.",
    "Fixed reference SQL only: result matches are not generated-SQL accuracy.",
    "Graph expansion checks approved connectivity, not automatic business intent or cardinality inference.",
    "English and Chinese order cases are translations, not independent business samples.",
    "underspecified uses a known target as a diagnostic; its missing intent cannot be inferred from the question."
  ],
  "summary": {
    "baseline": {
      "answerable_cases": 5,
      "mean_column_recall": 0.5823529411764705,
      "mean_candidate_columns": 4.8,
      "complete_strategy_cases": 1,
      "reference_queries_matched": 1,
      "guardrail_cases": 4,
      "expected_guardrail_statuses": 1
    },
    "expanded": {
      "answerable_cases": 5,
      "mean_column_recall": 0.86,
      "mean_candidate_columns": 8.4,
      "complete_strategy_cases": 4,
      "reference_queries_matched": 4,
      "guardrail_cases": 4,
      "expected_guardrail_statuses": 4
    }
  },
  "cases": [
    {
      "id": "orders_zh",
      "question": "按客户编号汇总下单时间为上海9月1日至7日、排除取消订单的未发金额和件数",
      "purpose": "联合租户/订单键补全；时间半开区间、取消与粒度",
      "expected_status": "ready",
      "baseline": {
        "status": "ready",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.status"
        ],
        "relationships": [],
        "candidate_columns": 6,
        "notes": [],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 0.6,
          "missing_columns": [
            "order_lines.order_id",
            "order_lines.tenant_id",
            "orders.order_id",
            "orders.tenant_id"
          ],
          "relationships_recall": 0.0,
          "missing_relationships": [
            "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
          ],
          "element_recall": 0.6153846153846154,
          "complete": false,
          "extra_columns": []
        },
        "reference_query": {
          "status": "not_run_incomplete_context",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      },
      "expanded": {
        "status": "ready",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.order_id",
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.tenant_id",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.order_id",
          "orders.status",
          "orders.tenant_id"
        ],
        "relationships": [
          "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
        ],
        "candidate_columns": 10,
        "notes": [
          "Added FK endpoints: order_lines.order_id, order_lines.tenant_id, orders.order_id, orders.tenant_id"
        ],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 1.0,
          "missing_columns": [],
          "relationships_recall": 1.0,
          "missing_relationships": [],
          "element_recall": 1.0,
          "complete": true,
          "extra_columns": []
        },
        "reference_query": {
          "status": "matched",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ],
          "actual_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      }
    },
    {
      "id": "orders_en",
      "question": "By customer id, sum remaining amount and quantity for order date September 1–7 Shanghai, excluding cancelled orders",
      "purpose": "同一业务问题的英文词表覆盖",
      "expected_status": "ready",
      "baseline": {
        "status": "ready",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.status"
        ],
        "relationships": [],
        "candidate_columns": 6,
        "notes": [],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 0.6,
          "missing_columns": [
            "order_lines.order_id",
            "order_lines.tenant_id",
            "orders.order_id",
            "orders.tenant_id"
          ],
          "relationships_recall": 0.0,
          "missing_relationships": [
            "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
          ],
          "element_recall": 0.6153846153846154,
          "complete": false,
          "extra_columns": []
        },
        "reference_query": {
          "status": "not_run_incomplete_context",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      },
      "expanded": {
        "status": "ready",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.order_id",
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.tenant_id",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.order_id",
          "orders.status",
          "orders.tenant_id"
        ],
        "relationships": [
          "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
        ],
        "candidate_columns": 10,
        "notes": [
          "Added FK endpoints: order_lines.order_id, order_lines.tenant_id, orders.order_id, orders.tenant_id"
        ],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 1.0,
          "missing_columns": [],
          "relationships_recall": 1.0,
          "missing_relationships": [],
          "element_recall": 1.0,
          "complete": true,
          "extra_columns": []
        },
        "reference_query": {
          "status": "matched",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ],
          "actual_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      }
    },
    {
      "id": "customer_product",
      "question": "按客户名称和商品名称汇总下单时间为上海9月1日至7日、排除取消的未发金额",
      "purpose": "沿客户—订单—明细—商品补齐关系与键",
      "expected_status": "ready",
      "baseline": {
        "status": "ready",
        "tables": [
          "customers",
          "order_lines",
          "orders",
          "products"
        ],
        "columns": [
          "customers.name",
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.status",
          "products.name"
        ],
        "relationships": [],
        "candidate_columns": 7,
        "notes": [],
        "coverage": {
          "strategy": "customer-order-line-product",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 0.4117647058823529,
          "missing_columns": [
            "customers.customer_id",
            "customers.tenant_id",
            "order_lines.order_id",
            "order_lines.product_id",
            "order_lines.tenant_id",
            "orders.customer_id",
            "orders.order_id",
            "orders.tenant_id",
            "products.product_id",
            "products.tenant_id"
          ],
          "relationships_recall": 0.0,
          "missing_relationships": [
            "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)",
            "order_lines(tenant_id,product_id)->products(tenant_id,product_id)",
            "orders(tenant_id,customer_id)->customers(tenant_id,customer_id)"
          ],
          "element_recall": 0.4583333333333333,
          "complete": false,
          "extra_columns": []
        },
        "reference_query": {
          "status": "not_run_incomplete_context",
          "expected_rows": [
            [
              "Acme",
              "Bolt",
              7000
            ],
            [
              "Beta",
              "Nut",
              4000
            ]
          ]
        }
      },
      "expanded": {
        "status": "ready",
        "tables": [
          "customers",
          "order_lines",
          "orders",
          "products"
        ],
        "columns": [
          "customers.customer_id",
          "customers.name",
          "customers.tenant_id",
          "order_lines.order_id",
          "order_lines.ordered_qty",
          "order_lines.product_id",
          "order_lines.shipped_qty",
          "order_lines.tenant_id",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.order_id",
          "orders.status",
          "orders.tenant_id",
          "products.name",
          "products.product_id",
          "products.tenant_id"
        ],
        "relationships": [
          "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)",
          "order_lines(tenant_id,product_id)->products(tenant_id,product_id)",
          "orders(tenant_id,customer_id)->customers(tenant_id,customer_id)"
        ],
        "candidate_columns": 17,
        "notes": [
          "Added FK endpoints: customers.customer_id, customers.tenant_id, order_lines.order_id, order_lines.product_id, order_lines.tenant_id, orders.customer_id, orders.order_id, orders.tenant_id, products.product_id, products.tenant_id"
        ],
        "coverage": {
          "strategy": "customer-order-line-product",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 1.0,
          "missing_columns": [],
          "relationships_recall": 1.0,
          "missing_relationships": [],
          "element_recall": 1.0,
          "complete": true,
          "extra_columns": []
        },
        "reference_query": {
          "status": "matched",
          "expected_rows": [
            [
              "Acme",
              "Bolt",
              7000
            ],
            [
              "Beta",
              "Nut",
              4000
            ]
          ],
          "actual_rows": [
            [
              "Acme",
              "Bolt",
              7000
            ],
            [
              "Beta",
              "Nut",
              4000
            ]
          ]
        }
      }
    },
    {
      "id": "stock",
      "question": "列出商品名称和库存",
      "purpose": "单表问题不需要路径扩展",
      "expected_status": "ready",
      "baseline": {
        "status": "ready",
        "tables": [
          "products"
        ],
        "columns": [
          "products.available_qty",
          "products.name"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [],
        "coverage": {
          "strategy": "scoped-stock",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 1.0,
          "missing_columns": [],
          "relationships_recall": 1.0,
          "missing_relationships": [],
          "element_recall": 1.0,
          "complete": true,
          "extra_columns": []
        },
        "reference_query": {
          "status": "matched",
          "expected_rows": [
            [
              "Bolt",
              30
            ],
            [
              "Nut",
              40
            ]
          ],
          "actual_rows": [
            [
              "Bolt",
              30
            ],
            [
              "Nut",
              40
            ]
          ]
        }
      },
      "expanded": {
        "status": "ready",
        "tables": [
          "products"
        ],
        "columns": [
          "products.available_qty",
          "products.name"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [],
        "coverage": {
          "strategy": "scoped-stock",
          "tables_recall": 1.0,
          "missing_tables": [],
          "columns_recall": 1.0,
          "missing_columns": [],
          "relationships_recall": 1.0,
          "missing_relationships": [],
          "element_recall": 1.0,
          "complete": true,
          "extra_columns": []
        },
        "reference_query": {
          "status": "matched",
          "expected_rows": [
            [
              "Bolt",
              30
            ],
            [
              "Nut",
              40
            ]
          ],
          "actual_rows": [
            [
              "Bolt",
              30
            ],
            [
              "Nut",
              40
            ]
          ]
        }
      }
    },
    {
      "id": "underspecified",
      "question": "未发金额",
      "purpose": "故意缺少分组/日期/状态描述，图扩展不能补出业务口径",
      "expected_status": "ready",
      "baseline": {
        "status": "ready",
        "tables": [
          "order_lines"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents"
        ],
        "relationships": [],
        "candidate_columns": 3,
        "notes": [],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 0.5,
          "missing_tables": [
            "orders"
          ],
          "columns_recall": 0.3,
          "missing_columns": [
            "order_lines.order_id",
            "order_lines.tenant_id",
            "orders.created_at",
            "orders.customer_id",
            "orders.order_id",
            "orders.status",
            "orders.tenant_id"
          ],
          "relationships_recall": 0.0,
          "missing_relationships": [
            "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
          ],
          "element_recall": 0.3076923076923077,
          "complete": false,
          "extra_columns": []
        },
        "reference_query": {
          "status": "not_run_incomplete_context",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      },
      "expanded": {
        "status": "ready",
        "tables": [
          "order_lines"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents"
        ],
        "relationships": [],
        "candidate_columns": 3,
        "notes": [],
        "coverage": {
          "strategy": "aggregate-lines-per-order",
          "tables_recall": 0.5,
          "missing_tables": [
            "orders"
          ],
          "columns_recall": 0.3,
          "missing_columns": [
            "order_lines.order_id",
            "order_lines.tenant_id",
            "orders.created_at",
            "orders.customer_id",
            "orders.order_id",
            "orders.status",
            "orders.tenant_id"
          ],
          "relationships_recall": 0.0,
          "missing_relationships": [
            "order_lines(tenant_id,order_id)->orders(tenant_id,order_id)"
          ],
          "element_recall": 0.3076923076923077,
          "complete": false,
          "extra_columns": []
        },
        "reference_query": {
          "status": "not_run_incomplete_context",
          "expected_rows": [
            [
              "C1",
              2,
              10,
              7000
            ],
            [
              "C2",
              1,
              2,
              4000
            ]
          ]
        }
      }
    },
    {
      "id": "denied_salary",
      "question": "列出员工工资 salary",
      "purpose": "禁止表在排序前被排除",
      "expected_status": "no_candidates",
      "baseline": {
        "status": "no_candidates",
        "tables": [],
        "columns": [],
        "relationships": [],
        "candidate_columns": 0,
        "notes": [],
        "status_matches_expectation": true
      },
      "expanded": {
        "status": "no_candidates",
        "tables": [],
        "columns": [],
        "relationships": [],
        "candidate_columns": 0,
        "notes": [],
        "status_matches_expectation": true
      }
    },
    {
      "id": "ambiguous_warehouse",
      "question": "列出物流跟踪号和仓库名称",
      "purpose": "起始仓与目的仓两条关系需要澄清",
      "expected_status": "ambiguous_path",
      "baseline": {
        "status": "ready",
        "tables": [
          "shipments",
          "warehouses"
        ],
        "columns": [
          "shipments.tracking_number",
          "warehouses.name"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [],
        "status_matches_expectation": false
      },
      "expanded": {
        "status": "ambiguous_path",
        "tables": [
          "shipments",
          "warehouses"
        ],
        "columns": [
          "shipments.tracking_number",
          "warehouses.name"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [
          "shipments(tenant_id,origin_id)->warehouses(tenant_id,warehouse_id)",
          "shipments(tenant_id,destination_id)->warehouses(tenant_id,warehouse_id)"
        ],
        "status_matches_expectation": true
      }
    },
    {
      "id": "disconnected_invoice",
      "question": "按客户名称汇总发票金额",
      "purpose": "没有维护过的关系时不按同名字段猜连接",
      "expected_status": "no_authorized_path",
      "baseline": {
        "status": "ready",
        "tables": [
          "customers",
          "invoices"
        ],
        "columns": [
          "customers.name",
          "invoices.amount_cents"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [],
        "status_matches_expectation": false
      },
      "expanded": {
        "status": "no_authorized_path",
        "tables": [
          "customers",
          "invoices"
        ],
        "columns": [
          "customers.name",
          "invoices.amount_cents"
        ],
        "relationships": [],
        "candidate_columns": 2,
        "notes": [
          "customers → invoices: no approved, authorized path"
        ],
        "status_matches_expectation": true
      }
    },
    {
      "id": "denied_join_key",
      "question": "按客户编号汇总下单时间为上海9月1日至7日、排除取消订单的未发金额和件数",
      "purpose": "补全不能重新引入被禁止的联合键列",
      "expected_status": "no_authorized_path",
      "baseline": {
        "status": "ready",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.status"
        ],
        "relationships": [],
        "candidate_columns": 6,
        "notes": [],
        "status_matches_expectation": false
      },
      "expanded": {
        "status": "no_authorized_path",
        "tables": [
          "order_lines",
          "orders"
        ],
        "columns": [
          "order_lines.ordered_qty",
          "order_lines.shipped_qty",
          "order_lines.unit_price_cents",
          "orders.created_at",
          "orders.customer_id",
          "orders.status"
        ],
        "relationships": [],
        "candidate_columns": 6,
        "notes": [
          "order_lines → orders: no approved, authorized path"
        ],
        "status_matches_expectation": true
      }
    }
  ]
}
