@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":"duties.js","sourceRoot":"","sources":["../../src/trust/duties.ts"],"names":[],"mappings":"AA0DA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,yEAAyE;AACzE,MAAM,CAAC,MAAM,YAAY,GAA0B,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,CAAA;AAC9F,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAA0B,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAA;AAExG,4CAA4C;AAC5C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAe,EAAE,KAAa,EAAU,EAAE,CAAC,YAAY,GAAG,IAAI,KAAK,EAAE,CAAA;AAC/F,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,WAAW,KAAK,EAAE,CAAA;AAE1E;;uEAEuE;AACvE,MAAM,UAAU,WAAW,CAAE,CAAO;IAClC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA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AA;AACH,CAAC;AAED,uFAAuF;AACvF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA4B,EAAE,CAAoB,EAAE,GAAe,EAAY,EAAE,CAC/G,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA","sourcesContent":["// trust/duties — the class duties of Section 2a in one place (lib Stage 2,\n// PR 5): when a trust class is on for a relationship (2850, 6595), which\n// duties deliver it, and the one open / drop / move logic every\n// transition that changes settings, entries or relationships runs: the\n// Trust act and the class settings (2770–2840), a merge (2160), a split\n// (2115), a departure (2260), the entry commit of a verification and a\n// chaining (6a.4). The anchor mapping (6370, 6410, 6596), the star\n// classes (5.4) and the profile (6455, 6465) share it.\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// The model. A class is on for a relationship when it is on toward the\n// entry the relationship's verifications go to (2145, 2146), the\n// relationship is live, and, except for the star and the blinded group\n// star, it does not lag (6595). How a class reaches a relationship:\n// - star, blinded and sealed group star: the reconciliation of 5.4\n// (trust/star.ts, trust/group-star.ts). Its sweep reads the settings\n// through its view: a class turning on adds a pending key (the\n// engine's wake names `when`), a class turning off stops production\n// and leaves the baseline as it is (5830, 5760), so turning on again\n// re-evaluates against that baseline (5850). No duty\n// - anchor mapping: class-on/1 `class-on:anchorMapping:<relId>` (2850)\n// and reissue-mapping/1 (6370, 6596)\n// - profile: class-on/1 `class-on:profile:<relId>` (2850, 6455) and\n// profile/1 `profile:<relId>` for a new revision (6455), both issued by\n// trust/profile.ts\n//\n// The follow rule (followClasses), run on (before, after) of a transition:\n// open per live relationship and duty class: on for it now and not\n// before (it turned on toward the entry, or the relationship\n// ceased to lag, or it is new to an entry the class is on toward)\n// opens the class-on duty, unless one is open\n// drop per relationship: a duty class off toward the entry its\n// verifications go to drops every duty of that class owed on it\n// (6410, 2790: nothing more while off). A relationship that only\n// started to lag keeps its duties: the anchor mapping's class-on\n// is fulfilled without sending, its re-issue still goes (6596)\n// move at a chaining, every class duty owed on the chain and on the\n// appended relationship moves to the chain under the entry that\n// takes its verifications (moveDuties)\n//\n// Choices this file makes where note and spec leave them open:\n// - the profile class-on duty opens only where an own profile exists\n// (state.profile.body): 2850 and 6455 owe \"the class's current\n// artifact\", and before the first profile there is none. A profile set\n// later goes out by its own revision duty (6455, trust/profile.ts)\n// - 6465 (the profile on the new head after a chaining, a SHOULD) is\n// followed: the chaining opens the profile's class-on duty on the\n// chain where the class is on for it (afterChain)\n// - a duty of a kind or version this library does not handle is opaque:\n// classOfDuty names no class for it, so nothing here moves, drops or\n// opens anything for it (note §2.1: unknown kinds are kept as they are)\n// - which transitions may drop a duty is listed in invariants.ts\n// (dutyDrops): fulfilment by resume, the drop rule above, departure of\n// its relationship, the move at a chaining, a merge duty that no longer\n// holds, and the continuity flow's own ends\nimport type { DutyHandler } from '../engine.js'\nimport type { ClassOnDuty, Contact, Duty, HolderState, ProfileDuty, ReissueMappingDuty, Relationship, TrustClass } from '../state.js'\nimport { classOnToward, entryOf, entryRelationships, lags, liveRel } from './state.js'\nimport { isKnownDuty } from '../codec.js'\n\n/** The classes a class-on duty delivers (2850), in the table's order. */\nexport const DUTY_CLASSES: readonly TrustClass[] = Object.freeze(['anchorMapping', 'profile'])\n/** The classes the reconciliation of 5.4 delivers. */\nexport const RECONCILED: readonly TrustClass[] = Object.freeze(['star', 'groupStar', 'sealedGroupStar'])\n\n/** The class-on duty's deterministic id. */\nexport const classOnId = (cls: TrustClass, relId: string): string => `class-on:${cls}:${relId}`\n/** The profile revision duty's deterministic id (6455). */\nexport const profileDutyId = (relId: string): string => `profile:${relId}`\n\n/** The class a duty delivers on one relationship, or null for every other\n * kind — and for a known kind at a version this library does not handle,\n * which stays opaque: never moved, dropped or checked (note §2.1). */\nexport function classOfDuty (d: Duty): TrustClass | null {\n if (!isKnownDuty(d)) return null\n if (d.kind === 'class-on') return (d as ClassOnDuty).cls\n if (d.kind === 'reissue-mapping') return 'anchorMapping'\n if (d.kind === 'profile') return 'profile'\n return null\n}\n\n/** Is `d` a duty of a duty class owed on `relId` (of class `cls`, where given)? */\nexport const owedOn = (d: Duty, relId: string, cls?: TrustClass): boolean => {\n const c = classOfDuty(d)\n return c !== null && (cls === undefined || c === cls) && (d as { relId?: unknown }).relId === relId\n}\n\n/** Whether the class has an artifact to send now: the profile once one exists. */\nexport const hasArtifact = (state: Readonly<HolderState>, cls: TrustClass): boolean =>\n cls !== 'profile' || state.profile.body !== null\n\n/**\n * Whether `cls` is on for relationship `r` (2850, 6595): on toward the\n * entry its verifications go to, the relationship live, and, except for\n * the star and the blinded group star, not lagging in that entry.\n */\nexport function onFor (state: Readonly<HolderState>, r: Readonly<Relationship>, cls: TrustClass): boolean {\n if (!liveRel(r)) return false\n const c = entryOf(state, r)\n if (!c || !c.relIds.includes(r.id) || !classOnToward(c, cls)) return false\n if (cls === 'star' || cls === 'groupStar') return true\n return !lags(r, entryRelationships(state, c))\n}\n\n/** A class-on duty of `cls` on `relId`, unless one is open in `state` or among `extra`. */\nexport function classOnDuty (state: Readonly<HolderState>, contactId: string, relId: string, cls: TrustClass, extra: readonly Duty[] = []): ClassOnDuty[] {\n const id = classOnId(cls, relId)\n if (Object.hasOwn(state.duties, id) || extra.some((d) => d.id === id)) return []\n return [{ kind: 'class-on', v: 1, id, contactId, relId, cls }]\n}\n\n/** The drop rule (6410, 2790): every duty of a duty class owed on a\n * relationship whose entry has that class off goes; `extra` (duties a\n * transition is about to open) is filtered the same way. */\nexport function dropOff (state: HolderState, extra: readonly Duty[] = []): { state: HolderState, extra: Duty[] } {\n const off = (d: Duty): boolean => {\n const cls = classOfDuty(d)\n if (cls === null) return false\n const relId = (d as { relId: string }).relId\n if (!Object.hasOwn(state.relationships, relId)) return false\n const r = state.relationships[relId]\n if (r.chainedInto !== null) return false // moved at the chaining\n const c = entryOf(state, r)\n return c !== undefined && !classOnToward(c, cls)\n }\n const gone = Object.values(state.duties).filter(off)\n const next = gone.length\n ? { ...state, duties: Object.fromEntries(Object.entries(state.duties).filter(([, d]) => !off(d))) }\n : state\n return { state: next, extra: extra.filter((d) => !off(d)) }\n}\n\n/**\n * The follow rule (see the header) over a transition from `before` to\n * `after`: the drop rule on `after`, then a class-on duty for every live\n * relationship and duty class on for it now and not before. `extra` are\n * the duties the transition opens besides (kept, deduplicated against);\n * the result's `duties` are those and the new ones.\n */\nexport function followClasses (before: Readonly<HolderState>, after: HolderState, extra: readonly Duty[] = []): { state: HolderState, duties: Duty[] } {\n const d = dropOff(after, extra)\n const state = d.state\n const duties: Duty[] = [...d.extra]\n for (const id of Object.keys(state.relationships).sort()) {\n const r = state.relationships[id]\n if (!liveRel(r)) continue\n const was = Object.hasOwn(before.relationships, id) ? before.relationships[id] : undefined\n for (const cls of DUTY_CLASSES) {\n if (!hasArtifact(state, cls) || !onFor(state, r, cls)) continue\n if (was && onFor(before, was, cls)) continue\n duties.push(...classOnDuty(state, entryOf(state, r)!.id, id, cls, duties))\n }\n }\n return { state, duties }\n}\n\n/**\n * The move at a chaining (6a.4, 2146): the class duties owed on `from`\n * (the chain, then the appended relationship) go to `relId` under\n * `contactId`, none dropped. Several re-issues are one (6596: one delivery\n * meets every re-issue owed), its urgency kept: the earliest dueAt (absent:\n * at once) and the most urgent awaited head (null, due at once, wins; else\n * the first's); several class-on duties of one class are one; several\n * profile duties are one, at the highest revision.\n */\nexport function moveDuties (state: HolderState, from: readonly string[], relId: string, contactId: string): HolderState {\n const owed = Object.values(state.duties)\n .filter((d) => classOfDuty(d) !== null && from.includes((d as { relId: string }).relId))\n .sort((a, b) => from.indexOf((a as { relId: string }).relId) - from.indexOf((b as { relId: string }).relId))\n if (!owed.length) return state\n const duties = { ...state.duties }\n for (const d of owed) delete duties[d.id]\n const reissues = owed.filter((d): d is ReissueMappingDuty => d.kind === 'reissue-mapping')\n if (reissues.length) {\n // urgency kept: due at the earliest of them (absent: at once), not\n // waiting where any was due without a wait\n const { dueAt: _, ...base } = reissues[0]\n const awaitHead = reissues.some((d) => d.awaitHead === null) ? null : base.awaitHead\n const dues = reissues.map((d) => d.dueAt)\n const dueAt = dues.some((x) => x === undefined) ? undefined : Math.min(...(dues as number[]))\n duties[base.id] = { ...base, contactId, relId, awaitHead, ...(dueAt !== undefined ? { dueAt } : {}) }\n }\n for (const d of owed.filter((x): x is ClassOnDuty => x.kind === 'class-on')) {\n const id = classOnId(d.cls, relId)\n if (!Object.hasOwn(duties, id)) duties[id] = { ...d, id, contactId, relId }\n }\n const profiles = owed.filter((d): d is ProfileDuty => d.kind === 'profile')\n if (profiles.length) {\n const top = profiles.reduce((a, b) => (BigInt(b.rev) > BigInt(a.rev) ? b : a))\n const id = profileDutyId(relId)\n const held = Object.hasOwn(duties, id) ? duties[id] as ProfileDuty : undefined\n if (!held || BigInt(top.rev) > BigInt(held.rev)) duties[id] = { ...top, id, contactId, relId }\n }\n return { ...state, duties }\n}\n\n/** 6465: after a chaining, the profile's class-on duty on the chain where\n * the class is on for it and a profile exists. */\nexport function afterChain (state: Readonly<HolderState>, relId: string, extra: readonly Duty[]): Duty[] {\n const r = state.relationships[relId]\n if (!r || !hasArtifact(state, 'profile') || !onFor(state, r, 'profile')) return []\n return classOnDuty(state, entryOf(state, r)!.id, relId, 'profile', extra)\n}\n\n/**\n * The class-on/1 handler: a reconciled class is fulfilled without sending\n * (its sweep runs in the same resume after the duties, 5850); a class with\n * a handler in `byClass` runs it (the anchor mapping, the profile); any\n * other waits.\n */\nexport function classOnHandler (byClass: Partial<Record<TrustClass, DutyHandler>>): DutyHandler {\n const of = (d: Duty): TrustClass => (d as ClassOnDuty).cls\n return {\n v: 1,\n prepare: (ctx, duty) => {\n const h = byClass[of(duty)]\n return h?.prepare ? h.prepare(ctx, duty) : Promise.resolve(null)\n },\n apply (state, duty, ctx, when) {\n const cls = of(duty)\n if (RECONCILED.includes(cls)) return { state: state as HolderState }\n const h = byClass[cls]\n return h ? h.apply(state, duty, ctx, when) : 'not-due'\n },\n }\n}\n\n/** Every relationship of `c` the class is on for (2820, 2850): for tests and views. */\nexport const onRelationships = (state: Readonly<HolderState>, c: Readonly<Contact>, cls: TrustClass): string[] =>\n entryRelationships(state, c).filter((r) => onFor(state, r, cls)).map((r) => r.id)\n"]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { CommandDef, DutyHandler, EventDraft, IdentityRename, Refusal, Applied } from '../engine.js';
|
|
2
|
+
import type { Contact, HolderState, MergeDuty, Setting, TrustClass } from '../state.js';
|
|
3
|
+
/** The trust module's entry commands. */
|
|
4
|
+
export declare const ENTRY_COMMANDS: Readonly<{
|
|
5
|
+
readonly merge: "trust.merge";
|
|
6
|
+
readonly depart: "trust.depart";
|
|
7
|
+
}>;
|
|
8
|
+
export interface TrustMergeInput {
|
|
9
|
+
contactIds: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface TrustDepartInput {
|
|
12
|
+
contactId: string;
|
|
13
|
+
relationshipId?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The entry's anchor head from what its relationships hold (6560): the
|
|
17
|
+
* newest of the heads its feeding relationships hold; among several
|
|
18
|
+
* (a manual merge before its split) the one it holds, else `prefer`, else
|
|
19
|
+
* the smallest. Where a relationship of it feeds another entry (2145), the
|
|
20
|
+
* head only moves forward: with no feeding head, or none beyond it, it
|
|
21
|
+
* stays. With neither, the entry has none.
|
|
22
|
+
*/
|
|
23
|
+
export declare function settleHead(state: Readonly<HolderState>, c: Readonly<Contact>, prefer?: string | null): Contact;
|
|
24
|
+
/** 2250: pending entries join the set in position order while it has room. */
|
|
25
|
+
export declare function admitPending(state: Readonly<HolderState>, bound: bigint): HolderState;
|
|
26
|
+
interface RewriteOpts {
|
|
27
|
+
/** the relationships whose keys move: their tuples' entryId, their
|
|
28
|
+
* duties, the recipients of their documents; default all */
|
|
29
|
+
rels?: (relId: string) => boolean;
|
|
30
|
+
/** also the keys that name the person rather than a relationship: the
|
|
31
|
+
* matches of accepted stars, prompts, the entry ids of merge duties */
|
|
32
|
+
global?: boolean;
|
|
33
|
+
/** also the members of the star baselines and in-flight views (a
|
|
34
|
+
* rename: nothing diverges by it) */
|
|
35
|
+
baselines?: boolean;
|
|
36
|
+
/** collects the rename for the engine, which follows it in the stored
|
|
37
|
+
* acks (engine.ts Applied.renames) */
|
|
38
|
+
renames?: IdentityRename[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Every holder-local key that resolved through an identity in `ids` now
|
|
42
|
+
* resolves through `to` (2100, 2140), within `opts`: tuples' entryId,
|
|
43
|
+
* duties, the recipients of issued documents, and with `global` the
|
|
44
|
+
* matches of accepted stars and merge duties; and the contact references
|
|
45
|
+
* of the membership and introduction state and of prompts, each with the
|
|
46
|
+
* relationship of the tuple it was made on (2080): by the own rkid it
|
|
47
|
+
* arrived or went on (joining preludes and invites, groups' preludes,
|
|
48
|
+
* invitations and roster) or the own pair label toward the mediator
|
|
49
|
+
* (encounter.offers by their pin, the introducer provenance.via by
|
|
50
|
+
* viaPin, memory.vouchedBy by memory.vouchedPin), a prompt with the
|
|
51
|
+
* record it asks about; one that names no tuple follows with `global`.
|
|
52
|
+
* Contacts are the caller's: their ids
|
|
53
|
+
* and aliases are what the rewrite follows. The stored acks follow
|
|
54
|
+
* through the engine (opts.renames): only the core writes the effect
|
|
55
|
+
* cache, and their sealed envelopes stay as they are. Parts without a
|
|
56
|
+
* change keep their identity.
|
|
57
|
+
*/
|
|
58
|
+
export declare function rewriteIdentity(state: Readonly<HolderState>, ids: readonly string[], to: string, opts?: RewriteOpts): HolderState;
|
|
59
|
+
/** 2160: per class `off` where any held `off`, else `on` where any held
|
|
60
|
+
* `on`, else `default`; per (group, contact) the same, every per-group
|
|
61
|
+
* `on` reset where the merged sealed group star is `off` (5450). */
|
|
62
|
+
export declare function mergeSettings(cs: readonly Readonly<Contact>[]): {
|
|
63
|
+
settings: Record<TrustClass, Setting>;
|
|
64
|
+
groupSettings: Record<string, Setting>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Whether entries can be one (6605, 6560): no relationship of one holds
|
|
68
|
+
* another binding (or another successor) for an anchor a relationship of
|
|
69
|
+
* another holds, and their anchor heads lie on one chain of the links
|
|
70
|
+
* their relationships hold, so the merged entry has exactly one.
|
|
71
|
+
*/
|
|
72
|
+
export declare function mergeable(state: Readonly<HolderState>, cs: readonly Readonly<Contact>[]): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The atomic merge of entries (2140, 2150, 2160, 2180): one entry at the
|
|
75
|
+
* earliest position under the survivor's identity, the others its
|
|
76
|
+
* aliases; admitted where any was, so `k` admitted ones free `k−1` slots,
|
|
77
|
+
* which the next pending entries take in position order in the same step;
|
|
78
|
+
* every key of a merged id rewritten to the survivor; the anchor head
|
|
79
|
+
* settled (6560). Per-tuple keys stay with their tuples.
|
|
80
|
+
*/
|
|
81
|
+
export declare function mergeEntries(state: Readonly<HolderState>, cs: readonly Readonly<Contact>[], bound: bigint): Applied & {
|
|
82
|
+
survivor: string;
|
|
83
|
+
};
|
|
84
|
+
/** The merge onto a chosen survivor under identity `id` (its id or one of its aliases). */
|
|
85
|
+
export declare function mergeInto(state: Readonly<HolderState>, survivor: Readonly<Contact>, id: string, gone: readonly Readonly<Contact>[], bound: bigint): Applied & {
|
|
86
|
+
survivor: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The merge duties a commit on `relId` opens (2230): where the
|
|
90
|
+
* relationship stands behind another entry (2145) that is now mergeable
|
|
91
|
+
* with its own, and, with `net`, the convergence net of rung 2 for an
|
|
92
|
+
* accepted anchor mapping (6520–6605). One duty for every entry that
|
|
93
|
+
* joins, in position order while they stay mergeable together (2150).
|
|
94
|
+
*/
|
|
95
|
+
export declare function mergeDutiesAfter(before: Readonly<HolderState>, after: HolderState, relId: string, opts: {
|
|
96
|
+
net: boolean;
|
|
97
|
+
}): {
|
|
98
|
+
state: HolderState;
|
|
99
|
+
duties: MergeDuty[];
|
|
100
|
+
};
|
|
101
|
+
/** merge/1: the merge as one step after the verification commit (2230),
|
|
102
|
+
* re-checked against its witness; where it no longer holds, the duty is
|
|
103
|
+
* dropped without a trace (a later verification may open another). */
|
|
104
|
+
export declare const mergeDuty: (bound: bigint) => DutyHandler;
|
|
105
|
+
/** The chain aliases of a relationship (2090): the identities of the
|
|
106
|
+
* husks chained into it. */
|
|
107
|
+
export declare function chainAliases(state: Readonly<HolderState>, relId: string): string[];
|
|
108
|
+
/**
|
|
109
|
+
* 2080: the first verified mapping on `relId`, already in `mid`, leaves it
|
|
110
|
+
* holding no anchor the other relationships of its entry hold, or another
|
|
111
|
+
* binding for one they hold: the split, else null. The entry keeps its
|
|
112
|
+
* position, status, the remaining relationships with their aliases and
|
|
113
|
+
* its settings, frees no slot and settles its anchor head; the leaver
|
|
114
|
+
* takes its identity, its chain aliases and the settings of 2115, and
|
|
115
|
+
* holds no position until the caller's entry commit (2090).
|
|
116
|
+
*/
|
|
117
|
+
export declare function splitIfUnlinked(before: Readonly<HolderState>, mid: Readonly<HolderState>, relId: string): {
|
|
118
|
+
state: HolderState;
|
|
119
|
+
event: EventDraft;
|
|
120
|
+
renames: IdentityRename[];
|
|
121
|
+
} | null;
|
|
122
|
+
/** The split of `relId` from its entry (2080–2115). */
|
|
123
|
+
export declare function splitOff(state: Readonly<HolderState>, relId: string): {
|
|
124
|
+
state: HolderState;
|
|
125
|
+
event: EventDraft;
|
|
126
|
+
renames: IdentityRename[];
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Departure: the relationships leave the state with their husks; an entry
|
|
130
|
+
* left without relationships is removed (pending: 2260; admitted: its
|
|
131
|
+
* slot frees, 2250), one that keeps some drops their aliases, takes a new
|
|
132
|
+
* identity where theirs was its own (2100) and settles its anchor head
|
|
133
|
+
* (2080); pending entries are admitted in position order in the same
|
|
134
|
+
* step, so the set changes once (5860).
|
|
135
|
+
*/
|
|
136
|
+
export declare function depart(state: Readonly<HolderState>, input: TrustDepartInput, bound: bigint): Applied | Refusal;
|
|
137
|
+
export declare function entryCommands(bound: bigint): Record<string, CommandDef>;
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/trust/entries.ts"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACzG,OAAO,KAAK,EAAe,OAAO,EAAa,WAAW,EAAE,SAAS,EAA4C,OAAO,EAAY,UAAU,EAAS,MAAM,aAAa,CAAA;AAe1K,yCAAyC;AACzC,eAAO,MAAM,cAAc;;;EAA2E,CAAA;AAEtG,MAAM,WAAW,eAAe;IAAG,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE;AACzD,MAAM,WAAW,gBAAgB;IAAG,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE;AAIhF;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAiBrH;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAWtF;AAID,UAAU,WAAW;IACnB;iEAC6D;IAC7D,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACjC;4EACwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;0C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