Skip to content

feat(primitives): build canonical IID atom anchors - #21

Merged
kamescg merged 1 commit into
update/v1.1.0-alphafrom
feat/primitives-iid-anchor
Aug 10, 2026
Merged

feat(primitives): build canonical IID atom anchors#21
kamescg merged 1 commit into
update/v1.1.0-alphafrom
feat/primitives-iid-anchor

Conversation

@kamescg

@kamescg kamescg commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

P05 of the iid-v1.1.0-alpha release train — the semantic lane's capstone. buildIidAnchor is the single supported high-level builder from classification field values to canonical, identifier-first atom bytes, completing the derive → classify → build → hash pipeline across iid-speciidclassificationsiid-registryprimitives.

Behavior

  • Interprets the classification's declarative ladder via the @0xintuition/iid engine (strongest rung that fires wins; same-as selection is order-independent).
  • Profile selection is the strongest legal profile: 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 at p1, a deterministic JSON payload (frozen key order: @context, @type, identifier, then recipe fields sorted) carrying the gen1 preimage evidence. Requesting p0 for an ineligible identifier is a structured error, never a silent downgrade.
  • URI context manifest: ordered, trimmed, exact-deduplicated; validated against offline policy limits (5 entries × 700 bytes) or caller-supplied live getAtomUriConfig values. URI context never changes atom bytes or the atom ID (tested).
  • Returns registry classification, ordered provider capability plan, dataHex, and the deterministic atom ID.
  • Pure and offline: no wallets, contracts, provider fetches, config reads, or duplicate checks.
  • recognizeAtomData distinguishes iid-anchor / json-object / invalid — only fully valid canonical IIDs count as anchors (non-canonical and unknown-scheme strings stay invalid); isValidAtomData now accepts canonical IID anchors.

Package impact

Package Change
@0xintuition/primitives 0.1.0-alpha.1 (target already carried since P03); new ./anchor subpath; new exact deps iid@0.1.0-alpha.0, iid-registry@0.1.0-alpha.0
all other packages none

Target versions

primitives@0.1.0-alpha.1 with exact internal pins: classifications 0.1.0-alpha.1, ids/predicates 0.1.0-alpha.0, iid/iid-registry 0.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:USRC17607839dataHex 0x696e743a697372633a555352433137363037383339, atom ID 0xd3368a…acab8d8, generated from the shipped @0xintuition/ids and 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

  • Gate results: golden P0 ISRC yields exact bytes and atom ID; Class C/polymorphic cannot emit bare P0; URI changes never change the atom ID; reordered equivalent input is deterministic; legacy snapshots stable; 140 primitives tests, full turbo suite (22 tasks), and the 13-package clean-room smoke all pass.
  • This completes the semantic lane (P01–P05). The contract lane (P06–P09) is next: P06 stays draft until contracts-v2@1.1.0-alpha.0 passes the 14-day release-age policy on 2026-08-18.

🤖 Generated with Claude Code

- 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>
@kamescg kamescg mentioned this pull request Aug 10, 2026
13 tasks
@kamescg
kamescg merged commit 6a484dc into update/v1.1.0-alpha Aug 10, 2026
1 check passed
@kamescg
kamescg deleted the feat/primitives-iid-anchor branch August 10, 2026 20:16
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.

1 participant