bpmax-cli 0.2.1-beta.85 → 0.2.1-beta.86
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 +428 -66
- 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.86",
|
|
544
544
|
description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
545
545
|
type: "module",
|
|
546
546
|
bin: {
|
|
@@ -5328,6 +5328,7 @@ function numericConfigResourcePath(resource, id, query = "") {
|
|
|
5328
5328
|
}
|
|
5329
5329
|
return `/${resource}/${encodeURIComponent(normalized)}${query}`;
|
|
5330
5330
|
}
|
|
5331
|
+
var PLATFORM_BUILTIN_FLOW_CATEGORIES = /* @__PURE__ */ new Set(["matrix"]);
|
|
5331
5332
|
function configWorkflowError(message, details) {
|
|
5332
5333
|
return Object.assign(new Error(message), details);
|
|
5333
5334
|
}
|
|
@@ -7708,18 +7709,18 @@ function validateFlowTemplateUrgentReminder(value, errors) {
|
|
|
7708
7709
|
}
|
|
7709
7710
|
validateOptionalBoolean(nextErrors, config, "enabled", pathName);
|
|
7710
7711
|
validateOptionalBoolean(nextErrors, config, "auto", pathName);
|
|
7712
|
+
validateOptionalBoolean(nextErrors, config, "enable_auto_action", pathName);
|
|
7711
7713
|
if (config.enabled !== true) {
|
|
7712
7714
|
return;
|
|
7713
7715
|
}
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
if (!action) {
|
|
7717
|
-
nextErrors.push(`${pathName}.auto_action is required when auto processing is enabled.`);
|
|
7718
|
-
}
|
|
7716
|
+
const action = typeof config.auto_action === "string" ? config.auto_action.trim() : "";
|
|
7717
|
+
if (action) {
|
|
7719
7718
|
const delay2 = config.auto_action_deplay ?? config.auto_action_delay;
|
|
7720
7719
|
if (delay2 === void 0 || delay2 === null || String(delay2).trim() === "") {
|
|
7721
7720
|
nextErrors.push(`${pathName}.auto_action_deplay is required when auto processing is enabled; the plugin field name is auto_action_deplay.`);
|
|
7722
7721
|
}
|
|
7722
|
+
} else if (config.enable_auto_action === true) {
|
|
7723
|
+
nextErrors.push(`${pathName}.auto_action is required when auto processing is enabled.`);
|
|
7723
7724
|
}
|
|
7724
7725
|
};
|
|
7725
7726
|
inspect(isRecord6(data.meta) ? data.meta.plugin_urgent_reminder : void 0, "data.meta.plugin_urgent_reminder");
|
|
@@ -8873,6 +8874,9 @@ async function auditFlowCategoryReference(flowWork, profile) {
|
|
|
8873
8874
|
);
|
|
8874
8875
|
const categories = flowCategoryRecords(response).filter(usableFlowCategory);
|
|
8875
8876
|
const availableKeys = [...new Set(categories.map((record2) => String(record2.key).trim()))].sort();
|
|
8877
|
+
if (availableKeys.includes(configuredKey)) {
|
|
8878
|
+
return { errors: [], configuredKey, status: "verified", availableKeys, categories };
|
|
8879
|
+
}
|
|
8876
8880
|
if (!availableKeys.length) {
|
|
8877
8881
|
return {
|
|
8878
8882
|
errors: ["$.category cannot be validated because the current profile returned no active flow categories."],
|
|
@@ -8882,16 +8886,16 @@ async function auditFlowCategoryReference(flowWork, profile) {
|
|
|
8882
8886
|
categories
|
|
8883
8887
|
};
|
|
8884
8888
|
}
|
|
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
|
-
};
|
|
8889
|
+
if (PLATFORM_BUILTIN_FLOW_CATEGORIES.has(configuredKey)) {
|
|
8890
|
+
return { errors: [], configuredKey, status: "platform_builtin", availableKeys, categories };
|
|
8893
8891
|
}
|
|
8894
|
-
return {
|
|
8892
|
+
return {
|
|
8893
|
+
errors: [`$.category references unknown flow category '${configuredKey}'; available keys: ${availableKeys.join(", ")}.`],
|
|
8894
|
+
configuredKey,
|
|
8895
|
+
status: "invalid",
|
|
8896
|
+
availableKeys,
|
|
8897
|
+
categories
|
|
8898
|
+
};
|
|
8895
8899
|
} catch (error) {
|
|
8896
8900
|
return {
|
|
8897
8901
|
errors: [`$.category cannot be validated against the current profile: ${error instanceof Error ? error.message : String(error)}.`],
|
|
@@ -29579,8 +29583,8 @@ async function syncTestSuiteRunReportUnlocked(manifestFile) {
|
|
|
29579
29583
|
async function syncTestSuiteRunReport(manifestFile) {
|
|
29580
29584
|
return withExecutionManifestLock(manifestFile, () => syncTestSuiteRunReportUnlocked(manifestFile));
|
|
29581
29585
|
}
|
|
29582
|
-
async function
|
|
29583
|
-
const
|
|
29586
|
+
async function previousBrowserScreenshotArtifacts(manifest, step) {
|
|
29587
|
+
const artifacts = /* @__PURE__ */ new Set();
|
|
29584
29588
|
for (const previous of manifest.steps) {
|
|
29585
29589
|
if (previous.step_no === step.step_no) break;
|
|
29586
29590
|
if (previous.status !== "pass" || !["browser", "browser_action", "e2e_create_page", "identity"].includes(previous.runner)) continue;
|
|
@@ -29589,11 +29593,21 @@ async function previousBrowserScreenshotHashes(manifest, step) {
|
|
|
29589
29593
|
const screenshot = typeof value.screenshot === "string" ? value.screenshot.trim() : "";
|
|
29590
29594
|
if (!screenshot) continue;
|
|
29591
29595
|
const screenshotPath = path18.resolve(path18.dirname(source), screenshot);
|
|
29592
|
-
|
|
29596
|
+
const identity = await fileIdentity(screenshotPath);
|
|
29597
|
+
if (identity) artifacts.add(identity);
|
|
29593
29598
|
}
|
|
29594
29599
|
}
|
|
29595
29600
|
}
|
|
29596
|
-
return
|
|
29601
|
+
return artifacts;
|
|
29602
|
+
}
|
|
29603
|
+
async function fileIdentity(file) {
|
|
29604
|
+
try {
|
|
29605
|
+
const info = await stat11(file);
|
|
29606
|
+
if (!info.isFile()) return null;
|
|
29607
|
+
return `${path18.resolve(file)}|${String(info.dev)}:${String(info.ino)}:${String(info.size)}`;
|
|
29608
|
+
} catch {
|
|
29609
|
+
return null;
|
|
29610
|
+
}
|
|
29597
29611
|
}
|
|
29598
29612
|
async function assertBrowserActionViewportEvidence(manifest, manifestPath, step, evidencePath) {
|
|
29599
29613
|
if (step.runner !== "browser_action" || !manifest.automation_file) return;
|
|
@@ -29690,9 +29704,10 @@ async function assertFormalExecutionEvidence(manifest, manifestPath, step, evide
|
|
|
29690
29704
|
(value) => value.transport === "chrome_identity_bridge" && value.browser_tool === "chrome:control-chrome" || value.transport === "playwright_context" && String(value.browser_tool || "").toLowerCase() === "playwright"
|
|
29691
29705
|
);
|
|
29692
29706
|
if (identityStepOperation(step) !== "unmock") {
|
|
29693
|
-
const
|
|
29707
|
+
const previousArtifacts = await previousBrowserScreenshotArtifacts(manifest, step);
|
|
29694
29708
|
for (const screenshot of screenshots) {
|
|
29695
|
-
|
|
29709
|
+
const identity = await fileIdentity(screenshot);
|
|
29710
|
+
if (identity && previousArtifacts.has(identity)) {
|
|
29696
29711
|
fail("identity pass evidence reuses an identical screenshot from an earlier step in this run", {
|
|
29697
29712
|
rule_id: "test_suite.run.duplicate_screenshot",
|
|
29698
29713
|
path: screenshot
|
|
@@ -29704,9 +29719,10 @@ async function assertFormalExecutionEvidence(manifest, manifestPath, step, evide
|
|
|
29704
29719
|
if (step.runner === "browser" || step.runner === "browser_action" || step.runner === "e2e_create_page") {
|
|
29705
29720
|
await assertBrowserActionViewportEvidence(manifest, manifestPath, step, evidencePath);
|
|
29706
29721
|
const screenshots = await browserEvidenceScreenshots(manifest, manifestPath, step, evidencePath);
|
|
29707
|
-
const
|
|
29722
|
+
const previousArtifacts = await previousBrowserScreenshotArtifacts(manifest, step);
|
|
29708
29723
|
for (const screenshot of screenshots) {
|
|
29709
|
-
|
|
29724
|
+
const identity = await fileIdentity(screenshot);
|
|
29725
|
+
if (identity && previousArtifacts.has(identity)) {
|
|
29710
29726
|
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
29727
|
}
|
|
29712
29728
|
}
|
|
@@ -32778,11 +32794,26 @@ function messageUrlParameter(url, name) {
|
|
|
32778
32794
|
return "";
|
|
32779
32795
|
}
|
|
32780
32796
|
}
|
|
32797
|
+
function messageUrlProjectId(url) {
|
|
32798
|
+
let parsed;
|
|
32799
|
+
try {
|
|
32800
|
+
parsed = new URL(url, "https://bpmax.invalid");
|
|
32801
|
+
} catch {
|
|
32802
|
+
return "";
|
|
32803
|
+
}
|
|
32804
|
+
const numeric = (value) => /^\d+$/.test(value) ? value : "";
|
|
32805
|
+
const queryId = numeric((parsed.searchParams.get("id") ?? "").trim());
|
|
32806
|
+
const segments = parsed.pathname.split("/").filter(Boolean);
|
|
32807
|
+
const detailIndex = segments.indexOf("project_detail");
|
|
32808
|
+
const pathId = detailIndex >= 0 && segments.length > detailIndex + 2 ? numeric(segments[detailIndex + 2].trim()) : "";
|
|
32809
|
+
if (queryId && pathId) return queryId === pathId ? queryId : "";
|
|
32810
|
+
return queryId || pathId;
|
|
32811
|
+
}
|
|
32781
32812
|
function browserMessageDeliveryMatches(records, expected) {
|
|
32782
32813
|
const projectId = String(expected.project_id ?? "").trim();
|
|
32783
32814
|
const stepId = String(expected.step_id ?? "").trim();
|
|
32784
32815
|
return records.filter((record2) => {
|
|
32785
|
-
const urlProjectId =
|
|
32816
|
+
const urlProjectId = messageUrlProjectId(record2.url);
|
|
32786
32817
|
const urlStepId = messageUrlParameter(record2.url, "step_id");
|
|
32787
32818
|
const requiresStepLink = String(expected.url_pattern ?? "").includes("projectContinue");
|
|
32788
32819
|
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 +33067,85 @@ async function labelledControl(root, label) {
|
|
|
33036
33067
|
if (!await field.count()) throw new Error(`form.set_punishment field not found: ${label}`);
|
|
33037
33068
|
return editableLocator(field);
|
|
33038
33069
|
}
|
|
33039
|
-
async function
|
|
33070
|
+
async function selectOptionPopupCandidates(page, control) {
|
|
33071
|
+
const candidateSelectors = '.el-select-dropdown, .el-autocomplete-suggestion, [role="listbox"]';
|
|
33072
|
+
const rawBoundIds = await control.evaluate((element) => {
|
|
33073
|
+
const ids = [element.getAttribute("aria-controls"), element.getAttribute("aria-owns")].filter(Boolean).flatMap((value) => String(value).split(/\s+/)).filter(Boolean);
|
|
33074
|
+
const expanded = element.closest('[aria-expanded="true"]');
|
|
33075
|
+
if (expanded) {
|
|
33076
|
+
const controls = expanded.getAttribute("aria-controls") ?? expanded.getAttribute("aria-owns");
|
|
33077
|
+
if (controls) ids.push(...String(controls).split(/\s+/).filter(Boolean));
|
|
33078
|
+
}
|
|
33079
|
+
return [...new Set(ids)];
|
|
33080
|
+
}).catch(() => []);
|
|
33081
|
+
const boundIds = Array.isArray(rawBoundIds) ? rawBoundIds.filter((id) => typeof id === "string" && id.length > 0) : [];
|
|
33082
|
+
const candidates = [];
|
|
33083
|
+
if (boundIds.length) {
|
|
33084
|
+
const selector = boundIds.map((id) => `[id=${JSON.stringify(id)}]`).join(", ");
|
|
33085
|
+
candidates.push(page.locator(selector));
|
|
33086
|
+
}
|
|
33087
|
+
const formItem = nearestFormItem(control);
|
|
33088
|
+
if (await formItem.count()) {
|
|
33089
|
+
candidates.push(formItem.locator(candidateSelectors));
|
|
33090
|
+
}
|
|
33091
|
+
candidates.push(page.locator(candidateSelectors));
|
|
33092
|
+
return candidates;
|
|
33093
|
+
}
|
|
33094
|
+
async function selectBrowserOption(page, control, optionText, timeout) {
|
|
33040
33095
|
const tagName = await control.evaluate((element) => element.tagName.toLowerCase()).catch(() => "");
|
|
33041
33096
|
if (tagName === "select") {
|
|
33042
33097
|
await control.selectOption({ label: optionText });
|
|
33043
|
-
return;
|
|
33098
|
+
return String(await control.inputValue().catch(() => optionText)).trim() || optionText;
|
|
33044
33099
|
}
|
|
33045
33100
|
await control.click({ timeout });
|
|
33046
|
-
const
|
|
33047
|
-
|
|
33048
|
-
|
|
33049
|
-
|
|
33101
|
+
const optionSelectors = [
|
|
33102
|
+
".el-select-dropdown__item",
|
|
33103
|
+
".el-autocomplete-suggestion li",
|
|
33104
|
+
'[role="option"]'
|
|
33105
|
+
].join(", ");
|
|
33106
|
+
const expected = optionText.trim();
|
|
33107
|
+
const matched = [];
|
|
33108
|
+
for (const candidate of await selectOptionPopupCandidates(page, control)) {
|
|
33109
|
+
const popupCount = await candidate.count();
|
|
33110
|
+
for (let index = 0; index < popupCount; index += 1) {
|
|
33111
|
+
const popup = candidate.nth(index);
|
|
33112
|
+
if (!await popup.isVisible().catch(() => false)) continue;
|
|
33113
|
+
const options = popup.locator(optionSelectors);
|
|
33114
|
+
const optionCount = await options.count();
|
|
33115
|
+
for (let optionIndex = 0; optionIndex < optionCount; optionIndex += 1) {
|
|
33116
|
+
const option = options.nth(optionIndex);
|
|
33117
|
+
if (!await option.isVisible().catch(() => false)) continue;
|
|
33118
|
+
const label = String(await option.textContent() ?? "").replace(/\s+/g, " ").trim();
|
|
33119
|
+
const disabled = await option.evaluate((element) => element.classList.contains("is-disabled") || element.getAttribute("aria-disabled") === "true").catch(() => false);
|
|
33120
|
+
if (disabled || label !== expected) continue;
|
|
33121
|
+
matched.push(option);
|
|
33122
|
+
}
|
|
33123
|
+
if (matched.length) break;
|
|
33124
|
+
}
|
|
33125
|
+
if (matched.length) break;
|
|
33050
33126
|
}
|
|
33127
|
+
if (matched.length !== 1) {
|
|
33128
|
+
throw new Error(`form.select_option requires exactly one visible option "${expected}" inside the control popup; found ${matched.length}`);
|
|
33129
|
+
}
|
|
33130
|
+
await matched[0].hover({ timeout });
|
|
33131
|
+
await matched[0].click({ timeout });
|
|
33132
|
+
const readControl = async () => {
|
|
33133
|
+
const value = String(await control.inputValue().catch(() => "") ?? "").trim();
|
|
33134
|
+
const text5 = String(await control.textContent().catch(() => "") ?? "").replace(/\s+/g, " ").trim();
|
|
33135
|
+
return { value, text: text5 };
|
|
33136
|
+
};
|
|
33137
|
+
const selected = async () => {
|
|
33138
|
+
const actual2 = await readControl();
|
|
33139
|
+
return actual2.value === expected || actual2.text.includes(expected);
|
|
33140
|
+
};
|
|
33141
|
+
const deadline = Date.now() + Math.max(0, Math.min(timeout, 3e3));
|
|
33142
|
+
do {
|
|
33143
|
+
if (await selected()) return expected;
|
|
33144
|
+
if (Date.now() >= deadline) break;
|
|
33145
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
33146
|
+
} while (true);
|
|
33147
|
+
const actual = await readControl();
|
|
33148
|
+
throw new Error(`form.select_option readback mismatch: expected "${expected}", got value "${actual.value}" text "${actual.text}"`);
|
|
33051
33149
|
}
|
|
33052
33150
|
async function selectBrowserCascader(page, semanticTarget, value, timeout) {
|
|
33053
33151
|
const spec = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
@@ -33260,7 +33358,7 @@ async function setBrowserPunishment(page, semanticTarget, punishmentType, condit
|
|
|
33260
33358
|
"punishment-item-form-control"
|
|
33261
33359
|
);
|
|
33262
33360
|
const spec = browserPunishmentSpec(punishmentType, conditionValue);
|
|
33263
|
-
await
|
|
33361
|
+
await selectBrowserOption(page, await labelledControl(root, "\u5904\u7F5A\u7C7B\u578B"), spec.label, timeout);
|
|
33264
33362
|
if (spec.conditionLabel) {
|
|
33265
33363
|
const conditionControl = await labelledControl(root, spec.conditionLabel);
|
|
33266
33364
|
await conditionControl.fill(String(spec.conditionValue));
|
|
@@ -33485,24 +33583,6 @@ async function dateRangeInputLocators(locator) {
|
|
|
33485
33583
|
}
|
|
33486
33584
|
throw new Error("form.set_date_range target does not contain two visible editable inputs");
|
|
33487
33585
|
}
|
|
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
33586
|
async function tableLocator(page, table) {
|
|
33507
33587
|
const escaped = table.replace(/["\\]/g, "\\$&");
|
|
33508
33588
|
const direct = page.locator(`[data-table-key="${escaped}"], [table-key="${escaped}"], [data-key="${escaped}"]`);
|
|
@@ -33627,10 +33707,12 @@ async function executeAction(page, action, variables, runtime) {
|
|
|
33627
33707
|
};
|
|
33628
33708
|
}
|
|
33629
33709
|
case "form.select_option": {
|
|
33630
|
-
const target =
|
|
33631
|
-
const
|
|
33632
|
-
|
|
33633
|
-
|
|
33710
|
+
const target = next.target ?? { field: next.field };
|
|
33711
|
+
const semanticTarget = await visibleTargetLocator(page, target);
|
|
33712
|
+
const editable = await editableLocator(semanticTarget);
|
|
33713
|
+
const option = String(next.option ?? next.value ?? "");
|
|
33714
|
+
const actual = await selectBrowserOption(page, editable, option, timeout);
|
|
33715
|
+
return { assertion: { type: next.type, passed: true, target, option, actual } };
|
|
33634
33716
|
}
|
|
33635
33717
|
case "cascader.search_select": {
|
|
33636
33718
|
const target = next.target ?? { field: next.field };
|
|
@@ -36129,13 +36211,23 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36129
36211
|
const execution = executionRecord(state);
|
|
36130
36212
|
const current = currentStepRecord(state);
|
|
36131
36213
|
const lease = await identityLeaseStatus(path20.join(path20.dirname(manifest), "identity-lease.json"));
|
|
36132
|
-
if (!
|
|
36214
|
+
if (!lease || lease.browser_tool !== "playwright" || path20.resolve(lease.binding.execution_manifest || "") !== manifest || lease.binding.profile !== options.profile) {
|
|
36215
|
+
throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36216
|
+
}
|
|
36217
|
+
const leaseCaseId = String(lease.binding.case_id || "");
|
|
36218
|
+
const caseId = current ? String(current.case_id) : leaseCaseId;
|
|
36219
|
+
if (!caseId) throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36220
|
+
if (current && String(current.case_id) !== leaseCaseId) {
|
|
36133
36221
|
throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36134
36222
|
}
|
|
36135
36223
|
const steps = Array.isArray(execution.steps) ? execution.steps : [];
|
|
36136
|
-
const
|
|
36137
|
-
const
|
|
36138
|
-
|
|
36224
|
+
const caseStepIds = new Set(steps.filter((s) => s.case_id === caseId).map((s) => String(s.step_id)));
|
|
36225
|
+
const anchorStepId = current ? String(current.step_id) : String(lease.binding.case_step_id || "");
|
|
36226
|
+
const index = current ? steps.findIndex((s) => s.case_id === caseId && s.step_id === anchorStepId) : 0;
|
|
36227
|
+
if (!current && !caseStepIds.has(anchorStepId)) throw new Error("e2e.scenario.cleanup_lease_binding_mismatch");
|
|
36228
|
+
if (index < 0) throw new Error("e2e.scenario.cleanup_unmock_step_missing");
|
|
36229
|
+
const release = steps.slice(index).find((s) => s.case_id === caseId && s.runner === "identity" && /unmock|退出模拟|恢复原始|恢复管理员/i.test(String(s.action)));
|
|
36230
|
+
if (!release) throw new Error("e2e.scenario.cleanup_unmock_step_missing");
|
|
36139
36231
|
const original = lease.original_user;
|
|
36140
36232
|
if (!original || !Number.isSafeInteger(original.id) || Number(original.id) <= 0) {
|
|
36141
36233
|
throw new Error("e2e.scenario.cleanup_original_identity_missing");
|
|
@@ -36144,7 +36236,7 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36144
36236
|
...options,
|
|
36145
36237
|
operation: lease.state === "released" ? "status" : "unmock",
|
|
36146
36238
|
executionManifest: manifest,
|
|
36147
|
-
evidenceDir: path20.join(path20.dirname(manifest), "evidence", `identity-cleanup-${
|
|
36239
|
+
evidenceDir: path20.join(path20.dirname(manifest), "evidence", `identity-cleanup-${caseId}-${String(release.step_id)}`),
|
|
36148
36240
|
runId: String(execution.run_id),
|
|
36149
36241
|
evidenceNonce: String(execution.evidence_nonce),
|
|
36150
36242
|
caseId: String(release.case_id),
|
|
@@ -36163,7 +36255,10 @@ async function cleanupE2eScenarioIdentity(options, dependencies = DEFAULT_DEPEND
|
|
|
36163
36255
|
evidence: result.evidence,
|
|
36164
36256
|
business_step_advanced: false,
|
|
36165
36257
|
formal_result: "partial",
|
|
36166
|
-
current_step: current.step_id
|
|
36258
|
+
current_step: current ? current.step_id : null,
|
|
36259
|
+
lease_case_id: caseId,
|
|
36260
|
+
terminal_run: !current,
|
|
36261
|
+
run_result: String(execution.result || "") || void 0
|
|
36167
36262
|
};
|
|
36168
36263
|
});
|
|
36169
36264
|
}
|
|
@@ -44963,6 +45058,122 @@ function rowText(row) {
|
|
|
44963
45058
|
row.parallel_type
|
|
44964
45059
|
].filter(Boolean).join(" ");
|
|
44965
45060
|
}
|
|
45061
|
+
function rowObjectLocks(row) {
|
|
45062
|
+
return (row.object_lock || "").split(/[;;,,、\s]+/).map((item) => item.trim().replace(/[。.]$/, "")).filter((item) => /^[a-z][a-z0-9-]*:[^\s]+$/i.test(item));
|
|
45063
|
+
}
|
|
45064
|
+
function readonlyLockTable(text5) {
|
|
45065
|
+
const locks = /* @__PURE__ */ new Set();
|
|
45066
|
+
const section = extractMarkdownSection(text5, "\u5BF9\u8C61\u9501\u8868");
|
|
45067
|
+
if (!section) return locks;
|
|
45068
|
+
for (const table of extractMarkdownTables(section)) {
|
|
45069
|
+
for (const row of table.rows) {
|
|
45070
|
+
const lock = (row["\u5BF9\u8C61\u9501"] || "").trim().toLowerCase();
|
|
45071
|
+
if (!lock) continue;
|
|
45072
|
+
if (/readonly\.?[^:]*$|只读/.test((row["\u5141\u8BB8\u64CD\u4F5C"] || "").trim())) locks.add(lock);
|
|
45073
|
+
}
|
|
45074
|
+
}
|
|
45075
|
+
return locks;
|
|
45076
|
+
}
|
|
45077
|
+
function isExclusiveWriteRow(row) {
|
|
45078
|
+
return /exclusive-write/i.test(row.subagent_mode || "");
|
|
45079
|
+
}
|
|
45080
|
+
function taskDependencyIds(row) {
|
|
45081
|
+
return [...new Set((row.dependencies || "").match(/\bT\d+\b/gi) || [])].map((id) => id.toUpperCase());
|
|
45082
|
+
}
|
|
45083
|
+
function objectLockDomains(locks) {
|
|
45084
|
+
return new Set(locks.map((lock) => lock.split(":")[0].trim().toLowerCase()).filter(Boolean));
|
|
45085
|
+
}
|
|
45086
|
+
function hasCreatePathEvidence(evidence) {
|
|
45087
|
+
const text5 = evidence || "";
|
|
45088
|
+
return /(?:^|\s)create(?:\s|$|\/)|\bconfig\s+\S+\s+create\b/i.test(text5);
|
|
45089
|
+
}
|
|
45090
|
+
function hasExactConfirmEvidence(evidence) {
|
|
45091
|
+
const text5 = evidence || "";
|
|
45092
|
+
return /--confirm\s+\S/.test(text5) || /精确确认|确认文本/.test(text5);
|
|
45093
|
+
}
|
|
45094
|
+
function rowsHaveExecutableTable(text5) {
|
|
45095
|
+
return extractTaskRows(text5).length > 0;
|
|
45096
|
+
}
|
|
45097
|
+
function validateTaskbookTraceabilityGates(text5) {
|
|
45098
|
+
const messages = [];
|
|
45099
|
+
const rows2 = extractTaskRows(text5);
|
|
45100
|
+
if (!rows2.length) return messages;
|
|
45101
|
+
if (!BLUEPRINT_TASKBOOK_PATTERN.test(text5)) return messages;
|
|
45102
|
+
const taskIDs = new Set(rows2.map((row) => (row.task_id || "").trim().toUpperCase()).filter(Boolean));
|
|
45103
|
+
const specs = [
|
|
45104
|
+
{
|
|
45105
|
+
section: "\u8C03\u6574\u9879 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
45106
|
+
idLabel: "\u8C03\u6574\u9879\u7F16\u53F7",
|
|
45107
|
+
sourceLabel: "\u8C03\u6574\u6E05\u5355\u6765\u6E90",
|
|
45108
|
+
pattern: /\b(?:C\d+|A\d+|F\d+)\b/gi
|
|
45109
|
+
},
|
|
45110
|
+
{
|
|
45111
|
+
section: "\u84DD\u56FE\u8282\u70B9 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
45112
|
+
idLabel: "\u8282\u70B9\u7F16\u53F7",
|
|
45113
|
+
sourceLabel: "\u8282\u70B9\u6E05\u5355\u6765\u6E90",
|
|
45114
|
+
pattern: /\b(?:P\d+|\d{1,2})\b/g
|
|
45115
|
+
}
|
|
45116
|
+
];
|
|
45117
|
+
for (const spec of specs) {
|
|
45118
|
+
const section = extractMarkdownSection(text5, spec.section);
|
|
45119
|
+
if (section === void 0) {
|
|
45120
|
+
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`);
|
|
45121
|
+
continue;
|
|
45122
|
+
}
|
|
45123
|
+
const table = extractMarkdownTables(section)[0];
|
|
45124
|
+
if (!table) {
|
|
45125
|
+
messages.push(`\u300C${spec.section}\u300D\u5FC5\u987B\u4F7F\u7528\u8868\u683C\u3002`);
|
|
45126
|
+
continue;
|
|
45127
|
+
}
|
|
45128
|
+
if (!table.headers.includes(spec.idLabel) || !table.headers.includes("\u4EFB\u52A1")) {
|
|
45129
|
+
messages.push(`\u300C${spec.section}\u300D\u7F3A\u5C11 ${spec.idLabel} \u6216 \u4EFB\u52A1 \u5217\u3002`);
|
|
45130
|
+
continue;
|
|
45131
|
+
}
|
|
45132
|
+
if (!table.rows.some((row) => new RegExp(spec.sourceLabel).test(row["\u6765\u6E90"] || "") || (row[spec.sourceLabel] || "").trim())) {
|
|
45133
|
+
if (!new RegExp(spec.sourceLabel).test(section) && !/来源文件|版本/.test(section)) {
|
|
45134
|
+
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`);
|
|
45135
|
+
}
|
|
45136
|
+
}
|
|
45137
|
+
const seenIDs = /* @__PURE__ */ new Set();
|
|
45138
|
+
for (const [rowIndex, row] of table.rows.entries()) {
|
|
45139
|
+
const ids = (row[spec.idLabel] || "").match(spec.pattern) || [];
|
|
45140
|
+
if (!ids.length) {
|
|
45141
|
+
if (BLUEPRINT_PLACEHOLDER_PATTERN.test((row[spec.idLabel] || "").trim())) continue;
|
|
45142
|
+
messages.push(`\u300C${spec.section}\u300D\u7B2C ${rowIndex + 1} \u884C\u7F3A\u5C11\u6709\u6548${spec.idLabel}\u3002`);
|
|
45143
|
+
continue;
|
|
45144
|
+
}
|
|
45145
|
+
ids.forEach((id) => seenIDs.add(id.toUpperCase()));
|
|
45146
|
+
const taskIDsInRow = (row["\u4EFB\u52A1"] || "").match(/\bT\d+\b/gi) || [];
|
|
45147
|
+
if (!taskIDsInRow.length) {
|
|
45148
|
+
messages.push(`\u300C${spec.section}\u300D\u7B2C ${rowIndex + 1} \u884C\u6CA1\u6709\u5173\u8054\u4EFB\u52A1\u3002`);
|
|
45149
|
+
continue;
|
|
45150
|
+
}
|
|
45151
|
+
for (const taskId of taskIDsInRow) {
|
|
45152
|
+
if (!taskIDs.has(taskId.toUpperCase())) {
|
|
45153
|
+
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`);
|
|
45154
|
+
}
|
|
45155
|
+
}
|
|
45156
|
+
}
|
|
45157
|
+
const declaredBlock = section.match(/编号清单\s*[::]\s*([^\n]+)/)?.[1] || "";
|
|
45158
|
+
if (!BLUEPRINT_PLACEHOLDER_PATTERN.test(declaredBlock.trim())) {
|
|
45159
|
+
const declaredIDs = (declaredBlock.match(spec.pattern) || []).map((id) => id.toUpperCase());
|
|
45160
|
+
for (const declared of new Set(declaredIDs)) {
|
|
45161
|
+
if (!seenIDs.has(declared)) {
|
|
45162
|
+
messages.push(`\u300C${spec.section}\u300D\u58F0\u660E\u7684${spec.idLabel} ${declared} \u6CA1\u6709\u51FA\u73B0\u5728\u4EFB\u4F55\u4EFB\u52A1\u884C\u4E2D\u3002`);
|
|
45163
|
+
}
|
|
45164
|
+
}
|
|
45165
|
+
}
|
|
45166
|
+
}
|
|
45167
|
+
const gateSection = extractMarkdownSection(text5, "\u9A8C\u6536\u95E8\u7981");
|
|
45168
|
+
if (gateSection) {
|
|
45169
|
+
const gateLines = gateSection.split(/\r?\n/).map((line) => line.trim()).filter((line) => /^[-*]\s+/.test(line));
|
|
45170
|
+
const unmapped = gateLines.filter((line) => !/\bT\d+\b/i.test(line));
|
|
45171
|
+
if (gateLines.length && unmapped.length === gateLines.length) {
|
|
45172
|
+
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");
|
|
45173
|
+
}
|
|
45174
|
+
}
|
|
45175
|
+
return messages;
|
|
45176
|
+
}
|
|
44966
45177
|
function addTaskbookIssue(issues, code, ruleId, message, options = {}) {
|
|
44967
45178
|
issues.push({
|
|
44968
45179
|
code,
|
|
@@ -44973,6 +45184,121 @@ function addTaskbookIssue(issues, code, ruleId, message, options = {}) {
|
|
|
44973
45184
|
suggestion: options.suggestion
|
|
44974
45185
|
});
|
|
44975
45186
|
}
|
|
45187
|
+
function validateTaskbookExecutionStructure(text5, issues) {
|
|
45188
|
+
const rows2 = extractTaskRows(text5);
|
|
45189
|
+
if (!rows2.length) return;
|
|
45190
|
+
const taskIds = /* @__PURE__ */ new Map();
|
|
45191
|
+
rows2.forEach((row, index) => {
|
|
45192
|
+
const id = (row.task_id || "").trim().toUpperCase();
|
|
45193
|
+
if (id) taskIds.set(id, index);
|
|
45194
|
+
});
|
|
45195
|
+
const readonlyLocks = readonlyLockTable(text5);
|
|
45196
|
+
for (const [index, row] of rows2.entries()) {
|
|
45197
|
+
const taskId = row.task_id || "<unknown>";
|
|
45198
|
+
const dependsOn = taskDependencyIds(row);
|
|
45199
|
+
const writeMode = isWriteMode(row);
|
|
45200
|
+
const locks = rowObjectLocks(row);
|
|
45201
|
+
for (const dependency of dependsOn) {
|
|
45202
|
+
const dependencyIndex = taskIds.get(dependency);
|
|
45203
|
+
if (dependencyIndex === void 0) {
|
|
45204
|
+
continue;
|
|
45205
|
+
}
|
|
45206
|
+
if (dependencyIndex > index) {
|
|
45207
|
+
addTaskbookIssue(
|
|
45208
|
+
issues,
|
|
45209
|
+
"dependency_inversion",
|
|
45210
|
+
"taskbook.execution.dependency_inversion",
|
|
45211
|
+
`\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`,
|
|
45212
|
+
{
|
|
45213
|
+
path: `tasks.${taskId}.dependencies`,
|
|
45214
|
+
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"
|
|
45215
|
+
}
|
|
45216
|
+
);
|
|
45217
|
+
}
|
|
45218
|
+
}
|
|
45219
|
+
if (writeMode) {
|
|
45220
|
+
for (const lock of locks) {
|
|
45221
|
+
const normalized = lock.toLowerCase();
|
|
45222
|
+
if (readonlyLocks.has(normalized)) {
|
|
45223
|
+
addTaskbookIssue(
|
|
45224
|
+
issues,
|
|
45225
|
+
"readonly_lock_in_write_task",
|
|
45226
|
+
"taskbook.execution.readonly_lock",
|
|
45227
|
+
`\u5199\u4EFB\u52A1 ${taskId} \u7684\u5BF9\u8C61\u9501\u5305\u542B\u9501\u8868\u4E2D\u6807\u8BB0\u4E3A\u53EA\u8BFB\u7684 ${lock}\u3002`,
|
|
45228
|
+
{
|
|
45229
|
+
path: `tasks.${taskId}.object_lock`,
|
|
45230
|
+
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"
|
|
45231
|
+
}
|
|
45232
|
+
);
|
|
45233
|
+
}
|
|
45234
|
+
}
|
|
45235
|
+
const domains = objectLockDomains(locks);
|
|
45236
|
+
if (domains.size >= 3 && isExclusiveWriteRow(row)) {
|
|
45237
|
+
addTaskbookIssue(
|
|
45238
|
+
issues,
|
|
45239
|
+
"task_granularity_too_coarse",
|
|
45240
|
+
"taskbook.execution.task_granularity",
|
|
45241
|
+
`\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`,
|
|
45242
|
+
{
|
|
45243
|
+
path: `tasks.${taskId}.object_lock`,
|
|
45244
|
+
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"
|
|
45245
|
+
}
|
|
45246
|
+
);
|
|
45247
|
+
}
|
|
45248
|
+
const createsNewObject = locks.some((lock) => /:new-/.test(lock));
|
|
45249
|
+
const evidence = row.evidence || "";
|
|
45250
|
+
if (createsNewObject && !hasCreatePathEvidence(evidence)) {
|
|
45251
|
+
addTaskbookIssue(
|
|
45252
|
+
issues,
|
|
45253
|
+
"create_evidence_missing",
|
|
45254
|
+
"taskbook.execution.create_evidence",
|
|
45255
|
+
`\u4EFB\u52A1 ${taskId} \u8981\u521B\u5EFA\u65B0\u5BF9\u8C61\uFF0C\u4F46 evidence \u6CA1\u6709 create \u8DEF\u5F84\u3002`,
|
|
45256
|
+
{
|
|
45257
|
+
path: `tasks.${taskId}.evidence`,
|
|
45258
|
+
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"
|
|
45259
|
+
}
|
|
45260
|
+
);
|
|
45261
|
+
}
|
|
45262
|
+
if (createsNewObject && hasCreatePathEvidence(evidence) && !hasExactConfirmEvidence(evidence)) {
|
|
45263
|
+
addTaskbookIssue(
|
|
45264
|
+
issues,
|
|
45265
|
+
"create_confirm_missing",
|
|
45266
|
+
"taskbook.execution.create_confirm",
|
|
45267
|
+
`\u4EFB\u52A1 ${taskId} \u7684 create \u8BC1\u636E\u7F3A\u5C11\u7CBE\u786E --confirm \u6587\u672C\u3002`,
|
|
45268
|
+
{
|
|
45269
|
+
path: `tasks.${taskId}.evidence`,
|
|
45270
|
+
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'
|
|
45271
|
+
}
|
|
45272
|
+
);
|
|
45273
|
+
}
|
|
45274
|
+
}
|
|
45275
|
+
}
|
|
45276
|
+
for (let left = 0; left < rows2.length; left += 1) {
|
|
45277
|
+
for (let right = left + 1; right < rows2.length; right += 1) {
|
|
45278
|
+
const leftRow = rows2[left];
|
|
45279
|
+
const rightRow = rows2[right];
|
|
45280
|
+
if (!isWriteMode(leftRow) || !isWriteMode(rightRow)) continue;
|
|
45281
|
+
const leftId = (leftRow.task_id || "").toUpperCase();
|
|
45282
|
+
const rightId = (rightRow.task_id || "").toUpperCase();
|
|
45283
|
+
const related = taskDependencyIds(leftRow).includes(rightId) || taskDependencyIds(rightRow).includes(leftId) || /单线/.test(leftRow.parallel_type || "") || /单线/.test(rightRow.parallel_type || "");
|
|
45284
|
+
if (related) continue;
|
|
45285
|
+
const rightLocks = new Set(rowObjectLocks(rightRow).map((lock) => lock.toLowerCase()));
|
|
45286
|
+
const conflicts = rowObjectLocks(leftRow).filter((lock) => rightLocks.has(lock.toLowerCase()));
|
|
45287
|
+
for (const lock of conflicts) {
|
|
45288
|
+
addTaskbookIssue(
|
|
45289
|
+
issues,
|
|
45290
|
+
"parallel_object_lock_conflict",
|
|
45291
|
+
"taskbook.execution.lock_conflict",
|
|
45292
|
+
`\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`,
|
|
45293
|
+
{
|
|
45294
|
+
path: `tasks.${leftRow.task_id}.object_lock`,
|
|
45295
|
+
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"
|
|
45296
|
+
}
|
|
45297
|
+
);
|
|
45298
|
+
}
|
|
45299
|
+
}
|
|
45300
|
+
}
|
|
45301
|
+
}
|
|
44976
45302
|
function extractMarkdownSection(text5, title) {
|
|
44977
45303
|
const lines = text5.split(/\r?\n/);
|
|
44978
45304
|
for (let index = 0; index < lines.length; index += 1) {
|
|
@@ -45653,6 +45979,13 @@ async function lintTaskbook(file, options = {}) {
|
|
|
45653
45979
|
}
|
|
45654
45980
|
validateTaskbookNavigationAndListGates(text5, issues);
|
|
45655
45981
|
validateTaskbookConfigSkillGates(text5, issues);
|
|
45982
|
+
validateTaskbookExecutionStructure(text5, issues);
|
|
45983
|
+
for (const message of validateTaskbookTraceabilityGates(text5)) {
|
|
45984
|
+
addTaskbookIssue(issues, "missing_taskbook_traceability", "taskbook.execution.traceability", message, {
|
|
45985
|
+
path: "traceability",
|
|
45986
|
+
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"
|
|
45987
|
+
});
|
|
45988
|
+
}
|
|
45656
45989
|
for (const match of text5.matchAll(FLOW_LOCK_PATTERN)) {
|
|
45657
45990
|
const value = match[1] || "";
|
|
45658
45991
|
if (value.startsWith("flow") && /^flow\d+$/.test(value)) {
|
|
@@ -45666,9 +45999,17 @@ async function lintTaskbook(file, options = {}) {
|
|
|
45666
45999
|
{ 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
46000
|
);
|
|
45668
46001
|
}
|
|
46002
|
+
const EXECUTION_RULE_PREFIXES = ["taskbook.execution."];
|
|
46003
|
+
const executableIssues = issues.filter((issue3) => EXECUTION_RULE_PREFIXES.some((prefix) => issue3.rule_id.startsWith(prefix)));
|
|
46004
|
+
const formatIssues = issues.filter((issue3) => !executableIssues.includes(issue3));
|
|
46005
|
+
if (!rowsHaveExecutableTable(text5)) {
|
|
46006
|
+
executableIssues.length = 0;
|
|
46007
|
+
}
|
|
45669
46008
|
const errors = uniqueErrors(issueMessages(issues));
|
|
45670
46009
|
return {
|
|
45671
46010
|
ok: errors.length === 0,
|
|
46011
|
+
format_ok: uniqueErrors(issueMessages(formatIssues)).length === 0,
|
|
46012
|
+
executable_ok: uniqueErrors(issueMessages(executableIssues)).length === 0,
|
|
45672
46013
|
file,
|
|
45673
46014
|
errors,
|
|
45674
46015
|
issues,
|
|
@@ -45707,6 +46048,8 @@ async function lintTaskPrompt(file, options = {}) {
|
|
|
45707
46048
|
file,
|
|
45708
46049
|
errors,
|
|
45709
46050
|
issues,
|
|
46051
|
+
format_ok: errors.length === 0,
|
|
46052
|
+
executable_ok: errors.length === 0,
|
|
45710
46053
|
checked_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
45711
46054
|
};
|
|
45712
46055
|
}
|
|
@@ -45758,6 +46101,25 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45758
46101
|
"|---|---|---|---|---|---|",
|
|
45759
46102
|
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
45760
46103
|
"",
|
|
46104
|
+
"## \u8C03\u6574\u9879 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
46105
|
+
"",
|
|
46106
|
+
"- \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",
|
|
46107
|
+
"- \u7F16\u53F7\u6E05\u5355\uFF1A\u5F85\u586B\u5199\u3002\u9010\u4E2A\u5217\u51FA\u8C03\u6574\u6E05\u5355\u91CC\u7684\u6BCF\u4E2A\u7F16\u53F7\uFF08\u4F8B\u5982 C \u5F00\u5934\u6216 F \u5F00\u5934\u7684\u8C03\u6574\u9879 ID\uFF09\u3002",
|
|
46108
|
+
"",
|
|
46109
|
+
"| \u8C03\u6574\u9879\u7F16\u53F7 | \u8C03\u6574\u5185\u5BB9 | \u4EFB\u52A1 | \u9A8C\u6536\u8BC1\u636E |",
|
|
46110
|
+
"|---|---|---|---|",
|
|
46111
|
+
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
46112
|
+
"",
|
|
46113
|
+
"## \u84DD\u56FE\u8282\u70B9 \u2192 \u4EFB\u52A1\u8FFD\u6EAF\u8868",
|
|
46114
|
+
"",
|
|
46115
|
+
"- \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",
|
|
46116
|
+
"- \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\u548C\u4E0D\u5360\u4E3B\u5E8F\u53F7\u7684\u5E76\u884C\u5206\u652F\u8282\u70B9\u3002",
|
|
46117
|
+
"- \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",
|
|
46118
|
+
"",
|
|
46119
|
+
"| \u8282\u70B9\u7F16\u53F7 | \u8282\u70B9\u540D\u79F0 | \u4EFB\u52A1 | \u8868\u5355 | \u8D23\u4EFB\u89D2\u8272 | \u9A8C\u6536\u8BC1\u636E |",
|
|
46120
|
+
"|---|---|---|---|---|---|",
|
|
46121
|
+
"| \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 | \u5F85\u586B\u5199 |",
|
|
46122
|
+
"",
|
|
45761
46123
|
"## \u5E76\u884C\u62C6\u89E3\u786C\u89C4\u5219",
|
|
45762
46124
|
"",
|
|
45763
46125
|
"- \u5BF9\u8C61\u9501\u91CD\u590D\u4E0D\u5F97\u5E76\u884C\u3002",
|
|
@@ -45800,7 +46162,7 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45800
46162
|
"",
|
|
45801
46163
|
"| task_id | status | phase | parallel_type | subagent_mode | business_goal | required_skills | object_lock | dependencies | owner | evidence | notes |",
|
|
45802
46164
|
"|---|---|---|---|---|---|---|---|---|---|---|---|",
|
|
45803
|
-
"| T00 | \u672A\u5F00\u59CB | 0 | \u5355\u7EBF |
|
|
46165
|
+
"| 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
46166
|
"| 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
46167
|
"",
|
|
45806
46168
|
"- \u6BCF\u4E2A\u4EFB\u52A1\u7684 `business_goal` \u90FD\u5FC5\u987B\u5199\u6E05\u695A\u4E1A\u52A1\u76EE\u6807\u573A\u666F\u3002",
|
|
@@ -45823,12 +46185,12 @@ function taskbookTemplate(title = "BPMAX AI \u5B9E\u65BD\u7F16\u6392\u4EFB\u52A1
|
|
|
45823
46185
|
"",
|
|
45824
46186
|
"## \u9A8C\u6536\u95E8\u7981",
|
|
45825
46187
|
"",
|
|
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",
|
|
46188
|
+
"- [ ] T00\uFF1A\u914D\u7F6E\u5BF9\u8C61\u7EBF\u4E0A\u56DE\u8BFB\u901A\u8FC7\u3002",
|
|
46189
|
+
"- [ ] 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",
|
|
46190
|
+
"- [ ] 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",
|
|
46191
|
+
"- [ ] 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",
|
|
46192
|
+
"- [ ] T01\uFF1A\u6D4F\u89C8\u5668 E2E \u9A8C\u8BC1\u901A\u8FC7\u3002",
|
|
46193
|
+
"- [ ] T01\uFF1A\u6D4B\u8BD5\u62A5\u544A\u548C\u622A\u56FE\u8BC1\u636E\u5B8C\u6574\u3002",
|
|
45832
46194
|
"",
|
|
45833
46195
|
"## \u5BFC\u822A\u5165\u53E3\u7B56\u7565\u4E0E\u5217\u8868 lint",
|
|
45834
46196
|
"",
|