Repository navigation
feat(primitives): accept a candidate IID on the anchor builder, export the reference's validators and the buildAtomAnchor name (P05c) - #42
Merged
Conversation
… to parity with the reference implementation (P16d) Application code imports helpers and data from the classifications package that the train lacked, and the train's spec data had drifted from the reference since August. This ports all of it onto the train's declarative spec shape. - Helpers: getClassificationLabel, getClassificationByType, getClassificationByReference (plus the reference resolver tiers), deriveClassificationIdentifier, buildClassificationSearchText, visibility presets incl. PRIMARY_ITEM_CATALOGUE_PRESET, native atom types, identity field aliases, DISCOVER_ACTIVITY_GROUPS; all exported from the package root. - Spec shape: optional typed commonName and atomCategory fields (the reference's label and engine category); every spec populates atomCategory. schema, metadataPredicates, inline identity and the creation-profile shape stay canonical. - Identity data: every rung order, wdSlug, recipe and identifies value audited against the reference for all 37 classifications; podcast GUID derived through normalizePodcastFeedUrl; person accepts a mononym (familyName optional) as the reference does. - Schema contexts: four specs move to the reference's context values (ethereum-account and ethereum-smart-contract to https://schemas.intuition.systems/v1, social-media-account and one more to the reference value); no spec references schema.intuition.systems any more. Creation profiles regenerated through the repo generator. - Tests: 256 pass, including inline parity oracles for labels, ladders and the catalogue (rung tokens, schema type and context per type) built from the reference data at authoring time; all 67 reference test cases present. Six ladders still carry slugless wd rungs (brand, local-business, location, event, thing, music-group); the ladder already refuses bare wd minting unless the plain-wd policy allows it, matching the reference.
…ta (P16d) The classification parity port changed data the primitives tests pinned: the Ethereum classifications' JSON-LD context is now the reference value, a person accepts a mononym (familyName optional, givenName required), and the movie ladder carries an active typed wd binding so it no longer serves as the polymorphic bare-P0 example (brand does). Eight expectations updated; 140 tests pass.
…interpreter so every entry point derives one GUID (P16d fix round)
…lassification data resolves (P16d ledger round)
…ference, including the no-identifier fallback envelope (P05b)
…, now that the builder returns no-identifier envelopes (P05b)
…eeing person ISNI anchor (P05b)
…t the reference's validators and the buildAtomAnchor name (P05c)
… the public builder instead of holding them OPEN (P05c)
…lity alone, as the reference does (P05c fix round)
kamescg
changed the base branch from
codex/p05b-anchor-builder-parity
to
update/v1.1.0-alpha
October 20, 2026 16:22
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 #41 (
codex/p05b-anchor-builder-parity); review after #41 and retarget as #41, #39 and #36 land.To ratify here: the public anchor builder now accepts a caller-supplied candidate IID (
options.candidateIid), validates it exactly as the reference does (scheme registered, value canonical, URL-class values under the 220-character cap) and uses it in place of ladder derivation. The reference's validators are exported (validateCandidateAnchorIid,validateDerivedAnchorIid,isOverCapUrlIid) andbuildAtomAnchoris exported as the reference's name forbuildIidAnchor, so the in-tree callers that pass a candidate IID (create-flow preview, canonical page, classification plugin, seed projection) can switch to the package without a behaviour change.Coordination: this PR, #40 and #41 all touch
packages/primitives/src/anchor.tsandtypes.ts; land it last of the three.Receipt: the 23 anchor cases the harness held OPEN now run against the public builder: anchor proof 75 agreements / 6 divergences / 0 OPEN; harness 1050 pass / 0 fail / 0 todo; primitives 229 tests; classifications 257.
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 reference implementation's shipped callers anchor with a candidate identifier:
buildAtomAnchor(slug, values, { candidateIid }), where the candidate comes from the provider ladder. The train's builder,buildIidAnchorin@0xintuition/primitives, had no candidate option, did not export the two validators the reference exposes (validateDerivedAnchorIid,isOverCapUrlIid), and carried a different name. The conformance harness held 23 anchor cases OPEN for exactly this reason.Need
The candidate path with the reference's validation and bytes, the validators public, and the reference's helper name available, so a consumer switching from the in-tree copy changes only the package path.
Reconciliation
src/anchor.ts:options.candidateIid. Validation follows the reference: the candidate must be a valid IID; a typed Wikidata candidate must carry an active binding and belong to the classification; a weak account handle is excluded from P0; an over-cap canonical URL candidate is rejected; there is no general scheme-membership check beyond those (the reference has none). Serialization follows the reference: an anchor-eligible candidate serializes as bare P0 bytes; any other candidate uses the validated values envelope withidentifierimmediately after@typeand declared string arrays normalized.p0when anchor-eligible, otherwisep1);options.profileis not consulted on this path, so a candidate always yields the atom the reference mints for it.AtomAnchorError, codeINVALID_IID, same message).buildAtomAnchoris exported as the same function object asbuildIidAnchor; the README documents the option, the validators and the alias.support/proofs.tspasses the candidate option through to the public builder, drops the OPEN markers and compares the validator results in full. The 23 cases now run and all agree; no ledger entry added.Parity
Matches the reference implementation's candidate path (
atom-anchor.ts:buildCandidateAnchor,validateCandidateAnchorIid,validateDerivedAnchorIid,isOverCapUrlIid) on every harness vector and on the reference's own fixtures, whichsrc/__tests__/anchor-candidate.test.tspins literally. The one intended difference is error delivery (structured result instead of a throw) for the builder; the validators throw as the reference does.Held out
Evidence
packages/primitives: typecheck, lint and build green; 229 tests (37 new candidate and validator cases, red-first, plus the 52 parity pins unchanged and the pre-existing suite).registry:check(14 packages),guard:supply-chain,pack:dry-runpass.profileoption override the reference's eligibility-based choice, so a caller could mint different bytes (and a different atom id) than the reference would for the same candidate. The third commit makes the candidate path select the profile from eligibility alone, as the reference'sbuildCandidateAnchordoes, documents it in the options type and the README, and pins both reproductions (eligible ISBN requested as P1 → bare P0 bytes and the reference's atom id; ineligible TMDB requested as P0 → the reference's P1 envelope). The combined re-review confirms the difference resolved with no new finding; the derived path'sprofilehandling is unchanged.Review notes
Base
codex/p05b-anchor-builder-parity(#41), on #39, on #36; retarget as those land. Readsrc/anchor.tscandidate branch against the reference'satom-anchor.ts, then the harness adapter inconformance/support/proofs.ts. The judgement call is the structured error return for a rejected candidate; it is in effect by default and open to ratification here.