@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":"continuity.js","sourceRoot":"","sources":["../../src/trust/continuity.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,mEAAmE;AACnE,iEAAiE;AACjE,wEAAwE;AACxE,wEAAwE;AACxE,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,wEAAwE;AACxE,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,wBAAwB;AACxB,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,yEAAyE;AACzE,0EAA0E;AAC1E,uEAAuE;AACvE,wEAAwE;AACxE,yEAAyE;AACzE,2EAA2E;AAC3E,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,wEAAwE;AACxE,yEAAyE;AACzE,sEAAsE;AACtE,yEAAyE;AACzE,sEAAsE;AACtE,0EAA0E;AAC1E,sEAAsE;AACtE,wEAAwE;AACxE,sEAAs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Aa,EAAE;KAC7F,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiB,MAAM,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,CAAC,SAAS,CAAC,EAAE;YACX,KAAK,EAAE,KAAK;YACZ,KAAK,CAAC,OAAO,CAAE,GAAe,EAAE,KAAoB;gBAClD,sDAAsD;gBACtD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;oBAC/B,IAAI,CAAC,CAAC,MAAM,KAAK,EAAE,IAAI,OAAO,GAAG,MAAM,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,YAAY;wBAAE,MAAM,IAAI,SAAS,CAAC,GAAG,SAAS,+DAA+D,CAAC,CAAA;gBACnM,CAAC;gBACD,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAA;YACnE,CAAC;YACD,KAAK,EAAE,CAAC,KAA4B,EAAE,QAA2B,EAAE,KAAoB,EAAE,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;SAC5G;KAC9C,CAAC;CACH,CAAC,CAAA","sourcesContent":["// trust/continuity — continuity on the holder (lib Stage 2, PR 4c; Trust\n// §6a, 6.4): the probe (6a.2), the continuity mapping (6a.4) and the\n// chaining it triggers, with the standing duties of 6a.3. Graduated from\n// probe/continuity.ts (buildProbe, receiveContinuity, handleProbe,\n// handleMapping, flushContinuity, chainTuple) and probe/trust.ts\n// (chainAdmission) onto HolderState and the engine; probe/continuity.ts\n// stays as it is for the simulators until PR 7. The pure wire forms are\n// the root module's (continuity.ts).\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// Spec follow-up 14 (Trust 0.32): 6900 has the record side chain\n// \"atomically with issuing its choice\", and 6910 lets it choose on the\n// first match. A probe hit is no evidence of the prior relationship: it\n// proves knowledge of the prior's counterpart anchor (a photographed card,\n// a mediator who saw it in the clear) and of the fresh tuple's k_p, never\n// possession of the prior relationship key, which only mac1 proves (6970).\n// Chaining on a hit lets anyone who knows a pair anchor take over that\n// relationship. This library therefore chains only on a verified mapping\n// of the counterpart, mac1 under the prior key: the record side issues its\n// choice on a hit and holds it as a candidate (the standing mapping duty,\n// 6840); it chains when the counterpart's report or alignment naming the\n// chosen prior verifies (6970). The non-record side already chains only on\n// the record side's verified mapping (6900). 6900/6910 need the evidence\n// wording against 6970.\n//\n// Spec follow-up 17 (Trust 0.32, where 2300 freezes the prior-candidate\n// set): candidate substitution. Two fresh tuples toward one counterpart\n// opened before either chained (a double scan under a transport outage)\n// both name the prior P; the later one, F2, also names F1. Where F2's\n// traffic arrives first, F2 chains onto P, and F1's only candidate is\n// consumed: the record side makes no choice, the non-record side resends\n// its report forever, two entries stay. So: when a chaining deactivates P\n// as the prior of a chain whose new head is X, every other fresh tuple\n// not yet chained whose prior-candidate set names P gets X in P's place\n// (same position; substitutePrior, run by chainTuple on its result), and\n// what its flow held about P is re-targeted to X as a fresh issuance under\n// the next revision, through the mapping duty: the record side's choice\n// (`chosen`, an owed `due`) is owed again naming X, X now the chain's head\n// and chainable; the non-record side's report or alignment likewise; the\n// frozen record prior (6290) follows to X's counterpart anchor. mac1 then\n// runs under X's relationship key (6970), which both holders hold, X being\n// a verified chained tuple; both sides apply the rule when they themselves\n// chain X, so the substituted candidate verifies on both. Transitive: a\n// chaining onto X later substitutes again. Only a tuple verified chained\n// onto P takes its place (chainTuple runs only on a verified mapping,\n// follow-up 14); a third party's fresh tuple never enters another flow's\n// candidates, and a probe hit proves nothing as before. A probe built\n// before the counterpart substituted still blinds P's anchor: X keeps, in\n// this tuple's set, the anchors it replaced in this flow (`replaces`,\n// transitively: Y in X's place stands for X and P), and answers a probe\n// for its own counterpart anchor and for those (standsFor). This is a\n// deviation from 6800, which matches the frozen set only (A19), limited to\n// anchors substituted in the tuple's own flow: a tuple opened after a\n// chaining completed has no history and matches its frozen candidates\n// only, so an attacker who knows an old pair anchor learns no current one\n// (stack review round 6: Codex I). A mapping\n// naming P that arrives after the substitution is refused (6960); its\n// sender re-targets on its own chaining. P's key is not kept for the\n// substituted flow: nothing verifies or issues under it there any more.\n\n// What it registers (through trustModule, trust/mapping.ts):\n// tasks continuity-probe/0.1 (proof absent): the assembly per tuple\n// (6790, the 5.2a rules with `probe` as the salt), the highest\n// completed probe (6690, 6700), the matches against the own\n// prior-candidate set (6800) and what they trigger: the record\n// side's choice, issued but not chained (spec follow-up 14), or\n// the non-record side's match report\n// continuity-mapping/0.1 (proof absent): steps 1–6 of 6940 (to,\n// next, prior in the frozen prior-candidate set, both MACs, the\n// revision rule with the record freeze, 6270, 6290); a record\n// side's mapping chains (6900) and raises the alignment (6850,\n// 6930); the non-record side's report or alignment informs the\n// record side's choice (6910) and, verified under the prior key,\n// chains it where it names the chosen relationship (follow-up 14)\n// duty continuity/1: step `probe` sends the pending probe (6830),\n// step `mapping` produces an owed choice, report or alignment, or\n// resends the last issuance under its revision (6840)\n// acks a completed probe ends the probe duty; the alignment's\n// delivery ends the alignment duty (6850)\n// failures a failed probe chunk re-opens the probe duty (a fresh probe,\n// 6710, 6830); a failed mapping not yet answered re-opens the\n// mapping duty (6840)\n//\n// What it exports for tests and the encounter (PR 7): openTuple, the\n// fresh tuple with its prior-candidate set frozen (2300) and its pending\n// probe (6820, 6830), behind the testing module's non-human command\n// continuity.newTuple.\n//\n// Choices this file makes where note and spec leave them open:\n// - the prior-candidate set is the active-head tuples of every live\n// relationship at tuple creation, in the order their heads were\n// created (entryOrder.heads), the fresh tuple excluded (2300, 6740)\n// - a probe is pending from the tuple's creation (6820) and goes out on\n// the next resume (the next available delivery contact). The probe\n// duty stands until a probe completes: after each send it is due again\n// after the holder's retry backoff (DutyCtx.backoff, growing with its\n// attempt) and then sends a fresh probe, next sequence, fresh padding\n// (6710, 6830). The outbox never reproduces a probe (ownRetries); a\n// failed chunk of the current probe (report, give-up) makes the duty\n// due as soon as its backoff allows, max(when, lastAt +\n// backoff(attempt)), never earlier; a superseded probe's failure\n// touches nothing\n// - the substitution (follow-up 17) applies to every fresh tuple not yet\n// chained, its flow open or not: a flow that has matched nothing yet\n// can still be reached by a late probe or mapping naming the head.\n// `chosen` is final once set except here, where the chosen prior was\n// consumed by another chaining and the choice is owed again on its head\n// - the record side chooses the first match, in prior-candidate order,\n// whose tuple is still the active head of a live relationship, and\n// chains on nothing yet; the non-record side reports the first such\n// match. A match report that reaches a record side without a choice is\n// chosen from where its prior is still chainable (6910), and chained\n// with that issuance: the report is the evidence\n// - a choice, a report or an alignment whose preparation fails (a key\n// not available) leaves `continuityOut.due` and a mapping duty; the\n// receive still commits (its ack, the assembly, the revision)\n// - every issuance opens the standing mapping duty; while the issuance\n// stands it resends after the backoff (6840): the stored artifact (body\n// and proof) re-sealed in a new document, same revision, a repeat at\n// the receiver (6270), but only when no document of it is still with\n// the outbox (whose retries are byte-identical, Delivery 4.2); a\n// failure of this issuance makes it due as soon as its backoff allows. The record side's choice stands until\n// the counterpart's mapping on the chosen relationship arrives\n// under a higher revision than it held (`aligned`; a repeat answers\n// nothing, 6270, and the report a choice was made from is no answer),\n// the match report until the record side's mapping is verified (6850,\n// 6860: it is never produced after), the alignment until its delivery\n// completes (6850), counted by this issuance's documents only (`sent`\n// is per issuance, `align` marks the alignment). The non-record side\n// always aligns with a new issuance under the next revision, even where\n// its report already named the chosen relationship (6930). Residue: a\n// report the record side never saw, arriving first after the choice\n// and naming it, is wire-identical to an alignment without a report\n// before it and counts as the answer\n// The outbox's retries of an issued report run to their horizon like\n// superseded star salts; the record side rejects a lower revision\n// - tick keeps the address key of a deactivated prior tuple while a live\n// fresh tuple whose flow is open names it among its prior candidates\n// (continuityKeys, the engine's keepKeys): mac1 needs it (6970)\n// - a prior that a competing chaining took (deactivated, its chain's\n// head another tuple) is refused at the record side's mapping as\n// validation-failed with ref 6900 where the flow still names it (an\n// unchained one had it substituted, follow-up 17, and refuses with\n// 6960); a chaining replayed is one append (6230): a record-side\n// mapping on an already chained tuple chains nothing again\n// - chaining keeps the chain's relationship id (the chain continues);\n// the fresh relationship stays as a husk without tuples, chainedInto\n// the chain, its contactId a chain alias (2090). The chain takes the\n// fresh relationship's place in entryOrder.heads (2180). Chain state\n// carries (2280): links and bindings as the union (6610), a binding\n// conflict kept as two bindings for one anchor, which the binding rule\n// sees: the two entries behind the chain never merge, no merge duty\n// opens, and no mapping touching that anchor verifies on the chain\n// (6118); the chaining itself happens (6900), the earliest anchor as the earlier of the two\n// by generation of the own register lineage (2285), contact memory\n// (the chain's wins key by key, the group-star pairs merged per group\n// with the appended head's winning: chainMemory), the relationship's anchor head (the appended\n// tuple's verified self, else the chain's), firstVerified the earlier;\n// provenance the chain's, except that an enactment chained onto an\n// introduced chain sets it to ceremony, at the chain's time and without\n// the introducer, never downward (8790, 8800: chainProvenance). Tuple\n// state does not migrate (6250): the prior tuple is deactivated with\n// its open assemblies discarded\n// (5360), the fresh tuple keeps its own scopes, so its star baseline\n// is fresh unless it completed a delivery before (5810, 5820)\n// - the entries at chaining: where both relationships hold an entry,\n// the appended tuple keeps its entry and the chain stands behind both\n// (2145) until a merge duty merges them; every entry behind the chain\n// settles its anchor head on what the chain holds (6560), so the\n// appended tuple's entry, which may hold none yet, takes the chain's; where only one holds one,\n// that one takes the other contact as an alias, the settings merged\n// by 2160; where neither does, the chain's contact takes the fresh one\n// as an alias (the chain continues; 2180 decides merges, and this is\n// an append)\n// - after a chaining whose entry has the anchor mapping class on, a\n// class-on duty owes the mapping on the new head (6980) where nothing\n// was issued on it, or where the chain and the tuple were issued under\n// different community anchors (6985); its lineage starts at the\n// chain's earliest anchor (2285). The duty respects lagging (6595):\n// a lagging relationship gets it when it ceases to lag (2850)\n// - at a chaining, the class duties owed on the chain and on the\n// appended relationship (class-on, re-issue, profile) move to the\n// chain under the entry that takes its verifications (2146); several\n// re-issues become one, the most urgent awaited head kept; a class off\n// toward that entry drops its duties (trust/duties.ts moveDuties, the\n// follow rule)\n// - 6465 (the profile on the new head after a chaining): the chaining\n// opens the profile's class-on duty on the chain (trust/duties.ts\n// afterChain), which trust/profile.ts delivers\n// - the class duties of both relationships move to the chain and the\n// follow rule runs over the chaining (trust/duties.ts)\n//\n// Open point for Trust 0.32 (found by the invariants generator, seed 5 and\n// 50; reproduced in test/trust-continuity.test.mjs \"one-sided chaining\"):\n// concurrent re-encounters of one pair race for one prior and leave the\n// two holders with different chains. Exact sequence, two fresh pairs x\n// and y of A and C, created before either chained, C the record side of\n// x, A of y (isRecordSide per fresh pair):\n// 1. the probes cross; C, record side of x, matches A's probe on x and\n// chooses its prior (the original tuple, the first match still an\n// active head, 6910), issuing its choice without chaining (follow-up\n// 14); A, record side of y, does the same for y. The two choices\n// cross: A chains x on verifying C's (6900, 6220), C chains y on A's\n// 2. the reports and alignments follow: A's alignment on y reaches C,\n// the record side of y, naming the prior it chose; its prior is in\n// C's frozen prior-candidate set of y (6960 passes on the snapshot),\n// but C's original tuple is no longer an active head: x took it.\n// Nothing in 6.4 or 6a.4 says onto what C appends; this library\n// refuses it (validation-failed, ref 6900), symmetrically at A for x.\n// Since follow-up 17 the refusal comes earlier, ref 6960: C's chaining\n// of y put y in the original's place in x's candidates (and A's of x\n// in y's), and each record side's re-choice on its own head meets a\n// counterpart already chained onto the original. The race stays\n// 3. end state: A's chain is original→x, C's is original→y; C keeps x,\n// A keeps y, as relationships of their own. x's standing mapping duty\n// never ends (6840): 6990's \"chained to the record-chosen relationship,\n// or honestly unchained pending transport\" is false, nothing is\n// pending. The net still puts C's r-A-x into its entry A (2145)\n// 4. C rotates before anything went out on x; its anchor mapping on x\n// carries the lineage from x's own earliest anchor (2285, 6420: per\n// relationship), the new generation, so none. A holds C's earlier\n// generation on its chain, whose head is x: 6170 (an unlinked change\n// of self) refuses it on every re-issue. 6985 does not apply at C: C\n// never chained. (Had C issued on x before rotating, x's earliest\n// anchor would be the earlier generation and the segment would reach\n// A; the divergent chains and the endless duty of step 3 remain.)\n// Each local decision follows a rule as written (6900, 6910, 6960); the\n// refusal of step 2 is this library's conservative reading, which 6900\n// does not state; the end state violates the progress rules 6870 and\n// 6990. What 0.32 needs to decide, either:\n// (a) order competing chainings: one deterministic winner among fresh\n// pairs that choose the same prior (say the lower record anchor),\n// the loser chained after the winner on both sides, so 6960's\n// snapshot verification has a defined append target; then 6990\n// holds, and 6985 covers the loser's head; or\n// (b) widen the lineage: 6420/2285 take the earliest generation issued\n// on any relationship of the entry (2145), not of the relationship\n// — C's r-A-x and r-A are one entry, so the segment from generation\n// 1 would reach A — and 6260/6990 name the unchained end state.\n// C's earliestAnchor on r-A-x is right by 2285 as written (nothing\n// earlier was issued on that relationship); it is the per-relationship\n// scope, not the value, that leaves A without the link.\nimport { iso, jcs, fromB64u } from '../core.js'\nimport type { Json } from '../core.js'\nimport { digestBytes, digestDoc } from '../crypto.js'\nimport { withLabel, withPairNonce } from '../identity-state.js'\nimport { seal } from '../delivery.js'\nimport {\n assembleContinuityMapping, blindPrior, buildProbeChunks, continuityMacsOk, continuityMappingOk, isRecordSide, probeChunkMacOk,\n probeChunkOk, probeKeyOf, PROBE_CHUNK,\n} from '../continuity.js'\nimport type { ContinuityMapping, ContinuityMappingBody, ProbeChunk } from '../continuity.js'\nimport { strictlyAscending } from '../star.js'\nimport { tupleByRkid } from '../receive.js'\nimport type { Arrival, ReceivedDocument, TaskDiscarded, TaskRefusal } from '../receive.js'\nimport type { AckHandler, Applied, CommandDef, DutyHandler, EventDraft, FailureHandler, HolderModule, IdentityRename, OutboundDraft, PrepareCtx, Refusal, TaskHandler } from '../engine.js'\nimport { triasOf } from '../state.js'\nimport type { ClassOnDuty, Contact, ContinuityDuty, ContinuityOut, Dec, Duty, HolderState, Millis, ReissueMappingDuty, Relationship, Tuple, TupleRef } from '../state.js'\nimport { emptyTuple } from '../state-builder.js'\nimport { ADMISSION_BOUND, activeTuple, classOnToward, entryOf, findContact, liveRel, tupleByLabel, unionBindings } from './state.js'\nimport { assembledBodies, assemblyStep, canComplete, chunkDocument, discardAssemblies, pairShared } from './star.js'\nimport { mergeDutiesAfter, mergeInto, settleHead } from './entries.js'\nimport { afterChain, classOnDuty, followClasses, moveDuties } from './duties.js'\nimport { isKnownDuty } from '../codec.js'\n\n/** The registered task types of 6a (Delivery §4.4, 6810). */\nexport const CONTINUITY_PROBE_TYPE = 'https://real-life.org/trust-tasks/continuity-probe/0.1'\nexport const CONTINUITY_MAPPING_TYPE = 'https://real-life.org/trust-tasks/continuity-mapping/0.1'\n\n/** The testing module's command (./testing). */\nexport const NEW_TUPLE = 'continuity.newTuple'\n\nconst inc = (d: Dec): Dec => (BigInt(d) + 1n).toString()\nconst cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0)\nconst refuse = (reason: TaskRefusal['reason'], ref?: string): TaskRefusal => ({ ok: false, reason, ...(ref ? { ref } : {}) })\nconst probeDutyId = (label: string): string => `continuity:probe:${label}`\nconst mappingDutyId = (label: string): string => `continuity:mapping:${label}`\n\n// ── reads ──────────────────────────────────────────────────────────────\n\n/** The tuple `label` if it is the active head of a live relationship. */\nfunction liveHead (state: Readonly<HolderState>, label: string): { rel: Relationship, tuple: Tuple } | null {\n const at = tupleByLabel(state, label)\n if (!at || !liveRel(at.rel) || at.rel.activeHead !== label) return null\n return at\n}\n\n/** The arrival tuple, if it is the active head of a live relationship (6190, 6240). */\nfunction arrivalTuple (state: Readonly<HolderState>, rkid: string): { rel: Relationship, tuple: Tuple } | null {\n const at = tupleByRkid(state, rkid)\n if (!at || !liveRel(at.rel) || at.rel.activeHead !== at.tuple.ownPairLabel) return null\n return at\n}\n\n/** A prior the fresh tuple `label` can still be chained onto: a tuple of\n * another relationship, its live active head. */\nconst chainable = (state: Readonly<HolderState>, label: string, prior: string): boolean => {\n const p = liveHead(state, prior)\n const t = tupleByLabel(state, label)\n return p !== null && t !== null && p.rel.id !== t.rel.id\n}\n\n/** The tuple `label` with `fn` applied, wherever it lives. */\nfunction withTuple (state: Readonly<HolderState>, label: string, fn: (t: Tuple) => Tuple): HolderState {\n const at = tupleByLabel(state, label)\n if (!at) throw new Error(`continuity: no tuple ${label}`)\n const tuples = at.rel.tuples.map((t) => (t.ownPairLabel === label ? fn(t) : t))\n return { ...state, relationships: { ...state.relationships, [at.rel.id]: { ...at.rel, tuples } } }\n}\n\n/** A probe is owed until one completed (6830). */\nconst probeOwed = (_state: Readonly<HolderState>, t: Readonly<Tuple>): boolean => !t.probeOut.done\n\n/** The fresh tuple's continuity flow is still open: no answered\n * issuance, and something chosen, reported, owed or not yet probed. */\nconst flowOpen = (t: Readonly<Tuple>): boolean =>\n !t.continuityOut.aligned && (t.continuityOut.chosen !== null || t.continuityIn.recordPrior !== null || t.continuityOut.reported !== null ||\n t.continuityOut.due !== null || !t.probeOut.done || t.probeIn.hwm === '0')\n\n/** The own rkids of deactivated prior tuples that a live fresh tuple with\n * an open flow still names (2300, 6200): their keys verify mac1 (6970)\n * and issue it, so tick keeps them (engine keepKeys). */\nexport function continuityKeys (state: Readonly<HolderState>): string[] {\n const out = new Set<string>()\n let byLabel: Map<string, Tuple> | null = null // every tuple by its own label, once per call\n for (const rel of Object.values(state.relationships)) {\n if (!liveRel(rel)) continue\n const t = activeTuple(rel)!\n if (!t.priorCandidates.length || !flowOpen(t)) continue\n if (!byLabel) {\n byLabel = new Map()\n for (const r of Object.values(state.relationships)) for (const x of r.tuples) byLabel.set(x.ownPairLabel, x)\n }\n for (const pc of t.priorCandidates) {\n const p = byLabel.get(pc.ownPairLabel)\n if (p && p.deactivated) out.add(p.rkid)\n }\n }\n return [...out]\n}\n\n/** The own pair label of the prior-candidate entry whose counterpart anchor is `anchor` (6960). */\nconst priorOf = (t: Readonly<Tuple>, anchor: string): TupleRef | undefined =>\n t.priorCandidates.find((pc) => pc.counterpartAnchor === anchor && pc.counterpartAnchor !== t.counterpartAnchor && pc.ownPairLabel !== t.ownPairLabel)\n\n/** The counterpart anchors a prior candidate answers a probe for (6800):\n * its own and those it replaced in this tuple's own flow (follow-up 17,\n * `replaces`): a probe built before the counterpart's substitution still\n * blinds the replaced prior's anchor. Never the chain's other deactivated\n * tuples: a tuple opened after a chaining matches its frozen candidates\n * only, so an old pair anchor discloses no current one (Codex I). */\nconst standsFor = (pc: Readonly<TupleRef>): string[] => [pc.counterpartAnchor, ...(pc.replaces ?? [])]\n\n/** Whether the last issuance still stands (6840, 6850, 6860), and the\n * record side's view of it. */\nfunction issuanceStands (t: Readonly<Tuple>, record: boolean): boolean {\n const o = t.continuityOut\n if (o.body === null) return false\n if (record) return !o.aligned\n if (t.continuityIn.recordPrior === null) return true // the match report, until the choice is verified\n const chosen = priorOf(t, t.continuityIn.recordPrior)?.ownPairLabel\n return o.align && o.reported === chosen && !o.aligned // the alignment, until its delivery completes\n}\n\n/** The record side of a tuple, read from its last issuance or its prior state. */\nconst recordOf = (t: Readonly<Tuple>): boolean | null => {\n if (t.continuityOut.chosen !== null) return true\n if (t.continuityOut.reported !== null || t.continuityIn.recordPrior !== null) return false\n return null\n}\n\n// ── a fresh tuple (2300, 6820) ─────────────────────────────────────────\n\nexport interface NewTupleInput {\n relId: string\n contactId: string\n ownPairLabel: string\n counterpartAnchor: string\n counterpartKeyAgreement: string\n provenance?: { kind: 'ceremony' | 'introduced', via?: string, viaPin?: string }\n /** the 32-byte relationship nonce the pair label digests (Identity\n * §6.1), base64url; where given, the register records it beside the\n * label, and the label must be pair/<multihash(nonce)> */\n nonce?: string\n}\n\n/**\n * A fresh tuple toward a counterpart as its own relationship and contact\n * (Encounter §4.4: fresh-always), its prior-candidate set frozen now\n * (2300), its own rkid live, its probe pending (6820, 6830).\n */\nexport function openTuple (state: Readonly<HolderState>, i: NewTupleInput, rkid: string, when: Millis): Applied {\n if (Object.hasOwn(state.relationships, i.relId)) throw new Error(`${NEW_TUPLE}: relationship ${i.relId} exists`)\n if (Object.hasOwn(state.contacts, i.contactId) || Object.values(state.contacts).some((c) => c.aliases.includes(i.contactId))) throw new Error(`${NEW_TUPLE}: contact ${i.contactId} exists`)\n if (tupleByLabel(state, i.ownPairLabel)) throw new Error(`${NEW_TUPLE}: label ${i.ownPairLabel} is in use`)\n const heads = state.entryOrder.heads\n const priorCandidates: TupleRef[] = Object.values(state.relationships)\n .filter((r) => liveRel(r))\n .sort((a, b) => (heads.indexOf(a.id) - heads.indexOf(b.id)) || cmp(a.id, b.id))\n .map((r) => activeTuple(r)!)\n .map((t) => ({ ownPairLabel: t.ownPairLabel, counterpartAnchor: t.counterpartAnchor }))\n const tuple = emptyTuple({\n ownPairLabel: i.ownPairLabel, counterpartAnchor: i.counterpartAnchor, counterpartKeyAgreement: i.counterpartKeyAgreement, rkid,\n entryId: i.contactId, priorCandidates,\n })\n const rel: Relationship = {\n id: i.relId, contactId: i.contactId, tuples: [tuple], activeHead: i.ownPairLabel, earliestAnchor: null, links: [], bindings: {},\n heldCounterpartHead: null, memory: {}, chainedInto: null, firstVerified: null,\n provenance: { kind: i.provenance?.kind ?? 'ceremony', ...(i.provenance?.via !== undefined ? { via: i.provenance.via } : {}), ...(i.provenance?.viaPin !== undefined ? { viaPin: i.provenance.viaPin } : {}), at: when },\n }\n const contact: Contact = {\n id: i.contactId, pos: null, status: 'none', aliases: [], relIds: [i.relId], anchorHead: null,\n settings: { star: 'default', groupStar: 'default', anchorMapping: 'default', sealedGroupStar: 'default', profile: 'default' }, groupSettings: {},\n }\n const duty: ContinuityDuty = { kind: 'continuity', v: 1, id: probeDutyId(i.ownPairLabel), relId: i.relId, tuple: i.ownPairLabel, step: 'probe' }\n return {\n state: {\n ...state,\n register: i.nonce === undefined ? withLabel(state.register, i.ownPairLabel) : withPairNonce(state.register, i.ownPairLabel, i.nonce),\n addresses: { ...state.addresses, keys: { ...state.addresses.keys, [rkid]: { label: i.ownPairLabel, lastShown: when } } },\n contacts: { ...state.contacts, [i.contactId]: contact },\n relationships: { ...state.relationships, [i.relId]: rel },\n entryOrder: { ...state.entryOrder, heads: [...state.entryOrder.heads, i.relId] },\n },\n events: [{ type: 'contact.added', contactId: i.contactId }],\n duties: [duty],\n }\n}\n\n// ── the chaining (6220–6250, 2145, 2280, 2285, 6610) ───────────────────\n\n/** The generation order of own community anchors along the register's\n * lineage (2285): the index of the element leaving the anchor, or the\n * lineage's length for its end; with no lineage, every anchor is one. */\nfunction generationOf (state: Readonly<HolderState>, anchor: string): number {\n const lin = state.register.lineage as Array<{ body?: { prev?: string, next?: string } }>\n if (!lin.length) return 0\n const at = lin.findIndex((r) => r.body?.prev === anchor)\n if (at >= 0) return at\n return lin[lin.length - 1].body?.next === anchor ? lin.length : Number.MAX_SAFE_INTEGER\n}\n\nconst earlierAnchor = (state: Readonly<HolderState>, a: string | null, b: string | null): string | null =>\n a === null ? b : b === null ? a : generationOf(state, b) < generationOf(state, a) ? b : a\n\n/** The anchors the holder issued its anchor mapping under on these tuples and relationship. */\nconst issuedUnder = (r: Readonly<Relationship>): string[] =>\n [r.earliestAnchor, ...r.tuples.map((t) => t.mappingOut.underAnchor)].filter((a): a is string => a !== null)\n\nexport type Chained = { state: HolderState, events: EventDraft[], duties: Duty[], renames: IdentityRename[] }\n\nconst mapOf = (x: Json | undefined): Record<string, Json> =>\n (x !== null && typeof x === 'object' && !Array.isArray(x) ? x as Record<string, Json> : {})\n\n/** Contact memory at a chaining (2280): the chain's wins key by key\n * (introducedName, vouchedBy with its vouchedPin: what the earlier\n * relationship established),\n * except the class-V group-star pairs (5580), merged per group with the\n * appended relationship's winning, since it is the active head whose\n * stars are the newer (5770). */\nfunction chainMemory (r0: Readonly<Record<string, Json>>, rn: Readonly<Record<string, Json>>): Record<string, Json> {\n const m: Record<string, Json> = { ...rn, ...r0 }\n if (Object.hasOwn(r0, 'groupMembers') || Object.hasOwn(rn, 'groupMembers')) m.groupMembers = { ...mapOf(r0.groupMembers), ...mapOf(rn.groupMembers) }\n return m\n}\n\n/** The chain's provenance (8790, 8800): an introduced chain becomes\n * `ceremony` when the appended relationship came by an enactment, at the\n * chain's time and without the introducer (via and viaPin name the\n * introduction; the voucher mark and the introduced name are memory and\n * stay); never downward: a ceremony chain stays ceremony, an introduced\n * one appended by an introduction keeps its own introducer. */\nconst chainProvenance = (p0: Relationship['provenance'], pn: Relationship['provenance']): Relationship['provenance'] =>\n p0.kind === 'introduced' && pn.kind === 'ceremony' ? { kind: 'ceremony', at: p0.at } : p0\n\n/**\n * The chain append (6220): the fresh tuple `label` becomes the active head\n * of the chain whose active head `prior` is, atomically with that prior's\n * deactivation; chain state carries, tuple state does not (6250). Returns\n * `already` where this very append is done (6230), `taken` where the prior\n * is no longer chainable.\n */\nexport function chainTuple (state: Readonly<HolderState>, label: string, prior: string, bound: bigint): Chained | 'already' | 'taken' {\n const fresh = tupleByLabel(state, label)\n const pr = tupleByLabel(state, prior)\n if (!fresh || !pr) return 'taken'\n if (fresh.rel.id === pr.rel.id) return fresh.rel.activeHead === label && pr.tuple.deactivated ? 'already' : 'taken'\n // a strand absorbs no second one (2220): the fresh tuple's relationship is just this tuple\n if (fresh.rel.tuples.length !== 1 || !liveRel(fresh.rel) || fresh.rel.activeHead !== label) return 'taken'\n if (!liveRel(pr.rel) || pr.rel.activeHead !== prior) return 'taken'\n const R0 = pr.rel, Rn = fresh.rel\n const t = fresh.tuple\n const Eo = entryOf(state, R0), En = entryOf(state, Rn)\n const links = [...R0.links]\n for (const l of Rn.links) if (!links.some((x) => x.prev === l.prev && x.next === l.next)) links.push(l)\n const firstVerified = R0.firstVerified === null ? Rn.firstVerified : Rn.firstVerified === null ? R0.firstVerified\n : BigInt(Rn.firstVerified) < BigInt(R0.firstVerified) ? Rn.firstVerified : R0.firstVerified\n const chain: Relationship = {\n ...R0,\n tuples: [...R0.tuples.map((x) => (x.ownPairLabel === prior ? discardAssemblies({ ...x, deactivated: true }) : x)), t],\n activeHead: label,\n earliestAnchor: earlierAnchor(state, R0.earliestAnchor, Rn.earliestAnchor),\n links,\n bindings: unionBindings(R0.bindings, Rn.bindings),\n heldCounterpartHead: Rn.heldCounterpartHead ?? R0.heldCounterpartHead,\n memory: chainMemory(R0.memory, Rn.memory),\n firstVerified,\n provenance: chainProvenance(R0.provenance, Rn.provenance),\n }\n const husk: Relationship = {\n ...Rn, tuples: [], chainedInto: R0.id, links: [], bindings: {}, earliestAnchor: null, heldCounterpartHead: null, memory: {},\n }\n // the chain takes the fresh relationship's place in the creation order of active heads (2180)\n const heads = state.entryOrder.heads.filter((id) => id !== R0.id).map((id) => (id === Rn.id ? R0.id : id))\n // the fresh relationship's continuity duties move to the chain; the\n // class and re-issue duties of both are relocated below, once the entry\n // that takes the chain's verifications is known\n const duties: HolderState['duties'] = {}\n for (const [id, d] of Object.entries(state.duties)) {\n const relId = (d as { relId?: unknown }).relId\n if (relId !== Rn.id || d.kind === 'merge') { duties[id] = d; continue }\n if (d.kind === 'continuity' && isKnownDuty(d)) duties[id] = { ...d, relId: R0.id } as Duty\n else duties[id] = d // class duties move below (moveDuties); unknown kinds stay as they are\n }\n const rotations: HolderState['rotations'] = {}\n for (const [id, r] of Object.entries(state.rotations)) {\n if (!Object.hasOwn(r.awaitHead, Rn.id)) { rotations[id] = r; continue }\n // the 6596 decision of a running rotation moves to the chain like the\n // re-issue duties (moveDuties): one re-issue owed, due at once where\n // either was (null wins), else the chain's own wait\n const { [Rn.id]: fresh, ...awaitHead } = r.awaitHead\n const own = Object.hasOwn(awaitHead, R0.id) ? awaitHead[R0.id] : undefined\n awaitHead[R0.id] = own === undefined ? fresh : own === null || fresh === null ? null : own\n rotations[id] = { ...r, awaitHead }\n }\n let next: HolderState = {\n ...state, relationships: { ...state.relationships, [R0.id]: chain, [Rn.id]: husk }, duties, rotations,\n entryOrder: { ...state.entryOrder, heads },\n }\n // the entries (2145, 2140)\n const swap = (c: Contact): Contact => ({ ...c, relIds: [...new Set(c.relIds.map((id) => (id === Rn.id ? R0.id : id)))] })\n let entryId: string\n const out: Duty[] = []\n const renames: IdentityRename[] = []\n if (!Eo || !En || Eo.id === En.id) {\n const e = (Eo ?? En)!\n entryId = e.id\n next = { ...next, contacts: { ...next.contacts, [e.id]: swap(next.contacts[e.id]) } }\n } else if (Eo.pos !== null && En.pos !== null) {\n // 2145: the chain stands behind both entries; the appended tuple's takes its verifications\n entryId = En.id\n next = { ...next, contacts: { ...next.contacts, [En.id]: swap(next.contacts[En.id]) } }\n } else {\n // one entry or none: the other contact folds into it as an alias (2160 settings)\n const survivor = Eo.pos === null && En.pos !== null ? En : Eo\n const gone = survivor === Eo ? En : Eo\n next = { ...next, contacts: { ...next.contacts, [En.id]: swap(next.contacts[En.id]) } }\n const m = mergeInto(next, next.contacts[survivor.id], survivor.id, [next.contacts[gone.id]], bound)\n next = m.state\n out.push(...(m.duties ?? []))\n renames.push(...(m.renames ?? []))\n entryId = m.survivor\n }\n next = withTuple(next, label, (x) => ({ ...x, entryId }))\n // 6560: the entries behind the chain settle their anchor heads on what\n // the chain holds now — the appended tuple's entry included, which (2145)\n // takes its verifications and may hold none of its own yet\n for (const id of new Set([entryId, Eo?.id, En?.id].filter((x): x is string => x !== undefined))) {\n const c = findContact(next, id)\n if (!c) continue\n const settled = settleHead(next, c, chain.heldCounterpartHead)\n if (settled !== c) next = { ...next, contacts: { ...next.contacts, [c.id]: settled } }\n }\n next = moveDuties(next, [R0.id, Rn.id], R0.id, entryId)\n // 6980, 6985: the anchor mapping on the new head, from the chain's earliest anchor (2285)\n const entry = next.contacts[entryId]\n if (classOnToward(entry, 'anchorMapping')) {\n const anchors = new Set([...issuedUnder(R0), ...issuedUnder(Rn)])\n const differ = issuedUnder(R0).length > 0 && issuedUnder(Rn).length > 0 && anchors.size > 1\n if (t.mappingOut.body === null || differ) out.push(...classOnDuty(next, entryId, R0.id, 'anchorMapping', out))\n }\n // 6465: the profile on the new head (trust/duties.ts)\n out.push(...afterChain(next, R0.id, out))\n // 2145: a merge the two entries admit runs after this commit (2230)\n const md = mergeDutiesAfter(state, next, R0.id, { net: false })\n out.push(...md.duties)\n // the follow rule over the whole chaining: the drop of a class off toward\n // the entry now, a class on for the chain that was not before (2850)\n const f = followClasses(state, md.state, out)\n // spec follow-up 17 (2300): the new head takes the prior's place in every other unchained flow\n return { state: substitutePrior(f.state, prior, label), events: [{ type: 'contact.chained', contactId: entryId, from: Rn.id, into: R0.id }], duties: f.duties, renames }\n}\n\n/**\n * Candidate substitution (spec follow-up 17, 2300): `prior` was just\n * deactivated as the prior of a chaining whose new head is `head`, a tuple\n * verified chained onto it (mac1 under the prior's key, 6970). Every other\n * fresh tuple not yet chained whose prior-candidate set names `prior` gets\n * `head` in its place (same position, a duplicate dropped), and what its\n * flow held about `prior` is re-targeted to `head`, a fresh issuance under\n * the next revision through the mapping duty: the record side's choice is\n * owed again naming `head` (chainable now), the non-record side's report or\n * alignment likewise, the frozen record prior (6290) follows to `head`'s\n * counterpart anchor. The head's entry records in `replaces` the anchors\n * it stands for in this flow (standsFor). Transitive by construction: a chaining onto `head`\n * later substitutes again. Pure: the state only, the duties written into it.\n */\nexport function substitutePrior (state: HolderState, prior: string, head: string): HolderState {\n const h = tupleByLabel(state, head)\n const p = tupleByLabel(state, prior)\n if (!h || !p) return state\n const sub = (l: string): string => (l === prior ? head : l)\n let next = state\n for (const rel of Object.values(state.relationships)) {\n if (!liveRel(rel) || rel.tuples.length !== 1) continue // a strand absorbs no second one (2220)\n const t = rel.tuples[0]\n if (t.ownPairLabel === head || !t.priorCandidates.some((pc) => pc.ownPairLabel === prior)) continue\n // the head in the prior's place, standing for whatever the prior stood for in this flow and for\n // the prior, oldest first (transitive); a head already in the set keeps the first position\n const pc0 = t.priorCandidates.find((pc) => pc.ownPairLabel === prior)!\n const into: TupleRef = { ownPairLabel: head, counterpartAnchor: h.tuple.counterpartAnchor }\n const replaces = new Set<string>()\n for (const pc of t.priorCandidates) if (pc.ownPairLabel === prior || pc.ownPairLabel === head) for (const a of [...(pc.replaces ?? []), pc.counterpartAnchor]) replaces.add(a)\n replaces.delete(into.counterpartAnchor)\n if (replaces.size) into.replaces = [...replaces]\n const priorCandidates: TupleRef[] = []\n for (const pc of t.priorCandidates) {\n const x = pc.ownPairLabel === prior || pc.ownPairLabel === head ? into : pc\n if (!priorCandidates.some((y) => y.ownPairLabel === x.ownPairLabel)) priorCandidates.push(x)\n }\n const o = t.continuityOut\n const rp = t.continuityIn.recordPrior\n let due: Tuple['continuityOut']['due'] = o.due === null ? null\n : o.due.kind === 'choice' ? { kind: 'choice', prior: sub(o.due.prior), alts: [...new Set(o.due.alts.map(sub))].filter((x) => x !== sub(o.due!.prior)) }\n : { kind: o.due.kind, prior: sub(o.due.prior) }\n // the record side re-chooses: its choice on the prior is owed again, on the head\n let chosen = o.chosen\n if (chosen === prior) { chosen = null; due = { kind: 'choice', prior: head, alts: [] } }\n // the non-record side re-reports, or re-aligns, naming the head\n if (o.reported === prior && due === null) due = { kind: rp !== null ? 'align' : 'report', prior: head }\n const recordPrior = rp === pc0.counterpartAnchor ? into.counterpartAnchor : rp\n next = withTuple(next, t.ownPairLabel, (x) => ({\n ...x, priorCandidates, continuityIn: { ...x.continuityIn, recordPrior }, continuityOut: { ...x.continuityOut, chosen, due },\n }))\n if (due !== null && (chosen !== o.chosen || due.kind !== o.due?.kind || due.prior !== o.due.prior)) next = owe(next, t.ownPairLabel, rel.id)\n }\n return next\n}\n\n// ── issuing a continuity mapping (6880, 6300) ──────────────────────────\n\n/** A continuity mapping prepared on the fresh tuple `label` naming the\n * own anchor of tuple `prior`. */\ninterface Issue {\n label: string\n prior: string\n baseRev: Dec\n rev: Dec\n body: ContinuityMappingBody\n proof: ContinuityMapping['proof']\n outbound: OutboundDraft\n}\n\n/** Seal a continuity-mapping/0.1 document on tuple `t`. */\nasync function mappingDocument (ctx: PrepareCtx, t: Readonly<Tuple>, contactId: string, own: string, m: ContinuityMapping): Promise<OutboundDraft> {\n const S = ctx.crypto.subtle\n const threadId = ctx.entropy.id('thread.id')\n const doc = { id: ctx.entropy.id('doc.id'), type: CONTINUITY_MAPPING_TYPE, issuer: own, recipient: t.counterpartAnchor, threadId, issuedAt: iso(ctx.when), payload: m as unknown as Json }\n const envelope = await seal(doc, t.counterpartKeyAgreement, { ephSeed: ctx.entropy.bytes('seal.eph', 32), nonce: ctx.entropy.bytes('seal.nonce', 12) }, S)\n return { digest: await digestDoc(doc, S), envelope, type: CONTINUITY_MAPPING_TYPE, threadId, recipient: { contactId, rkid: t.rkid, keyAgreement: t.counterpartKeyAgreement } }\n}\n\n/** Prepare the next revision of the tuple's continuity mapping naming `prior` (6300). */\nasync function prepareIssue (ctx: PrepareCtx, label: string, prior: string): Promise<Issue | null> {\n const st = ctx.snapshot\n const at = tupleByLabel(st, label)\n const pr = tupleByLabel(st, prior)\n if (!at || !pr) return null\n const t = at.tuple\n const rev = inc(t.continuityOut.rev)\n if (BigInt(rev) > ADMISSION_BOUND) return null // the scope suspends (2.1, 6870)\n const shNew = await pairShared(ctx, t)\n const shPrior = await pairShared(ctx, pr.tuple)\n if (!shNew || !shPrior) return null\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n const body: ContinuityMappingBody = {\n type: 'continuity-mapping@1', prior: (await ctx.keys.anchorOf(pr.tuple.ownPairLabel)).anchor, next: own, to: t.counterpartAnchor,\n revision: rev, issuedAt: iso(ctx.when),\n }\n const m = await assembleContinuityMapping(body, shPrior, shNew, ctx.crypto.subtle)\n const contactId = entryOf(st, at.rel)?.id ?? at.rel.contactId\n return { label, prior, baseRev: t.continuityOut.rev, rev, body, proof: m.proof, outbound: await mappingDocument(ctx, t, contactId, own, m) }\n}\n\n/** Commit an issuance on the state it lands on: revision and body in one\n * step (6300), the recipient's current entry; null where the scope moved. */\nfunction commitIssue (state: HolderState, p: Issue, set: (o: ContinuityOut) => Partial<ContinuityOut>): { state: HolderState, outbound: OutboundDraft } | null {\n const at = tupleByLabel(state, p.label)\n if (!at || at.tuple.continuityOut.rev !== p.baseRev) return null\n const next = withTuple(state, p.label, (t) => ({\n ...t,\n continuityOut: {\n ...t.continuityOut, rev: p.rev, body: p.body as unknown as Json, proof: p.proof as unknown as Json, sent: [p.outbound.digest], due: null,\n align: t.continuityIn.recordPrior !== null, ...set(t.continuityOut),\n },\n }))\n const after = tupleByLabel(next, p.label)!\n const contactId = entryOf(next, after.rel)?.id ?? p.outbound.recipient.contactId\n return { state: next, outbound: { ...p.outbound, recipient: { ...p.outbound.recipient, contactId } } }\n}\n\n/** The standing mapping duty of the tuple (6840, 6850), in the state:\n * opened (or restarted) at an issuance; its first run schedules the\n * resend after the backoff. */\nconst openMapping = (state: HolderState, label: string, relId: string, when: Millis): HolderState =>\n ({ ...state, duties: { ...state.duties, [mappingDutyId(label)]: { kind: 'continuity', v: 1, id: mappingDutyId(label), relId, tuple: label, step: 'mapping', attempt: 1, lastAt: when } } })\n\n/** The earliest time the standing duty may send again: the backoff after its last send. */\nconst nextAt = (d: Readonly<ContinuityDuty>, backoff: (attempt: number) => number): Millis =>\n Math.min((d.lastAt ?? 0) + Math.max(0, Math.ceil(backoff(Math.max(1, d.attempt ?? 1)))), Number.MAX_SAFE_INTEGER)\n\n/** A failure (6830/6840) makes the standing duty due as soon as its\n * backoff allows, never earlier: max(when, lastAt + backoff(attempt)). */\nconst dueOnFailure = (state: HolderState, d: ContinuityDuty, when: Millis, backoff: (attempt: number) => number): HolderState => {\n const cur = Object.hasOwn(state.duties, d.id) ? state.duties[d.id] as ContinuityDuty : d\n const dueAt = cur.lastAt === undefined ? when : Math.max(when, nextAt(cur, backoff))\n return cur.dueAt === dueAt ? state : { ...state, duties: { ...state.duties, [d.id]: { ...cur, dueAt } } }\n}\n\nconst dropDuty = (state: HolderState, id: string): HolderState => {\n if (!Object.hasOwn(state.duties, id)) return state\n const { [id]: _, ...duties } = state.duties\n return { ...state, duties }\n}\n\n/**\n * The record side's choice (6900, 6910): the first prepared prior still\n * chainable is issued; where none was prepared but some match is still\n * chainable, the choice is owed (due). It chains with the issuance only on\n * `evidence`: a verified mapping of the counterpart under the prior\n * relationship's key (mac1, 6970), its match report naming that prior. A\n * probe hit alone proves only that the counterpart knows the prior's\n * anchor and shares the fresh tuple's key, never that it holds the prior\n * relationship (spec follow-up 14, header): on a hit the choice is issued\n * and stands as a candidate until that mapping arrives (mappingTask).\n */\nfunction choose (state: HolderState, label: string, matches: readonly string[], issues: readonly Issue[], bound: bigint, when: Millis, evidence: boolean): Applied {\n for (const p of issues) {\n if (!chainable(state, label, p.prior)) continue\n const c = evidence ? chainTuple(state, label, p.prior, bound) : null\n if (typeof c === 'string') continue\n const i = commitIssue(c ? c.state : state, p, () => ({ chosen: p.prior }))\n if (!i) continue\n const after = tupleByLabel(i.state, label)!\n const opened = openMapping(i.state, label, after.rel.id, when)\n return c ? { state: opened, outbound: [i.outbound], events: c.events, duties: c.duties, renames: c.renames } : { state: opened, outbound: [i.outbound] }\n }\n const viable = matches.filter((m) => chainable(state, label, m))\n // every candidate gone: an owed choice dies, honestly unchained (6990)\n if (!viable.length) return { state: withTuple(state, label, (t) => (t.continuityOut.due?.kind === 'choice' ? { ...t, continuityOut: { ...t.continuityOut, due: null } } : t)) }\n const at = tupleByLabel(state, label)!\n const s = withTuple(state, label, (t) => ({ ...t, continuityOut: { ...t.continuityOut, due: { kind: 'choice', prior: viable[0], alts: viable.slice(1) } } }))\n return { state: owe(s, label, at.rel.id) }\n}\n\n/** A production owed: the mapping duty, due at once. */\nconst owe = (state: HolderState, label: string, relId: string): HolderState => {\n const id = mappingDutyId(label)\n const fresh: ContinuityDuty = { kind: 'continuity', v: 1, id, relId, tuple: label, step: 'mapping' }\n const { dueAt: _, ...cur } = (Object.hasOwn(state.duties, id) ? state.duties[id] : fresh) as ContinuityDuty\n return { ...state, duties: { ...state.duties, [id]: cur } }\n}\n\n/** The non-record side's match report or alignment (6930): issued, or owed. */\nfunction issueOrOwe (state: HolderState, label: string, prior: string, issue: Issue | null, kind: 'report' | 'align', when: Millis): Applied {\n const at = tupleByLabel(state, label)!\n const i = issue && issue.prior === prior ? commitIssue(state, issue, () => ({ reported: prior, aligned: false })) : null\n if (i) return { state: openMapping(i.state, label, at.rel.id, when), outbound: [i.outbound] }\n const s = withTuple(state, label, (t) => ({ ...t, continuityOut: { ...t.continuityOut, due: { kind, prior } } }))\n return { state: owe(s, label, at.rel.id) }\n}\n\nconst merge = (a: Applied, b: Applied): Applied => ({\n state: b.state,\n outbound: [...(a.outbound ?? []), ...(b.outbound ?? [])],\n events: [...(a.events ?? []), ...(b.events ?? [])],\n duties: [...(a.duties ?? []), ...(b.duties ?? [])],\n renames: [...(a.renames ?? []), ...(b.renames ?? [])],\n})\n\n// ── the probe sender (6a.2, 6830) ──────────────────────────────────────\n\ninterface ProbeIssue { label: string, baseSeq: Dec, seq: Dec, outbound: OutboundDraft[] }\n\nasync function prepareProbe (ctx: PrepareCtx, label: string): Promise<ProbeIssue | null> {\n const st = ctx.snapshot\n const at = liveHead(st, label)\n if (!at || !probeOwed(st, at.tuple)) return null\n const t = at.tuple\n const seq = inc(t.probeOut.seq)\n if (BigInt(seq) > ADMISSION_BOUND) return null // 6680, the scope suspends\n const shared = await pairShared(ctx, t)\n if (!shared) return null\n const S = ctx.crypto.subtle\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n // 6730, 6740: the own pair anchors of the prior-candidate set, never the fresh tuple's\n const priors: string[] = []\n for (const pc of t.priorCandidates) if (pc.ownPairLabel !== t.ownPairLabel) priors.push((await ctx.keys.anchorOf(pc.ownPairLabel)).anchor)\n const k = await probeKeyOf(shared, own, t.counterpartAnchor, S)\n const chunks = await buildProbeChunks(k, seq, priors.filter((a) => a !== own), () => ctx.entropy.bytes('pad', 32), S)\n // one probe = one thread (Delivery §4.4)\n const threadId = ctx.entropy.id('thread.id')\n const contactId = entryOf(st, at.rel)?.id ?? at.rel.contactId\n const outbound: OutboundDraft[] = []\n for (const c of chunks) outbound.push(await chunkDocument(ctx, CONTINUITY_PROBE_TYPE, own, t, contactId, threadId, c as unknown as Json))\n return { label, baseSeq: t.probeOut.seq, seq, outbound }\n}\n\n// ── the duty (6830–6850) ───────────────────────────────────────────────\n\ntype MappingWork =\n | { kind: 'choice', baseRev: Dec, issues: Issue[] }\n | { kind: 'report' | 'align', baseRev: Dec, issue: Issue | null }\n | { kind: 'resend', baseRev: Dec, outbound: OutboundDraft }\n\nasync function prepareMappingWork (ctx: PrepareCtx, label: string): Promise<MappingWork | null> {\n const st = ctx.snapshot\n const at = liveHead(st, label)\n if (!at) return null\n const t = at.tuple\n const o = t.continuityOut\n if (o.due?.kind === 'choice') {\n const issues: Issue[] = []\n for (const p of [o.due.prior, ...o.due.alts]) {\n if (!chainable(st, label, p)) continue\n const i = await prepareIssue(ctx, label, p)\n if (i) issues.push(i)\n }\n return { kind: 'choice', baseRev: o.rev, issues }\n }\n if (o.due) return { kind: o.due.kind, baseRev: o.rev, issue: await prepareIssue(ctx, label, o.due.prior) }\n if (o.body === null || o.proof === null) return null\n // 6840: the same artifact under the same revision, in a new document\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n const m = { body: o.body, proof: o.proof } as unknown as ContinuityMapping\n return { kind: 'resend', baseRev: o.rev, outbound: await mappingDocument(ctx, t, entryOf(st, at.rel)?.id ?? at.rel.contactId, own, m) }\n}\n\nfunction continuityDuty (bound: bigint): DutyHandler<ProbeIssue | MappingWork | null> {\n return {\n v: 1,\n prepare: (ctx, duty) => {\n const d = duty as ContinuityDuty\n return d.step === 'probe' ? prepareProbe(ctx, d.tuple) : prepareMappingWork(ctx, d.tuple)\n },\n apply (state, duty, ctx, when): Applied | Refusal | 'not-due' {\n const d = duty as ContinuityDuty\n const at = liveHead(state, d.tuple)\n if (!at) return { state: state as HolderState } // per-tuple duties die with the tuple (6250)\n const t = at.tuple\n const p = ctx.prepared.value\n const attempt = d.attempt ?? 0\n // the standing duty stays, due again after the backoff (6830, 6840)\n // sent now (`sent`), or only rescheduled from the last send\n const again = (n: number, sent = true): ContinuityDuty => {\n const { dueAt: _, ...rest } = d\n const lastAt = sent ? when : (d.lastAt ?? when)\n const next: ContinuityDuty = { ...rest, relId: at.rel.id, attempt: n, lastAt }\n return { ...next, dueAt: Math.max(when, nextAt(next, ctx.backoff)) }\n }\n if (d.step === 'probe') {\n if (!probeOwed(state, t)) return { state: state as HolderState }\n const q = p as ProbeIssue | null\n if (q === null) return { ok: false, code: BigInt(t.probeOut.seq) >= ADMISSION_BOUND ? 'scope-exhausted' : 'no-own-channel' }\n if (t.probeOut.seq !== q.baseSeq) return 'not-due'\n // 6680: the sequence and the outbox in one commit, before the send;\n // every send is a fresh probe (6710), never the outbox's reproduction\n const inflight: Tuple['probeOut']['inflight'] = {}\n for (const [s, f] of Object.entries(t.probeOut.inflight)) if (f.digests.some((x) => Object.hasOwn(state.outbox, x))) inflight[s] = f\n inflight[q.seq] = { digests: q.outbound.map((o) => o.digest), acked: [] }\n return {\n state: withTuple(state, d.tuple, (x) => ({ ...x, probeOut: { ...x.probeOut, seq: q.seq, inflight } })),\n outbound: q.outbound, duties: [again(attempt + 1)],\n }\n }\n const w = p as MappingWork | null\n const o = t.continuityOut\n if (w === null) return o.due || issuanceStands(t, recordOf(t) ?? false) ? { ok: false, code: 'no-own-channel' } : { state: state as HolderState }\n if (o.rev !== w.baseRev) return 'not-due'\n if (w.kind === 'choice') {\n if (o.chosen !== null || o.due?.kind !== 'choice') return { state: withTuple(state, d.tuple, (x) => ({ ...x, continuityOut: { ...x.continuityOut, due: null } })) }\n // prepared before a substitution re-targeted it (follow-up 17): prepared again\n const owed = [o.due.prior, ...o.due.alts]\n if (w.issues.length && !w.issues.some((i) => owed.includes(i.prior))) return 'not-due'\n const r = choose(state as HolderState, d.tuple, [o.due.prior, ...o.due.alts], w.issues, bound, when, false)\n if (r.outbound?.length) return { ...r, duties: [...(r.duties ?? []), again(1)] }\n // still owed (no key for any candidate): the duty stays; else every candidate is gone\n return tupleByLabel(r.state, d.tuple)!.tuple.continuityOut.due ? { ok: false, code: 'no-own-channel' } : { state: r.state }\n }\n if (w.kind === 'report' || w.kind === 'align') {\n if (o.due?.kind !== w.kind) return { state: state as HolderState }\n // 6860: a match report after the record side's choice is never sent\n if (w.kind === 'report' && t.continuityIn.recordPrior !== null) return { state: withTuple(state, d.tuple, (x) => ({ ...x, continuityOut: { ...x.continuityOut, due: null } })) }\n if (!w.issue) return { ok: false, code: 'no-own-channel' }\n // prepared before a substitution re-targeted it (follow-up 17): prepared again\n if (w.issue.prior !== o.due.prior) return 'not-due'\n const i = commitIssue(state as HolderState, w.issue, () => ({ reported: w.issue!.prior, aligned: false }))\n return i ? { state: i.state, outbound: [i.outbound], duties: [again(1)] } : 'not-due'\n }\n // the resend (6840): while the issuance stands, after the backoff,\n // unless a document of it is still with the outbox\n const record = recordOf(t)\n if (record === null || !issuanceStands(t, record)) return { state: state as HolderState }\n if (when < nextAt(d, ctx.backoff) || o.sent.some((x) => pending(state, x))) return { state: state as HolderState, duties: [again(Math.max(1, attempt), false)] }\n const resend = (w as Extract<MappingWork, { kind: 'resend' }>).outbound\n return {\n state: withTuple(state, d.tuple, (x) => ({ ...x, continuityOut: { ...x.continuityOut, sent: [...x.continuityOut.sent, resend.digest] } })),\n outbound: [resend], duties: [again(attempt + 1)],\n }\n },\n }\n}\n\nconst delivered = (state: Readonly<HolderState>, digest: string): boolean =>\n Object.hasOwn(state.outbox, digest) && triasOf(state.outbox[digest]) === 'delivered'\n\n/** Still with the outbox: neither delivered nor failed. */\nconst pending = (state: Readonly<HolderState>, digest: string): boolean =>\n Object.hasOwn(state.outbox, digest) && triasOf(state.outbox[digest]) !== 'delivered' && triasOf(state.outbox[digest]) !== 'failed'\n\n// ── acks and failures ──────────────────────────────────────────────────\n\n/** A probe's chunks all acked: the probe completed and the duty ends (6830). */\nconst probeAck: AckHandler = (state, ref) => {\n const at = tupleByRkid(state, state.outbox[ref].recipient.rkid)\n if (!at) return { state: state as HolderState }\n const o = at.tuple.probeOut\n const hit = Object.entries(o.inflight).find(([, f]) => f.digests.includes(ref))\n if (!hit) return { state: state as HolderState }\n const [seq, f] = hit\n const acked = f.acked.includes(ref) ? f.acked : [...f.acked, ref]\n const done = f.digests.every((x) => acked.includes(x))\n const next = withTuple(state, at.tuple.ownPairLabel, (t) => ({\n ...t, probeOut: done ? { ...t.probeOut, inflight: {}, done: true } : { ...t.probeOut, inflight: { ...t.probeOut.inflight, [seq]: { ...f, acked } } },\n }))\n return { state: done ? dropDuty(next, probeDutyId(at.tuple.ownPairLabel)) : next }\n}\n\n/** A failed probe chunk: the fresh probe is due at once (6710, 6830). */\nconst probeFailed: FailureHandler = (state, ref, when, { backoff }) => {\n const at = tupleByRkid(state, state.outbox[ref].recipient.rkid)\n if (!at || !liveHead(state, at.tuple.ownPairLabel) || !probeOwed(state, at.tuple)) return { state: state as HolderState }\n // only the current probe's failure counts; a superseded one's touches nothing\n if (!(at.tuple.probeOut.inflight[at.tuple.probeOut.seq]?.digests ?? []).includes(ref)) return { state: state as HolderState }\n const label = at.tuple.ownPairLabel\n return { state: dueOnFailure(state as HolderState, { kind: 'continuity', v: 1, id: probeDutyId(label), relId: at.rel.id, tuple: label, step: 'probe' }, when, backoff) }\n}\n\n/** The alignment delivered: its duty ends (6850). */\nconst mappingAck: AckHandler = (state, ref) => {\n const at = tupleByRkid(state, state.outbox[ref].recipient.rkid)\n if (!at || !at.tuple.continuityOut.sent.includes(ref)) return { state: state as HolderState }\n const t = at.tuple\n const rp = t.continuityIn.recordPrior\n // only the alignment's own documents (this issuance's `sent`) complete it\n if (rp === null || !t.continuityOut.align || t.continuityOut.reported !== priorOf(t, rp)?.ownPairLabel) return { state: state as HolderState }\n const next = withTuple(state, t.ownPairLabel, (x) => ({ ...x, continuityOut: { ...x.continuityOut, aligned: true } }))\n return { state: t.continuityOut.due ? next : dropDuty(next, mappingDutyId(t.ownPairLabel)) }\n}\n\n/** A failed mapping that still stands: the resend is due at once (6840). */\nconst mappingFailed: FailureHandler = (state, ref, when, { backoff }) => {\n const at = tupleByRkid(state, state.outbox[ref].recipient.rkid)\n if (!at || !liveHead(state, at.tuple.ownPairLabel)) return { state: state as HolderState }\n const t = at.tuple\n const record = recordOf(t)\n if (!t.continuityOut.sent.includes(ref) || record === null || !issuanceStands(t, record)) return { state: state as HolderState }\n if (t.continuityOut.sent.some((x) => pending(state, x))) return { state: state as HolderState }\n const label = t.ownPairLabel\n return { state: dueOnFailure(state as HolderState, { kind: 'continuity', v: 1, id: mappingDutyId(label), relId: at.rel.id, tuple: label, step: 'mapping', attempt: 1 }, when, backoff) }\n}\n\n// ── reception: continuity-probe/0.1 (6a.2) ─────────────────────────────\n\ntype ProbePlan =\n | { kind: 'repeat' }\n | { kind: 'hold', label: string, assembly: NonNullable<Tuple['probeIn']['assembly']> }\n | { kind: 'discard', label: string, probe: Dec, reason: 'resource-limit' | 'rejected', ref: string }\n | { kind: 'complete', label: string, probe: Dec, matches: string[], record: boolean, issues: Issue[] }\n\nconst maxDec = (a: Dec, b: Dec): Dec => (BigInt(a) >= BigInt(b) ? a : b)\n\nfunction probeTask (bound: bigint, limit: number): TaskHandler<ProbeChunk, ProbePlan> {\n return {\n proof: 'absent',\n // stage 7: the closed chunk schema, exactly 256 entries (6670)\n decode: (payload) => (probeChunkOk(payload) ? payload as ProbeChunk : refuse('malformed', 'RLTP-TRU-6670')),\n async prepare (ctx, doc, arrival) {\n if ((doc.ceremony as { enactment?: unknown } | undefined)?.enactment !== undefined) return refuse('validation-failed')\n const st = ctx.snapshot\n const at = arrivalTuple(st, arrival.rkid)\n if (!at) return refuse('validation-failed', 'RLTP-TRU-6240')\n const t = at.tuple\n const body = doc.payload.body\n const probe = BigInt(body.probe)\n if (probe <= BigInt(t.probeIn.hwm)) return refuse('validation-failed', 'RLTP-TRU-6700')\n if (probe <= BigInt(t.probeIn.lowerBound)) return refuse('validation-failed', 'RLTP-TRU-5366')\n if (t.probeIn.assembly && probe < BigInt(t.probeIn.assembly.salt)) return refuse('validation-failed', 'RLTP-TRU-5340')\n const shared = await pairShared(ctx, t)\n if (!shared) return refuse('validation-failed', 'RLTP-TRU-6670')\n const S = ctx.crypto.subtle\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n // k_p of the sender's direction (6720)\n const k = await probeKeyOf(shared, t.counterpartAnchor, own, S)\n if (!(await probeChunkMacOk(k, doc.payload, S))) return refuse('validation-failed', 'RLTP-TRU-6670')\n const label = t.ownPairLabel\n const step = assemblyStep(t.probeIn.assembly, body.probe, body as unknown as { seq: Dec, last: boolean } & Record<string, Json>, doc.threadId, arrival.digest, limit)\n if (step.kind === 'limit') return { kind: 'discard', label, probe: body.probe, reason: 'resource-limit', ref: 'RLTP-TRU-5365' }\n if (step.kind === 'repeat') return { kind: 'repeat' }\n if (step.kind === 'reject') return { kind: 'discard', label, probe: body.probe, reason: 'rejected', ref: step.ref }\n if (step.kind === 'hold') return { kind: 'hold', label, assembly: step.assembly }\n const union = assembledBodies(step.chunks, step.last).flatMap((b) => b.blinded as string[])\n if (union.length !== Number(step.last) * PROBE_CHUNK || !strictlyAscending(union)) return { kind: 'discard', label, probe: body.probe, reason: 'rejected', ref: 'RLTP-TRU-6760' }\n // 6800: the counterpart anchors of the own prior-candidate set, never the fresh tuple's\n const inUnion = new Set(union)\n const matches: string[] = []\n for (const pc of t.priorCandidates) {\n if (pc.ownPairLabel === label || pc.counterpartAnchor === t.counterpartAnchor) continue\n for (const a of standsFor(pc)) {\n if (inUnion.has(await blindPrior(k, a, S))) { matches.push(pc.ownPairLabel); break }\n }\n }\n const record = isRecordSide(own, t.counterpartAnchor)\n const issues: Issue[] = []\n const o = t.continuityOut\n if (matches.length && record && o.chosen === null) {\n for (const m of matches) {\n if (!chainable(st, label, m)) continue\n const i = await prepareIssue(ctx, label, m)\n if (i) issues.push(i)\n }\n } else if (matches.length && !record && o.reported === null && t.continuityIn.recordPrior === null) {\n const m = matches.find((x) => chainable(st, label, x)) ?? matches[0]\n const i = await prepareIssue(ctx, label, m)\n if (i) issues.push(i)\n }\n return { kind: 'complete', label, probe: body.probe, matches, record, issues }\n },\n apply (state, prepared, _doc, arrival): Applied | TaskDiscarded {\n const p = prepared.value\n if (p.kind === 'repeat') return { state: state as HolderState }\n if (p.kind === 'hold') return { state: withTuple(state, p.label, (t) => ({ ...t, probeIn: { ...t.probeIn, assembly: p.assembly } })) }\n if (p.kind === 'discard') {\n // 5365, 5366: the assembly dropped, its probe the lower bound; the completed one stays\n return { discarded: true, reason: p.reason, ref: p.ref, state: withTuple(state, p.label, (t) => ({ ...t, probeIn: { ...t.probeIn, assembly: null, lowerBound: maxDec(t.probeIn.lowerBound, p.probe) } })) }\n }\n // 6690: the highest completed probe, in the completing chunk's commit\n let next = withTuple(state, p.label, (t) => ({ ...t, probeIn: { ...t.probeIn, hwm: p.probe, assembly: null } }))\n if (!p.matches.length) return { state: next } // 6260: honestly a new relationship\n const t = tupleByLabel(next, p.label)!.tuple\n if (p.record) {\n if (t.continuityOut.chosen !== null) return { state: next }\n return choose(next, p.label, p.matches, p.issues, bound, arrival.when, false)\n }\n if (t.continuityOut.reported !== null || t.continuityIn.recordPrior !== null) return { state: next }\n const m = p.issues[0]?.prior ?? p.matches.find((x) => chainable(next, p.label, x)) ?? p.matches[0]\n return issueOrOwe(next, p.label, m, p.issues[0] ?? null, 'report', arrival.when)\n },\n }\n}\n\n// ── reception: continuity-mapping/0.1 (6a.4) ───────────────────────────\n\ninterface MappingPlan {\n label: string\n /** the prior tuple the mapping's `prior` names (6960) */\n prior: string\n /** the sender is the record side (2290) */\n senderRecord: boolean\n /** the own anchor of the prior tuple: what an aligned mapping names */\n ownPrior: string\n /** the issuance the verification triggers: the alignment (non-record)\n * or the choice the match report informs (record) */\n issue: Issue | null\n}\n\nfunction mappingTask (bound: bigint): TaskHandler<ContinuityMapping, MappingPlan> {\n return {\n proof: 'absent',\n // step 1 (6940): the schema and a calendar-valid issuedAt\n decode: (payload) => (continuityMappingOk(payload) ? payload as ContinuityMapping : refuse('malformed', 'RLTP-TRU-6940')),\n async prepare (ctx, doc, arrival) {\n if ((doc.ceremony as { enactment?: unknown } | undefined)?.enactment !== undefined) return refuse('validation-failed')\n const st = ctx.snapshot\n const at = arrivalTuple(st, arrival.rkid)\n if (!at) return refuse('validation-failed', 'RLTP-TRU-6240')\n const t = at.tuple\n const b = doc.payload.body\n const own = (await ctx.keys.anchorOf(t.ownPairLabel)).anchor\n // steps 2 and 3 (6950): the tuple it arrived on\n if (b.to !== own || b.next !== t.counterpartAnchor) return refuse('validation-failed', 'RLTP-TRU-6950')\n // step 4 (6960): prior in the frozen prior-candidate set (6200)\n const pc = priorOf(t, b.prior)\n const pr = pc && tupleByLabel(st, pc.ownPairLabel)\n if (!pc || !pr) return refuse('validation-failed', 'RLTP-TRU-6960')\n // step 5 (6970): both secrets non-zero, mac1 under the prior relationship's, mac2 under the new\n const shNew = await pairShared(ctx, t)\n const shPrior = await pairShared(ctx, pr.tuple)\n if (!shNew || !shPrior || !(await continuityMacsOk(doc.payload, shPrior, shNew, ctx.crypto.subtle))) return refuse('validation-failed', 'RLTP-TRU-6970')\n const senderRecord = isRecordSide(b.next, own)\n const ownPrior = (await ctx.keys.anchorOf(pc.ownPairLabel)).anchor\n const o = t.continuityOut\n let issue: Issue | null = null\n // the alignment (6930): a new issuance under the next revision, even\n // where an earlier report already named this relationship\n if (senderRecord && !(o.align && o.reported === pc.ownPairLabel)) issue = await prepareIssue(ctx, t.ownPairLabel, pc.ownPairLabel)\n if (!senderRecord && o.chosen === null && chainable(st, t.ownPairLabel, pc.ownPairLabel)) issue = await prepareIssue(ctx, t.ownPairLabel, pc.ownPairLabel)\n return { label: t.ownPairLabel, prior: pc.ownPairLabel, senderRecord, ownPrior, issue }\n },\n // step 6 (6970): the revision rule with the record freeze, and what follows\n apply (state, prepared, doc, arrival): Applied | TaskRefusal {\n const at = arrivalTuple(state, arrival.rkid)\n if (!at) return refuse('validation-failed', 'RLTP-TRU-6240')\n const p = prepared.value\n const t = at.tuple\n const b = doc.payload.body\n const rev = BigInt(b.revision)\n const cur = BigInt(t.continuityIn.rev)\n if (rev === cur) {\n // a repeat is ignored (6270); another body under it an equivocation\n // a repeat changes nothing, not even an open duty: it answers no choice\n if (t.continuityIn.body === null || jcs(b) !== jcs(t.continuityIn.body)) return refuse('validation-failed', 'RLTP-TRU-6270')\n return { state: state as HolderState }\n }\n if (rev < cur) return refuse('validation-failed', 'RLTP-TRU-6270')\n if (p.senderRecord && t.continuityIn.recordPrior !== null && t.continuityIn.recordPrior !== b.prior) return refuse('validation-failed', 'RLTP-TRU-6290')\n let next = withTuple(state, p.label, (x) => ({\n ...x, continuityIn: { rev: b.revision, body: b as unknown as Json, recordPrior: p.senderRecord ? b.prior : x.continuityIn.recordPrior },\n }))\n if (p.senderRecord) {\n // 6900: the non-record side chains on verifying the record side's mapping\n const c = chainTuple(next, p.label, p.prior, bound)\n if (c === 'taken') return refuse('validation-failed', 'RLTP-TRU-6900')\n let out: Applied = { state: next }\n if (c !== 'already') out = { state: c.state, events: c.events, duties: c.duties, renames: c.renames }\n next = out.state\n // 6850: the report duty ends; the alignment arises in its place (6930)\n const x = tupleByLabel(next, p.label)!.tuple\n if (x.continuityOut.due?.kind === 'report') next = withTuple(next, p.label, (y) => ({ ...y, continuityOut: { ...y.continuityOut, due: null } }))\n // a higher revision of the same choice, already aligned to: nothing new\n if (x.continuityOut.align && x.continuityOut.reported === p.prior) return { ...out, state: next }\n return merge(out, issueOrOwe(next, p.label, p.prior, p.issue, 'align', arrival.when))\n }\n // the non-record side's report or alignment, verified with mac1 under the\n // prior relationship's key (6970): the evidence the record side chains on\n const x = tupleByLabel(next, p.label)!.tuple\n if (x.continuityOut.chosen === null) return choose(next, p.label, [p.prior], p.issue ? [p.issue] : [], bound, arrival.when, true)\n if (x.continuityOut.chosen !== p.prior) return { state: next }\n // the choice made on a hit: chained now (6900), once\n const c = chainTuple(next, p.label, p.prior, bound)\n if (c === 'taken') return refuse('validation-failed', 'RLTP-TRU-6900')\n const out: Applied = c === 'already' ? { state: next } : { state: c.state, events: c.events, duties: c.duties, renames: c.renames }\n // the counterpart's mapping on the chosen relationship, verified under a\n // higher revision than any it held, answers the choice (6840); the\n // report a choice was made from is not its answer\n return { ...out, state: answered(out.state, p.label) }\n },\n }\n}\n\n/** The record side's choice answered: its standing duty ends (6840). */\nconst answered = (state: HolderState, label: string): HolderState =>\n dropDuty(withTuple(state, label, (y) => ({ ...y, continuityOut: { ...y.continuityOut, aligned: true } })), mappingDutyId(label))\n\n// ── the module's parts ─────────────────────────────────────────────────\n\n/** What trustModule registers for continuity. */\nexport function continuityParts (bound: bigint, limit: number): Pick<HolderModule, 'tasks' | 'duties' | 'acks' | 'failures' | 'ownRetries' | 'keepKeys'> {\n return {\n ownRetries: [CONTINUITY_PROBE_TYPE],\n keepKeys: continuityKeys,\n tasks: { [CONTINUITY_PROBE_TYPE]: probeTask(bound, limit), [CONTINUITY_MAPPING_TYPE]: mappingTask(bound) },\n duties: { continuity: continuityDuty(bound) },\n acks: { [CONTINUITY_PROBE_TYPE]: probeAck, [CONTINUITY_MAPPING_TYPE]: mappingAck },\n failures: { [CONTINUITY_PROBE_TYPE]: probeFailed, [CONTINUITY_MAPPING_TYPE]: mappingFailed },\n }\n}\n\n/**\n * The testing module (./testing): its non-human command continuity.newTuple\n * opens a fresh tuple the way the encounter will (PR 7), with the rkid\n * the KeyProvider derives for its label.\n */\nexport const continuityTestModule: HolderModule = Object.freeze({\n name: 'continuity-test',\n commands: Object.freeze({\n [NEW_TUPLE]: {\n human: false,\n async prepare (ctx: PrepareCtx, input: NewTupleInput) {\n // Identity §6.1: the label digests the 32 nonce bytes\n if (input.nonce !== undefined) {\n const n = fromB64u(input.nonce)\n if (n.length !== 32 || 'pair/' + await digestBytes(n, ctx.crypto.subtle) !== input.ownPairLabel) throw new TypeError(`${NEW_TUPLE}: the label is not pair/<multihash(nonce)> of a 32-byte nonce`)\n }\n return (await ctx.keys.anchorOf(input.ownPairLabel)).keyAgreement\n },\n apply: (state: Readonly<HolderState>, prepared: { value: string }, input: NewTupleInput, when: Millis) => openTuple(state, input, prepared.value, when),\n } satisfies CommandDef<NewTupleInput, string>,\n }),\n})\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { DutyHandler } from '../engine.js';
|
|
2
|
+
import type { ClassOnDuty, Contact, Duty, HolderState, Relationship, TrustClass } from '../state.js';
|
|
3
|
+
/** The classes a class-on duty delivers (2850), in the table's order. */
|
|
4
|
+
export declare const DUTY_CLASSES: readonly TrustClass[];
|
|
5
|
+
/** The classes the reconciliation of 5.4 delivers. */
|
|
6
|
+
export declare const RECONCILED: readonly TrustClass[];
|
|
7
|
+
/** The class-on duty's deterministic id. */
|
|
8
|
+
export declare const classOnId: (cls: TrustClass, relId: string) => string;
|
|
9
|
+
/** The profile revision duty's deterministic id (6455). */
|
|
10
|
+
export declare const profileDutyId: (relId: string) => string;
|
|
11
|
+
/** The class a duty delivers on one relationship, or null for every other
|
|
12
|
+
* kind — and for a known kind at a version this library does not handle,
|
|
13
|
+
* which stays opaque: never moved, dropped or checked (note §2.1). */
|
|
14
|
+
export declare function classOfDuty(d: Duty): TrustClass | null;
|
|
15
|
+
/** Is `d` a duty of a duty class owed on `relId` (of class `cls`, where given)? */
|
|
16
|
+
export declare const owedOn: (d: Duty, relId: string, cls?: TrustClass) => boolean;
|
|
17
|
+
/** Whether the class has an artifact to send now: the profile once one exists. */
|
|
18
|
+
export declare const hasArtifact: (state: Readonly<HolderState>, cls: TrustClass) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `cls` is on for relationship `r` (2850, 6595): on toward the
|
|
21
|
+
* entry its verifications go to, the relationship live, and, except for
|
|
22
|
+
* the star and the blinded group star, not lagging in that entry.
|
|
23
|
+
*/
|
|
24
|
+
export declare function onFor(state: Readonly<HolderState>, r: Readonly<Relationship>, cls: TrustClass): boolean;
|
|
25
|
+
/** A class-on duty of `cls` on `relId`, unless one is open in `state` or among `extra`. */
|
|
26
|
+
export declare function classOnDuty(state: Readonly<HolderState>, contactId: string, relId: string, cls: TrustClass, extra?: readonly Duty[]): ClassOnDuty[];
|
|
27
|
+
/** The drop rule (6410, 2790): every duty of a duty class owed on a
|
|
28
|
+
* relationship whose entry has that class off goes; `extra` (duties a
|
|
29
|
+
* transition is about to open) is filtered the same way. */
|
|
30
|
+
export declare function dropOff(state: HolderState, extra?: readonly Duty[]): {
|
|
31
|
+
state: HolderState;
|
|
32
|
+
extra: Duty[];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The follow rule (see the header) over a transition from `before` to
|
|
36
|
+
* `after`: the drop rule on `after`, then a class-on duty for every live
|
|
37
|
+
* relationship and duty class on for it now and not before. `extra` are
|
|
38
|
+
* the duties the transition opens besides (kept, deduplicated against);
|
|
39
|
+
* the result's `duties` are those and the new ones.
|
|
40
|
+
*/
|
|
41
|
+
export declare function followClasses(before: Readonly<HolderState>, after: HolderState, extra?: readonly Duty[]): {
|
|
42
|
+
state: HolderState;
|
|
43
|
+
duties: Duty[];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The move at a chaining (6a.4, 2146): the class duties owed on `from`
|
|
47
|
+
* (the chain, then the appended relationship) go to `relId` under
|
|
48
|
+
* `contactId`, none dropped. Several re-issues are one (6596: one delivery
|
|
49
|
+
* meets every re-issue owed), its urgency kept: the earliest dueAt (absent:
|
|
50
|
+
* at once) and the most urgent awaited head (null, due at once, wins; else
|
|
51
|
+
* the first's); several class-on duties of one class are one; several
|
|
52
|
+
* profile duties are one, at the highest revision.
|
|
53
|
+
*/
|
|
54
|
+
export declare function moveDuties(state: HolderState, from: readonly string[], relId: string, contactId: string): HolderState;
|
|
55
|
+
/** 6465: after a chaining, the profile's class-on duty on the chain where
|
|
56
|
+
* the class is on for it and a profile exists. */
|
|
57
|
+
export declare function afterChain(state: Readonly<HolderState>, relId: string, extra: readonly Duty[]): Duty[];
|
|
58
|
+
/**
|
|
59
|
+
* The class-on/1 handler: a reconciled class is fulfilled without sending
|
|
60
|
+
* (its sweep runs in the same resume after the duties, 5850); a class with
|
|
61
|
+
* a handler in `byClass` runs it (the anchor mapping, the profile); any
|
|
62
|
+
* other waits.
|
|
63
|
+
*/
|
|
64
|
+
export declare function classOnHandler(byClass: Partial<Record<TrustClass, DutyHandler>>): DutyHandler;
|
|
65
|
+
/** Every relationship of `c` the class is on for (2820, 2850): for tests and views. */
|
|
66
|
+
export declare const onRelationships: (state: Readonly<HolderState>, c: Readonly<Contact>, cls: TrustClass) => string[];
|
|
67
|
+
//# sourceMappingURL=duties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duties.d.ts","sourceRoot":"","sources":["../../src/trust/duties.ts"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAmC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIrI,yEAAyE;AACzE,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAgD,CAAA;AAC9F,sDAAsD;AACtD,eAAO,MAAM,UAAU,EAAE,SAAS,UAAU,EAA4D,CAAA;AAExG,4CAA4C;AAC5C,eAAO,MAAM,SAAS,GAAI,KAAK,UAAU,EAAE,OAAO,MAAM,KAAG,MAAoC,CAAA;AAC/F,2DAA2D;AAC3D,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,MAA4B,CAAA;AAE1E;;uEAEuE;AACvE,wBAAgB,WAAW,CAAE,CAAC,EAAE,IAAI,GAAG,UAAU,GAAG,IAAI,CAMvD;AAED,mFAAmF;AACnF,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,EAAE,OAAO,MAAM,EAAE,MAAM,UAAU,KAAG,OAGjE,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,WAAW,GAAI,OA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,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,GAAG,WAAW,CAe9F;AAED,uFAAuF;AACvF,eAAO,MAAM,eAAe,GAAI,OAAO,QAAQ,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,UAAU,KAAG,MAAM,EACzB,CAAA"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { classOnToward, entryOf, entryRelationships, lags, liveRel } from './state.js';
|
|
2
|
+
import { isKnownDuty } from '../codec.js';
|
|
3
|
+
/** The classes a class-on duty delivers (2850), in the table's order. */
|
|
4
|
+
export const DUTY_CLASSES = Object.freeze(['anchorMapping', 'profile']);
|
|
5
|
+
/** The classes the reconciliation of 5.4 delivers. */
|
|
6
|
+
export const RECONCILED = Object.freeze(['star', 'groupStar', 'sealedGroupStar']);
|
|
7
|
+
/** The class-on duty's deterministic id. */
|
|
8
|
+
export const classOnId = (cls, relId) => `class-on:${cls}:${relId}`;
|
|
9
|
+
/** The profile revision duty's deterministic id (6455). */
|
|
10
|
+
export const profileDutyId = (relId) => `profile:${relId}`;
|
|
11
|
+
/** The class a duty delivers on one relationship, or null for every other
|
|
12
|
+
* kind — and for a known kind at a version this library does not handle,
|
|
13
|
+
* which stays opaque: never moved, dropped or checked (note §2.1). */
|
|
14
|
+
export function classOfDuty(d) {
|
|
15
|
+
if (!isKnownDuty(d))
|
|
16
|
+
return null;
|
|
17
|
+
if (d.kind === 'class-on')
|
|
18
|
+
return d.cls;
|
|
19
|
+
if (d.kind === 'reissue-mapping')
|
|
20
|
+
return 'anchorMapping';
|
|
21
|
+
if (d.kind === 'profile')
|
|
22
|
+
return 'profile';
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/** Is `d` a duty of a duty class owed on `relId` (of class `cls`, where given)? */
|
|
26
|
+
export const owedOn = (d, relId, cls) => {
|
|
27
|
+
const c = classOfDuty(d);
|
|
28
|
+
return c !== null && (cls === undefined || c === cls) && d.relId === relId;
|
|
29
|
+
};
|
|
30
|
+
/** Whether the class has an artifact to send now: the profile once one exists. */
|
|
31
|
+
export const hasArtifact = (state, cls) => cls !== 'profile' || state.profile.body !== null;
|
|
32
|
+
/**
|
|
33
|
+
* Whether `cls` is on for relationship `r` (2850, 6595): on toward the
|
|
34
|
+
* entry its verifications go to, the relationship live, and, except for
|
|
35
|
+
* the star and the blinded group star, not lagging in that entry.
|
|
36
|
+
*/
|
|
37
|
+
export function onFor(state, r, cls) {
|
|
38
|
+
if (!liveRel(r))
|
|
39
|
+
return false;
|
|
40
|
+
const c = entryOf(state, r);
|
|
41
|
+
if (!c || !c.relIds.includes(r.id) || !classOnToward(c, cls))
|
|
42
|
+
return false;
|
|
43
|
+
if (cls === 'star' || cls === 'groupStar')
|
|
44
|
+
return true;
|
|
45
|
+
return !lags(r, entryRelationships(state, c));
|
|
46
|
+
}
|
|
47
|
+
/** A class-on duty of `cls` on `relId`, unless one is open in `state` or among `extra`. */
|
|
48
|
+
export function classOnDuty(state, contactId, relId, cls, extra = []) {
|
|
49
|
+
const id = classOnId(cls, relId);
|
|
50
|
+
if (Object.hasOwn(state.duties, id) || extra.some((d) => d.id === id))
|
|
51
|
+
return [];
|
|
52
|
+
return [{ kind: 'class-on', v: 1, id, contactId, relId, cls }];
|
|
53
|
+
}
|
|
54
|
+
/** The drop rule (6410, 2790): every duty of a duty class owed on a
|
|
55
|
+
* relationship whose entry has that class off goes; `extra` (duties a
|
|
56
|
+
* transition is about to open) is filtered the same way. */
|
|
57
|
+
export function dropOff(state, extra = []) {
|
|
58
|
+
const off = (d) => {
|
|
59
|
+
const cls = classOfDuty(d);
|
|
60
|
+
if (cls === null)
|
|
61
|
+
return false;
|
|
62
|
+
const relId = d.relId;
|
|
63
|
+
if (!Object.hasOwn(state.relationships, relId))
|
|
64
|
+
return false;
|
|
65
|
+
const r = state.relationships[relId];
|
|
66
|
+
if (r.chainedInto !== null)
|
|
67
|
+
return false; // moved at the chaining
|
|
68
|
+
const c = entryOf(state, r);
|
|
69
|
+
return c !== undefined && !classOnToward(c, cls);
|
|
70
|
+
};
|
|
71
|
+
const gone = Object.values(state.duties).filter(off);
|
|
72
|
+
const next = gone.length
|
|
73
|
+
? { ...state, duties: Object.fromEntries(Object.entries(state.duties).filter(([, d]) => !off(d))) }
|
|
74
|
+
: state;
|
|
75
|
+
return { state: next, extra: extra.filter((d) => !off(d)) };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The follow rule (see the header) over a transition from `before` to
|
|
79
|
+
* `after`: the drop rule on `after`, then a class-on duty for every live
|
|
80
|
+
* relationship and duty class on for it now and not before. `extra` are
|
|
81
|
+
* the duties the transition opens besides (kept, deduplicated against);
|
|
82
|
+
* the result's `duties` are those and the new ones.
|
|
83
|
+
*/
|
|
84
|
+
export function followClasses(before, after, extra = []) {
|
|
85
|
+
const d = dropOff(after, extra);
|
|
86
|
+
const state = d.state;
|
|
87
|
+
const duties = [...d.extra];
|
|
88
|
+
for (const id of Object.keys(state.relationships).sort()) {
|
|
89
|
+
const r = state.relationships[id];
|
|
90
|
+
if (!liveRel(r))
|
|
91
|
+
continue;
|
|
92
|
+
const was = Object.hasOwn(before.relationships, id) ? before.relationships[id] : undefined;
|
|
93
|
+
for (const cls of DUTY_CLASSES) {
|
|
94
|
+
if (!hasArtifact(state, cls) || !onFor(state, r, cls))
|
|
95
|
+
continue;
|
|
96
|
+
if (was && onFor(before, was, cls))
|
|
97
|
+
continue;
|
|
98
|
+
duties.push(...classOnDuty(state, entryOf(state, r).id, id, cls, duties));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return { state, duties };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The move at a chaining (6a.4, 2146): the class duties owed on `from`
|
|
105
|
+
* (the chain, then the appended relationship) go to `relId` under
|
|
106
|
+
* `contactId`, none dropped. Several re-issues are one (6596: one delivery
|
|
107
|
+
* meets every re-issue owed), its urgency kept: the earliest dueAt (absent:
|
|
108
|
+
* at once) and the most urgent awaited head (null, due at once, wins; else
|
|
109
|
+
* the first's); several class-on duties of one class are one; several
|
|
110
|
+
* profile duties are one, at the highest revision.
|
|
111
|
+
*/
|
|
112
|
+
export function moveDuties(state, from, relId, contactId) {
|
|
113
|
+
const owed = Object.values(state.duties)
|
|
114
|
+
.filter((d) => classOfDuty(d) !== null && from.includes(d.relId))
|
|
115
|
+
.sort((a, b) => from.indexOf(a.relId) - from.indexOf(b.relId));
|
|
116
|
+
if (!owed.length)
|
|
117
|
+
return state;
|
|
118
|
+
const duties = { ...state.duties };
|
|
119
|
+
for (const d of owed)
|
|
120
|
+
delete duties[d.id];
|
|
121
|
+
const reissues = owed.filter((d) => d.kind === 'reissue-mapping');
|
|
122
|
+
if (reissues.length) {
|
|
123
|
+
// urgency kept: due at the earliest of them (absent: at once), not
|
|
124
|
+
// waiting where any was due without a wait
|
|
125
|
+
const { dueAt: _, ...base } = reissues[0];
|
|
126
|
+
const awaitHead = reissues.some((d) => d.awaitHead === null) ? null : base.awaitHead;
|
|
127
|
+
const dues = reissues.map((d) => d.dueAt);
|
|
128
|
+
const dueAt = dues.some((x) => x === undefined) ? undefined : Math.min(...dues);
|
|
129
|
+
duties[base.id] = { ...base, contactId, relId, awaitHead, ...(dueAt !== undefined ? { dueAt } : {}) };
|
|
130
|
+
}
|
|
131
|
+
for (const d of owed.filter((x) => x.kind === 'class-on')) {
|
|
132
|
+
const id = classOnId(d.cls, relId);
|
|
133
|
+
if (!Object.hasOwn(duties, id))
|
|
134
|
+
duties[id] = { ...d, id, contactId, relId };
|
|
135
|
+
}
|
|
136
|
+
const profiles = owed.filter((d) => d.kind === 'profile');
|
|
137
|
+
if (profiles.length) {
|
|
138
|
+
const top = profiles.reduce((a, b) => (BigInt(b.rev) > BigInt(a.rev) ? b : a));
|
|
139
|
+
const id = profileDutyId(relId);
|
|
140
|
+
const held = Object.hasOwn(duties, id) ? duties[id] : undefined;
|
|
141
|
+
if (!held || BigInt(top.rev) > BigInt(held.rev))
|
|
142
|
+
duties[id] = { ...top, id, contactId, relId };
|
|
143
|
+
}
|
|
144
|
+
return { ...state, duties };
|
|
145
|
+
}
|
|
146
|
+
/** 6465: after a chaining, the profile's class-on duty on the chain where
|
|
147
|
+
* the class is on for it and a profile exists. */
|
|
148
|
+
export function afterChain(state, relId, extra) {
|
|
149
|
+
const r = state.relationships[relId];
|
|
150
|
+
if (!r || !hasArtifact(state, 'profile') || !onFor(state, r, 'profile'))
|
|
151
|
+
return [];
|
|
152
|
+
return classOnDuty(state, entryOf(state, r).id, relId, 'profile', extra);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The class-on/1 handler: a reconciled class is fulfilled without sending
|
|
156
|
+
* (its sweep runs in the same resume after the duties, 5850); a class with
|
|
157
|
+
* a handler in `byClass` runs it (the anchor mapping, the profile); any
|
|
158
|
+
* other waits.
|
|
159
|
+
*/
|
|
160
|
+
export function classOnHandler(byClass) {
|
|
161
|
+
const of = (d) => d.cls;
|
|
162
|
+
return {
|
|
163
|
+
v: 1,
|
|
164
|
+
prepare: (ctx, duty) => {
|
|
165
|
+
const h = byClass[of(duty)];
|
|
166
|
+
return h?.prepare ? h.prepare(ctx, duty) : Promise.resolve(null);
|
|
167
|
+
},
|
|
168
|
+
apply(state, duty, ctx, when) {
|
|
169
|
+
const cls = of(duty);
|
|
170
|
+
if (RECONCILED.includes(cls))
|
|
171
|
+
return { state: state };
|
|
172
|
+
const h = byClass[cls];
|
|
173
|
+
return h ? h.apply(state, duty, ctx, when) : 'not-due';
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** Every relationship of `c` the class is on for (2820, 2850): for tests and views. */
|
|
178
|
+
export const onRelationships = (state, c, cls) => entryRelationships(state, c).filter((r) => onFor(state, r, cls)).map((r) => r.id);
|
|
179
|
+
//# sourceMappingURL=duties.js.map
|