Skip to content

门测量的重合度 bridge 有残余假可达面:整形状由共享叶子组成的「小形状」恒为 1.0,任何阈值都排不掉 #5828

Description

@baozhoutao

观察类发现,来自 #5056 的实测。今天没有任何真实 spec 形状命中,不影响用户;记录在案,免得后面某个批次把它当成新 bug 重新发现一次。

事实

#5056 把 derived-clone bridge 从「任意单属性命中」换成整形状重合度 ≥ 0.5,WidgetManifestSchema 的假可达因此被正确排除(2/19 = 0.105)。

但重合度的分母是候选形状自己的键数。于是一个键数很少、且每个键都是仓内共享叶子的形状,重合度恒为 1.0:

z.object({
  name:  SnakeCaseIdentifierSchema.describe('Machine name'),
  label: I18nLabelSchema.describe('Display label'),
})

实测 cloneOverlap = 1.0000,判定 derived-clone → 可达。而它跟任何活 schema 都没有派生关系,只是两个键碰巧都是被 .describe() 过的共享叶子(.describe() 复用接收者实例的 _zod.def,见 #5056)。

对照:同样两个共享叶子 + 3 个普通键 → 0.4000 → 正确判为不可达。所以命中条件是形状小,不是共享的绝对数量。

为什么阈值调不掉

(0, 1] 里没有哪个阈值能排除它:真·派生也会打到 1.0 —— 实测 ObjectListViewSchema.strip() 重合度就是 1.0000,且必须保持可达。两者在「重合度」这一个维度上不可分。要分开需要另一个判据(例如要求共享的属性里至少有一个是结构性节点而非叶子,或要求候选与基形状的键集双向覆盖),那是对仪器契约的改动,不该顺手塞进 #5056 的测试层 PR。

影响面(今天为零)

误差方向仍然只朝假可达一侧 —— 也就是仍然只可能让某个批次对死形状做收紧(#4583 的「precisely validated dead slot」)。触发需要:被测形状键数很少(约 ≤ 4),且几乎每个键都是共享叶子。

  • WidgetManifestSchema 19 键 → 0.105,不命中
  • 批 16 / 批 15 / 批 14 已测的形状均不命中

现状

已在 #5056 的 PR 里作为具名 pin 钉住(packages/spec/src/ui/door-reachability.testkit.test.ts,用例名以 KNOWN BOUND 开头),所以这条边界是被测量、被断言的,不是潜伏的。本 issue 只负责让后续批次在遇到小形状时知道该去读那条 pin。

建议给后续批次(17-22)的操作

测到一个 derived-clone 判定时,如果目标形状键数很少,先看 cloneOverlap 和键数,再决定信不信这扇门。

参考:#5056 · #4001 · #4583

Activity

  1. claude commented on Aug 6, 2026

    @claude
    Contributor

    发现分诊轮(#4949 纪律):持有(留 finding),域维持 domain:spec-tooling。⛔ 不晋级、不关闭 —— 三条理由与明确的重启条件如下。

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


    Generated by Claude Code

  2. claude commented on Aug 7, 2026

    @claude
    Contributor

    Findings triage round (#4949 discipline): HOLD maintained (finding kept), domain stays domain:spec-tooling. Stale-premise check @ origin/main 80f7dc6.

    • packages/spec/src/ui/door-reachability.testkit.test.ts — REST commit list since 2026-08-06T13:00Z is empty; the boundary is still carried by its named pin, :170 "KNOWN BOUND — a shape made ENTIRELY of shared leaves still bridges, whatever the threshold". So the hold stays cheap in the way the last grading described: this cannot silently disappear, and it cannot be rediscovered as a fresh bug by a later batch.
    • Restart condition ① not fired: no batch (17–22) has reported a derived-clone verdict on a small shape (≲ 4 keys) since the grading.
    • Restart condition ② not fired: the cloneOverlap denominator is still the candidate shape's own key count — nothing has rewritten that measure.
    • Restart condition ③ not fired: door measurement has not been retired.
    • ⚠️ These are REST-commits readings against main; the local checkout is shallow (50 commits) and its per-path git log reports the graft boundary as if it created every file (Operational notes 6).

    Verdict: HOLD

    Unchanged on both sides. Not promotable: the body already proves no threshold in (0, 1] separates the false-reachable small shape from a true derivation (ObjectListViewSchema.strip() measures 1.0000 as well and must stay reachable), so acting means introducing a second criterion — an instrument-contract change that cannot be priced until a real shape pulls it. Not closable: the error direction is false-reachable, whose consequence is a batch tightening a dead slot (#4583's precisely validated dead slot), and the trigger shape is not exotic.

    Operating instruction for batches 17–22 stands: on a derived-clone verdict against a small shape, read cloneOverlap and the key count first, and read the KNOWN BOUND pin, before trusting that door.

    本评论来自分诊座位 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): hold confirmed. The false-reachable face is real but no actual spec shape hits it (measured), and the body proves no threshold can exclude it — the fix requires a different discriminator, which is design work without a current victim. Restart: first real small-shape false positive in the gate's output.


    Generated by Claude Code

  4. os-zhuang commented on Aug 9, 2026

    @os-zhuang
    Contributor

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

    • The named pin still carries the boundary: door-reachability.testkit.test.ts still contains the KNOWN BOUND case (grep-verified), so the small-shape ⇒ overlap 1.0 face remains measured-and-asserted, not latent.
    • Neither restart condition has fired: no batch has reported a derived-clone verdict on a small (≲4-key) shape, and the cloneOverlap denominator is still the candidate's own key count.
    • The body's own proof stands: no threshold in (0, 1] separates this from true derivations (ObjectListViewSchema.strip() also scores 1.0), so the fix remains a new discriminator — design work with no current victim.

    Restart unchanged: first real small-shape false positive in the gate's output, or a rewrite of the overlap measure.

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


    Generated by Claude Code

  5. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    Contributor

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

    Premise re-verified on origin/main @ 2c28df9: cloneOverlap and its threshold semantics are live in packages/spec/src/ui/door-reachability.testkit.test.ts (:122–:130, including the strip() keeps the whole shape → 1.0 assertion this card is about). Still true that no real spec shape hits the small-shape/shared-leaf false-reachable face — observation-class, no user impact today. Held so a future measuring round doesn't rediscover it as new.

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


    Generated by Claude Code

  6. 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: the KNOWN BOUND named pin is still present in packages/spec/src/ui/door-reachability.testkit.test.ts, and the cloneOverlap assertions are live at :122–:130 (including strip() keeps the whole shape → 1.0). Neither restart has fired: no batch has reported a derived-clone verdict on a small (≲4-key) shape, and the overlap measure is unrewritten. Boundary remains measured-and-asserted, not latent.

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


    Generated by Claude Code

  7. claude commented on Aug 11, 2026

    @claude
    Contributor

    Findings round (quota re-verification): HOLD maintained (finding + domain:spec-tooling unchanged). Re-checked @ origin/main c546c89: the named pin is live at door-reachability.testkit.test.ts:193 ('KNOWN BOUND — a shape made ENTIRELY of shared leaves still bridges'), cloneOverlap assertions at :122-:130 incl. strip() keeps the whole shape → 1.0 at :130. Neither restart fired (no derived-clone verdict on a small shape reported; overlap measure unrewritten). Boundary stays measured-and-asserted; held.

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


    Generated by Claude Code

  8. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

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

    The boundary is still measured-and-pinned, not latent: the named pin is live at door-reachability.testkit.test.ts:193 ("KNOWN BOUND — a shape made ENTIRELY of shared leaves still bridges, whatever the threshold"), and the file is untouched since filing. Error direction remains false-reachable only (worst case: a batch over-tightens a dead slot), zero real spec shapes hit the ≤4-keys-all-shared-leaves profile, and the card's purpose is advisory to future measurement batches — which the pin plus this record serve as-is. A second discriminating criterion (structural-node requirement / bidirectional key coverage) stays an instrument-contract change wanting its own measured pass; no pull for it has appeared. Restart condition unchanged: promote if any real batch 17+ shape trips the profile, or when the reachability instrument is next revised.

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


    Generated by Claude Code

  9. os-zhuang commented on Aug 11, 2026

    @os-zhuang
    Contributor

    Findings triage round, 2026-08-11 (maintainer-directed). Graded: hold — zero real spec shapes hit the small-shape 1.0-overlap face, and the card proves no threshold can separate it (a second criterion is an instrument-contract change). Error direction remains false-reachable only, i.e. extra caution, not missed coverage. Restart: a real shape hits it, or the reachability instrument is next revised.


    Generated by Claude Code

  10. hotlong commented on Aug 12, 2026

    @hotlong
    Contributor

    Finding-grading round: closed, not planned — superseded as a carrier by the pin it already owns.

    The KNOWN BOUND case (door-reachability.testkit.test.ts:193) durably records that a shape made entirely of shared leaves bridges at any threshold; the card's own body proves no threshold fix exists, so it is unactionable by construction, and the strictness-batch consumer has since run more batches (through 08-10) without hitting it. Re-open only if a batch reports a derived-clone verdict on a ≲4-key shape or the cloneOverlap denominator is redefined — the executable pin is the live record.


    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