@real-life/trust-protocol 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +187 -78
- package/dist/ack.d.ts +84 -0
- package/dist/ack.d.ts.map +1 -0
- package/dist/ack.js +114 -0
- package/dist/ack.js.map +1 -0
- package/dist/adapters/vti-mediator.d.ts +154 -0
- package/dist/adapters/vti-mediator.d.ts.map +1 -0
- package/dist/adapters/vti-mediator.js +621 -0
- package/dist/adapters/vti-mediator.js.map +1 -0
- package/dist/anchor.d.ts +226 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +347 -0
- package/dist/anchor.js.map +1 -0
- package/dist/{holder.d.ts → carrier-holder.d.ts} +1 -1
- package/dist/carrier-holder.d.ts.map +1 -0
- package/dist/{holder.js → carrier-holder.js} +5 -4
- package/dist/carrier-holder.js.map +1 -0
- package/dist/carrier-identity.js +4 -4
- package/dist/carrier-identity.js.map +1 -1
- package/dist/carrier.d.ts.map +1 -1
- package/dist/carrier.js +4 -3
- package/dist/carrier.js.map +1 -1
- package/dist/ceremony.d.ts +3 -2
- package/dist/ceremony.d.ts.map +1 -1
- package/dist/ceremony.js +16 -26
- package/dist/ceremony.js.map +1 -1
- package/dist/codec.d.ts +46 -0
- package/dist/codec.d.ts.map +1 -0
- package/dist/codec.js +410 -0
- package/dist/codec.js.map +1 -0
- package/dist/continuity.d.ts +67 -0
- package/dist/continuity.d.ts.map +1 -0
- package/dist/continuity.js +110 -0
- package/dist/continuity.js.map +1 -0
- package/dist/core.d.ts +4 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/crypto.d.ts +23 -7
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +54 -20
- package/dist/crypto.js.map +1 -1
- package/dist/delivery.d.ts +31 -3
- package/dist/delivery.d.ts.map +1 -1
- package/dist/delivery.js +75 -28
- package/dist/delivery.js.map +1 -1
- package/dist/encounter/ceremony.d.ts +37 -0
- package/dist/encounter/ceremony.d.ts.map +1 -0
- package/dist/encounter/ceremony.js +662 -0
- package/dist/encounter/ceremony.js.map +1 -0
- package/dist/encounter.d.ts +91 -1
- package/dist/encounter.d.ts.map +1 -1
- package/dist/encounter.js +191 -12
- package/dist/encounter.js.map +1 -1
- package/dist/engine.d.ts +291 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +1395 -0
- package/dist/engine.js.map +1 -0
- package/dist/entropy.d.ts +28 -0
- package/dist/entropy.d.ts.map +1 -0
- package/dist/entropy.js +96 -0
- package/dist/entropy.js.map +1 -0
- package/dist/events.d.ts +177 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +2 -0
- package/dist/events.js.map +1 -0
- package/dist/fixtures.d.ts +30 -0
- package/dist/fixtures.d.ts.map +1 -0
- package/dist/fixtures.js +155 -0
- package/dist/fixtures.js.map +1 -0
- package/dist/forge.d.ts +47 -0
- package/dist/forge.d.ts.map +1 -0
- package/dist/forge.js +20 -0
- package/dist/forge.js.map +1 -0
- package/dist/group-star.d.ts +251 -0
- package/dist/group-star.d.ts.map +1 -0
- package/dist/group-star.js +348 -0
- package/dist/group-star.js.map +1 -0
- package/dist/holder-api.d.ts +137 -0
- package/dist/holder-api.d.ts.map +1 -0
- package/dist/holder-api.js +132 -0
- package/dist/holder-api.js.map +1 -0
- package/dist/holder-state-v1.d.ts +801 -0
- package/dist/holder-state-v1.d.ts.map +1 -0
- package/dist/holder-state-v1.js +2 -0
- package/dist/holder-state-v1.js.map +1 -0
- package/dist/identity-state.d.ts +43 -0
- package/dist/identity-state.d.ts.map +1 -0
- package/dist/identity-state.js +345 -0
- package/dist/identity-state.js.map +1 -0
- package/dist/identity.d.ts +24 -2
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +70 -11
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -29
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +36 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +22 -0
- package/dist/internal.js.map +1 -0
- package/dist/introduction/holder.d.ts +18 -0
- package/dist/introduction/holder.d.ts.map +1 -0
- package/dist/introduction/holder.js +757 -0
- package/dist/introduction/holder.js.map +1 -0
- package/dist/introduction.d.ts +101 -0
- package/dist/introduction.d.ts.map +1 -0
- package/dist/introduction.js +132 -0
- package/dist/introduction.js.map +1 -0
- package/dist/invariants.d.ts +43 -0
- package/dist/invariants.d.ts.map +1 -0
- package/dist/invariants.js +883 -0
- package/dist/invariants.js.map +1 -0
- package/dist/keys-seed.d.ts +7 -0
- package/dist/keys-seed.d.ts.map +1 -0
- package/dist/keys-seed.js +133 -0
- package/dist/keys-seed.js.map +1 -0
- package/dist/log-memory.d.ts +12 -0
- package/dist/log-memory.d.ts.map +1 -0
- package/dist/log-memory.js +101 -0
- package/dist/log-memory.js.map +1 -0
- package/dist/membership/holder.d.ts +35 -0
- package/dist/membership/holder.d.ts.map +1 -0
- package/dist/membership/holder.js +852 -0
- package/dist/membership/holder.js.map +1 -0
- package/dist/membership.d.ts +92 -0
- package/dist/membership.d.ts.map +1 -0
- package/dist/membership.js +157 -0
- package/dist/membership.js.map +1 -0
- package/dist/ports.d.ts +237 -0
- package/dist/ports.d.ts.map +1 -0
- package/dist/ports.js +2 -0
- package/dist/ports.js.map +1 -0
- package/dist/profile.d.ts +56 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +193 -0
- package/dist/profile.js.map +1 -0
- package/dist/prompts.d.ts +14 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +69 -0
- package/dist/prompts.js.map +1 -0
- package/dist/receive.d.ts +133 -0
- package/dist/receive.d.ts.map +1 -0
- package/dist/receive.js +298 -0
- package/dist/receive.js.map +1 -0
- package/dist/results.d.ts +158 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +21 -0
- package/dist/results.js.map +1 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +42 -38
- package/dist/schemas.js.map +1 -1
- package/dist/sha256.d.ts +3 -0
- package/dist/sha256.d.ts.map +1 -0
- package/dist/sha256.js +69 -0
- package/dist/sha256.js.map +1 -0
- package/dist/star.d.ts +31 -0
- package/dist/star.d.ts.map +1 -0
- package/dist/star.js +56 -0
- package/dist/star.js.map +1 -0
- package/dist/state-builder.d.ts +42 -0
- package/dist/state-builder.d.ts.map +1 -0
- package/dist/state-builder.js +100 -0
- package/dist/state-builder.js.map +1 -0
- package/dist/state.d.ts +853 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +36 -0
- package/dist/state.js.map +1 -0
- package/dist/store-contract.d.ts +11 -0
- package/dist/store-contract.d.ts.map +1 -0
- package/dist/store-contract.js +189 -0
- package/dist/store-contract.js.map +1 -0
- package/dist/store-memory.d.ts +8 -0
- package/dist/store-memory.d.ts.map +1 -0
- package/dist/store-memory.js +17 -0
- package/dist/store-memory.js.map +1 -0
- package/dist/testing.d.ts +22 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +21 -0
- package/dist/testing.js.map +1 -0
- package/dist/trust/continuity.d.ts +71 -0
- package/dist/trust/continuity.d.ts.map +1 -0
- package/dist/trust/continuity.js +1216 -0
- package/dist/trust/continuity.js.map +1 -0
- package/dist/trust/duties.d.ts +67 -0
- package/dist/trust/duties.d.ts.map +1 -0
- package/dist/trust/duties.js +179 -0
- package/dist/trust/duties.js.map +1 -0
- package/dist/trust/entries.d.ts +139 -0
- package/dist/trust/entries.d.ts.map +1 -0
- package/dist/trust/entries.js +694 -0
- package/dist/trust/entries.js.map +1 -0
- package/dist/trust/group-star.d.ts +43 -0
- package/dist/trust/group-star.d.ts.map +1 -0
- package/dist/trust/group-star.js +188 -0
- package/dist/trust/group-star.js.map +1 -0
- package/dist/trust/mapping.d.ts +56 -0
- package/dist/trust/mapping.d.ts.map +1 -0
- package/dist/trust/mapping.js +584 -0
- package/dist/trust/mapping.js.map +1 -0
- package/dist/trust/profile.d.ts +25 -0
- package/dist/trust/profile.d.ts.map +1 -0
- package/dist/trust/profile.js +249 -0
- package/dist/trust/profile.js.map +1 -0
- package/dist/trust/star.d.ts +208 -0
- package/dist/trust/star.d.ts.map +1 -0
- package/dist/trust/star.js +588 -0
- package/dist/trust/star.js.map +1 -0
- package/dist/trust/state.d.ts +83 -0
- package/dist/trust/state.d.ts.map +1 -0
- package/dist/trust/state.js +154 -0
- package/dist/trust/state.js.map +1 -0
- package/dist/util-freeze.d.ts +3 -0
- package/dist/util-freeze.d.ts.map +1 -0
- package/dist/util-freeze.js +11 -0
- package/dist/util-freeze.js.map +1 -0
- package/dist/views.d.ts +147 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +268 -0
- package/dist/views.js.map +1 -0
- package/dist/visibility.d.ts +5 -5
- package/dist/visibility.d.ts.map +1 -1
- package/dist/visibility.js +22 -28
- package/dist/visibility.js.map +1 -1
- package/dist/wire.d.ts +178 -84
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js.map +1 -1
- package/package.json +58 -11
- package/schemas/holder-state-v1.schema.json +3880 -0
- package/dist/holder.d.ts.map +0 -1
- package/dist/holder.js.map +0 -1
- package/dist/probe/acks.d.ts +0 -27
- package/dist/probe/acks.d.ts.map +0 -1
- package/dist/probe/acks.js +0 -152
- package/dist/probe/acks.js.map +0 -1
- package/dist/probe/continuity.d.ts +0 -20
- package/dist/probe/continuity.d.ts.map +0 -1
- package/dist/probe/continuity.js +0 -805
- package/dist/probe/continuity.js.map +0 -1
- package/dist/probe/deps.d.ts +0 -61
- package/dist/probe/deps.d.ts.map +0 -1
- package/dist/probe/deps.js +0 -54
- package/dist/probe/deps.js.map +0 -1
- package/dist/probe/encounter.d.ts +0 -26
- package/dist/probe/encounter.d.ts.map +0 -1
- package/dist/probe/encounter.js +0 -938
- package/dist/probe/encounter.js.map +0 -1
- package/dist/probe/introduce.d.ts +0 -70
- package/dist/probe/introduce.d.ts.map +0 -1
- package/dist/probe/introduce.js +0 -295
- package/dist/probe/introduce.js.map +0 -1
- package/dist/probe/membership.d.ts +0 -90
- package/dist/probe/membership.d.ts.map +0 -1
- package/dist/probe/membership.js +0 -450
- package/dist/probe/membership.js.map +0 -1
- package/dist/probe/trust.d.ts +0 -156
- package/dist/probe/trust.d.ts.map +0 -1
- package/dist/probe/trust.js +0 -1233
- package/dist/probe/trust.js.map +0 -1
- package/dist/probe.d.ts +0 -7
- package/dist/probe.d.ts.map +0 -1
- package/dist/probe.js +0 -42
- package/dist/probe.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.js","sourceRoot":"","sources":["../../src/trust/entries.ts"],"names":[],"mappings":"AAgGA,OAAO,EACL,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,GAC3J,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAChC,MAAM,KAAK,GAAG,CAAC,CAAU,EAAE,CAAU,EAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAA;AAEpE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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oD,CAAC,CAAA;gBACpI,IAAI,CAAC,CAAC,cAAc,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,KAAK,QAAQ,IAAI,CAAC,CAAC,cAAc,KAAK,EAAE,CAAC;oBAAE,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAA;gBACvL,OAAO,MAAM,CAAC,KAAK,EAAE,CAAgC,EAAE,KAAK,CAAC,CAAA;YAC/D,CAAC;SACqC;KACzC,CAAA;AACH,CAAC","sourcesContent":["// trust/entries — the entries of the deliverable set on the holder (lib\n// Stage 2, PR 4c; Trust Section 2, 6a.1): merge, split, departure, the\n// pending admission that goes with them, and the identity rewrite they\n// need, on HolderState.\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// What it registers (through trustModule, trust/mapping.ts):\n// commands trust.merge {contactIds} the manual merge of\n// rung 3 (6640): at most one of them holds an entry; human\n// trust.depart {contactId, relationshipId?} departure (2260):\n// the entry id departs the whole entry, an alias the\n// relationship(s) whose identity it is, a relationshipId that\n// one relationship; human\n// duty merge/1 (2230): the persisted continuation of a merge the\n// net (rung 2) or a chaining (2145) made admissible; it runs\n// after the verification commit, as one atomic step\n//\n// The model. An entry is a Contact; its id is the identity of one of its\n// relationships (2100, 2140). A relationship's own identity is its\n// contactId, the contact id it was created under, which stays its identity\n// when it is merged (then an alias of the entry) and which it takes along\n// when it leaves (2090, 2100). A fresh relationship whose tuple a chaining\n// appended to a chain stays as a husk (no tuples, chainedInto = the\n// chain): its contactId is a chain alias of the chain (2090).\n//\n// Choices this file makes where note and spec leave them open:\n// - every merge path but the manual act runs as a merge/1 duty: the\n// verification (or the chaining) commits first, and the duty, run by\n// the next resume before the sweeps, merges in one step (2230). The\n// duty persists its witness (each entry's anchor head and the heads\n// each held as superseded) and runs only while it holds and the binding\n// rule and the one anchor head (6605, 6560) still hold; otherwise it is\n// dropped silently. A verification that admits the merge of the same\n// entries while a duty is open refreshes its witness. The manual merge\n// (6640) involves no verification and merges in its own act\n// - the merged entry's identity: the entry at the earliest position\n// (2140); where none holds one, the identity of the relationship whose\n// active head was created last (2180, entryOrder.heads)\n// - the net (rung 2) runs on every accepted anchor mapping: the incoming\n// relationship against every other entry when it does not lag in its\n// own entry (6550), and, where the entry's\n// anchor head changed, every relationship of another entry against it\n// (6580); all entries that join in one evaluation merge in one duty\n// (2150), taken in position order while they stay mergeable together\n// - the split (2080) applies to the first verified mapping on a\n// relationship of an entry whose other relationships hold an anchor:\n// a relationship without a mapping can share an entry with others only\n// by the manual merge (6640); see the split exception below\n// - \"oldest remaining relationship in entry-commit order\" (2100): by\n// firstVerified (the commitSeq of its first verification, 2190), never\n// verified ones after, then by the creation of their active heads\n// - departure removes the relationship (and its husks) from the state;\n// its tuples' address keys become tombstones by tick's retention. Its\n// open duties go; its outbox items run to their horizon. An entry\n// removed with it leaves the matches of every accepted star (6160); an\n// entry that keeps relationships keeps its matches, though the anchors\n// behind one may have left with the relationship (a match is not\n// re-tested without the star's key; matches only grow otherwise)\n// - a merge rewrites every holder-local key of the merged ids to the\n// survivor's; a rename (2100) rewrites the remaining entry's keys and\n// the star baselines' members, so a rename alone diverges nothing; the\n// introducer a relationship names (provenance.via) follows both; the\n// stored acks follow through the engine (Applied.renames)\n// - a split (2080) moves a contact reference with the relationship it\n// was made on, never with the entry it was filed under: membership\n// records keep the own rkid of the tuple their prelude went or arrived\n// on (joining preludes and invites, groups' preludes and invitations,\n// the roster entry an invitation became, and as Recipient.via the\n// outbox items and stored acks of documents on a member key), introduction records the own\n// pair label toward the mediator (an offer's pin, the introducer's\n// provenance.viaPin, the voucher mark's memory.vouchedPin); a prompt\n// follows the record it asks about\n// - head rule (b) for the incoming relationship is read by the rationale\n// under 6590 (\"only knowledge the committed mapping newly carries\n// connects … stale knowledge … must not create a merge\"): (b) is\n// evaluated against the links its entry held before this\n// verification's lineage joined them (6610), while that lineage counts\n// for (a). Read literally after the commit, 6540 would refuse every\n// case 6530 (a) admits by a lineage that extends E's head; the wording\n// of 6540 is a follow-up for Trust 0.32\n// - the split exception: 2080 read literally would split every manual\n// merge of unmapped relationships at the first mapping; open point for\n// Trust 0.32. A relationship whose entry's other relationships hold no\n// anchor yet stays\n//\n// Open point for Trust 0.32: 6540/6580/6590 in the rotation direction;\n// today's behaviour is pinned, not justified normatively. The incoming\n// relationship is joined against the links its entry held before the\n// verification (the 6590 rationale, mergeDutiesAfter), the 6580 direction\n// (an entry's anchor head changed) against the other entry's current\n// links; so a relationship rotating up to a head another entry's lineage\n// extends opens no merge, while the same relationships arriving the other\n// way round can (test/trust-ported.test.mjs, \"the other direction\").\nimport type { CommandDef, DutyHandler, EventDraft, IdentityRename, Refusal, Applied } from '../engine.js'\nimport type { ClassOnDuty, Contact, Dec, Duty, HolderState, MergeDuty, Prompt, ReissueMappingDuty, Relationship, Setting, StarPair, TrustClass, Tuple } from '../state.js'\nimport {\n CLASSES, anchorSet, classOnToward, conflicts, entryOf, entryRelationships, feeding, findContact, joins, lags, liveRel, newestHeads, newestOf, supersededIn,\n} from './state.js'\nimport { viewDigest } from './star.js'\nimport { dropOff, followClasses } from './duties.js'\nimport { isKnownDuty } from '../codec.js'\nimport { jcs } from '../core.js'\nconst jcsEq = (a: unknown, b: unknown): boolean => jcs(a) === jcs(b)\n\nconst cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0)\nconst cmpDec = (a: Dec, b: Dec): number => { const x = BigInt(a), y = BigInt(b); return x < y ? -1 : x > y ? 1 : 0 }\nconst byPos = (a: Readonly<Contact>, b: Readonly<Contact>): number => cmpDec(a.pos!, b.pos!) || cmp(a.id, b.id)\nconst unique = <T>(xs: Iterable<T>): T[] => [...new Set(xs)]\n\n/** The trust module's entry commands. */\nexport const ENTRY_COMMANDS = Object.freeze({ merge: 'trust.merge', depart: 'trust.depart' } as const)\n\nexport interface TrustMergeInput { contactIds: string[] }\nexport interface TrustDepartInput { contactId: string, relationshipId?: string }\n\n// ── the anchor head and admission ──────────────────────────────────────\n\n/**\n * The entry's anchor head from what its relationships hold (6560): the\n * newest of the heads its feeding relationships hold; among several\n * (a manual merge before its split) the one it holds, else `prefer`, else\n * the smallest. Where a relationship of it feeds another entry (2145), the\n * head only moves forward: with no feeding head, or none beyond it, it\n * stays. With neither, the entry has none.\n */\nexport function settleHead (state: Readonly<HolderState>, c: Readonly<Contact>, prefer: string | null = null): Contact {\n const rels = feeding(state, c)\n const all = entryRelationships(state, c)\n const newest = newestHeads(rels)\n if (!newest.length) {\n if (all.length > rels.length) return c as Contact\n return c.anchorHead === null ? c as Contact : { ...c, anchorHead: null }\n }\n // 2145: a chain of this entry feeds the other one; what the rest feeds\n // never moves the head back — it stays unless a feeding head lies\n // beyond it along the links the entry's relationships hold\n if (all.length > rels.length && c.anchorHead !== null && newestOf([...newest, c.anchorHead], all.flatMap((r) => r.links)).includes(c.anchorHead)) return c as Contact\n const head = newest.length === 1 ? newest[0]\n : c.anchorHead !== null && newest.includes(c.anchorHead) ? c.anchorHead\n : prefer !== null && newest.includes(prefer) ? prefer\n : [...newest].sort(cmp)[0]\n return head === c.anchorHead ? c as Contact : { ...c, anchorHead: head }\n}\n\n/** 2250: pending entries join the set in position order while it has room. */\nexport function admitPending (state: Readonly<HolderState>, bound: bigint): HolderState {\n let admitted = BigInt(Object.values(state.contacts).filter((x) => x.status === 'admitted').length)\n const pending = Object.values(state.contacts).filter((x) => x.status === 'pending' && x.pos !== null).sort(byPos)\n let contacts: HolderState['contacts'] | null = null\n for (const c of pending) {\n if (admitted >= bound) break\n contacts ??= { ...state.contacts }\n contacts[c.id] = { ...c, status: 'admitted' }\n admitted += 1n\n }\n return contacts ? { ...state, contacts } : state as HolderState\n}\n\n// ── the identity rewrite (2100, 2140) ──────────────────────────────────\n\ninterface RewriteOpts {\n /** the relationships whose keys move: their tuples' entryId, their\n * duties, the recipients of their documents; default all */\n rels?: (relId: string) => boolean\n /** also the keys that name the person rather than a relationship: the\n * matches of accepted stars, prompts, the entry ids of merge duties */\n global?: boolean\n /** also the members of the star baselines and in-flight views (a\n * rename: nothing diverges by it) */\n baselines?: boolean\n /** collects the rename for the engine, which follows it in the stored\n * acks (engine.ts Applied.renames) */\n renames?: IdentityRename[]\n}\n\n/** Rename members of one star scope's views, re-sorted and re-digested. */\nfunction renameView (view: StarPair[], from: (id: string) => boolean, to: string): StarPair[] | null {\n if (!view.some((p) => from(p.member))) return null\n return view.map((p) => (from(p.member) ? { ...p, member: to } : p)).sort((a, b) => cmp(a.member, b.member))\n}\n\nfunction renameBaselines (t: Tuple, from: (id: string) => boolean, to: string): Tuple {\n const o = t.starOut\n let changed = false\n let snapshot = o.snapshot\n let snapshotDigest = o.snapshotDigest\n if (snapshot) {\n const v = renameView(snapshot, from, to)\n if (v) { snapshot = v; snapshotDigest = viewDigest(v); changed = true }\n }\n const inflight: typeof o.inflight = {}\n for (const [salt, f] of Object.entries(o.inflight)) {\n const v = renameView(f.view, from, to)\n if (v) { inflight[salt] = { ...f, view: v, viewDigest: viewDigest(v) }; changed = true } else inflight[salt] = f\n }\n return changed ? { ...t, starOut: { ...o, snapshot, snapshotDigest, inflight } } : t\n}\n\n/** The tuple the record a prompt asks about was made on: a group-invite's\n * invite by its own rkid, an introduction's offer or the target's act by\n * its pin toward the mediator; null where none is held (an\n * encounter-confirm names the fresh relationship's own identity). */\nfunction promptTuple (state: Readonly<HolderState>, p: Readonly<Prompt>): { rkid: string } | { label: string } | null {\n if (p.kind === 'group-invite') {\n const i = Object.values(state.joining.invites).find((x) => x.promptId === p.id)\n return i ? { rkid: i.rkid } : null\n }\n if (p.kind === 'introduction') {\n if (Object.hasOwn(state.encounter.offers, p.id)) return { label: state.encounter.offers[p.id].pin }\n const a = Object.values(state.encounter.introductions).find((x) => x.role === 'target' && x.promptId === p.id)\n return a?.pins.mediator !== undefined ? { label: a.pins.mediator } : null\n }\n return null\n}\n\n/**\n * Every holder-local key that resolved through an identity in `ids` now\n * resolves through `to` (2100, 2140), within `opts`: tuples' entryId,\n * duties, the recipients of issued documents, and with `global` the\n * matches of accepted stars and merge duties; and the contact references\n * of the membership and introduction state and of prompts, each with the\n * relationship of the tuple it was made on (2080): by the own rkid it\n * arrived or went on (joining preludes and invites, groups' preludes,\n * invitations and roster) or the own pair label toward the mediator\n * (encounter.offers by their pin, the introducer provenance.via by\n * viaPin, memory.vouchedBy by memory.vouchedPin), a prompt with the\n * record it asks about; one that names no tuple follows with `global`.\n * Contacts are the caller's: their ids\n * and aliases are what the rewrite follows. The stored acks follow\n * through the engine (opts.renames): only the core writes the effect\n * cache, and their sealed envelopes stay as they are. Parts without a\n * change keep their identity.\n */\nexport function rewriteIdentity (state: Readonly<HolderState>, ids: readonly string[], to: string, opts: RewriteOpts = {}): HolderState {\n const from = (x: string): boolean => ids.includes(x)\n const inRel = opts.rels ?? (() => true)\n // the own rkids and pair labels of the tuples within `opts`\n const rkids = new Set<string>(), labels = new Set<string>()\n for (const [id, r] of Object.entries(state.relationships)) {\n if (inRel(id)) for (const t of r.tuples) { rkids.add(t.rkid); labels.add(t.ownPairLabel) }\n }\n const byRkid = (rkid: string | undefined): boolean => (rkid === undefined ? !!opts.global : !opts.rels || rkids.has(rkid))\n const byLabel = (label: unknown): boolean => (typeof label !== 'string' ? !!opts.global : !opts.rels || labels.has(label))\n const re = (x: string | undefined, tied: boolean): boolean => x !== undefined && from(x) && tied\n let relationships: HolderState['relationships'] | null = null\n for (const [id, r] of Object.entries(state.relationships)) {\n const mine = inRel(id)\n let changed = false\n const tuples = r.tuples.map((t) => {\n let x = t\n if (mine && from(t.entryId)) x = { ...x, entryId: to }\n const acc = x.starIn.accepted\n if (opts.global && acc && acc.matches.some(from)) {\n x = { ...x, starIn: { ...x.starIn, accepted: { ...acc, matches: unique(acc.matches.map((m) => (from(m) ? to : m))).sort(cmp) } } }\n }\n if (opts.baselines) x = renameBaselines(x, from, to)\n if (x !== t) changed = true\n return x\n })\n // the introducer with the relationship toward it the act was pinned to\n const provenance = re(r.provenance.via, byLabel(r.provenance.viaPin)) ? { ...r.provenance, via: to } : r.provenance\n if (changed || provenance !== r.provenance) (relationships ??= { ...state.relationships })[id] = { ...r, tuples, provenance }\n }\n opts.renames?.push({ from: [...ids], to, rkids: opts.rels ? [...rkids].sort() : null })\n let duties: HolderState['duties'] | null = null\n for (const [id, d] of Object.entries(state.duties)) {\n if (!isKnownDuty(d)) continue // a kind or version this library does not handle stays as it is\n const x = d as unknown as Record<string, unknown>\n let nd: Duty = d\n if (d.kind === 'merge' && opts.global && Array.isArray(x.entryIds) && (x.entryIds as string[]).some(from)) {\n nd = { ...d, entryIds: unique((x.entryIds as string[]).map((e) => (from(e) ? to : e))).sort(cmp) } as Duty\n } else if (d.kind !== 'merge' && typeof x.contactId === 'string' && from(x.contactId) && (typeof x.relId !== 'string' || inRel(x.relId))) {\n nd = { ...d, contactId: to } as Duty\n }\n if (nd !== d) (duties ??= { ...state.duties })[id] = nd\n }\n // membership, introduction and prompts: each contact reference with the\n // relationship of the tuple it was made on, where it names one (2080)\n let prompts: HolderState['prompts'] | null = null\n for (const [id, p] of Object.entries(state.prompts)) {\n const at = promptTuple(state, p)\n const tied = at === null ? !!opts.global : 'rkid' in at ? byRkid(at.rkid) : byLabel(at.label)\n if (re(p.contactId, tied)) (prompts ??= { ...state.prompts })[id] = { ...p, contactId: to }\n }\n let joining: HolderState['joining'] | null = null\n for (const [k, p] of Object.entries(state.joining.preludes)) {\n if (re(p.contactId, byRkid(p.rkid))) (joining ??= { ...state.joining, preludes: { ...state.joining.preludes } }).preludes[k] = { ...p, contactId: to }\n }\n for (const [k, i] of Object.entries(state.joining.invites)) {\n if (re(i.contactId, byRkid(i.rkid))) {\n joining ??= { ...state.joining, preludes: { ...state.joining.preludes } }\n joining.invites = { ...joining.invites, [k]: { ...i, contactId: to } }\n }\n }\n let groups: HolderState['groups'] | null = null\n for (const [gid, g] of Object.entries(state.groups)) {\n const preludes = Object.fromEntries(Object.entries(g.preludes).map(([k, p]) => [k, re(p.contactId, byRkid(p.rkid)) ? { ...p, contactId: to } : p]))\n const invitations = Object.fromEntries(Object.entries(g.invitations).map(([k, i]) => [k, re(i.contactId, byRkid(i.rkid)) ? { ...i, contactId: to } : i]))\n const roster = Object.fromEntries(Object.entries(g.roster).map(([k, m]) => [k, re(m.contactId, byRkid(m.rkid)) ? { ...m, contactId: to } : m]))\n if (jcsEq(preludes, g.preludes) && jcsEq(invitations, g.invitations) && jcsEq(roster, g.roster)) continue\n ;(groups ??= { ...state.groups })[gid] = { ...g, preludes, invitations, roster }\n }\n let encounter: HolderState['encounter'] | null = null\n for (const [k, o] of Object.entries(state.encounter.offers)) {\n if (re(o.mediatorContactId, byLabel(o.pin))) (encounter ??= { ...state.encounter, offers: { ...state.encounter.offers } }).offers[k] = { ...o, mediatorContactId: to }\n }\n // the voucher mark names the mediator that vouched: it follows the\n // relationship toward that mediator the voucher came on (memory.vouchedPin),\n // not the entry it was filed under\n for (const [id, r] of Object.entries(relationships ?? state.relationships)) {\n const v = r.memory.vouchedBy\n if (typeof v === 'string' && re(v, byLabel(r.memory.vouchedPin))) (relationships ??= { ...state.relationships })[id] = { ...r, memory: { ...r.memory, vouchedBy: to } }\n }\n let outbox: HolderState['outbox'] | null = null\n for (const [d, it] of Object.entries(state.outbox)) {\n // a document on a member key follows the tuple its contact was named through (Recipient.via)\n if (from(it.recipient.contactId) && rkids.has(it.recipient.via ?? it.recipient.rkid)) (outbox ??= { ...state.outbox })[d] = { ...it, recipient: { ...it.recipient, contactId: to } }\n }\n if (!relationships && !duties && !prompts && !outbox && !joining && !groups && !encounter) return state as HolderState\n return {\n ...state,\n ...(relationships ? { relationships } : {}), ...(duties ? { duties } : {}), ...(prompts ? { prompts } : {}), ...(outbox ? { outbox } : {}),\n ...(joining ? { joining } : {}), ...(groups ? { groups } : {}), ...(encounter ? { encounter } : {}),\n }\n}\n\n// ── merge (2140–2180) ──────────────────────────────────────────────────\n\n/** 2160: per class `off` where any held `off`, else `on` where any held\n * `on`, else `default`; per (group, contact) the same, every per-group\n * `on` reset where the merged sealed group star is `off` (5450). */\nexport function mergeSettings (cs: readonly Readonly<Contact>[]): { settings: Record<TrustClass, Setting>, groupSettings: Record<string, Setting> } {\n const pick = (xs: Setting[]): Setting => (xs.includes('off') ? 'off' : xs.includes('on') ? 'on' : 'default')\n const settings = {} as Record<TrustClass, Setting>\n for (const cls of CLASSES) settings[cls] = pick(cs.map((c) => c.settings[cls]))\n const groupSettings: Record<string, Setting> = {}\n for (const g of unique(cs.flatMap((c) => Object.keys(c.groupSettings))).sort(cmp)) {\n const s = pick(cs.map((c) => c.groupSettings[g] ?? 'default'))\n if (s === 'off' || (s === 'on' && settings.sealedGroupStar !== 'off')) groupSettings[g] = s\n }\n return { settings, groupSettings }\n}\n\n/**\n * Whether entries can be one (6605, 6560): no relationship of one holds\n * another binding (or another successor) for an anchor a relationship of\n * another holds, and their anchor heads lie on one chain of the links\n * their relationships hold, so the merged entry has exactly one.\n */\nexport function mergeable (state: Readonly<HolderState>, cs: readonly Readonly<Contact>[]): boolean {\n if (cs.length < 2 || new Set(cs.map((c) => c.id)).size !== cs.length) return false\n const rels = cs.map((c) => entryRelationships(state, c))\n for (let i = 0; i < rels.length; i++) for (let j = i + 1; j < rels.length; j++) if (conflicts(rels[i], rels[j])) return false\n const all = unique(rels.flat())\n const heads = [...cs.map((c) => c.anchorHead), ...all.map((r) => r.heldCounterpartHead)].filter((h): h is string => h !== null)\n return newestOf(heads, all.flatMap((r) => r.links)).length <= 1\n}\n\n/** Where the newest active head among the entries' relationships was created (2180). */\nfunction newestRelationship (state: Readonly<HolderState>, cs: readonly Readonly<Contact>[]): Relationship | undefined {\n let best: Relationship | undefined\n let at = -1\n for (const c of cs) {\n for (const r of entryRelationships(state, c)) {\n const i = state.entryOrder.heads.indexOf(r.id)\n if (i > at) { at = i; best = r }\n }\n }\n return best\n}\n\n/**\n * The atomic merge of entries (2140, 2150, 2160, 2180): one entry at the\n * earliest position under the survivor's identity, the others its\n * aliases; admitted where any was, so `k` admitted ones free `k−1` slots,\n * which the next pending entries take in position order in the same step;\n * every key of a merged id rewritten to the survivor; the anchor head\n * settled (6560). Per-tuple keys stay with their tuples.\n */\nexport function mergeEntries (state: Readonly<HolderState>, cs: readonly Readonly<Contact>[], bound: bigint): Applied & { survivor: string } {\n const withPos = cs.filter((c) => c.pos !== null).sort(byPos)\n let survivor: Readonly<Contact>\n let id: string\n if (withPos.length) { survivor = withPos[0]; id = survivor.id } else {\n const r = newestRelationship(state, cs)\n survivor = (r && cs.find((c) => c.relIds.includes(r.id))) ?? cs[0]\n // the relationship's identity, where it names the survivor (2180)\n id = r && findContact(state, r.contactId)?.id === survivor.id ? r.contactId : survivor.id\n }\n return mergeInto(state, survivor, id, cs.filter((c) => c !== survivor), bound)\n}\n\n/** The merge onto a chosen survivor under identity `id` (its id or one of its aliases). */\nexport function mergeInto (state: Readonly<HolderState>, survivor: Readonly<Contact>, id: string, gone: readonly Readonly<Contact>[], bound: bigint): Applied & { survivor: string } {\n const all = [survivor, ...gone]\n const { settings, groupSettings } = mergeSettings(all)\n const status: Contact['status'] = all.some((c) => c.status === 'admitted') ? 'admitted' : all.some((c) => c.status === 'pending') ? 'pending' : 'none'\n const positioned = all.filter((c) => c.pos !== null).sort(byPos)\n const merged = all.map((c) => c.id).filter((x) => x !== id)\n const contacts = { ...state.contacts }\n for (const c of all) delete contacts[c.id]\n contacts[id] = {\n id, pos: positioned[0]?.pos ?? null, status,\n aliases: unique(all.flatMap((c) => [c.id, ...c.aliases])).filter((x) => x !== id).sort(cmp),\n relIds: unique(all.flatMap((c) => c.relIds)),\n anchorHead: survivor.anchorHead ?? positioned.find((c) => c.anchorHead !== null)?.anchorHead ?? null,\n settings, groupSettings,\n }\n const renames: IdentityRename[] = []\n let next: HolderState = rewriteIdentity({ ...state, contacts }, merged, id, { global: true, renames })\n next = { ...next, contacts: { ...next.contacts, [id]: settleHead(next, next.contacts[id]) } }\n // the class duties of the merged settings (2160, 2850, 6410): per\n // relationship against the entry it sent under before (2146)\n const f = followClasses(state, admitPending(next, bound))\n next = f.state\n return {\n state: next, events: [{ type: 'contact.merged', contactId: id, merged: [...merged].sort(cmp) }],\n ...(f.duties.length ? { duties: f.duties } : {}), renames, survivor: id,\n }\n}\n\n/**\n * The merge duties a commit on `relId` opens (2230): where the\n * relationship stands behind another entry (2145) that is now mergeable\n * with its own, and, with `net`, the convergence net of rung 2 for an\n * accepted anchor mapping (6520–6605). One duty for every entry that\n * joins, in position order while they stay mergeable together (2150).\n */\nexport function mergeDutiesAfter (before: Readonly<HolderState>, after: HolderState, relId: string, opts: { net: boolean }): { state: HolderState, duties: MergeDuty[] } {\n const none = { state: after, duties: [] }\n const rel = after.relationships[relId]\n const E = rel && entryOf(after, rel)\n if (!E || E.pos === null || E.anchorHead === null) return none\n const eRels = entryRelationships(after, E)\n const others = Object.values(after.contacts).filter((x) => x.id !== E.id && x.pos !== null && x.anchorHead !== null).sort(byPos)\n const picked: Contact[] = []\n const take = (x: Contact): void => { if (!picked.includes(x) && mergeable(after, [E, ...picked, x])) picked.push(x) }\n // 2145: the other entry behind this relationship, once comparable and the binding rule admits\n for (const t of rel.tuples) {\n const x = findContact(after, t.entryId)\n if (x && x.id !== E.id && x.pos !== null && x.anchorHead !== null) take(x)\n }\n if (opts.net) {\n // the incoming relationship, where it does not lag in its own entry\n // (6550). Head rule (b) against the knowledge the entry held before\n // this commit: its relationships' links with this relationship's taken\n // from before the 6610 union of this verification. What the mapping\n // newly carries counts for (a) only (the 6590 rationale reading)\n if (rel.heldCounterpartHead === E.anchorHead) {\n const relB = Object.hasOwn(before.relationships, relId) ? before.relationships[relId] : rel\n const own = supersededIn(eRels.map((r) => (r.id === relId ? relB : r)))\n for (const x of others) if (joins(rel, x, entryRelationships(after, x), own)) take(x)\n }\n // 6580: E's anchor head changed — every relationship of another entry against E\n if (findContact(before, E.id)?.anchorHead !== E.anchorHead) {\n for (const x of others) {\n const xs = entryRelationships(after, x)\n if (feeding(after, x).some((r) => r.heldCounterpartHead === x.anchorHead && joins(r, E, eRels, supersededIn(xs)))) take(x)\n }\n }\n }\n if (!picked.length) return none\n const cs = [E, ...picked]\n const ids = cs.map((c) => c.id).sort(cmp)\n const id = 'merge:' + ids.join('|')\n const duty: MergeDuty = { kind: 'merge', v: 1, id, entryIds: ids, relId, witness: witnessOf(after, cs) }\n // a duty open for the same entries takes the new admission's witness\n if (Object.hasOwn(after.duties, id)) return { state: { ...after, duties: { ...after.duties, [id]: { ...after.duties[id], ...duty } as Duty } }, duties: [] }\n return { state: after, duties: [duty] }\n}\n\n/** The heads and superseded sets a merge is admitted against. */\nfunction witnessOf (state: Readonly<HolderState>, cs: readonly Readonly<Contact>[]): MergeDuty['witness'] {\n const heads: Record<string, string> = {}\n const superseded: Record<string, string[]> = {}\n for (const c of cs) heads[c.id] = c.anchorHead!\n for (const y of cs) {\n const sup = supersededIn(entryRelationships(state, y))\n superseded[y.id] = unique(cs.filter((x) => x !== y && sup.has(x.anchorHead!)).map((x) => x.anchorHead!)).sort(cmp)\n }\n return { heads, superseded }\n}\n\n/**\n * Whether the merge a duty was opened for still stands (6540, 6550,\n * 6605): every entry still holds the anchor head it was admitted with, no\n * entry holds another's head as superseded beyond what it did then, the\n * relationship that opened it is still one of theirs, and the entries are\n * mergeable (the binding rule, one anchor head).\n */\nfunction witnessHolds (state: Readonly<HolderState>, d: Readonly<MergeDuty>, cs: readonly Readonly<Contact>[]): boolean {\n const w = d.witness\n if (cs.some((c) => !Object.hasOwn(w.heads, c.id) || c.anchorHead !== w.heads[c.id])) return false\n if (!cs.some((c) => c.relIds.includes(d.relId))) return false\n for (const y of cs) {\n const sup = supersededIn(entryRelationships(state, y))\n for (const x of cs) if (x !== y && sup.has(x.anchorHead!) && !(w.superseded[y.id] ?? []).includes(x.anchorHead!)) return false\n }\n return mergeable(state, cs)\n}\n\n/** merge/1: the merge as one step after the verification commit (2230),\n * re-checked against its witness; where it no longer holds, the duty is\n * dropped without a trace (a later verification may open another). */\nexport const mergeDuty = (bound: bigint): DutyHandler => ({\n v: 1,\n apply (state, duty) {\n const d = duty as MergeDuty\n const cs = unique(d.entryIds.map((x) => findContact(state, x)).filter((c): c is Contact => c !== undefined))\n // the state moved since the commit that opened it: nothing (left) to merge\n if (cs.length < 2 || cs.some((c) => c.pos === null) || !witnessHolds(state, d, cs)) return { state: state as HolderState }\n const r = mergeEntries(state, cs, bound)\n return { state: r.state, ...(r.events ? { events: r.events } : {}), ...(r.duties ? { duties: r.duties } : {}), ...(r.renames ? { renames: r.renames } : {}) }\n },\n})\n\n// ── split (2080–2115) ──────────────────────────────────────────────────\n\n/** The chain aliases of a relationship (2090): the identities of the\n * husks chained into it. */\nexport function chainAliases (state: Readonly<HolderState>, relId: string): string[] {\n const out: string[] = []\n for (const r of Object.values(state.relationships)) {\n if (r.chainedInto === relId) out.push(r.contactId, ...chainAliases(state, r.id))\n }\n return unique(out).sort(cmp)\n}\n\n/** The husks chained into `relId`, transitively. */\nconst husksOf = (state: Readonly<HolderState>, relId: string): string[] =>\n Object.values(state.relationships).filter((r) => r.chainedInto === relId).flatMap((r) => [r.id, ...husksOf(state, r.id)])\n\n/**\n * The identity an entry takes when the relationship whose identity it was\n * leaves (2100): its oldest remaining relationship's in entry-commit order\n * (firstVerified, unverified after, then active-head creation), among those\n * whose identity resolves to this entry; the relationship's id where none\n * does (a relationship behind two entries, 2145).\n */\nfunction oldestIdentity (state: Readonly<HolderState>, c: Readonly<Contact>, remaining: readonly string[], exclude: ReadonlySet<string>): string {\n const heads = state.entryOrder.heads\n const rels = remaining.filter((id) => Object.hasOwn(state.relationships, id)).map((id) => state.relationships[id]).sort((a, b) => {\n if (a.firstVerified !== null && b.firstVerified !== null) { const d = cmpDec(a.firstVerified, b.firstVerified); if (d) return d }\n if ((a.firstVerified === null) !== (b.firstVerified === null)) return a.firstVerified === null ? 1 : -1\n return (heads.indexOf(a.id) - heads.indexOf(b.id)) || cmp(a.id, b.id)\n })\n const own = rels.find((r) => !exclude.has(r.contactId) && (r.contactId === c.id || c.aliases.includes(r.contactId)))\n return own ? own.contactId : rels[0].id\n}\n\n/** The keys of the entry's relationships resolve through its new id (2100). */\nconst rename = (state: HolderState, oldId: string, id: string, rels: (relId: string) => boolean, renames: IdentityRename[]): HolderState =>\n rewriteIdentity(state, [oldId], id, { rels, global: true, baselines: true, renames })\n\n/**\n * 2080: the first verified mapping on `relId`, already in `mid`, leaves it\n * holding no anchor the other relationships of its entry hold, or another\n * binding for one they hold: the split, else null. The entry keeps its\n * position, status, the remaining relationships with their aliases and\n * its settings, frees no slot and settles its anchor head; the leaver\n * takes its identity, its chain aliases and the settings of 2115, and\n * holds no position until the caller's entry commit (2090).\n */\nexport function splitIfUnlinked (before: Readonly<HolderState>, mid: Readonly<HolderState>, relId: string): { state: HolderState, event: EventDraft, renames: IdentityRename[] } | null {\n if (before.relationships[relId]?.heldCounterpartHead !== null) return null\n const rel = mid.relationships[relId]\n const E = entryOf(mid, rel)\n if (!E) return null\n const others = entryRelationships(mid, E).filter((r) => r.id !== relId)\n const holding = others.filter((r) => r.heldCounterpartHead !== null)\n // 2080 read literally would split every manual merge of unmapped\n // relationships at the first mapping; open point for Trust 0.32. Here\n // the relationship stays where the others hold no anchor to contradict\n if (!holding.length) return null\n const mine = anchorSet(rel)\n const shares = holding.some((o) => [...anchorSet(o)].some((a) => mine.has(a)))\n if (shares && !conflicts([rel], others)) return null\n return splitOff(mid, relId)\n}\n\n/** The split of `relId` from its entry (2080–2115). */\nexport function splitOff (state: Readonly<HolderState>, relId: string): { state: HolderState, event: EventDraft, renames: IdentityRename[] } {\n const rel = state.relationships[relId]\n const E = entryOf(state, rel)!\n const identity = rel.contactId\n const chain = chainAliases(state, relId)\n const leaverIds = new Set([identity, ...chain])\n const remaining = E.relIds.filter((id) => id !== relId)\n const eId = leaverIds.has(E.id) ? oldestIdentity(state, E, remaining, leaverIds) : E.id\n // 2115: every class at default, except an `off` of the merged entry, which goes along\n const settings = {} as Record<TrustClass, Setting>\n for (const cls of CLASSES) settings[cls] = E.settings[cls] === 'off' ? 'off' : 'default'\n const groupSettings: Record<string, Setting> = {}\n for (const [g, s] of Object.entries(E.groupSettings)) if (s === 'off') groupSettings[g] = 'off'\n const contacts = { ...state.contacts }\n delete contacts[E.id]\n contacts[eId] = { ...E, id: eId, relIds: remaining, aliases: E.aliases.filter((a) => !leaverIds.has(a) && a !== eId) }\n contacts[identity] = {\n id: identity, pos: null, status: 'none', aliases: chain.filter((a) => a !== identity), relIds: [relId], anchorHead: null, settings, groupSettings,\n }\n // the leaver's keys go to its own entry (2145 entryId, its duties and recipients)\n const renames: IdentityRename[] = []\n let next = rewriteIdentity({ ...state, contacts }, [E.id, ...E.aliases], identity, { rels: (id) => id === relId, renames })\n // the remaining entry's keys that resolved through the old identity (2100)\n if (eId !== E.id) next = rename(next, E.id, eId, (id) => id !== relId, renames)\n next = { ...next, contacts: { ...next.contacts, [eId]: settleHead(next, next.contacts[eId]) } }\n // the leaver's classes start at default (2115): the trusted contacts' classes off with the anchor mapping (6410)\n next = dropOff(next).state\n return { state: next, event: { type: 'contact.split', contactId: eId, leaver: identity, relationshipId: relId }, renames }\n}\n\n// ── departure (2210, 2250, 2260, 5860) ─────────────────────────────────\n\nconst needInput = (x: unknown, name: string): Record<string, unknown> => {\n if (x === null || typeof x !== 'object' || Array.isArray(x)) throw new TypeError(`${name} needs an input object`)\n return x as Record<string, unknown>\n}\n\n/** The matches of every accepted star without the entry ids `ids` (6160). */\nfunction dropMatches (state: HolderState, ids: readonly string[]): HolderState {\n if (!ids.length) return state\n let relationships: HolderState['relationships'] | null = null\n for (const [id, r] of Object.entries(state.relationships)) {\n if (!r.tuples.some((t) => t.starIn.accepted?.matches.some((m) => ids.includes(m)))) continue\n const tuples = r.tuples.map((t) => {\n const acc = t.starIn.accepted\n return acc && acc.matches.some((m) => ids.includes(m)) ? { ...t, starIn: { ...t.starIn, accepted: { ...acc, matches: acc.matches.filter((m) => !ids.includes(m)) } } } : t\n })\n ;(relationships ??= { ...state.relationships })[id] = { ...r, tuples }\n }\n return relationships ? { ...state, relationships } : state\n}\n\n/** The identities of a relationship: its own and its chain aliases. */\nconst identitiesOf = (state: Readonly<HolderState>, relId: string): string[] =>\n [state.relationships[relId].contactId, ...chainAliases(state, relId)]\n\n/**\n * Departure: the relationships leave the state with their husks; an entry\n * left without relationships is removed (pending: 2260; admitted: its\n * slot frees, 2250), one that keeps some drops their aliases, takes a new\n * identity where theirs was its own (2100) and settles its anchor head\n * (2080); pending entries are admitted in position order in the same\n * step, so the set changes once (5860).\n */\nexport function depart (state: Readonly<HolderState>, input: TrustDepartInput, bound: bigint): Applied | Refusal {\n const c = findContact(state, input.contactId)\n if (!c) return { ok: false, code: 'unknown-contact' }\n let relIds: string[]\n if (input.relationshipId !== undefined) {\n if (!c.relIds.includes(input.relationshipId)) return { ok: false, code: 'unknown-contact' }\n relIds = [input.relationshipId]\n } else if (input.contactId !== c.id) {\n relIds = c.relIds.filter((rid) => Object.hasOwn(state.relationships, rid) && identitiesOf(state, rid).includes(input.contactId))\n } else relIds = [...c.relIds]\n const leaving = new Set(relIds.flatMap((rid) => [rid, ...husksOf(state, rid)]))\n const goneIds = new Set([...relIds.flatMap((rid) => (Object.hasOwn(state.relationships, rid) ? identitiesOf(state, rid) : []))])\n if (input.contactId !== c.id && input.relationshipId === undefined) goneIds.add(input.contactId) // an alias without a relationship\n const relationships: HolderState['relationships'] = {}\n for (const [id, r] of Object.entries(state.relationships)) if (!leaving.has(id)) relationships[id] = r\n const contacts: HolderState['contacts'] = {}\n const renamed: Array<{ from: string, to: string, rels: string[] }> = []\n let removed = false\n const removedIds: string[] = []\n for (const x of Object.values(state.contacts)) {\n const rest = x.relIds.filter((id) => !leaving.has(id))\n if (rest.length === x.relIds.length && !x.aliases.some((a) => goneIds.has(a))) { contacts[x.id] = x; continue }\n if (!rest.length) { if (x.id === c.id) removed = true; removedIds.push(x.id); continue }\n const id = goneIds.has(x.id) ? oldestIdentity(state, x, rest, goneIds) : x.id\n if (id !== x.id) renamed.push({ from: x.id, to: id, rels: rest })\n contacts[id] = { ...x, id, relIds: rest, aliases: x.aliases.filter((a) => !goneIds.has(a) && a !== id) }\n }\n const duties: HolderState['duties'] = {}\n for (const [id, d] of Object.entries(state.duties)) {\n const relOf = (d as { relId?: unknown }).relId\n // a duty of a kind (or version) this library does not know is kept as it is\n if (typeof relOf === 'string' && leaving.has(relOf) && d.kind !== 'merge' && isKnownDuty(d)) continue\n duties[id] = d\n }\n const rotations: HolderState['rotations'] = {}\n for (const [id, r] of Object.entries(state.rotations)) {\n rotations[id] = Object.keys(r.awaitHead).some((k) => leaving.has(k))\n ? { ...r, awaitHead: Object.fromEntries(Object.entries(r.awaitHead).filter(([k]) => !leaving.has(k))) }\n : r\n }\n let next: HolderState = {\n ...state, relationships, contacts, duties, rotations,\n entryOrder: { ...state.entryOrder, heads: state.entryOrder.heads.filter((id) => !leaving.has(id)) },\n }\n // 6160: an accepted star matches the holder's contacts; one that left matches nothing\n next = dropMatches(next, removedIds)\n const renames: IdentityRename[] = []\n for (const r of renamed) next = rename(next, r.from, r.to, (id) => r.rels.includes(id), renames)\n for (const x of Object.values(next.contacts)) {\n const s = settleHead(next, x)\n if (s !== x) next = { ...next, contacts: { ...next.contacts, [x.id]: s } }\n }\n // 2850: a relationship that ceased to lag with the departure gets the classes on for it\n const f = followClasses(state, admitPending(next, bound))\n next = f.state\n return {\n ...(f.duties.length ? { duties: f.duties } : {}),\n state: next, events: [{ type: 'contact.departed', contactId: c.id, relationshipIds: relIds.filter((id) => Object.hasOwn(state.relationships, id)).sort(cmp), removed }],\n ...(renames.length ? { renames } : {}),\n }\n}\n\n// ── the commands ───────────────────────────────────────────────────────\n\nexport function entryCommands (bound: bigint): Record<string, CommandDef> {\n return {\n // rung 3: the manual merge (6640)\n [ENTRY_COMMANDS.merge]: {\n human: true,\n apply (state, _p, input: TrustMergeInput) {\n const i = needInput(input, ENTRY_COMMANDS.merge)\n if (!Array.isArray(i.contactIds) || i.contactIds.some((x) => typeof x !== 'string' || x === '')) throw new TypeError('trust.merge: contactIds must be non-empty strings')\n const cs: Contact[] = []\n for (const x of i.contactIds as string[]) {\n const c = findContact(state, x)\n if (!c) return { ok: false, code: 'unknown-contact' }\n if (!cs.includes(c)) cs.push(c)\n }\n if (cs.length < 2) return { state: state as HolderState }\n if (cs.filter((c) => c.pos !== null).length > 1) return { ok: false, code: 'not-mergeable', ref: 'RLTP-TRU-6640' }\n if (!mergeable(state, cs)) return { ok: false, code: 'not-mergeable', ref: 'RLTP-TRU-6605' }\n const r = mergeEntries(state, cs, bound)\n return { state: r.state, ...(r.events ? { events: r.events } : {}), ...(r.duties ? { duties: r.duties } : {}), ...(r.renames ? { renames: r.renames } : {}) }\n },\n } satisfies CommandDef<TrustMergeInput>,\n [ENTRY_COMMANDS.depart]: {\n human: true,\n apply (state, _p, input: TrustDepartInput) {\n const i = needInput(input, ENTRY_COMMANDS.depart)\n if (typeof i.contactId !== 'string' || i.contactId === '') throw new TypeError('trust.depart: contactId must be a non-empty string')\n if (i.relationshipId !== undefined && (typeof i.relationshipId !== 'string' || i.relationshipId === '')) throw new TypeError('trust.depart: relationshipId must be a non-empty string')\n return depart(state, i as unknown as TrustDepartInput, bound)\n },\n } satisfies CommandDef<TrustDepartInput>,\n }\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { GroupMembership } from '../group-star.js';
|
|
2
|
+
import type { PrepareCtx } from '../engine.js';
|
|
3
|
+
import type { Contact, Dec, GroupStarItem, HolderState, Relationship, SeqIn } from '../state.js';
|
|
4
|
+
import type { Artifact } from './star.js';
|
|
5
|
+
/** The registered task type that carries group-star@1 (Delivery §4.4, 5740). */
|
|
6
|
+
export declare const GROUP_STAR_TYPE = "https://real-life.org/trust-tasks/group-star/0.1";
|
|
7
|
+
/** Whether the sealed group star is on for (group, contact) (2830, 2760). */
|
|
8
|
+
export declare function sealedOn(c: Readonly<Contact>, group: string): boolean;
|
|
9
|
+
/** The group-star view toward contact c on relationship r (5730). */
|
|
10
|
+
export declare function groupStarView(state: Readonly<HolderState>, c: Readonly<Contact>, rel: Readonly<Relationship>): GroupStarItem[];
|
|
11
|
+
type GroupAccepted = NonNullable<SeqIn<{
|
|
12
|
+
salt: Dec;
|
|
13
|
+
entries: Array<{
|
|
14
|
+
d: string;
|
|
15
|
+
c: string;
|
|
16
|
+
}>;
|
|
17
|
+
groups: string[];
|
|
18
|
+
}>['accepted']>;
|
|
19
|
+
/** The group star as an artifact (5.2b, 5730–5770). */
|
|
20
|
+
export declare const GROUP_STAR: Artifact<GroupStarItem, GroupAccepted>;
|
|
21
|
+
/** One tuple's outcome of the re-match: the hit, and the accepted pair if one opened. */
|
|
22
|
+
export interface GroupStarRehit {
|
|
23
|
+
label: string;
|
|
24
|
+
member?: string;
|
|
25
|
+
memberOp?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 5520–5580 for a group the holder joins, over the group stars it already
|
|
29
|
+
* accepted: d = HMAC(k_g, G) tested against each stored union, and on a
|
|
30
|
+
* hit the sealed pair opened and checked in the order of 5530–5570
|
|
31
|
+
* against `membership` (the joined group's roster as the welcome carries
|
|
32
|
+
* it), exactly as at a star's completion. k_g and k_e are the accepted
|
|
33
|
+
* star's (its sender, this holder's pair anchor, its salt), through the
|
|
34
|
+
* KeyProvider under the engine's release. Async: the caller prepares it
|
|
35
|
+
* and applies withGroupHits in its commit.
|
|
36
|
+
*/
|
|
37
|
+
export declare function groupStarRematch(ctx: PrepareCtx, membership: GroupMembership): Promise<GroupStarRehit[]>;
|
|
38
|
+
/** The re-match committed: `group` joins the accepted groups of the hit
|
|
39
|
+
* tuples, and an accepted pair is merged into its relationship's memory
|
|
40
|
+
* under `groupMembers` (class V, 5580), as at a star's completion. */
|
|
41
|
+
export declare function withGroupHits(state: HolderState, hits: readonly GroupStarRehit[], group: string): HolderState;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=group-star.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group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AACH,wBAAsB,gBAAgB,CAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAyB/G;AAED;;uEAEuE;AACvE,wBAAgB,aAAa,CAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAmB9G"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { xRawOfMk } from '../crypto.js';
|
|
2
|
+
import { buildGroupStarWith, groupStarChunkOk, groupStarKeyOf, groupStarUnionOk, openGroupStarWith } from '../group-star.js';
|
|
3
|
+
import { macU } from '../anchor.js';
|
|
4
|
+
import { jcs } from '../core.js';
|
|
5
|
+
import { classOnToward, entryRelationships, lags } from './state.js';
|
|
6
|
+
/** The registered task type that carries group-star@1 (Delivery §4.4, 5740). */
|
|
7
|
+
export const GROUP_STAR_TYPE = 'https://real-life.org/trust-tasks/group-star/0.1';
|
|
8
|
+
const cmp = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
9
|
+
/** Whether the sealed group star is on for (group, contact) (2830, 2760). */
|
|
10
|
+
export function sealedOn(c, group) {
|
|
11
|
+
const s = Object.hasOwn(c.groupSettings, group) ? c.groupSettings[group] : 'default';
|
|
12
|
+
return s === 'default' ? classOnToward(c, 'sealedGroupStar') : s === 'on';
|
|
13
|
+
}
|
|
14
|
+
/** The group-star view toward contact c on relationship r (5730). */
|
|
15
|
+
export function groupStarView(state, c, rel) {
|
|
16
|
+
const lagging = lags(rel, entryRelationships(state, c));
|
|
17
|
+
return Object.values(state.groups).filter((g) => g.listed).sort((a, b) => cmp(a.id, b.id)).map((g) => {
|
|
18
|
+
if (lagging || !sealedOn(c, g.id))
|
|
19
|
+
return { group: g.id, mode: 'digest' };
|
|
20
|
+
if (g.memberAnchor === undefined || g.memberOp === undefined)
|
|
21
|
+
throw new Error(`trust: listed group ${g.id} lacks memberAnchor or memberOp (5400)`);
|
|
22
|
+
return { group: g.id, mode: 'sealed', member: g.memberAnchor, memberOp: g.memberOp };
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
class Skip extends Error {
|
|
26
|
+
}
|
|
27
|
+
/** The group star as an artifact (5.2b, 5730–5770). */
|
|
28
|
+
export const GROUP_STAR = {
|
|
29
|
+
kind: 'groupStar',
|
|
30
|
+
type: GROUP_STAR_TYPE,
|
|
31
|
+
cls: 'groupStar',
|
|
32
|
+
malformedRef: 'RLTP-TRU-5370',
|
|
33
|
+
out: (t) => t.groupStarOut,
|
|
34
|
+
withOut: (t, o) => ({ ...t, groupStarOut: o }),
|
|
35
|
+
inn: (t) => t.groupStarIn,
|
|
36
|
+
withIn: (t, i) => ({ ...t, groupStarIn: i }),
|
|
37
|
+
view: groupStarView,
|
|
38
|
+
uniform: false,
|
|
39
|
+
async build(ctx, p) {
|
|
40
|
+
const groups = ctx.snapshot.groups;
|
|
41
|
+
const theirX = xRawOfMk(p.tuple.counterpartKeyAgreement);
|
|
42
|
+
if (!theirX)
|
|
43
|
+
return null;
|
|
44
|
+
try {
|
|
45
|
+
const { chunks } = await buildGroupStarWith({
|
|
46
|
+
shared: p.shared, sender: p.own, to: p.tuple.counterpartAnchor, salt: p.salt, subtle: ctx.crypto.subtle,
|
|
47
|
+
groups: p.view.map((item) => item.mode === 'digest'
|
|
48
|
+
? { group: item.group, sealed: false }
|
|
49
|
+
: {
|
|
50
|
+
group: item.group, sealed: true, member: item.member, memberOp: item.memberOp,
|
|
51
|
+
// 5400: the proof under memberX_sender × pairX_recipient
|
|
52
|
+
memberShared: async () => {
|
|
53
|
+
const label = groups[item.group].memberLabel;
|
|
54
|
+
const m = await ctx.keys.anchorOf(label);
|
|
55
|
+
if (m.anchor !== item.member)
|
|
56
|
+
throw new Error(`trust: group ${item.group}: memberAnchor is not the anchor of memberLabel`);
|
|
57
|
+
const release = (rkid) => (rkid === m.keyAgreement ? { status: 'live', label } : { status: 'unknown' });
|
|
58
|
+
const a = await ctx.keys.agree(m.keyAgreement, theirX, release);
|
|
59
|
+
if (a.status !== 'available')
|
|
60
|
+
throw new Skip();
|
|
61
|
+
return a.shared;
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
draw: (n, kind) => ctx.entropy.bytes(kind === 'nonce' ? 'groupstar.nonce' : 'pad', n),
|
|
65
|
+
});
|
|
66
|
+
return chunks;
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
if (e instanceof Skip)
|
|
70
|
+
return null;
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
chunkOk: groupStarChunkOk,
|
|
75
|
+
async macOk(ctx, p) {
|
|
76
|
+
const S = ctx.crypto.subtle;
|
|
77
|
+
const kg = await groupStarKeyOf(p.shared, p.from, p.own, p.salt, S);
|
|
78
|
+
const ch = p.chunk;
|
|
79
|
+
return (await macU(kg, jcs(ch.body), S)) === ch.proof.mac;
|
|
80
|
+
},
|
|
81
|
+
entries: (body) => body.groups,
|
|
82
|
+
async complete(ctx, p) {
|
|
83
|
+
const union = p.union;
|
|
84
|
+
const bad = groupStarUnionOk(union);
|
|
85
|
+
if (bad !== null)
|
|
86
|
+
return { ok: false, ref: bad === 'order' ? 'RLTP-TRU-5300' : bad === 'size' ? 'RLTP-TRU-5500' : 'RLTP-TRU-5510' };
|
|
87
|
+
// 5520: every group the holder is a current member of, resolved through Access
|
|
88
|
+
const memberships = [];
|
|
89
|
+
for (const g of Object.keys(ctx.snapshot.groups).sort()) {
|
|
90
|
+
const ga = ctx.access ? await ctx.access.membership(g) : null;
|
|
91
|
+
memberships.push({ group: g, isMember: (a) => ga?.isMember(a) ?? false, resolve: (oid) => ga?.resolve(oid) ?? null });
|
|
92
|
+
}
|
|
93
|
+
const t = p.tuple;
|
|
94
|
+
const results = await openGroupStarWith({
|
|
95
|
+
shared: p.shared, from: p.from, own: p.own, salt: p.salt, entries: union, memberships, subtle: ctx.crypto.subtle,
|
|
96
|
+
agreeMember: async (keyAgreement) => {
|
|
97
|
+
const x = xRawOfMk(keyAgreement);
|
|
98
|
+
if (!x)
|
|
99
|
+
return null;
|
|
100
|
+
const a = await ctx.keys.agree(t.rkid, x, ctx.release);
|
|
101
|
+
return a.status === 'available' ? a.shared : null;
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
const hits = results.filter((r) => r.hit).map((r) => r.group).sort();
|
|
105
|
+
const entries = union;
|
|
106
|
+
const pairs = results.filter((r) => r.accepted);
|
|
107
|
+
let memory;
|
|
108
|
+
if (pairs.length) {
|
|
109
|
+
// class V (5580): holder-local, keyed by group
|
|
110
|
+
const held = (p.rel.memory.groupMembers ?? {});
|
|
111
|
+
const merged = { ...held };
|
|
112
|
+
for (const r of pairs)
|
|
113
|
+
merged[r.group] = { member: r.member, memberOp: r.memberOp };
|
|
114
|
+
memory = { groupMembers: merged };
|
|
115
|
+
}
|
|
116
|
+
return { ok: true, accepted: { salt: p.salt, entries, groups: hits }, ...(memory ? { memory } : {}) };
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* 5520–5580 for a group the holder joins, over the group stars it already
|
|
121
|
+
* accepted: d = HMAC(k_g, G) tested against each stored union, and on a
|
|
122
|
+
* hit the sealed pair opened and checked in the order of 5530–5570
|
|
123
|
+
* against `membership` (the joined group's roster as the welcome carries
|
|
124
|
+
* it), exactly as at a star's completion. k_g and k_e are the accepted
|
|
125
|
+
* star's (its sender, this holder's pair anchor, its salt), through the
|
|
126
|
+
* KeyProvider under the engine's release. Async: the caller prepares it
|
|
127
|
+
* and applies withGroupHits in its commit.
|
|
128
|
+
*/
|
|
129
|
+
export async function groupStarRematch(ctx, membership) {
|
|
130
|
+
const out = [];
|
|
131
|
+
for (const r of Object.values(ctx.snapshot.relationships)) {
|
|
132
|
+
for (const t of r.tuples) {
|
|
133
|
+
const acc = t.groupStarIn.accepted;
|
|
134
|
+
if (!acc || acc.groups.includes(membership.group))
|
|
135
|
+
continue;
|
|
136
|
+
const x = xRawOfMk(t.counterpartKeyAgreement);
|
|
137
|
+
if (!x)
|
|
138
|
+
continue;
|
|
139
|
+
const a = await ctx.keys.agree(t.rkid, x, ctx.release);
|
|
140
|
+
if (a.status !== 'available')
|
|
141
|
+
continue;
|
|
142
|
+
const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor;
|
|
143
|
+
const [res] = await openGroupStarWith({
|
|
144
|
+
shared: a.shared, from: t.counterpartAnchor, own, salt: acc.salt, entries: acc.entries, memberships: [membership], subtle: ctx.crypto.subtle,
|
|
145
|
+
agreeMember: async (keyAgreement) => {
|
|
146
|
+
const mx = xRawOfMk(keyAgreement);
|
|
147
|
+
if (!mx)
|
|
148
|
+
return null;
|
|
149
|
+
const m = await ctx.keys.agree(t.rkid, mx, ctx.release);
|
|
150
|
+
return m.status === 'available' ? m.shared : null;
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
if (!res?.hit)
|
|
154
|
+
continue;
|
|
155
|
+
out.push(res.accepted ? { label: t.ownPairLabel, member: res.member, memberOp: res.memberOp } : { label: t.ownPairLabel });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return out.sort((p, q) => cmp(p.label, q.label));
|
|
159
|
+
}
|
|
160
|
+
/** The re-match committed: `group` joins the accepted groups of the hit
|
|
161
|
+
* tuples, and an accepted pair is merged into its relationship's memory
|
|
162
|
+
* under `groupMembers` (class V, 5580), as at a star's completion. */
|
|
163
|
+
export function withGroupHits(state, hits, group) {
|
|
164
|
+
if (!hits.length)
|
|
165
|
+
return state;
|
|
166
|
+
const byLabel = new Map(hits.map((h) => [h.label, h]));
|
|
167
|
+
const relationships = {};
|
|
168
|
+
for (const [id, r] of Object.entries(state.relationships)) {
|
|
169
|
+
if (!r.tuples.some((t) => byLabel.has(t.ownPairLabel))) {
|
|
170
|
+
relationships[id] = r;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
let memory = r.memory;
|
|
174
|
+
const tuples = r.tuples.map((t) => {
|
|
175
|
+
const h = byLabel.get(t.ownPairLabel);
|
|
176
|
+
if (!h || !t.groupStarIn.accepted || t.groupStarIn.accepted.groups.includes(group))
|
|
177
|
+
return t;
|
|
178
|
+
if (h.member !== undefined) {
|
|
179
|
+
const held = (memory.groupMembers ?? {});
|
|
180
|
+
memory = { ...memory, groupMembers: { ...held, [group]: { member: h.member, memberOp: h.memberOp } } };
|
|
181
|
+
}
|
|
182
|
+
return { ...t, groupStarIn: { ...t.groupStarIn, accepted: { ...t.groupStarIn.accepted, groups: [...t.groupStarIn.accepted.groups, group].sort() } } };
|
|
183
|
+
});
|
|
184
|
+
relationships[id] = { ...r, tuples, memory };
|
|
185
|
+
}
|
|
186
|
+
return { ...state, relationships };
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=group-star.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-star.js","sourceRoot":"","sources":["../../src/trust/group-star.ts"],"names":[],"mappings":"AAsDA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAE5H,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAIhC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGpE,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,kDAAkD,CAAA;AAEjF,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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AAM,EAAE,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAA;QACvJ,CAAC,CAAC,CAAA;QACF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;IAC9C,CAAC;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,CAAA;AACpC,CAAC","sourcesContent":["// trust/group-star — the group star on the holder (lib Stage 2, PR 4b):\n// group-star@1 as the registered task group-star/0.1 (5.2b), reconciled\n// per recipient over its own domain, baseline and salt sequence (5730,\n// 5740), on the machinery of trust/star.ts; the pure forms are the root\n// module's (group-star.ts).\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// What it registers (through trustModule, trust/mapping.ts):\n// sweep trust.groupStar the reconciliation of 5730 toward every\n// contact the blinded group star class is on\n// toward (5760)\n// task group-star/0.1 (proof absent) reception (5500–5580)\n// ack group-star/0.1 completion by the acks of every chunk (5740)\n//\n// The view toward contact c on relationship r (5730): one item per group\n// of state.groups that is listed (5420, the per-group switch of 5.2b),\n// sorted by group; `sealed` with the own member anchor and memberOp\n// exactly when the sealed group star is on for (group, c) — the per-group\n// setting first (2830), else the class toward c (2760, 2840) — and r does\n// not lag (5430, 6595); otherwise `digest` (the entry's c is filler).\n// Zero groups is the empty view: one all-filler group star (5480). A\n// change of any of these is divergence toward exactly the contacts whose\n// view it alters (5750, 5770, 5800).\n//\n// Choices this file makes where note and spec leave them open:\n// - 5430's two filler conditions (sealed off for (group, contact), the\n// relationship lags) are the only ones: a listed group carries\n// memberAnchor and memberOp (codec.ts), and a listed group without them\n// where a pair is due is a broken invariant and throws, never filler.\n// memberAnchor must be the anchor of memberLabel; a mismatch throws too\n// - the sealed pair's proof agrees through the KeyProvider with the\n// member label's key-agreement key under a release derived from the\n// group (not from `addresses`: the member key is no delivery address),\n// as the anchor mapping does for the community key\n// - filler and AEAD nonces come from the Entropy port: `pad` for filler\n// d and c, `groupstar.nonce` for sealed pairs\n// - reception tests the union against every group in state.groups (the\n// holder's current groups); steps 4 and 5 of 5560/5570 resolve through\n// the Access port. Without an Access port, or where it does not know\n// the group, a hit is recorded but no pair is accepted\n// - `accepted` keeps the whole assembled union of {d, c} entries and the\n// groups among the holder's that hit (sharedGroups of the contact\n// view). The union stays so a group the holder joins later is matched\n// against the stars it already accepted (groupStarRematch, called by\n// the welcome): the hit, and a sealed pair opened and checked by\n// 5530–5570 against the joined group as at completion; a late joiner\n// sees the groups it shares with existing contacts, and their members,\n// without a new star, which the sender has no reason to send\n// - an accepted pair is class V (5580): merged into the relationship's\n// holder-local memory under `groupMembers` as { [G]: { member,\n// memberOp } }, a later accepted pair for G replacing it (5770); it is\n// never republished, carried into a group space or sent anywhere\nimport type { Json } from '../core.js'\nimport { xRawOfMk } from '../crypto.js'\nimport { buildGroupStarWith, groupStarChunkOk, groupStarKeyOf, groupStarUnionOk, openGroupStarWith } from '../group-star.js'\nimport type { GroupMembership } from '../group-star.js'\nimport { macU } from '../anchor.js'\nimport { jcs } from '../core.js'\nimport type { KeyRelease } from '../ports.js'\nimport type { PrepareCtx } from '../engine.js'\nimport type { Contact, Dec, Group, GroupStarItem, HolderState, Relationship, SeqIn } from '../state.js'\nimport { classOnToward, entryRelationships, lags } from './state.js'\nimport type { Artifact } from './star.js'\n\n/** The registered task type that carries group-star@1 (Delivery §4.4, 5740). */\nexport const GROUP_STAR_TYPE = 'https://real-life.org/trust-tasks/group-star/0.1'\n\nconst cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0)\n\n/** Whether the sealed group star is on for (group, contact) (2830, 2760). */\nexport function sealedOn (c: Readonly<Contact>, group: string): boolean {\n const s = Object.hasOwn(c.groupSettings, group) ? c.groupSettings[group] : 'default'\n return s === 'default' ? classOnToward(c, 'sealedGroupStar') : s === 'on'\n}\n\n/** The group-star view toward contact c on relationship r (5730). */\nexport function groupStarView (state: Readonly<HolderState>, c: Readonly<Contact>, rel: Readonly<Relationship>): GroupStarItem[] {\n const lagging = lags(rel, entryRelationships(state, c))\n return Object.values(state.groups).filter((g) => g.listed).sort((a, b) => cmp(a.id, b.id)).map((g): GroupStarItem => {\n if (lagging || !sealedOn(c, g.id)) return { group: g.id, mode: 'digest' }\n if (g.memberAnchor === undefined || g.memberOp === undefined) throw new Error(`trust: listed group ${g.id} lacks memberAnchor or memberOp (5400)`)\n return { group: g.id, mode: 'sealed', member: g.memberAnchor, memberOp: g.memberOp }\n })\n}\n\ntype GroupAccepted = NonNullable<SeqIn<{ salt: Dec, entries: Array<{ d: string, c: string }>, groups: string[] }>['accepted']>\ntype Entry = { d: string, c: string }\n\nclass Skip extends Error {}\n\n/** The group star as an artifact (5.2b, 5730–5770). */\nexport const GROUP_STAR: Artifact<GroupStarItem, GroupAccepted> = {\n kind: 'groupStar',\n type: GROUP_STAR_TYPE,\n cls: 'groupStar',\n malformedRef: 'RLTP-TRU-5370',\n out: (t) => t.groupStarOut,\n withOut: (t, o) => ({ ...t, groupStarOut: o }),\n inn: (t) => t.groupStarIn,\n withIn: (t, i) => ({ ...t, groupStarIn: i }),\n view: groupStarView,\n uniform: false,\n async build (ctx, p) {\n const groups: Record<string, Group> = ctx.snapshot.groups\n const theirX = xRawOfMk(p.tuple.counterpartKeyAgreement)\n if (!theirX) return null\n try {\n const { chunks } = await buildGroupStarWith({\n shared: p.shared, sender: p.own, to: p.tuple.counterpartAnchor, salt: p.salt, subtle: ctx.crypto.subtle,\n groups: p.view.map((item) => item.mode === 'digest'\n ? { group: item.group, sealed: false }\n : {\n group: item.group, sealed: true, member: item.member, memberOp: item.memberOp,\n // 5400: the proof under memberX_sender × pairX_recipient\n memberShared: async () => {\n const label = groups[item.group].memberLabel\n const m = await ctx.keys.anchorOf(label)\n if (m.anchor !== item.member) throw new Error(`trust: group ${item.group}: memberAnchor is not the anchor of memberLabel`)\n const release: KeyRelease = (rkid) => (rkid === m.keyAgreement ? { status: 'live', label } : { status: 'unknown' })\n const a = await ctx.keys.agree(m.keyAgreement, theirX, release)\n if (a.status !== 'available') throw new Skip()\n return a.shared\n },\n }),\n draw: (n, kind) => ctx.entropy.bytes(kind === 'nonce' ? 'groupstar.nonce' : 'pad', n),\n })\n return chunks as unknown as Json[]\n } catch (e) {\n if (e instanceof Skip) return null\n throw e\n }\n },\n chunkOk: groupStarChunkOk,\n async macOk (ctx, p) {\n const S = ctx.crypto.subtle\n const kg = await groupStarKeyOf(p.shared, p.from, p.own, p.salt, S)\n const ch = p.chunk as { body: Json, proof: { mac: string } }\n return (await macU(kg, jcs(ch.body), S)) === ch.proof.mac\n },\n entries: (body) => (body as { groups: Json[] }).groups,\n async complete (ctx, p) {\n const union = p.union as Entry[]\n const bad = groupStarUnionOk(union)\n if (bad !== null) return { ok: false, ref: bad === 'order' ? 'RLTP-TRU-5300' : bad === 'size' ? 'RLTP-TRU-5500' : 'RLTP-TRU-5510' }\n // 5520: every group the holder is a current member of, resolved through Access\n const memberships: GroupMembership[] = []\n for (const g of Object.keys(ctx.snapshot.groups).sort()) {\n const ga = ctx.access ? await ctx.access.membership(g) : null\n memberships.push({ group: g, isMember: (a) => ga?.isMember(a) ?? false, resolve: (oid) => ga?.resolve(oid) ?? null })\n }\n const t = p.tuple\n const results = await openGroupStarWith({\n shared: p.shared, from: p.from, own: p.own, salt: p.salt, entries: union, memberships, subtle: ctx.crypto.subtle,\n agreeMember: async (keyAgreement) => {\n const x = xRawOfMk(keyAgreement)\n if (!x) return null\n const a = await ctx.keys.agree(t.rkid, x, ctx.release)\n return a.status === 'available' ? a.shared : null\n },\n })\n const hits = results.filter((r) => r.hit).map((r) => r.group).sort()\n const entries = union\n const pairs = results.filter((r) => r.accepted)\n let memory: Record<string, Json> | undefined\n if (pairs.length) {\n // class V (5580): holder-local, keyed by group\n const held = (p.rel.memory.groupMembers ?? {}) as Record<string, Json>\n const merged: Record<string, Json> = { ...held }\n for (const r of pairs) merged[r.group] = { member: r.member!, memberOp: r.memberOp! }\n memory = { groupMembers: merged }\n }\n return { ok: true, accepted: { salt: p.salt, entries, groups: hits }, ...(memory ? { memory } : {}) }\n },\n}\n\n/** One tuple's outcome of the re-match: the hit, and the accepted pair if one opened. */\nexport interface GroupStarRehit { label: string, member?: string, memberOp?: string }\n\n/**\n * 5520–5580 for a group the holder joins, over the group stars it already\n * accepted: d = HMAC(k_g, G) tested against each stored union, and on a\n * hit the sealed pair opened and checked in the order of 5530–5570\n * against `membership` (the joined group's roster as the welcome carries\n * it), exactly as at a star's completion. k_g and k_e are the accepted\n * star's (its sender, this holder's pair anchor, its salt), through the\n * KeyProvider under the engine's release. Async: the caller prepares it\n * and applies withGroupHits in its commit.\n */\nexport async function groupStarRematch (ctx: PrepareCtx, membership: GroupMembership): Promise<GroupStarRehit[]> {\n const out: GroupStarRehit[] = []\n for (const r of Object.values(ctx.snapshot.relationships)) {\n for (const t of r.tuples) {\n const acc = t.groupStarIn.accepted\n if (!acc || acc.groups.includes(membership.group)) continue\n const x = xRawOfMk(t.counterpartKeyAgreement)\n if (!x) continue\n const a = await ctx.keys.agree(t.rkid, x, ctx.release)\n if (a.status !== 'available') continue\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n const [res] = await openGroupStarWith({\n shared: a.shared, from: t.counterpartAnchor, own, salt: acc.salt, entries: acc.entries, memberships: [membership], subtle: ctx.crypto.subtle,\n agreeMember: async (keyAgreement) => {\n const mx = xRawOfMk(keyAgreement)\n if (!mx) return null\n const m = await ctx.keys.agree(t.rkid, mx, ctx.release)\n return m.status === 'available' ? m.shared : null\n },\n })\n if (!res?.hit) continue\n out.push(res.accepted ? { label: t.ownPairLabel, member: res.member!, memberOp: res.memberOp! } : { label: t.ownPairLabel })\n }\n }\n return out.sort((p, q) => cmp(p.label, q.label))\n}\n\n/** The re-match committed: `group` joins the accepted groups of the hit\n * tuples, and an accepted pair is merged into its relationship's memory\n * under `groupMembers` (class V, 5580), as at a star's completion. */\nexport function withGroupHits (state: HolderState, hits: readonly GroupStarRehit[], group: string): HolderState {\n if (!hits.length) return state\n const byLabel = new Map(hits.map((h) => [h.label, h]))\n const relationships: Record<string, Relationship> = {}\n for (const [id, r] of Object.entries(state.relationships)) {\n if (!r.tuples.some((t) => byLabel.has(t.ownPairLabel))) { relationships[id] = r; continue }\n let memory = r.memory\n const tuples = r.tuples.map((t) => {\n const h = byLabel.get(t.ownPairLabel)\n if (!h || !t.groupStarIn.accepted || t.groupStarIn.accepted.groups.includes(group)) return t\n if (h.member !== undefined) {\n const held = (memory.groupMembers ?? {}) as Record<string, Json>\n memory = { ...memory, groupMembers: { ...held, [group]: { member: h.member, memberOp: h.memberOp! } } }\n }\n return { ...t, groupStarIn: { ...t.groupStarIn, accepted: { ...t.groupStarIn.accepted, groups: [...t.groupStarIn.accepted.groups, group].sort() } } }\n })\n relationships[id] = { ...r, tuples, memory }\n }\n return { ...state, relationships }\n}\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Json } from '../core.js';
|
|
2
|
+
import type { Applied, HolderModule } from '../engine.js';
|
|
3
|
+
import type { HolderState, Setting, TrustClass } from '../state.js';
|
|
4
|
+
/** The registered task type that carries anchor-mapping@4 (Delivery §4.4). */
|
|
5
|
+
export declare const ANCHOR_MAPPING_TYPE = "https://real-life.org/trust-tasks/anchor-mapping/0.3";
|
|
6
|
+
/** The trust module's command names. */
|
|
7
|
+
export declare const TRUST_COMMANDS: Readonly<{
|
|
8
|
+
readonly set: "trust.set";
|
|
9
|
+
readonly setClass: "trust.setClass";
|
|
10
|
+
readonly setGroupClass: "trust.setGroupClass";
|
|
11
|
+
readonly pause: "trust.pause";
|
|
12
|
+
readonly recover: "trust.recover";
|
|
13
|
+
}>;
|
|
14
|
+
export interface TrustSetInput {
|
|
15
|
+
contactId: string;
|
|
16
|
+
on: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TrustSetClassInput {
|
|
19
|
+
contactId: string;
|
|
20
|
+
cls: TrustClass;
|
|
21
|
+
setting: Setting;
|
|
22
|
+
}
|
|
23
|
+
export interface TrustSetGroupClassInput {
|
|
24
|
+
contactId: string;
|
|
25
|
+
groupId: string;
|
|
26
|
+
setting: Setting;
|
|
27
|
+
}
|
|
28
|
+
export interface TrustPauseInput {
|
|
29
|
+
contactId: string;
|
|
30
|
+
paused: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The lineage a mapping on one relationship carries (6020, 6420): empty
|
|
34
|
+
* where nothing was issued there under an earlier anchor, otherwise the
|
|
35
|
+
* holder's lineage from the element that leaves the relationship's
|
|
36
|
+
* earliest anchor (2285) to `self`, at most the LINEAGE_MAX most recent.
|
|
37
|
+
*/
|
|
38
|
+
export declare function lineageSegment(lineage: readonly Json[], earliest: string | null, self: string): Json[];
|
|
39
|
+
/** First, pending entries are admitted in position order while the set
|
|
40
|
+
* has room (2250): they hold earlier positions than any re-commit. Then
|
|
41
|
+
* (2240) every relationship holding a verified mapping on a tuple whose
|
|
42
|
+
* entry holds no position re-commits that entry, in the order of
|
|
43
|
+
* entryOrder.heads (2180), then by relationship id, at the next position,
|
|
44
|
+
* admitted or pending by what room is left. */
|
|
45
|
+
export declare function recommitEntries(state: Readonly<HolderState>, bound?: bigint): Applied;
|
|
46
|
+
export interface TrustModuleOptions {
|
|
47
|
+
/** the deliverable set's bound (2050); another value is for tests only */
|
|
48
|
+
admissionBound?: bigint;
|
|
49
|
+
/** the receiver's resource limit of 5365 (highest seq of an open
|
|
50
|
+
* assembly) for star, group star and probe; default ASSEMBLY_LIMIT,
|
|
51
|
+
* another value is for tests only */
|
|
52
|
+
assemblyLimit?: number;
|
|
53
|
+
}
|
|
54
|
+
/** The trust module createHolder builds in (see the header). */
|
|
55
|
+
export declare function trustModule(opts?: TrustModuleOptions): HolderModule;
|
|
56
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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