feat(primitives): build canonical IID atom anchors - #21
Merged
Conversation
- Add buildIidAnchor, the supported high-level path from a classification's field values to on-chain-ready atom bytes: interprets the declarative identity ladder through @0xintuition/iid, selects the strongest legal representation profile (P0 when anchor-eligible, otherwise a deterministic P1 payload with frozen key order carrying @type, identifier, and the fired recipe's fields), computes the atom ID through @0xintuition/ids, and returns the registry's classification and ordered provider plan. - Class C and polymorphic-scheme identifiers floor at P1; requesting p0 for them is a structured error, never a silent downgrade. - Add ordered, trimmed, exact-deduplicated URI-context manifest construction with offline policy limits (5 x 700 bytes) and optional caller-supplied live limits; URI context never changes atom bytes or atom ID. - Add recognizeAtomData: classifies canonical IID anchors vs JSON payloads without reclassifying arbitrary strings; isValidAtomData now accepts valid canonical IID anchors as atom data. - Add exact deps @0xintuition/iid@0.1.0-alpha.0 and @0xintuition/iid-registry@0.1.0-alpha.0, the ./anchor subpath export, README section, and 10 anchor tests including the golden P0 ISRC byte/ID fixture (140 primitives tests total). - Legacy JSON-LD builders unchanged; all existing snapshots stable. Identity impact: none — existing golden bytes unchanged; new golden P0 ISRC fixture values generated from the shipped ids package and pinned in tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
P05 of the iid-v1.1.0-alpha release train — the semantic lane's capstone.
buildIidAnchoris the single supported high-level builder from classification field values to canonical, identifier-first atom bytes, completing the derive → classify → build → hash pipeline acrossiid-spec→iid→classifications→iid-registry→primitives.Behavior
@0xintuition/iidengine (strongest rung that fires wins;same-asselection is order-independent).p0(bare IID — atom ID is a pure function of the identifier, protocol-level dedupe) only for Class A/B unambiguously-typed identifiers; Class C and polymorphic schemes floor atp1, a deterministic JSON payload (frozen key order:@context,@type,identifier, then recipe fields sorted) carrying the gen1 preimage evidence. Requestingp0for an ineligible identifier is a structured error, never a silent downgrade.getAtomUriConfigvalues. URI context never changes atom bytes or the atom ID (tested).dataHex, and the deterministic atom ID.recognizeAtomDatadistinguishesiid-anchor/json-object/invalid— only fully valid canonical IIDs count as anchors (non-canonical and unknown-scheme strings stay invalid);isValidAtomDatanow accepts canonical IID anchors.Package impact
@0xintuition/primitives0.1.0-alpha.1(target already carried since P03); new./anchorsubpath; new exact depsiid@0.1.0-alpha.0,iid-registry@0.1.0-alpha.0Target versions
primitives@0.1.0-alpha.1with exact internal pins: classifications0.1.0-alpha.1, ids/predicates0.1.0-alpha.0, iid/iid-registry0.1.0-alpha.0.Identity impact
Identity impact: none — existing golden bytes unchanged. Legacy JSON-LD builder outputs are byte-identical (all existing snapshots pass). New golden fixture: P0 ISRC
int:isrc:USRC17607839→dataHex 0x696e743a697372633a555352433137363037383339, atom ID0xd3368a…acab8d8, generated from the shipped@0xintuition/idsand pinned in tests.Fixture impact
New anchor test fixtures (golden P0 ISRC, Class C floor, polymorphic rejection, URI invariance/ordering/limits, deterministic reordering). No existing fixtures change.
Contract artifact
n/a
Rollout notes
contracts-v2@1.1.0-alpha.0passes the 14-day release-age policy on 2026-08-18.🤖 Generated with Claude Code