Skip to content

feat(ids): add the auth-user atom builder and the shared I subject atom (P14) - #25

Open
jonathanprozzi wants to merge 1 commit into
update/v1.1.0-alphafrom
codex/p14-ids
Open

jonathanprozzi wants to merge 1 commit into
update/v1.1.0-alphafrom
codex/p14-ids

Conversation

@jonathanprozzi

Copy link
Copy Markdown
Member

Child PR of the v1.1.0-alpha umbrella (#15). Tracking: ENG-15883.

Current (train)

@0xintuition/ids has no builder for the authenticated-user atom and no shared first-person subject atom.

Need

The reference implementation (intuition-v2 feat/intuition-app @ 1b877506d) derives a deterministic IntuitionAuthUser atom from a hashed user id with the derivation version pinned in the payload, and uses a shared I subject atom whose identity is the exact byte I.

Reconciliation

  • New auth-user-atom.ts (authUserIdHash, createAuthUserAtomData, serializeAuthUserAtomData, authUserAtomDataHex, calculateAuthUserAtomId) and i-atom.ts (I_SUBJECT_ID computed from calculateAtomId at module load and pinned by test), exported from the index and covered by the public-entrypoints test.
  • Imports converted to the package's .js style.
  • Identity impact: additive only. calculateAtomId, calculateTripleId, createPredicateAtomData and every existing constant keep their bytes; the new constants reproduce the reference values exactly.

Held out

  • OAuth atom context URL. The train uses schema.intuition.systems; the reference uses schema.0xintuition.com. Changing it changes OAuth atom bytes and ids, so this PR keeps the train value. Reviewers: please confirm which host is live; that decides whether a follow-up changes it.

Evidence

  • Package tests, typecheck, check and build green; pack dry run green.
  • Independent review: conformance and adversarial passes clean.

Review notes

CI shows the base branch's expired supply-chain exception until the CI-fix child PR merges; this branch is rebased after that.

…atom (P14)

- Add auth-user-atom.ts: deterministic IntuitionAuthUser atom data from a
  hashed user id (authUserIdHash, createAuthUserAtomData,
  serializeAuthUserAtomData, authUserAtomDataHex, calculateAuthUserAtomId)
  with the derivation version pinned in the payload.
- Add i-atom.ts: the shared first-person subject atom whose identity is the
  exact byte `I`; I_SUBJECT_ID is computed from calculateAtomId at module
  load and pinned by test.
- Export the new surface from the package index and cover it in the
  public-entrypoints test.

Ported from the private reference implementation at feat/intuition-app
@ 1b877506d; source imports converted to the package's .js style. The
OAuth atom context URL is deliberately left unchanged pending a ruling.

Identity impact: additive only — calculateAtomId, calculateTripleId,
createPredicateAtomData and every existing constant keep their bytes;
the new constants reproduce the reference values exactly.

This branch has not been deployed

No deployments
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