Skip to content

zodShapeOf 补完 union + prefault 后仍剩两格不对齐:不下探 array element / record valueType,且 depth 上限 12 是四个 walker 里最窄的 #6232

Closed as not planned

Description

@os-zhuang

观察类发现,来自 #6098 收尾时对四个同族 walker 的逐格对照。今天两格都被 fail-closed 兜住(解不出 shape 时 reachableVia 返回 'root-graph',宁可多要一个 tombstone),没有已知错误产物。记录在案,免得下一轮把「补齐了吗」当成已答之问。

#6098 补掉的是 union 分支与 prefault,这两格补完之后 zodShapeOf 与三个同族 walker 的包装器集合、lazy、pipe 方向、union 键面已经一致。剩下的不一致有两处,都不是 #6098 的范围。

格 1 —— 不下探 array element / record valueType

walker array → element record → valueType
scripts/lib/zod-graph.ts zodShapeOf ❌ ❌
scripts/liveness/check-liveness.mts unwrap ❌ ❌
src/kernel/metadata-authoring-lint.ts unwrap ❌ ❌
src/system/metadata-form-zod-reconciliation.test.ts unwrap ✅ d.element ✅ d.valueType

所以这一格三比一,而且是唯一一个下探的那位跟另外三个不同——不能直接说「zodShapeOf 窄」。真正要先答的是语义问题:对 z.array(SomeObject) 这样的节点,「作者在这个节点上写的 shape」到底是不是元素的 shape?

现存标本:data/FilterArray(一个 lazy → array 的 emitted def,visited=false)今天 zodShapeOf 解不出 shape,落在 fail-closed 兜底上答 root-graph。#6098 实测的 1610 个 def 里只有它一个属于这一类。

格 2 —— depth 上限 12,是四个里最窄的

scripts/lib/zod-graph.ts                                12   (zodShapeOf 与 pipeInIsTransform 各一处)
scripts/liveness/check-liveness.mts                     16
src/kernel/metadata-authoring-lint.ts                   25
src/system/metadata-form-zod-reconciliation.test.ts     25

#6098 之后这一格的重要性上升了一点:union 分支是逐成员递归的(mergedUnionShape 对每个成员 depth + 1),嵌套 union 会比以前更快吃掉预算。今天没有截断——view 这条最深的链在 depth ≤ 3 就解完了——但「最窄的那个上限」正好落在喂删除门禁的这个 walker 上,方向不理想。

超限的后果同样是 return null → fail-closed,所以是保守而非错答。

与 #6098 的关系

#6098 的正文只点名了两格(union、prefault),这两格已随 PR #6222 合入并完成 #5056 测量轮。本条是那一轮收尾对照时发现的剩余项,单独记录而不是塞进那个 PR——因为格 1 会动桥表,必须有自己的测量轮。

建议

参考:#6098 · PR #6222 · #5317 · #5056 · #6221

Activity

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

    @os-project-manager
    Collaborator

    Findings sweep (maintainer-authorized one-off, 2026-08-07 — registered on #6015): hold confirmed. Both remaining cells are fail-closed today (unresolved shapes err toward demanding tombstones), so the 3-vs-1 walker disagreement produces no wrong artifacts yet. Restart: a wrong product traced to the missing descent, or the next walker-family alignment card (pairs with #6221).


    Generated by Claude Code

  2. os-zhuang commented on Aug 9, 2026

    @os-zhuang
    ContributorAuthor

    Findings round — hold re-confirmed (finding + domain:spec-tooling unchanged). Stale-premise check on origin/main @ 424316b:

    • Both cells are unchanged: zod-graph.ts still caps at depth > 12 (:109 and :224), check-liveness.mts still at depth > 16 (:239) — the narrowest limit still sits on the walker feeding the deletion gate; and zodShapeOf still does not descend array element / record valueType (the 3-vs-1 walker split stands).
    • The safety argument stands: both cells fail closed (return null ⇒ root-graph ⇒ tombstone demanded), so the misalignment still produces conservative answers, not wrong ones; data/FilterArray remains the only def in the affected class.
    • The open question is still semantic (is an array-of-X def's authored shape the element's shape — different answers for keysOf vs reachability), which is a measured-round change per #4001 战役的门测量 BFS 会误报「可达」:zod .describe() 共享 def 对象,任意单属性 bridge 把无关形状连起来 #5056's rule, not a drive-by.

    Restart unchanged: a wrong product traced to the missing descent, or the next walker-family alignment card (pairs with #6221).

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


    Generated by Claude Code

  3. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    ContributorAuthor

    Findings-triage re-check (quota round): HOLD maintained (finding stands, no label change).

    Premise re-verified on origin/main @ 2c28df9: zodShapeOf live at packages/spec/scripts/lib/zod-graph.ts:223 (union-branch recursion at :201), and the four-walker family it is compared against still exists. The two remaining misaligned cells (no array element / record valueType descent; depth cap) are still fail-closed — an unresolvable shape returns 'root-graph', over-producing tombstone candidates rather than losing any. No known wrong artifact today. Held.

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


    Generated by Claude Code

  4. claude commented on Aug 10, 2026

    @claude
    Contributor

    Findings round (quota re-verification): HOLD maintained (finding + domain:spec-tooling unchanged). Re-checked @ origin/main a76a3af: both misaligned cells stand — zod-graph.ts still caps at depth > 12 (:109, :224) while check-liveness.mts allows 16 (line drift :239 → :274, now spelled if (!s || depth > 16)), and zodShapeOf still does not descend array element / record valueType (3-vs-1 walker split). Both cells fail closed (return null ⇒ root-graph ⇒ tombstone demanded), so answers remain conservative, not wrong. Restart unfired; pairs with #6221.

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


    Generated by Claude Code

  5. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    ContributorAuthor

    Findings cadence re-check @ origin/main 1530870: HOLD — finding stands.

    Premise live: the depth cap is still 12 at both walker sites (packages/spec/scripts/lib/zod-graph.ts:109 and :224), and no array-element / record-valueType descent has been added to zodShapeOf (consumed unchanged from build-schemas.ts:1002/:1020). Measurement-tooling accuracy only; pairs with #6221 (same file) for any future promotion.

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


    Generated by Claude Code

  6. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    ContributorAuthor

    Findings cadence re-check @ origin/main 4ed4160: HOLD — finding stands, premise frozen.

    Both cells re-verified unchanged: depth caps still 12/12 (zod-graph.ts:109, :224) vs 16 (check-liveness.mts:274) and 25/25 (metadata-authoring-lint.ts:90, reconciliation test :110); no descent into array element / record valueType in zodShapeOf (the :24 mention is the family docblock, not code); no commit has touched packages/spec/scripts/lib/zod-graph.ts since filing. Fail-closed protection intact — both cells still resolve to root-graph/null conservatism, no wrong artifact. Held because cell 1 needs its own #5056 measurement round (it moves the bridge table) and cell 2 alone is a micro-change the spec-tooling seat can fold into the next gen:schema-diffed pass; nothing user-facing waits on either.

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


    Generated by Claude Code

  7. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    ContributorAuthor

    Findings triage round, 2026-08-11 (maintainer-directed). Graded: hold — both remaining cells are fail-closed today (worst case: one extra tombstone demanded), and the array-element question is semantic, not mechanical — 3-vs-1 across the walker family with the ONE downward-walking implementation being the outlier. Restart: next walker-family card, or any measured wrong product from these cells.


    Generated by Claude Code

  8. hotlong commented on Aug 12, 2026

    @hotlong
    Contributor

    Findings-round disposition: hold carried (premise re-verified byte-exact: the 12/16/25/25 depth-cap spread across the four walkers stands, narrowest still on the gate-feeding walker; element/valueType descent still absent against a live zodShapeOf control; both cells still fail closed).

    Pack recorded — PACK-zodgraph = {#6221, #6232} — see the #6221 comment of this round for the shared acceptance criterion. Restart condition: any commit touches packages/spec/scripts/lib/zod-graph.ts — promote the pack then.

    本评论来自分诊座位(scheduled session session_01DLzE5XVRASxFotEU1h9cjH),不构成认领。


    Generated by Claude Code

  9. hotlong commented on Aug 12, 2026

    @hotlong
    Contributor

    Finding-grading round: closed, not planned (dissolving PACK-zodgraph = {#6221, #6232} together).

    Both cells fail closed (worst case: one extra tombstone demanded), zero wrong artifacts ever measured, zero consumer pull; zod-graph.ts untouched since 2026-08-07 across ~90 merges, and the pack's own restart condition never fired. The 8 comments here are almost entirely re-verification passes returning the identical verdict — the card now costs more in triage than the defect ever did. Pack acceptance criterion, carried on close: zodShapeOf does not descend array element / record valueType, and the walker depth caps are 12/16/25/25. Whoever next edits zod-graph.ts: a 3-line docblock note (getter non-memoized; cap spread; both fail-closed) is where this knowledge should live — that rider serves the cards' stated purpose better than keeping them open.


    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