Skip to content

refactor(file): the unasserted claim is AnyKind, so its concrete type can be anyKind - #651

Merged
David-Noble-at-work merged 1 commit into
developfrom
any-kind-rename
Aug 24, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
any-kind-rename

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Renames the unasserted file claim from Any to AnyKind, so its concrete type under #625 can be
anyKind.

Closes #650.

Why rename rather than pick a different struct name

any is a predeclared alias, not a keyword — made an alias in Go 1.18 precisely so pre-existing
identifiers named any kept compiling. So type any struct{…} in package file compiles. It
silently rebinds all 139 bare any occurrences in the package, including DiscoverAny(…, value any),
Equal(other any), ConvertFrom(value any) (any, error), and UnmarshalYAML(unmarshal func(any) error).
Not a diagnostic — a change of meaning that surfaces as errors somewhere else.

Renaming the exported type fixes it at the source, and the new name states the variant's assertion — a
kind, any kind
— instead of borrowing Go's word for the empty interface.

Scope

Any → AnyKind, DiscoverAny → DiscoverAnyKind, anyAt → anyKindAt; sources renamed to
any_kind*.go; gen/any.gen.go regenerated as gen/any_kind.gen.go; the existenceVerifiableTypes
type-id string; the live .star assertion in test_judgment_interface_slot_mints.star — which is worth
noting on its own, because it proves the Go type name is observable from Starlark.

Prose was separated from identifiers by hand. Any appears as an English word in eight Go comments
(**Any kind moves.**, Any existing file is archived, …). All 75 occurrences were enumerated and
classified rather than swept with a pattern.

Completed plans keep their prose. any-entry-claims.md and resource-construction.md carry a rename
note at the top instead of being retconned; the living design docs are renamed in place.

Unchanged, deliberately: the authoring token kind="any" and the enum constant ResourceKindAny.
Those name the kind axis, not the claim variant.

Serialization

The unasserted claim's URI fragment moves from …/file.Any to …/file.AnyKind. Greenfield, so there is
no legacy to break, but it is a document change and is recorded as such.

Gate

make build 0 · make test 103 ok / 0 fail · make test-scenario PASS · make vet clean under darwin,
windows, and linux · gofmt -l clean.

make check's lint stage fails locally on two typecheck errors inside Go 1.27's own standard library
(crypto/internal/randutil cannot import math/rand/v2) — a golangci-lint/toolchain mismatch unrelated
to this change. CI's quality-gate is the authority and passed on #648 against the same toolchain.

@David-Noble-at-work David-Noble-at-work self-assigned this Aug 24, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 7a8f123 into develop Aug 24, 2026
8 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the any-kind-rename branch August 24, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file.Any's unexported struct cannot be named 'any' — it shadows the predeclared identifier

1 participant