镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

#90 residual: records separable only through broken-typed fields collide → order-dependent counter; hash couples to typeToString text #141

Open

Description

@jagguji

Follow-up to #90 (PR #140), from the PR review. Low severity — the primary #90 goal (no churn across compiler versions / unrelated edits) holds for the general case and is verified byte-identical on TS 5.9 → 6.0.3.

Residual 1 — under-discrimination of broken-typed fields

structuralSig normalizes every unknown/any/opaque/review field to the same token, so two DISTINCT records separable only through broken-typed fields hash identically and fall back to an order-dependent counter (…2) — a narrow slice of the churn #90 targets.

Residual 2 — hash couples to typeToString

The t.text discriminator is TS's typeToString output, which is version-sensitive (e.g. intersection-member order {a}&{b} vs {b}&{a} could canonicalize on a major bump). Verified stable across 5.9 → 6.0.3, but latent risk for names distinguishable ONLY by broken-field text.

Proper fix (deferred — bigger/riskier)

Merge entries whose FULL structuralSig is genuinely identical (they're structurally interchangeable → one name, refs redirect). Needs care around the add-only seen diamond-collapse (Rcyc), which could otherwise make two genuinely-different entries look equal → unsound merge. Would fix both base-ui and blend and drop the counters entirely.

Meanwhile

Counters here are STABLE across the 5.9 → 6.0.3 transition (deterministic sort), so no active churn today; this tracks closing the residual properly.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions