@stalfh233/omc-cli 0.8.15 → 0.8.17
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 +50 -14
- package/dist/discovery.js +2 -0
- package/dist/field-add.js +1 -1
- package/dist/form-support.js +213 -19
- package/dist/goal-plan.js +23 -2
- package/dist/goal-routes.js +94 -18
- package/dist/human-summary.js +24 -4
- package/dist/lanes/datarule.js +3 -0
- package/dist/lanes/field-contract.js +10 -1
- package/dist/lanes/field.js +10 -2
- package/dist/lanes/form.js +3 -1
- package/dist/lanes/list-view-contract.js +1 -1
- package/dist/lanes/list-view.js +56 -0
- package/dist/lanes/model-references.js +22 -3
- package/dist/lanes/runtime-data.js +97 -17
- package/dist/lanes/workflow.js +97 -14
- package/dist/model-purge.js +112 -37
- package/dist/model-scaffold.js +11 -3
- package/dist/path-projection.js +151 -4
- package/dist/recipes/datarule.js +39 -1
- package/dist/recipes/form.js +2 -2
- package/dist/residue.js +13 -2
- package/dist/tool-types.js +19 -0
- package/dist/wire-refusal.js +171 -0
- package/dist/write.js +27 -174
- package/package.json +3 -3
- package/skills/omc-glossary.md +22 -0
- package/skills/omc-start-here.md +1 -1
package/dist/goal-routes.js
CHANGED
|
@@ -569,7 +569,7 @@ const WHOLE_PACKAGE_CAPABILITIES = ["model", "field", "form", "listview", "datar
|
|
|
569
569
|
* 声明式路径)。
|
|
570
570
|
*/
|
|
571
571
|
const INTENT_COVERAGE = Object.freeze({
|
|
572
|
-
note: "intent 覆盖面(与 `omc intent schema` 同源):covered 由 validate/plan/apply 声明式生成;needsCall
|
|
572
|
+
note: "intent 覆盖面(与 `omc intent schema` 同源):covered 由 validate/plan/apply 声明式生成;needsCall 是本次需求里 intent 不声明(或运行语义/精确 patch 不在声明面)的部分,apply 后用 command 走原子面补齐。",
|
|
573
573
|
covered: [
|
|
574
574
|
"模型 model(含 absent 删除)",
|
|
575
575
|
"标量字段与子表标量列(CHILD_TABLE subFields)",
|
|
@@ -586,24 +586,77 @@ const INTENT_COVERAGE = Object.freeze({
|
|
|
586
586
|
id: "child-map-fill",
|
|
587
587
|
what: "子表取主表字段:WORK_SHEET 关联列 + options.mappings(intent 子列可声明 relativeCode/options;映射回填只在门户表单执行、REST 不回填,精确改映射与读回以 child-map-fill 配方为准)",
|
|
588
588
|
command: "omc describe field.create --example child-map-fill",
|
|
589
|
+
cues: ["子表", "明细", "主子表", "映射", "mapping", "关联字段"],
|
|
589
590
|
},
|
|
590
591
|
{
|
|
591
592
|
id: "form-two-column-layout",
|
|
592
593
|
what: "表单两列布局(intent 的 form 只有 publish/fieldCodes,不含行分组/控件 span)",
|
|
593
594
|
command: "omc describe form.draft --example two-column-layout",
|
|
595
|
+
cues: ["两列", "布局"],
|
|
594
596
|
},
|
|
595
597
|
{
|
|
596
598
|
id: "listview-sorts-conditions",
|
|
597
599
|
what: "列表视图业务排序/筛选条件(intent 的 listview 只声明列,排序/条件/按钮 apply 后用 listview.configure 补)",
|
|
598
600
|
command: "omc describe listview.configure --param sorts",
|
|
601
|
+
cues: ["排序", "筛选", "过滤", "查询条件"],
|
|
599
602
|
},
|
|
600
603
|
{
|
|
601
604
|
id: "workflow-runtime",
|
|
602
605
|
what: "审批运行操作:提交/审批/待办/流转(intent 的 workflow 只到模板+发布+绑规则,运行实例走 data.save/data.submit/workitem.list)",
|
|
603
606
|
command: "omc describe data.submit --example workflow-backed-data-submit",
|
|
607
|
+
// F9 收紧(0.8.17 复核):裸「审批」「提交」会误伤字段名与模板面——
|
|
608
|
+
// 「提交人/提交时间/提交日期」是字段,不是运行动作;
|
|
609
|
+
// 「审批流程/审批流/审批节点/审批模板」是 intent 覆盖的模板面。
|
|
610
|
+
// 运行面只认动作/对象:提交(非字段后缀)、审批(非模板后缀)、待办、流转、跑通、实例。
|
|
611
|
+
cues: [
|
|
612
|
+
"re:提交(?!人|时间|日期|者|方|单位|部门|按钮|字段|记录|说明|备注|项)",
|
|
613
|
+
"re:审批(?!流程|流|模板|节点|权限|规则|人|时间|日期)",
|
|
614
|
+
"待办",
|
|
615
|
+
"流转",
|
|
616
|
+
"跑通",
|
|
617
|
+
"实例",
|
|
618
|
+
],
|
|
604
619
|
},
|
|
605
620
|
],
|
|
606
621
|
});
|
|
622
|
+
/**
|
|
623
|
+
* F9(0.8.17,探针 K):needsCall 必须按「这次需求点名了哪几面」来算,不能整份
|
|
624
|
+
* 静态清单全贴上。探针原句 4 个未覆盖面(子表映射/两列布局/排序筛选/流程运行)
|
|
625
|
+
* 全部命中,route 却仍回 `primary:"intent"` + `confident:true`——等于宣称声明式
|
|
626
|
+
* 一条路走完,agent 照做后在 4 个面上撞墙。现在:
|
|
627
|
+
* - needsCall 只列本句真实点名的面;
|
|
628
|
+
* - 命中 ≥3 面,或面数 ≥4 且占比 ≥1/2 → `primary:"hybrid"`,并给混合起手命令。
|
|
629
|
+
* 单面句(「给表单加两列布局」「配好列表视图」)与 2/3 面的小任务仍不降级,
|
|
630
|
+
* 仍是 intent 主推(「报销单带提交人和提交时间,明细子表,两列布局」不得翻 hybrid)。
|
|
631
|
+
*/
|
|
632
|
+
export function intentNeedsCallFor(goal) {
|
|
633
|
+
return INTENT_COVERAGE.needsCall
|
|
634
|
+
.filter((entry) => entry.cues.some((cue) => cueMatches(goal, cue)))
|
|
635
|
+
.map(({ id, what, command }) => ({ id, what, command }));
|
|
636
|
+
}
|
|
637
|
+
/** `re:`-prefixed cues are regexes (negative lookaheads keep field names out); others are literals. */
|
|
638
|
+
function cueMatches(goal, cue) {
|
|
639
|
+
return cue.startsWith("re:") ? new RegExp(cue.slice(3)).test(goal) : goal.includes(cue);
|
|
640
|
+
}
|
|
641
|
+
export function intentCoverageFor(goal) {
|
|
642
|
+
return { note: INTENT_COVERAGE.note, covered: INTENT_COVERAGE.covered, needsCall: intentNeedsCallFor(goal) };
|
|
643
|
+
}
|
|
644
|
+
/** Hybrid trigger: ≥3 atomic-fill faces, or ≥half of ≥4 named faces. */
|
|
645
|
+
function needsHybridRoute(needsCallCount, faceCount) {
|
|
646
|
+
return needsCallCount >= 3 || (faceCount >= 4 && needsCallCount / faceCount >= 0.5);
|
|
647
|
+
}
|
|
648
|
+
function hybridRouteNote(needsCall, faceCount) {
|
|
649
|
+
return (`本任务 ${needsCall.length}/${faceCount} 面需原子工具补齐(${needsCall.map((entry) => entry.id).join("、")}):` +
|
|
650
|
+
"intent 只声明可覆盖面(模型/字段/规则/流程模板);先按 intent schema 写 YAML,apply 后按 intentCoverage.needsCall 的命令逐面补;" +
|
|
651
|
+
"模型/字段也可先用 model-scaffold 一步建(见 firstCommands / atomicSupplement)。");
|
|
652
|
+
}
|
|
653
|
+
/** Hybrid first moves: intent shape + the model-scaffold door + the first two atomic faces. */
|
|
654
|
+
function hybridFirstCommands(needsCall) {
|
|
655
|
+
// 命令骨架不在此另写一份:model-scaffold 的单命令门来自 composer 注册表
|
|
656
|
+
// (与 next 的 composer 路由同一真相源),改模板只改注册表。
|
|
657
|
+
const scaffold = COMPOSER_ROUTES.find((entry) => entry.id === "model-scaffold")?.command ?? "omc model-scaffold --help";
|
|
658
|
+
return ["omc intent schema", scaffold, ...needsCall.slice(0, 2).map((entry) => entry.command)];
|
|
659
|
+
}
|
|
607
660
|
const COMPOSER_ROUTES = Object.freeze([
|
|
608
661
|
{
|
|
609
662
|
id: "model-purge",
|
|
@@ -800,6 +853,10 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
800
853
|
// 运行数据是 intent 的**已知**未覆盖面(coverageNote 明说),不能因此把整包的
|
|
801
854
|
// 主路径翻成 atomic-only——它本就归 atomicSupplement 管。
|
|
802
855
|
const intentCovered = ordered.every((id) => id === "data" || (index.nodeById.get(id)?.intent.level ?? "none") !== "none");
|
|
856
|
+
// F9(0.8.17,探针 K):按本句点名的面算 needsCall;4/7 面要原子补齐时不再
|
|
857
|
+
// 宣称 intent 单主路径,降为 hybrid 并给混合起手。
|
|
858
|
+
const coverageNeedsCall = intentNeedsCallFor(goal);
|
|
859
|
+
const hybrid = intentCovered && needsHybridRoute(coverageNeedsCall.length, faces.length);
|
|
803
860
|
const atomicLadder = ordered.map((id) => {
|
|
804
861
|
const capability = routeById.get(id);
|
|
805
862
|
const recipe = bestRecipe(registry, id, capability.lane, goal) ?? defaultRecipeFor(registry, id, capability.lane);
|
|
@@ -819,7 +876,8 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
819
876
|
mode: "whole-package",
|
|
820
877
|
match: { kind: "whole-package", ref: ordered.join("→"), capabilities: ordered },
|
|
821
878
|
route: {
|
|
822
|
-
primary: intentCovered ? "intent" : "atomic",
|
|
879
|
+
primary: intentCovered ? (hybrid ? "hybrid" : "intent") : "atomic",
|
|
880
|
+
...(intentCovered && hybrid ? { note: hybridRouteNote(coverageNeedsCall, faces.length) } : {}),
|
|
823
881
|
...(intentCovered ? {} : {
|
|
824
882
|
note: "命中能力中有 intent.level=none 的面,声明式 intent 不覆盖全部需求,走原子工具阶梯;intent 仅作可用能力补充提示",
|
|
825
883
|
ladder: atomicLadder,
|
|
@@ -828,7 +886,8 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
828
886
|
// F5(0.8.11):主推 intent 时先交代「能/不能覆盖什么」,别让 agent 写完
|
|
829
887
|
// YAML 才发现半边需求要回落 omc call。atomic 主路径(intent.level=none)
|
|
830
888
|
// 不加——它没有推荐 intent,说明覆盖面只会误导。
|
|
831
|
-
|
|
889
|
+
// F9(0.8.17,探针 K):needsCall 只列本句点名的面(intentCoverageFor)。
|
|
890
|
+
...(intentCovered ? { intentCoverage: intentCoverageFor(goal) } : {}),
|
|
832
891
|
atomicSupplement: {
|
|
833
892
|
note: intentCovered
|
|
834
893
|
? "intent 已覆盖下列能力的创建;原子工具只用于 intent 未覆盖面(删除/生命周期/运行数据/精确 patch)——逐项见 intentCoverage.needsCall"
|
|
@@ -843,30 +902,38 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
843
902
|
// the probe executed it 0 times in 184 calls; it rides its own field now.
|
|
844
903
|
readiness: DISCOVERY_AUTHORITY.readiness,
|
|
845
904
|
firstCommands: intentCovered
|
|
846
|
-
?
|
|
905
|
+
? hybrid
|
|
906
|
+
? hybridFirstCommands(coverageNeedsCall)
|
|
907
|
+
: ["omc intent schema", "omc help omc-playbook --section 采购申请"]
|
|
847
908
|
: atomicLadder.flatMap((step) => "firstCommand" in step ? [step.firstCommand] : step.recipe ? [step.recipe.command] : []).slice(0, 3),
|
|
848
909
|
write: true,
|
|
849
910
|
},
|
|
850
911
|
write: true,
|
|
851
912
|
intent: intentGuidance(),
|
|
852
|
-
firstAnswer: intentCovered &&
|
|
913
|
+
firstAnswer: intentCovered && hybrid
|
|
853
914
|
? {
|
|
854
915
|
state: "ready",
|
|
855
916
|
action: "omc intent schema",
|
|
856
|
-
why:
|
|
917
|
+
why: `整包但有 ${coverageNeedsCall.length}/${faces.length} 面 intent 不覆盖:先用 intent 声明模型/字段/规则/流程模板(可覆盖面),模型/字段可直接用 model-scaffold 一步建;apply 后按 intentCoverage.needsCall 的命令补齐布局/排序/运行面`,
|
|
857
918
|
}
|
|
858
|
-
: intentCovered
|
|
919
|
+
: intentCovered && greenfield
|
|
859
920
|
? {
|
|
860
921
|
state: "ready",
|
|
861
922
|
action: "omc intent schema",
|
|
862
|
-
why: "
|
|
923
|
+
why: "从零整包:模型还不存在——先看 intent 键位/示例,再按 starter 写 YAML(validate → plan → apply);不要先问已有 schemaCode",
|
|
863
924
|
}
|
|
864
|
-
:
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
925
|
+
: intentCovered
|
|
926
|
+
? {
|
|
927
|
+
state: "ready",
|
|
928
|
+
action: "omc intent schema",
|
|
929
|
+
why: "整包需求走声明式意图:先看 intent YAML 的键位与可运行示例,再按 starter 写文件(validate → plan → apply)",
|
|
930
|
+
}
|
|
931
|
+
: {
|
|
932
|
+
state: "needs-input",
|
|
933
|
+
action: atomicLadder.find((step) => "firstCommand" in step)?.firstCommand,
|
|
934
|
+
question: "第一步要操作哪个对象?给我 schemaCode(或模型业务名,我列清单核对)",
|
|
935
|
+
why: "命中能力包含 intent 未覆盖面,不能把整包需求主推到声明式 intent;先按原子工具阶梯执行",
|
|
936
|
+
},
|
|
870
937
|
};
|
|
871
938
|
}
|
|
872
939
|
/** A configuration read-back ask that names no capability ("给我一份现状说明"). */
|
|
@@ -1565,6 +1632,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1565
1632
|
// 0.8.9 F1:指针里的 firstCommand 以前只看 `step.firstCommand`,命中配方时
|
|
1566
1633
|
// 仍给 `commands --lane`(正是探针被绕回发现面的那条路)。有配方就用配方命令。
|
|
1567
1634
|
const atomicSupplement = { note: "intent 已覆盖这些能力的创建;原子工具只用于 intent 未覆盖面:", ladder: ladder.map((step) => ({ capability: step.capability, lane: step.lane, firstCommand: step.recipe?.command ?? step.firstCommand ?? `omc commands --json --compact --lane ${step.lane}` })) };
|
|
1635
|
+
// F9(0.8.17,探针 K):整包阶梯同样按本句点名的未覆盖面判 hybrid。
|
|
1636
|
+
const coverageNeedsCall = intentNeedsCallFor(goal);
|
|
1637
|
+
const hybrid = whole && intentCoveredOf(ordered) && needsHybridRoute(coverageNeedsCall.length, ordered.length);
|
|
1568
1638
|
return {
|
|
1569
1639
|
status: "ok",
|
|
1570
1640
|
goal,
|
|
@@ -1573,7 +1643,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1573
1643
|
match: { kind: readish ? "read-ladder" : "ladder", ref: `${routeOrder.join("→")}${routeOrder.includes("businessrule") && /累加|联动|审计|规则触发|自动累加|自动回写/.test(goal) ? "(规则面不在本阶梯)" : ""}`, capabilities: routeOrder },
|
|
1574
1644
|
route: {
|
|
1575
1645
|
...(whole ? (intentCoveredOf(ordered)
|
|
1576
|
-
?
|
|
1646
|
+
? hybrid
|
|
1647
|
+
? { primary: "hybrid", note: hybridRouteNote(coverageNeedsCall, ordered.length), intentCoverage: intentCoverageFor(goal), atomicSupplement }
|
|
1648
|
+
: { primary: "intent", intentCoverage: intentCoverageFor(goal), atomicSupplement }
|
|
1577
1649
|
: { primary: "atomic", note: "命中能力中有 intent.level=none 的面,声明式 intent 不覆盖全部需求,走原子工具阶梯", ladder }) : { ladder }),
|
|
1578
1650
|
// r28e F2(真机复现 2026-11-05):`next "建表单布局、在线JS、表单按钮"`
|
|
1579
1651
|
// 命中的是 model→form→listview→businessrule→onlinejs 的整包 ladder,
|
|
@@ -1601,7 +1673,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1601
1673
|
// `omc intent schema`。此前这里只挑 ladder 里**任意一条**配方贴上来;
|
|
1602
1674
|
// 当只有 businessrule 有配方时,表单/视图目标会收到 rule.save 的样例,
|
|
1603
1675
|
// 与首答自相矛盾(且必然跑题)。整包就统一给 intent。
|
|
1604
|
-
|
|
1676
|
+
// F9(0.8.17,探针 K):hybrid 起手 = intent 键位 + model-scaffold 门 +
|
|
1677
|
+
// 前两个未覆盖面的原子命令(不再只给 intent schema 让你一条路走到黑)。
|
|
1678
|
+
...(whole ? (hybrid ? hybridFirstCommands(coverageNeedsCall) : ["omc intent schema"]) : recipeCommands),
|
|
1605
1679
|
// r13 #3: `capability workflow --executable` is 23 KB and still did not
|
|
1606
1680
|
// answer "how do I submit an approval" — the answer is a data.submit
|
|
1607
1681
|
// recipe, which lives in a DIFFERENT capability. When the goal is about
|
|
@@ -1615,7 +1689,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1615
1689
|
},
|
|
1616
1690
|
write,
|
|
1617
1691
|
...(whole
|
|
1618
|
-
?
|
|
1692
|
+
? hybrid
|
|
1693
|
+
? { intent: intentGuidance(), firstAnswer: { state: "ready", action: "omc intent schema", why: `整包但有 ${coverageNeedsCall.length}/${ordered.length} 面 intent 不覆盖:先用 intent 声明可覆盖面(模型/字段/规则/流程模板),模型/字段也可用 model-scaffold 一步建;apply 后按 intentCoverage.needsCall 逐面补布局/排序/运行` } }
|
|
1694
|
+
: { intent: intentGuidance(), firstAnswer: { state: "ready", action: "omc intent schema", why: "整包需求走声明式意图:先看 intent 的键位与示例,再按 starter 写文件" } }
|
|
1619
1695
|
: readish
|
|
1620
1696
|
// A read ask about the model inventory itself is answered BY the
|
|
1621
1697
|
// inventory call; any other read needs the target object code first.
|
|
@@ -1671,7 +1747,7 @@ function goalRouteInner(registry, goal) {
|
|
|
1671
1747
|
capability: capabilityId,
|
|
1672
1748
|
lane: route.lane,
|
|
1673
1749
|
...(whole ? (intentCoveredOf([capabilityId])
|
|
1674
|
-
? { primary: "intent", intentCoverage:
|
|
1750
|
+
? { primary: "intent", intentCoverage: intentCoverageFor(goal) }
|
|
1675
1751
|
: { primary: "atomic", note: "该能力无声明式面(intent.level=none),走原子工具" }) : {}),
|
|
1676
1752
|
...(readish ? { readTools: readToolsInLane(registry, route.lane) } : { tools: route.tools }),
|
|
1677
1753
|
// r66 ②(c-F4):有依赖顺序的能力(report)显式给 order,修掉 tools 键序
|
package/dist/human-summary.js
CHANGED
|
@@ -294,11 +294,13 @@ function phraseOf(tool, args, outcome) {
|
|
|
294
294
|
// F8(w63):平台按模型「数据标题」覆盖显式传入的 name,摘要行必须抬头。
|
|
295
295
|
const nameNote = readbackNoteClause(outcome, "nameOverwrittenNote");
|
|
296
296
|
if (args.submit === true && submitRefused !== undefined) {
|
|
297
|
+
// P1(w132 探针 J):这是**部分完成**——草稿已落库、提交未完成。摘要
|
|
298
|
+
// 必须先说清这个事实,再说被拒原因,避免调用方读成「已提交」。
|
|
297
299
|
// 更新行不得复用「重建流程草稿」口径(会诱导多建一行)。
|
|
298
300
|
if (workflowUpdateNote !== undefined) {
|
|
299
|
-
return `保存数据(模型 ${schemaCode ?? "?"}
|
|
301
|
+
return `保存数据(模型 ${schemaCode ?? "?"})——草稿已保存,提交未完成:submit:true 被拒(${submitRefused.blocker ?? "?"});更新既有行,不会创建/改动流程实例;推进用 workitem.list → data.submit 三件套;指引进 readback.workflowUpdateNote${nameNote}`;
|
|
300
302
|
}
|
|
301
|
-
return `保存数据(模型 ${schemaCode ?? "?"}
|
|
303
|
+
return `保存数据(模型 ${schemaCode ?? "?"})——草稿已保存,提交未完成:submit:true 被拒(${submitRefused.blocker ?? "?"});模型有已发布流程,行保持草稿 DRAFT;重建流程草稿的指引进 readback.submitRefused${nameNote}`;
|
|
302
304
|
}
|
|
303
305
|
if (workflowUpdateNote !== undefined) {
|
|
304
306
|
return `保存数据(模型 ${schemaCode ?? "?"})——更新既有行,不创建/改动流程实例;流程模型上保存的直提标志会被拒,推进该行用 workitem.list → data.submit 三件套(不要为触发规则/推进流程再 data.save)${nameNote}`;
|
|
@@ -389,7 +391,9 @@ function phraseOf(tool, args, outcome) {
|
|
|
389
391
|
case "listview.create":
|
|
390
392
|
return `创建列表视图 ${stringArg(args, "name") ?? ""}(${stringArg(args, "code") ?? schemaCode ?? "?"},模型 ${schemaCode ?? "?"})`;
|
|
391
393
|
case "listview.configure": {
|
|
392
|
-
|
|
394
|
+
// F2(0.8.17 探针 K 复核):同一请求列去重后再展示,`d1,d1` 只列一次。
|
|
395
|
+
const requestedCodes = Array.isArray(args.fieldCodes) ? [...new Set(args.fieldCodes.map(String))] : [];
|
|
396
|
+
const codes = requestedCodes.join("、");
|
|
393
397
|
const sections = ["sorts", "conditions", "actions", "buttons", "presentation", "options", "presentationType", "gantt", "queryLayer", "multiTableHeaderConfig"].filter((key) => args[key] !== undefined);
|
|
394
398
|
// F9(w44,2026-11-26 真机):视图固定条件只在门户运行面生效,REST 的
|
|
395
399
|
// data.list --queryCode 不应用。此前只有 JSON 回执尾部的
|
|
@@ -425,8 +429,24 @@ function phraseOf(tool, args, outcome) {
|
|
|
425
429
|
const systemColumnsAdded = Array.isArray(outcome?.readback?.systemColumnsAdded)
|
|
426
430
|
? (outcome.readback.systemColumnsAdded.map(String))
|
|
427
431
|
: [];
|
|
432
|
+
// F2(0.8.17 探针 K):真机 4 列请求回读 8 列(4 业务 + 4 平台系统列),
|
|
433
|
+
// 旧摘要只写「列 repairNo、device、amount、status」再追加系统列,人读起来
|
|
434
|
+
// 仍像 4 列。这里把实际列数点明:总列 = 业务列 + 平台系统列。
|
|
435
|
+
const readbackColumnCount = Array.isArray(outcome?.readback?.columns)
|
|
436
|
+
? outcome.readback.columns.length
|
|
437
|
+
: undefined;
|
|
438
|
+
const requestedColumnCount = requestedCodes.length;
|
|
439
|
+
const businessColumnCount = readbackColumnCount !== undefined ? Math.max(0, readbackColumnCount - systemColumnsAdded.length) : requestedColumnCount;
|
|
440
|
+
const totalColumnCount = readbackColumnCount ?? businessColumnCount + systemColumnsAdded.length;
|
|
441
|
+
// 只有「回读里的非系统列」恰好等于本次请求列时才敢写「业务 N 列:请求列」;
|
|
442
|
+
// 增量配置会保留既有业务列(a1,a2 后再配 b1,b2,b3),此时收益句若沿用
|
|
443
|
+
// business 计数会建议「要精确 5 列」——照做就丢 a1/a2。指引必须用本次请求
|
|
444
|
+
// 列数(replaceColumns+fieldCodes 的真实结果),并如实标「本次请求 N 列」。
|
|
445
|
+
const requestedColumnClause = businessColumnCount === requestedColumnCount && codes
|
|
446
|
+
? `业务 ${businessColumnCount} 列:${codes}`
|
|
447
|
+
: `本次请求 ${requestedColumnCount} 列${codes ? `:${codes}` : ""}`;
|
|
428
448
|
const systemColumnsLine = systemColumnsAdded.length > 0
|
|
429
|
-
?
|
|
449
|
+
? `;当前实际 ${totalColumnCount} 列(${requestedColumnClause} + 平台系统 ${systemColumnsAdded.length} 列):平台额外保留系统列 ${systemColumnsAdded.join("、")}(未传 replaceColumns/hideDefaultSystemFields);要精确 ${requestedColumnCount} 列请加 replaceColumns:true + hideDefaultSystemFields:true`
|
|
430
450
|
: "";
|
|
431
451
|
return `配置列表视图 ${stringArg(args, "code") ?? schemaCode ?? "?"}(模型 ${schemaCode ?? "?"}):列 ${codes || "(未变)"}${sections.length > 0 ? `;同时配置 ${sections.join("、")}` : ""}${systemColumnsLine}${actionsClearedLine}${conditionRuntimeLine}`;
|
|
432
452
|
}
|
package/dist/lanes/datarule.js
CHANGED
|
@@ -980,6 +980,9 @@ export function registerDataRuleLane(tools) {
|
|
|
980
980
|
tools,
|
|
981
981
|
name: "datarule.create",
|
|
982
982
|
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交", "必须附件", "不然就提交不了"] },
|
|
983
|
+
nestedParamHints: {
|
|
984
|
+
conditions: 'checkType:2 提交校验的条件串:`{字段} 操作符 右值`。常量右值用 `{"valueType":"custom","value":0}`(JSON 值对象;平台也接受裸字面量,如 `{qty} 大于 100`;例 `{amount} 大于 {"valueType":"custom","value":0}`);跨字段右值才用 `{"valueType":"currentModel","value":"<字段code>"}`。完整最小例见 --example submit-field-vs-constant',
|
|
985
|
+
},
|
|
983
986
|
lane: DATARULE_LANE,
|
|
984
987
|
scope: DATARULE_TOOLS["datarule.create"].scope,
|
|
985
988
|
description: DATARULE_TOOLS["datarule.create"].description,
|
|
@@ -258,6 +258,11 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
258
258
|
childTableSubSchema: '{"code":"<父字段 code>","properties":[{"code","name","schemaCode":"<父字段 code>","propertyType","propertyEmpty","sortKey"}]}',
|
|
259
259
|
childTableFormControl: "Sheet(201) with columns[{type,width,key,parentKey,options}]; child column keys never enter viewJson",
|
|
260
260
|
dateDefaultOptions: JSON.stringify(FIELD_DATE_DEFAULT_OPTIONS),
|
|
261
|
+
dateFormat: JSON.stringify({
|
|
262
|
+
default: FIELD_DATE_DEFAULT_OPTIONS.format,
|
|
263
|
+
formats: FIELD_DATE_FORMATS_EVIDENCED,
|
|
264
|
+
valueSemantics: "DATE(3) options.format 逐字比较、区分大小写;Java 写法 yyyy-MM-dd 不在任何族(字段能建,首次运行时 save 报 50000)。这是跨版本并集(8.6 的 19 项 ⊂ 2.1.5/8.7/8.8 的 55 项),平台是最终门",
|
|
265
|
+
}, null, 2),
|
|
261
266
|
formulaOptions: FIELD_FORMULA_WIRE.outerOptions,
|
|
262
267
|
formulaConfig: FIELD_FORMULA_WIRE.innerConfig,
|
|
263
268
|
formulaRuntimeVerification: FIELD_FORMULA_WIRE.runtimeVerification,
|
|
@@ -277,6 +282,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
277
282
|
childTableSubSchema: Object.freeze([behaviorBinding("test/child-table.test.ts#field.create CHILD_TABLE sends a subSchema (not options) with parent-coded child columns", assertFieldContract)]),
|
|
278
283
|
childTableFormControl: Object.freeze([behaviorBinding("test/child-table.test.ts#form.draft scaffolds a Sheet201 control with columns and keeps child keys out of viewJson", assertFieldContract)]),
|
|
279
284
|
dateDefaultOptions: Object.freeze([emitterBinding("lanes/field-contract.FIELD_DATE_DEFAULT_OPTIONS", assertFieldContract)]),
|
|
285
|
+
dateFormat: Object.freeze([emitterBinding("lanes/field-contract.FIELD_DATE_FORMATS_EVIDENCED", assertFieldContract)]),
|
|
280
286
|
formulaOptions: Object.freeze([behaviorBinding("test/formula-resultformat.test.ts#validateFormulaOptions accepts the fwb", assertFieldContract)]),
|
|
281
287
|
formulaConfig: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA persists formulaConfig + persistent", assertFieldContract)]),
|
|
282
288
|
formulaRuntimeVerification: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA ACCEPTS aggregation written as an EXPRESSION (form 计算控件 subtable SUM; UI+runtime-verified 2026-10-07)", assertFieldContract)]),
|
|
@@ -322,7 +328,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
322
328
|
"For single/multi-select pass `choices` (e.g. [\"A\",\"B\",\"C\"]) or `options.optionsSet` with optionsType custom/dictionary/businessModel; dictionary uses checkedDictionary/checkedDictionaryCode, businessModel uses schemaCode/sheetDataItem.",
|
|
323
329
|
"For a relation pass `relativeCode` and `options` (schemaCode/displayField/...). `searchFormula` and `conditions` are JSON strings for the relation data restriction/query conditions.",
|
|
324
330
|
"For a relation display field the tool writes the field-row top-level `relativePropertyCode` = options.displayField (the runtime reads THAT key, not options.displayField — QueryRuntimeController.java:1214-1226) and defaults options.displayFieldType:0 + displayFieldFormat:\"\".",
|
|
325
|
-
"For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale(数值小数位)`。数值显示格式写 `options.format`(`ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`percentile`=2,000.00;**百分比存比值** 0.5→50.00%;别名 percent/currency 归一;全表见 contract 的 numericalFormat
|
|
331
|
+
"For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale(数值小数位)`。数值显示格式写 `options.format`(`ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`percentile`=2,000.00;**百分比存比值** 0.5→50.00%;别名 percent/currency 归一;全表见 contract 的 numericalFormat);DATE 用日期枚举 `YYYY-MM-DD`/`YYYY-MM-DD HH:mm:ss`/`YYYY年MM月DD日`。",
|
|
326
332
|
"org 选人族(STAFF_SELECTOR 等 5/50/51/60/61)字段行 options 由工具写成发布安全形状(形状与读面键见 contract field 的 orgSelectorFieldRowOptions)。deptVisible/multi 是**表单控件面**判别键(disposeUpdateType/updateSelectionType 读 control.options,票 69 已由表单脚手架写入控件面),不出现在字段行。",
|
|
327
333
|
]),
|
|
328
334
|
}),
|
|
@@ -360,6 +366,9 @@ export function assertFieldContract() {
|
|
|
360
366
|
throw new Error("field contract must carry the RELEVANCE_DATA referenceField wire facts");
|
|
361
367
|
if (!String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("ratio.percentile") || !String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("0.5 renders 50.00%"))
|
|
362
368
|
throw new Error("field contract must carry the NUMERICAL display-format enum and the ratio value semantics");
|
|
369
|
+
const dateFormatWire = String(FIELD_LANE_CONTRACT.wire.dateFormat);
|
|
370
|
+
if (FIELD_DATE_FORMATS_EVIDENCED.length !== 55 || !dateFormatWire.includes("YYYY-MM-DD HH:mm:ss") || !dateFormatWire.includes("YYYY年MM月DD日"))
|
|
371
|
+
throw new Error("field contract must carry the full 55-item DATE options.format enum (dateFormat)");
|
|
363
372
|
if (!String(FIELD_LANE_CONTRACT.wire.controlEmissionPolicy).includes("BizPropertyType.java:27-54"))
|
|
364
373
|
throw new Error("field contract must carry the ticket-101 control-emission policy with its enum evidence");
|
|
365
374
|
if (!String(FIELD_LANE_CONTRACT.wire.fieldRowDefaultPolicy).includes("MUST-FIXED"))
|
package/dist/lanes/field.js
CHANGED
|
@@ -862,6 +862,9 @@ export function registerFieldLane(tools) {
|
|
|
862
862
|
tools,
|
|
863
863
|
name: "field.create",
|
|
864
864
|
search: { intents: ["加字段", "新增字段", "添加字段", "加一个字段", "单据号字段", "序列号字段", "编号规则字段", "百分比字段", "占比字段", "百分号显示"] },
|
|
865
|
+
nestedParamHints: {
|
|
866
|
+
format: "NUMERICAL 用平台常量(全表见 contract 的 numericalFormat;**百分比存比值** 0.5→50.00%);DATE 用日期枚举(`YYYY-MM-DD` / `YYYY-MM-DD HH:mm:ss` / `YYYY年MM月DD日`,共 55 项、区分大小写;全表见 contract 的 dateFormat),不是数值常量。",
|
|
867
|
+
},
|
|
865
868
|
lane: FIELD_LANE,
|
|
866
869
|
scope: FIELD_TOOLS["field.create"].scope,
|
|
867
870
|
description: FIELD_TOOLS["field.create"].description,
|
|
@@ -2029,12 +2032,17 @@ async function formBindingAdvisory(session, schemaCode, publishedRows) {
|
|
|
2029
2032
|
const fix = missingChildColumns.length > 0
|
|
2030
2033
|
? { schemaCode, ...(missingTopLevel.length > 0 ? { fieldCodes: missingTopLevel } : {}), childColumns: missingChildColumns }
|
|
2031
2034
|
: { schemaCode, fieldCodes: missingTopLevel, rebuild: true };
|
|
2035
|
+
// F5(探针 K):两个写回执各报一条同义告警时,不要给同一条命令。子表列专用
|
|
2036
|
+
// form.publish 的一步绑定参数(field.publish 自身不改表单布局)。
|
|
2037
|
+
const nextCommand = missingChildColumns.length > 0 && missingTopLevel.length === 0
|
|
2038
|
+
? `omc call form.publish --args '${JSON.stringify({ schemaCode, bindNewChildColumns: true })}'`
|
|
2039
|
+
: `omc call configure_form --args '${JSON.stringify(fix)}'`;
|
|
2032
2040
|
return {
|
|
2033
2041
|
formPresent: true,
|
|
2034
2042
|
...(missingTopLevel.length > 0 ? { notInFormLayout: missingTopLevel } : {}),
|
|
2035
2043
|
...(missingChildColumns.length > 0 ? { childColumnsNotInForm: missingChildColumns } : {}),
|
|
2036
|
-
note: "字段已发布但**表单布局里没有**,业务页面看不到。子表列用 childColumns
|
|
2037
|
-
nextCommand
|
|
2044
|
+
note: "字段已发布但**表单布局里没有**,业务页面看不到。子表列用 form.publish {bindNewChildColumns:true}(或 configure_form childColumns)增量绑进 Sheet201,不动其它控件;顶层缺字段用 rebuild:true(会重建布局)",
|
|
2045
|
+
nextCommand,
|
|
2038
2046
|
...extras,
|
|
2039
2047
|
};
|
|
2040
2048
|
}
|
package/dist/lanes/form.js
CHANGED
|
@@ -580,7 +580,7 @@ export function registerFormLane(tools) {
|
|
|
580
580
|
includeSystem: z.boolean().optional(),
|
|
581
581
|
})
|
|
582
582
|
.optional()
|
|
583
|
-
.describe("增量布局(推荐):{rows:[[\"a\",\"b\"],[\"c\"]],spans?:{a:12},includeSystem?}
|
|
583
|
+
.describe("增量布局(推荐):{rows:[[\"a\",\"b\"],[\"c\"]],spans?:{a:12},includeSystem?}。以当前草稿为基线(草稿为空时退回已发布),只改 rows 行分组与这些控件 span,**不必回传整包 attrs**;未列入 rows 的控件保留原行,系统控件须 includeSystem:true 才动。与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥"),
|
|
584
584
|
allowTypeMismatch: z.boolean().optional().describe("放行控件 type 与字段 propertyType 不匹配(默认拒 form-control-type-mismatch;仅平台模板明确要求特殊控件时用)"),
|
|
585
585
|
draftHtmlJson: z.string().optional(),
|
|
586
586
|
fieldCodes: z.array(z.string().min(1)).optional().describe("脚手架绑定的已发布字段(按此顺序);由 configure_form/intent 显式传入。子表列写「父字段.子列」等价于 childColumns"),
|
|
@@ -671,6 +671,7 @@ export function registerFormLane(tools) {
|
|
|
671
671
|
// 实测 form.draft 改布局后直接 form.publish **不带 force 也正常提拔**
|
|
672
672
|
// (errcode 0 / published true)。误导会让人多传一个没必要的护栏。
|
|
673
673
|
force: z.boolean().optional().describe("仅在回执 already-published(同一份草稿重复发布被短路)且你确认要重推时使用;正常流程(改草稿→publish)不需要它"),
|
|
674
|
+
bindNewChildColumns: z.boolean().optional().describe("true=发布前先把已发布但不在表单 Sheet201 columns 里的子表列增量绑定(同 configure_form childColumns),再一次发布;默认 false 只告警"),
|
|
674
675
|
allowDegrade: z.boolean().optional().describe("显式放行降级提拔(草稿控件数 < 已发布面);默认拒绝(form-publish-degrade),防把空/残草稿提拔成发布版"),
|
|
675
676
|
rebuild: z
|
|
676
677
|
.boolean()
|
|
@@ -694,6 +695,7 @@ export function registerFormLane(tools) {
|
|
|
694
695
|
sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode),
|
|
695
696
|
...(args.allowDegrade !== undefined ? { allowDegrade: args.allowDegrade } : {}),
|
|
696
697
|
...(args.rebuild !== undefined ? { rebuild: args.rebuild } : {}),
|
|
698
|
+
...(args.bindNewChildColumns !== undefined ? { bindNewChildColumns: args.bindNewChildColumns } : {}),
|
|
697
699
|
...(args.force !== undefined ? { force: args.force } : {}),
|
|
698
700
|
}),
|
|
699
701
|
lintScope: "partial",
|
|
@@ -126,7 +126,7 @@ export const LIST_VIEW_LANE_CONTRACT = Object.freeze({
|
|
|
126
126
|
}),
|
|
127
127
|
"listview.configure": Object.freeze({
|
|
128
128
|
scope: LIST_VIEW_SCOPE,
|
|
129
|
-
description: "配置列表视图(列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型)。**code 语义**:省略 `code`(或 code=schemaCode)= 配置**默认视图**(code = 模型 code,8.6.41 起默认视图同样可 configure),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户;仅需第二个视图时才 listview.create(configure 带 code 指向它)。`fieldCodes` 可省略——**省略=不动列**(只改排序/筛选/动作时不必重发列集合;`replaceColumns:true` 仍必须带 fieldCodes,全空参数零写入拒)。读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;2.1.5 树视图过滤组三键 `treeLimitScopeType`/`treeLimitConditionGroup`/`treeDefaultConditionGroup` 原样透传(值不同默认拒 `listview-tree-conditions-changed`,确认改写传 `allowTreeConditionChange:true`;缺键拒 `listview-tree-conditions-would-be-lost`);写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow
|
|
129
|
+
description: "配置列表视图(列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型)。**code 语义**:省略 `code`(或 code=schemaCode)= 配置**默认视图**(code = 模型 code,8.6.41 起默认视图同样可 configure),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户;仅需第二个视图时才 listview.create(configure 带 code 指向它)。`fieldCodes` 可省略——**省略=不动列**(只改排序/筛选/动作时不必重发列集合;`replaceColumns:true` 仍必须带 fieldCodes,全空参数零写入拒)。读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;2.1.5 树视图过滤组三键 `treeLimitScopeType`/`treeLimitConditionGroup`/`treeDefaultConditionGroup` 原样透传(值不同默认拒 `listview-tree-conditions-changed`,确认改写传 `allowTreeConditionChange:true`;缺键拒 `listview-tree-conditions-would-be-lost`);写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow。**条件验收**:配置面用 `listview.get` 回读 conditions;固定条件只在门户运行时生效,无 REST 验证入口(`data.list --queryCode` 不应用),数据侧用 `data.list` 显式 `filter`。",
|
|
130
130
|
}),
|
|
131
131
|
"listview.delete": Object.freeze({
|
|
132
132
|
scope: LIST_VIEW_SCOPE,
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -17,6 +17,28 @@ import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeC
|
|
|
17
17
|
export { assertListViewConfigureShape } from "./list-view-shapes.js";
|
|
18
18
|
const LIST_VIEW_LANE = LIST_VIEW_LANE_CONTRACT.lane;
|
|
19
19
|
const LIST_VIEW_TOOLS = LIST_VIEW_LANE_CONTRACT.tools;
|
|
20
|
+
/**
|
|
21
|
+
* F6(0.8.16):视图条件的 `filterType`(QueryFilterType 枚举名)→ `data.list`
|
|
22
|
+
* `filter.op` 的 DSL 别名。只映射 data.list 真正支持的算子;Of/NotOf 等没有
|
|
23
|
+
* 等价 DSL 时不伪造 op,改给 `dataSideTemplate`。大小写不敏感由 data.list 侧
|
|
24
|
+
* resolveSimpleOp 兜底,但 NotEq→noteq 不在别名表里,所以必须显式映射。
|
|
25
|
+
*/
|
|
26
|
+
const DATA_LIST_OP_BY_FILTER_TYPE = {
|
|
27
|
+
Eq: "eq",
|
|
28
|
+
NotEq: "neq",
|
|
29
|
+
Gt: "gt",
|
|
30
|
+
Lt: "lt",
|
|
31
|
+
Gte: "gte",
|
|
32
|
+
Lte: "lte",
|
|
33
|
+
Like: "like",
|
|
34
|
+
NotLike: "notlike",
|
|
35
|
+
IsNull: "isNull",
|
|
36
|
+
IsNotNull: "isNotNull",
|
|
37
|
+
In: "in",
|
|
38
|
+
NotIn: "notin",
|
|
39
|
+
Between: "between",
|
|
40
|
+
NotBetween: "notbetween",
|
|
41
|
+
};
|
|
20
42
|
/**
|
|
21
43
|
* r62a-F5 / r61 a-F14:列汇总(sumType)真值在呈现层 queryPresentation.columnsJson
|
|
22
44
|
* ——queryColumns 列树不回它。listview.get 与 listview.configure 的读回共用这个
|
|
@@ -1222,6 +1244,40 @@ export function registerListViewLane(tools) {
|
|
|
1222
1244
|
"视图条件的运行时过滤语义未取证:REST `data.list --queryCode <本视图>` 实测不应用固定条件(r35:读回 Gte/5000 正确、返回未过滤 4 条)。别用 queryCode 断言过滤生效;REST 侧过滤用 `data.list` 显式 `filter`。";
|
|
1223
1245
|
if (conditions.length > 0)
|
|
1224
1246
|
readback.viewConditionsAppliedRest = false;
|
|
1247
|
+
// F6(0.8.16 探针 J):conditionRuntimeNote 只说「不行」,探针要一个可执行
|
|
1248
|
+
// 的验收入口。配置面验收 = listview.get 回读 conditions(propertyCode/
|
|
1249
|
+
// filterType/defaultValue);运行时面没有 REST 验证入口(固定条件只在门户
|
|
1250
|
+
// 生效),数据侧只能用 data.list 显式 filter 自行过滤。不新增假验证。
|
|
1251
|
+
if (conditions.length > 0) {
|
|
1252
|
+
const firstCondition = conditions.find((condition) => String(condition.propertyCode ?? "").length > 0);
|
|
1253
|
+
const firstConditionCode = String(firstCondition?.propertyCode ?? "<propertyCode>");
|
|
1254
|
+
const firstFilterType = typeof firstCondition?.filterType === "string" ? firstCondition.filterType : "";
|
|
1255
|
+
const dataListOp = firstFilterType.length > 0 ? DATA_LIST_OP_BY_FILTER_TYPE[firstFilterType] : undefined;
|
|
1256
|
+
const dataSideArgs = {
|
|
1257
|
+
schemaCode: args.schemaCode,
|
|
1258
|
+
filter: { op: dataListOp ?? "<op>", field: firstConditionCode, value: "<value>" },
|
|
1259
|
+
};
|
|
1260
|
+
readback.conditionVerification = {
|
|
1261
|
+
configFace: "配置面验收:listview.get 回读 conditions(propertyCode/filterType/defaultValue);本次提交了 conditions 时 conditionReadback 已比对",
|
|
1262
|
+
command: `omc call listview.get --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, code })}'`,
|
|
1263
|
+
// F10(0.8.17 探针 K):验收口径集中一处写明,别让探针去找不存在的
|
|
1264
|
+
// REST 运行面验证入口。配置面 = conditionReadback.equivalent;运行面
|
|
1265
|
+
// 只有门户点验,平台没有 REST 入口。
|
|
1266
|
+
acceptance: "配置面验收 = conditionReadback.equivalent;运行面 = 门户点验(REST 无入口)",
|
|
1267
|
+
portalCheck: `需人工在门户打开视图 ${code}(模型 ${args.schemaCode}),按固定条件筛选一次并核对返回行——平台不提供 REST 运行面验证入口,本工具不提供假验证`,
|
|
1268
|
+
runtimeRunnable: false,
|
|
1269
|
+
runtimeNote: "视图固定条件只在门户运行时生效;平台没有 REST 验证入口(REST data.list --queryCode 不应用固定条件)。不要用 data.list --queryCode 断言过滤生效。",
|
|
1270
|
+
...(dataListOp !== undefined
|
|
1271
|
+
? {
|
|
1272
|
+
dataSideAlternative: `omc call data.list --env <env> --args '${JSON.stringify(dataSideArgs)}'`,
|
|
1273
|
+
dataSideNote: `数据侧替代:data.list 显式 filter(op 由条件 filterType ${firstFilterType} 映射为 ${dataListOp});它按该条件取数,但不是对视图固定条件的运行时验证。`,
|
|
1274
|
+
}
|
|
1275
|
+
: {
|
|
1276
|
+
dataSideTemplate: `omc call data.list --env <env> --args '${JSON.stringify(dataSideArgs)}'`,
|
|
1277
|
+
dataSideNote: `数据侧模板:条件 filterType ${firstFilterType || "未知"} 没有 data.list 等价 op,先把 <op> 换成 data.list 支持的算子(eq/neq/gte/lte/like/between/in…);这不是视图条件验证,也不声称按同一条件取数。`,
|
|
1278
|
+
}),
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1225
1281
|
// Post-write semantic readback (dogfood R2): the platform MODELS a list
|
|
1226
1282
|
// condition as a filter CONTROL definition, so a requested condition whose
|
|
1227
1283
|
// propertyCode does not survive the round-trip was lost. Surface that as
|
|
@@ -113,6 +113,16 @@ export async function inboundModelReferences(session, targets, treeRows, options
|
|
|
113
113
|
left.via.localeCompare(right.via) ||
|
|
114
114
|
(left.childTable?.code ?? "").localeCompare(right.childTable?.code ?? ""));
|
|
115
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Stable receipt label for one dependency step (`field.delete:<schema>.<code>`
|
|
118
|
+
* / `<tool>:<schema>`). Shared by `deletionOrderFromSteps`, the purge executor
|
|
119
|
+
* and the self-reference split so the three cannot drift.
|
|
120
|
+
*/
|
|
121
|
+
export function deletionStepLabel(step) {
|
|
122
|
+
const schemaCode = String(step.args.schemaCode ?? "");
|
|
123
|
+
const code = typeof step.args.code === "string" ? step.args.code : "";
|
|
124
|
+
return step.tool === "field.delete" ? `field.delete:${schemaCode}.${code}` : `${step.tool}:${schemaCode}`;
|
|
125
|
+
}
|
|
116
126
|
/**
|
|
117
127
|
* The executable dependency order derived from `deletionSteps` — one entry per
|
|
118
128
|
* distinct target, in the order the caller must execute them. A model that
|
|
@@ -131,9 +141,7 @@ export function deletionOrderFromSteps(steps) {
|
|
|
131
141
|
const seen = new Set();
|
|
132
142
|
const order = [];
|
|
133
143
|
for (const step of steps) {
|
|
134
|
-
const
|
|
135
|
-
const code = typeof step.args.code === "string" ? step.args.code : "";
|
|
136
|
-
const target = step.tool === "field.delete" ? `field.delete:${schemaCode}.${code}` : `${step.tool}:${schemaCode}`;
|
|
144
|
+
const target = deletionStepLabel(step);
|
|
137
145
|
if (seen.has(target))
|
|
138
146
|
continue;
|
|
139
147
|
seen.add(target);
|
|
@@ -141,6 +149,17 @@ export function deletionOrderFromSteps(steps) {
|
|
|
141
149
|
}
|
|
142
150
|
return order;
|
|
143
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* `omc model-purge --apply` without the destructive flag: the one-command form
|
|
154
|
+
* for a model whose only inbound references are SELF references (`selfReference`
|
|
155
|
+
* — its own child-table column pointing back at it). 0.8.16 F7: those columns
|
|
156
|
+
* belong to the model being deleted, so the purge tears them down automatically
|
|
157
|
+
* (field.delete → field.publish); only cross-model references still require the
|
|
158
|
+
* explicit `--unbind-references` opt-in.
|
|
159
|
+
*/
|
|
160
|
+
export function modelPurgeCommand(schemaCode, options = {}) {
|
|
161
|
+
return `omc model-purge --code ${schemaCode}${options.purgeInstances === true ? " --purge-instances" : ""} --apply`;
|
|
162
|
+
}
|
|
144
163
|
/**
|
|
145
164
|
* `omc model-purge --unbind-references --apply` — the ONE command that executes
|
|
146
165
|
* the same `field.delete → field.publish` unlink steps and then lets
|