Repository navigation
fix(iid): skip a Wikidata rung without an active slug in the declarative engine, as the reference does (P16i) - #43
Merged
kamescg merged 2 commits intoOct 20, 2026
Conversation
…ive engine, as the reference does (P16i)
…f surfacing the polymorphic P0 refusal (P16i)
kamescg
added a commit
that referenced
this pull request
Oct 20, 2026
…to PR #15 # Conflicts: # conformance/README.md # conformance/known-divergences.ts
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.
Important
@kamescg — review ready. Stacked on #39 (
codex/p16d-classifications-parity); review after #39 and retarget as #39 and #36 land.To ratify here: the declarative engine no longer mints a bare
int:wd:Q…on a Wikidata rung that has no active slug. The reference engine skips such a rung and tries the next one; the train minted on it under design notes D-P16-1 and D-P16-5, which this PR withdraws. Identity-affecting in the safe direction: brand, event, local-business, location, music-group and thing stop producing bare Wikidata identifiers that the reference never produced.Coordination: the engine change is confined to
packages/iid/src/derive.ts;iid-ladder(the provider ladder,allowPlainWd) is untouched. Independent of #40, #41 and #42 apart from one primitives test expectation.Receipt: 39 ledger entries retired (ladder proof 451 agreements / 3 divergences; harness 804 / 31); harness 1027 pass / 0 fail; iid 318 tests.
Child PR of the v1.1.0-alpha umbrella (#15). Part of the parity series: each PR in the series makes a train package behave exactly as the reference implementation's in-tree copy does today, so the published packages can replace those copies without a behaviour change.
Current (train)
The declarative identity engine in
@0xintuition/iidminted a bare Wikidata identifier (int:wd:Q…) on awdrung that has no slug, under the "legacy bare minting" design notes D-P16-1 and D-P16-5. The reference engine skips such a rung (and any rung whose slug names no active binding) and tries the next one. Six classifications carry slugless Wikidata rungs: brand, event, local-business, location, music-group and thing. For them, an input with only a Wikidata id produced an identifier on the train and none (or the next rung's) on the reference; the conformance ledger carried 39 entries for exactly this.Need
The engine's rung-skip condition equal to the reference's, the design notes withdrawn, and the ledger moved to match.
Reconciliation
src/derive.ts: thewdscheme-rung branch skips whenwdSlugis undefined or names no active binding, ported from the reference's condition. Active slugs still prefix bare QIDs and retain matching typed values; conflicting or invalid typed values are still skipped. The provider ladder iniid-ladderis untouched.iid,classifications) drop the legacy-minting row and record the withdrawal of D-P16-1 and D-P16-5.src/__tests__/slugless-wd-cases.tscover the six classifications × seven input shapes (bare QID URL insameAs, bare QID string, lowercase entity path, two values forward and reversed, set minimum, no fallback data), each expected output reproduced offline from the reference engine and the reference ladders. Three existing bare-minting tests now assert the skip; the two synthetic film-rung tests declare an active slug so they keep testing set-minimum selection. Restoring the bare-minting branch in memory turns all 42 red. Oneprimitivesexpectation changes: the brand bare-P0 case now fails with "No identity rung fired" because the slugless rung never reaches the profile check.ladder:*entries for brand, event, local-business, location, music-group and thing (a barescheme:wdrung) now agree with the unchanged oracle and are retired; no expected fingerprint, vector or oracle expectation changed; 31 entries remain. The README enumeration is regenerated: 804 agreements / 31 divergences across the five proof files; ladder proof 451 / 3.Parity
Matches the reference implementation's engine (
derive.ts, the Wikidata rung branch) on every harness vector for the six classifications. The identity-affecting consequence is in the safe direction: the published engine stops minting bare Wikidata identifiers where the reference never did.Held out
Evidence
iid: typecheck, 318 tests, biome, build.classifications257,iid-ladder139,iid-registry49,primitives140 tests, each with typecheck and biome.bun test conformance1027 pass / 0 fail (the README-accounting integrity test passes); biome onconformance;registry:check14 packages;guard:supply-chain;pack:dry-run.trim()and the reference trims ASCII whitespace only. That difference predates this change, is unchanged by it, and is a standing ruling of the typed-Wikidata work, so it stays as documented.Review notes
filmslug, and the dormant slugs on book, company and music-album, whose 20 matching ledger entries feat(classifications, iid): bring the catalogue, ladders and helpers to parity with the reference implementation and derive one podcast GUID per feed (P16d) #39 already retires by data.primitivesstays in place; after this change no ladder in the catalogue can reach it with a bare polymorphic identifier, so its brand test asserts the no-rung refusal instead.