{
  "date": "2026-09-05",
  "timezone": "Asia/Shanghai",
  "window_start": "2026-09-05T00:00:00+08:00",
  "window_end": "2026-09-06T00:00:00+08:00",
  "granularity": "daily",
  "data_status": "complete",
  "source": {
    "kind": "grafana_prometheus_and_prod_sqlite",
    "grafana_datasource": "DevOps-prometheus",
    "grafana_datasource_id": 80,
    "prometheus_labels": {
      "cluster": "prod-devops",
      "namespace": "investibook",
      "job": "backend",
      "prometheus": "monitoring/o11y-vmagent"
    },
    "prod_backend_sqlite": "/data/db/investibook.db",
    "notes": [
      "Cost comes from prod SQLite interaction_token_usage with runtime-aware accounting: OpenCode ses_* rows use cumulative session deltas; PI UUID and image-parse rows use per-row increments.",
      "workspace_count in summary is cost-derived distinct positive-cost workspaces.",
      "Prometheus is used for ACP interaction counts only; investigatory PI sessions made investibook_acp_session_cost unsuitable as the cost source for mixed-runtime weekly reporting.",
      "message categories are rule-based user-message classifications.",
      "scenario labels are added to split daily workspace_changes rows."
    ]
  },
  "summary": {
    "total_cost": 5.7896,
    "total_acp_interactions": 9,
    "active_users": 2,
    "workspace_count": 2,
    "created_workspace_count": 2,
    "new_workspace_count": 2,
    "updated_existing_workspace_count": 0,
    "changed_workspace_count": 2,
    "message_count": 20,
    "user_message_count": 9,
    "assistant_message_count": 11,
    "unknown_user_count": 0,
    "unknown_cost": 0.0
  },
  "teams": [
    {
      "team_path": "APAC Business Group / Customer Success & Alliances / Professional Services",
      "team": "Professional Services",
      "cost": 5.5381,
      "acp_interactions": 7,
      "workspace_count": 1,
      "active_users": 1,
      "message_count": 14,
      "user_message_count": 7,
      "cost_per_ws": 5.5381,
      "cost_per_acp": 0.7912,
      "acp_per_ws": 7.0,
      "message_per_ws": 14.0,
      "message_per_acp": 2.0,
      "correction_message_ratio": null
    },
    {
      "team_path": "Engineering Group / Global Support Intelligence / Intelligent Support",
      "team": "Intelligent Support",
      "cost": 0.2516,
      "acp_interactions": 2,
      "workspace_count": 1,
      "active_users": 1,
      "message_count": 6,
      "user_message_count": 2,
      "cost_per_ws": 0.2516,
      "cost_per_acp": 0.1258,
      "acp_per_ws": 2.0,
      "message_per_ws": 6.0,
      "message_per_acp": 3.0,
      "correction_message_ratio": null
    }
  ],
  "users": [
    {
      "user_email": "zhi.xie@pingcap.com",
      "name": "谢智",
      "en_name": "Zhi Xie",
      "team_path": "APAC Business Group / Customer Success & Alliances / Professional Services",
      "team": "Professional Services",
      "mapping_source": "investibook-usage-team-overrides.csv",
      "cost": 5.5381,
      "acp_interactions": 7,
      "workspace_count": 1,
      "message_count": 14,
      "user_message_count": 7,
      "channel_breakdown": {
        "web": 7
      },
      "frequency_bucket": "低频",
      "depth_bucket": "高轮次",
      "behavior_mode": "低频高轮次",
      "avg_acp_per_ws": 7.0
    },
    {
      "user_email": "weizhin.lim@pingcap.com",
      "name": "Lim Wei Zhin",
      "en_name": "Lim Wei Zhin",
      "team_path": "Engineering Group / Global Support Intelligence / Intelligent Support",
      "team": "Intelligent Support",
      "mapping_source": "pingcap_members_by_team.csv",
      "cost": 0.2516,
      "acp_interactions": 2,
      "workspace_count": 1,
      "message_count": 6,
      "user_message_count": 2,
      "channel_breakdown": {
        "lark": 2
      },
      "frequency_bucket": "低频",
      "depth_bucket": "低轮次",
      "behavior_mode": "低频低轮次",
      "avg_acp_per_ws": 2.0
    }
  ],
  "message_categories": [
    {
      "category": "查询纠偏",
      "user_message_count": 1,
      "share": 0.111111,
      "estimated_cost_by_turn": 0.6433,
      "estimated_cost_by_output_weight": null,
      "avg_user_chars": 19.0,
      "avg_next_assistant_chars": null,
      "classification_method": "rule_based_keywords_v2"
    },
    {
      "category": "Ad hoc 查询",
      "user_message_count": 2,
      "share": 0.222222,
      "estimated_cost_by_turn": 1.2866,
      "estimated_cost_by_output_weight": null,
      "avg_user_chars": 132.0,
      "avg_next_assistant_chars": null,
      "classification_method": "rule_based_keywords_v2"
    },
    {
      "category": "诊断启动",
      "user_message_count": 1,
      "share": 0.111111,
      "estimated_cost_by_turn": 0.6433,
      "estimated_cost_by_output_weight": null,
      "avg_user_chars": 47.0,
      "avg_next_assistant_chars": null,
      "classification_method": "rule_based_keywords_v2"
    },
    {
      "category": "流程控制/确认",
      "user_message_count": 3,
      "share": 0.333333,
      "estimated_cost_by_turn": 1.9299,
      "estimated_cost_by_output_weight": null,
      "avg_user_chars": 14028.67,
      "avg_next_assistant_chars": null,
      "classification_method": "rule_based_keywords_v2"
    },
    {
      "category": "背景补充",
      "user_message_count": 2,
      "share": 0.222222,
      "estimated_cost_by_turn": 1.2866,
      "estimated_cost_by_output_weight": null,
      "avg_user_chars": 74.5,
      "avg_next_assistant_chars": null,
      "classification_method": "rule_based_keywords_v2"
    }
  ],
  "unmatched_users": [],
  "top_changed_workspaces": [
    {
      "workspace_id": "ws-1788577649589-3621f177e",
      "title": "未命名工作空间",
      "workspace_lifecycle": "new",
      "user_email": "zhi.xie@pingcap.com",
      "team_path": "APAC Business Group / Customer Success & Alliances / Professional Services",
      "scenario_group": "diagnosis",
      "scenario_category": "sql_plan_or_query",
      "cost": 5.5381,
      "message_count": 14,
      "user_message_count": 7
    },
    {
      "workspace_id": "lark-ws-1ecc3c32-3450-45bc-9fff-5a5705917d47",
      "title": "Lark chat",
      "workspace_lifecycle": "new",
      "user_email": "weizhin.lim@pingcap.com",
      "team_path": "Engineering Group / Global Support Intelligence / Intelligent Support",
      "scenario_group": "diagnosis",
      "scenario_category": "sql_plan_or_query",
      "cost": 0.2516,
      "message_count": 6,
      "user_message_count": 2
    }
  ],
  "charts": {
    "daily_cost_acp": [
      {
        "date": "2026-09-05",
        "cost": 5.7896,
        "acp_interactions": 9,
        "workspace_count": 2,
        "active_users": 2
      }
    ],
    "team_cost_bar": [
      {
        "team": "Professional Services",
        "team_path": "APAC Business Group / Customer Success & Alliances / Professional Services",
        "cost": 5.5381,
        "acp_interactions": 7,
        "workspace_count": 1,
        "active_users": 1
      },
      {
        "team": "Intelligent Support",
        "team_path": "Engineering Group / Global Support Intelligence / Intelligent Support",
        "cost": 0.2516,
        "acp_interactions": 2,
        "workspace_count": 1,
        "active_users": 1
      }
    ],
    "team_ratio_scatter": [
      {
        "team": "Professional Services",
        "team_path": "APAC Business Group / Customer Success & Alliances / Professional Services",
        "x": 7.0,
        "y": 0.7912,
        "size": 1,
        "cost": 5.5381
      },
      {
        "team": "Intelligent Support",
        "team_path": "Engineering Group / Global Support Intelligence / Intelligent Support",
        "x": 2.0,
        "y": 0.1258,
        "size": 1,
        "cost": 0.2516
      }
    ],
    "message_category_stack": [
      {
        "team": "Professional Services",
        "category": "Ad hoc 查询",
        "count": 2
      },
      {
        "team": "Professional Services",
        "category": "查询纠偏",
        "count": 1
      },
      {
        "team": "Professional Services",
        "category": "流程控制/确认",
        "count": 1
      },
      {
        "team": "Professional Services",
        "category": "背景补充",
        "count": 2
      },
      {
        "team": "Professional Services",
        "category": "诊断启动",
        "count": 1
      },
      {
        "team": "Intelligent Support",
        "category": "流程控制/确认",
        "count": 2
      }
    ],
    "user_behavior_quadrant": [
      {
        "user_email": "weizhin.lim@pingcap.com",
        "x": 1,
        "y": 2.0,
        "cost": 0.2516,
        "mode": "低频低轮次"
      },
      {
        "user_email": "zhi.xie@pingcap.com",
        "x": 1,
        "y": 7.0,
        "cost": 5.5381,
        "mode": "低频高轮次"
      }
    ]
  },
  "workspace_changes_ref": "workspace_changes.json"
}
