# DO NOT EDIT -- overwritten on every update.
#
# Workflow customization surface for xiaoma-bug-resolve. Mirrors the
# agent customization shape under the [workflow] namespace.
# Override in {project-root}/_xiaoma/custom/xiaoma-bug-resolve.toml
# (team, committed) or xiaoma-bug-resolve.user.toml (personal).

[workflow]

# --- Configurable below. Overrides merge per XiaoMa structural rules: ---
#   scalars: override wins • arrays (persistent_facts, activation_steps_*): append
#   arrays-of-tables with `code`/`id`: replace matching items, append new ones.

# Steps to run before the standard activation (config load, source resolution).
# Overrides append. Use for pre-flight loads, compliance checks, etc.

activation_steps_prepend = []

# Steps to run after activation but before the workflow begins.
# Overrides append.

activation_steps_append = []

# Persistent facts the workflow keeps in mind for the whole run: coding
# standards, architecture constraints, known fragile areas. Each entry is
# either a literal sentence or a `file:` reference (globs supported).
# Overrides append.

persistent_facts = [
  "file:{project-root}/**/project-context.md",
]

# Bug intake source. "auto" picks: platform when platform_spec is non-empty,
# else file when bug_list_file exists, else interactive.
# Explicit values: "interactive" | "file" | "platform"

bug_source = "auto"

# File mode: the bug-queue file (format: see workflow.md appendix).

bug_list_file = "{implementation_artifacts}/bug-queue.md"

# Platform mode: free-form instructions teaching the workflow how to operate
# your defect platform (queue query, detail fetch, status write-back, scope
# filter, data-verification tools). Contract and a complete MySQL-MCP example:
# workflow.md appendix "Platform Spec Contract".
# Default below: the AI 测试平台 MySQL defect library. Override (or blank out)
# in {project-root}/_xiaoma/custom/xiaoma-bug-resolve.toml per project.

platform_spec = """
缺陷平台：AI 测试平台，MySQL 缺陷库（库名 xiaoma_one_dev1），通过 `mcp__xiaoma-dev-mysql__mysql_query` 工具访问。
表 `t_defect_info`；状态枚举 defect_status：0=新增, 1=已验证, 2=已修复, 3=非缺陷(误报)；软删字段 is_del（0未删除,1已删除）。
严重等级 severity：1=紧急, 2=高, 3=中, 4=低。缺陷类型 defect_type：前端 / 后端。

批量必须按 scope 过滤（scope is REQUIRED）：每条 SELECT/UPDATE/COUNT 都必须携带 AND jira_id = '<scope>'（JIRA 项目号，如 GYLPJ-1153）。缺少 scope 时调度器必须 HALT。

队列查询（待处理，最旧优先）：
  SELECT defect_id, title, severity, defect_type, module_path, discover_time
  FROM t_defect_info
  WHERE is_del = 0 AND defect_status = 0 AND jira_id = '<scope>'
  ORDER BY create_time ASC;

队列统计：
  SELECT defect_status, COUNT(*) AS cnt
  FROM t_defect_info
  WHERE is_del = 0 AND jira_id = '<scope>'
  GROUP BY defect_status;
  （pending = defect_status=0 的条数；fixed = 2；false-positive = 3）

详情拉取（按缺陷 ID）：
  SELECT * FROM t_defect_info WHERE defect_id = '<id>' AND is_del = 0;
  关键字段：title(缺陷描述), steps(重现步骤), error_front(前端错误日志), error_apis(接口报错信息), url(页面URL), module_path(所属模块), severity(严重等级), defect_type(前端/后端)。

状态写回（写回后须重新 SELECT 确认）：
  已修复:   UPDATE t_defect_info SET defect_status = 2, update_time = NOW() WHERE defect_id = '<id>' AND jira_id = '<scope>' AND is_del = 0;
  误报:     UPDATE t_defect_info SET defect_status = 3, update_time = NOW() WHERE defect_id = '<id>' AND jira_id = '<scope>' AND is_del = 0;

数据验证：业务数据用本项目 Oracle 库验证，工具 `mcp__oracle_zqyl_pj_incentive_test4__execute_query`（schema ZQYL_PJ_INCENTIVE_TEST4），用于复现/验证查询逻辑与数据正确性。
"""

# Frontend base URL for browser-automation verification of interaction bugs.
# Can also be passed per-run as a `testUrl=...` arg. Empty = ask when needed.

test_url = ""

# Max fix-verify iterations before halting with a report.

max_fix_iterations = 3

# Subdirectory under {implementation_artifacts} where fix reports land.

fix_report_subdir = "bug-fixes"

# Executed after the closure summary. Override wins. Use for post-fix
# automation: notify a channel, link the report to a ticket, trigger CI.
# Leave empty for no custom post-completion behavior.

on_complete = ""
