bpmax-cli 0.2.1-beta.85 → 0.2.1-beta.87
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/dist/bin.js +633 -72
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/skills/bpmax-ai-taskbook/SKILL.md +4 -0
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +20 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +2 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +2 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +1 -1
package/dist/bin.js
CHANGED
|
@@ -540,7 +540,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
|
|
|
540
540
|
// package.json
|
|
541
541
|
var package_default = {
|
|
542
542
|
name: "bpmax-cli",
|
|
543
|
-
version: "0.2.1-beta.
|
|
543
|
+
version: "0.2.1-beta.87",
|
|
544
544
|
description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
545
545
|
type: "module",
|
|
546
546
|
bin: {
|
|
@@ -5143,6 +5143,51 @@ function matchesBoundary(path29, declared) {
|
|
|
5143
5143
|
}
|
|
5144
5144
|
return path29 === normalized || path29.startsWith(`${normalized}/`);
|
|
5145
5145
|
}
|
|
5146
|
+
var LIST_TEMPLATE_PRESENTATION_PATH = /\/(?:props\/)?(?:width|minWidth|align|headerAlign|showOverflowTooltip|fixed|sortable|className)$/;
|
|
5147
|
+
function isPresentationOnlyChange(changedPaths) {
|
|
5148
|
+
return changedPaths.length > 0 && changedPaths.every((path29) => LIST_TEMPLATE_PRESENTATION_PATH.test(path29));
|
|
5149
|
+
}
|
|
5150
|
+
function isPresentationOnlyListTemplateChange(changedPaths) {
|
|
5151
|
+
return isPresentationOnlyChange([...changedPaths]);
|
|
5152
|
+
}
|
|
5153
|
+
function validateListTemplateColumnWidthEvidence(value, context2) {
|
|
5154
|
+
if (!isRecord5(value)) {
|
|
5155
|
+
throw new Error("[list_template_column_width_report_invalid] Column-width report must be a JSON object.");
|
|
5156
|
+
}
|
|
5157
|
+
if (value.schema_version !== 1 || value.result !== "pass") {
|
|
5158
|
+
throw new Error('[list_template_column_width_report_invalid] Column-width report must use schema_version=1 and result="pass".');
|
|
5159
|
+
}
|
|
5160
|
+
if (value.template_id !== context2.templateId || value.profile !== context2.profile) {
|
|
5161
|
+
throw new Error("[list_template_column_width_report_mismatch] Column-width report is not bound to this template and profile.");
|
|
5162
|
+
}
|
|
5163
|
+
if (value.submit_payload_hash !== context2.payloadHash) {
|
|
5164
|
+
throw new Error("[list_template_column_width_report_mismatch] Column-width report is not bound to this submit payload.");
|
|
5165
|
+
}
|
|
5166
|
+
const columns = Array.isArray(value.columns) ? value.columns.filter(isRecord5) : [];
|
|
5167
|
+
if (!columns.length) {
|
|
5168
|
+
throw new Error("[list_template_column_width_report_invalid] Column-width report must record at least one measured column.");
|
|
5169
|
+
}
|
|
5170
|
+
const unmeasured = columns.filter((column) => typeof column.truncated !== "boolean");
|
|
5171
|
+
if (unmeasured.length) {
|
|
5172
|
+
throw new Error(
|
|
5173
|
+
`[list_template_column_width_report_invalid] Every measured column must record truncated: true|false; missing for ${unmeasured.map((column) => String(column.title ?? column.prop ?? "<unknown>")).join(", ")}.`
|
|
5174
|
+
);
|
|
5175
|
+
}
|
|
5176
|
+
const truncated = columns.filter((column) => column.truncated === true);
|
|
5177
|
+
if (truncated.length) {
|
|
5178
|
+
throw new Error(
|
|
5179
|
+
`[list_template_column_width_report_truncated] Rendered columns still truncate their content: ${truncated.map((column) => String(column.title ?? column.prop ?? "<unknown>")).join(", ")}. Increase the width instead of overriding the gate.`
|
|
5180
|
+
);
|
|
5181
|
+
}
|
|
5182
|
+
return {
|
|
5183
|
+
schema_version: 1,
|
|
5184
|
+
kind: "list_template_column_width_evidence",
|
|
5185
|
+
template_id: context2.templateId,
|
|
5186
|
+
profile: context2.profile,
|
|
5187
|
+
submit_payload_hash: context2.payloadHash,
|
|
5188
|
+
measured_columns: columns.length
|
|
5189
|
+
};
|
|
5190
|
+
}
|
|
5146
5191
|
function analyzeListTemplatePermissionBoundary(raw, work, manifest) {
|
|
5147
5192
|
const changedPaths = changedJsonPaths(raw, work);
|
|
5148
5193
|
const permissionRelated = changedPaths.some((path29) => containsPermissionIdentifier(path29) || containsPermissionIdentifier(changedTextFragment(
|
|
@@ -5180,6 +5225,7 @@ function analyzeListTemplatePermissionBoundary(raw, work, manifest) {
|
|
|
5180
5225
|
boundary: {
|
|
5181
5226
|
schema_version: 1,
|
|
5182
5227
|
change_type: "list-template-permission",
|
|
5228
|
+
presentation_only: isPresentationOnlyChange(changedPaths),
|
|
5183
5229
|
allowed_paths: allowedPaths,
|
|
5184
5230
|
allowed_functions: allowedFunctions,
|
|
5185
5231
|
forbidden_paths: forbiddenPaths,
|
|
@@ -5328,6 +5374,7 @@ function numericConfigResourcePath(resource, id, query = "") {
|
|
|
5328
5374
|
}
|
|
5329
5375
|
return `/${resource}/${encodeURIComponent(normalized)}${query}`;
|
|
5330
5376
|
}
|
|
5377
|
+
var PLATFORM_BUILTIN_FLOW_CATEGORIES = /* @__PURE__ */ new Set(["matrix"]);
|
|
5331
5378
|
function configWorkflowError(message, details) {
|
|
5332
5379
|
return Object.assign(new Error(message), details);
|
|
5333
5380
|
}
|
|
@@ -7708,18 +7755,18 @@ function validateFlowTemplateUrgentReminder(value, errors) {
|
|
|
7708
7755
|
}
|
|
7709
7756
|
validateOptionalBoolean(nextErrors, config, "enabled", pathName);
|
|
7710
7757
|
validateOptionalBoolean(nextErrors, config, "auto", pathName);
|
|
7758
|
+
validateOptionalBoolean(nextErrors, config, "enable_auto_action", pathName);
|
|
7711
7759
|
if (config.enabled !== true) {
|
|
7712
7760
|
return;
|
|
7713
7761
|
}
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
if (!action) {
|
|
7717
|
-
nextErrors.push(`${pathName}.auto_action is required when auto processing is enabled.`);
|
|
7718
|
-
}
|
|
7762
|
+
const action = typeof config.auto_action === "string" ? config.auto_action.trim() : "";
|
|
7763
|
+
if (action) {
|
|
7719
7764
|
const delay2 = config.auto_action_deplay ?? config.auto_action_delay;
|
|
7720
7765
|
if (delay2 === void 0 || delay2 === null || String(delay2).trim() === "") {
|
|
7721
7766
|
nextErrors.push(`${pathName}.auto_action_deplay is required when auto processing is enabled; the plugin field name is auto_action_deplay.`);
|
|
7722
7767
|
}
|
|
7768
|
+
} else if (config.enable_auto_action === true) {
|
|
7769
|
+
nextErrors.push(`${pathName}.auto_action is required when auto processing is enabled.`);
|
|
7723
7770
|
}
|
|
7724
7771
|
};
|
|
7725
7772
|
inspect(isRecord6(data.meta) ? data.meta.plugin_urgent_reminder : void 0, "data.meta.plugin_urgent_reminder");
|
|
@@ -8873,6 +8920,9 @@ async function auditFlowCategoryReference(flowWork, profile) {
|
|
|
8873
8920
|
);
|
|
8874
8921
|
const categories = flowCategoryRecords(response).filter(usableFlowCategory);
|
|
8875
8922
|
const availableKeys = [...new Set(categories.map((record2) => String(record2.key).trim()))].sort();
|
|
8923
|
+
if (availableKeys.includes(configuredKey)) {
|
|
8924
|
+
return { errors: [], configuredKey, status: "verified", availableKeys, categories };
|
|
8925
|
+
}
|
|
8876
8926
|
if (!availableKeys.length) {
|
|
8877
8927
|
return {
|
|
8878
8928
|
errors: ["$.category cannot be validated because the current profile returned no active flow categories."],
|
|
@@ -8882,16 +8932,16 @@ async function auditFlowCategoryReference(flowWork, profile) {
|
|
|
8882
8932
|
categories
|
|
8883
8933
|
};
|
|
8884
8934
|
}
|
|
8885
|
-
if (
|
|
8886
|
-
return {
|
|
8887
|
-
errors: [`$.category references unknown flow category '${configuredKey}'; available keys: ${availableKeys.join(", ")}.`],
|
|
8888
|
-
configuredKey,
|
|
8889
|
-
status: "invalid",
|
|
8890
|
-
availableKeys,
|
|
8891
|
-
categories
|
|
8892
|
-
};
|
|
8935
|
+
if (PLATFORM_BUILTIN_FLOW_CATEGORIES.has(configuredKey)) {
|
|
8936
|
+
return { errors: [], configuredKey, status: "platform_builtin", availableKeys, categories };
|
|
8893
8937
|
}
|
|
8894
|
-
return {
|
|
8938
|
+
return {
|
|
8939
|
+
errors: [`$.category references unknown flow category '${configuredKey}'; available keys: ${availableKeys.join(", ")}.`],
|
|
8940
|
+
configuredKey,
|
|
8941
|
+
status: "invalid",
|
|
8942
|
+
availableKeys,
|
|
8943
|
+
categories
|
|
8944
|
+
};
|
|
8895
8945
|
} catch (error) {
|
|
8896
8946
|
return {
|
|
8897
8947
|
errors: [`$.category cannot be validated against the current profile: ${error instanceof Error ? error.message : String(error)}.`],
|
|
@@ -9945,7 +9995,40 @@ function hasListTemplateOverflowDisclosure(column) {
|
|
|
9945
9995
|
visit(column.createElement);
|
|
9946
9996
|
return disclosed;
|
|
9947
9997
|
}
|
|
9948
|
-
|
|
9998
|
+
var LIST_TEMPLATE_CONTENT_MIN_WIDTH = [
|
|
9999
|
+
// `编码`/`code` only when the column is a document number, not every "code" word:
|
|
10000
|
+
// 门店编码 is an identifier list column and does need room, so include it, but
|
|
10001
|
+
// keep the width below a full date-stamped serial number.
|
|
10002
|
+
{ kind: "document_no", pattern: /(单号|单据号|流水号|订单号|合同号|批次号)/i, minWidth: 180, why: "\u5355\u53F7\u7C7B\u5185\u5BB9\u542B\u65E5\u671F\u6BB5\u6216\u524D\u7F00\uFF0C\u901A\u5E38\u9700\u8981 180px \u4EE5\u4E0A" },
|
|
10003
|
+
{ kind: "identifier", pattern: /(编码|编号|\bno\b|\bsn\b|\bcode\b|\bid\b)/i, minWidth: 130, why: "\u7F16\u7801/\u7F16\u53F7\u7C7B\u5185\u5BB9\u901A\u5E38\u9700\u8981 130px \u4EE5\u4E0A" },
|
|
10004
|
+
{ kind: "date", pattern: /(日期|时间|截止|\bdate\b|\btime\b|_at\b)/i, minWidth: 130, why: "\u65E5\u671F\u5E38\u5E26\u56FE\u6807\u4E0E\u65F6:\u5206\uFF0C\u901A\u5E38\u9700\u8981 130px \u4EE5\u4E0A" },
|
|
10005
|
+
{ kind: "people", pattern: /(负责人|处理人|申请人|创建人|审批人|经办人|owner|assignee|creator|approver|manager)/i, minWidth: 130, why: "\u4EBA\u5458\u5217\u542B\u5934\u50CF\u6216\u201C\u59D3\u540D | \u7EC4\u7EC7\u201D\uFF0C\u901A\u5E38\u9700\u8981 130px \u4EE5\u4E0A" },
|
|
10006
|
+
// Only multi-value shapes are listed: a plain 状态 column renders one short enum
|
|
10007
|
+
// and is usually fine at 110px, so it must not be pulled into this rule.
|
|
10008
|
+
{ kind: "multi_value", pattern: /(包件|范围|标签|多选|\btags?\b|\bscope\b)/i, minWidth: 180, why: "\u591A\u503C\u62FC\u63A5\u5217\u4F1A\u968F\u53D6\u503C\u6570\u91CF\u53D8\u957F\uFF0C\u901A\u5E38\u9700\u8981 180px \u4EE5\u4E0A" }
|
|
10009
|
+
];
|
|
10010
|
+
function listTemplateContentMinWidth(column) {
|
|
10011
|
+
const title = typeof column.title === "string" ? column.title : "";
|
|
10012
|
+
const key = typeof column.key === "string" ? column.key : typeof column.prop === "string" ? column.prop : "";
|
|
10013
|
+
const renderer = textOf2(column.createElement);
|
|
10014
|
+
const probe = `${title} ${key} ${renderer}`;
|
|
10015
|
+
const match = LIST_TEMPLATE_CONTENT_MIN_WIDTH.find((entry) => entry.pattern.test(probe));
|
|
10016
|
+
if (match) {
|
|
10017
|
+
if (/\.join\s*\(|\{\{\s*[^}]*\}\}\s*[,,]/.test(renderer)) {
|
|
10018
|
+
return { minWidth: Math.max(match.minWidth, 180), why: "\u5355\u5143\u683C\u62FC\u63A5\u4E86\u591A\u4E2A\u503C\uFF0C\u5BBD\u5EA6\u4F1A\u968F\u53D6\u503C\u6570\u91CF\u589E\u957F" };
|
|
10019
|
+
}
|
|
10020
|
+
return { minWidth: match.minWidth, why: match.why };
|
|
10021
|
+
}
|
|
10022
|
+
if (/el-avatar/.test(renderer)) {
|
|
10023
|
+
return { minWidth: 130, why: "\u5355\u5143\u683C\u542B\u5934\u50CF\uFF0C\u9700\u8981\u4E3A\u5934\u50CF\u548C\u59D3\u540D\u7559\u51FA 130px \u4EE5\u4E0A" };
|
|
10024
|
+
}
|
|
10025
|
+
return void 0;
|
|
10026
|
+
}
|
|
10027
|
+
function listTemplateUsesFixedWidthOnly(column) {
|
|
10028
|
+
const props = isRecord6(column.props) ? column.props : {};
|
|
10029
|
+
return props.width !== void 0 && props.width !== null && props.width !== "";
|
|
10030
|
+
}
|
|
10031
|
+
function validateListTemplateColumnWidths(columns, errors, warnings = []) {
|
|
9949
10032
|
const recordColumns = columns.filter(isRecord6);
|
|
9950
10033
|
const dataColumns = recordColumns.filter((column) => !isListTemplateUtilityColumn(column));
|
|
9951
10034
|
if (dataColumns.length === 0) {
|
|
@@ -9953,6 +10036,7 @@ function validateListTemplateColumnWidths(columns, errors) {
|
|
|
9953
10036
|
return;
|
|
9954
10037
|
}
|
|
9955
10038
|
let adaptiveColumnCount = 0;
|
|
10039
|
+
const pinnedToTitleFloor = [];
|
|
9956
10040
|
recordColumns.forEach((column, index) => {
|
|
9957
10041
|
const props = isRecord6(column.props) ? column.props : {};
|
|
9958
10042
|
const label = listTemplateColumnLabel(column, index);
|
|
@@ -9979,6 +10063,17 @@ function validateListTemplateColumnWidths(columns, errors) {
|
|
|
9979
10063
|
const requiredWidth = estimatedListTemplateTitleWidth(title);
|
|
9980
10064
|
if (effectiveReadableWidth < requiredWidth) {
|
|
9981
10065
|
errors.push(`\u5217\u8868\u6A21\u677F\u5217\u201C${label}\u201D\u5BBD\u5EA6\u8FC7\u5C0F\uFF0C\u6807\u9898\u5B8C\u6574\u5C55\u793A\u81F3\u5C11\u9700\u8981\u7EA6 ${requiredWidth}px\u3002`);
|
|
10066
|
+
} else if (Math.abs(effectiveReadableWidth - requiredWidth) <= 2) {
|
|
10067
|
+
pinnedToTitleFloor.push(label);
|
|
10068
|
+
}
|
|
10069
|
+
}
|
|
10070
|
+
if (isDataColumn && effectiveReadableWidth !== void 0) {
|
|
10071
|
+
const content = listTemplateContentMinWidth(column);
|
|
10072
|
+
if (content && effectiveReadableWidth < content.minWidth) {
|
|
10073
|
+
const hint = listTemplateUsesFixedWidthOnly(column) ? `\uFF1B\u56FA\u5B9A\u5BBD\u5EA6\u5217\u53EF\u6309\u6B64\u4E0B\u9650\u914D\u7F6E\uFF0C\u6216\u6539\u7528 minWidth \u8BA9\u5185\u5BB9\u53C2\u4E0E\u6491\u5F00` : "";
|
|
10074
|
+
warnings.push(
|
|
10075
|
+
`\u5217\u8868\u6A21\u677F\u5217\u201C${label}\u201D\u5F53\u524D\u7EA6 ${effectiveReadableWidth}px\uFF0C\u6309\u5217\u8BED\u4E49\uFF08${content.why}\uFF09\u5185\u5BB9\u53EF\u80FD\u88AB\u622A\u65AD\uFF0C\u5EFA\u8BAE\u81F3\u5C11 ${content.minWidth}px${hint}\u3002\u8FD9\u662F\u6309\u5B57\u6BB5\u8BED\u4E49\u7684\u4F30\u7B97\uFF0C\u8BF7\u4EE5\u771F\u5B9E\u9875\u9762\u6BCF\u5217 scrollWidth == clientWidth \u4E3A\u51C6\u3002`
|
|
10076
|
+
);
|
|
9982
10077
|
}
|
|
9983
10078
|
}
|
|
9984
10079
|
if (isDataColumn && hasWidth && isListTemplateLongTextColumn(column) && !hasListTemplateOverflowDisclosure(column)) {
|
|
@@ -9988,6 +10083,11 @@ function validateListTemplateColumnWidths(columns, errors) {
|
|
|
9988
10083
|
if (adaptiveColumnCount === 0) {
|
|
9989
10084
|
errors.push("\u5217\u8868\u6A21\u677F\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u81EA\u9002\u5E94\u6570\u636E\u5217\uFF1B\u8BF7\u5728\u4E00\u4E2A\u975E\u64CD\u4F5C\u5217\u4E0A\u5220\u9664 props.width\uFF0C\u53EF\u4FDD\u7559 props.minWidth\u3002");
|
|
9990
10085
|
}
|
|
10086
|
+
if (pinnedToTitleFloor.length >= 2) {
|
|
10087
|
+
warnings.push(
|
|
10088
|
+
`\u5217\u8868\u6A21\u677F\u6709 ${pinnedToTitleFloor.length} \u5217\u5BBD\u5EA6\u6B63\u597D\u7B49\u4E8E\u8868\u5934\u4E0B\u9650\uFF08${pinnedToTitleFloor.slice(0, 6).join("\u3001")}${pinnedToTitleFloor.length > 6 ? " \u7B49" : ""}\uFF09\u3002\u6309\u8868\u5934\u4E0B\u9650\u914D\u5BBD\u5EA6\u4F1A\u8BA9\u6BCF\u884C\u5185\u5BB9\u88AB\u7701\u7565\u53F7\u622A\u65AD\uFF1B\u8BF7\u6309\u5B57\u6BB5\u8BED\u4E49\u7ED9\u8DB3\u5BBD\u5EA6\uFF0C\u6216\u6539\u7528\u81EA\u9002\u5E94\u5217\u3002`
|
|
10089
|
+
);
|
|
10090
|
+
}
|
|
9991
10091
|
}
|
|
9992
10092
|
function classifyListTemplateAction(label) {
|
|
9993
10093
|
if (/(删除|移除|作废|delete|remove|discard)/i.test(label)) {
|
|
@@ -10361,6 +10461,65 @@ function validateDeletePermissionGuard(item, errors) {
|
|
|
10361
10461
|
errors.push("list-template delete action must include a permission guard using ctx.$CAN_DELETE or an equivalent project.delete/project.delete.my + owner check.");
|
|
10362
10462
|
}
|
|
10363
10463
|
}
|
|
10464
|
+
var LIST_TEMPLATE_ROW_CONTEXT_PATTERN = /\{\{\s*__id\s*\}\}|ctx\.__id\b|ctx\.\$PROJECT\b|\{\{\s*(?:id|project_id)\s*\}\}/;
|
|
10465
|
+
function listTemplateLinkTargets(node) {
|
|
10466
|
+
const attribute = isRecord6(node.attribute) ? node.attribute : {};
|
|
10467
|
+
const props = isRecord6(attribute.props) ? attribute.props : {};
|
|
10468
|
+
const targets = [];
|
|
10469
|
+
const visit = (value) => {
|
|
10470
|
+
if (value === void 0 || value === null) return;
|
|
10471
|
+
if (typeof value === "string") {
|
|
10472
|
+
if (value.trim()) targets.push(value);
|
|
10473
|
+
return;
|
|
10474
|
+
}
|
|
10475
|
+
if (Array.isArray(value)) {
|
|
10476
|
+
value.forEach(visit);
|
|
10477
|
+
return;
|
|
10478
|
+
}
|
|
10479
|
+
if (!isRecord6(value)) return;
|
|
10480
|
+
if (typeof value.$template === "string") {
|
|
10481
|
+
targets.push(value.$template);
|
|
10482
|
+
return;
|
|
10483
|
+
}
|
|
10484
|
+
Object.values(value).forEach(visit);
|
|
10485
|
+
};
|
|
10486
|
+
visit(props.to);
|
|
10487
|
+
visit(props.href);
|
|
10488
|
+
visit(attribute.to);
|
|
10489
|
+
return targets;
|
|
10490
|
+
}
|
|
10491
|
+
function hardCodedStepNameGuard(text5) {
|
|
10492
|
+
if (!/\bcurrent_(?:flow_)?step_name\b/.test(text5)) return false;
|
|
10493
|
+
if (/\bcurrent_(?:flow_)?step_name\b\s*(?:===|==|!==|!=)\s*['"`]/.test(text5)) return true;
|
|
10494
|
+
if (/['"`][^'"`]*['"`]\s*(?:===|==|!==|!=)\s*\bcurrent_(?:flow_)?step_name\b/.test(text5)) return true;
|
|
10495
|
+
if (/\bcurrent_(?:flow_)?step_name\b[^\n]{0,40}?\.includes\s*\(/.test(text5)) return true;
|
|
10496
|
+
return Boolean(/!{1,2}\s*ctx\.current_(?:flow_)?step_name\b/.test(text5));
|
|
10497
|
+
}
|
|
10498
|
+
function lintListTemplateRowContext(columns, warnings) {
|
|
10499
|
+
for (const column of columns.filter(isRecord6)) {
|
|
10500
|
+
const label = listTemplateColumnLabel(column, columns.indexOf(column));
|
|
10501
|
+
const visit = (value) => {
|
|
10502
|
+
if (value === void 0 || value === null) return;
|
|
10503
|
+
if (Array.isArray(value)) {
|
|
10504
|
+
value.forEach(visit);
|
|
10505
|
+
return;
|
|
10506
|
+
}
|
|
10507
|
+
if (!isRecord6(value)) return;
|
|
10508
|
+
if (value.is === "router-link") {
|
|
10509
|
+
const targets = listTemplateLinkTargets(value);
|
|
10510
|
+
const joined = targets.join("\n");
|
|
10511
|
+
const looksLikeNavigation = /\/(?:w:|project|myProject|project_detail|projectContinue)\b|workspace/.test(joined);
|
|
10512
|
+
if (looksLikeNavigation && !LIST_TEMPLATE_ROW_CONTEXT_PATTERN.test(joined)) {
|
|
10513
|
+
warnings.push(
|
|
10514
|
+
`\u5217\u8868\u6A21\u677F\u5217\u201C${label}\u201D\u7684\u4E0B\u94BB\u94FE\u63A5\u6CA1\u6709\u643A\u5E26\u884C\u4E0A\u4E0B\u6587\uFF08\u672A\u89C1 {{__id}} \u6216 ctx.__id\uFF09\uFF1A\u6BCF\u884C\u90FD\u4F1A\u8DF3\u5230\u540C\u4E00\u4E2A\u5168\u5C40\u9875\u9762\u3002\u82E5\u662F\u884C\u5185\u4E0B\u94BB\uFF0C\u8BF7\u628A\u884C id \u6216\u4E1A\u52A1\u7F16\u53F7\u5E26\u8FDB\u76EE\u6807 URL\uFF1B\u786E\u5B9E\u662F\u5168\u5C40\u52A8\u4F5C\u8BF7\u5728\u94FE\u63A5\u6587\u6848\u548C skill \u5907\u6CE8\u4E2D\u663E\u5F0F\u8BF4\u660E\u3002`
|
|
10515
|
+
);
|
|
10516
|
+
}
|
|
10517
|
+
}
|
|
10518
|
+
Object.values(value).forEach(visit);
|
|
10519
|
+
};
|
|
10520
|
+
visit(column.createElement);
|
|
10521
|
+
}
|
|
10522
|
+
}
|
|
10364
10523
|
function validateListTemplateActionGate(value, errors, warnings) {
|
|
10365
10524
|
const nextErrors = [];
|
|
10366
10525
|
const content = parseTemplateContent(value, nextErrors);
|
|
@@ -10383,8 +10542,11 @@ function validateListTemplateActionGate(value, errors, warnings) {
|
|
|
10383
10542
|
lintListTemplateDatasetFieldReferences(value, content, nextErrors);
|
|
10384
10543
|
lintListTemplateNullableDomCoercion(content, nextErrors);
|
|
10385
10544
|
lintListTemplateRuntimeStateConflicts(content, nextErrors);
|
|
10386
|
-
if (warnings)
|
|
10387
|
-
|
|
10545
|
+
if (warnings) {
|
|
10546
|
+
lintListTemplateRowRendererSideEffects(columns, warnings);
|
|
10547
|
+
lintListTemplateRowContext(columns, warnings);
|
|
10548
|
+
}
|
|
10549
|
+
validateListTemplateColumnWidths(columns, nextErrors, warnings);
|
|
10388
10550
|
validateListTemplateIcons(columns, nextErrors);
|
|
10389
10551
|
const operationColumn = columns.filter(isRecord6).find(isListTemplateOperationColumn);
|
|
10390
10552
|
if (!operationColumn) {
|
|
@@ -10412,6 +10574,14 @@ function validateListTemplateActionGate(value, errors, warnings) {
|
|
|
10412
10574
|
else warnings?.push(message);
|
|
10413
10575
|
}
|
|
10414
10576
|
});
|
|
10577
|
+
classified.forEach((item) => {
|
|
10578
|
+
const guards = [...item.inheritedGuards, ...listTemplateNodeGuards(item.node)];
|
|
10579
|
+
if (guards.some((guard) => hardCodedStepNameGuard(guard.text))) {
|
|
10580
|
+
warnings?.push(
|
|
10581
|
+
`list-template \u64CD\u4F5C\u6309\u94AE ${JSON.stringify(item.label.trim() || item.kind)} \u7684\u663E\u793A\u6761\u4EF6\u4F9D\u8D56 current_step_name \u7684\u5B57\u9762\u91CF\u6216\u5B58\u5728\u6027\u5224\u65AD\uFF1B\u73AF\u8282\u6539\u540D\u6216\u589E\u5220\u8282\u70B9\u540E\u8BE5\u6761\u4EF6\u4F1A\u9759\u9ED8\u5931\u6548\u3002\u8BF7\u6539\u7528 status\u3001\u662F\u5426\u5DF2\u5F00\u6807\u3001\u662F\u5426\u5DF2\u53D1\u51FA\u7B49\u8BED\u4E49\u5B57\u6BB5\u3002`
|
|
10582
|
+
);
|
|
10583
|
+
}
|
|
10584
|
+
});
|
|
10415
10585
|
}
|
|
10416
10586
|
if (!nextErrors.length) {
|
|
10417
10587
|
return;
|
|
@@ -17782,16 +17952,20 @@ async function buildConfigSubmitPayload(domain, workFile, outFile, metaFile, opt
|
|
|
17782
17952
|
}
|
|
17783
17953
|
const unverified = Array.isArray(impactReport?.unverified_surfaces) ? impactReport.unverified_surfaces.filter((item) => typeof item === "string") : [];
|
|
17784
17954
|
const impactStatus = String(impactReport?.impact_status ?? "not_provided");
|
|
17785
|
-
const
|
|
17955
|
+
const presentationOnly = isPresentationOnlyListTemplateChange(boundary.changed_paths);
|
|
17956
|
+
const validationRequired = boundary.permission_related || !presentationOnly && ["review_recommended", "required_collateral_review"].includes(impactStatus) && (unverified.includes("runtime-script") || unverified.includes("e2e"));
|
|
17786
17957
|
listTemplateSafety = {
|
|
17787
17958
|
schema_version: 1,
|
|
17788
17959
|
permission_related: boundary.permission_related,
|
|
17960
|
+
presentation_only: presentationOnly,
|
|
17789
17961
|
changed_paths: boundary.changed_paths,
|
|
17790
17962
|
boundary: boundary.boundary,
|
|
17791
17963
|
impact_report: impactReport ?? null,
|
|
17792
17964
|
submit_gate: {
|
|
17793
17965
|
validation_required: validationRequired,
|
|
17794
|
-
|
|
17966
|
+
evidence_kind: validationRequired ? "permission_matrix" : presentationOnly ? "column_width_runtime_check" : null,
|
|
17967
|
+
unverified_surfaces: unverified,
|
|
17968
|
+
reason: validationRequired ? "permission or high-risk impact changes have unverified runtime-script/e2e surfaces" : presentationOnly ? "only presentation properties changed; a rendered column-width check is sufficient" : "no high-risk unverified surface detected"
|
|
17795
17969
|
}
|
|
17796
17970
|
};
|
|
17797
17971
|
}
|
|
@@ -18704,9 +18878,28 @@ async function submitConfigDomain(config, profile, domain, id, submitFile, confi
|
|
|
18704
18878
|
reason: options.overrideReason.trim(),
|
|
18705
18879
|
evidence_missing: true
|
|
18706
18880
|
};
|
|
18881
|
+
} else {
|
|
18882
|
+
const changedPaths = Array.isArray(safety.changed_paths) ? safety.changed_paths : [];
|
|
18883
|
+
const unverifiedSurfaces = Array.isArray(gate.unverified_surfaces) ? gate.unverified_surfaces : [];
|
|
18884
|
+
throw new Error(
|
|
18885
|
+
`[list_template_submit_validation_required] This list-template needs a permission/high-risk validation report. Reason: ${String(gate.reason ?? "unspecified")}. Changed paths: ${changedPaths.length ? changedPaths.slice(0, 8).join(", ") : "<none recorded>"}. Unverified surfaces: ${unverifiedSurfaces.length ? unverifiedSurfaces.join(", ") : "<none>"}. Provide --validation-report, or explicitly use --override-reason with a specific audited reason.`
|
|
18886
|
+
);
|
|
18887
|
+
}
|
|
18888
|
+
} else if (safety.presentation_only === true) {
|
|
18889
|
+
if (options.validationReportFile) {
|
|
18890
|
+
listTemplateValidation = validateListTemplateColumnWidthEvidence(
|
|
18891
|
+
await readJsonFile(options.validationReportFile),
|
|
18892
|
+
{ templateId: id, profile: profile.name, payloadHash: hashJson(submit.payload) }
|
|
18893
|
+
);
|
|
18894
|
+
} else if (typeof options.overrideReason === "string" && options.overrideReason.trim().length >= 12) {
|
|
18895
|
+
listTemplateOverride = {
|
|
18896
|
+
used: true,
|
|
18897
|
+
reason: options.overrideReason.trim(),
|
|
18898
|
+
evidence_missing: true
|
|
18899
|
+
};
|
|
18707
18900
|
} else {
|
|
18708
18901
|
throw new Error(
|
|
18709
|
-
|
|
18902
|
+
'[list_template_column_width_validation_required] Only presentation properties changed, so a permission matrix is not required. Provide --validation-report with a rendered column-width check (schema_version=1, result="pass", columns with truncated=false), or explicitly use --override-reason with a specific audited reason.'
|
|
18710
18903
|
);
|
|
18711
18904
|
}
|
|
18712
18905
|
}
|
|
@@ -29579,8 +29772,8 @@ async function syncTestSuiteRunReportUnlocked(manifestFile) {
|
|
|
29579
29772
|
async function syncTestSuiteRunReport(manifestFile) {
|
|
29580
29773
|
return withExecutionManifestLock(manifestFile, () => syncTestSuiteRunReportUnlocked(manifestFile));
|
|
29581
29774
|
}
|
|
29582
|
-
async function
|
|
29583
|
-
const
|
|
29775
|
+
async function previousBrowserScreenshotArtifacts(manifest, step) {
|
|
29776
|
+
const artifacts = /* @__PURE__ */ new Set();
|
|
29584
29777
|
for (const previous of manifest.steps) {
|
|
29585
29778
|
if (previous.step_no === step.step_no) break;
|
|
29586
29779
|
if (previous.status !== "pass" || !["browser", "browser_action", "e2e_create_page", "identity"].includes(previous.runner)) continue;
|
|
@@ -29589,11 +29782,21 @@ async function previousBrowserScreenshotHashes(manifest, step) {
|
|
|
29589
29782
|
const screenshot = typeof value.screenshot === "string" ? value.screenshot.trim() : "";
|
|
29590
29783
|
if (!screenshot) continue;
|
|
29591
29784
|
const screenshotPath = path18.resolve(path18.dirname(source), screenshot);
|
|
29592
|
-
|
|
29785
|
+
const identity = await fileIdentity(screenshotPath);
|
|
29786
|
+
if (identity) artifacts.add(identity);
|
|
29593
29787
|
}
|
|
29594
29788
|
}
|
|
29595
29789
|
}
|
|
29596
|
-
return
|
|
29790
|
+
return artifacts;
|
|
29791
|
+
}
|
|
29792
|
+
async function fileIdentity(file) {
|
|
29793
|
+
try {
|
|
29794
|
+
const info = await stat11(file);
|
|
29795
|
+
if (!info.isFile()) return null;
|
|
29796
|
+
return `${path18.resolve(file)}|${String(info.dev)}:${String(info.ino)}:${String(info.size)}`;
|
|
29797
|
+
} catch {
|
|
29798
|
+
return null;
|
|
29799
|
+
}
|
|
29597
29800
|
}
|
|
29598
29801
|
async function assertBrowserActionViewportEvidence(manifest, manifestPath, step, evidencePath) {
|
|
29599
29802
|
if (step.runner !== "browser_action" || !manifest.automation_file) return;
|
|
@@ -29690,9 +29893,10 @@ async function assertFormalExecutionEvidence(manifest, manifestPath, step, evide
|
|
|
29690
29893
|
(value) => value.transport === "chrome_identity_bridge" && value.browser_tool === "chrome:control-chrome" || value.transport === "playwright_context" && String(value.browser_tool || "").toLowerCase() === "playwright"
|
|
29691
29894
|
);
|
|
29692
29895
|
if (identityStepOperation(step) !== "unmock") {
|
|
29693
|
-
const
|
|
29896
|
+
const previousArtifacts = await previousBrowserScreenshotArtifacts(manifest, step);
|
|
29694
29897
|
for (const screenshot of screenshots) {
|
|
29695
|
-
|
|
29898
|
+
const identity = await fileIdentity(screenshot);
|
|
29899
|
+
if (identity && previousArtifacts.has(identity)) {
|
|
29696
29900
|
fail("identity pass evidence reuses an identical screenshot from an earlier step in this run", {
|
|
29697
29901
|
rule_id: "test_suite.run.duplicate_screenshot",
|
|
29698
29902
|
path: screenshot
|
|
@@ -29704,9 +29908,10 @@ async function assertFormalExecutionEvidence(manifest, manifestPath, step, evide
|
|
|
29704
29908
|
if (step.runner === "browser" || step.runner === "browser_action" || step.runner === "e2e_create_page") {
|
|
29705
29909
|
await assertBrowserActionViewportEvidence(manifest, manifestPath, step, evidencePath);
|
|
29706
29910
|
const screenshots = await browserEvidenceScreenshots(manifest, manifestPath, step, evidencePath);
|
|
29707
|
-
const
|
|
29911
|
+
const previousArtifacts = await previousBrowserScreenshotArtifacts(manifest, step);
|
|
29708
29912
|
for (const screenshot of screenshots) {
|
|
29709
|
-
|
|
29913
|
+
const identity = await fileIdentity(screenshot);
|
|
29914
|
+
if (identity && previousArtifacts.has(identity)) {
|
|
29710
29915
|
fail("browser pass evidence reuses an identical screenshot from an earlier step in this run", { rule_id: "test_suite.run.duplicate_screenshot", path: screenshot });
|
|
29711
29916
|
}
|
|
29712
29917
|
}
|
|
@@ -32778,11 +32983,26 @@ function messageUrlParameter(url, name) {
|
|
|
32778
32983
|
return "";
|
|
32779
32984
|
}
|
|
32780
32985
|
}
|
|
32986
|
+
function messageUrlProjectId(url) {
|
|
32987
|
+
let parsed;
|
|
32988
|
+
try {
|
|
32989
|
+
parsed = new URL(url, "https://bpmax.invalid");
|
|
32990
|
+
} catch {
|
|
32991
|
+
return "";
|
|
32992
|
+
}
|
|
32993
|
+
const numeric = (value) => /^\d+$/.test(value) ? value : "";
|
|
32994
|
+
const queryId = numeric((parsed.searchParams.get("id") ?? "").trim());
|
|
32995
|
+
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
32996
|
+
const detailIndex = segments.indexOf("project_detail");
|
|
32997
|
+
const pathId = detailIndex >= 0 && segments.length > detailIndex + 2 ? numeric(segments[detailIndex + 2].trim()) : "";
|
|
32998
|
+
if (queryId && pathId) return queryId === pathId ? queryId : "";
|
|
32999
|
+
return queryId || pathId;
|
|
33000
|
+
}
|
|
32781
33001
|
function browserMessageDeliveryMatches(records, expected) {
|
|
32782
33002
|
const projectId = String(expected.project_id ?? "").trim();
|
|
32783
33003
|
const stepId = String(expected.step_id ?? "").trim();
|
|
32784
33004
|
return records.filter((record2) => {
|
|
32785
|
-
const urlProjectId =
|
|
33005
|
+
const urlProjectId = messageUrlProjectId(record2.url);
|
|
32786
33006
|
const urlStepId = messageUrlParameter(record2.url, "step_id");
|
|
32787
33007
|
const requiresStepLink = String(expected.url_pattern ?? "").includes("projectContinue");
|
|
32788
33008
|
return record2.recipient_id === String(expected.recipient_id ?? "").trim() && boundMessageTextMatches(record2.title, expected.title) && boundMessageTextMatches(record2.content, expected.content) && boundMessageTextMatches(record2.url, expected.url_pattern) && urlProjectId === projectId && (!stepId || urlStepId === stepId) && (!requiresStepLink || /^\d+$/.test(urlStepId));
|
|
@@ -33036,18 +33256,85 @@ async function labelledControl(root, label) {
|
|
|
33036
33256
|
if (!await field.count()) throw new Error(`form.set_punishment field not found: ${label}`);
|
|
33037
33257
|
return editableLocator(field);
|
|
33038
33258
|
}
|
|
33039
|
-
async function
|
|
33259
|
+
async function selectOptionPopupCandidates(page, control) {
|
|
33260
|
+
const candidateSelectors = '.el-select-dropdown, .el-autocomplete-suggestion, [role="listbox"]';
|
|
33261
|
+
const rawBoundIds = await control.evaluate((element) => {
|
|
33262
|
+
const ids = [element.getAttribute("aria-controls"), element.getAttribute("aria-owns")].filter(Boolean).flatMap((value) => String(value).split(/\s+/)).filter(Boolean);
|
|
33263
|
+
const expanded = element.closest('[aria-expanded="true"]');
|
|
33264
|
+
if (expanded) {
|
|
33265
|
+
const controls = expanded.getAttribute("aria-controls") ?? expanded.getAttribute("aria-owns");
|
|
33266
|
+
if (controls) ids.push(...String(controls).split(/\s+/).filter(Boolean));
|
|
33267
|
+
}
|
|
33268
|
+
return [...new Set(ids)];
|
|
33269
|
+
}).catch(() => []);
|
|
33270
|
+
const boundIds = Array.isArray(rawBoundIds) ? rawBoundIds.filter((id) => typeof id === "string" && id.length > 0) : [];
|
|
33271
|
+
const candidates = [];
|
|
33272
|
+
if (boundIds.length) {
|
|
33273
|
+
const selector = boundIds.map((id) => `[id=${JSON.stringify(id)}]`).join(", ");
|
|
33274
|
+
candidates.push(page.locator(selector));
|
|
33275
|
+
}
|
|
33276
|
+
const formItem = nearestFormItem(control);
|
|
33277
|
+
if (await formItem.count()) {
|
|
33278
|
+
candidates.push(formItem.locator(candidateSelectors));
|
|
33279
|
+
}
|
|
33280
|
+
candidates.push(page.locator(candidateSelectors));
|
|
33281
|
+
return candidates;
|
|
33282
|
+
}
|
|
33283
|
+
async function selectBrowserOption(page, control, optionText, timeout) {
|
|
33040
33284
|
const tagName = await control.evaluate((element) => element.tagName.toLowerCase()).catch(() => "");
|
|
33041
33285
|
if (tagName === "select") {
|
|
33042
33286
|
await control.selectOption({ label: optionText });
|
|
33043
|
-
return;
|
|
33287
|
+
return String(await control.inputValue().catch(() => optionText)).trim() || optionText;
|
|
33044
33288
|
}
|
|
33045
33289
|
await control.click({ timeout });
|
|
33046
|
-
const
|
|
33047
|
-
|
|
33048
|
-
|
|
33049
|
-
|
|
33290
|
+
const optionSelectors = [
|
|
33291
|
+
".el-select-dropdown__item",
|
|
33292
|
+
".el-autocomplete-suggestion li",
|
|
33293
|
+
'[role="option"]'
|
|
33294
|
+
].join(", ");
|
|
33295
|
+
const expected = optionText.trim();
|
|
33296
|
+
const matched = [];
|
|
33297
|
+
for (const candidate of await selectOptionPopupCandidates(page, control)) {
|
|
33298
|
+
const popupCount = await candidate.count();
|
|
33299
|
+
for (let index = 0; index < popupCount; index += 1) {
|
|
33300
|
+
const popup = candidate.nth(index);
|
|
33301
|
+
if (!await popup.isVisible().catch(() => false)) continue;
|
|
33302
|
+
const options = popup.locator(optionSelectors);
|
|
33303
|
+
const optionCount = await options.count();
|
|
33304
|
+
for (let optionIndex = 0; optionIndex < optionCount; optionIndex += 1) {
|
|
33305
|
+
const option = options.nth(optionIndex);
|
|
33306
|
+
if (!await option.isVisible().catch(() => false)) continue;
|
|
33307
|
+
const label = String(await option.textContent() ?? "").replace(/\s+/g, " ").trim();
|
|
33308
|
+
const disabled = await option.evaluate((element) => element.classList.contains("is-disabled") || element.getAttribute("aria-disabled") === "true").catch(() => false);
|
|
33309
|
+
if (disabled || label !== expected) continue;
|
|
33310
|
+
matched.push(option);
|
|
33311
|
+
}
|
|
33312
|
+
if (matched.length) break;
|
|
33313
|
+
}
|
|
33314
|
+
if (matched.length) break;
|
|
33315
|
+
}
|
|
33316
|
+
if (matched.length !== 1) {
|
|
33317
|
+
throw new Error(`form.select_option requires exactly one visible option "${expected}" inside the control popup; found ${matched.length}`);
|
|
33050
33318
|
}
|
|
33319
|
+
await matched[0].hover({ timeout });
|
|
33320
|
+
await matched[0].click({ timeout });
|
|
33321
|
+
const readControl = async () => {
|
|
33322
|
+
const value = String(await control.inputValue().catch(() => "") ?? "").trim();
|
|
33323
|
+
const text5 = String(await control.textContent().catch(() => "") ?? "").replace(/\s+/g, " ").trim();
|
|
33324
|
+
return { value, text: text5 };
|
|
33325
|
+
};
|
|
33326
|
+
const selected = async () => {
|
|
33327
|
+
const actual2 = await readControl();
|
|
33328
|
+
return actual2.value === expected || actual2.text.includes(expected);
|
|
33329
|
+
};
|
|
33330
|
+
const deadline = Date.now() + Math.max(0, Math.min(timeout, 3e3));
|
|
33331
|
+
do {
|
|
33332
|
+
if (await selected()) return expected;
|
|
33333
|
+
if (Date.now() >= deadline) break;
|
|
33334
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
33335
|
+
} while (true);
|
|
33336
|
+
const actual = await readControl();
|
|
33337
|
+
throw new Error(`form.select_option readback mismatch: expected "${expected}", got value "${actual.value}" text "${actual.text}"`);
|
|
33051
33338
|
}
|
|
33052
33339
|
async function selectBrowserCascader(page, semanticTarget, value, timeout) {
|
|
33053
33340
|
const spec = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
@@ -33260,7 +33547,7 @@ async function setBrowserPunishment(page, semanticTarget, punishmentType, condit
|
|
|
33260
33547
|
"punishment-item-form-control"
|
|
33261
33548
|
);
|
|
33262
33549
|
const spec = browserPunishmentSpec(punishmentType, conditionValue);
|
|
33263
|
-
await
|
|
33550
|
+
await selectBrowserOption(page, await labelledControl(root, "\u5904\u7F5A\u7C7B\u578B"), spec.label, timeout);
|
|
33264
33551
|
if (spec.conditionLabel) {
|
|
33265
33552
|
const conditionControl = await labelledControl(root, spec.conditionLabel);
|
|
33266
33553
|
await conditionControl.fill(String(spec.conditionValue));
|
|
@@ -33485,24 +33772,6 @@ async function dateRangeInputLocators(locator) {
|
|
|
33485
33772
|
}
|
|
33486
33773
|
throw new Error("form.set_date_range target does not contain two visible editable inputs");
|
|
33487
33774
|
}
|
|
33488
|
-
async function clickFirstVisibleLocator(locator, timeoutMs = 0) {
|
|
33489
|
-
const deadline = Date.now() + Math.max(0, timeoutMs);
|
|
33490
|
-
do {
|
|
33491
|
-
const clicked = await locator.evaluateAll((elements) => {
|
|
33492
|
-
const candidate = elements.find((element) => {
|
|
33493
|
-
const style = window.getComputedStyle(element);
|
|
33494
|
-
const rect = element.getBoundingClientRect();
|
|
33495
|
-
return style.visibility !== "hidden" && style.display !== "none" && rect.width > 0 && rect.height > 0;
|
|
33496
|
-
});
|
|
33497
|
-
if (!candidate) return false;
|
|
33498
|
-
candidate.click();
|
|
33499
|
-
return true;
|
|
33500
|
-
}).catch(() => false);
|
|
33501
|
-
if (clicked) return true;
|
|
33502
|
-
if (Date.now() >= deadline) return false;
|
|
33503
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
33504
|
-
} while (true);
|
|
33505
|
-
}
|
|
33506
33775
|
async function tableLocator(page, table) {
|
|
33507
33776
|
const escaped = table.replace(/["\\]/g, "\\$&");
|
|
33508
33777
|
const direct = page.locator(`[data-table-key="${escaped}"], [table-key="${escaped}"], [data-key="${escaped}"]`);
|
|
@@ -33627,10 +33896,12 @@ async function executeAction(page, action, variables, runtime) {
|
|
|
33627
33896
|
};
|
|
33628
33897
|
}
|
|
33629
33898
|
case "form.select_option": {
|
|
33630
|
-
const target =
|
|
33631
|
-
const
|
|
33632
|
-
|
|
33633
|
-
|
|
33899
|
+
const target = next.target ?? { field: next.field };
|
|
33900
|
+
const semanticTarget = await visibleTargetLocator(page, target);
|
|
33901
|
+
const editable = await editableLocator(semanticTarget);
|
|
33902
|
+
const option = String(next.option ?? next.value ?? "");
|
|
33903
|
+
const actual = await selectBrowserOption(page, editable, option, timeout);
|
|
33904
|
+
return { assertion: { type: next.type, passed: true, target, option, actual } };
|
|
33634
33905
|
}
|
|
33635
33906
|
case "cascader.search_select": {
|
|
33636
33907
|
const target = next.target ?? { field: next.field };
|
|
@@ -36129,13 +36400,23 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36129
36400
|
const execution = executionRecord(state);
|
|
36130
36401
|
const current = currentStepRecord(state);
|
|
36131
36402
|
const lease = await identityLeaseStatus(path20.join(path20.dirname(manifest), "identity-lease.json"));
|
|
36132
|
-
if (!
|
|
36403
|
+
if (!lease || lease.browser_tool !== "playwright" || path20.resolve(lease.binding.execution_manifest || "") !== manifest || lease.binding.profile !== options.profile) {
|
|
36404
|
+
throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36405
|
+
}
|
|
36406
|
+
const leaseCaseId = String(lease.binding.case_id || "");
|
|
36407
|
+
const caseId = current ? String(current.case_id) : leaseCaseId;
|
|
36408
|
+
if (!caseId) throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36409
|
+
if (current && String(current.case_id) !== leaseCaseId) {
|
|
36133
36410
|
throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36134
36411
|
}
|
|
36135
36412
|
const steps = Array.isArray(execution.steps) ? execution.steps : [];
|
|
36136
|
-
const
|
|
36137
|
-
const
|
|
36138
|
-
|
|
36413
|
+
const caseStepIds = new Set(steps.filter((s) => s.case_id === caseId).map((s) => String(s.step_id)));
|
|
36414
|
+
const anchorStepId = current ? String(current.step_id) : String(lease.binding.case_step_id || "");
|
|
36415
|
+
const index = current ? steps.findIndex((s) => s.case_id === caseId && s.step_id === anchorStepId) : 0;
|
|
36416
|
+
if (!current && !caseStepIds.has(anchorStepId)) throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36417
|
+
if (index < 0) throw new Error("e2e.scenario.cleanup_unmock_step_missing");
|
|
36418
|
+
const release = steps.slice(index).find((s) => s.case_id === caseId && s.runner === "identity" && /unmock|退出模拟|恢复原始|恢复管理员/i.test(String(s.action)));
|
|
36419
|
+
if (!release) throw new Error("e2e.scenario.cleanup_unmock_step_missing");
|
|
36139
36420
|
const original = lease.original_user;
|
|
36140
36421
|
if (!original || !Number.isSafeInteger(original.id) || Number(original.id) <= 0) {
|
|
36141
36422
|
throw new Error("e2e.scenario.cleanup_original_identity_missing");
|
|
@@ -36144,7 +36425,7 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36144
36425
|
...options,
|
|
36145
36426
|
operation: lease.state === "released" ? "status" : "unmock",
|
|
36146
36427
|
executionManifest: manifest,
|
|
36147
|
-
evidenceDir: path20.join(path20.dirname(manifest), "evidence", `identity-cleanup-${
|
|
36428
|
+
evidenceDir: path20.join(path20.dirname(manifest), "evidence", `identity-cleanup-${caseId}-${String(release.step_id)}`),
|
|
36148
36429
|
runId: String(execution.run_id),
|
|
36149
36430
|
evidenceNonce: String(execution.evidence_nonce),
|
|
36150
36431
|
caseId: String(release.case_id),
|
|
@@ -36163,7 +36444,10 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36163
36444
|
evidence: result.evidence,
|
|
36164
36445
|
business_step_advanced: false,
|
|
36165
36446
|
formal_result: "partial",
|
|
36166
|
-
current_step: current.step_id
|
|
36447
|
+
current_step: current ? current.step_id : null,
|
|
36448
|
+
lease_case_id: caseId,
|
|
36449
|
+
terminal_run: !current,
|
|
36450
|
+
run_result: String(execution.result || "") || void 0
|
|
36167
36451
|
};
|
|
36168
36452
|
});
|
|
36169
36453
|
}
|
|
@@ -44963,6 +45247,132 @@ function rowText(row) {
|
|
|
44963
45247
|
row.parallel_type
|
|
44964
45248
|
].filter(Boolean).join(" ");
|
|
44965
45249
|
}
|
|
45250
|
+
function rowObjectLocks(row) {
|
|
45251
|
+
return (row.object_lock || "").split(/[;;,,、\s]+/).map((item) => item.trim().replace(/[。.]$/, "")).filter((item) => /^[a-z][a-z0-9-]*:[^\s]+$/i.test(item));
|
|
45252
|
+
}
|
|
45253
|
+
function readonlyLockTable(text5) {
|
|
45254
|
+
const locks = /* @__PURE__ */ new Set();
|
|
45255
|
+
const section = extractMarkdownSection(text5, "\u5BF9\u8C61\u9501\u8868");
|
|
45256
|
+
if (!section) return locks;
|
|
45257
|
+
for (const table of extractMarkdownTables(section)) {
|
|
45258
|
+
for (const row of table.rows) {
|
|
45259
|
+
const lock = (row["\u5BF9\u8C61\u9501"] || "").trim().toLowerCase();
|
|
45260
|
+
if (!lock) continue;
|
|
45261
|
+
if (/readonly\.?[^:]*$|只读/.test((row["\u5141\u8BB8\u64CD\u4F5C"] || "").trim())) locks.add(lock);
|
|
45262
|
+
}
|
|
45263
|
+
}
|
|
45264
|
+
return locks;
|
|
45265
|
+
}
|
|
45266
|
+
function isExclusiveWriteRow(row) {
|
|
45267
|
+
return /exclusive-write/i.test(row.subagent_mode || "");
|
|
45268
|
+
}
|
|
45269
|
+
function taskDependencyIds(row) {
|
|
45270
|
+
return [...new Set((row.dependencies || "").match(/\bT\d+\b/gi) || [])].map((id) => id.toUpperCase());
|
|
45271
|
+
}
|
|
45272
|
+
function objectLockDomains(locks) {
|
|
45273
|
+
return new Set(locks.map((lock) => lock.split(":")[0].trim().toLowerCase()).filter(Boolean));
|
|
45274
|
+
}
|
|
45275
|
+
function hasCreatePathEvidence(evidence) {
|
|
45276
|
+
const text5 = evidence || "";
|
|
45277
|
+
return /(?:^|\s)create(?:\s|$|\/)|\bconfig\s+\S+\s+create\b/i.test(text5);
|
|
45278
|
+
}
|
|
45279
|
+
function hasExactConfirmEvidence(evidence) {
|
|
45280
|
+
const text5 = evidence || "";
|
|
45281
|
+
return /--confirm\s+\S/.test(text5) || /精确确认|确认文本/.test(text5);
|
|
45282
|
+
}
|
|
45283
|
+
function rowsHaveExecutableTable(text5) {
|
|
45284
|
+
return extractTaskRows(text5).length > 0;
|
|
45285
|
+
}
|
|
45286
|
+
function adjustmentTraceIds(cell) {
|
|
45287
|
+
return [...cell.matchAll(ADJUSTMENT_TRACE_ID_PATTERN)].map((match) => match[0]);
|
|
45288
|
+
}
|
|
45289
|
+
var ADJUSTMENT_TRACE_ID_PATTERN = /\b(?!T\d)[A-Z]\d+\b/gi;
|
|
45290
|
+
var NODE_TRACE_PHRASE = "\u7CFB\u7EDF\u52A8\u4F5C";
|
|
45291
|
+
function nodeTraceIds(cell) {
|
|
45292
|
+
const ids = [...cell.matchAll(/\b(?!T\d)[A-Z]\d+\b|\b\d{1,2}\b/g)].map((match) => match[0]);
|
|
45293
|
+
if (cell.includes(NODE_TRACE_PHRASE)) ids.push(NODE_TRACE_PHRASE);
|
|
45294
|
+
return ids;
|
|
45295
|
+
}
|
|
45296
|
+
function validateTaskbookTraceabilityGates(text5) {
|
|
45297
|
+
const messages = [];
|
|
45298
|
+
const rows2 = extractTaskRows(text5);
|
|
45299
|
+
if (!rows2.length) return messages;
|
|
45300
|
+
if (!BLUEPRINT_TASKBOOK_PATTERN.test(text5)) return messages;
|
|
45301
|
+
const taskIDs = new Set(rows2.map((row) => (row.task_id || "").trim().toUpperCase()).filter(Boolean));
|
|
45302
|
+
const specs = [
|
|
45303
|
+
{
|
|
45304
|
+
section: "\u8C03\u6574\u9879 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
45305
|
+
idLabel: "\u8C03\u6574\u9879\u7F16\u53F7",
|
|
45306
|
+
sourceLabel: "\u8C03\u6574\u6E05\u5355\u6765\u6E90",
|
|
45307
|
+
extract: adjustmentTraceIds
|
|
45308
|
+
},
|
|
45309
|
+
{
|
|
45310
|
+
section: "\u84DD\u56FE\u8282\u70B9 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
45311
|
+
idLabel: "\u8282\u70B9\u7F16\u53F7",
|
|
45312
|
+
sourceLabel: "\u8282\u70B9\u6E05\u5355\u6765\u6E90",
|
|
45313
|
+
extract: nodeTraceIds
|
|
45314
|
+
}
|
|
45315
|
+
];
|
|
45316
|
+
for (const spec of specs) {
|
|
45317
|
+
const section = extractMarkdownSection(text5, spec.section);
|
|
45318
|
+
if (section === void 0) {
|
|
45319
|
+
messages.push(`\u4EFB\u52A1\u4E66\u7F3A\u5C11\u300C${spec.section}\u300D\u7AE0\u8282\uFF1B\u8C03\u6574\u6E05\u5355\u4E0E\u76EE\u6807\u6D41\u7A0B\u8282\u70B9\u8868\u5FC5\u987B\u5206\u522B\u8FFD\u6EAF\uFF0C\u4E0D\u80FD\u4E92\u76F8\u66FF\u4EE3\u3002`);
|
|
45320
|
+
continue;
|
|
45321
|
+
}
|
|
45322
|
+
const table = extractMarkdownTables(section)[0];
|
|
45323
|
+
if (!table) {
|
|
45324
|
+
messages.push(`\u300C${spec.section}\u300D\u5FC5\u987B\u4F7F\u7528\u8868\u683C\u3002`);
|
|
45325
|
+
continue;
|
|
45326
|
+
}
|
|
45327
|
+
if (!table.headers.includes(spec.idLabel) || !table.headers.includes("\u4EFB\u52A1")) {
|
|
45328
|
+
messages.push(`\u300C${spec.section}\u300D\u7F3A\u5C11 ${spec.idLabel} \u6216 \u4EFB\u52A1 \u5217\u3002`);
|
|
45329
|
+
continue;
|
|
45330
|
+
}
|
|
45331
|
+
if (!table.rows.some((row) => new RegExp(spec.sourceLabel).test(row["\u6765\u6E90"] || "") || (row[spec.sourceLabel] || "").trim())) {
|
|
45332
|
+
if (!new RegExp(spec.sourceLabel).test(section) && !/来源文件|版本/.test(section)) {
|
|
45333
|
+
messages.push(`\u300C${spec.section}\u300D\u5FC5\u987B\u58F0\u660E${spec.sourceLabel}\uFF08\u6587\u4EF6\u8DEF\u5F84\u4E0E\u7248\u672C\uFF09\uFF0C\u6216\u63D0\u4F9B\u300C\u6765\u6E90\u300D\u5217\u3002`);
|
|
45334
|
+
}
|
|
45335
|
+
}
|
|
45336
|
+
const seenIDs = /* @__PURE__ */ new Set();
|
|
45337
|
+
for (const [rowIndex, row] of table.rows.entries()) {
|
|
45338
|
+
const ids = spec.extract(row[spec.idLabel] || "");
|
|
45339
|
+
if (!ids.length) {
|
|
45340
|
+
if (BLUEPRINT_PLACEHOLDER_PATTERN.test((row[spec.idLabel] || "").trim())) continue;
|
|
45341
|
+
messages.push(`\u300C${spec.section}\u300D\u7B2C ${rowIndex + 1} \u884C\u7F3A\u5C11\u6709\u6548${spec.idLabel}\u3002`);
|
|
45342
|
+
continue;
|
|
45343
|
+
}
|
|
45344
|
+
ids.forEach((id) => seenIDs.add(id.toUpperCase()));
|
|
45345
|
+
const taskIDsInRow = (row["\u4EFB\u52A1"] || "").match(/\bT\d+\b/gi) || [];
|
|
45346
|
+
if (!taskIDsInRow.length) {
|
|
45347
|
+
messages.push(`\u300C${spec.section}\u300D\u7B2C ${rowIndex + 1} \u884C\u6CA1\u6709\u5173\u8054\u4EFB\u52A1\u3002`);
|
|
45348
|
+
continue;
|
|
45349
|
+
}
|
|
45350
|
+
for (const taskId of taskIDsInRow) {
|
|
45351
|
+
if (!taskIDs.has(taskId.toUpperCase())) {
|
|
45352
|
+
messages.push(`\u300C${spec.section}\u300D\u7B2C ${rowIndex + 1} \u884C\u5F15\u7528\u4E86\u4EFB\u52A1\u8868\u4E2D\u4E0D\u5B58\u5728\u7684\u4EFB\u52A1 ${taskId}\u3002`);
|
|
45353
|
+
}
|
|
45354
|
+
}
|
|
45355
|
+
}
|
|
45356
|
+
const declaredBlock = section.match(/编号清单\s*[::]\s*([^\n]+)/)?.[1] || "";
|
|
45357
|
+
if (!BLUEPRINT_PLACEHOLDER_PATTERN.test(declaredBlock.trim())) {
|
|
45358
|
+
const declaredIDs = spec.extract(declaredBlock).map((id) => id.toUpperCase());
|
|
45359
|
+
for (const declared of new Set(declaredIDs)) {
|
|
45360
|
+
if (!seenIDs.has(declared)) {
|
|
45361
|
+
messages.push(`\u300C${spec.section}\u300D\u58F0\u660E\u7684${spec.idLabel} ${declared} \u6CA1\u6709\u51FA\u73B0\u5728\u4EFB\u4F55\u4EFB\u52A1\u884C\u4E2D\u3002`);
|
|
45362
|
+
}
|
|
45363
|
+
}
|
|
45364
|
+
}
|
|
45365
|
+
}
|
|
45366
|
+
const gateSection = extractMarkdownSection(text5, "\u9A8C\u6536\u95E8\u7981");
|
|
45367
|
+
if (gateSection) {
|
|
45368
|
+
const gateLines = gateSection.split(/\r?\n/).map((line) => line.trim()).filter((line) => /^[-*]\s+/.test(line));
|
|
45369
|
+
const unmapped = gateLines.filter((line) => !/\bT\d+\b/i.test(line));
|
|
45370
|
+
if (gateLines.length && unmapped.length === gateLines.length) {
|
|
45371
|
+
messages.push("\u9A8C\u6536\u95E8\u7981\u7684\u6761\u76EE\u6CA1\u6709\u4EFB\u4F55\u4E00\u6761\u6620\u5C04\u5230\u4EFB\u52A1\uFF08Txx\uFF09\uFF1B\u65E0\u6CD5\u6620\u5C04\u7684\u9A8C\u6536\u6761\u4EF6\u4E0D\u4F1A\u88AB\u6267\u884C\u3002");
|
|
45372
|
+
}
|
|
45373
|
+
}
|
|
45374
|
+
return messages;
|
|
45375
|
+
}
|
|
44966
45376
|
function addTaskbookIssue(issues, code, ruleId, message, options = {}) {
|
|
44967
45377
|
issues.push({
|
|
44968
45378
|
code,
|
|
@@ -44973,6 +45383,121 @@ function addTaskbookIssue(issues, code, ruleId, message, options = {}) {
|
|
|
44973
45383
|
suggestion: options.suggestion
|
|
44974
45384
|
});
|
|
44975
45385
|
}
|
|
45386
|
+
function validateTaskbookExecutionStructure(text5, issues) {
|
|
45387
|
+
const rows2 = extractTaskRows(text5);
|
|
45388
|
+
if (!rows2.length) return;
|
|
45389
|
+
const taskIds = /* @__PURE__ */ new Map();
|
|
45390
|
+
rows2.forEach((row, index) => {
|
|
45391
|
+
const id = (row.task_id || "").trim().toUpperCase();
|
|
45392
|
+
if (id) taskIds.set(id, index);
|
|
45393
|
+
});
|
|
45394
|
+
const readonlyLocks = readonlyLockTable(text5);
|
|
45395
|
+
for (const [index, row] of rows2.entries()) {
|
|
45396
|
+
const taskId = row.task_id || "<unknown>";
|
|
45397
|
+
const dependsOn = taskDependencyIds(row);
|
|
45398
|
+
const writeMode = isWriteMode(row);
|
|
45399
|
+
const locks = rowObjectLocks(row);
|
|
45400
|
+
for (const dependency of dependsOn) {
|
|
45401
|
+
const dependencyIndex = taskIds.get(dependency);
|
|
45402
|
+
if (dependencyIndex === void 0) {
|
|
45403
|
+
continue;
|
|
45404
|
+
}
|
|
45405
|
+
if (dependencyIndex > index) {
|
|
45406
|
+
addTaskbookIssue(
|
|
45407
|
+
issues,
|
|
45408
|
+
"dependency_inversion",
|
|
45409
|
+
"taskbook.execution.dependency_inversion",
|
|
45410
|
+
`\u4EFB\u52A1 ${taskId} \u4F9D\u8D56\u7684 ${dependency} \u5728\u4EFB\u52A1\u8868\u4E2D\u6392\u5728\u5176\u540E\uFF0C\u6309\u8868\u987A\u5E8F\u65E0\u6CD5\u6EE1\u8DB3\u3002`,
|
|
45411
|
+
{
|
|
45412
|
+
path: `tasks.${taskId}.dependencies`,
|
|
45413
|
+
suggestion: "\u8C03\u6574\u4EFB\u52A1\u987A\u5E8F\uFF0C\u6216\u628A\u524D\u7F6E\u52A8\u4F5C\u62C6\u5230\u66F4\u65E9\u7684\u4EFB\u52A1\uFF1B\u88AB\u4F9D\u8D56\u5BF9\u8C61\uFF08\u5982\u76EE\u6807\u6D41\u7A0B\uFF09\u5FC5\u987B\u5148\u4E8E\u4F7F\u7528\u5B83\u7684\u4EFB\u52A1\u521B\u5EFA\u3002"
|
|
45414
|
+
}
|
|
45415
|
+
);
|
|
45416
|
+
}
|
|
45417
|
+
}
|
|
45418
|
+
if (writeMode) {
|
|
45419
|
+
for (const lock of locks) {
|
|
45420
|
+
const normalized = lock.toLowerCase();
|
|
45421
|
+
if (readonlyLocks.has(normalized)) {
|
|
45422
|
+
addTaskbookIssue(
|
|
45423
|
+
issues,
|
|
45424
|
+
"readonly_lock_in_write_task",
|
|
45425
|
+
"taskbook.execution.readonly_lock",
|
|
45426
|
+
`\u5199\u4EFB\u52A1 ${taskId} \u7684\u5BF9\u8C61\u9501\u5305\u542B\u9501\u8868\u4E2D\u6807\u8BB0\u4E3A\u53EA\u8BFB\u7684 ${lock}\u3002`,
|
|
45427
|
+
{
|
|
45428
|
+
path: `tasks.${taskId}.object_lock`,
|
|
45429
|
+
suggestion: "\u628A\u8BE5\u53EA\u8BFB\u5BF9\u8C61\u7684\u64CD\u4F5C\u62C6\u5230 readonly \u4EFB\u52A1\uFF0C\u5199\u4EFB\u52A1\u53EA\u4FDD\u7559\u81EA\u5DF1\u72EC\u5360\u7684\u53EF\u5199\u5BF9\u8C61\u9501\u3002"
|
|
45430
|
+
}
|
|
45431
|
+
);
|
|
45432
|
+
}
|
|
45433
|
+
}
|
|
45434
|
+
const domains = objectLockDomains(locks);
|
|
45435
|
+
if (domains.size >= 3 && isExclusiveWriteRow(row)) {
|
|
45436
|
+
addTaskbookIssue(
|
|
45437
|
+
issues,
|
|
45438
|
+
"task_granularity_too_coarse",
|
|
45439
|
+
"taskbook.execution.task_granularity",
|
|
45440
|
+
`\u4EFB\u52A1 ${taskId} \u662F exclusive-write\uFF0C\u4F46\u5BF9\u8C61\u9501\u6A2A\u8DE8 ${domains.size} \u4E2A\u914D\u7F6E\u57DF\uFF08${[...domains].join("\u3001")}\uFF09\u3002`,
|
|
45441
|
+
{
|
|
45442
|
+
path: `tasks.${taskId}.object_lock`,
|
|
45443
|
+
suggestion: "\u6309\u914D\u7F6E\u57DF\u62C6\u5206\u4EFB\u52A1\uFF0C\u6BCF\u4E2A\u4EFB\u52A1\u72EC\u5360\u4E00\u4E2A\u53EF\u5199\u5BF9\u8C61\u9501\uFF0C\u907F\u514D\u5E76\u884C\u7F16\u6392\u548C\u56DE\u6EDA\u4E92\u76F8\u7275\u8FDE\u3002"
|
|
45444
|
+
}
|
|
45445
|
+
);
|
|
45446
|
+
}
|
|
45447
|
+
const createsNewObject = locks.some((lock) => /:new-/.test(lock));
|
|
45448
|
+
const evidence = row.evidence || "";
|
|
45449
|
+
if (createsNewObject && !hasCreatePathEvidence(evidence)) {
|
|
45450
|
+
addTaskbookIssue(
|
|
45451
|
+
issues,
|
|
45452
|
+
"create_evidence_missing",
|
|
45453
|
+
"taskbook.execution.create_evidence",
|
|
45454
|
+
`\u4EFB\u52A1 ${taskId} \u8981\u521B\u5EFA\u65B0\u5BF9\u8C61\uFF0C\u4F46 evidence \u6CA1\u6709 create \u8DEF\u5F84\u3002`,
|
|
45455
|
+
{
|
|
45456
|
+
path: `tasks.${taskId}.evidence`,
|
|
45457
|
+
suggestion: "\u65B0\u5BF9\u8C61\u6CA1\u6709\u8FDC\u7AEF id\uFF0Cevidence \u5FC5\u987B\u4ECE typed create \u5F00\u59CB\uFF0C\u518D lint/build/submit/verify\uFF1B\u4ECE export \u5F00\u59CB\u4F1A\u5728\u6267\u884C\u65F6\u5361\u4F4F\u3002"
|
|
45458
|
+
}
|
|
45459
|
+
);
|
|
45460
|
+
}
|
|
45461
|
+
if (createsNewObject && hasCreatePathEvidence(evidence) && !hasExactConfirmEvidence(evidence)) {
|
|
45462
|
+
addTaskbookIssue(
|
|
45463
|
+
issues,
|
|
45464
|
+
"create_confirm_missing",
|
|
45465
|
+
"taskbook.execution.create_confirm",
|
|
45466
|
+
`\u4EFB\u52A1 ${taskId} \u7684 create \u8BC1\u636E\u7F3A\u5C11\u7CBE\u786E --confirm \u6587\u672C\u3002`,
|
|
45467
|
+
{
|
|
45468
|
+
path: `tasks.${taskId}.evidence`,
|
|
45469
|
+
suggestion: 'create/submit \u5FC5\u987B\u5199\u660E\u786E\u8BA4\u6587\u672C\uFF08\u4F8B\u5982 --confirm "create flow-template <name>"\uFF09\uFF0C\u6216\u7528 --publish-live \u524D\u5148\u786E\u8BA4\u8349\u7A3F\u3002'
|
|
45470
|
+
}
|
|
45471
|
+
);
|
|
45472
|
+
}
|
|
45473
|
+
}
|
|
45474
|
+
}
|
|
45475
|
+
for (let left = 0; left < rows2.length; left += 1) {
|
|
45476
|
+
for (let right = left + 1; right < rows2.length; right += 1) {
|
|
45477
|
+
const leftRow = rows2[left];
|
|
45478
|
+
const rightRow = rows2[right];
|
|
45479
|
+
if (!isWriteMode(leftRow) || !isWriteMode(rightRow)) continue;
|
|
45480
|
+
const leftId = (leftRow.task_id || "").toUpperCase();
|
|
45481
|
+
const rightId = (rightRow.task_id || "").toUpperCase();
|
|
45482
|
+
const related = taskDependencyIds(leftRow).includes(rightId) || taskDependencyIds(rightRow).includes(leftId) || /单线/.test(leftRow.parallel_type || "") || /单线/.test(rightRow.parallel_type || "");
|
|
45483
|
+
if (related) continue;
|
|
45484
|
+
const rightLocks = new Set(rowObjectLocks(rightRow).map((lock) => lock.toLowerCase()));
|
|
45485
|
+
const conflicts = rowObjectLocks(leftRow).filter((lock) => rightLocks.has(lock.toLowerCase()));
|
|
45486
|
+
for (const lock of conflicts) {
|
|
45487
|
+
addTaskbookIssue(
|
|
45488
|
+
issues,
|
|
45489
|
+
"parallel_object_lock_conflict",
|
|
45490
|
+
"taskbook.execution.lock_conflict",
|
|
45491
|
+
`\u4EFB\u52A1 ${leftRow.task_id} \u4E0E ${rightRow.task_id} \u90FD\u5199 ${lock}\uFF0C\u4F46\u6CA1\u6709\u4F9D\u8D56\u5173\u7CFB\uFF0C\u4E0D\u80FD\u5E76\u884C\u3002`,
|
|
45492
|
+
{
|
|
45493
|
+
path: `tasks.${leftRow.task_id}.object_lock`,
|
|
45494
|
+
suggestion: "\u4E3A\u5176\u4E2D\u4E00\u4E2A\u4EFB\u52A1\u8865\u5145\u8F93\u5165\u4F9D\u8D56\u4E32\u884C\u5316\uFF0C\u6216\u628A\u540C\u4E00\u5BF9\u8C61\u7684\u5199\u5165\u5408\u5E76\u5230\u4E00\u4E2A\u6392\u4ED6\u4EFB\u52A1\u3002"
|
|
45495
|
+
}
|
|
45496
|
+
);
|
|
45497
|
+
}
|
|
45498
|
+
}
|
|
45499
|
+
}
|
|
45500
|
+
}
|
|
44976
45501
|
function extractMarkdownSection(text5, title) {
|
|
44977
45502
|
const lines = text5.split(/\r?\n/);
|
|
44978
45503
|
for (let index = 0; index < lines.length; index += 1) {
|
|
@@ -45653,6 +46178,13 @@ async function lintTaskbook(file, options = {}) {
|
|
|
45653
46178
|
}
|
|
45654
46179
|
validateTaskbookNavigationAndListGates(text5, issues);
|
|
45655
46180
|
validateTaskbookConfigSkillGates(text5, issues);
|
|
46181
|
+
validateTaskbookExecutionStructure(text5, issues);
|
|
46182
|
+
for (const message of validateTaskbookTraceabilityGates(text5)) {
|
|
46183
|
+
addTaskbookIssue(issues, "missing_taskbook_traceability", "taskbook.execution.traceability", message, {
|
|
46184
|
+
path: "traceability",
|
|
46185
|
+
suggestion: "\u8865\u9F50\u201C\u8C03\u6574\u9879 \u2192 \u4EFB\u52A1\u201D\u548C\u201C\u84DD\u56FE\u8282\u70B9 \u2192 \u4EFB\u52A1\u201D\u4E24\u5F20\u8FFD\u6EAF\u8868\uFF1B\u8C03\u6574\u6E05\u5355\u4E0E\u76EE\u6807\u6D41\u7A0B\u8282\u70B9\u8868\u7C92\u5EA6\u4E0D\u540C\uFF0C\u5FC5\u987B\u5206\u522B\u8FFD\u6EAF\u3002"
|
|
46186
|
+
});
|
|
46187
|
+
}
|
|
45656
46188
|
for (const match of text5.matchAll(FLOW_LOCK_PATTERN)) {
|
|
45657
46189
|
const value = match[1] || "";
|
|
45658
46190
|
if (value.startsWith("flow") && /^flow\d+$/.test(value)) {
|
|
@@ -45666,9 +46198,17 @@ async function lintTaskbook(file, options = {}) {
|
|
|
45666
46198
|
{ path: "object_lock", suggestion: "\u65B0\u6D41\u7A0B\u521B\u5EFA\u524D\u4F7F\u7528 new-flow:<name>\uFF0C\u521B\u5EFA\u540E\u56DE\u586B BPMAX \u751F\u6210\u7684\u771F\u5B9E flow_type\u3002" }
|
|
45667
46199
|
);
|
|
45668
46200
|
}
|
|
46201
|
+
const EXECUTION_RULE_PREFIXES = ["taskbook.execution."];
|
|
46202
|
+
const executableIssues = issues.filter((issue3) => EXECUTION_RULE_PREFIXES.some((prefix) => issue3.rule_id.startsWith(prefix)));
|
|
46203
|
+
const formatIssues = issues.filter((issue3) => !executableIssues.includes(issue3));
|
|
46204
|
+
if (!rowsHaveExecutableTable(text5)) {
|
|
46205
|
+
executableIssues.length = 0;
|
|
46206
|
+
}
|
|
45669
46207
|
const errors = uniqueErrors(issueMessages(issues));
|
|
45670
46208
|
return {
|
|
45671
46209
|
ok: errors.length === 0,
|
|
46210
|
+
format_ok: uniqueErrors(issueMessages(formatIssues)).length === 0,
|
|
46211
|
+
executable_ok: uniqueErrors(issueMessages(executableIssues)).length === 0,
|
|
45672
46212
|
file,
|
|
45673
46213
|
errors,
|
|
45674
46214
|
issues,
|
|
@@ -45707,6 +46247,8 @@ async function lintTaskPrompt(file, options = {}) {
|
|
|
45707
46247
|
file,
|
|
45708
46248
|
errors,
|
|
45709
46249
|
issues,
|
|
46250
|
+
format_ok: errors.length === 0,
|
|
46251
|
+
executable_ok: errors.length === 0,
|
|
45710
46252
|
checked_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
45711
46253
|
};
|
|
45712
46254
|
}
|
|
@@ -45758,6 +46300,25 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45758
46300
|
"|---|---|---|---|---|---|",
|
|
45759
46301
|
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
45760
46302
|
"",
|
|
46303
|
+
"## \u8C03\u6574\u9879 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
46304
|
+
"",
|
|
46305
|
+
"- \u8C03\u6574\u6E05\u5355\u6765\u6E90\uFF1A`<\u84DD\u56FE\u8C03\u6574\u6E05\u5355\u6587\u4EF6\u8DEF\u5F84>`\uFF0C\u7248\u672C\uFF1A\u5F85\u586B\u5199\u3002",
|
|
46306
|
+
"- \u7F16\u53F7\u6E05\u5355\uFF1A\u5F85\u586B\u5199\u3002\u9010\u4E2A\u5217\u51FA\u8C03\u6574\u6E05\u5355\u91CC\u7684\u6BCF\u4E2A\u7F16\u53F7\uFF1B\u7F16\u53F7\u5F62\u5982\u5B57\u6BCD\u52A0\u5E8F\u53F7\uFF0C\u5177\u4F53\u65CF\u522B\u4EE5\u84DD\u56FE\u4E3A\u51C6\u3002",
|
|
46307
|
+
"",
|
|
46308
|
+
"| \u8C03\u6574\u9879\u7F16\u53F7 | \u8C03\u6574\u5185\u5BB9 | \u4EFB\u52A1 | \u9A8C\u6536\u8BC1\u636E |",
|
|
46309
|
+
"|---|---|---|---|",
|
|
46310
|
+
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
46311
|
+
"",
|
|
46312
|
+
"## \u84DD\u56FE\u8282\u70B9 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
46313
|
+
"",
|
|
46314
|
+
"- \u8282\u70B9\u6E05\u5355\u6765\u6E90\uFF1A`<\u84DD\u56FE\u76EE\u6807\u6D41\u7A0B\u8282\u70B9\u8868\u6587\u4EF6\u8DEF\u5F84>`\uFF0C\u7248\u672C\uFF1A\u5F85\u586B\u5199\u3002",
|
|
46315
|
+
"- \u7F16\u53F7\u6E05\u5355\uFF1A\u5F85\u586B\u5199\u3002\u9010\u4E2A\u5217\u51FA\u76EE\u6807\u6D41\u7A0B\u8282\u70B9\u8868\u91CC\u7684\u6BCF\u4E2A\u7F16\u53F7\uFF0C\u5305\u62EC\u4E3B\u5E8F\u53F7\u8282\u70B9\u3001\u5B57\u6BCD\u52A0\u5E8F\u53F7\u7684\u5E76\u884C\u5206\u652F\u8282\u70B9\uFF0C\u4EE5\u53CA\u56FA\u5B9A\u77ED\u8BED\u8282\u70B9\u3002",
|
|
46316
|
+
"- \u8C03\u6574\u6E05\u5355\u4E0E\u76EE\u6807\u6D41\u7A0B\u8282\u70B9\u8868\u7C92\u5EA6\u4E0D\u540C\uFF1A\u53EA\u6309\u8C03\u6574\u9879\u6253\u52FE\u4F1A\u6F0F\u6389\u8282\u70B9\u8868\u91CC\u7684\u5E76\u884C\u5206\u652F\u548C\u652F\u6491\u8282\u70B9\uFF0C\u4E24\u8005\u5FC5\u987B\u5206\u522B\u8FFD\u6EAF\u3002",
|
|
46317
|
+
"",
|
|
46318
|
+
"| \u8282\u70B9\u7F16\u53F7 | \u8282\u70B9\u540D\u79F0 | \u4EFB\u52A1 | \u8868\u5355 | \u8D23\u4EFB\u89D2\u8272 | \u9A8C\u6536\u8BC1\u636E |",
|
|
46319
|
+
"|---|---|---|---|---|---|",
|
|
46320
|
+
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
46321
|
+
"",
|
|
45761
46322
|
"## \u5E76\u884C\u62C6\u89E3\u786C\u89C4\u5219",
|
|
45762
46323
|
"",
|
|
45763
46324
|
"- \u5BF9\u8C61\u9501\u91CD\u590D\u4E0D\u5F97\u5E76\u884C\u3002",
|
|
@@ -45800,7 +46361,7 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45800
46361
|
"",
|
|
45801
46362
|
"| task_id | status | phase | parallel_type | subagent_mode | business_goal | required_skills | object_lock | dependencies | owner | evidence | notes |",
|
|
45802
46363
|
"|---|---|---|---|---|---|---|---|---|---|---|---|",
|
|
45803
|
-
"| T00 | \u672A\u5F00\u59CB | 0 | \u5355\u7EBF |
|
|
46364
|
+
"| T00 | \u672A\u5F00\u59CB | 0 | \u5355\u7EBF | readonly | \u786E\u8BA4\u7EBF\u4E0A\u57FA\u7EBF\u548C\u8303\u56F4 | bpmax-e2e-flow-config-orchestrator | readonly:baseline | | \u4E3B\u7EBF\u7A0B | bpmax-cli config adapters --format json\uFF1B\u914D\u7F6E\u5BF9\u8C61\u7EBF\u4E0A\u56DE\u8BFB | \u4EC5\u786E\u8BA4\u57FA\u7EBF\uFF0C\u4E0D\u4FDD\u5B58\u3001\u4E0D\u53D1\u5E03 |",
|
|
45804
46365
|
"| T01 | \u672A\u5F00\u59CB | 1 | \u53EA\u8BFB\u5E76\u884C | readonly | \u8C03\u7814\u76EE\u6807\u6D41\u7A0B\u548C\u8868\u5355 | bpmax-flow-template-editor,bpmax-form-template-editor | readonly:flow | T00 | \u5F85\u5206\u914D | bpmax-cli config flow-template export\uFF1Bbpmax-cli config form-template export\uFF1B\u6D41\u7A0B\u56DE\u8BFB\uFF1B\u8868\u5355\u56DE\u8BFB | \u68C0\u67E5 project_after_create_path\u3001message_template\u3001\u5B57\u6BB5 schema\u3001\u8868\u5355\u987A\u5E8F\u3001raw.value\u3001layout\u3001sub_form |",
|
|
45805
46366
|
"",
|
|
45806
46367
|
"- \u6BCF\u4E2A\u4EFB\u52A1\u7684 `business_goal` \u90FD\u5FC5\u987B\u5199\u6E05\u695A\u4E1A\u52A1\u76EE\u6807\u573A\u666F\u3002",
|
|
@@ -45823,12 +46384,12 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45823
46384
|
"",
|
|
45824
46385
|
"## \u9A8C\u6536\u95E8\u7981",
|
|
45825
46386
|
"",
|
|
45826
|
-
"- \u914D\u7F6E\u5BF9\u8C61\u7EBF\u4E0A\u56DE\u8BFB\u901A\u8FC7\u3002",
|
|
45827
|
-
"- \u5217\u8868\u6A21\u677F\
|
|
45828
|
-
"- \u5217\u8868\u5B57\u6BB5\u8FD0\u884C\u6001\u5951\u7EA6\
|
|
45829
|
-
"- \
|
|
45830
|
-
"- \u6D4F\u89C8\u5668 E2E \u9A8C\u8BC1\u901A\u8FC7\u3002",
|
|
45831
|
-
"- \u6D4B\u8BD5\u62A5\u544A\u548C\u622A\u56FE\u8BC1\u636E\u5B8C\u6574\u3002",
|
|
46387
|
+
"- [ ] T00\uFF1A\u914D\u7F6E\u5BF9\u8C61\u7EBF\u4E0A\u56DE\u8BFB\u901A\u8FC7\u3002",
|
|
46388
|
+
"- [ ] T01\uFF1A\u5217\u8868\u6A21\u677F\u901A\u8FC7 `bpmax-cli config list-template lint`\uFF0C\u8986\u76D6\u64CD\u4F5C\u5217\u3001\u8BE6\u60C5\u52A8\u4F5C\u3001\u5220\u9664\u52A8\u4F5C\u3001`ctx.$CAN_DELETE` \u5220\u9664\u6743\u9650 guard\u3001\u7981\u6B62\u5F53\u524D\u73AF\u8282\u4E3A\u7A7A\u6761\u4EF6\u3001icon \u5339\u914D\u548C\u67E5\u8BE2\u5B89\u5168\u3002",
|
|
46389
|
+
"- [ ] T01\uFF1A\u5217\u8868\u5B57\u6BB5\u8FD0\u884C\u6001\u5951\u7EA6\u9010\u9879\u8BB0\u5F55 `required_nonempty`\u3001`allowed_empty_reason`\u3001`source_dataset_field`\u3001`detail_consistency`\u3001`runtime_evidence`\u3001`icon_token`\uFF1B\u7F3A\u5931\u65F6\u53EA\u80FD\u4FDD\u6301 partial/blocked\u3002",
|
|
46390
|
+
"- [ ] T01\uFF1A\u914D\u7F6E\u6216\u53D8\u66F4\u4E86\u5BFC\u822A\u5165\u53E3\u65F6\uFF0C\u901A\u8FC7 `bpmax-cli config nav-config lint/build/submit` \u95ED\u73AF\uFF0C\u5E76\u5728\u6D4F\u89C8\u5668\u786E\u8BA4\u5165\u53E3\u53EF\u89C1\u4E14\u80FD\u8FDB\u5165\u76EE\u6807\u9875\u9762\u3002",
|
|
46391
|
+
"- [ ] T01\uFF1A\u6D4F\u89C8\u5668 E2E \u9A8C\u8BC1\u901A\u8FC7\u3002",
|
|
46392
|
+
"- [ ] T01\uFF1A\u6D4B\u8BD5\u62A5\u544A\u548C\u622A\u56FE\u8BC1\u636E\u5B8C\u6574\u3002",
|
|
45832
46393
|
"",
|
|
45833
46394
|
"## \u5BFC\u822A\u5165\u53E3\u7B56\u7565\u4E0E\u5217\u8868 lint",
|
|
45834
46395
|
"",
|