[
  {
    "layer": "ORCHESTRATION",
    "task_code": "FLOW_DEFINITIONS",
    "status": "PASS",
    "message": "全部 7 种 Flow 定义完整",
    "details": {
      "expected": [
        "api_full",
        "api_ods",
        "api_ods_dwd",
        "dwd_dws",
        "dwd_dws_index",
        "dwd_index",
        "ods_dwd"
      ],
      "actual": [
        "api_full",
        "api_ods",
        "api_ods_dwd",
        "dwd_dws",
        "dwd_dws_index",
        "dwd_index",
        "ods_dwd"
      ],
      "missing": [],
      "extra": []
    },
    "duration_sec": 0.0,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "FLOW_LAYER_MAPPING",
    "status": "PASS",
    "message": "所有 Flow 层映射正确",
    "details": {
      "total_flows": 7,
      "mismatches": []
    },
    "duration_sec": 0.0,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "INVALID_FLOW_REJECTION",
    "status": "PASS",
    "message": "全部 5 个无效 Flow 名称被正确拒绝",
    "details": {
      "tested": [
        "nonexistent",
        "API_ODS",
        "full",
        "",
        "api_full_extra"
      ],
      "correctly_rejected": [
        "nonexistent",
        "API_ODS",
        "full",
        "",
        "api_full_extra"
      ],
      "missed": []
    },
    "duration_sec": 0.0008,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "FLOW_TASK_RESOLUTION",
    "status": "PASS",
    "message": "所有 7 种 Flow 任务解析正确",
    "details": {
      "flow_tasks": {
        "api_ods": [
          "ODS_ASSISTANT_ACCOUNT",
          "ODS_SETTLEMENT_RECORDS",
          "ODS_TABLE_USE",
          "ODS_ASSISTANT_LEDGER",
          "ODS_ASSISTANT_ABOLISH",
          "ODS_STORE_GOODS_SALES",
          "ODS_PAYMENT",
          "ODS_REFUND",
          "ODS_PLATFORM_COUPON",
          "ODS_MEMBER",
          "ODS_MEMBER_CARD",
          "ODS_MEMBER_BALANCE",
          "ODS_RECHARGE_SETTLE",
          "ODS_GROUP_PACKAGE",
          "ODS_GROUP_BUY_REDEMPTION",
          "ODS_INVENTORY_STOCK",
          "ODS_INVENTORY_CHANGE",
          "ODS_TABLES",
          "ODS_GOODS_CATEGORY",
          "ODS_STORE_GOODS",
          "ODS_TABLE_FEE_DISCOUNT",
          "ODS_TENANT_GOODS",
          "ODS_SETTLEMENT_TICKET"
        ],
        "api_ods_dwd": [
          "ODS_ASSISTANT_ACCOUNT",
          "ODS_SETTLEMENT_RECORDS",
          "ODS_TABLE_USE",
          "ODS_ASSISTANT_LEDGER",
          "ODS_ASSISTANT_ABOLISH",
          "ODS_STORE_GOODS_SALES",
          "ODS_PAYMENT",
          "ODS_REFUND",
          "ODS_PLATFORM_COUPON",
          "ODS_MEMBER",
          "ODS_MEMBER_CARD",
          "ODS_MEMBER_BALANCE",
          "ODS_RECHARGE_SETTLE",
          "ODS_GROUP_PACKAGE",
          "ODS_GROUP_BUY_REDEMPTION",
          "ODS_INVENTORY_STOCK",
          "ODS_INVENTORY_CHANGE",
          "ODS_TABLES",
          "ODS_GOODS_CATEGORY",
          "ODS_STORE_GOODS",
          "ODS_TABLE_FEE_DISCOUNT",
          "ODS_TENANT_GOODS",
          "ODS_SETTLEMENT_TICKET",
          "DWD_LOAD_FROM_ODS"
        ],
        "api_full": [
          "ODS_ASSISTANT_ACCOUNT",
          "ODS_SETTLEMENT_RECORDS",
          "ODS_TABLE_USE",
          "ODS_ASSISTANT_LEDGER",
          "ODS_ASSISTANT_ABOLISH",
          "ODS_STORE_GOODS_SALES",
          "ODS_PAYMENT",
          "ODS_REFUND",
          "ODS_PLATFORM_COUPON",
          "ODS_MEMBER",
          "ODS_MEMBER_CARD",
          "ODS_MEMBER_BALANCE",
          "ODS_RECHARGE_SETTLE",
          "ODS_GROUP_PACKAGE",
          "ODS_GROUP_BUY_REDEMPTION",
          "ODS_INVENTORY_STOCK",
          "ODS_INVENTORY_CHANGE",
          "ODS_TABLES",
          "ODS_GOODS_CATEGORY",
          "ODS_STORE_GOODS",
          "ODS_TABLE_FEE_DISCOUNT",
          "ODS_TENANT_GOODS",
          "ODS_SETTLEMENT_TICKET",
          "DWD_LOAD_FROM_ODS",
          "DWS_BUILD_ORDER_SUMMARY",
          "DWS_ASSISTANT_DAILY",
          "DWS_ASSISTANT_MONTHLY",
          "DWS_ASSISTANT_CUSTOMER",
          "DWS_ASSISTANT_SALARY",
          "DWS_ASSISTANT_FINANCE",
          "DWS_MEMBER_CONSUMPTION",
          "DWS_MEMBER_VISIT",
          "DWS_FINANCE_DAILY",
          "DWS_FINANCE_RECHARGE",
          "DWS_FINANCE_INCOME_STRUCTURE",
          "DWS_FINANCE_DISCOUNT_DETAIL",
          "DWS_RETENTION_CLEANUP",
          "DWS_MV_REFRESH_FINANCE_DAILY",
          "DWS_MV_REFRESH_ASSISTANT_DAILY",
          "DWS_WINBACK_INDEX",
          "DWS_NEWCONV_INDEX",
          "DWS_ML_MANUAL_IMPORT",
          "DWS_RELATION_INDEX"
        ],
        "ods_dwd": [
          "DWD_LOAD_FROM_ODS"
        ],
        "dwd_dws": [
          "DWS_BUILD_ORDER_SUMMARY",
          "DWS_ASSISTANT_DAILY",
          "DWS_ASSISTANT_MONTHLY",
          "DWS_ASSISTANT_CUSTOMER",
          "DWS_ASSISTANT_SALARY",
          "DWS_ASSISTANT_FINANCE",
          "DWS_MEMBER_CONSUMPTION",
          "DWS_MEMBER_VISIT",
          "DWS_FINANCE_DAILY",
          "DWS_FINANCE_RECHARGE",
          "DWS_FINANCE_INCOME_STRUCTURE",
          "DWS_FINANCE_DISCOUNT_DETAIL",
          "DWS_RETENTION_CLEANUP",
          "DWS_MV_REFRESH_FINANCE_DAILY",
          "DWS_MV_REFRESH_ASSISTANT_DAILY"
        ],
        "dwd_dws_index": [
          "DWS_BUILD_ORDER_SUMMARY",
          "DWS_ASSISTANT_DAILY",
          "DWS_ASSISTANT_MONTHLY",
          "DWS_ASSISTANT_CUSTOMER",
          "DWS_ASSISTANT_SALARY",
          "DWS_ASSISTANT_FINANCE",
          "DWS_MEMBER_CONSUMPTION",
          "DWS_MEMBER_VISIT",
          "DWS_FINANCE_DAILY",
          "DWS_FINANCE_RECHARGE",
          "DWS_FINANCE_INCOME_STRUCTURE",
          "DWS_FINANCE_DISCOUNT_DETAIL",
          "DWS_RETENTION_CLEANUP",
          "DWS_MV_REFRESH_FINANCE_DAILY",
          "DWS_MV_REFRESH_ASSISTANT_DAILY",
          "DWS_WINBACK_INDEX",
          "DWS_NEWCONV_INDEX",
          "DWS_ML_MANUAL_IMPORT",
          "DWS_RELATION_INDEX"
        ],
        "dwd_index": [
          "DWS_WINBACK_INDEX",
          "DWS_NEWCONV_INDEX",
          "DWS_ML_MANUAL_IMPORT",
          "DWS_RELATION_INDEX"
        ]
      },
      "issues": []
    },
    "duration_sec": 0.0012,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "TASK_REGISTRY_LAYERS",
    "status": "PASS",
    "message": "各层任务数量正确 (ODS=23, DWD=2, DWS=15, INDEX=4)",
    "details": {
      "ODS": {
        "expected": 23,
        "actual": 23,
        "tasks": [
          "ODS_ASSISTANT_ABOLISH",
          "ODS_ASSISTANT_ACCOUNT",
          "ODS_ASSISTANT_LEDGER",
          "ODS_GOODS_CATEGORY",
          "ODS_GROUP_BUY_REDEMPTION",
          "ODS_GROUP_PACKAGE",
          "ODS_INVENTORY_CHANGE",
          "ODS_INVENTORY_STOCK",
          "ODS_MEMBER",
          "ODS_MEMBER_BALANCE",
          "ODS_MEMBER_CARD",
          "ODS_PAYMENT",
          "ODS_PLATFORM_COUPON",
          "ODS_RECHARGE_SETTLE",
          "ODS_REFUND",
          "ODS_SETTLEMENT_RECORDS",
          "ODS_SETTLEMENT_TICKET",
          "ODS_STORE_GOODS",
          "ODS_STORE_GOODS_SALES",
          "ODS_TABLES",
          "ODS_TABLE_FEE_DISCOUNT",
          "ODS_TABLE_USE",
          "ODS_TENANT_GOODS"
        ]
      },
      "DWD": {
        "expected": 2,
        "actual": 2,
        "tasks": [
          "DWD_LOAD_FROM_ODS",
          "DWD_QUALITY_CHECK"
        ]
      },
      "DWS": {
        "expected": 15,
        "actual": 15,
        "tasks": [
          "DWS_ASSISTANT_CUSTOMER",
          "DWS_ASSISTANT_DAILY",
          "DWS_ASSISTANT_FINANCE",
          "DWS_ASSISTANT_MONTHLY",
          "DWS_ASSISTANT_SALARY",
          "DWS_BUILD_ORDER_SUMMARY",
          "DWS_FINANCE_DAILY",
          "DWS_FINANCE_DISCOUNT_DETAIL",
          "DWS_FINANCE_INCOME_STRUCTURE",
          "DWS_FINANCE_RECHARGE",
          "DWS_MEMBER_CONSUMPTION",
          "DWS_MEMBER_VISIT",
          "DWS_MV_REFRESH_ASSISTANT_DAILY",
          "DWS_MV_REFRESH_FINANCE_DAILY",
          "DWS_RETENTION_CLEANUP"
        ]
      },
      "INDEX": {
        "expected": 4,
        "actual": 4,
        "tasks": [
          "DWS_ML_MANUAL_IMPORT",
          "DWS_NEWCONV_INDEX",
          "DWS_RELATION_INDEX",
          "DWS_WINBACK_INDEX"
        ]
      },
      "TOTAL": {
        "actual": 52
      }
    },
    "duration_sec": 0.0001,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "UTILITY_TASK_IDENTIFICATION",
    "status": "PASS",
    "message": "工具类任务识别正确 (6 个工具类, 6 个 ETL 类)",
    "details": {
      "utility_tasks": {
        "MANUAL_INGEST": true,
        "INIT_ODS_SCHEMA": true,
        "INIT_DWD_SCHEMA": true,
        "INIT_DWS_SCHEMA": true,
        "ODS_JSON_ARCHIVE": true,
        "CHECK_CUTOFF": true
      },
      "etl_tasks": {
        "ODS_MEMBER": false,
        "ODS_ORDER": false,
        "ODS_PAYMENT": false,
        "DWD_LOAD_FROM_ODS": false,
        "DWS_ASSISTANT_DAILY": false,
        "DWS_FINANCE_DAILY": false
      },
      "index_tasks_utility_status": {
        "DWS_WINBACK_INDEX": true,
        "DWS_NEWCONV_INDEX": true,
        "DWS_ML_MANUAL_IMPORT": true,
        "DWS_RELATION_INDEX": true
      },
      "issues": []
    },
    "duration_sec": 0.0,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "TASK_DISPATCH_PATHS",
    "status": "PASS",
    "message": "任务分发路径正确 (utility=13, ods=23, standard=16)",
    "details": {
      "path_counts": {
        "utility": 13,
        "standard": 16,
        "ods": 23
      },
      "issues": [],
      "sample_dispatch": {
        "CHECK_CUTOFF": {
          "layer": null,
          "is_utility": true,
          "is_ods": false,
          "dispatch_path": "utility"
        },
        "DATA_INTEGRITY_CHECK": {
          "layer": null,
          "is_utility": true,
          "is_ods": false,
          "dispatch_path": "utility"
        },
        "DWD_LOAD_FROM_ODS": {
          "layer": "DWD",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWD_QUALITY_CHECK": {
          "layer": "DWD",
          "is_utility": true,
          "is_ods": false,
          "dispatch_path": "utility"
        },
        "DWS_ASSISTANT_CUSTOMER": {
          "layer": "DWS",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWS_ASSISTANT_DAILY": {
          "layer": "DWS",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWS_ASSISTANT_FINANCE": {
          "layer": "DWS",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWS_ASSISTANT_MONTHLY": {
          "layer": "DWS",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWS_ASSISTANT_SALARY": {
          "layer": "DWS",
          "is_utility": false,
          "is_ods": false,
          "dispatch_path": "standard"
        },
        "DWS_BUILD_ORDER_SUMMARY": {
          "layer": "DWS",
          "is_utility": true,
          "is_ods": false,
          "dispatch_path": "utility"
        }
      }
    },
    "duration_sec": 0.0001,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CURSOR_MANAGER_INTERFACE",
    "status": "PASS",
    "message": "CursorManager 接口签名正确 (get_or_create, advance)",
    "details": {
      "method_signatures": {
        "get_or_create": [
          "self",
          "task_id",
          "store_id"
        ],
        "advance": [
          "self",
          "task_id",
          "store_id",
          "window_start",
          "window_end",
          "run_id",
          "last_id"
        ]
      },
      "issues": []
    },
    "duration_sec": 0.0002,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CURSOR_ADVANCE_SQL",
    "status": "PASS",
    "message": "游标推进 SQL 逻辑正确",
    "details": {
      "checks": [
        "✓ 使用 UPDATE meta.etl_cursor",
        "✓ 使用 GREATEST 保护 last_id 不回退",
        "✓ 调用 commit() 持久化",
        "✓ last_id 参数可选（有 None 分支）",
        "✓ 更新 updated_at 时间戳"
      ],
      "issues": []
    },
    "duration_sec": 0.0005,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CURSOR_SKIP_UTILITY",
    "status": "PASS",
    "message": "工具类任务正确跳过游标管理和运行记录",
    "details": {
      "checks": [
        "✓ run_single_task 检查 is_utility_task 并分发到 _run_utility_task",
        "✓ _run_utility_task 不调用 cursor_mgr",
        "✓ _run_utility_task 不调用 run_tracker.create_run"
      ],
      "issues": []
    },
    "duration_sec": 0.002,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CLI_DATA_SOURCE",
    "status": "PASS",
    "message": "全部 7 个 data_source 解析用例通过",
    "details": {
      "test_cases": [
        {
          "case": "默认值",
          "expected": "hybrid",
          "actual": "hybrid"
        },
        {
          "case": "--data-source online",
          "expected": "online",
          "actual": "online"
        },
        {
          "case": "--data-source offline",
          "expected": "offline",
          "actual": "offline"
        },
        {
          "case": "--pipeline-flow FULL",
          "expected": "hybrid",
          "actual": "hybrid",
          "deprecation_warning": true
        },
        {
          "case": "--pipeline-flow FETCH_ONLY",
          "expected": "online",
          "actual": "online"
        },
        {
          "case": "--pipeline-flow INGEST_ONLY",
          "expected": "offline",
          "actual": "offline"
        },
        {
          "case": "--data-source online + --pipeline-flow INGEST_ONLY",
          "expected": "online",
          "actual": "online"
        }
      ],
      "issues": []
    },
    "duration_sec": 0.0002,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CLI_MODE_DETECTION",
    "status": "PASS",
    "message": "CLI Flow/传统模式检测逻辑正确",
    "details": {
      "checks": [
        "✓ 有 --pipeline 参数时使用 PipelineRunner（Flow 模式）",
        "✓ 无 --pipeline 参数时使用 run_tasks（传统模式）",
        "✓ 调用 resolve_data_source 解析数据源模式",
        "✓ 支持 --lookback-hours 回溯窗口",
        "✓ 设置 window_override 确保任务使用指定窗口"
      ],
      "issues": []
    },
    "duration_sec": 0.0017,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "CLI_PIPELINE_CHOICES",
    "status": "PASS",
    "message": "CLI --pipeline 可选值与 PIPELINE_LAYERS 完全一致 (7 种)",
    "details": {
      "pipeline_layers_keys": [
        "api_full",
        "api_ods",
        "api_ods_dwd",
        "dwd_dws",
        "dwd_dws_index",
        "dwd_index",
        "ods_dwd"
      ],
      "cli_choices": [
        "api_full",
        "api_ods",
        "api_ods_dwd",
        "dwd_dws",
        "dwd_dws_index",
        "dwd_index",
        "ods_dwd"
      ],
      "missing_in_cli": [],
      "extra_in_cli": []
    },
    "duration_sec": 0.0,
    "error_detail": null,
    "fix_applied": null
  },
  {
    "layer": "ORCHESTRATION",
    "task_code": "PROCESSING_MODES",
    "status": "PASS",
    "message": "三种处理模式（increment_only/verify_only/increment_verify）逻辑正确",
    "details": {
      "checks": [
        "✓ 支持 verify_only 模式",
        "✓ verify_only 调用 _run_verification",
        "✓ 支持 increment_verify 模式",
        "✓ 支持 fetch_before_verify 参数（校验前先获取 API 数据）",
        "✓ _run_verification 方法存在"
      ],
      "issues": []
    },
    "duration_sec": 0.0014,
    "error_detail": null,
    "fix_applied": null
  }
]