Repository navigation
feat(primitives): bring the anchor builder to byte parity with the reference implementation, including the no-identifier fallback envelope (P05b) - #41
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)
This was referenced Oct 19, 2026
jonathanprozzi
marked this pull request as ready for review
October 19, 2026 20:40
kamescg
changed the base branch from
codex/p16d-classifications-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 #39 (
codex/p16d-classifications-parity); review after #39 and retarget as #39 and #36 land.To ratify here: the no-identifier fallback envelope. The reference builds a validated P1 envelope with no identifier when no rung fires, the ladder is null, or a canonical URL exceeds 220 characters; the train used to refuse it. The anchor result's
iid,schemeandclassare therefore nullable and consumers must narrow.Coordination: this PR and #40 both touch
packages/primitives/src/types.ts(whichever lands second takesIdentityClass | null). One harness line changed: encode proofs register identified anchors only.Receipt: byte parity on all 52 agreeing anchor vectors; 19 ledger entries retired (anchor proof now 52 agreements / 6 divergences / 23 OPEN); harness 1027 pass / 0 fail.
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)
@0xintuition/primitivesbuilt identity anchors whose bytes differed from the reference's for the same input in several families: raw evidence was normalized before hashing, derived recipe values (geohash, year, hashed text) were not materialized under the recipe key,sameAswas dropped from identity envelopes or kept unsorted, descriptive fields leaked into scheme envelopes, and a classification with no identifier at all was refused where the reference builds a P1 fallback envelope. The conformance harness recorded 26 anchor divergences for these.Need
Byte parity of every anchor vector with the reference builder, the no-identifier fallback envelope as the reference builds it, and the conformance ledger moved to match.
Reconciliation
src/anchor.tsandsrc/types.ts:sameAsas the last identity field: strings verbatim, exact-deduplicated, default-sorted, omitted when empty or not an array.platform:@handleform emits P1, the strong form keeps P0 (consistent with feat(iid, iid-spec): floor weak account handles below anchor eligibility, with the spec amendment and conformance rule (P16g) #35).int:url:value over 220 characters produces a validated P1 envelope without identifier;iid,schemeandclassarenullon that result, so consumers that assume every successful anchor carries an IID must narrow. Unknown, missing or invalid fields still fail.support/proofs.tsregisters encode proofs for identified anchors only, since a no-identifier envelope has no URI to encode (the encode inventory pinned in the manifest is unchanged).Parity
Matches the reference implementation's anchor builder byte for byte on all 52 agreeing vectors (
src/__tests__/anchor-parity.test.tspins every one: JSON, hex, atom id, IID or null, profile). The six remaining anchor divergences are the cases where the reference is expected to adopt the train's field order; they are documented in the ledger, not changed here. The primitives README now describes the reproducible canonicalization and hashing; the IID spec should carry that as a section in a later cut.Held out
src/types.tsalso changes in feat(iid-spec, iid, iid-ladder, iid-registry): register provider-local identifiers as class D with the reference's grammar, typing and P1 floor (P16f) #40 (the class union widens to include class D); whichever lands second takesIdentityClass | null.Evidence
packages/primitives: typecheck, lint and build green; 192 tests (the 52 literal parity pins, 19 red-first regressions that failed before the builder change, and the pre-existing suite).registry:check(14 packages),guard:supply-chain,pack:dry-runpass.Review notes
Base
codex/p16d-classifications-parity(#39), which sits onfix/pr15-integration-gates(#36); retarget as those land. Read the ledger diff first (19 retirements), thensrc/anchor.tstop to bottom, then the parity test. The one judgement call is the fallback envelope (the reference builds it; the train used to refuse it); it is in effect by default and open to ratification here.