@stalfh233/omc-cli 0.6.82 → 0.6.84
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/cli.js +97 -6
- package/dist/config-store.js +35 -0
- package/dist/endpoints.js +10 -0
- package/dist/lanes/businessrule.js +78 -2
- package/dist/lanes/environment-contract.js +8 -0
- package/dist/lanes/environment.js +73 -0
- package/dist/lanes/runtime-data-contract.js +8 -0
- package/dist/lanes/runtime-data.js +99 -12
- package/dist/lanes/workflow.js +101 -64
- package/dist/path-projection.js +163 -24
- package/dist/read-shapes.js +2 -1
- package/dist/refusal-guidance.js +1 -1
- package/dist/rule-support.js +105 -15
- package/dist/session.js +27 -0
- package/dist/token-cache.js +3 -0
- package/dist/tool-types.js +3 -1
- package/dist/writable-window.js +209 -0
- package/package.json +3 -3
|
@@ -1162,7 +1162,10 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1162
1162
|
fields: z.array(z.string().min(1)).optional().describe("列投影别名(=displayFields;与 data.load/data.save/data.update 的 fields 同语义)"),
|
|
1163
1163
|
// r73 #4(GitLab #40 P1):只读查询的排序 fallback 首选曾是写操作(listview.configure
|
|
1164
1164
|
// 会改线上视图、影响所有用户)。顺序反转——本地排序第一,视图级写操作殿后并注明代价。
|
|
1165
|
-
|
|
1165
|
+
// r86(retro issue 16):wire 侧其实有服务端排序(QueryDataVO.orders,真机 1.1.25
|
|
1166
|
+
// 实证生效)——orderBy 映射为 orders:[{propertyCode,dir:ASC|DESC}];教学进
|
|
1167
|
+
// contract/notes(tools/list 只留这句)。
|
|
1168
|
+
orderBy: z.array(z.object({ field: z.string().min(1), direction: z.enum(["asc", "desc"]) })).optional().describe("服务端排序 [{field,direction:asc|desc}](wire=orders,dir 发送时转大写);多键按数组序优先;可排面=已发布字段+系统列(createdTime/modifiedTime 等);子表 schema 面被平台忽略"),
|
|
1166
1169
|
mobile: z.boolean().optional(),
|
|
1167
1170
|
// r63(b-F12):draftPolicy 此前只能从结果反推——探针无法控制也无法预知
|
|
1168
1171
|
// 草稿口径。显式开关:false 注入 sequenceStatus≠DRAFT(真机验证可过滤,
|
|
@@ -1189,17 +1192,14 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1189
1192
|
tool: "data.list",
|
|
1190
1193
|
message: '没有 `query` 参数——过滤用 `filter: {"op":"eq","field":"<字段>","value":"<值>"}`(或 `filters` 数组=AND、`filterGroup` 嵌套)。r31 真机:`query:{...}` 被静默忽略、total 不变,极易误判为"无数据/已过滤"。',
|
|
1191
1194
|
});
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
message: "运行面 query/list 不支持服务端排序。排序请先在本地做:用本工具取回数据(全量 all:true 或逐页翻页),再按 items[].fields.<字段> 在本地排序(--jq 只能投影不能排序,需用客户端脚本/管道排)。只有确实要改**视图级**默认排序时才用 listview.configure 的 sorts(写操作:会改线上视图排序、影响所有用户,谨慎)。",
|
|
1201
|
-
nextCommand: `omc call data.list --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, all: true })}'(取回全量后本地排序)`,
|
|
1202
|
-
});
|
|
1195
|
+
// r86(retro issue 16):orderBy 参数面 → wire orders(QueryDataVO.orders,
|
|
1196
|
+
// 真机 1.1.25 实证:dir 枚举 ASC|DESC 大小写敏感、未知列 40000、多键数组序
|
|
1197
|
+
// 优先、orders 优先于视图 sorts、无则平台默认 createdTime DESC)。
|
|
1198
|
+
const orderBy = args.orderBy;
|
|
1199
|
+
// r86(retro issue 15):子表拒绝只看**调用方显式给的**过滤面。includeDrafts:false
|
|
1200
|
+
// 注入的 sequenceStatus≠DRAFT 是默认属性(平台子表分支自建同款 parent-scope
|
|
1201
|
+
// notDraftFilter),按父模型解析也成立,不该被新门误伤。
|
|
1202
|
+
const userFilterRequested = args.rawCondition !== undefined || args.filter !== undefined || (args.filters?.length ?? 0) > 0 || args.filterGroup !== undefined;
|
|
1203
1203
|
let condition;
|
|
1204
1204
|
let fromDsl = false;
|
|
1205
1205
|
try {
|
|
@@ -1266,6 +1266,22 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1266
1266
|
publishedTypes = new Map((await publishedFields()).map((row) => [row.code, row.type]));
|
|
1267
1267
|
return publishedTypes;
|
|
1268
1268
|
};
|
|
1269
|
+
/**
|
|
1270
|
+
* r86(retro issue 15):子表 schema 判别——bizmodels/get_all 的 parentCode
|
|
1271
|
+
* (BizSchemaModel.parentCode,QueryRuntimeController.list 同源判别)。
|
|
1272
|
+
* 非子表/读不到(8.0/8.1 不挂载该路径、模型不存在)都返回 undefined,
|
|
1273
|
+
* 调用方按「不能预判」处理(发 wire,50000 时再映射)。
|
|
1274
|
+
*/
|
|
1275
|
+
const subtableParentCodeOf = async (session, schemaCode) => {
|
|
1276
|
+
try {
|
|
1277
|
+
const record = (await wireCall(session, { path: ENDPOINTS.modelGet, query: { schemaCode } })).data;
|
|
1278
|
+
const parent = record?.parentCode;
|
|
1279
|
+
return typeof parent === "string" && parent.trim().length > 0 ? parent : undefined;
|
|
1280
|
+
}
|
|
1281
|
+
catch {
|
|
1282
|
+
return undefined;
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1269
1285
|
if (fromDsl) {
|
|
1270
1286
|
const typeByCode = await publishedTypeByCode();
|
|
1271
1287
|
const injected = injectPropertyTypes(condition, (code) => {
|
|
@@ -1353,6 +1369,58 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1353
1369
|
message: `这些字段是子表(propertyType=${CHILD_TABLE_PROPERTY_TYPE},值是行数组):运行面 query/list 只支持标量过滤,按子表字段过滤会回 errcode 50000 且无明细。改法:用 data.load 读主表记录(子表行随主记录返回),或在本地按子表字段筛选。`,
|
|
1354
1370
|
nextCommand: `omc call data.load --env <env> --args '{"schemaCode":"${args.schemaCode}","bizObjectId":"<主表 bizObjectId>"}'`,
|
|
1355
1371
|
};
|
|
1372
|
+
// r86(retro issue 15,真机 1.1.25 实证):schemaCode 本身是子表 schema
|
|
1373
|
+
// (get_all parentCode 非空)时,queryCondition 的裸叶子被平台按**父模型**
|
|
1374
|
+
// 元数据解析(ChildBizObjectAssembler.buildFilter(父code) + 无点号→
|
|
1375
|
+
// schema=parentCode)——子表自身字段(含 parentId)→ 50000 服务异常。
|
|
1376
|
+
// DSL 叶子按子表自身 field.list 注入 propertyType 后必然是裸子表字段,
|
|
1377
|
+
// 全部是错误形状,写前整批拒绝(+1 wire 读 get_all 换拒绝面)。
|
|
1378
|
+
const parentCode = await subtableParentCodeOf(session, args.schemaCode);
|
|
1379
|
+
if (parentCode !== undefined && userFilterRequested)
|
|
1380
|
+
return {
|
|
1381
|
+
status: "refused",
|
|
1382
|
+
blocker: "unsupported-filter-on-subtable",
|
|
1383
|
+
schemaCode: args.schemaCode,
|
|
1384
|
+
parentSchema: parentCode,
|
|
1385
|
+
fields: collectConditionLeafFields(condition),
|
|
1386
|
+
message: `${args.schemaCode} 是子表模型(父模型 ${parentCode}):运行面 query/list 的过滤叶子按**父模型**解析——裸子表字段(含 parentId)会回 errcode 50000「服务异常」(真机实证),不是平台故障。` +
|
|
1387
|
+
`读子表行的正路:data.load 父模型记录(子表行随主记录返回),或本工具不带 filter 全量拉子表后本地筛。要点号「<子表code>.<字段>」形状请走 rawCondition。`,
|
|
1388
|
+
nextCommand: `omc call data.load --env <env> --args '{"schemaCode":"${parentCode}","bizObjectId":"<主表 bizObjectId>"}' --jq 'data.${args.schemaCode}'`,
|
|
1389
|
+
};
|
|
1390
|
+
}
|
|
1391
|
+
// r86(retro issue 16):orderBy 参数面 → wire orders。可排面 = 已发布字段 +
|
|
1392
|
+
// 系统列(平台默认排序本身用 createdTime,8.6.26 resolveSorts;真机 1.1.25
|
|
1393
|
+
// 实证 createdTime/modifiedTime/业务列均可排)。不在可排面的列写前拒——
|
|
1394
|
+
// 平台会回 40000「调用数据库发生异常」(真机),与真故障难分。
|
|
1395
|
+
let wireOrders;
|
|
1396
|
+
if (orderBy !== undefined && orderBy.length > 0) {
|
|
1397
|
+
// r86(retro issue 16):可排面 = 已发布业务字段 + **全部**默认属性列
|
|
1398
|
+
// (DefaultPropertyType.codes:id/name/creater/createdDeptId/owner/
|
|
1399
|
+
// ownerDeptId/createdTime/modifier/modifiedTime/workflowInstanceId/
|
|
1400
|
+
// sequenceNo/sequenceStatus/ownerDeptQueryCode/version)——真机 1.1.25
|
|
1401
|
+
// 逐列实证 createdTime/name/id/sequenceNo 均可排;它们都是物理列,不是
|
|
1402
|
+
// 元数据特例。只放 createdTime/modifiedTime 会把合法排序误拒。
|
|
1403
|
+
const ORDERABLE_SYSTEM_FIELDS = new Set([
|
|
1404
|
+
"id", "name", "creater", "createdDeptId", "owner", "ownerDeptId", "createdTime",
|
|
1405
|
+
"modifier", "modifiedTime", "workflowInstanceId", "sequenceNo", "sequenceStatus",
|
|
1406
|
+
"ownerDeptQueryCode", "version",
|
|
1407
|
+
]);
|
|
1408
|
+
const catalog = await publishedFields();
|
|
1409
|
+
const codes = catalog.map((row) => row.code);
|
|
1410
|
+
const missing = [...new Set(orderBy.map((entry) => entry.field))].filter((field) => !ORDERABLE_SYSTEM_FIELDS.has(field) && !codes.includes(field));
|
|
1411
|
+
if (missing.length > 0)
|
|
1412
|
+
return {
|
|
1413
|
+
status: "refused",
|
|
1414
|
+
blocker: "unsupported-order-field",
|
|
1415
|
+
schemaCode: args.schemaCode,
|
|
1416
|
+
fields: missing,
|
|
1417
|
+
...(catalog.length > 0 && catalog.length <= FILTER_FIELD_SAMPLE_LIMIT ? { acceptedValues: { "orderBy.field": [...ORDERABLE_SYSTEM_FIELDS, ...codes] } } : {}),
|
|
1418
|
+
message: `排序字段不在可排面:${missing.join("、")}(可排 = 已发布字段 + 系统列,如 createdTime/modifiedTime/name/id/sequenceNo)。` +
|
|
1419
|
+
`平台对未知排序列回 40000「调用数据库发生异常」(真机实证:no_such_col DESC → 40000),与数据库真故障同码——写前拒绝免歧义。` +
|
|
1420
|
+
`排序形状:orderBy:[{"field":"modifiedTime","direction":"desc"}],多键按数组序优先。`,
|
|
1421
|
+
...(catalog.length > 0 ? { nextCommand: `omc call field.list --env <env> --args '{"schemaCode":"${args.schemaCode}","published":true}'` } : {}),
|
|
1422
|
+
};
|
|
1423
|
+
wireOrders = orderBy.map((entry) => ({ propertyCode: entry.field, dir: entry.direction === "desc" ? "DESC" : "ASC" }));
|
|
1356
1424
|
}
|
|
1357
1425
|
// r29b F9: fields 是 displayFields/columns 的同义别名(与 data.load 对齐)。
|
|
1358
1426
|
const requestedFields = args.displayFields ?? args.columns ?? args.fields;
|
|
@@ -1367,6 +1435,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1367
1435
|
queryVersion: 1,
|
|
1368
1436
|
showTotal: args.showTotal !== false,
|
|
1369
1437
|
...(condition !== undefined ? { queryCondition: condition } : {}),
|
|
1438
|
+
...(wireOrders !== undefined ? { orders: wireOrders } : {}),
|
|
1370
1439
|
};
|
|
1371
1440
|
// An empty model answers with a business error (301005) on this face;
|
|
1372
1441
|
// that is "no data yet", not a query failure.
|
|
@@ -1524,7 +1593,25 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1524
1593
|
// 不改判定的排查提示——子表/子表 schema 的过滤与系统字段过滤是这个面
|
|
1525
1594
|
// 最常见的"服务异常"来源(live: 子表 schema 加 parentId 过滤 → 50000,
|
|
1526
1595
|
// 去掉 filter 就正常)。只加 hint,不猜 blocker。
|
|
1596
|
+
// r86(retro issue 15):rawCondition 路径无法写前预判(点号形状合法),
|
|
1597
|
+
// 50000 后补读一次 get_all parentCode——确认是子表 schema 就把该形状
|
|
1598
|
+
// 重写为结构化 blocker(平台原文进 detail,不吞),否则维持原样抛出。
|
|
1527
1599
|
if (error instanceof WireError && error.kind === "business" && error.errcode === 50000) {
|
|
1600
|
+
if (condition !== undefined) {
|
|
1601
|
+
const parentCodeOn50000 = await subtableParentCodeOf(session, args.schemaCode);
|
|
1602
|
+
if (parentCodeOn50000 !== undefined)
|
|
1603
|
+
return {
|
|
1604
|
+
status: "refused",
|
|
1605
|
+
blocker: "unsupported-filter-on-subtable",
|
|
1606
|
+
schemaCode: args.schemaCode,
|
|
1607
|
+
parentSchema: parentCodeOn50000,
|
|
1608
|
+
rawCondition: true,
|
|
1609
|
+
detail: `平台原文:errcode 50000 ${error.message}`,
|
|
1610
|
+
message: `${args.schemaCode} 是子表模型(父模型 ${parentCodeOn50000}),本次查询带了 rawCondition——运行面 query/list 的过滤叶子按**父模型**解析,裸子表字段(含 parentId)会回 50000「服务异常」。` +
|
|
1611
|
+
`合法 wire 形状只有点号「<子表code>.<字段>」(真机实证 errcode 0);或改 data.load 读父模型记录后看子表数组。若 rawCondition 里已经全是点号字段仍 50000,按真服务异常排查(平台原文见 detail)。`,
|
|
1612
|
+
nextCommand: `omc call data.load --env <env> --args '{"schemaCode":"${parentCodeOn50000}","bizObjectId":"<主表 bizObjectId>"}' --jq 'data.${args.schemaCode}'`,
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1528
1615
|
throw new WireError(error.kind, error.message, error.errcode, error.diagnostic, `若 filter/filters 里含子表字段或子表自身 schema 的 parentId 等系统字段:运行面 query/list 的标量过滤不适用于子表,去掉 filter 后按主表 id 用 data.load 读子表行。其余情况按真服务异常处理(同一 schemaCode 去掉 filter 可读即说明是过滤形状问题)。`);
|
|
1529
1616
|
}
|
|
1530
1617
|
throw error;
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -2529,6 +2529,81 @@ async function ensureWorkflowRulesEnabled(session, schemaCode, codes, byCode) {
|
|
|
2529
2529
|
}
|
|
2530
2530
|
return { enabledRuleCodes, alreadyEnabledRuleCodes };
|
|
2531
2531
|
}
|
|
2532
|
+
/** 该 target(flow 级 handler / node 级事件)在模板上的 handler 对象。 */
|
|
2533
|
+
function bindTargetHandlerOf(template, target) {
|
|
2534
|
+
if (target.scope === "workflow")
|
|
2535
|
+
return (template?.[target.field] ?? {}) ?? {};
|
|
2536
|
+
return (findTemplateActivity(template, target.activityCode)?.[target.field] ?? {}) ?? {};
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* unbindRule 的读回+校验上下文——execute 与 dryRunPayload **共用这一个函数**
|
|
2540
|
+
* (同 rule.node.update 的 loadRuleNodePatchGraph 模式),保证 dry-run 与真写
|
|
2541
|
+
* 对「不存在流程 / 不存在活动 / absent code」给出完全相同的 refusal:此前
|
|
2542
|
+
* dry-run 走 write.ts 的泛型 plan 信封,打错 ruleCode 也回 wouldChange:true,
|
|
2543
|
+
* 真写才拒 absent。本函数只读草稿 + 本地校验(含模板渲染检查),零写入。
|
|
2544
|
+
*/
|
|
2545
|
+
async function unbindRuleContext(session, args) {
|
|
2546
|
+
const target = resolveBindTarget(args.handler, args.nodeEvent, args.activityCode);
|
|
2547
|
+
const codes = (args.ruleCodes ?? [args.ruleCode]).map(String);
|
|
2548
|
+
const shouldPublish = args.publish !== false;
|
|
2549
|
+
const draft = (await getWorkflowDraftOrNull(session, args.workflowCode)) ?? {};
|
|
2550
|
+
if (Object.keys(draft).length === 0) {
|
|
2551
|
+
throw new ToolRefusalError({
|
|
2552
|
+
status: "refused",
|
|
2553
|
+
blocker: "workflow-not-found",
|
|
2554
|
+
workflowCode: args.workflowCode,
|
|
2555
|
+
message: `流程 ${args.workflowCode} 不存在(get_draft 401001 缺席)——先 workflow.create,再 unbindRule`,
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
if (target.scope === "activity" && !findTemplateActivity(draft, target.activityCode)) {
|
|
2559
|
+
throw new ToolRefusalError({
|
|
2560
|
+
status: "refused",
|
|
2561
|
+
blocker: "workflow-activity-not-found",
|
|
2562
|
+
workflowCode: args.workflowCode,
|
|
2563
|
+
activityCode: target.activityCode,
|
|
2564
|
+
activities: templateActivityCodes(draft),
|
|
2565
|
+
message: `流程 ${args.workflowCode} 的草稿里没有活动 ${target.activityCode}——节点级事件必须指向已存在的活动。可用活动:${templateActivityCodes(draft).join("、") || "(无)"}(先用 workflow.get_draft 看 code,别用节点名)`,
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
const existing = bindTargetHandlerOf(draft, target);
|
|
2569
|
+
const priorActions = Array.isArray(existing.bizActions)
|
|
2570
|
+
? existing.bizActions.filter((value) => typeof value === "string")
|
|
2571
|
+
: [];
|
|
2572
|
+
// Fail closed BEFORE any wire call when the caller names codes the handler
|
|
2573
|
+
// does not carry — a typo'd ruleCode must not report a phantom success,
|
|
2574
|
+
// and the existing codes are the fix's raw material.
|
|
2575
|
+
const absent = codes.filter((code) => !priorActions.includes(code));
|
|
2576
|
+
if (absent.length > 0) {
|
|
2577
|
+
throw new ToolRefusalError({
|
|
2578
|
+
status: "refused",
|
|
2579
|
+
blocker: "workflow-unbind-rule-absent",
|
|
2580
|
+
workflowCode: args.workflowCode,
|
|
2581
|
+
absentRuleCodes: absent,
|
|
2582
|
+
bizActions: priorActions,
|
|
2583
|
+
...(target.scope === "activity" ? { activityCode: target.activityCode, nodeEvent: target.key } : { handler: target.key }),
|
|
2584
|
+
message: `该处理器当前没有绑定 ${absent.join("、")}——现有绑定:${priorActions.join("、") || "(无)"}。解绑只对已绑定的 code 生效;要换目标先看 workflow.get_draft 的 ruleBindings/nodeRuleBindings`,
|
|
2585
|
+
});
|
|
2586
|
+
}
|
|
2587
|
+
const nextActions = priorActions.filter((code) => !codes.includes(code));
|
|
2588
|
+
// 移空后的写回形状按平台 canonical 未绑态:handler 对象保留、bizActions 与
|
|
2589
|
+
// bizActionType 置 null(WorkflowTemplateController 的模板示例即此形状;平台
|
|
2590
|
+
// 判空走 CollectionUtils.isEmpty,null 与 [] 等价,null 是平台自己的存量拼写)。
|
|
2591
|
+
const mergedHandler = nextActions.length > 0
|
|
2592
|
+
? { ...(typeof existing === "object" && existing ? existing : {}), bizActions: nextActions, bizActionType: "BIZ_RULE" }
|
|
2593
|
+
: { ...(typeof existing === "object" && existing ? existing : {}), bizActions: null, bizActionType: null };
|
|
2594
|
+
let nextTemplate;
|
|
2595
|
+
if (target.scope === "workflow") {
|
|
2596
|
+
nextTemplate = { ...draft, [target.field]: mergedHandler, workflowCode: args.workflowCode, schemaCode: args.schemaCode };
|
|
2597
|
+
}
|
|
2598
|
+
else {
|
|
2599
|
+
// Keep the draft's activities container shape (array or index-keyed
|
|
2600
|
+
// object) — only the selected row's handler field changes.
|
|
2601
|
+
nextTemplate = mapTemplateActivity(draft, target.activityCode, (row) => ({ ...row, [target.field]: mergedHandler })).template;
|
|
2602
|
+
nextTemplate = { ...nextTemplate, workflowCode: args.workflowCode, schemaCode: args.schemaCode };
|
|
2603
|
+
}
|
|
2604
|
+
validateWorkflowRender(nextTemplate, "workflow.unbindRule");
|
|
2605
|
+
return { target, codes, shouldPublish, nextTemplate, priorActions, nextActions };
|
|
2606
|
+
}
|
|
2532
2607
|
export function registerWorkflowLane(tools) {
|
|
2533
2608
|
// Sibling registry for the high-level `configure_workflow` (reuses each atomic
|
|
2534
2609
|
// tool's own writeExecute so every gate + readback is identical).
|
|
@@ -3278,70 +3353,9 @@ export function registerWorkflowLane(tools) {
|
|
|
3278
3353
|
publish: z.boolean().optional(),
|
|
3279
3354
|
},
|
|
3280
3355
|
execute: async (session, args) => {
|
|
3281
|
-
|
|
3282
|
-
const codes = (
|
|
3283
|
-
const
|
|
3284
|
-
const draft = (await getWorkflowDraftOrNull(session, args.workflowCode)) ?? {};
|
|
3285
|
-
if (Object.keys(draft).length === 0) {
|
|
3286
|
-
throw new ToolRefusalError({
|
|
3287
|
-
status: "refused",
|
|
3288
|
-
blocker: "workflow-not-found",
|
|
3289
|
-
workflowCode: args.workflowCode,
|
|
3290
|
-
message: `流程 ${args.workflowCode} 不存在(get_draft 401001 缺席)——先 workflow.create,再 unbindRule`,
|
|
3291
|
-
});
|
|
3292
|
-
}
|
|
3293
|
-
if (target.scope === "activity" && !findTemplateActivity(draft, target.activityCode)) {
|
|
3294
|
-
throw new ToolRefusalError({
|
|
3295
|
-
status: "refused",
|
|
3296
|
-
blocker: "workflow-activity-not-found",
|
|
3297
|
-
workflowCode: args.workflowCode,
|
|
3298
|
-
activityCode: target.activityCode,
|
|
3299
|
-
activities: templateActivityCodes(draft),
|
|
3300
|
-
message: `流程 ${args.workflowCode} 的草稿里没有活动 ${target.activityCode}——节点级事件必须指向已存在的活动。可用活动:${templateActivityCodes(draft).join("、") || "(无)"}(先用 workflow.get_draft 看 code,别用节点名)`,
|
|
3301
|
-
});
|
|
3302
|
-
}
|
|
3303
|
-
const handlerOf = (template) => {
|
|
3304
|
-
if (target.scope === "workflow")
|
|
3305
|
-
return (template?.[target.field] ?? {}) ?? {};
|
|
3306
|
-
return (findTemplateActivity(template, target.activityCode)?.[target.field] ?? {}) ?? {};
|
|
3307
|
-
};
|
|
3308
|
-
const existing = handlerOf(draft);
|
|
3309
|
-
const priorActions = Array.isArray(existing.bizActions)
|
|
3310
|
-
? existing.bizActions.filter((value) => typeof value === "string")
|
|
3311
|
-
: [];
|
|
3312
|
-
// Fail closed BEFORE any wire call when the caller names codes the handler
|
|
3313
|
-
// does not carry — a typo'd ruleCode must not report a phantom success,
|
|
3314
|
-
// and the existing codes are the fix's raw material.
|
|
3315
|
-
const absent = codes.filter((code) => !priorActions.includes(code));
|
|
3316
|
-
if (absent.length > 0) {
|
|
3317
|
-
throw new ToolRefusalError({
|
|
3318
|
-
status: "refused",
|
|
3319
|
-
blocker: "workflow-unbind-rule-absent",
|
|
3320
|
-
workflowCode: args.workflowCode,
|
|
3321
|
-
absentRuleCodes: absent,
|
|
3322
|
-
bizActions: priorActions,
|
|
3323
|
-
...(target.scope === "activity" ? { activityCode: target.activityCode, nodeEvent: target.key } : { handler: target.key }),
|
|
3324
|
-
message: `该处理器当前没有绑定 ${absent.join("、")}——现有绑定:${priorActions.join("、") || "(无)"}。解绑只对已绑定的 code 生效;要换目标先看 workflow.get_draft 的 ruleBindings/nodeRuleBindings`,
|
|
3325
|
-
});
|
|
3326
|
-
}
|
|
3327
|
-
const nextActions = priorActions.filter((code) => !codes.includes(code));
|
|
3328
|
-
// 移空后的写回形状按平台 canonical 未绑态:handler 对象保留、bizActions 与
|
|
3329
|
-
// bizActionType 置 null(WorkflowTemplateController 的模板示例即此形状;平台
|
|
3330
|
-
// 判空走 CollectionUtils.isEmpty,null 与 [] 等价,null 是平台自己的存量拼写)。
|
|
3331
|
-
const mergedHandler = nextActions.length > 0
|
|
3332
|
-
? { ...(typeof existing === "object" && existing ? existing : {}), bizActions: nextActions, bizActionType: "BIZ_RULE" }
|
|
3333
|
-
: { ...(typeof existing === "object" && existing ? existing : {}), bizActions: null, bizActionType: null };
|
|
3334
|
-
let nextTemplate;
|
|
3335
|
-
if (target.scope === "workflow") {
|
|
3336
|
-
nextTemplate = { ...draft, [target.field]: mergedHandler, workflowCode: args.workflowCode, schemaCode: args.schemaCode };
|
|
3337
|
-
}
|
|
3338
|
-
else {
|
|
3339
|
-
// Keep the draft's activities container shape (array or index-keyed
|
|
3340
|
-
// object) — only the selected row's handler field changes.
|
|
3341
|
-
nextTemplate = mapTemplateActivity(draft, target.activityCode, (row) => ({ ...row, [target.field]: mergedHandler })).template;
|
|
3342
|
-
nextTemplate = { ...nextTemplate, workflowCode: args.workflowCode, schemaCode: args.schemaCode };
|
|
3343
|
-
}
|
|
3344
|
-
validateWorkflowRender(nextTemplate, "workflow.unbindRule");
|
|
3356
|
+
// 读回+校验与 dry-run 共用 unbindRuleContext(同 refusal、同答案)。
|
|
3357
|
+
const { target, codes, shouldPublish, nextTemplate } = await unbindRuleContext(session, args);
|
|
3358
|
+
const handlerOf = (template) => bindTargetHandlerOf(template, target);
|
|
3345
3359
|
const performed = await wireCall(session, {
|
|
3346
3360
|
path: ENDPOINTS.workflowUpdate,
|
|
3347
3361
|
method: "POST",
|
|
@@ -3409,6 +3423,29 @@ export function registerWorkflowLane(tools) {
|
|
|
3409
3423
|
throw new ToolRefusalError({ status: "refused", blocker: "workflow-bindrule-codes-invalid", message: "ruleCodes 必须是非空、去重的规则 code 数组" });
|
|
3410
3424
|
}
|
|
3411
3425
|
},
|
|
3426
|
+
// dry-run 与真写同答案:读回+校验走 execute 同一个 unbindRuleContext——
|
|
3427
|
+
// 不存在流程 / 不存在活动 / absent code 在 dry-run 就拿到与真写完全相同的
|
|
3428
|
+
// refusal(打错 ruleCode 不再先亮 wouldChange:true);全过则回预览载荷。
|
|
3429
|
+
dryRunPayload: async (session, args) => {
|
|
3430
|
+
const ctx = await unbindRuleContext(session, args);
|
|
3431
|
+
const targetShape = ctx.target.scope === "workflow"
|
|
3432
|
+
? { handler: ctx.target.key, handlerField: ctx.target.field }
|
|
3433
|
+
: { activityCode: ctx.target.activityCode, nodeEvent: ctx.target.key, nodeEventField: ctx.target.field };
|
|
3434
|
+
return {
|
|
3435
|
+
workflowCode: args.workflowCode,
|
|
3436
|
+
scope: ctx.target.scope,
|
|
3437
|
+
...targetShape,
|
|
3438
|
+
removedRuleCodes: ctx.codes,
|
|
3439
|
+
currentBizActions: ctx.priorActions,
|
|
3440
|
+
remainingBizActions: ctx.nextActions,
|
|
3441
|
+
handlerWillBeCleared: ctx.nextActions.length === 0,
|
|
3442
|
+
publish: ctx.shouldPublish,
|
|
3443
|
+
ruleEnableUntouched: true,
|
|
3444
|
+
summary: writeSummary("workflow.unbindRule", args, undefined, "plan"),
|
|
3445
|
+
};
|
|
3446
|
+
},
|
|
3447
|
+
lintScope: "full",
|
|
3448
|
+
lintUnchecked: ["platform-side-validation", "post-write-readback"],
|
|
3412
3449
|
rollback: workflowRollbackSpec("workflow.unbindRule"),
|
|
3413
3450
|
});
|
|
3414
3451
|
/**
|
package/dist/path-projection.js
CHANGED
|
@@ -312,8 +312,13 @@ export const PATH_MISS_HINT = `路径未命中(这一层没有该段)。${RE
|
|
|
312
312
|
* `artifact get` 面:产物内容的投影。区别只在开头——它已经把 miss 落在哪一段
|
|
313
313
|
* (`missedAt`)和可用的键/范围一并返回,所以不必重复「这一层没有该段」。
|
|
314
314
|
*/
|
|
315
|
-
export function artifactPathMissHint(at) {
|
|
316
|
-
|
|
315
|
+
export function artifactPathMissHint(at, copyable) {
|
|
316
|
+
const lead = `路径未命中${at !== undefined ? `段 "${at}"` : "(这一层没有该段)"}`;
|
|
317
|
+
// issue 19:命中同名键时先给可整段复制的完整路径(相对产物正文)。
|
|
318
|
+
if (copyable !== undefined) {
|
|
319
|
+
return `${lead}。${copyable}。想一次拿全部顶层键:--keys(或裸 --jq)。${JQ_PATH_SYNTAX}${JQ_PATH_RULES}${JQ_PATH_HELP_POINTER}`;
|
|
320
|
+
}
|
|
321
|
+
return `${lead}——available 是该层真实存在的键/范围;方括号下标(a[0])与点式(a.0)等价;想一次拿全部顶层键:--keys(或裸 --jq)。${JQ_PATH_SYNTAX}${JQ_PATH_RULES}${JQ_PATH_HELP_POINTER}`;
|
|
317
322
|
}
|
|
318
323
|
/** 逗号多路径里只有部分 miss:给出定位方式 + 同一套语法。 */
|
|
319
324
|
export function partialPathMissHint() {
|
|
@@ -376,6 +381,106 @@ export function pathMissDidYouMean(at, available, availableAll) {
|
|
|
376
381
|
const alias = PATH_KEY_ALIASES[leaf.toLowerCase()];
|
|
377
382
|
return alias !== undefined && keys.includes(alias) ? alias : undefined;
|
|
378
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Issue 19(retro 2026-11-19):`workflow.get_published` 的 activities 在
|
|
386
|
+
* `data.activities`,但 pathMiss hint 只会说「这一层没有该段 / 它在 result
|
|
387
|
+
* 顶层(只是不在 artifact 副本里)」——描述性指引让人再猜 2–3 次。
|
|
388
|
+
*
|
|
389
|
+
* 这里在**真实结果树**里找同名的键,拼出可整段复制的完整路径:
|
|
390
|
+
* `activities[].bizActions` → `data.activities[].bizActions`。多个位置就列
|
|
391
|
+
* 全部(≤3 条)让调用方自己选;找不到/都解析不通就返回 undefined,由原
|
|
392
|
+
* hint 兜底(不编造路径)。
|
|
393
|
+
*/
|
|
394
|
+
const COPYABLE_SCAN_MAX_NODES = 4000;
|
|
395
|
+
const COPYABLE_MAX_CANDIDATES = 24;
|
|
396
|
+
function escapeRegExp(text) {
|
|
397
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
398
|
+
}
|
|
399
|
+
/** 收集 source 里键名恰为 leaf 的所有路径;数组层记作 `[]`(与 DSL 同形)。 */
|
|
400
|
+
function collectKeyPaths(source, leaf) {
|
|
401
|
+
const found = [];
|
|
402
|
+
let visited = 0;
|
|
403
|
+
const walk = (node, prefix, depth) => {
|
|
404
|
+
if (found.length >= COPYABLE_MAX_CANDIDATES || visited > COPYABLE_SCAN_MAX_NODES || depth > 8)
|
|
405
|
+
return;
|
|
406
|
+
if (Array.isArray(node)) {
|
|
407
|
+
const arrayPrefix = prefix === "" ? "" : `${prefix}[]`;
|
|
408
|
+
for (const entry of node.slice(0, 25)) {
|
|
409
|
+
visited += 1;
|
|
410
|
+
walk(entry, arrayPrefix, depth + 1);
|
|
411
|
+
if (found.length >= COPYABLE_MAX_CANDIDATES)
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (node === null || typeof node !== "object")
|
|
417
|
+
return;
|
|
418
|
+
for (const [key, child] of Object.entries(node)) {
|
|
419
|
+
visited += 1;
|
|
420
|
+
const next = prefix === "" ? key : `${prefix}.${key}`;
|
|
421
|
+
if (key === leaf)
|
|
422
|
+
found.push(next);
|
|
423
|
+
walk(child, next, depth + 1);
|
|
424
|
+
if (found.length >= COPYABLE_MAX_CANDIDATES)
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
walk(source, "", 0);
|
|
429
|
+
return found;
|
|
430
|
+
}
|
|
431
|
+
/** path 里 leaf 之后的部分(含 `[]` / `.` 分隔符)。 */
|
|
432
|
+
function suffixAfterLeaf(path, leaf) {
|
|
433
|
+
const matcher = new RegExp(`(?:^|[.\\[])${escapeRegExp(leaf)}(?=$|[.\\[\\]])`, "gu");
|
|
434
|
+
let last;
|
|
435
|
+
let match;
|
|
436
|
+
while ((match = matcher.exec(path)) !== null)
|
|
437
|
+
last = match;
|
|
438
|
+
if (last === undefined)
|
|
439
|
+
return undefined;
|
|
440
|
+
return path.slice(last.index + last[0].length);
|
|
441
|
+
}
|
|
442
|
+
function copyableCandidateResolves(source, candidate) {
|
|
443
|
+
return candidate.includes("[]")
|
|
444
|
+
? !projectJsonPathFanout(source, candidate).missed
|
|
445
|
+
: !projectJsonPath(source, candidate).missed;
|
|
446
|
+
}
|
|
447
|
+
/** 可复制的完整路径(已验证在 source 上命中;去重,≤limit 条)。 */
|
|
448
|
+
export function pathMissCopyablePaths(source, path, at, limit = 3) {
|
|
449
|
+
if (at === undefined || at.length === 0)
|
|
450
|
+
return [];
|
|
451
|
+
const cleanPath = path.replace(/^\$\.?/, "").replace(/^[.\/]+/, "");
|
|
452
|
+
const leaf = at.replace(/^[.\/]+/, "").split(/[./\[]/).filter(Boolean).pop();
|
|
453
|
+
if (leaf === undefined || leaf.length === 0)
|
|
454
|
+
return [];
|
|
455
|
+
const suffix = suffixAfterLeaf(cleanPath, leaf);
|
|
456
|
+
if (suffix === undefined)
|
|
457
|
+
return [];
|
|
458
|
+
const candidates = [];
|
|
459
|
+
for (const prefix of collectKeyPaths(source, leaf)) {
|
|
460
|
+
const candidate = `${prefix}${suffix}`;
|
|
461
|
+
if (candidate === cleanPath || candidates.includes(candidate))
|
|
462
|
+
continue;
|
|
463
|
+
if (!copyableCandidateResolves(source, candidate))
|
|
464
|
+
continue;
|
|
465
|
+
candidates.push(candidate);
|
|
466
|
+
if (candidates.length >= limit)
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
return candidates;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* pathMiss hint 的「可复制路径」句。有命中就**先给命令**(而不是描述它在
|
|
473
|
+
* 哪);多个位置列前 3 条;没有命中返回 undefined(原 hint 原样兜底)。
|
|
474
|
+
*/
|
|
475
|
+
export function pathMissCopyableHint(source, path, at, limit = 3) {
|
|
476
|
+
const shown = pathMissCopyablePaths(source, path, at, limit);
|
|
477
|
+
if (shown.length === 0)
|
|
478
|
+
return undefined;
|
|
479
|
+
const quoted = shown.map((candidate) => `--jq '${candidate.replace(/'/g, "'\\''")}'`).join(";");
|
|
480
|
+
if (shown.length === 1)
|
|
481
|
+
return `这段的完整路径是 ${shown[0]}——可直接复制:${quoted}`;
|
|
482
|
+
return `这段有多个位置——可直接复制其一:${quoted}`;
|
|
483
|
+
}
|
|
379
484
|
/**
|
|
380
485
|
* 多路径一次投影时的**唯一一份**语法说明(放结果顶层,不再逐条复制)。
|
|
381
486
|
* 只给最要紧的三条:位置语义、映射写法、help 指针。
|
|
@@ -412,11 +517,38 @@ export function nullProjectionHint(nullEntries, total) {
|
|
|
412
517
|
* 这类只在 result 层有的键;`--jq modelsCount` 却去 artifact 副本里找,
|
|
413
518
|
* 于是 pathMiss,且 `available` 列的是 artifact 的键——调用方看到"键明明打印过
|
|
414
519
|
* 却说没有"。这里把事实补回去:该路径在 result 层存在时明确指路。
|
|
520
|
+
*
|
|
521
|
+
* retro issue 19 第三变体:result 层的同名键也可能是回执的**摘要投影**(如
|
|
522
|
+
* workflow.get_published 外置后的顶层 activities——形状与 artifact 正文完全
|
|
523
|
+
* 不同,元素常缺深层键),再无条件教「不带 --jq 直接读回执」会把人导向摘要面。
|
|
524
|
+
* 两头说清:正文里能解析同名键(pathMissCopyablePaths 已验证)就给可复制
|
|
525
|
+
* 命令;解析不了就说明形状差异并给结构性探索建议;只有正文**完全无同名键**
|
|
526
|
+
* (modelsCount 这类纯回执派生键)才保留「直接读回执」的旧指路。
|
|
415
527
|
*/
|
|
416
|
-
function resultLayerNote(result, path) {
|
|
528
|
+
function resultLayerNote(result, path, artifactSource, at) {
|
|
417
529
|
const head = path.replace(/^\$\.?/, "").split(/[.\[]/)[0];
|
|
418
530
|
if (head === "" || !(head in result))
|
|
419
531
|
return undefined;
|
|
532
|
+
// 与 pathMissCopyableHint 同一解析器:只在候选路径**能解析**时才输出,
|
|
533
|
+
// 绝不给出解析不了的假路径(issue 19 的语义门)。
|
|
534
|
+
const copyable = pathMissCopyablePaths(artifactSource, path, at, 1);
|
|
535
|
+
if (copyable.length > 0) {
|
|
536
|
+
return {
|
|
537
|
+
existsOnResult: head,
|
|
538
|
+
summaryProjection: true,
|
|
539
|
+
resultLayerHint: `result 顶层的「${head}」是摘要投影(形状与 artifact 正文不同,深层键常缺席),不要按它取值;正文里的真实路径:--jq '${copyable[0].replace(/'/g, "'\\''")}'`,
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
// 正文里有同名键但完整路径解析不了(如该流程无绑定、元素缺深层键):
|
|
543
|
+
// 说清差异 + 指向正文实际结构,不编造路径。
|
|
544
|
+
const bodyKey = collectKeyPaths(artifactSource, head).find((candidate) => candidate !== head);
|
|
545
|
+
if (bodyKey !== undefined) {
|
|
546
|
+
return {
|
|
547
|
+
existsOnResult: head,
|
|
548
|
+
summaryProjection: true,
|
|
549
|
+
resultLayerHint: `result 顶层的「${head}」是摘要投影(形状与 artifact 正文不同,深层键常缺席);正文同名键在 ${bodyKey},但该路径在正文里也不可解析(深层键缺席)。先用 artifact get --shape ${bodyKey} 看正文实际结构再定位`,
|
|
550
|
+
};
|
|
551
|
+
}
|
|
420
552
|
return {
|
|
421
553
|
existsOnResult: head,
|
|
422
554
|
resultLayerHint: `「${head}」在 result 顶层(只是不在 artifact 副本里)。取它请不带 --jq 直接读回执,或改取 artifact 内的键(见 available)`,
|
|
@@ -594,25 +726,32 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
594
726
|
const missHintFor = (path, at, available, availableAll) => {
|
|
595
727
|
const fallback = multiPath ? pathMissEntryHint(at, available) : PATH_MISS_HINT;
|
|
596
728
|
const candidate = pathMissDidYouMean(at, available, availableAll);
|
|
597
|
-
if (candidate
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
729
|
+
if (candidate !== undefined && at !== undefined) {
|
|
730
|
+
// Replace only the missed segment, retaining array mapping and suffixes.
|
|
731
|
+
const leaf = at.split(/[./\[]/).filter(Boolean).pop();
|
|
732
|
+
if (leaf !== undefined) {
|
|
733
|
+
let replaced = false;
|
|
734
|
+
const corrected = path.replace(/[^.[\]/]+/g, (segment, offset) => {
|
|
735
|
+
const prefix = path.slice(0, offset + segment.length).replace(/^[.$/]+/, "");
|
|
736
|
+
if (replaced || segment !== leaf || (at !== leaf && prefix !== at))
|
|
737
|
+
return segment;
|
|
738
|
+
replaced = true;
|
|
739
|
+
return candidate;
|
|
740
|
+
});
|
|
741
|
+
// A similar key is useful only if the complete proposed path resolves.
|
|
742
|
+
if (corrected !== path && !projectPathOnSource(projectionSource, corrected).projected.missed) {
|
|
743
|
+
const quoted = corrected.replace(/'/g, "'\\''");
|
|
744
|
+
return `路径未命中:在 "${at}" 断开;最接近的是 ${candidate}。可试:--jq '${quoted}'`;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
// issue 19:没有拼写近似时,在真实结果树里找同名键,直接给可复制的完整
|
|
749
|
+
// 路径(如 data.activities[].bizActions)——不再只描述「它在哪一层」。
|
|
750
|
+
const copyable = pathMissCopyableHint(projectionSource, path, at);
|
|
751
|
+
if (copyable !== undefined) {
|
|
752
|
+
return multiPath ? `${copyable}。${pathMissEntryHint(at, available)}` : `${copyable}。${RESULT_RELATIVE_PATH_NOTE}`;
|
|
753
|
+
}
|
|
754
|
+
return fallback;
|
|
616
755
|
};
|
|
617
756
|
out.extract = paths.map((path) => {
|
|
618
757
|
// r28f F2:对象构造 / 函数调用不是 pathMiss——先识别,别伪装成键缺失。
|
|
@@ -647,7 +786,7 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
647
786
|
...(fan.availableTruncated !== undefined ? { availableTruncated: fan.availableTruncated } : {}),
|
|
648
787
|
missedEntries: fan.missedEntries,
|
|
649
788
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
650
|
-
...(readFromArtifact ? resultLayerNote(result, path) ?? {} : {}),
|
|
789
|
+
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, fan.at) ?? {} : {}),
|
|
651
790
|
hint: missHintFor(path, fan.at, fan.available, fan.availableAll),
|
|
652
791
|
};
|
|
653
792
|
}
|
|
@@ -684,7 +823,7 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
684
823
|
available: single.available,
|
|
685
824
|
...(single.availableTruncated !== undefined ? { availableTruncated: single.availableTruncated } : {}),
|
|
686
825
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
687
|
-
...(readFromArtifact ? resultLayerNote(result, path) ?? {} : {}),
|
|
826
|
+
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, single.at) ?? {} : {}),
|
|
688
827
|
hint: missHintFor(path, single.at, single.available, single.availableAll),
|
|
689
828
|
};
|
|
690
829
|
}
|
package/dist/read-shapes.js
CHANGED
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
const READ_SHAPES = {
|
|
13
13
|
// r28k 治理面形状钉:截断≠空表;指纹有用途;doctor/get_status 分流。
|
|
14
14
|
"discover_environment": {
|
|
15
|
-
keys: ["applications:array<{code,name,groupId?,portalHidden?}>", "applicationsCount", "groups", "groupsCount", "foldersAndModels?", "foldersAndModelsCount?", "foldersAndModelsOmitted?", "models?", "modelsCount?", "modelsOmitted?", "tablesHint?", "applicationCode", "applicationResolution", "readiness", "detectedVersion", "inAnchorFamily", "versionSource", "versionFamily", "anchorVersion", "versionNotice?", "environmentFingerprint", "fingerprintHint?", "detailArtifactId?"],
|
|
15
|
+
keys: ["applications:array<{code,name,groupId?,portalHidden?}>", "applicationsCount", "groups", "groupsCount", "foldersAndModels?", "foldersAndModelsCount?", "foldersAndModelsOmitted?", "models?", "modelsCount?", "modelsOmitted?", "tablesHint?", "applicationCode", "applicationResolution", "readiness", "detectedVersion", "inAnchorFamily", "versionSource", "versionFamily", "anchorVersion", "versionNotice?", "environmentFingerprint", "fingerprintHint?", "platform:{productVersion,buildTime?,licenseType?,licenseExpiration?,source,licenseFaceUnavailable?,extensionBuildShaUnavailable?}|{versionUnavailable}", "detailArtifactId?"],
|
|
16
16
|
notes: [
|
|
17
17
|
"applications/groups 内联;foldersAndModels/models 外置时是 null + *Omitted:true(不是 [])",
|
|
18
18
|
"environmentFingerprint 用途见 fingerprintHint(写前漂移/计划绑定/读缓存键,非审批令牌)",
|
|
19
19
|
"detectedVersion/inAnchorFamily/versionSource 与 doctor/fingerprint 同源",
|
|
20
|
+
"platform.productVersion 是原始版本串(如 AI-Platform-v1.1.25);buildTime 只有平台回传才有(8.6.26 info() 从不赋值)、扩展 build sha 无端点(extensionBuildShaUnavailable)",
|
|
20
21
|
],
|
|
21
22
|
},
|
|
22
23
|
"environment.fingerprint": {
|
package/dist/refusal-guidance.js
CHANGED
|
@@ -115,7 +115,7 @@ const FIX_FIRST_GATES = Object.freeze({
|
|
|
115
115
|
"workflow-start-permission-denied": "40009 有三个独立同码原因:① 发起人角色没挂该流程的发起权限(ouScope ∩ 发起人部门链,全空会静默回退发起人);② 流程未启用/未发布;③ 模型未绑定流程。先 omc call workflow.permissions / workflow.get_published 核对;管理员发起成功带 bypassReason 时不证明白名单生效——换非管理员环境验证。不要反复换参数重试 data.submit",
|
|
116
116
|
"workflow-bound-to-listview": "303024 列表绑定了流程:直接粘贴回执 nextCommand(listview.configure:actions:[] + replaceActions:true + 现成 fieldCodes)解绑,再 workflow.delete;整体清理用 model-purge",
|
|
117
117
|
"workflow-start-permission-empty": "发起权限表为空:除平台管理员外无人能发起。用 workflow.addPermission 授给部门/角色/用户;管理员 data.submit 成功不证明白名单生效",
|
|
118
|
-
"environment-write-disabled": "当前环境 profile
|
|
118
|
+
"environment-write-disabled": "当前环境 profile 不可写:换可写环境;临时改一次配置用 `omc env writable <env> --ttl 10m --reason \"...\"`(有审计、到期自动恢复只读),`omc env writable <env> --close` 立即恢复——窗口只解除 writable 门,生产写仍需每笔 confirmProduction:true(两道门并存)",
|
|
119
119
|
"production-confirmation-required": "生产环境的写需要显式 confirmProduction:true——确认这次写入真的要落生产再加该参数,不要靠重试",
|
|
120
120
|
"app-not-published": "目标应用未发布:先 workflow/form/field 各面发布(或 app 级发布),再重试运行面操作",
|
|
121
121
|
"submit-workitem-not-mine": "该 workItem 不在当前登录人的待办里:用 omc call workitem.list --args '{\"status\":\"PENDING\"}' 拿**自己的** workItemId,不要用别人的 id 提交",
|