Repository navigation
feat(iid, iid-spec): typed Wikidata identity int:wd:<slug>:Q… — spec amendment and reference implementation (P16) - #28
Open
jonathanprozzi wants to merge 3 commits into
Open
jonathanprozzi wants to merge 3 commits into
jonathanprozzi wants to merge 3 commits into
Conversation
…c amendment and reference implementation (P16) Ports intuition-v2's typed-wd identity onto the release train as one unit, because the iid conformance test executes the iid-spec vectors. iid-spec - schemes/wd.md: value grammar `^(?:<slug>:)?Q[1-9]\d*$`, ordered canonicalization for typed forms, value-typed scheme typing (bare polymorphic; typed with an active EntitySchema binding unambiguous and P0-eligible; dormant binding valid but not mintable), the closed binding table with pinned revisions, typed vectors, ladder-rung note - spec/07 §7.3: value-typed schemes defined; wd rows split bare/typed - spec/09 §9.3.1: additive value-grammar extensions (in-place MINOR ratification under four conditions); wd is the first instance - conformance: value-typed corpus support (`valueTyped` on scheme entries, optional per-vector `typing`, validator effective-typing guards); 18 new wd vectors; all 145 base vectors unchanged apart from one note; scheme typing entries unchanged - README / schemes README updated iid - wd-entityschema-bindings.ts: the 11 pinned bindings (film, television-series, human active), deep-frozen table/rows/anchorQids, frozen slug list, membership guards - schemes.ts: typed-aware wd canonicalizer (URL forms never infer a slug, ASCII slug lowercased and must be registered, QID uppercased); the ratified whitespace trim is kept for every form; SCHEME_TYPING.wd stays polymorphic - types.ts: `wdSlug` on the declarative scheme rung, `dormant-wd-binding` ineligibility reason, `wdSlug` on the valid inspection branch - parse.ts: per-value inspection for typed wd (active → unambiguous and eligible; dormant → ineligible) - derive.ts: typed derivation on the declarative engine (active slug only, same-slug check, bare-prefixing, length bound); slugless wd rungs keep minting bare values and bare values only - index.ts exports; README section; tests re-expressed against declarative ladders, fence test replaced by a positive export test Ruled: R1 (typed-wd canonical for the packages). Default-in-effect, pending ratification: R17 (§9.3.1), D-P16-1..5. No version or dependency changes; the version freeze is a separate commit. Gates: iid-spec 163 vectors; iid 263 tests, typecheck, check, build; iid-registry 42, iid-ladder 12, classifications 38, primitives 140 against the rebuilt dist; pack dry run. Review: round 1 pair found three real issues (trim regression, typed values minting through slugless rungs, mutable bindings table), fixed; round-2 combined re-review found no new defect.
…003bc1 — music identity policy, podcast feed-URL normalization, ISNI URL form (P16 refresh) Second commit on the typed-wd PR: this week's reference changes, folded into the open PR per JP (10/3) instead of a follow-up. iid - music-identity-policy.ts (new, verbatim): MUSIC_IDENTITY_RUNG_POLICY (artist → MusicGroup: isni, mbid:artist, wd, spotify:artist; music-album → MusicAlbum: mbid:release-group, wd, spotify:album) and isPlainWdPrimaryAllowed(schemaType). The iid-ladder refresh consumes it for policy-gated plain-QID primaries (R23). - uuid5.ts: normalizePodcastFeedUrl (folds scheme/host case, strips the scheme and trailing slashes, preserves userinfo, port, path and query bytes). derivePodcastGuid unchanged. - schemes.ts: the ISNI canonicalizer also accepts the https://isni.org/isni/<id> URL form (with or without www., host case-insensitive), stripping it to the bare form before the existing canonicalization. Every existing canonical output is byte-identical. - index.ts exports; README section; two new tests (feed normalization preserves bytes; isni.org evidence canonicalizes, wrong hosts and checksums rejected). iid-spec (R24) - schemes/isni.md: accepted input forms note; the URL form is an additive value-grammar extension under §9.3.1 (previously invalid input becomes valid, canonical bytes unchanged), provenance intuition-v2 develop @ 83a003bc1. - conformance: four additive ISNI vectors (canonicalization, validation); no existing vector changed. Corpus: 167 vectors. Typed-wd itself is unchanged: SCHEME_TYPING, the bindings table, parse.ts and derive.ts are untouched. No version or dependency changes. Gates: iid-spec corpus 167 vectors OK; iid 270 tests, typecheck, check, build; iid-ladder 12, iid-registry 42, classifications 38, primitives 140 against the rebuilt dist; pack dry run.
…ely as a whole, including the /isni/ path (P16 refresh review) The adversarial review of the refresh found the spec note narrower than the ported canonicalizer: the regex's case-insensitive flag folds the whole prefix, so `https://isni.org/ISNI/<id>` is accepted, exactly as the reference implementation accepts it. No behavior change on the train; the scheme doc now states the whole-prefix fold, the corpus gains a vector for the upper-case path form (168 vectors), and the schemes test asserts it (iid 271 tests).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Child PR of the v1.1.0-alpha umbrella (#15). Tracking: ENG-15883. First of three stacked typed-wd PRs (this → iid-ladder → iid-registry).
Current (train)
The
wdscheme is bare:int:wd:Q42, polymorphic at scheme level, never anchor-eligible, with no notion of what kind of thing a QID names.Need
The reference implementation (intuition-v2
feat/intuition-app@ 1b877506d) types the value:int:wd:<slug>:Q…, where the slug is one of eleven pinned Wikidata EntitySchema bindings (three active:film,television-series,human). A typed value with an active binding is unambiguous and anchor-eligible; a dormant binding is valid but not mintable; bare values are unchanged. Ruled canonical for the packages.Reconciliation
One unit, because the iid conformance test executes the iid-spec vectors.
schemes/wd.md(grammar^(?:<slug>:)?Q[1-9]\d*$, ordered canonicalization, value-typed typing, the closed binding table with pinned revisions, vectors); spec §7.3 defines value-typed schemes; spec §9.3.1 adds the additive value-grammar extension clause; the conformance corpus gainsvalueTypedon scheme entries and optional per-vectortyping; 18 new wd vectors, all 145 base vectors unchanged apart from one note.wdSlugon the valid branch,dormant-wd-bindingineligibility reason); typed derivation on the train's declarative ladder engine (the reference's callback engine is not ported);SCHEME_TYPING.wdstays polymorphic.Defaults in effect, for ratification in this review
human:Q42) cannot mint through a rung that declares no slug. The classifications package has 13 generated ladders with slugless rungs; refusing them now would silently drop a rung from each. Flips with the classifications follow-on.Surfaced, pre-existing, not changed here
Weak account handles (
int:acct:x:@jack): the ratified spec says both forms are anchor-eligible; the reference floors the weak form. Outside typed-wd; to be reconciled when the app swaps to this package.Evidence
Review notes
CI shows the base branch's expired supply-chain exception until the CI-fix child PR merges; this branch is rebased after that. Merge before the iid-ladder PR.
Update 2026-10-03: this week's reference changes folded in
The reference moved to
develop(the feature branch was consolidated intomainon 9/24). Per the maintainers' call, this week'siidchanges (throughdevelop@ 83a003bc1) are folded into this PR as a second commit rather than a follow-up.MUSIC_IDENTITY_RUNG_POLICY,isPlainWdPrimaryAllowed): verbatim data and predicate. Nothing iniidmints on them; the ladder PR consumes them for policy-gated plain-QID primaries (see feat(iid-ladder): typed-wd ladder policy, category rungs, rung aliases and pinned P31 closure (P16b) #29).normalizePodcastFeedUrl: folds scheme and host case, strips the scheme and trailing slashes, preserves userinfo, port, path and query bytes.derivePodcastGuidis unchanged.https://isni.org/isni/<id>(with or withoutwww., host case-insensitive), stripping it to the bare form before the existing canonicalization. Every existing canonical output is byte-identical. Recorded in the spec's ISNI scheme doc as an additive value-grammar extension under §9.3.1, with four additive conformance vectors. For ratification in this review.SCHEME_TYPING, the bindings table,parse.tsandderive.tshave no diff./isni/path, as the reference does), fixed by aligning the note, adding a vector and a test; round 2 clean on both gates.