bpmax-cli 0.2.1-beta.3 → 0.2.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -364,7 +364,7 @@ bpmax-cli config readback dataset-field --id 5926 --format json
364
364
  bpmax-cli config flow-app context --workspace <workspace> --flow <flow_type_or_name> --evidence-out .codex/tmp/target-context.csv --format json
365
365
  ```
366
366
 
367
- `flow-app create` dry-run responses include `required_confirm`; automation should copy that exact value instead of reconstructing confirmation text. Typed create/submit responses expose stable `id`, `key`, and `readback_hint` fields for collectors.
367
+ `flow-app create` dry-run responses include `required_confirm`; automation should copy that exact value instead of reconstructing confirmation text. Direct typed create/submit responses expose stable top-level `id`, `key`, and `readback_hint` fields for collectors.
368
368
 
369
369
  Dataset relation fields and lifecycle actions are typed:
370
370
 
@@ -381,6 +381,8 @@ bpmax-cli config batch submit --manifest .codex/tmp/config-batch.json --continue
381
381
  bpmax-cli config batch readback --manifest .codex/tmp/config-readback-batch.json --continue-on-error --format json
382
382
  ```
383
383
 
384
+ Batch row `response_out` files are envelopes: read `ok`, `domain`, `id`, and `action` at the top level, and read typed command fields from `response.id`, `response.key`, and `response.readback_hint`. If a row stops at dry-run, copy `response.required_confirm` into the manifest row's `confirm` before retrying.
385
+
384
386
  ## BPMAX AI implementation taskbooks
385
387
 
386
388
  `bpmax-cli taskbook` manages local AI implementation taskbooks before configuration work is dispatched:
package/dist/bin.js CHANGED
@@ -469,7 +469,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
469
469
  // package.json
470
470
  var package_default = {
471
471
  name: "bpmax-cli",
472
- version: "0.2.1-beta.3",
472
+ version: "0.2.1-beta.5",
473
473
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
474
474
  type: "module",
475
475
  bin: {
@@ -8297,7 +8297,7 @@ async function runDatasetLifecycleAction(config, profile, action, id, confirm3)
8297
8297
  }
8298
8298
  function normalizeConfigBatchItems(manifest) {
8299
8299
  if (Array.isArray(manifest)) {
8300
- return manifest.filter(isRecord3);
8300
+ return manifest.map((raw) => ({ raw, item: isRecord3(raw) ? raw : null }));
8301
8301
  }
8302
8302
  if (!isRecord3(manifest)) {
8303
8303
  throw new Error("config batch manifest must be a JSON object or array.");
@@ -8306,7 +8306,7 @@ function normalizeConfigBatchItems(manifest) {
8306
8306
  if (!Array.isArray(items)) {
8307
8307
  throw new Error("config batch manifest requires operations, items, or rows array.");
8308
8308
  }
8309
- return items.filter(isRecord3);
8309
+ return items.map((raw) => ({ raw, item: isRecord3(raw) ? raw : null }));
8310
8310
  }
8311
8311
  function assertBatchItemDomain(domain) {
8312
8312
  if (typeof domain !== "string" || !Object.prototype.hasOwnProperty.call(CONFIG_DOMAINS, domain)) {
@@ -8326,36 +8326,51 @@ async function runConfigBatchSubmit(config, profile, manifestFile, options = {})
8326
8326
  const items = normalizeConfigBatchItems(manifest);
8327
8327
  const results = [];
8328
8328
  for (let index = 0; index < items.length; index += 1) {
8329
- const item = items[index];
8330
- const domain = assertBatchItemDomain(item.domain);
8331
- const id = typeof item.id === "string" ? item.id : "";
8332
- const payload = typeof item.payload === "string" ? item.payload : "";
8333
- if (!id || !payload) {
8329
+ const batchItem = items[index];
8330
+ const item = batchItem.item;
8331
+ if (!item) {
8334
8332
  const result = {
8335
8333
  ok: false,
8336
8334
  index,
8337
- domain,
8338
- id,
8335
+ domain: null,
8336
+ id: "",
8339
8337
  action: "submit",
8340
- error: "config batch submit item requires id and payload."
8338
+ error: "config batch submit item must be a JSON object."
8341
8339
  };
8342
8340
  results.push(result);
8343
- await writeOptionalBatchResponse(item.response_out, result);
8344
8341
  if (!options.continueOnError) break;
8345
8342
  continue;
8346
8343
  }
8344
+ let domain = null;
8345
+ let id = "";
8347
8346
  try {
8347
+ domain = assertBatchItemDomain(item.domain);
8348
+ id = typeof item.id === "string" ? item.id : "";
8349
+ const payload = typeof item.payload === "string" ? item.payload : "";
8350
+ if (!id || !payload) {
8351
+ throw new Error("config batch submit item requires id and payload.");
8352
+ }
8348
8353
  const response = await submitConfigDomain(config, profile, domain, id, payload, item.confirm);
8349
- const result = {
8354
+ const executed = !isRecord3(response) || response.operation_executed !== false && response.dry_run !== true;
8355
+ const result = executed ? {
8350
8356
  ok: true,
8351
8357
  index,
8352
8358
  domain,
8353
8359
  id,
8354
8360
  action: "submit",
8355
8361
  response
8362
+ } : {
8363
+ ok: false,
8364
+ index,
8365
+ domain,
8366
+ id,
8367
+ action: "submit",
8368
+ error: `config batch submit item did not execute; confirm_required=${String(isRecord3(response) ? response.required_confirm ?? response.expected_confirm ?? "" : "")}`,
8369
+ response
8356
8370
  };
8357
8371
  results.push(result);
8358
- await writeOptionalBatchResponse(item.response_out, response);
8372
+ await writeOptionalBatchResponse(item.response_out, result);
8373
+ if (!result.ok && !options.continueOnError) break;
8359
8374
  } catch (error) {
8360
8375
  const result = {
8361
8376
  ok: false,
@@ -8388,24 +8403,29 @@ async function runConfigBatchReadback(config, profile, manifestFile, options = {
8388
8403
  const items = normalizeConfigBatchItems(manifest);
8389
8404
  const results = [];
8390
8405
  for (let index = 0; index < items.length; index += 1) {
8391
- const item = items[index];
8392
- const domain = assertBatchItemDomain(item.domain);
8393
- const id = typeof item.id === "string" ? item.id : "";
8394
- if (!id) {
8406
+ const batchItem = items[index];
8407
+ const item = batchItem.item;
8408
+ if (!item) {
8395
8409
  const result = {
8396
8410
  ok: false,
8397
8411
  index,
8398
- domain,
8399
- id,
8412
+ domain: null,
8413
+ id: "",
8400
8414
  action: "readback",
8401
- error: "config batch readback item requires id."
8415
+ error: "config batch readback item must be a JSON object."
8402
8416
  };
8403
8417
  results.push(result);
8404
- await writeOptionalBatchResponse(item.response_out, result);
8405
8418
  if (!options.continueOnError) break;
8406
8419
  continue;
8407
8420
  }
8421
+ let domain = null;
8422
+ let id = "";
8408
8423
  try {
8424
+ domain = assertBatchItemDomain(item.domain);
8425
+ id = typeof item.id === "string" ? item.id : "";
8426
+ if (!id) {
8427
+ throw new Error("config batch readback item requires id.");
8428
+ }
8409
8429
  const response = await readbackConfigDomain(config, profile, domain, id);
8410
8430
  const result = {
8411
8431
  ok: true,
@@ -8416,7 +8436,7 @@ async function runConfigBatchReadback(config, profile, manifestFile, options = {
8416
8436
  response
8417
8437
  };
8418
8438
  results.push(result);
8419
- await writeOptionalBatchResponse(item.response_out, response);
8439
+ await writeOptionalBatchResponse(item.response_out, result);
8420
8440
  } catch (error) {
8421
8441
  const result = {
8422
8442
  ok: false,
@@ -15335,6 +15355,7 @@ var CONFIG_BASIS_ALLOWED_PREFIXES = [
15335
15355
  ".codex/skills/"
15336
15356
  ];
15337
15357
  var REPORT_REQUIRED_KEYS = ["run_id:", "scenario_id:", "source_suite:", "result:"];
15358
+ var REPORT_EXECUTION_KEYS = ["planned_cases:", "executed_cases:", "precondition_check:", "state_file:", "browser_tool:"];
15338
15359
  var REPORT_REQUIRED_HEADINGS = [
15339
15360
  "## 1. \u6D4B\u8BD5\u8303\u56F4",
15340
15361
  "## 2. \u6267\u884C\u73AF\u5883",
@@ -15352,18 +15373,28 @@ var ID_AS_ENTRY_RE = /(发起表单|处理表单|表单模板|数据集|列表
15352
15373
  var URL_RE = /https?:\/\/|\/w:[^\s,,;;]+|\/project\?|\/project_detail\/|\/projectContinue\?/;
15353
15374
  var SHA_RE = /^[0-9a-f]{40}$/;
15354
15375
  var CONFIG_BASIS_REASON_RE = /(依据|覆盖|校验|验证|对应|因为|reason=|why=|=>|->)/;
15355
- var PREP_TOKEN_RE = /(账号|入口|样本|准备操作|预期|主数据|权限|自动化|依赖流程|清理策略|绑定解析|定位规则|模拟用户)=/g;
15376
+ var PREP_TOKEN_RE = /(账号|入口|样本|准备操作|预期|主数据|权限|自动化|依赖流程|清理策略|绑定解析|定位规则|模拟用户|precondition_check|browser_tool|live_draft|state_file|report_run|login_profile|mock_user|unmock_done|resume_policy)=/g;
15356
15377
  var TEST_DATA_TOKEN_RE = /(业务场景|业务逻辑|样本数据|合理性|客户口径|数据约束)=/g;
15357
15378
  var GENERIC_SAMPLE_VALUE_RE = /(^|[=,;,\s])(sample|test|mock|demo|xxx|todo|tbd|placeholder|随便|假数据|占位|待补)(?=$|[,;,\s])/i;
15358
15379
  var SENSITIVE_TEST_DATA_RE = /authorization|bearer\s+[A-Za-z0-9._-]+|cookie|set-cookie|api[-_]?key|token|password|passwd|pwd|secret|session|验证码|手机号|\b1[3-9]\d{9}\b/i;
15359
15380
  var RAW_PAYLOAD_TEST_DATA_RE = /(^|[;;]\s*)(payload|完整payload|request|请求体|headers?)\s*=/i;
15360
15381
  var PLACEHOLDER_RE = /<[^>]+>/;
15382
+ var CASE_CONTENT_GARBLED_RE = /\uFFFD|�|Ã.|Â.|â[€\u0080-\u00BF]|锛|鈥|乱码|���|\?\?\?/i;
15383
+ var HOLLOW_CASE_TEXT_RE = /(^|[=,;,\s])(todo|tbd|xxx|placeholder|占位|待补|随便写|后补|暂无|无具体步骤|略)(?=$|[,;,\s])/i;
15361
15384
  var IMAGE_RE = /!\[[^\]]*]\(([^)]+)\)/g;
15362
15385
  var YBS_NONZERO_DETAIL_RE = /https:\/\/yaditest\.yitaiyitai\.com\/w:ybs\/project_detail\/(?!0\/)\d+\//;
15363
15386
  var YBS_PC_CREATE_WRONG_RE = /https:\/\/yaditest\.yitaiyitai\.com\/w:ybs\/pages\/projectCreate\/projectCreate\?flow_type=/;
15364
15387
  var IDENTITY_MOCK_CASE_RE = /(非处理人|越权|只读|多角色|角色隔离|无权限|低权限|unauthorized|limited|readonly|permission)/;
15365
15388
  var IDENTITY_MOCK_VALUE_RE = /(mock|模拟).*(unmock|退出模拟|恢复)|bpmax-user-mock-operator/;
15366
15389
  var E2E_REUSABLE_ASSET_RE = /bpmax-cli\s+e2e|record-from-evidence|create-page-submit|step-run|browser-template|scenario\s+plan|data\s+profile|reusable\s+step|复用模板|可复用|首次运行沉淀|沉淀模板/;
15390
+ var ERROR_CAPTURE_CASE_RE = /(negative|boundary|异常|错误|失败|报错|重复|无效|非法|invalid|error|扫码.*(异常|错误|无效)|错误\s*SN|异常\s*SN|无效\s*SN)/i;
15391
+ var ERROR_CAPTURE_EVIDENCE_RE = /(expected_error_text|error_capture_required|错误提示|提示文案|报错文案|toast|校验文案).*(screenshot|截图)|截图.*(错误提示|提示文案|报错文案|toast|校验文案)/i;
15392
+ var BROWSER_TOOL_RE = /(Chrome DevTools|DevTools|Playwright|AppleScript|browser_tool=|浏览器工具)/i;
15393
+ var LIVE_DRAFT_RE = /(live|draft|已发布|草稿|发布态|live_draft=)/i;
15394
+ var MULTI_ROLE_VALUE_RE = /[,、/]\s*[^,、/\s]+|多角色|跨角色/;
15395
+ var RESUME_POLICY_VALUE_RE = /(full_rerun|checkpoint|evidence_only|从头重跑|检查点|仅补证据)/i;
15396
+ var NOT_RUN_RE = /(not[_ -]?run|未执行|未跑|跳过)/i;
15397
+ var PAGE_CONCLUSION_RE = /(页面.*(通过|已验证|真实|可见|不可见)|浏览器回归.*(通过|完成)|完整链路.*通过|真实页面.*通过)/;
15367
15398
  var TestSuiteError = class extends Error {
15368
15399
  code;
15369
15400
  rule_id;
@@ -15636,6 +15667,72 @@ function hasE2eReusableAsset(row) {
15636
15667
  const evidencePlan = [row.prep_data, row.steps, row.expected_result, row.evidence_required, row.tags].join(" ");
15637
15668
  return E2E_REUSABLE_ASSET_RE.test(evidencePlan);
15638
15669
  }
15670
+ function validateReadableCaseContent(filePath, caseId, row) {
15671
+ for (const field of ["title", "preconditions", "config_basis", "prep_data", "steps", "expected_result", "test_data"]) {
15672
+ const value = row[field].trim();
15673
+ if (!value) continue;
15674
+ if (CASE_CONTENT_GARBLED_RE.test(value)) {
15675
+ fail(`${filePath}:${caseId}: \`${field}\` \u5305\u542B\u4E71\u7801\u6216\u5F02\u5E38\u7F16\u7801\u7247\u6BB5\uFF1Bpromote \u524D\u5FC5\u987B\u4FEE\u590D\u6587\u672C\u7F16\u7801`, { rule_id: "test_suite.case.content_garbled" });
15676
+ }
15677
+ if (HOLLOW_CASE_TEXT_RE.test(value)) {
15678
+ fail(`${filePath}:${caseId}: \`${field}\` \u5305\u542B\u7A7A\u6D1E\u5360\u4F4D\u5185\u5BB9\uFF1B\u5FC5\u987B\u5199\u6E05\u53EF\u6267\u884C\u4E1A\u52A1\u6B65\u9AA4\u548C\u9884\u671F\u7ED3\u679C`, { rule_id: "test_suite.case.content_hollow" });
15679
+ }
15680
+ }
15681
+ if (row.steps.trim().length < 12 || !/[>;;。]|打开|点击|填写|选择|提交|等待|截图|校验|验证/.test(row.steps)) {
15682
+ fail(`${filePath}:${caseId}: \`steps\` \u5FC5\u987B\u662F\u53EF\u8BFB\u3001\u53EF\u6267\u884C\u7684\u6B65\u9AA4\uFF0C\u4E0D\u80FD\u662F\u4E00\u53E5\u6CDB\u6CDB\u5907\u6CE8`, { rule_id: "test_suite.case.content_steps" });
15683
+ }
15684
+ }
15685
+ function validatePreflightEvidence(filePath, caseId, row, prepTokens) {
15686
+ if (!prepTokens.precondition_check) {
15687
+ fail(`${filePath}:${caseId}: \`prep_data\` \u5FC5\u987B\u5305\u542B \`precondition_check=\`\uFF0C\u5426\u5219\u53EA\u80FD\u8FDB\u5165\u51C6\u5907\u9636\u6BB5\uFF0C\u4E0D\u80FD\u5F00\u59CB\u6B63\u5F0F E2E \u6267\u884C`, { rule_id: "test_suite.case.precondition_check" });
15688
+ }
15689
+ if (!prepTokens.browser_tool || !BROWSER_TOOL_RE.test(prepTokens.browser_tool)) {
15690
+ fail(`${filePath}:${caseId}: E2E \u7528\u4F8B\u5FC5\u987B\u58F0\u660E\u6D4F\u89C8\u5668\u5DE5\u5177\u8BC1\u636E\uFF0C\u4F8B\u5982 \`browser_tool=Chrome DevTools\` \u6216 AppleScript fallback`, { rule_id: "test_suite.case.browser_tool" });
15691
+ }
15692
+ if (!prepTokens.live_draft || !LIVE_DRAFT_RE.test(prepTokens.live_draft)) {
15693
+ fail(`${filePath}:${caseId}: E2E \u7528\u4F8B\u5FC5\u987B\u58F0\u660E\u672C\u8F6E\u76EE\u6807\u662F live \u53D1\u5E03\u6001\u8FD8\u662F draft \u8349\u7A3F\u6001`, { rule_id: "test_suite.case.live_draft" });
15694
+ }
15695
+ if (!prepTokens.state_file && !prepTokens.report_run) {
15696
+ fail(`${filePath}:${caseId}: E2E \u7528\u4F8B\u5FC5\u987B\u58F0\u660E .codex/tmp/e2e_states \u72B6\u6001\u6587\u4EF6\u6216 .ai_test/report/<run> \u62A5\u544A\u8BC1\u636E\u8DEF\u5F84`, { rule_id: "test_suite.case.state_file" });
15697
+ }
15698
+ }
15699
+ function validateErrorCaptureEvidence(filePath, caseId, row) {
15700
+ const caseText = [row.type, row.title, row.preconditions, row.steps, row.expected_result, row.tags].join(" ");
15701
+ if (!ERROR_CAPTURE_CASE_RE.test(caseText)) return;
15702
+ const evidenceText = [row.prep_data, row.steps, row.expected_result, row.evidence_required].join(" ");
15703
+ if (!ERROR_CAPTURE_EVIDENCE_RE.test(evidenceText)) {
15704
+ fail(`${filePath}:${caseId}: \u8D1F\u5411/\u9519\u8BEF\u63D0\u793A\u7528\u4F8B\u5FC5\u987B\u5305\u542B expected_error_text \u6216 error_capture_required\uFF0C\u5E76\u8981\u6C42\u771F\u5B9E\u63D0\u793A\u6587\u6848\u622A\u56FE`, { rule_id: "test_suite.case.error_capture" });
15705
+ }
15706
+ }
15707
+ function validateResumePolicy(filePath, caseId, row, prepTokens) {
15708
+ const text5 = [row.preconditions, row.prep_data, row.steps, row.expected_result, row.evidence_required, row.tags].join(" ");
15709
+ if (!/(人工介入|手工|补救|续跑|dirty_resumed|resume|局部复核|partial rerun)/i.test(text5)) return;
15710
+ const policy = prepTokens.resume_policy || text5;
15711
+ if (!RESUME_POLICY_VALUE_RE.test(policy)) {
15712
+ fail(`${filePath}:${caseId}: \u4EBA\u5DE5\u4ECB\u5165\u6216\u7EED\u8DD1\u7528\u4F8B\u5FC5\u987B\u58F0\u660E \`resume_policy=full_rerun|checkpoint|evidence_only\``, { rule_id: "test_suite.case.resume_policy" });
15713
+ }
15714
+ if (!/dirty_resumed|局部复核|partial|从头重跑|检查点/.test(text5)) {
15715
+ fail(`${filePath}:${caseId}: \u4EBA\u5DE5\u4ECB\u5165\u6216\u7EED\u8DD1\u7528\u4F8B\u5FC5\u987B\u6807\u8BB0 dirty_resumed\uFF0C\u6216\u660E\u786E\u8BF4\u660E\u5C40\u90E8/\u5B8C\u6574\u91CD\u8DD1\u8303\u56F4`, { rule_id: "test_suite.case.resume_scope" });
15716
+ }
15717
+ }
15718
+ function validateMultiRoleEvidence(filePath, caseId, row, prepTokens) {
15719
+ const text5 = [row.roles, row.prep_data, row.steps, row.expected_result, row.evidence_required, row.tags].join(" ");
15720
+ if (!MULTI_ROLE_VALUE_RE.test(row.roles) && !/多角色|跨角色/.test(text5)) return;
15721
+ if (!prepTokens.login_profile) {
15722
+ fail(`${filePath}:${caseId}: \u591A\u89D2\u8272 E2E \u7528\u4F8B\u5FC5\u987B\u8BB0\u5F55\u6BCF\u4E2A\u89D2\u8272\u7684 login_profile`, { rule_id: "test_suite.case.multi_role_login_profile" });
15723
+ }
15724
+ const hasMockUser = Boolean(prepTokens.mock_user) || /bpmax-user-mock-operator|mock_user|模拟用户.*[=,,]/i.test(text5);
15725
+ if (!hasMockUser) {
15726
+ fail(`${filePath}:${caseId}: \u591A\u89D2\u8272 E2E \u7528\u4F8B\u5FC5\u987B\u8BB0\u5F55 mock_user \u6216 bpmax-user-mock-operator\uFF0C\u8BF4\u660E\u5982\u4F55\u5207\u6362\u8EAB\u4EFD`, { rule_id: "test_suite.case.multi_role_mock_user" });
15727
+ }
15728
+ const hasUnmock = Boolean(prepTokens.unmock_done) || /unmock|退出模拟|恢复身份|恢复管理员/i.test(text5);
15729
+ if (!hasUnmock) {
15730
+ fail(`${filePath}:${caseId}: \u591A\u89D2\u8272 E2E \u7528\u4F8B\u5FC5\u987B\u8BB0\u5F55 unmock_done\uFF0C\u8BF4\u660E\u6D4B\u8BD5\u7ED3\u675F\u540E\u5982\u4F55\u6062\u590D\u539F\u59CB\u8EAB\u4EFD`, { rule_id: "test_suite.case.multi_role_unmock" });
15731
+ }
15732
+ if (!/(分别截图|独立截图|每个角色|separate evidence|per-role|角色证据)/i.test(text5)) {
15733
+ fail(`${filePath}:${caseId}: \u591A\u89D2\u8272 E2E \u7528\u4F8B\u5FC5\u987B\u8981\u6C42\u6BCF\u4E2A\u89D2\u8272\u5355\u72EC\u6D4F\u89C8\u5668\u8BC1\u636E\uFF0C\u4E0D\u80FD\u590D\u7528\u622A\u56FE`, { rule_id: "test_suite.case.multi_role_screenshot" });
15734
+ }
15735
+ }
15639
15736
  function bootstrapActionForCase(row) {
15640
15737
  const rawText = [row.title, row.prep_data, row.steps, row.evidence_required, row.tags].join(" ");
15641
15738
  const text5 = rawText.toLowerCase();
@@ -15655,6 +15752,7 @@ async function validateCase(filePath, row, seen) {
15655
15752
  if (!caseId) fail(`${filePath}: case_id is required`);
15656
15753
  if (seen.has(caseId)) fail(`${filePath}: duplicate case_id \`${caseId}\``);
15657
15754
  seen.add(caseId);
15755
+ validateReadableCaseContent(filePath, caseId, row);
15658
15756
  for (const field of ["title", "config_basis", "steps", "expected_result", "status", "updated_at"]) {
15659
15757
  if (!row[field].trim()) fail(`${filePath}:${caseId}: \`${field}\` is required`);
15660
15758
  }
@@ -15698,6 +15796,10 @@ async function validateCase(filePath, row, seen) {
15698
15796
  if (UUID_RE2.test(browserText)) fail(`${filePath}:${caseId}: browser-executed cases must not use UUID as the execution entrypoint`);
15699
15797
  if (YBS_NONZERO_DETAIL_RE.test(browserText)) fail(`${filePath}:${caseId}: YBS detail URLs must use /w:ybs/project_detail/0/<project_id> unless verified otherwise`);
15700
15798
  if (YBS_PC_CREATE_WRONG_RE.test(browserText)) fail(`${filePath}:${caseId}: YBS PC create URLs must use /w:ybs/project/create?flow_type=<flow_type>`);
15799
+ validatePreflightEvidence(filePath, caseId, row, prepTokens);
15800
+ validateErrorCaptureEvidence(filePath, caseId, row);
15801
+ validateResumePolicy(filePath, caseId, row, prepTokens);
15802
+ validateMultiRoleEvidence(filePath, caseId, row, prepTokens);
15701
15803
  validateBusinessTestData(filePath, caseId, row);
15702
15804
  }
15703
15805
  async function collectE2eAccelerationGaps(root) {
@@ -16152,6 +16254,15 @@ async function nextReportDir(root = DEFAULT_REPORT_ROOT, create = false, today =
16152
16254
  }
16153
16255
  return reportDir;
16154
16256
  }
16257
+ function reportKeyValue(text5, key) {
16258
+ const escaped = key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16259
+ const match = new RegExp(`^${escaped}\\s*(.+)$`, "im").exec(text5);
16260
+ return match?.[1]?.trim() ?? "";
16261
+ }
16262
+ function reportCaseList(text5, key) {
16263
+ const value = reportKeyValue(text5, key);
16264
+ return value.split(/[,\s,、;;]+/).map((item) => item.trim()).filter((item) => /^[A-Za-z0-9_-]+$/.test(item));
16265
+ }
16155
16266
  async function lintReport(root = DEFAULT_REPORT_ROOT) {
16156
16267
  if (!await exists3(root)) return [`report root not found: ${root}`];
16157
16268
  const errors = [];
@@ -16169,7 +16280,28 @@ async function lintReport(root = DEFAULT_REPORT_ROOT) {
16169
16280
  const reportPath = path13.join(runDir, reportName);
16170
16281
  const text5 = await readText(reportPath);
16171
16282
  for (const key of REPORT_REQUIRED_KEYS) if (!text5.includes(key)) errors.push(`${reportPath}: missing \`${key}\``);
16283
+ for (const key of REPORT_EXECUTION_KEYS) if (!text5.includes(key)) errors.push(`${reportPath}: missing \`${key}\``);
16172
16284
  for (const heading of REPORT_REQUIRED_HEADINGS) if (!text5.includes(heading)) errors.push(`${reportPath}: missing \`${heading}\``);
16285
+ const plannedCases = reportCaseList(text5, "planned_cases:");
16286
+ const executedCases = reportCaseList(text5, "executed_cases:");
16287
+ const missingExecuted = plannedCases.filter((caseId) => !executedCases.includes(caseId));
16288
+ const unexpectedExecuted = executedCases.filter((caseId) => !plannedCases.includes(caseId));
16289
+ if (plannedCases.length > 0 && missingExecuted.length > 0) {
16290
+ errors.push(`[test_suite.report.case_reconciliation] ${reportPath}: planned_cases \u4E2D\u5B58\u5728\u672A\u6267\u884C\u7528\u4F8B: ${missingExecuted.join(", ")}\uFF1B\u62A5\u544A\u5FC5\u987B\u5199\u660E blocked/not run \u539F\u56E0\u5E76\u964D\u7EA7\u7ED3\u8BBA`);
16291
+ }
16292
+ if (unexpectedExecuted.length > 0) {
16293
+ errors.push(`[test_suite.report.case_reconciliation] ${reportPath}: executed_cases \u5305\u542B\u4E0D\u5728 planned_cases \u4E2D\u7684\u7528\u4F8B: ${unexpectedExecuted.join(", ")}`);
16294
+ }
16295
+ const resultValue = reportKeyValue(text5, "result:").toLowerCase();
16296
+ if (NOT_RUN_RE.test(text5) && /pass|passed|complete|success|通过|完整/.test(resultValue) && !/partial|stage|blocked|阶段|局部|不完整/.test(resultValue)) {
16297
+ errors.push(`[test_suite.report.not_run_downgrade] ${reportPath}: \u62A5\u544A\u5B58\u5728 not-run/\u672A\u6267\u884C\u7528\u4F8B\u4F46 result \u662F\u5B8C\u6574\u7ED3\u8BBA\uFF1B\u5FC5\u987B\u964D\u7EA7\u4E3A partial/stage \u6216\u8BF4\u660E\u7528\u6237\u786E\u8BA4\u7F29\u5C0F\u8303\u56F4`);
16298
+ }
16299
+ if (PAGE_CONCLUSION_RE.test(text5) && !BROWSER_TOOL_RE.test(text5)) {
16300
+ errors.push(`[test_suite.report.page_conclusion_browser] ${reportPath}: \u9875\u9762/\u6D4F\u89C8\u5668\u7ED3\u8BBA\u5FC5\u987B\u5305\u542B browser_tool \u8BC1\u636E\uFF1BAPI/readback \u4E0D\u80FD\u5192\u5145\u9875\u9762\u9A8C\u8BC1`);
16301
+ }
16302
+ if (/browser[_ -]?blocked|浏览器阻塞|无可用浏览器工具/i.test(text5) && !/browser_status:\s*blocked|页面结论停止|停止页面结论/i.test(text5)) {
16303
+ errors.push(`[test_suite.report.browser_blocked] ${reportPath}: \u6D4F\u89C8\u5668\u963B\u585E\u62A5\u544A\u5FC5\u987B\u4F7F\u7528 browser_status: blocked \u6A21\u677F\uFF0C\u5E76\u505C\u6B62\u9875\u9762\u7ED3\u8BBA`);
16304
+ }
16173
16305
  const imageRefs = [...text5.matchAll(IMAGE_RE)].map((match) => match[1]);
16174
16306
  if (imageRefs.length === 0) errors.push(`${reportPath}: missing embedded screenshot image`);
16175
16307
  const screenshotsDir = path13.join(runDir, "screenshots");