@0xintuition/iid-ladder
What it's for
The projection ladder selects a primary IID from supplied strong identifiers, provider handles, and canonical URLs. If nothing usable is available, it returns an explicit envelope fallback with a null IID.
When to use it
Use it before atom construction when imports contain several candidate identifiers. The selection order is strong identifier → registered provider handle → canonical URL → envelope fallback. It does not search by name, prove a unique entity match, serialize atom bytes, record aliases, or fetch provider metadata.
Install
npm install @0xintuition/iid-ladder@0.1.1
Use ESM import or CommonJS require() on Node 20+. Public subpaths work in both formats. See installation and peer setup and the runtime compatibility limits.
Entry points
| Subpath | Purpose |
|---|---|
. | Identifier projection, category ordering, matching aliases, bound policy creation, and pinned Wikidata classification helpers. |
Depends on and works with
Runtime dependencies: @0xintuition/iid.
Published peers: none.
Example
import { projectIdentifierLadder } from '@0xintuition/iid-ladder';
const selection = projectIdentifierLadder({
strongIdentifiers: { isrc: 'US-RC1-76-07839' },
canonicalUrl: 'https://example.com/recording',
});
if (selection.iid === null) {
console.log({ needsIdentityEvidence: true, reason: selection.reason });
} else {
console.log({ iid: selection.iid, selectedFrom: selection.rung });
}
const noIdentifier = projectIdentifierLadder({});
console.log(noIdentifier);
The supplied strong ISRC wins over the URL. Empty input returns iid: null; inspect reason and collect more evidence or use an explicit envelope. A name-only recipe belongs to the declarative IID engine and a classification ladder; identical names can describe different entities.
strongIdentifierOrder is an allowlist as well as an order. Category policies distinguish primary identities from aliases used only for matching. Default providerLocalHandles: 'reject' leaves unregistered provider namespaces as fallbacks. The optional 'mint' policy preserves application-local historical strings; it does not make them canonical registered IIDs or P0-eligible. Package-specific identifier additions are disclosed on the specification page.
Related concepts
See also Primitives.
Source
Package README at the pinned release.
Canonical identity ladders · Canonical gen1 derivation · Projection implementation.
Applies to V2 · @0xintuition/iid-ladder 0.1.1