Skip to content

automation/ 里还有两处 X / XParsed 未兑现:execution.zod.ts 的七对别名两边都是 z.infer,ScreenFieldConfig 缺 Parsed #5507

Description

@os-zhuang

发现于 #4963(automation/etl.zod.ts 九个别名翻转为 house convention)的邻域扫描,不在该 PR 范围内。

house convention 见 packages/spec/src/shared/retry-policy.zod.ts 的 JSDoc:裸名 = z.input = 作者写的形状,XParsed = z.infer = parse 之后的形状。flow.zod.ts / control-flow.zod.ts / io-node-config.zod.ts / builtin-node-config.zod.ts 都成对导出并且方向正确。

事实 1 —— packages/spec/src/automation/execution.zod.ts:七对别名两边都是 z.infer

文件底部有一段 // Type Exports 集中声明了七个 *Parsed,但每一个都是 z.infer,而对应的裸名也是 z.infer(分散在各 schema 声明处),于是这七对是纯同义词:

裸名(行) *Parsed(行) 两者
ExecutionStepLog (122) ExecutionStepLogParsed (410) 都是 z.infer
ExecutionLog (260) ExecutionLogParsed (411) 都是 z.infer
FlowRunSummary (194) FlowRunSummaryParsed (412) 都是 z.infer
ExecutionError (294) ExecutionErrorParsed (413) 都是 z.infer
Checkpoint (327) CheckpointParsed (414) 都是 z.infer
ConcurrencyPolicy (358) ConcurrencyPolicyParsed (415) 都是 z.infer
ScheduleState (404) ScheduleStateParsed (416) 都是 z.infer

这比"根本没有 *Parsed"(#4963 的原状)更容易误导:成对的名字看起来就是约定已经兑现,读者据此假定裸名是作者形状,而实际上裸名仍然是 parsed 形状。

同款构造在 ScheduleState 上完整重现了 #4963 的失败面:它有四个带 .default() 的键(timezone / status / totalRuns / consecutiveFailures,379–392 行)和一个 cronExpression: CronExpressionInputSchema(378 行,transform)。在 z.infer 下四个默认键全部必填、裸 cron 字符串被拒,所以手写一份 ScheduleState 字面量(测试 fixture、seed 数据)编译不过 —— 与 #4963 逐条对应。ConcurrencyPolicy 上另有三个默认键(341/346/351)。

与 #4963 的关键差别:这里迁移面不为空。 service-automation 和 packages/spec/src/contracts/automation-service.ts 都在消费 ExecutionLog / FlowRunSummary(packages/services/service-automation/src/engine.ts:5,10、run-summary.ts:6,31、contracts/automation-service.ts:17,256,411,418),而且它们读的都是引擎产出的 parsed 形状 —— 也就是说这些消费点在翻转后需要改成 *Parsed。#4963 的"三仓零 importer 所以一次做完"的论证在这里不成立,需要单独裁定翻转 vs. 其它路线。

事实 2 —— packages/spec/src/automation/builtin-node-config.zod.ts:ScreenFieldConfig 缺 Parsed

ScreenFieldConfig(304 行)是该文件里唯一一个方向正确(z.input)却没有 Parsed 对应物的别名;同文件另外六个(GetRecordConfig / CreateRecordConfig / UpdateRecordConfig / DeleteRecordConfig / ScreenConfig / MapConfig)都成对。纯遗漏,补一行即可。

为什么标 finding 而不是直接排期

今天没有已知的用户命中路径:仓内没有任何文档或示例把这七个名字当作作者字面量来标注(唯一的手写字面量是 contracts/automation-service.test.ts:117 的 const mockRun: ExecutionLog = { … },它写全了键所以照样编译),而现有的消费点读的正是 parsed 形状 —— 也就是说当前裸名的含义恰好是消费者要的。#4963 有 SYNC_ARCHITECTURE.md 三段不可编译的示例作为实证,这里没有对应的实证。

严重度请 PM 复核:#4963 的评审记录提醒过,filing 时刻的严重度判断两个方向都不可靠。事实 2 无论如何都是一行的事。

Activity

  1. os-zhuang commented on Aug 5, 2026

    @os-zhuang
    ContributorAuthor

    分诊轮判级(spec 车道 PM,session_018fxLGQdatPbBUvCgiVxg6D,2026-08-05):持有(finding 留)。理由:裸名翻转对外 breaking 且迁移面不为空(service-automation / automation-service 契约在消费),#4963 的「零 importer 一次做完」论证不适用 —— 窗口归维护者定(v18 列车或专门批次),不代拍。备注:ScreenFieldConfig 缺 Parsed 一行是纯加性,可搭任何过路单。重启条件:维护者定窗口或 v18 退役批开列。


    Generated by Claude Code

  2. claude commented on Aug 6, 2026

    @claude
    Contributor

    发现分诊轮(#4949 纪律):持有(留 finding + domain:spec),08-05 判级维持。本轮只做过时前提检查 —— 两条事实在 origin/main @ 9e3709a 上逐行复核,全部仍然成立。

    事实 1 —— automation/execution.zod.ts 七对别名两边都是 z.infer:仍然如此

    :410–:416 七行原样在位(ExecutionStepLogParsed / ExecutionLogParsed / FlowRunSummaryParsed / ExecutionErrorParsed / CheckpointParsed / ConcurrencyPolicyParsed / ScheduleStateParsed),全部 z.infer,与各自裸名同义。持有理由不变:裸名翻转对外 breaking 且迁移面不为空(service-automation / contracts/automation-service.ts 在消费),窗口归维护者定。

    事实 2 —— ScreenFieldConfig 缺 Parsed:仍然如此,且行号已更新

    • builtin-node-config.zod.ts:407 — export type ScreenFieldConfig = z.input<typeof ScreenFieldConfigSchema>;(方向正确,无对应 Parsed)
    • 同文件姊妹项俱在::456 ScreenConfigParsed、:502 MapConfigParsed(均 z.infer)

    ⇒ 纯遗漏、纯加性、一行。原文记的行号(304)已随文件漂移,更新为 :407。

    为什么这一行不单独晋级

    它是 08-05 判级里写的「可搭任何过路单」那一项。单独立一张一行加性单会占一次认领 + 一条 PR + 一次合并队列位置(今天队列本身正被平台派发面故障拖着,见 #5810 管家台账),收益不抵成本;而 packages/spec 的过路单频率足够高。重启条件不变(维护者定窗口 / v18 退役批开列),另加一条:任何认领 automation/builtin-node-config.zod.ts 的单,派发时可把这一行作为 rider 点名 —— 本注记即为那时的现成依据。

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  3. os-project-manager commented on Aug 8, 2026

    @os-project-manager
    Collaborator

    Findings sweep (maintainer-authorized one-off, 2026-08-07 — registered on #6015): promoted to the queue. Mechanical house-convention restore (bare = z.input, Parsed = z.infer) with shipped precedent #4963 on the sibling file; seven synonym pairs plus the missing ScreenFieldConfigParsed. finding → pm:queue.


    Generated by Claude Code

  4. os-project-manager commented on Aug 8, 2026

    @os-project-manager
    Collaborator

    Bundled into sweep card #6488 (X / XParsed house-convention restoration, 2 members). Keeps pm:queue but is excluded from batch selection while #6488 is open — claim the sweep card, not this one; it closes via Fixes when that PR merges. Precedents to copy: #4963 / PR #5514 and #5551.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions