@stalfh233/omc-cli 0.6.100 → 0.8.0

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 (53) hide show
  1. package/conformance/README.md +267 -0
  2. package/conformance/frontend-behavior-probe.mjs +1986 -0
  3. package/conformance/frontend-scenarios/calc-visibility.json +22 -0
  4. package/conformance/frontend-scenarios/form-buttons.json +19 -0
  5. package/conformance/frontend-scenarios/list-buttons.json +28 -0
  6. package/conformance/frontend-scenarios/onlinejs.json +19 -0
  7. package/coverage/m1-coverage-manifest-v1.json +88 -2
  8. package/dist/capability-overview.js +16 -4
  9. package/dist/cli-stdout.js +4 -0
  10. package/dist/cli.js +190 -7
  11. package/dist/contract-resources.js +2 -0
  12. package/dist/coverage-registry.js +4 -0
  13. package/dist/coverage.js +16 -2
  14. package/dist/endpoints.js +65 -0
  15. package/dist/environment-policy.js +15 -1
  16. package/dist/field-change.js +9 -2
  17. package/dist/field-families.js +27 -6
  18. package/dist/governed-execution.js +18 -12
  19. package/dist/human-summary.js +8 -0
  20. package/dist/intent/capabilities/field.js +6 -0
  21. package/dist/lanes/environment.js +3 -0
  22. package/dist/lanes/field-contract.js +117 -6
  23. package/dist/lanes/file-contract.js +69 -0
  24. package/dist/lanes/file-coverage.js +16 -0
  25. package/dist/lanes/file.js +257 -0
  26. package/dist/lanes/lane-ids.js +1 -0
  27. package/dist/lanes/list-view-contract.js +3 -3
  28. package/dist/lanes/list-view-shapes.js +56 -0
  29. package/dist/lanes/list-view.js +40 -5
  30. package/dist/lanes/meta.js +4 -3
  31. package/dist/lanes/model.js +8 -4
  32. package/dist/lanes/org-query-contract.js +62 -0
  33. package/dist/lanes/org-query-coverage.js +27 -0
  34. package/dist/lanes/org-query.js +610 -0
  35. package/dist/lanes/organization.js +44 -11
  36. package/dist/lanes/runtime-data.js +228 -59
  37. package/dist/lanes/workflow-contract.js +100 -1
  38. package/dist/lanes/workflow-coverage.js +13 -0
  39. package/dist/lanes/workflow.js +615 -15
  40. package/dist/package.js +3 -1
  41. package/dist/read-shapes.js +3 -3
  42. package/dist/recipes/runtime-data.js +8 -6
  43. package/dist/refusal-guidance.js +1 -1
  44. package/dist/rule-support.js +15 -17
  45. package/dist/session.js +16 -1
  46. package/dist/tool-types.js +15 -1
  47. package/dist/tools.js +7 -0
  48. package/dist/version-family-gaps.js +8 -1
  49. package/dist/version-partition.js +633 -0
  50. package/dist/wire.js +8 -2
  51. package/dist/write.js +11 -2
  52. package/package.json +6 -4
  53. package/skills/omc-capabilities.md +8 -1
package/dist/endpoints.js CHANGED
@@ -315,6 +315,71 @@ export const ENDPOINTS = {
315
315
  // end 规则照常触发);abort_instance 才是终止(规则不一定跑)。
316
316
  workflowOperation: "/api/api/runtime/workflow/workflow_operation",
317
317
  workflowFinishInstance: "/api/api/runtime/workflow/finish_instance_by_post",
318
+ /**
319
+ * The OpenAPI v2 审批动作 face — **可选通道**(`channel:"openapi"`),默认通道
320
+ * 是上面的会话面。OpenApiWorkflowController,
321
+ * `@RequestMapping("/openapi/v2/runtime/workflow")` — 8.6.26 :133 /
322
+ * AI-Platform 2.1.5 :129, verbatim identical. 这 8 个动作在 OpenAPI v2 面都有
323
+ * (reject_workitem/forward_workitem/adjust_workitem/assist_workitem/
324
+ * circulate_workitem/revoke_workitem/list_reject_activities/abort_instance),
325
+ * 但 `/openapi/**` 在 launcher 的 ResourceConfig 里是
326
+ * `hasAuthority("openapi")`,只有开放接口客户端(base_security_client
327
+ * .authorities=openapi,如种子客户端 xclient / client_credentials)满足;
328
+ * 门户登录 token 只有 AUTH_SYSTEM_MANAGE,USER ⇒ 401。
329
+ *
330
+ * PREFIX: the deployment's servlet context-path is `/api`
331
+ * (cp-sources/raw/v87/.../launcher/application-prod.yml:4 `context-path: /api`),
332
+ * so a controller mapping of `/openapi/...` lands on `/api/openapi/...`
333
+ * (SINGLE layer) — unlike the engine controllers whose own mapping already
334
+ * starts with `/api` (`/api/runtime/workflow` → `/api/api/runtime/workflow`).
335
+ * Actions carry the caller's id in the `userId` HEADER (8.6.26
336
+ * `@RequestHeader String userId`), which `wireCall` supplies.
337
+ */
338
+ openApiWorkflowReject: "/api/openapi/v2/runtime/workflow/reject_workitem",
339
+ openApiWorkflowForward: "/api/openapi/v2/runtime/workflow/forward_workitem",
340
+ openApiWorkflowAdjust: "/api/openapi/v2/runtime/workflow/adjust_workitem",
341
+ openApiWorkflowAssist: "/api/openapi/v2/runtime/workflow/assist_workitem",
342
+ openApiWorkflowCirculate: "/api/openapi/v2/runtime/workflow/circulate_workitem",
343
+ openApiWorkflowRevoke: "/api/openapi/v2/runtime/workflow/revoke_workitem",
344
+ openApiWorkflowRejectActivities: "/api/openapi/v2/runtime/workflow/list_reject_activities",
345
+ openApiWorkflowAbort: "/api/openapi/v2/runtime/workflow/abort_instance",
346
+ /**
347
+ * 审批动作的**默认(会话)通道** — WorkflowInstanceController
348
+ * (`@RequestMapping("/api/runtime/workflow")`, 8.6.26 :341 / 2.1.5 :252)
349
+ * + 部署 context-path `/api` ⇒ 双层 `/api/api/runtime/workflow/*`。
350
+ *
351
+ * 门户 UI 自己就走这一族(登录 token 的 authorities = AUTH_SYSTEM_MANAGE,USER,
352
+ * user-8.6.34 UserDetailsServiceImpl.java:104),所以**会话 token 直接可用**;
353
+ * OpenAPI v2 面(下面的 openApiWorkflow*)要求 OAuth 客户端带 `openapi`
354
+ * authority(launcher ResourceConfig:`/openapi/** → hasAuthority("openapi")`),
355
+ * 用户 token 没有 → AccessDeniedHandlerImpl 回 HTTP 401
356
+ * (真机 2026-11-24:`{"errcode":401,"errmsg":"权限不够,请联系管理员"}`)。
357
+ *
358
+ * 端点形状(两版逐字一致):
359
+ * - POST /reject_workItem WorkItemRejectVO(rejectToActivityCode+workItemId 必填)
360
+ * - POST /forward_workItem WorkItemSendToVO(workflowInstanceId 必填:WorkflowAspect.addUserFavoriteAspect)
361
+ * - POST /adjust_workItem_participators 加签(countersign,原审批人待办保留)
362
+ * - POST /assist_workItem / circulate_workItem 协办 / 传阅
363
+ * - GET /revoke_workitem query workflowInstanceId+activityCode(+workItemId)
364
+ * - GET /abort_instance query workflowInstanceId(+workItemId&version)
365
+ * - GET /list_reject_activities query workflowInstanceId+activityCode
366
+ */
367
+ workflowReject: "/api/api/runtime/workflow/reject_workItem",
368
+ workflowForward: "/api/api/runtime/workflow/forward_workItem",
369
+ workflowAdjustWorkItemParticipators: "/api/api/runtime/workflow/adjust_workItem_participators",
370
+ workflowAssist: "/api/api/runtime/workflow/assist_workItem",
371
+ workflowCirculate: "/api/api/runtime/workflow/circulate_workItem",
372
+ workflowRevoke: "/api/api/runtime/workflow/revoke_workitem",
373
+ workflowListRejectActivities: "/api/api/runtime/workflow/list_reject_activities",
374
+ /**
375
+ * 作废实例(`/api/runtime/workflow/abort_instance`,GET,
376
+ * params workflowInstanceId/workItemId?/version? — WorkflowInstanceController
377
+ * :867 in 8.6.26 / :639 in 2.1.5; same handleCancelWorkflowInstance target as
378
+ * the OpenAPI face). 会话通道的默认形态;POST `/abort_instance_by_post`
379
+ * (:886 / :651)接受 comment/resources,门户表单详情的「作废」用它。
380
+ */
381
+ workflowAbortInstance: "/api/api/runtime/workflow/abort_instance",
382
+ workflowAbortInstanceByPost: "/api/api/runtime/workflow/abort_instance_by_post",
318
383
  workflowListFinishedWorkItems: "/api/api/runtime/workflow/list_finished_workitems",
319
384
  workflowGetInstanceBaseInfo: "/api/api/runtime/workflow/get_instance_baseinfo",
320
385
  organizationRoleList: "/api/api/organization/role/list",
@@ -1,3 +1,4 @@
1
+ import { partitionVersion } from "./version-partition.js";
1
2
  /** The environment's write permission: the single machine-side write gate. */
2
3
  export function environmentWritable(profile) {
3
4
  return profile.writable === true;
@@ -23,6 +24,10 @@ export function environmentNotice(profile) {
23
24
  ? "当前是测试环境;已允许写入,仅应使用测试数据。"
24
25
  : "当前是测试环境;当前设置为只读,写入会被拒绝。";
25
26
  }
27
+ function partitionEvidence(version) {
28
+ const partition = partitionVersion(version);
29
+ return { family: partition.family, confidence: partition.confidence, matched: partition.matched };
30
+ }
26
31
  export function versionEvidenceOf(input) {
27
32
  const detected = input.detectedVersion;
28
33
  if (detected === undefined || detected.length === 0) {
@@ -32,14 +37,23 @@ export function versionEvidenceOf(input) {
32
37
  versionSource: null,
33
38
  anchorVersion: input.anchorVersion,
34
39
  versionFamily: input.versionFamily,
40
+ partition: partitionEvidence(undefined),
35
41
  };
36
42
  }
43
+ const partition = partitionVersion(detected);
37
44
  return {
38
45
  detectedVersion: detected,
39
- inAnchorFamily: detected.startsWith(`${input.versionFamily}.`),
46
+ // manifest 的锚点族是权威;今天就是 8.6。分区命中 anchor 或命中 manifest
47
+ // 前缀都算锚点族(后者保留给未来 manifest 改锚点的情形)。
48
+ inAnchorFamily: partition.family === "anchor-8.6" || detected.startsWith(`${input.versionFamily}.`),
40
49
  versionSource: input.versionSource ?? "system-config",
41
50
  anchorVersion: input.anchorVersion,
42
51
  versionFamily: input.versionFamily,
52
+ partition: {
53
+ family: partition.family,
54
+ confidence: partition.confidence,
55
+ matched: partition.matched,
56
+ },
43
57
  ...(input.versionNotice ? { versionNotice: input.versionNotice } : {}),
44
58
  };
45
59
  }
@@ -73,7 +73,12 @@ export function prepareFieldChange(input) {
73
73
  });
74
74
  assertRelationTargetPresent(propertyType, raw, input.relativeCode, input.code);
75
75
  // Gates run here so every entry point (direct, orchestrator, intent) shares them.
76
- assertFieldOptionsAllowed(propertyType, raw, input.schemaCode);
76
+ // DATE format whitelist is family-specific: the lane passes the session's
77
+ // detected version; no evidence keeps the 8.6 19-item set (fail closed).
78
+ assertFieldOptionsAllowed(propertyType, raw, input.schemaCode, {
79
+ ...(input.targetVersion ? { targetVersion: input.targetVersion } : {}),
80
+ ...(input.deferDateFormatFamily ? { deferDateFormatFamily: true } : {}),
81
+ });
77
82
  assertNumericalScale(propertyType, raw);
78
83
  assertFormConditions(raw);
79
84
  const options = ensureRelationDisplayFieldOptions(propertyType, raw);
@@ -228,7 +233,9 @@ export function prepareFieldUpdate(input) {
228
233
  // backfill schemaCode from relativeCode (top-level or already stored) so
229
234
  // field.publish cannot later 300010 on this field.
230
235
  assertRelationTargetPresent(recordType, nextOptions, input.relativeCode ?? (typeof input.base.relativeCode === "string" ? input.base.relativeCode : undefined), input.code);
231
- assertFieldOptionsAllowed(recordType, nextOptions, input.schemaCode);
236
+ assertFieldOptionsAllowed(recordType, nextOptions, input.schemaCode, {
237
+ ...(input.targetVersion ? { targetVersion: input.targetVersion } : {}),
238
+ });
232
239
  if (effectiveOptions !== undefined || input.choices !== undefined)
233
240
  assertNumericalScale(recordType, nextOptions);
234
241
  if (effectiveOptions !== undefined)
@@ -4,7 +4,7 @@ import { z } from "zod";
4
4
  import { closestMatch } from "./closest-match.js";
5
5
  import { ToolRefusalError } from "./tool-types.js";
6
6
  import { decodeJsonObjectColumn } from "./json-column.js";
7
- import { FIELD_CONTROL_CODES, FIELD_DATE_DEFAULT_OPTIONS, FIELD_DATE_FORMATS, FIELD_FAMILY_LIST } from "./lanes/field-contract.js";
7
+ import { FIELD_CONTROL_CODES, FIELD_DATE_DEFAULT_OPTIONS, FIELD_DATE_FORMATS_EVIDENCED, FIELD_FAMILY_LIST } from "./lanes/field-contract.js";
8
8
  import { formConditionOptionsError } from "./lanes/datarule-protocol.js";
9
9
  import { CAPABILITY_CONTROL_TYPES, capabilityShapeError, deriveControlOptions, deriveFieldOptions } from "./capability-shape.js";
10
10
  export { FIELD_FAMILY_LIST, FIELD_CONTROL_CODES };
@@ -1064,7 +1064,10 @@ export function assertFieldFamilyAllowed(args) {
1064
1064
  buildChildTableSubSchema(args);
1065
1065
  return;
1066
1066
  }
1067
- assertFieldOptionsAllowed(normalized, options);
1067
+ // Version evidence is not available in this pure-argument gate (it runs
1068
+ // before the session exists), so validate DATE formats against the union of
1069
+ // every evidenced family and let the session-aware seam decide the family.
1070
+ assertFieldOptionsAllowed(normalized, options, undefined, { deferDateFormatFamily: true });
1068
1071
  // r13 (2026-10-24): NUMERICAL's scale requirement lived ONLY in the execute
1069
1072
  // path, so `field.create --dry-run` said "fine" and the real write refused —
1070
1073
  // two verdicts for the same payload. `model-scaffold` preflights every field
@@ -1327,7 +1330,25 @@ function choiceOptionsError(type, options) {
1327
1330
  }
1328
1331
  return null;
1329
1332
  }
1330
- export function assertFieldOptionsAllowed(type, options, schemaCode) {
1333
+ /**
1334
+ * DATE(3) `options.format` gate — version-agnostic by policy.
1335
+ *
1336
+ * Every version is validated against `FIELD_DATE_FORMATS_EVIDENCED`, the union
1337
+ * of every evidenced family (55 items; 8.6's 19 are a strict subset of the
1338
+ * AI-Platform 2.1.5 / 8.7 / 8.8 set). This is a deliberate multi-version
1339
+ * compatibility trade-off: OMC no longer adjudicates the platform version. A
1340
+ * known 8.6 server that receives a 55-only value reports 50000 on the first
1341
+ * runtime save, and OMC surfaces that error as-is — 平台是最终门. Only values
1342
+ * NO evidenced platform accepts (e.g. the Java-style `yyyy-MM-dd`) are refused
1343
+ * up front.
1344
+ */
1345
+ function assertDateFormatAllowed(format) {
1346
+ const value = String(format);
1347
+ if (FIELD_DATE_FORMATS_EVIDENCED.includes(value))
1348
+ return;
1349
+ refuseFieldOptions(`不支持的日期格式:${JSON.stringify(value)}(已取证平台支持 55 种,见 options.format 枚举)`, `rejected: DATE(3) options.format 必须是已取证平台的枚举值(区分大小写的大写写法,共 55 项,见 FIELD_DATE_FORMATS_EVIDENCED)。Java 写法 yyyy-MM-dd 不在任何族——平台会判为 不支持的format,字段能创建但**首次运行时 save 报 50000**(2026-09-30 R5 实测)。这是有意的多版本兼容取舍:OMC 不按版本提前拒绝,平台是最终门,错误照实返回`);
1350
+ }
1351
+ export function assertFieldOptionsAllowed(type, options, schemaCode, _scope = {}) {
1331
1352
  if (options) {
1332
1353
  const shapeError = capabilityShapeError(type, "field", options);
1333
1354
  if (shapeError)
@@ -1337,10 +1358,10 @@ export function assertFieldOptionsAllowed(type, options, schemaCode) {
1337
1358
  // UPPERCASE enum (DateBizField.contentFromClient → `不支持的format:<v>`).
1338
1359
  // The shape check above only requires the key to be present, so a Java-style
1339
1360
  // `yyyy-MM-dd` passes create and then 50000s on the FIRST runtime save
1340
- // (2026-09-30 R5 live). Refuse any value outside the enum.
1361
+ // (2026-09-30 R5 live). Refuse only values outside the evidenced union —
1362
+ // version selection is left to the platform.
1341
1363
  if (type === FIELD_PROPERTY_TYPES.DATE && options && options.format !== undefined) {
1342
- if (!FIELD_DATE_FORMATS.includes(String(options.format)))
1343
- refuseFieldOptions(`DATE options.format ${JSON.stringify(options.format)} 不是平台支持的格式`, `rejected: DATE(3) options.format 必须是平台枚举(区分大小写的大写写法):${FIELD_DATE_FORMATS.join("、")}。Java 写法 yyyy-MM-dd 不在其中——平台 DateBizField 会判为 不支持的format,字段能创建但**首次运行时 save 报 50000**(2026-09-30 R5 实测)`);
1364
+ assertDateFormatAllowed(options.format);
1344
1365
  }
1345
1366
  if (type === FIELD_PROPERTY_TYPES.FORMULA) {
1346
1367
  if (options && (options.resultType !== undefined || options.expression !== undefined))
@@ -1,4 +1,4 @@
1
- import { assertWithinCoverage, versionFamilyNotice } from "./coverage.js";
1
+ import { assertWithinCoverage, versionEvidenceAbsentNotice, versionFamilyNotice } from "./coverage.js";
2
2
  import { planFingerprint } from "./plan.js";
3
3
  import { environmentNotice, environmentWritable, requiresProductionConfirmation } from "./environment-policy.js";
4
4
  import { refusalFromCoverage } from "./support.js";
@@ -44,14 +44,18 @@ export async function admitGovernedWrite(ctx, request) {
44
44
  });
45
45
  }
46
46
  const version = session.detectedVersion();
47
- if (!version)
48
- return settled({
49
- status: "refused",
50
- blocker: "version-family-evidence-missing",
51
- message: "writes fail closed when the CloudPivot version family cannot be established",
52
- });
53
- // P2-5:只读放行的证明**放在版本门之后**——任何额外读回都要先过 fail-closed 的
54
- // 版本证据门,保持「没有版本证据就不加新 wire 行为」的既有顺序。
47
+ // 2026-11-24 产品口径:**版本证据缺失不再关闭写面**。
48
+ //
49
+ // 原实现(`refused / version-family-evidence-missing`)挡的不是「版本不同」,
50
+ // 而是「探测不到版本」——而探测失败常常是环境侧的面缺失(例如 2.1.x 不挂
51
+ // license/info、某些部署 public/system/config 也不回版本串),按它锁死整个写面
52
+ // 属于把「诊断缺一条证据」升级成「不能工作」。多版本兼容优先:放行,把证据质量
53
+ // 显式写进 plan/回执(`versionEvidence:"absent"`),平台是最终门。
54
+ // blocker 名 `version-family-evidence-missing` 仅保留在 refusal-guidance 的诊断
55
+ // 枚举里,不再有代码路径产生它。
56
+ const versionEvidence = version ? undefined : "absent";
57
+ // P2-5:只读放行的证明在这里之后跑——它与版本无关;顺序只是让「先读版本证据、
58
+ // 再放行额外读回」的既有可观测顺序不变(现在缺证据也不再中断)。
55
59
  let readOnlyEscape;
56
60
  if (escapeRequested && request.readOnlyEscape !== undefined) {
57
61
  let verdict;
@@ -70,10 +74,11 @@ export async function admitGovernedWrite(ctx, request) {
70
74
  return settled({ ...verdict.refusal, environment: resolved.name });
71
75
  readOnlyEscape = verdict.note;
72
76
  }
73
- // Version family is advisory now: OMC is built on 8.6, but a deployment on a
77
+ // Version family is advisory: OMC is built on 8.6, but a deployment on a
74
78
  // different version (or product line, e.g. AI-Platform) is accepted in
75
- // compatibility mode. Missing evidence still fails closed above.
76
- const versionNotice = versionFamilyNotice(ctx.manifest, version);
79
+ // compatibility mode. Missing evidence is accepted too — with an explicit
80
+ // `versionEvidence:"absent"` marker instead of a refusal.
81
+ const versionNotice = version ? versionFamilyNotice(ctx.manifest, version) : versionEvidenceAbsentNotice(ctx.manifest);
77
82
  // Bind the plan to THIS environment (fingerprint + notice) so the preview and
78
83
  // every downstream artifact agree.
79
84
  const plan = {
@@ -82,6 +87,7 @@ export async function admitGovernedWrite(ctx, request) {
82
87
  environmentFingerprint: session.environmentFingerprint(),
83
88
  environmentNotice: environmentNotice(resolved.profile),
84
89
  ...(versionNotice ? { versionNotice } : {}),
90
+ ...(versionEvidence ? { versionEvidence } : {}),
85
91
  };
86
92
  if (request.dryRun === true)
87
93
  return settled((await request.dryRunResult?.(plan, session)) ?? { status: "dry-run", wouldChange: true, plan, planFingerprint: planFingerprint(plan) });
@@ -95,6 +95,14 @@ function noChange(outcome) {
95
95
  * 无变更 instead of pretending something changed.
96
96
  */
97
97
  export function writeSummary(tool, args, outcome, phase = "done") {
98
+ // 2026-11-24: 批量删除的运行时兜底失败(平台回成功、回读行仍在)不得读成
99
+ // 「已删除…」。leading verb 必须是否定,并列出仍在的 id。
100
+ if (phase === "done" && tool === "data.delete" && outcome?.readback?.batchDeleteIneffective) {
101
+ const ineffective = outcome.readback.batchDeleteIneffective;
102
+ const ids = Array.isArray(ineffective.undeletedIds) ? ineffective.undeletedIds.map(String) : [];
103
+ const schema = stringArg(args, "schemaCode");
104
+ return `未删除(batch-delete-ineffective)${ids.length} 条回读仍在${schema ? `(${schema})` : ""}:${ids.join("、")};改用单条 data.delete 重试`;
105
+ }
98
106
  // r28b F11: data.delete already-absent must NOT read as「已删除…」— humans/CI
99
107
  // that skim stderr treat the leading verb as the outcome. Say「未删除」first.
100
108
  if (phase === "done" && tool === "data.delete" && outcome?.performed?.skipped === "already-absent") {
@@ -61,6 +61,12 @@ function expectedFieldOptions(schemaCode, field) {
61
61
  propertyType: field.type,
62
62
  ...(field.choices ? { choices: field.choices } : {}),
63
63
  ...(field.options ? { options: field.options } : {}),
64
+ // This is the READBACK projection, not a write: the session-aware seam
65
+ // already applied the version-family DATE gate, and `compare()` has no
66
+ // version in scope. Without deferring, an AI-Platform 2.1.5/8.8 DATE
67
+ // format (MMM D, YYYY, HH:mm:ss, …) would make the projection throw and
68
+ // report `field-option-unwritable` for a field the apply just wrote.
69
+ deferDateFormatFamily: true,
64
70
  }).options;
65
71
  }
66
72
  catch {
@@ -165,6 +165,7 @@ export function registerEnvironmentLane(tools) {
165
165
  versionSource: versionEvidence.versionSource,
166
166
  versionFamily: versionEvidence.versionFamily,
167
167
  anchorVersion: versionEvidence.anchorVersion,
168
+ partition: versionEvidence.partition,
168
169
  ...(versionEvidence.versionNotice ? { versionNotice: versionEvidence.versionNotice } : {}),
169
170
  // 额外键:不替代冷路径键,只标注缓存来源。
170
171
  generatedAt: cached.generatedAt,
@@ -347,6 +348,7 @@ export function registerEnvironmentLane(tools) {
347
348
  versionSource: versionEvidence.versionSource,
348
349
  versionFamily: versionEvidence.versionFamily,
349
350
  anchorVersion: versionEvidence.anchorVersion,
351
+ partition: versionEvidence.partition,
350
352
  ...(versionEvidence.versionNotice ? { versionNotice: versionEvidence.versionNotice } : {}),
351
353
  };
352
354
  }, {
@@ -418,6 +420,7 @@ export function registerEnvironmentLane(tools) {
418
420
  versionSource: versionEvidence.versionSource,
419
421
  versionFamily: versionEvidence.versionFamily,
420
422
  anchorVersion: versionEvidence.anchorVersion,
423
+ partition: versionEvidence.partition,
421
424
  ...(versionEvidence.versionNotice ? { versionNotice: versionEvidence.versionNotice } : {}),
422
425
  };
423
426
  }),
@@ -67,12 +67,22 @@ export const FIELD_DATE_DEFAULT_OPTIONS = Object.freeze({
67
67
  format: "YYYY-MM-DD",
68
68
  });
69
69
  /**
70
- * Platform-supported DATE(3) `options.format` enum. The runtime compares the
71
- * stored value LITERALLY (DateBizField.contentFromClient has an if/else over
72
- * exactly these strings, else `不支持的format:<value>`): the UPPERCASE tokens
73
- * below work; Java's `yyyy-MM-dd` (lowercase y/d) is NOT one of them and makes
74
- * the first runtime save answer 50000 (2026-09-30 R5 live). Kept beside the
75
- * default so the default is provably in the enum.
70
+ * The DATE(3) `options.format` enum **on the 8.6 anchor family**. The runtime
71
+ * compares the stored value LITERALLY (8.6.26 `DateBizField.fillClientContent`
72
+ * inlines an if/else over exactly these 19 strings, else `不支持的format:<value>`):
73
+ * the UPPERCASE tokens below work; Java's `yyyy-MM-dd` (lowercase y/d) is NOT
74
+ * one of them and makes the first runtime save answer 50000 (2026-09-30 R5
75
+ * live). Kept beside the default so the default is provably in the enum.
76
+ *
77
+ * EVIDENCE ONLY — this is no longer a gate set. Since the multi-version
78
+ * compatibility decision (2026-11-24) every version is validated against
79
+ * `FIELD_DATE_FORMATS_EVIDENCED` (the 55-item union) and the platform is the
80
+ * final gate. 8.6.26 was decompiled and checked (inline if/else, no
81
+ * `FormatProcessConfig` class in its utility jar); 8.6.34's user-side
82
+ * `cloudpivot-utility` also ships no `FormatProcessConfig` (its engine-side
83
+ * bizobject artifact is not in hand). Later 8.6 patch builds (8.6.39 / 8.6.49)
84
+ * have no local artifact — not assumed either way. See
85
+ * `.scratch/omc-cli-2.1-compat/DATE-86-SURVEY.md`.
76
86
  */
77
87
  export const FIELD_DATE_FORMATS = Object.freeze([
78
88
  "YYYY", "YYYY-MM", "YYYY/MM",
@@ -85,6 +95,107 @@ export const FIELD_DATE_FORMATS = Object.freeze([
85
95
  "YYYY-MM-DD EN-APM HH:mm", "YYYY/MM/DD EN-APM HH:mm",
86
96
  "YYYY年MM月DD日", "YYYY年MM月",
87
97
  ]);
98
+ /**
99
+ * The 36 DATE(3) formats the AI-Platform wide family adds on top of the 8.6
100
+ * anchor set. Evidence: `FormatProcessConfig.FORMAT_RULES`
101
+ * (`isLegalFormat` = `FORMAT_RULES.containsKey(value)`); extracted independently
102
+ * from AI-Platform v2.1.5 and v1.1.23-dsj.8 (8.7.x) — both maps hold exactly
103
+ * the same 55 keys in the same order. The 55 values are a STRICT SUPERSET of
104
+ * the 19 8.6 ones (36 added, 0 removed). Still no milliseconds (`SSS`).
105
+ */
106
+ const FIELD_DATE_FORMATS_AI_PLATFORM_EXTRA = Object.freeze([
107
+ // 英文日期(无时间)
108
+ "MMM D, YYYY", "MMM. D, YYYY", "MMMM D, YYYY",
109
+ "DD MMMM YYYY", "DD/MM/YYYY", "MM/DD/YYYY",
110
+ // 中文日期 + 时间
111
+ "YYYY年MM月DD日 HH:mm", "YYYY年MM月DD日 HH:mm:ss",
112
+ // 中文 + CN-APM
113
+ "YYYY年MM月DD日 CN-APM", "YYYY年MM月DD日 CN-APM HH:mm",
114
+ // 英文日期 + EN-APM(6 个完整日期形态 × ` EN-APM` / ` EN-APM HH:mm`)
115
+ "MMM D, YYYY EN-APM", "MMM D, YYYY EN-APM HH:mm",
116
+ "MMM. D, YYYY EN-APM", "MMM. D, YYYY EN-APM HH:mm",
117
+ "MMMM D, YYYY EN-APM", "MMMM D, YYYY EN-APM HH:mm",
118
+ "DD MMMM YYYY EN-APM", "DD MMMM YYYY EN-APM HH:mm",
119
+ "DD/MM/YYYY EN-APM", "DD/MM/YYYY EN-APM HH:mm",
120
+ "MM/DD/YYYY EN-APM", "MM/DD/YYYY EN-APM HH:mm",
121
+ // 英文日期 + 24 小时制(同 6 个完整日期形态)
122
+ "MMM D, YYYY HH:mm", "MMM D, YYYY HH:mm:ss",
123
+ "MMM. D, YYYY HH:mm", "MMM. D, YYYY HH:mm:ss",
124
+ "MMMM D, YYYY HH:mm", "MMMM D, YYYY HH:mm:ss",
125
+ "DD MMMM YYYY HH:mm", "DD MMMM YYYY HH:mm:ss",
126
+ "DD/MM/YYYY HH:mm", "DD/MM/YYYY HH:mm:ss",
127
+ "MM/DD/YYYY HH:mm", "MM/DD/YYYY HH:mm:ss",
128
+ // 纯时间
129
+ "HH:mm", "HH:mm:ss",
130
+ ]);
131
+ /**
132
+ * DATE(3) `options.format` enum on the AI-Platform wide family — 2.1.5 / 8.7 /
133
+ * 8.8(8.7 与 2.1.5 集合逐字相同)— the 8.6 anchor 19 plus the 36 evidenced
134
+ * additions (55 total). The name is historical (`*_215`); the 8.7 set was
135
+ * extracted separately and is byte-identical to the 2.1.5 one.
136
+ */
137
+ export const FIELD_DATE_FORMATS_215 = Object.freeze([
138
+ ...FIELD_DATE_FORMATS,
139
+ ...FIELD_DATE_FORMATS_AI_PLATFORM_EXTRA,
140
+ ]);
141
+ /**
142
+ * The single DATE(3) `options.format` gate set for **every** version — the
143
+ * union of all evidenced families (55). 8.6's 19 are a strict subset of the
144
+ * AI-Platform 2.1.5 / 8.7 / 8.8 set, so the union is that 55-item list.
145
+ *
146
+ * Deliberate multi-version compatibility trade-off (2026-11-24): OMC does not
147
+ * adjudicate the platform version for this option. A known 8.6 server that
148
+ * receives a 55-only value reports 50000 on the first runtime save and OMC
149
+ * surfaces that error as-is (平台是最终门). Only values no evidenced platform
150
+ * accepts are refused up front.
151
+ */
152
+ export const FIELD_DATE_FORMATS_EVIDENCED = FIELD_DATE_FORMATS_215;
153
+ /**
154
+ * Informational classification of a detected version against the two evidenced
155
+ * families. **NOT a gate** — no code path refuses a DATE format based on this;
156
+ * see `FIELD_DATE_FORMATS_EVIDENCED` for the accepted set.
157
+ *
158
+ * Evidence per family (all 55-item sets extracted from the jar constant pool,
159
+ * `FormatProcessConfig.FORMAT_RULES`, and byte-identical):
160
+ * * 2.1.x — AI-Platform v2.1.5 (customer-facing 8.8)
161
+ * * 8.7.x — AI-Platform v1.1.23-dsj.8: `DateBizField.fillClientContent`
162
+ * calls `FormatProcessConfig.isLegalFormat(...)` instead of the 8.6
163
+ * inline if/else, and that map holds the same 55 keys.
164
+ * * 8.8 — the 2.1.x line under its 8.x spelling (same mapping already used
165
+ * by `perm`/`workflow` lanes).
166
+ * * 8.6.x — the 19-item anchor (8.6.26 inline if/else; 8.6.34 has no
167
+ * FormatProcessConfig class).
168
+ *
169
+ * Everything else (2.0.x, 2.2.x, 2.10.x, 3.x, 8.9+, 9.x, unknown, unparsable)
170
+ * is deliberately left `undefined` — we have no evidence to classify it, and it
171
+ * must not be mistaken for an evidenced family.
172
+ */
173
+ export function fieldDateFormatFamily(version) {
174
+ if (typeof version !== "string")
175
+ return undefined;
176
+ const match = /^\s*(\d+)\.(\d+)/u.exec(version);
177
+ if (!match)
178
+ return undefined;
179
+ const major = Number(match[1]);
180
+ const minor = Number(match[2]);
181
+ if (!Number.isInteger(major) || !Number.isInteger(minor))
182
+ return undefined;
183
+ if (major === 8 && minor === 6)
184
+ return "anchor";
185
+ if (major === 2 && minor === 1)
186
+ return "ai-platform";
187
+ if (major === 8 && (minor === 7 || minor === 8))
188
+ return "ai-platform";
189
+ return undefined;
190
+ }
191
+ /**
192
+ * @deprecated Version selection was removed (multi-version compatibility):
193
+ * always returns the evidenced 55-item union, same as the DATE gate. The
194
+ * `version` argument is ignored and kept only for source compatibility.
195
+ */
196
+ export function fieldDateFormatsFor(_version) {
197
+ return FIELD_DATE_FORMATS_EVIDENCED;
198
+ }
88
199
  /** FORMULA(100) options wire (8.6.26 FormulaPropertyOptions + admin field serializer). */
89
200
  export const FIELD_FORMULA_WIRE = Object.freeze({
90
201
  outerOptions: '{"formulaConfig":"<JSON string>","persistent":true[, "format":""|"percentile" — readback-only mirror, fwb §100]}',
@@ -0,0 +1,69 @@
1
+ import { assertDescriptionCarries, assertLaneContract, behaviorBinding, CONTRACT_FAMILY, CONTRACT_REFERENCE_VERSION } from "./contract-support.js";
2
+ import { LANES } from "./lane-ids.js";
3
+ /**
4
+ * File-transfer lane wire paths.
5
+ *
6
+ * 待收编:`src/endpoints.ts` 正被并行任务修改,本 lane 暂在这里持有个位数
7
+ * 路径常量;收编时原样搬进 ENDPOINTS(值已按网关前缀 `/api/api` 实测形状
8
+ * 写死,搬动只改引用、不改字符串)。
9
+ */
10
+ export const FILE_ENDPOINTS = Object.freeze({
11
+ /** QueryRuntimeController.java:2415-2428(8.6.26)/ 2939-2946(2.1.5):multipart field `file` → 纯字符串 refId。 */
12
+ upload: "/api/api/runtime/query/upload_file",
13
+ /** FileServerController.java:78-113(8.6.26)/ 67-90(2.1.5):GET ?refId= → 附件二进制流。 */
14
+ attachmentDownload: "/api/api/fileServer/attachment",
15
+ /** QueryRuntimeController.java:2868-2890(8.6.26)/ 3287-3306(2.1.5):POST {fileName:refId} → 原始存储对象二进制流。 */
16
+ storedDownload: "/api/api/runtime/query/download_import_error_info",
17
+ });
18
+ export const FILE_LANE_CONTRACT = Object.freeze({
19
+ lane: LANES.file,
20
+ family: CONTRACT_FAMILY,
21
+ referenceVersion: CONTRACT_REFERENCE_VERSION,
22
+ // 待收编 endpoints.ts:见 FILE_ENDPOINTS 注释。
23
+ endpoints: Object.freeze({}),
24
+ wire: Object.freeze({
25
+ upload: "POST /api/api/runtime/query/upload_file — multipart/form-data field `file`;回包是**纯字符串 refId**(不是 {errcode,data} 信封)。QueryRuntimeController.java:2415-2428(8.6.26)/ 2939-2946(2.1.5)。",
26
+ downloadAttachment: "GET /api/api/fileServer/attachment?refId=<refId> — 附件二进制流(Content-Disposition 带原始文件名);失败回 200 + {errcode,errmsg} JSON(OSS_DOWNLOAD_PERMISSION_ERR 等)。FileServerController.java:78-113(8.6.26)/ 67-90(2.1.5)。",
27
+ downloadStored: "POST /api/api/runtime/query/download_import_error_info body {fileName:<refId>} — 以存储对象键直取二进制流(upload_file 的 refId 就是存储键);失败被控制器吞掉,回 200 + 空 body。QueryRuntimeController.java:2868-2890(8.6.26)/ 3287-3306(2.1.5)。",
28
+ fileTypeGate: "上传端 checkFileType 只看文件名:必须含扩展名(最后一个 . 之后非空)、不得含 `..`、扩展名须在平台设置 allow_file_types 白名单;源码无固定大小上限(由部署的 multipart/nginx 限制)。OSSController.checkFileType(8.6.26 OSSController.java:306-330)。",
29
+ oneShotRefId: "refId 可能是**一次性**:FileOperateHelper2.downloadFile(filePath,fileName,delete=true) 在取文件时 refIdToFilenameCache.remove(refId)(8.6.26 FileOperateHelper2.java:43-57;2.1.5 同函数 65-76),业务集成 check/import 等消费型链路走的就是 delete=true——同一 refId 不要假定可重复消费。",
30
+ }),
31
+ wireBindings: Object.freeze({
32
+ upload: Object.freeze([behaviorBinding("test/file-transfer.test.ts#file.upload: multipart field `file` → plain-string refId", assertFileContract)]),
33
+ downloadAttachment: Object.freeze([behaviorBinding("test/file-transfer.test.ts#file.download: attachment source streams bytes and surfaces envelope refusals", assertFileContract)]),
34
+ downloadStored: Object.freeze([behaviorBinding("test/file-transfer.test.ts#file.download: stored source writes the bytes and reports path/size/sha256", assertFileContract)]),
35
+ fileTypeGate: Object.freeze([behaviorBinding("test/file-transfer.test.ts#file.upload: local preflight rejects a filename the platform checkFileType would reject", assertFileContract)]),
36
+ oneShotRefId: Object.freeze([behaviorBinding("test/file-transfer.test.ts#file.download: a consumed/unknown refId is answered as a definitive refusal", assertFileContract)]),
37
+ }),
38
+ evidence: Object.freeze([
39
+ "cp-sources/backend/decompiled-full/launcher-8.6.26/.../QueryRuntimeController.java:2415-2428,2868-2890",
40
+ "cp-sources/backend/decompiled-full/launcher-8.6.26/.../FileServerController.java:78-113",
41
+ "cp-sources/backend/decompiled-full/launcher-8.6.26/.../FileOperateHelper2.java:35-57",
42
+ "cp-sources/backend/decompiled-full/launcher-2.1.5/.../QueryRuntimeController.java:2939-2946,3287-3306",
43
+ "cp-sources/backend/decompiled-full/launcher-2.1.5/.../FileServerController.java:67-90",
44
+ "packages/omc-cli/src/lanes/file.ts",
45
+ "packages/omc-cli/test/file-transfer.test.ts",
46
+ ]),
47
+ tools: Object.freeze({
48
+ "file.upload": Object.freeze({
49
+ scope: "file upload (multipart → refId)",
50
+ description: "把本地文件上传到平台对象存储,返回纯字符串 refId。multipart 字段 `file`;服务器 checkFileType 只看文件名(必须含扩展名、不得含 `..`、扩展名须在平台 allow_file_types 白名单,白名单是平台设置、本地不可预知),源码无固定大小上限(由部署 multipart/nginx 决定)。上传会产生一个真实存储对象且平台没有删除端点。refId 可能一次性:平台消费型下载(业务集成 check/import 等 delete=true)会移除 refId→文件名缓存,之后不可复用——重试请重新上传。下载用 file.download;本工具返回的临时 refId 用 source:\"stored\"。",
51
+ }),
52
+ "file.download": Object.freeze({
53
+ scope: "file download (refId → local path)",
54
+ description: "按 refId 下载文件到本地路径(默认当前目录),返回 path/size/sha256;二进制不进 stdout。source:attachment(默认)=表单附件 refId,走 attachment 权限,失败回 200+{errcode};source:stored=上传临时对象(file.upload 的 refId),走 download_import_error_info 的存储键通道,失败回 200+空 body。refId 可能一次性(平台消费型接口 delete=true 会移除 refId→文件名缓存);取不到字节按 file-ref-unavailable 明确拒绝并提示重新上传。整文件读入内存,大文件请在平台前台下载。目标已存在默认拒绝(overwrite:true 覆盖),落盘 0600。",
55
+ }),
56
+ }),
57
+ });
58
+ export function assertFileContract() {
59
+ assertLaneContract(FILE_LANE_CONTRACT);
60
+ assertDescriptionCarries(FILE_LANE_CONTRACT, "file.upload", ["multipart", "allow_file_types", "一次性", "refId"]);
61
+ assertDescriptionCarries(FILE_LANE_CONTRACT, "file.download", ["sha256", "source:stored", "一次性", "overwrite"]);
62
+ if (!String(FILE_LANE_CONTRACT.wire.upload).includes("纯字符串"))
63
+ throw new Error("file contract must pin the plain-string refId response");
64
+ if (!String(FILE_LANE_CONTRACT.wire.downloadStored).includes("空 body"))
65
+ throw new Error("file contract must pin the swallowed-error signature of download_import_error_info");
66
+ if (!String(FILE_LANE_CONTRACT.wire.oneShotRefId).includes("FileOperateHelper2.java:43-57"))
67
+ throw new Error("file contract must pin the one-shot refId evidence");
68
+ }
69
+ //# sourceMappingURL=file-contract.js.map
@@ -0,0 +1,16 @@
1
+ import { claim, declareLaneCoverage } from "./coverage-declaration.js";
2
+ import { FILE_LANE_CONTRACT } from "./file-contract.js";
3
+ const T = FILE_LANE_CONTRACT.tools;
4
+ export const FILE_COVERAGE = declareLaneCoverage(FILE_LANE_CONTRACT.lane, [
5
+ {
6
+ capability: "Runtime file transfer (multipart upload refId ↔ local path download)",
7
+ evidence: [
8
+ "cp-sources/backend/decompiled-full/launcher-8.6.26/.../QueryRuntimeController.java:2415-2428,2868-2890",
9
+ "cp-sources/backend/decompiled-full/launcher-8.6.26/.../FileServerController.java:78-113",
10
+ "packages/omc-cli/src/lanes/file.ts",
11
+ "packages/omc-cli/test/file-transfer.test.ts",
12
+ ],
13
+ tools: [claim("file.upload", T["file.upload"].scope), claim("file.download", T["file.download"].scope)],
14
+ },
15
+ ]);
16
+ //# sourceMappingURL=file-coverage.js.map