@stalfh233/omc-cli 0.5.0 → 0.5.2

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.
Files changed (226) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +359 -359
  3. package/coverage/m1-coverage-manifest-v1.json +1414 -1414
  4. package/dist/approval-flow.js +0 -0
  5. package/dist/approval-token.js +102 -0
  6. package/dist/args.js +0 -0
  7. package/dist/artifacts.js +0 -0
  8. package/dist/batch-call.js +0 -0
  9. package/dist/bench/call-face-eval.js +0 -0
  10. package/dist/bench/context-attribution.js +0 -0
  11. package/dist/bench/discovery-cost-eval.js +0 -0
  12. package/dist/bench/driver.js +0 -0
  13. package/dist/bench/evals.js +0 -0
  14. package/dist/bench/fake-http-server.js +65 -0
  15. package/dist/bench/instrument.js +0 -0
  16. package/dist/bench/intent-face-eval.js +40 -40
  17. package/dist/bench/run.js +0 -0
  18. package/dist/bench/scenario.js +0 -0
  19. package/dist/bench/types.js +0 -0
  20. package/dist/bi-wire.js +0 -0
  21. package/dist/bizservice-config.js +0 -0
  22. package/dist/call.js +0 -0
  23. package/dist/capability-absences.js +0 -0
  24. package/dist/capability-overview.js +0 -0
  25. package/dist/capability-shape.js +0 -0
  26. package/dist/cli-contract.js +38 -1
  27. package/dist/cli-output.js +8 -2
  28. package/dist/cli.js +9 -1
  29. package/dist/closest-match.js +0 -0
  30. package/dist/code-rules.js +0 -0
  31. package/dist/command-transport.js +0 -0
  32. package/dist/compound-writes.js +0 -0
  33. package/dist/compute.js +0 -0
  34. package/dist/config-store.js +0 -0
  35. package/dist/context.js +0 -0
  36. package/dist/contract-consistency.js +0 -0
  37. package/dist/contract-resources.js +0 -0
  38. package/dist/coverage-consistency.js +0 -0
  39. package/dist/coverage-registry.js +0 -0
  40. package/dist/coverage.js +0 -0
  41. package/dist/data-list-filter.js +0 -0
  42. package/dist/describe-cache.js +0 -0
  43. package/dist/discovery.js +0 -0
  44. package/dist/endpoints.js +0 -0
  45. package/dist/environment-policy.js +0 -0
  46. package/dist/execution-metadata.js +0 -0
  47. package/dist/fake/app.js +45 -0
  48. package/dist/fake/b2-registration.js +594 -0
  49. package/dist/fake/businessrule.js +242 -0
  50. package/dist/fake/datarule.js +72 -0
  51. package/dist/fake/dictionary.js +108 -0
  52. package/dist/fake/environment.js +30 -0
  53. package/dist/fake/field.js +167 -0
  54. package/dist/fake/form.js +101 -0
  55. package/dist/fake/index.js +121 -0
  56. package/dist/fake/list-view.js +289 -0
  57. package/dist/fake/model.js +136 -0
  58. package/dist/fake/online-js.js +18 -0
  59. package/dist/fake/report.js +253 -0
  60. package/dist/fake/routes.js +47 -0
  61. package/dist/fake/rule-lifecycle.js +37 -0
  62. package/dist/fake/runtime-data.js +367 -0
  63. package/dist/fake/state.js +67 -0
  64. package/dist/fake/workflow.js +364 -0
  65. package/dist/field-change.js +75 -7
  66. package/dist/field-families.js +59 -9
  67. package/dist/form-default.js +0 -0
  68. package/dist/form-layout.js +0 -0
  69. package/dist/form-support.js +0 -0
  70. package/dist/formula-lint.js +0 -0
  71. package/dist/goal-routes.js +16 -16
  72. package/dist/governed-execution.js +0 -0
  73. package/dist/graph.js +29 -29
  74. package/dist/human-summary.js +0 -0
  75. package/dist/identity.js +0 -0
  76. package/dist/intent/baseline.js +0 -0
  77. package/dist/intent/capabilities/bizservice.js +0 -0
  78. package/dist/intent/capabilities/businessrule.js +0 -0
  79. package/dist/intent/capabilities/datarule.js +0 -0
  80. package/dist/intent/capabilities/field.js +0 -0
  81. package/dist/intent/capabilities/form.js +0 -0
  82. package/dist/intent/capabilities/index.js +0 -0
  83. package/dist/intent/capabilities/listview.js +0 -0
  84. package/dist/intent/capabilities/model.js +0 -0
  85. package/dist/intent/capabilities/onlinejs.js +0 -0
  86. package/dist/intent/capabilities/report.js +0 -0
  87. package/dist/intent/capabilities/workflow.js +0 -0
  88. package/dist/intent/capability.js +0 -0
  89. package/dist/intent/cli.js +0 -0
  90. package/dist/intent/compare.js +0 -0
  91. package/dist/intent/compiler.js +0 -0
  92. package/dist/intent/dsl.js +0 -0
  93. package/dist/intent/plan-apply.js +0 -0
  94. package/dist/intent/plan-file.js +0 -0
  95. package/dist/intent/readback.js +0 -0
  96. package/dist/intent/schema.js +0 -0
  97. package/dist/intent/validation.js +0 -0
  98. package/dist/intent/yaml.js +0 -0
  99. package/dist/journal.js +0 -0
  100. package/dist/json-column.js +0 -0
  101. package/dist/lanes/app-contract.js +0 -0
  102. package/dist/lanes/app-coverage.js +0 -0
  103. package/dist/lanes/app.js +0 -0
  104. package/dist/lanes/apply-changes.js +0 -0
  105. package/dist/lanes/b2-registration-contract.js +0 -0
  106. package/dist/lanes/b2-registration-coverage.js +0 -0
  107. package/dist/lanes/b2-registration.js +0 -0
  108. package/dist/lanes/businessrule-contract.js +0 -0
  109. package/dist/lanes/businessrule-coverage.js +0 -0
  110. package/dist/lanes/businessrule.js +0 -0
  111. package/dist/lanes/contract-support.js +0 -0
  112. package/dist/lanes/coverage-declaration.js +0 -0
  113. package/dist/lanes/custom-page.js +0 -0
  114. package/dist/lanes/datarule-contract.js +0 -0
  115. package/dist/lanes/datarule-coverage.js +0 -0
  116. package/dist/lanes/datarule-protocol.js +0 -0
  117. package/dist/lanes/datarule.js +0 -0
  118. package/dist/lanes/dictionary-contract.js +0 -0
  119. package/dist/lanes/dictionary-coverage.js +0 -0
  120. package/dist/lanes/dictionary.js +0 -0
  121. package/dist/lanes/environment-contract.js +0 -0
  122. package/dist/lanes/environment-coverage.js +0 -0
  123. package/dist/lanes/environment.js +0 -0
  124. package/dist/lanes/field-contract.js +0 -0
  125. package/dist/lanes/field-coverage.js +0 -0
  126. package/dist/lanes/field.js +6 -1
  127. package/dist/lanes/folder-contract.js +0 -0
  128. package/dist/lanes/folder-coverage.js +0 -0
  129. package/dist/lanes/folder.js +0 -0
  130. package/dist/lanes/form-contract.js +0 -0
  131. package/dist/lanes/form-coverage.js +0 -0
  132. package/dist/lanes/form.js +0 -0
  133. package/dist/lanes/lane-ids.js +0 -0
  134. package/dist/lanes/list-view-contract.js +0 -0
  135. package/dist/lanes/list-view-coverage.js +0 -0
  136. package/dist/lanes/list-view-shapes.js +0 -0
  137. package/dist/lanes/list-view.js +0 -0
  138. package/dist/lanes/meta-contract.js +0 -0
  139. package/dist/lanes/meta.js +6 -0
  140. package/dist/lanes/model-contract.js +0 -0
  141. package/dist/lanes/model-coverage.js +0 -0
  142. package/dist/lanes/model.js +14 -29
  143. package/dist/lanes/online-js-contract.js +0 -0
  144. package/dist/lanes/online-js-coverage.js +0 -0
  145. package/dist/lanes/online-js.js +0 -0
  146. package/dist/lanes/org-tree.js +0 -0
  147. package/dist/lanes/organization.js +0 -0
  148. package/dist/lanes/report-contract.js +0 -0
  149. package/dist/lanes/report-coverage.js +0 -0
  150. package/dist/lanes/report.js +0 -0
  151. package/dist/lanes/rule-graph.js +0 -0
  152. package/dist/lanes/rule-lifecycle-contract.js +0 -0
  153. package/dist/lanes/rule-lifecycle-coverage.js +0 -0
  154. package/dist/lanes/rule-lifecycle.js +0 -0
  155. package/dist/lanes/runtime-data-contract.js +0 -0
  156. package/dist/lanes/runtime-data-coverage.js +0 -0
  157. package/dist/lanes/runtime-data.js +0 -0
  158. package/dist/lanes/workflow-contract.js +0 -0
  159. package/dist/lanes/workflow-coverage.js +0 -0
  160. package/dist/lanes/workflow.js +0 -0
  161. package/dist/model-purge.js +2 -2
  162. package/dist/model-record.js +40 -0
  163. package/dist/model-scaffold.js +0 -0
  164. package/dist/omc-core-lazy.js +0 -0
  165. package/dist/online-js-layout.js +0 -0
  166. package/dist/online-js-source.js +28 -28
  167. package/dist/package-tool.js +0 -0
  168. package/dist/package.js +0 -0
  169. package/dist/path-projection.js +0 -0
  170. package/dist/plan.js +0 -0
  171. package/dist/read.js +0 -0
  172. package/dist/recipes/b2-registration.js +0 -0
  173. package/dist/recipes/businessrule.js +0 -0
  174. package/dist/recipes/datarule.js +0 -0
  175. package/dist/recipes/dictionary.js +0 -0
  176. package/dist/recipes/field.js +0 -0
  177. package/dist/recipes/form.js +0 -0
  178. package/dist/recipes/list-view.js +0 -0
  179. package/dist/recipes/model.js +0 -0
  180. package/dist/recipes/online-js.js +0 -0
  181. package/dist/recipes/runtime-data.js +0 -0
  182. package/dist/recipes/shared.js +0 -0
  183. package/dist/recipes/workflow.js +0 -0
  184. package/dist/redact.js +0 -0
  185. package/dist/refusal-guidance.js +0 -0
  186. package/dist/rollback-spec.js +0 -0
  187. package/dist/rollback.js +0 -0
  188. package/dist/rule-support.js +5 -11
  189. package/dist/rule-when.js +0 -0
  190. package/dist/runtime-support.js +0 -0
  191. package/dist/script.js +0 -0
  192. package/dist/server.js +92 -0
  193. package/dist/service-doctor.js +0 -0
  194. package/dist/session-manager.js +0 -0
  195. package/dist/session.js +12 -0
  196. package/dist/skills.js +12 -2
  197. package/dist/sqlite-warning-filter.js +0 -0
  198. package/dist/support.js +0 -0
  199. package/dist/token-cache.js +0 -0
  200. package/dist/tool-types.js +0 -0
  201. package/dist/tools.js +0 -0
  202. package/dist/usage-log.js +0 -0
  203. package/dist/wire.js +0 -0
  204. package/dist/workflow-support.js +0 -0
  205. package/dist/write-lease.js +0 -0
  206. package/dist/write-lock.js +0 -0
  207. package/dist/write.js +0 -0
  208. package/dist/zip.js +0 -0
  209. package/docs/images/omc-nixi/README.md +41 -41
  210. package/docs/omc-introduction.md +851 -851
  211. package/docs/tool-surface-map.md +42 -42
  212. package/package.json +4 -4
  213. package/skills/omc-acceptance-criteria.md +50 -50
  214. package/skills/omc-business-configuration.md +334 -334
  215. package/skills/omc-capabilities.md +214 -214
  216. package/skills/omc-capability-scouting.md +55 -55
  217. package/skills/omc-config-draft-review.md +175 -175
  218. package/skills/omc-five-piece-flow.md +35 -35
  219. package/skills/omc-glossary.md +86 -86
  220. package/skills/omc-refusals.md +127 -127
  221. package/skills/omc-requirement-analysis.md +161 -161
  222. package/skills/omc-requirement-vocabulary.md +61 -61
  223. package/skills/omc-start-here.md +106 -106
  224. package/skills/omc-tool-selection.md +119 -119
  225. package/skills/omc-write-hazards.md +200 -200
  226. package/dist/lanes/organization-coverage.js +0 -27
@@ -1,127 +1,127 @@
1
- ---
2
- name: omc-refusals
3
- description: Decode a refused or uncertain OMC result. Use when a call returns refused/uncertain, or a status looks wrong, to find what the blocker means and the correct next action. Grouped by family, not enumerated per code.
4
- ---
5
-
6
- # Refusals & Recovery (拒绝与恢复)
7
-
8
- Grouped by family. For a specific tool's exact wire and valid shapes, follow the
9
- `contract`/`describe` pointers; this page is the **meaning + next action**.
10
-
11
- Read `result.blocker` (refused) or `result.status`+`result.reason` (uncertain).
12
- `result.retryable` is advisory only — the family decides what to do.
13
-
14
- ## 1. Write permission declined
15
-
16
- - `environment-write-disabled` — the environment profile has `writable:false`.
17
- **Do not retry the same call.** Either the operator turns writes on in
18
- `omc setup`, or the write is out of bounds. Zero wire was sent.
19
- - `production-confirmation-required` — the target is production and the call
20
- omitted `confirmProduction:true`. If the human approved a production write,
21
- re-send with `confirmProduction:true`; otherwise **stop**. Zero wire was sent.
22
-
23
- ## 2. Boundary — the capability is not covered
24
-
25
- - `capability-out-of-coverage` — `result.citation` names the manifest entry and
26
- its status (`blocked` / `unsupported` / `static-only`). **The refusal is the
27
- answer.** Do not route around it with a lower-level tool; the boundary is the
28
- same. If it should be covered, use `omc-capability-scouting`.
29
- - `version-family-evidence-missing` — no version evidence could be parsed at all;
30
- writes fail closed. (A version that simply isn't 8.6 is **not** a refusal any
31
- more: OMC is built on 8.6 but accepts other versions/product lines in
32
- compatibility mode, surfacing a `versionNotice`; only truly absent evidence
33
- still fails closed.) Verify the environment's version before retrying.
34
-
35
- ## 3. Semantic preflight — the payload is malformed
36
-
37
- Refused **before any wire call**; fix the payload, don't retry as-is. The refusal
38
- usually carries `validation` entries to fix one by one.
39
-
40
- - `business-code-invalid`, `duplicate-field`, `duplicate-service`,
41
- `dictionary-create-duplicate`, `app-create-duplicate`, `model-create-duplicate`
42
- - `field-*` family gates (unaccepted family, missing relation `relativeCode`,
43
- child-table column that is itself a child table, OCR/ELECTRONIC_SIGN)
44
- - `form-layout-invalid`, `form-fieldcodes-unknown`, `form-html-render-invalid`
45
- - `rule-graph-validation-failed`, `rule-graph-*` (node-graph dry lint)
46
- - `datarule-options-invalid`, `datarule-property-not-published`, `datarule-duplicate-property-type`
47
- - `listview-*` (columns/buttons/sorts/gantt/presentation)
48
- - `configure-model-*`, `apply-changes-tool-not-atomic`, `apply-changes-step-failed`
49
- - `bizservice-*` (required field, name length, config invalid, category/dbconnpool)
50
- - `model-type-immutable`, `model-referenced-by`
51
-
52
- ### 3b. A platform `errcode` is a SHAPE error, never a boundary
53
-
54
- `blocker:"wire-business"` + non-zero `errcode` means the payload's shape (or a
55
- referenced dependency) is wrong — **not** that the capability is unavailable.
56
- Fix the shape; never conclude 「配置表达不了 → 必须二开」 from an errcode.
57
- Known shape codes: `300010` a node resolves its input schema from `inputParam`
58
- and it is missing (BRANCH/UPDATE/CREATE/DELETE/ASSIGN/BIZ_ACTION/MESSAGE/QUERY;
59
- `prepareRuleGraph` defaults `"_input"`) or a node names a non-existent schema;
60
- `550018` a referenced field/out-param/mapping key is absent; `50000` a
61
- condition/expression/query shape is off. Compare against
62
- `omc describe <tool> --example …` and the node-graph prose, then re-save.
63
- Escalate to 二开 **only** for a real `capability-out-of-coverage` (§2).
64
-
65
- `40000 调用数据库发生异常` is the **most opaque** shape code — no detail at all.
66
- Line up the model's field-level config first: an `AGGREGATION` FORMULA field whose
67
- `aggregation.schemaCode` points at a **child-table schema** publishes fine and then
68
- makes every `data.submit`/`data.update` on that model 40000 (r18 2026-10-26 live;
69
- bisect by deleting/disabling the suspect formula field, which is reversible).
70
- `omc` now answers `runtime-write-db-exception` and lists the model's formula
71
- fields; the fix is to aggregate a MAIN-table scalar column instead.
72
-
73
- ## 4. Readback mismatch — the write landed but does not match
74
-
75
- `*-readback-failed`, `*-readback-mismatch`, `cleanup-absence-readback`,
76
- `intent-readback-mismatch`, `workflow-render-readback-invalid`.
77
-
78
- **Stop and report.** Never auto-retry, never assume success. Inspect
79
- `result.readback` / `result.verification.differences`, compare against the
80
- approved draft, and decide with the human. A second write may duplicate.
81
-
82
- ## 5. Dependency & async convergence
83
-
84
- - `model-referenced-by` — inbound relation references block the delete. Clean up
85
- **dependency-inverted**: delete referencing models first, then the referenced
86
- one.
87
- - `absent:false` + `treeNodePending:true` with `nextAction:"wait-and-recheck"` —
88
- the platform's per-column cascade is still running (40–60s). **Not a failure.**
89
- Wait ~60s and re-run; the call is idempotent and `already-absent` short-circuits.
90
-
91
- ## 6. Idempotency & replay
92
-
93
- - A repeated `requestId` with identical args returns `replay:"already-completed"`
94
- — the first write stands; treat as success, do not re-execute.
95
- - `intent-plan-tampered` — the plan file changed after planning. Re-run
96
- `intent plan`.
97
- - `intent-baseline-drifted` — the environment moved after planning. Re-run
98
- `intent plan` against the fresh baseline.
99
- - `intent-plan-environment-mismatch` — the plan targets a different environment.
100
-
101
- ## 7. Transport uncertainty — outcome unknown
102
-
103
- `status:"uncertain"` with `frozen:true` (`cli-timeout`, `batch-timeout-budget`,
104
- `wire-transport:*`). The write **may** be in flight.
105
-
106
- 1. Read back the affected resource (or `artifact get <id>` / the `requestId`).
107
- 2. Only after the outcome is established, decide whether to retry.
108
- 3. Never blind-retry — that risks a second write.
109
-
110
- `write-lock-held` — another write holds the environment lock; `owner` and
111
- `recovery` are included. Wait for it to clear (it auto-recovers when the holding
112
- process exits), then retry. This guards concurrency, not approval.
113
-
114
- ## 8. Runtime / gateway errors (not tool refusals, same discipline)
115
-
116
- - `401 权限不够`(业务集成)→ 先查**前缀×鉴权**:`/openapi/**` 用 `xclient`,`/api/api/**` 用用户 token;混用必 401。对照同 adapter 既有成功服务(`service.get` 的方法 url)。
117
- - `500` 且仅 `X-LowCode-EngineCode should not be empty` → 补多租户头,不是业务错误。
118
- - `404 openresty` / `API 在服务端找不到` → url 层数不对(双层/三层 `/api`),按矩阵改一次,别反复试。
119
- - `position` 读回整数、写入枚举名 → 读侧编码,不是没写进去。
120
- - 版本证据缺失:先分 `pcServerUrl` 缺失(读取耦合,0.4.54 已修)与 `systemVersion` 真缺失(fail-closed 正确);不要伪造 8.6。
121
- - `401/403` 且 body 是 HTML/空 → 网关层,不是业务拒绝;停手索要一条可运行样例,别继续改载荷。
122
-
123
- ## 9. Input / target
124
-
125
- - `tool-input-invalid` — schema violation (exit 10); fix the arguments.
126
- - `dictionary-target-required`, `intent-plan-invalid` — a required selector or
127
- shape is missing; see `describe <tool>`.
1
+ ---
2
+ name: omc-refusals
3
+ description: Decode a refused or uncertain OMC result. Use when a call returns refused/uncertain, or a status looks wrong, to find what the blocker means and the correct next action. Grouped by family, not enumerated per code.
4
+ ---
5
+
6
+ # Refusals & Recovery (拒绝与恢复)
7
+
8
+ Grouped by family. For a specific tool's exact wire and valid shapes, follow the
9
+ `contract`/`describe` pointers; this page is the **meaning + next action**.
10
+
11
+ Read `result.blocker` (refused) or `result.status`+`result.reason` (uncertain).
12
+ `result.retryable` is advisory only — the family decides what to do.
13
+
14
+ ## 1. Write permission declined
15
+
16
+ - `environment-write-disabled` — the environment profile has `writable:false`.
17
+ **Do not retry the same call.** Either the operator turns writes on in
18
+ `omc setup`, or the write is out of bounds. Zero wire was sent.
19
+ - `production-confirmation-required` — the target is production and the call
20
+ omitted `confirmProduction:true`. If the human approved a production write,
21
+ re-send with `confirmProduction:true`; otherwise **stop**. Zero wire was sent.
22
+
23
+ ## 2. Boundary — the capability is not covered
24
+
25
+ - `capability-out-of-coverage` — `result.citation` names the manifest entry and
26
+ its status (`blocked` / `unsupported` / `static-only`). **The refusal is the
27
+ answer.** Do not route around it with a lower-level tool; the boundary is the
28
+ same. If it should be covered, use `omc-capability-scouting`.
29
+ - `version-family-evidence-missing` — no version evidence could be parsed at all;
30
+ writes fail closed. (A version that simply isn't 8.6 is **not** a refusal any
31
+ more: OMC is built on 8.6 but accepts other versions/product lines in
32
+ compatibility mode, surfacing a `versionNotice`; only truly absent evidence
33
+ still fails closed.) Verify the environment's version before retrying.
34
+
35
+ ## 3. Semantic preflight — the payload is malformed
36
+
37
+ Refused **before any wire call**; fix the payload, don't retry as-is. The refusal
38
+ usually carries `validation` entries to fix one by one.
39
+
40
+ - `business-code-invalid`, `duplicate-field`, `duplicate-service`,
41
+ `dictionary-create-duplicate`, `app-create-duplicate`, `model-create-duplicate`
42
+ - `field-*` family gates (unaccepted family, missing relation `relativeCode`,
43
+ child-table column that is itself a child table, OCR/ELECTRONIC_SIGN)
44
+ - `form-layout-invalid`, `form-fieldcodes-unknown`, `form-html-render-invalid`
45
+ - `rule-graph-validation-failed`, `rule-graph-*` (node-graph dry lint)
46
+ - `datarule-options-invalid`, `datarule-property-not-published`, `datarule-duplicate-property-type`
47
+ - `listview-*` (columns/buttons/sorts/gantt/presentation)
48
+ - `configure-model-*`, `apply-changes-tool-not-atomic`, `apply-changes-step-failed`
49
+ - `bizservice-*` (required field, name length, config invalid, category/dbconnpool)
50
+ - `model-type-immutable`, `model-referenced-by`
51
+
52
+ ### 3b. A platform `errcode` is a SHAPE error, never a boundary
53
+
54
+ `blocker:"wire-business"` + non-zero `errcode` means the payload's shape (or a
55
+ referenced dependency) is wrong — **not** that the capability is unavailable.
56
+ Fix the shape; never conclude 「配置表达不了 → 必须二开」 from an errcode.
57
+ Known shape codes: `300010` a node resolves its input schema from `inputParam`
58
+ and it is missing (BRANCH/UPDATE/CREATE/DELETE/ASSIGN/BIZ_ACTION/MESSAGE/QUERY;
59
+ `prepareRuleGraph` defaults `"_input"`) or a node names a non-existent schema;
60
+ `550018` a referenced field/out-param/mapping key is absent; `50000` a
61
+ condition/expression/query shape is off. Compare against
62
+ `omc describe <tool> --example …` and the node-graph prose, then re-save.
63
+ Escalate to 二开 **only** for a real `capability-out-of-coverage` (§2).
64
+
65
+ `40000 调用数据库发生异常` is the **most opaque** shape code — no detail at all.
66
+ Line up the model's field-level config first: an `AGGREGATION` FORMULA field whose
67
+ `aggregation.schemaCode` points at a **child-table schema** publishes fine and then
68
+ makes every `data.submit`/`data.update` on that model 40000 (r18 2026-10-26 live;
69
+ bisect by deleting/disabling the suspect formula field, which is reversible).
70
+ `omc` now answers `runtime-write-db-exception` and lists the model's formula
71
+ fields; the fix is to aggregate a MAIN-table scalar column instead.
72
+
73
+ ## 4. Readback mismatch — the write landed but does not match
74
+
75
+ `*-readback-failed`, `*-readback-mismatch`, `cleanup-absence-readback`,
76
+ `intent-readback-mismatch`, `workflow-render-readback-invalid`.
77
+
78
+ **Stop and report.** Never auto-retry, never assume success. Inspect
79
+ `result.readback` / `result.verification.differences`, compare against the
80
+ approved draft, and decide with the human. A second write may duplicate.
81
+
82
+ ## 5. Dependency & async convergence
83
+
84
+ - `model-referenced-by` — inbound relation references block the delete. Clean up
85
+ **dependency-inverted**: delete referencing models first, then the referenced
86
+ one.
87
+ - `absent:false` + `treeNodePending:true` with `nextAction:"wait-and-recheck"` —
88
+ the platform's per-column cascade is still running (40–60s). **Not a failure.**
89
+ Wait ~60s and re-run; the call is idempotent and `already-absent` short-circuits.
90
+
91
+ ## 6. Idempotency & replay
92
+
93
+ - A repeated `requestId` with identical args returns `replay:"already-completed"`
94
+ — the first write stands; treat as success, do not re-execute.
95
+ - `intent-plan-tampered` — the plan file changed after planning. Re-run
96
+ `intent plan`.
97
+ - `intent-baseline-drifted` — the environment moved after planning. Re-run
98
+ `intent plan` against the fresh baseline.
99
+ - `intent-plan-environment-mismatch` — the plan targets a different environment.
100
+
101
+ ## 7. Transport uncertainty — outcome unknown
102
+
103
+ `status:"uncertain"` with `frozen:true` (`cli-timeout`, `batch-timeout-budget`,
104
+ `wire-transport:*`). The write **may** be in flight.
105
+
106
+ 1. Read back the affected resource (or `artifact get <id>` / the `requestId`).
107
+ 2. Only after the outcome is established, decide whether to retry.
108
+ 3. Never blind-retry — that risks a second write.
109
+
110
+ `write-lock-held` — another write holds the environment lock; `owner` and
111
+ `recovery` are included. Wait for it to clear (it auto-recovers when the holding
112
+ process exits), then retry. This guards concurrency, not approval.
113
+
114
+ ## 8. Runtime / gateway errors (not tool refusals, same discipline)
115
+
116
+ - `401 权限不够`(业务集成)→ 先查**前缀×鉴权**:`/openapi/**` 用 `xclient`,`/api/api/**` 用用户 token;混用必 401。对照同 adapter 既有成功服务(`service.get` 的方法 url)。
117
+ - `500` 且仅 `X-LowCode-EngineCode should not be empty` → 补多租户头,不是业务错误。
118
+ - `404 openresty` / `API 在服务端找不到` → url 层数不对(双层/三层 `/api`),按矩阵改一次,别反复试。
119
+ - `position` 读回整数、写入枚举名 → 读侧编码,不是没写进去。
120
+ - 版本证据缺失:先分 `pcServerUrl` 缺失(读取耦合,0.4.54 已修)与 `systemVersion` 真缺失(fail-closed 正确);不要伪造 8.6。
121
+ - `401/403` 且 body 是 HTML/空 → 网关层,不是业务拒绝;停手索要一条可运行样例,别继续改载荷。
122
+
123
+ ## 9. Input / target
124
+
125
+ - `tool-input-invalid` — schema violation (exit 10); fix the arguments.
126
+ - `dictionary-target-required`, `intent-plan-invalid` — a required selector or
127
+ shape is missing; see `describe <tool>`.
@@ -1,161 +1,161 @@
1
- ---
2
- name: omc-requirement-analysis
3
- description: Turn a fuzzy Chinese requirement into a platform-independent Configuration Intent. Use before discovery when the ask is vague or spans domains.
4
- ---
5
-
6
- # Requirement Analysis (需求分析)
7
-
8
- Turn a fuzzy Chinese requirement into a platform-independent **Configuration
9
- Intent** before any discovery, plan, or draft.
10
-
11
- This is reasoning, not a governed tool: it reads no environment, prints no
12
- credential, and writes nothing.
13
-
14
- **Leading word: 定面** — name the face. The same Chinese word names several
15
- OMC surfaces (规则, 表单, 字段, 集成, 在线, 数据). 定面 first; everything after
16
- depends on it. This word is shared with `omc-capability-scouting`.
17
-
18
- ## Process
19
-
20
- Five moves, in order. Each ends on a completion criterion.
21
-
22
- ### 1. 定面 — name the face
23
-
24
- For every noun in the requirement, assign exactly one OMC face from the 定面表.
25
-
26
- **Done when** every ambiguous noun carries exactly one face, and every noun
27
- with no face is marked a boundary.
28
-
29
- ### 2. 归类 — capability and lane
30
-
31
- Map each face to its capability, lane, and status in the 能力表.
32
-
33
- **Done when** every face has a capability, its lane, and one status
34
- (`executable` / `partial` / `blocked` / `unsupported`).
35
-
36
- ### 3. 选路 — implementation path
37
-
38
- Choose one path per behavior, in preference order: **native** →
39
- **configuration + Online JS** → **configuration + backend extension**.
40
-
41
- **Done when** each behavior carries a path, and every non-native path names
42
- the code owner and why native cannot carry it.
43
-
44
- ### 4. 澄清 — risk-driven
45
-
46
- Ask only about unresolved details that change behavior, data, environment
47
- impact, or acceptance (see 澄清触发). A blocked or unsupported face is a
48
- **boundary** — stated, not asked. All other detail takes the established
49
- project convention.
50
-
51
- **Done when** the open-question list is emitted, or empty.
52
-
53
- ### 5. 出意图 — emit Configuration Intent
54
-
55
- Emit the intent object (see Configuration Intent).
56
-
57
- **Done when** every field is populated and `nextStep` is set.
58
-
59
- ## 定面表 — disambiguate before classifying
60
-
61
- | 需求里的词 | 面 A | 面 B | 判别 |
62
- | --- | --- | --- | --- |
63
- | 规则 | cross-model **businessrule** graph (B 平面) | 字段级控件规则 `dataRuleType` 3/4/5 | 跨模型/触发/动作 → businessrule;单字段随值必填/只读/显示 → 表单控件绑定 |
64
- | 表单 | default form **(`bizsheet`)** | list view **(`query`)** | 录入/详情/布局/控件 → default form;列表/视图/筛选列 → list view |
65
- | 字段 | model property **(`bizproperty`)** | form control binding | 结构/类型 → model field;可见/只读/必填 → form binding |
66
- | 集成 | B2 业务集成服务 **(`bizservice`,`service.register`)** | 方法体来源:原生适配器(RESTFUL→外部 API)/ 二开扩展接口(也用 RESTFUL 指向扩展端点) | 对接接口/外部系统、或需自定义 Java 方法体 → **一律用 RESTFUL 业务集成服务**(二开接口 = 扩展模块写 REST 接口 + RESTFUL 服务指向它);自定义协议适配器 SPI 是「新增一种协议类型」,非常规、且不在工具支持面 |
67
- | 在线 | form **Online JS** | 在线后端编码 | 表单脚本 → Online JS;内联后端代码 → boundary (unsupported) |
68
- | 数据 | M2 runtime data | model/field 定义 | 记录读写 → M2 data;结构 → model/field |
69
-
70
- ## 归类 — face → capability
71
-
72
- Each face maps to a capability; **read the capability's coverage, tools,
73
- recipes, and boundaries from `omc-capabilities`** — that catalogue is the prose
74
- authority (this section is a pointer, not a second copy). Read only the section
75
- you need: `omc help omc-capabilities --section "<能力>"`. At call time the
76
- coverage manifest is authoritative and the tool gate rejects out-of-coverage
77
- calls.
78
-
79
- > `blocked` / `unsupported` are **native-config** verdicts. They route the
80
- > behavior to another code owner (`config + backend extension`), they do NOT
81
- > mean the requirement is undeliverable. Compiling a blocked face into "can't
82
- > do it, leave it manual" is a failure mode — see 选路.
83
-
84
- Full Chinese cue vocabulary lives in `omc-requirement-vocabulary.md` — reach
85
- for it when a cue in step 1 is not obvious from 定面表.
86
-
87
- ## 选路 — path rules
88
-
89
- > 落点判据(配置 vs 二开、组合观)的唯一权威源是 `cpdocs-guide` 的「落点」;本节只列 OMC 侧的落点执行。
90
-
91
- - **Native configuration** owns structure and lifecycle: models, fields,
92
- forms, list views, rule graphs, workflow templates.
93
- - **Online JS** owns form interaction and presentation: visibility, labels,
94
- field linkage, preview. It *previews* a computed value; the saved value
95
- comes from native config or a backend extension.
96
- - **Backend extension** is the method-BODY source when native config cannot
97
- express the logic. Expose it the normal way: **write an interface (a REST
98
- endpoint) in the extension package, then register a `RESTFUL` service pointing
99
- at it** (`service.register`, `adapterCode:RESTFUL`, `methodConfig.url` → the
100
- extension endpoint). Do NOT use `INTERNAL` / `custom_protocol` adapters — those
101
- are platform-internal protocol mechanisms, not the way a 二开 interface is
102
- registered, and they are outside the write face. A RESTFUL service pointing at
103
- an external API is the same face.
104
- - **Business-rule action dual path**: a rule's action nodes use product-native
105
- CRUD/query nodes (no code) **or** bind an already-released BizMethod. Surface
106
- both paths; the clarification decides.
107
- - **Cannot express declaratively ⇒ `config + backend extension`, do not stop** —
108
- the code owner is a backend extension (interface in the extension package +
109
- `RESTFUL` service + BIZ_ACTION/button binding). **Do not report "blocked" and
110
- leave the value unbuilt, and do not substitute an external throwaway script.**
111
-
112
- ## 澄清触发 — ask only when
113
-
114
- - the business domain is unknown, or a noun in 定面表 stays ambiguous;
115
- - money, cumulative values, or concurrency are involved;
116
- - the requirement is environment-impacting (上线 / 发布 / 生产 / 释放冻结);
117
- - two capabilities could satisfy it and the choice changes behavior.
118
-
119
- Proceed with the convention when the detail is cosmetic (label wording,
120
- layout polish) or already implied by an established project pattern.
121
-
122
- ## Configuration Intent
123
-
124
- ```jsonc
125
- {
126
- "domains": ["customer", "project"],
127
- "capabilities": ["model", "field", "form", "businessrule", "workflow"],
128
- "intent": {
129
- "entities": [{ "name": "…", "fields": [{ "name": "…", "type": "…" }] }],
130
- "behaviors": [{ "trigger": "create|update|delete|button|system|timed|…", "action": "…" }],
131
- "integrations": [{ "kind": "native-crud|bizmethod|b2-service", "target": "…" }]
132
- },
133
- "implementationPath": "native | config+onlinejs | config+backend-extension",
134
- "risks": ["…"],
135
- "clarifications": ["…"],
136
- "acceptanceScenarios": ["…"],
137
- "nextStep": "discover_and_plan | clarify | boundary"
138
- }
139
- ```
140
-
141
- `clarify` whenever 澄清触发 fires; `boundary` when a face is out of coverage;
142
- otherwise `discover_and_plan`.
143
-
144
- ## 反模式
145
-
146
- - Classifying a noun before 定面 — e.g. mapping 规则 to `dataRuleType` when a
147
- cross-model graph was meant.
148
- - Treating 对接外部系统 as a cue to develop a custom protocol adapter SPI — that
149
- is a rare NEW PROTOTYPE, not integration. The normal path is a
150
- business-integration service (`service.register`).
151
- - Routing a saved value through Online JS.
152
- - Inventing a capability for a blocked face. Cite the boundary instead.
153
- - Emitting a plan or DTO payload here — intent stays platform-independent
154
- until discovery.
155
-
156
- ## 接续
157
-
158
- Intent feeds, in order: `discover_environment` (fingerprint + existing
159
- resources) → configuration baseline → `omc-five-piece-flow`. For a face not
160
- yet proven, use `omc-capability-scouting`. For the concrete tool to call, use
161
- `omc-tool-selection`.
1
+ ---
2
+ name: omc-requirement-analysis
3
+ description: Turn a fuzzy Chinese requirement into a platform-independent Configuration Intent. Use before discovery when the ask is vague or spans domains.
4
+ ---
5
+
6
+ # Requirement Analysis (需求分析)
7
+
8
+ Turn a fuzzy Chinese requirement into a platform-independent **Configuration
9
+ Intent** before any discovery, plan, or draft.
10
+
11
+ This is reasoning, not a governed tool: it reads no environment, prints no
12
+ credential, and writes nothing.
13
+
14
+ **Leading word: 定面** — name the face. The same Chinese word names several
15
+ OMC surfaces (规则, 表单, 字段, 集成, 在线, 数据). 定面 first; everything after
16
+ depends on it. This word is shared with `omc-capability-scouting`.
17
+
18
+ ## Process
19
+
20
+ Five moves, in order. Each ends on a completion criterion.
21
+
22
+ ### 1. 定面 — name the face
23
+
24
+ For every noun in the requirement, assign exactly one OMC face from the 定面表.
25
+
26
+ **Done when** every ambiguous noun carries exactly one face, and every noun
27
+ with no face is marked a boundary.
28
+
29
+ ### 2. 归类 — capability and lane
30
+
31
+ Map each face to its capability, lane, and status in the 能力表.
32
+
33
+ **Done when** every face has a capability, its lane, and one status
34
+ (`executable` / `partial` / `blocked` / `unsupported`).
35
+
36
+ ### 3. 选路 — implementation path
37
+
38
+ Choose one path per behavior, in preference order: **native** →
39
+ **configuration + Online JS** → **configuration + backend extension**.
40
+
41
+ **Done when** each behavior carries a path, and every non-native path names
42
+ the code owner and why native cannot carry it.
43
+
44
+ ### 4. 澄清 — risk-driven
45
+
46
+ Ask only about unresolved details that change behavior, data, environment
47
+ impact, or acceptance (see 澄清触发). A blocked or unsupported face is a
48
+ **boundary** — stated, not asked. All other detail takes the established
49
+ project convention.
50
+
51
+ **Done when** the open-question list is emitted, or empty.
52
+
53
+ ### 5. 出意图 — emit Configuration Intent
54
+
55
+ Emit the intent object (see Configuration Intent).
56
+
57
+ **Done when** every field is populated and `nextStep` is set.
58
+
59
+ ## 定面表 — disambiguate before classifying
60
+
61
+ | 需求里的词 | 面 A | 面 B | 判别 |
62
+ | --- | --- | --- | --- |
63
+ | 规则 | cross-model **businessrule** graph (B 平面) | 字段级控件规则 `dataRuleType` 3/4/5 | 跨模型/触发/动作 → businessrule;单字段随值必填/只读/显示 → 表单控件绑定 |
64
+ | 表单 | default form **(`bizsheet`)** | list view **(`query`)** | 录入/详情/布局/控件 → default form;列表/视图/筛选列 → list view |
65
+ | 字段 | model property **(`bizproperty`)** | form control binding | 结构/类型 → model field;可见/只读/必填 → form binding |
66
+ | 集成 | B2 业务集成服务 **(`bizservice`,`service.register`)** | 方法体来源:原生适配器(RESTFUL→外部 API)/ 二开扩展接口(也用 RESTFUL 指向扩展端点) | 对接接口/外部系统、或需自定义 Java 方法体 → **一律用 RESTFUL 业务集成服务**(二开接口 = 扩展模块写 REST 接口 + RESTFUL 服务指向它);自定义协议适配器 SPI 是「新增一种协议类型」,非常规、且不在工具支持面 |
67
+ | 在线 | form **Online JS** | 在线后端编码 | 表单脚本 → Online JS;内联后端代码 → boundary (unsupported) |
68
+ | 数据 | M2 runtime data | model/field 定义 | 记录读写 → M2 data;结构 → model/field |
69
+
70
+ ## 归类 — face → capability
71
+
72
+ Each face maps to a capability; **read the capability's coverage, tools,
73
+ recipes, and boundaries from `omc-capabilities`** — that catalogue is the prose
74
+ authority (this section is a pointer, not a second copy). Read only the section
75
+ you need: `omc help omc-capabilities --section "<能力>"`. At call time the
76
+ coverage manifest is authoritative and the tool gate rejects out-of-coverage
77
+ calls.
78
+
79
+ > `blocked` / `unsupported` are **native-config** verdicts. They route the
80
+ > behavior to another code owner (`config + backend extension`), they do NOT
81
+ > mean the requirement is undeliverable. Compiling a blocked face into "can't
82
+ > do it, leave it manual" is a failure mode — see 选路.
83
+
84
+ Full Chinese cue vocabulary lives in `omc-requirement-vocabulary.md` — reach
85
+ for it when a cue in step 1 is not obvious from 定面表.
86
+
87
+ ## 选路 — path rules
88
+
89
+ > 落点判据(配置 vs 二开、组合观)的唯一权威源是 `cpdocs-guide` 的「落点」;本节只列 OMC 侧的落点执行。
90
+
91
+ - **Native configuration** owns structure and lifecycle: models, fields,
92
+ forms, list views, rule graphs, workflow templates.
93
+ - **Online JS** owns form interaction and presentation: visibility, labels,
94
+ field linkage, preview. It *previews* a computed value; the saved value
95
+ comes from native config or a backend extension.
96
+ - **Backend extension** is the method-BODY source when native config cannot
97
+ express the logic. Expose it the normal way: **write an interface (a REST
98
+ endpoint) in the extension package, then register a `RESTFUL` service pointing
99
+ at it** (`service.register`, `adapterCode:RESTFUL`, `methodConfig.url` → the
100
+ extension endpoint). Do NOT use `INTERNAL` / `custom_protocol` adapters — those
101
+ are platform-internal protocol mechanisms, not the way a 二开 interface is
102
+ registered, and they are outside the write face. A RESTFUL service pointing at
103
+ an external API is the same face.
104
+ - **Business-rule action dual path**: a rule's action nodes use product-native
105
+ CRUD/query nodes (no code) **or** bind an already-released BizMethod. Surface
106
+ both paths; the clarification decides.
107
+ - **Cannot express declaratively ⇒ `config + backend extension`, do not stop** —
108
+ the code owner is a backend extension (interface in the extension package +
109
+ `RESTFUL` service + BIZ_ACTION/button binding). **Do not report "blocked" and
110
+ leave the value unbuilt, and do not substitute an external throwaway script.**
111
+
112
+ ## 澄清触发 — ask only when
113
+
114
+ - the business domain is unknown, or a noun in 定面表 stays ambiguous;
115
+ - money, cumulative values, or concurrency are involved;
116
+ - the requirement is environment-impacting (上线 / 发布 / 生产 / 释放冻结);
117
+ - two capabilities could satisfy it and the choice changes behavior.
118
+
119
+ Proceed with the convention when the detail is cosmetic (label wording,
120
+ layout polish) or already implied by an established project pattern.
121
+
122
+ ## Configuration Intent
123
+
124
+ ```jsonc
125
+ {
126
+ "domains": ["customer", "project"],
127
+ "capabilities": ["model", "field", "form", "businessrule", "workflow"],
128
+ "intent": {
129
+ "entities": [{ "name": "…", "fields": [{ "name": "…", "type": "…" }] }],
130
+ "behaviors": [{ "trigger": "create|update|delete|button|system|timed|…", "action": "…" }],
131
+ "integrations": [{ "kind": "native-crud|bizmethod|b2-service", "target": "…" }]
132
+ },
133
+ "implementationPath": "native | config+onlinejs | config+backend-extension",
134
+ "risks": ["…"],
135
+ "clarifications": ["…"],
136
+ "acceptanceScenarios": ["…"],
137
+ "nextStep": "discover_and_plan | clarify | boundary"
138
+ }
139
+ ```
140
+
141
+ `clarify` whenever 澄清触发 fires; `boundary` when a face is out of coverage;
142
+ otherwise `discover_and_plan`.
143
+
144
+ ## 反模式
145
+
146
+ - Classifying a noun before 定面 — e.g. mapping 规则 to `dataRuleType` when a
147
+ cross-model graph was meant.
148
+ - Treating 对接外部系统 as a cue to develop a custom protocol adapter SPI — that
149
+ is a rare NEW PROTOTYPE, not integration. The normal path is a
150
+ business-integration service (`service.register`).
151
+ - Routing a saved value through Online JS.
152
+ - Inventing a capability for a blocked face. Cite the boundary instead.
153
+ - Emitting a plan or DTO payload here — intent stays platform-independent
154
+ until discovery.
155
+
156
+ ## 接续
157
+
158
+ Intent feeds, in order: `discover_environment` (fingerprint + existing
159
+ resources) → configuration baseline → `omc-five-piece-flow`. For a face not
160
+ yet proven, use `omc-capability-scouting`. For the concrete tool to call, use
161
+ `omc-tool-selection`.