@interop/wallet-core 0.87.0 → 0.89.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.
@@ -20,12 +20,19 @@ type DerivedGap = Pick<InvariantGap, 'invariant' | 'kind'>;
20
20
  * The invariants a transient visit on a standing credential reaches. The
21
21
  * two chain triggers are read through `dueAt` over the ladder held set; a
22
22
  * `login-routing` site counts unless the client-key-record probe guards it;
23
- * an `encounter` site counts, since the read it rides runs on any session;
24
- * a `ceremony-tail` entry counts, every such ceremony running on any
25
- * session type; and a detector no site reports (a declaration carrying
26
- * `holdsWhen`) counts when it is checked at a trigger a transient visit
27
- * fires and, on the chain, under an authority the ladder held set carries.
28
- * An unreported declaration with no detector is reached by nothing.
23
+ * an `encounter` site counts when its `reachedBy` names `transient` and the
24
+ * ladder held set admits every invariant it reports, the test a chain
25
+ * registration meets; a `ceremony-tail` entry counts, every such ceremony
26
+ * running on any session type; and a detector no site reports (a
27
+ * declaration carrying `holdsWhen`) counts when it is checked at routing or,
28
+ * on the transient chain, under an authority the ladder held set carries.
29
+ * An unreported declaration with no detector is reached by nothing. No
30
+ * unreported declaration lists `encounter`, since `menderRegistry` refuses
31
+ * one at construction.
32
+ *
33
+ * The rule trusts each declaration's `authority`. A declaration claiming a
34
+ * wider authority than what converges it on a transient visit would count
35
+ * an encounter site as reachable and hide a real `unreachable` gap.
29
36
  *
30
37
  * @param options {object}
31
38
  * @param options.registry {MenderRegistry}
@@ -43,7 +50,9 @@ export declare function transientReachableInvariants({ registry }: {
43
50
  * a gap. A declaration naming a chain or routing trigger no site backs
44
51
  * derives `none` whatever else it names. An invariant reported only at sites
45
52
  * a transient visit cannot reach, on an account shape the violation can
46
- * stand on, derives `unreachable`. Nothing else derives a gap.
53
+ * stand on, derives `unreachable`. That includes an invariant reported
54
+ * only at encounter sites a transient visit does not reach: the ceremony-tail
55
+ * exemption does not extend to `encounter`. Nothing else derives a gap.
47
56
  *
48
57
  * @param options {object}
49
58
  * @param options.registry {MenderRegistry}
@@ -1 +1 @@
1
- {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/menders/derive.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEhE;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,MAAM,CAAC,CAAA;AAW1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,WAAW,CAAC,CA2C7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,UAAU,CAAC,CAoB5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAQ,EACT,EAAE;IACD,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAClC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;CACtC,GAAG,aAAa,CAAC,UAAU,CAAC,CAS5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,WAAW,CAAC,CAG7B"}
1
+ {"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/menders/derive.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAEhE;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,MAAM,CAAC,CAAA;AAW1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,WAAW,CAAC,CA4C7B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,UAAU,CAAC,CAoB5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAQ,EACT,EAAE;IACD,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;IAClC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;CACtC,GAAG,aAAa,CAAC,UAAU,CAAC,CAS5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACT,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAA;CAClD,GAAG,aAAa,CAAC,WAAW,CAAC,CAG7B"}
@@ -21,12 +21,19 @@ function reportedIds(registry) {
21
21
  * The invariants a transient visit on a standing credential reaches. The
22
22
  * two chain triggers are read through `dueAt` over the ladder held set; a
23
23
  * `login-routing` site counts unless the client-key-record probe guards it;
24
- * an `encounter` site counts, since the read it rides runs on any session;
25
- * a `ceremony-tail` entry counts, every such ceremony running on any
26
- * session type; and a detector no site reports (a declaration carrying
27
- * `holdsWhen`) counts when it is checked at a trigger a transient visit
28
- * fires and, on the chain, under an authority the ladder held set carries.
29
- * An unreported declaration with no detector is reached by nothing.
24
+ * an `encounter` site counts when its `reachedBy` names `transient` and the
25
+ * ladder held set admits every invariant it reports, the test a chain
26
+ * registration meets; a `ceremony-tail` entry counts, every such ceremony
27
+ * running on any session type; and a detector no site reports (a
28
+ * declaration carrying `holdsWhen`) counts when it is checked at routing or,
29
+ * on the transient chain, under an authority the ladder held set carries.
30
+ * An unreported declaration with no detector is reached by nothing. No
31
+ * unreported declaration lists `encounter`, since `menderRegistry` refuses
32
+ * one at construction.
33
+ *
34
+ * The rule trusts each declaration's `authority`. A declaration claiming a
35
+ * wider authority than what converges it on a transient visit would count
36
+ * an encounter site as reachable and hide a real `unreachable` gap.
30
37
  *
31
38
  * @param options {object}
32
39
  * @param options.registry {MenderRegistry}
@@ -44,8 +51,11 @@ export function transientReachableInvariants({ registry }) {
44
51
  }
45
52
  }
46
53
  for (const site of registry.sites()) {
47
- if ((site.trigger === 'login-routing' && !site.guardedBy) ||
48
- site.trigger === 'encounter') {
54
+ const routed = site.trigger === 'login-routing' && !site.guardedBy;
55
+ const encountered = site.trigger === 'encounter' &&
56
+ site.reachedBy.includes('transient') &&
57
+ registry.admits({ site, held });
58
+ if (routed || encountered) {
49
59
  for (const id of site.reports) {
50
60
  reached.add(id);
51
61
  }
@@ -61,7 +71,6 @@ export function transientReachableInvariants({ registry }) {
61
71
  continue;
62
72
  }
63
73
  const checkedOnVisit = decl.triggers.includes('login-routing') ||
64
- decl.triggers.includes('encounter') ||
65
74
  (decl.triggers.includes('transient-login-chain') &&
66
75
  held.includes(decl.authority));
67
76
  if (checkedOnVisit) {
@@ -82,7 +91,9 @@ export function transientReachableInvariants({ registry }) {
82
91
  * a gap. A declaration naming a chain or routing trigger no site backs
83
92
  * derives `none` whatever else it names. An invariant reported only at sites
84
93
  * a transient visit cannot reach, on an account shape the violation can
85
- * stand on, derives `unreachable`. Nothing else derives a gap.
94
+ * stand on, derives `unreachable`. That includes an invariant reported
95
+ * only at encounter sites a transient visit does not reach: the ceremony-tail
96
+ * exemption does not extend to `encounter`. Nothing else derives a gap.
86
97
  *
87
98
  * @param options {object}
88
99
  * @param options.registry {MenderRegistry}
@@ -1 +1 @@
1
- {"version":3,"file":"derive.js","sourceRoot":"","sources":["../../src/menders/derive.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,UAAU,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAQ/C;;GAEG;AACH,SAAS,WAAW,CAClB,QAAiD;IAEjD,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;AAChE,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,4BAA4B,CAAC,EAC3C,QAAQ,EAGT;IACC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAe,CAAA;IACtC,MAAM,IAAI,GAAG,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IAChD,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC;QAChC,IAAI;QACJ,OAAO,EAAE,uBAAuB;KACjC,CAAC,EAAE,CAAC;QACH,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACjB,CAAC;IACH,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACpC,IACE,CAAC,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vB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EACzC,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;QACxD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,OAAO,EACP,QAAQ,EAIT;IACC,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CACtB,CAAC,QAAQ,CAAC,IAAI,CACZ,GAAG,CAAC,EAAE,CACJ,GAAG,CAAC,SAAS,KAAK,SAAS;QAC3B,CAAC,IAAI,KAAK,aAAa,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAClD,CACJ,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,QAAQ,EAGT;IACC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7D,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AACtD,CAAC"}
@@ -14,11 +14,15 @@
14
14
  * `MendOutcome`, `MendReportEntry`, `MendReport`, `InvariantGap`,
15
15
  * `LoginRoute`
16
16
  * - the readers: `menderRegistry` (`all`, `byId`, `sites`, `admits`,
17
- * `dueAt`), which refuses a duplicated id, an undeclared report, or a
18
- * guard on a non-routing site at construction, and `heldAuthorities`, the
19
- * held set a session's account-ceremony context derives
20
- * - the runner: `runMenderBlock`, one try, warn, and skip discipline over
21
- * one chain trigger's registrations, `mendReportAccumulator`, the
17
+ * `dueAt`), which refuses a duplicated id, an undeclared report, a
18
+ * guard on a non-routing site, an encounter site with no reach, or an
19
+ * encounter trigger no encounter site backs at construction, and
20
+ * `heldAuthorities`, the held set a session's account-ceremony context
21
+ * derives
22
+ * - the runner: `runMenderRegistration`, one try, warn, and skip
23
+ * discipline over one registration, shared by the chain runner and a
24
+ * wallet's encounter sites; `runMenderBlock`, that discipline over one
25
+ * chain trigger's registrations; `mendReportAccumulator`, the
22
26
  * pre-session report collector its `onOutcome` feeds, and `errorNameOf`,
23
27
  * the name a report carries for a thrown value of any shape
24
28
  * - the derived sets a wallet's audit tests pin:
@@ -35,7 +39,7 @@ export type { InvariantId } from './ids.js';
35
39
  export { heldAuthorities, menderRegistry } from './registry.js';
36
40
  export type { MenderRegistry, ResolvedAuthority } from './registry.js';
37
41
  export { errorNameOf } from '../errorName.js';
38
- export { MEND_REPORT_SHAPE_ERROR, mendReportAccumulator, runMenderBlock } from './runner.js';
42
+ export { MEND_REPORT_SHAPE_ERROR, mendReportAccumulator, runMenderBlock, runMenderRegistration } from './runner.js';
39
43
  export type { MendReportAccumulator } from './runner.js';
40
44
  export type { InvariantDeclaration, InvariantGap, LoginRoute, MendOutcome, MendReport, MendReportEntry, Registration, RegistrationSite } from './types.js';
41
45
  export { ACCOUNT_SHAPES, AUTHORITIES, CHAIN_TRIGGERS, EVIDENCE, GAP_KINDS, MEND_OUTCOMES, TRIGGERS } from './vocabulary.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/menders/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,UAAU,EACV,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;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M,aAAa,CAAA;AACpB,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxD,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EACf,YAAY,EACZ,gBAAgB,EACjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,eAAe,EACf,OAAO,EACR,MAAM,iBAAiB,CAAA"}
@@ -14,11 +14,15 @@
14
14
  * `MendOutcome`, `MendReportEntry`, `MendReport`, `InvariantGap`,
15
15
  * `LoginRoute`
16
16
  * - the readers: `menderRegistry` (`all`, `byId`, `sites`, `admits`,
17
- * `dueAt`), which refuses a duplicated id, an undeclared report, or a
18
- * guard on a non-routing site at construction, and `heldAuthorities`, the
19
- * held set a session's account-ceremony context derives
20
- * - the runner: `runMenderBlock`, one try, warn, and skip discipline over
21
- * one chain trigger's registrations, `mendReportAccumulator`, the
17
+ * `dueAt`), which refuses a duplicated id, an undeclared report, a
18
+ * guard on a non-routing site, an encounter site with no reach, or an
19
+ * encounter trigger no encounter site backs at construction, and
20
+ * `heldAuthorities`, the held set a session's account-ceremony context
21
+ * derives
22
+ * - the runner: `runMenderRegistration`, one try, warn, and skip
23
+ * discipline over one registration, shared by the chain runner and a
24
+ * wallet's encounter sites; `runMenderBlock`, that discipline over one
25
+ * chain trigger's registrations; `mendReportAccumulator`, the
22
26
  * pre-session report collector its `onOutcome` feeds, and `errorNameOf`,
23
27
  * the name a report carries for a thrown value of any shape
24
28
  * - the derived sets a wallet's audit tests pin:
@@ -33,6 +37,6 @@ export { deriveGaps, transientReachableInvariants, undeclaredGaps, undeclaredInv
33
37
  export { INVARIANT_IDS } from './ids.js';
34
38
  export { heldAuthorities, menderRegistry } from './registry.js';
35
39
  export { errorNameOf } from '../errorName.js';
36
- export { MEND_REPORT_SHAPE_ERROR, mendReportAccumulator, runMenderBlock } from './runner.js';
40
+ export { MEND_REPORT_SHAPE_ERROR, mendReportAccumulator, runMenderBlock, runMenderRegistration } from './runner.js';
37
41
  export { ACCOUNT_SHAPES, AUTHORITIES, CHAIN_TRIGGERS, EVIDENCE, GAP_KINDS, MEND_OUTCOMES, TRIGGERS } from './vocabulary.js';
38
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/menders/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,UAAU,EACV,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACf,MAAM,aAAa,CAAA;AAYpB,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/menders/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EACL,UAAU,EACV,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAA;AAYpB,OAAO,EACL,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,iBAAiB,CAAA"}
@@ -9,9 +9,12 @@
9
9
  * listed under one chain trigger that `admits` passes, in list order.
10
10
  * Registration order is execution order; there is no dependency graph and
11
11
  * no priority. The table and the sites are checked once, at construction: a
12
- * duplicated declaration id, a site reporting an undeclared invariant, or a
13
- * guard on a non-routing site is a `TypeError` there, so no reader meets the
14
- * defect later, depending on what a login happens to hold.
12
+ * duplicated declaration id, a site reporting an undeclared invariant, a
13
+ * guard on a non-routing site, an encounter site with no reach, or a
14
+ * declaration listing `encounter` that no encounter site reports is a
15
+ * `TypeError` there, so no reader meets the defect later, depending on what
16
+ * a login happens to hold. Both wallets build their registries at import, so
17
+ * the error surfaces at module load.
15
18
  */
16
19
  import type { InvariantId } from './ids.js';
17
20
  import type { InvariantDeclaration, LoginRoute, RegistrationSite } from './types.js';
@@ -35,7 +38,8 @@ export interface MenderRegistry<Site extends RegistrationSite, Deps, Ceremony ex
35
38
  /**
36
39
  * Whether a site's every reported invariant declares an authority in
37
40
  * `held` and, when a route is given, admits it. The one admission test,
38
- * shared by `dueAt` and by a runner admitting a site the caller supplies.
41
+ * shared by `dueAt`, by a runner admitting a site the caller supplies, and
42
+ * by the derivation's encounter reach rule, which gives no route.
39
43
  *
40
44
  * @throws {TypeError} when the site reports an undeclared invariant,
41
45
  * reachable only for a site the registry does not index
@@ -67,7 +71,9 @@ export declare function heldAuthorities({ kind }: {
67
71
  /**
68
72
  * Builds the readers over one wallet's declarations and sites, checking
69
73
  * both once: every declaration id is unique, every reported id is declared,
70
- * and only a `login-routing` site carries `guardedBy`.
74
+ * only a `login-routing` site carries `guardedBy`, every `encounter` site
75
+ * names at least one session kind in `reachedBy`, and every declaration
76
+ * listing `encounter` among its triggers is reported by an encounter site.
71
77
  *
72
78
  * @param options {object}
73
79
  * @param options.declarations {ReadonlyArray<InvariantDeclaration>}
@@ -75,7 +81,8 @@ export declare function heldAuthorities({ kind }: {
75
81
  * registration site, any trigger, in execution order within a trigger
76
82
  * @returns {MenderRegistry}
77
83
  * @throws {TypeError} on a duplicated declaration id, an undeclared
78
- * report, or a guard on a non-routing site
84
+ * report, a guard on a non-routing site, an encounter site with no reach,
85
+ * or an encounter trigger no encounter site backs
79
86
  */
80
87
  export declare function menderRegistry<Site extends RegistrationSite, Deps, Ceremony extends string = string>({ declarations, sites }: {
81
88
  declarations: ReadonlyArray<InvariantDeclaration<Deps, Ceremony>>;
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/menders/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EACjB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;AAEtE;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAC7B,IAAI,SAAS,gBAAgB,EAC7B,IAAI,EACJ,QAAQ,SAAS,MAAM,GAAG,MAAM;IAEhC,GAAG,IAAI,aAAa,CAAC,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC1D,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAA;IACvE,KAAK,IAAI,aAAa,CAAC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,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;CAC3B,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAsEvC"}
@@ -14,7 +14,9 @@ export function heldAuthorities({ kind }) {
14
14
  /**
15
15
  * Builds the readers over one wallet's declarations and sites, checking
16
16
  * both once: every declaration id is unique, every reported id is declared,
17
- * and only a `login-routing` site carries `guardedBy`.
17
+ * only a `login-routing` site carries `guardedBy`, every `encounter` site
18
+ * names at least one session kind in `reachedBy`, and every declaration
19
+ * listing `encounter` among its triggers is reported by an encounter site.
18
20
  *
19
21
  * @param options {object}
20
22
  * @param options.declarations {ReadonlyArray<InvariantDeclaration>}
@@ -22,7 +24,8 @@ export function heldAuthorities({ kind }) {
22
24
  * registration site, any trigger, in execution order within a trigger
23
25
  * @returns {MenderRegistry}
24
26
  * @throws {TypeError} on a duplicated declaration id, an undeclared
25
- * report, or a guard on a non-routing site
27
+ * report, a guard on a non-routing site, an encounter site with no reach,
28
+ * or an encounter trigger no encounter site backs
26
29
  */
27
30
  export function menderRegistry({ declarations, sites }) {
28
31
  const index = new Map();
@@ -39,12 +42,24 @@ export function menderRegistry({ declarations, sites }) {
39
42
  }
40
43
  return decl;
41
44
  };
45
+ const encountered = new Set();
42
46
  for (const site of sites) {
43
47
  site.reports.forEach(requireDeclared);
44
- const { trigger, guardedBy } = site;
48
+ const { trigger, guardedBy, reachedBy } = site;
45
49
  if (guardedBy !== undefined && trigger !== 'login-routing') {
46
50
  throw new TypeError(`A ${trigger} site carries a guard; only a login-routing site may`);
47
51
  }
52
+ if (trigger === 'encounter') {
53
+ if (!reachedBy || reachedBy.length === 0) {
54
+ throw new TypeError(`An encounter site names no session kind that reaches it: ${site.reports.join(', ')}`);
55
+ }
56
+ site.reports.forEach(id => encountered.add(id));
57
+ }
58
+ }
59
+ for (const decl of declarations) {
60
+ if (decl.triggers.includes('encounter') && !encountered.has(decl.id)) {
61
+ throw new TypeError(`An invariant lists the encounter trigger but no encounter site reports it: ${decl.id}`);
62
+ }
48
63
  }
49
64
  const admits = ({ site, held, route }) => site.reports.every(id => {
50
65
  const decl = requireDeclared(id);
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/menders/registry.ts"],"names":[],"mappings":"AAgEA;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EAGL;IACC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AACpD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAI5B,EACA,YAAY,EACZ,KAAK,EAIN;IACC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAqD,CAAA;IAC1E,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,SAAS,CAAC,mCAAmC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;QACnE,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAC1B,CAAC;IACD,MAAM,eAAe,GAAG,CACtB,EAAe,EACuB,EAAE;QACxC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,SAAS,CACjB,mDAAmD,EAAE,EAAE,CACxD,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;QACrC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,C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CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAClE;KACJ,CAAA;AACH,CAAC"}
@@ -11,15 +11,25 @@ export declare const MEND_REPORT_SHAPE_ERROR = "MendReportShapeError";
11
11
  * The report collector a wallet creates ahead of session assembly. A
12
12
  * routing entry reports into it from its own call site before a `Session`
13
13
  * exists, {@link runMenderBlock} reports the chain's entries into it
14
- * through `onOutcome`, and the wallet hands `settled` to the session as its
15
- * mend report.
14
+ * through its `mends` option, and the wallet hands `settled` to the session
15
+ * as its mend report. When the accumulator was created with a logger, each
16
+ * `report` call also emits that entry's `'ceremony mender'` event.
16
17
  */
17
18
  export interface MendReportAccumulator<Ceremony extends string = string> {
18
19
  /**
19
- * Records one entry. Bound to the accumulator, so it can be passed
20
- * directly as {@link runMenderBlock}'s `onOutcome`.
20
+ * Records one entry. When the accumulator has a logger, it also emits one
21
+ * `'ceremony mender'` event (`menderEvent`) from the same entry, carrying
22
+ * `err` when one is given. The event never throws. Bound to the
23
+ * accumulator, so it can be passed around as a function.
24
+ *
25
+ * @param entry {MendReportEntry} the entry to record
26
+ * @param [options] {object}
27
+ * @param [options.err] {unknown} the error behind the entry, carried on
28
+ * the event only. The recorded entry keeps `errorName` alone
21
29
  */
22
- report(entry: MendReportEntry<Ceremony>): void;
30
+ report(entry: MendReportEntry<Ceremony>, options?: {
31
+ err?: unknown;
32
+ }): void;
23
33
  /**
24
34
  * Every entry recorded so far, in report order.
25
35
  */
@@ -39,15 +49,25 @@ export interface MendReportAccumulator<Ceremony extends string = string> {
39
49
  * Creates a report accumulator. Generic over the wallet's ceremony-id
40
50
  * union, which defaults to `string`.
41
51
  *
52
+ * With a `logger`, every `report` call records the entry and emits its
53
+ * `'ceremony mender'` event through that logger, so the diagnostics stream
54
+ * and the report cannot diverge. Without one, `report` only records.
55
+ *
56
+ * @param [options] {object}
57
+ * @param [options.logger] {Logger} the wallet's own sink for the mender
58
+ * events
42
59
  * @returns {MendReportAccumulator}
43
60
  */
44
- export declare function mendReportAccumulator<Ceremony extends string = string>(): MendReportAccumulator<Ceremony>;
61
+ export declare function mendReportAccumulator<Ceremony extends string = string>({ logger }?: {
62
+ logger?: Logger;
63
+ }): MendReportAccumulator<Ceremony>;
45
64
  /**
46
65
  * Runs one registration block: the registrations listed under `trigger`
47
66
  * whose every reported invariant declares an authority the session holds
48
67
  * and admits this login route, in list order.
49
68
  *
50
- * The discipline, in one place. An optional `seed` registration runs first,
69
+ * Each step runs through {@link runMenderRegistration}, which holds the
70
+ * discipline in one place. An optional `seed` registration runs first,
51
71
  * and its failure aborts the block: nothing behind it runs, which is what a
52
72
  * rejected chain seed does today. Past the seed, a registration that throws
53
73
  * warns once per reported invariant with that declaration's own `warn`
@@ -62,10 +82,13 @@ export declare function mendReportAccumulator<Ceremony extends string = string>(
62
82
  * carrying {@link MEND_REPORT_SHAPE_ERROR} rather than throwing, so a
63
83
  * mismatched adapter cannot tear a login.
64
84
  *
65
- * Beside each `onOutcome` call the block emits one `'ceremony mender'`
66
- * event through `logger` (`menderEvent`), from the same entry, so the
67
- * diagnostics stream and the report cannot diverge. A `noop` entry emits at
68
- * debug.
85
+ * Each entry emits exactly one `'ceremony mender'` event (`menderEvent`),
86
+ * so the diagnostics stream and the report cannot diverge. Given `mends`,
87
+ * the block reports each entry into that accumulator, and the accumulator's
88
+ * own logger emits the event; the block does not emit it again. Without
89
+ * `mends`, the block emits the event through `logger` itself. A `noop`
90
+ * entry emits at debug. `onOutcome` runs after a registration's entries are
91
+ * reported, once per entry.
69
92
  *
70
93
  * `trigger` is one of the two chain values, so a `ceremony-tail` entry is
71
94
  * out of reach here. Such an entry has no registration at all: its body
@@ -95,22 +118,26 @@ export declare function mendReportAccumulator<Ceremony extends string = string>(
95
118
  * `when` predicate reads
96
119
  * @param options.deps {Deps} passed to the seed and to every `converge`
97
120
  * @param options.logger {Logger} the wallet's own sink, so its warn
98
- * copy keeps the wallet's namespace
121
+ * copy keeps the wallet's namespace. The block emits the mender events
122
+ * through it when no `mends` is given
99
123
  * @param [options.registrations] {ReadonlyArray<Registration>} the
100
124
  * registrations to run, in place of the ones the registry lists under
101
125
  * `trigger`. Each is admitted by the same authority and route tests
102
126
  * @param [options.seed] {Registration} the step whose failure aborts the
103
127
  * block. Admitted by the same authority and route tests as any other
104
128
  * registration; one it does not pass is skipped rather than failed
129
+ * @param [options.mends] {MendReportAccumulator} the accumulator the
130
+ * block reports each entry into. It emits the entry's mender event, so
131
+ * the block emits none of its own. An accumulator created without a
132
+ * logger then emits nothing
105
133
  * @param [options.onOutcome] {(entry: MendReportEntry) => void} called
106
- * once per reported entry, in order. The single place a chain entry's
107
- * outcome is reported
134
+ * once per reported entry, in order, after the entry is reported
108
135
  * @returns {Promise<MendReport>} the block's entries in order. It never
109
136
  * rejects; a seed failure resolves with the seed's `failed` entries alone
110
137
  * @throws {TypeError} when the seed or an override registration is listed
111
138
  * under a trigger other than `trigger`, a programming error
112
139
  */
113
- export declare function runMenderBlock<Deps, Ceremony extends string = string, Site extends RegistrationSite = Registration<Deps, Ceremony>>({ registry, trigger, held, route, deps, logger, registrations, seed, onOutcome }: {
140
+ export declare function runMenderBlock<Deps, Ceremony extends string = string, Site extends RegistrationSite = Registration<Deps, Ceremony>>({ registry, trigger, held, route, deps, logger, registrations, seed, mends, onOutcome }: {
114
141
  registry: MenderRegistry<Site, Deps, Ceremony>;
115
142
  trigger: ChainTrigger;
116
143
  held: ReadonlyArray<Authority>;
@@ -119,6 +146,48 @@ export declare function runMenderBlock<Deps, Ceremony extends string = string, S
119
146
  logger: Logger;
120
147
  registrations?: ReadonlyArray<Registration<Deps, Ceremony>>;
121
148
  seed?: Registration<Deps, Ceremony>;
149
+ mends?: MendReportAccumulator<Ceremony>;
122
150
  onOutcome?: (entry: MendReportEntry<Ceremony>) => void;
123
151
  }): Promise<MendReport<Ceremony>>;
152
+ /**
153
+ * Runs one registration under the runner's discipline and reports its
154
+ * entries. `runMenderBlock` calls it for each step, and a wallet calls it
155
+ * for a registration its own call site fires, such as an encounter site. It
156
+ * admits nothing: the caller has already checked the authority and any
157
+ * route.
158
+ *
159
+ * A registration that throws warns once per reported invariant with that
160
+ * declaration's own `warn` string, carrying the error, and yields one
161
+ * `failed` entry per reported id with the error's name alone
162
+ * (`errorNameOf`). A registration that resolves with entries that do not
163
+ * name its reported invariants, in order, warns once and yields `failed`
164
+ * entries carrying {@link MEND_REPORT_SHAPE_ERROR}. The run never rejects.
165
+ *
166
+ * Each entry emits exactly one `'ceremony mender'` event. Given `mends`,
167
+ * each entry is reported into that accumulator, whose own logger emits the
168
+ * event. Without `mends`, the event goes through `logger`. The event carries
169
+ * no `err`; the declared warn keeps the error.
170
+ *
171
+ * @param options {object}
172
+ * @param options.registry {MenderRegistry} the wallet's declarations,
173
+ * read for each reported invariant's `warn` and ceremonies
174
+ * @param options.registration {Registration} the registration to run
175
+ * @param options.deps {Deps} passed to `converge` unread
176
+ * @param options.logger {Logger} the wallet's own sink for the warn copy,
177
+ * and for the mender events when no `mends` is given
178
+ * @param [options.mends] {MendReportAccumulator} the accumulator each
179
+ * entry is reported into
180
+ * @returns {Promise<{ entries: MendReport, threw: boolean }>} the entries,
181
+ * one per reported id in order, and whether `converge` threw
182
+ */
183
+ export declare function runMenderRegistration<Deps, Ceremony extends string = string, Site extends RegistrationSite = Registration<Deps, Ceremony>>({ registry, registration, deps, logger, mends }: {
184
+ registry: MenderRegistry<Site, Deps, Ceremony>;
185
+ registration: Registration<Deps, Ceremony>;
186
+ deps: Deps;
187
+ logger: Logger;
188
+ mends?: MendReportAccumulator<Ceremony>;
189
+ }): Promise<{
190
+ entries: MendReport<Ceremony>;
191
+ threw: boolean;
192
+ }>;
124
193
  //# sourceMappingURL=runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/menders/runner.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,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ACvD,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAoChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EACJ,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,IAAI,SAAS,gBAAgB,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,EAC5D,EACA,QAAQ,EACR,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,KAAK,EACN,EAAE;IACD,QAAQ,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC9C,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC1C,IAAI,EAAE,IAAI,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAA;CACxC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAiB7D"}
@@ -3,14 +3,18 @@
3
3
  */
4
4
  /**
5
5
  * The mender runner: one try, warn, and skip discipline over the
6
- * registrations listed under one chain trigger. `runMenderBlock` runs them
7
- * in list order, since registration order is execution order and there is
8
- * no dependency graph. A seed step's failure aborts the block; a
9
- * registration's failure warns through the wallet's own `Logger` and the
10
- * block continues. Beside it sits `mendReportAccumulator`, the report
6
+ * registrations listed under one chain trigger. `runMenderRegistration` is
7
+ * that discipline for one registration, exported so a wallet's encounter
8
+ * sites run under the same copy. `runMenderBlock` runs a chain's
9
+ * registrations through it in list order, since registration order is
10
+ * execution order and there is no dependency graph. A seed step's failure
11
+ * aborts the block; a registration's failure warns through the wallet's own
12
+ * `Logger` and the block continues. Beside them sits `mendReportAccumulator`, the report
11
13
  * collector a wallet creates before a `Session` exists, so the entries a
12
14
  * routing site reports and the entries this runner reports assemble into
13
- * one `MendReport`.
15
+ * one `MendReport`. An accumulator given a logger emits each entry's
16
+ * `'ceremony mender'` event from the same `report` call that records it, so
17
+ * a caller cannot report an entry without emitting it.
14
18
  */
15
19
  import { menderEvent } from '../ceremonyEvents.js';
16
20
  import { errorNameOf } from '../errorName.js';
@@ -23,9 +27,16 @@ export const MEND_REPORT_SHAPE_ERROR = 'MendReportShapeError';
23
27
  * Creates a report accumulator. Generic over the wallet's ceremony-id
24
28
  * union, which defaults to `string`.
25
29
  *
30
+ * With a `logger`, every `report` call records the entry and emits its
31
+ * `'ceremony mender'` event through that logger, so the diagnostics stream
32
+ * and the report cannot diverge. Without one, `report` only records.
33
+ *
34
+ * @param [options] {object}
35
+ * @param [options.logger] {Logger} the wallet's own sink for the mender
36
+ * events
26
37
  * @returns {MendReportAccumulator}
27
38
  */
28
- export function mendReportAccumulator() {
39
+ export function mendReportAccumulator({ logger } = {}) {
29
40
  const recorded = [];
30
41
  let resolveSettled = () => undefined;
31
42
  const settled = new Promise(resolve => {
@@ -33,8 +44,12 @@ export function mendReportAccumulator() {
33
44
  });
34
45
  let assembled;
35
46
  return {
36
- report(entry) {
47
+ report(entry, { err } = {}) {
37
48
  recorded.push(entry);
49
+ if (logger) {
50
+ // menderEvent never throws and drops an undefined `err`.
51
+ menderEvent({ log: logger, entry, err });
52
+ }
38
53
  },
39
54
  entries: () => [...recorded],
40
55
  settle() {
@@ -52,7 +67,8 @@ export function mendReportAccumulator() {
52
67
  * whose every reported invariant declares an authority the session holds
53
68
  * and admits this login route, in list order.
54
69
  *
55
- * The discipline, in one place. An optional `seed` registration runs first,
70
+ * Each step runs through {@link runMenderRegistration}, which holds the
71
+ * discipline in one place. An optional `seed` registration runs first,
56
72
  * and its failure aborts the block: nothing behind it runs, which is what a
57
73
  * rejected chain seed does today. Past the seed, a registration that throws
58
74
  * warns once per reported invariant with that declaration's own `warn`
@@ -67,10 +83,13 @@ export function mendReportAccumulator() {
67
83
  * carrying {@link MEND_REPORT_SHAPE_ERROR} rather than throwing, so a
68
84
  * mismatched adapter cannot tear a login.
69
85
  *
70
- * Beside each `onOutcome` call the block emits one `'ceremony mender'`
71
- * event through `logger` (`menderEvent`), from the same entry, so the
72
- * diagnostics stream and the report cannot diverge. A `noop` entry emits at
73
- * debug.
86
+ * Each entry emits exactly one `'ceremony mender'` event (`menderEvent`),
87
+ * so the diagnostics stream and the report cannot diverge. Given `mends`,
88
+ * the block reports each entry into that accumulator, and the accumulator's
89
+ * own logger emits the event; the block does not emit it again. Without
90
+ * `mends`, the block emits the event through `logger` itself. A `noop`
91
+ * entry emits at debug. `onOutcome` runs after a registration's entries are
92
+ * reported, once per entry.
74
93
  *
75
94
  * `trigger` is one of the two chain values, so a `ceremony-tail` entry is
76
95
  * out of reach here. Such an entry has no registration at all: its body
@@ -100,33 +119,27 @@ export function mendReportAccumulator() {
100
119
  * `when` predicate reads
101
120
  * @param options.deps {Deps} passed to the seed and to every `converge`
102
121
  * @param options.logger {Logger} the wallet's own sink, so its warn
103
- * copy keeps the wallet's namespace
122
+ * copy keeps the wallet's namespace. The block emits the mender events
123
+ * through it when no `mends` is given
104
124
  * @param [options.registrations] {ReadonlyArray<Registration>} the
105
125
  * registrations to run, in place of the ones the registry lists under
106
126
  * `trigger`. Each is admitted by the same authority and route tests
107
127
  * @param [options.seed] {Registration} the step whose failure aborts the
108
128
  * block. Admitted by the same authority and route tests as any other
109
129
  * registration; one it does not pass is skipped rather than failed
130
+ * @param [options.mends] {MendReportAccumulator} the accumulator the
131
+ * block reports each entry into. It emits the entry's mender event, so
132
+ * the block emits none of its own. An accumulator created without a
133
+ * logger then emits nothing
110
134
  * @param [options.onOutcome] {(entry: MendReportEntry) => void} called
111
- * once per reported entry, in order. The single place a chain entry's
112
- * outcome is reported
135
+ * once per reported entry, in order, after the entry is reported
113
136
  * @returns {Promise<MendReport>} the block's entries in order. It never
114
137
  * rejects; a seed failure resolves with the seed's `failed` entries alone
115
138
  * @throws {TypeError} when the seed or an override registration is listed
116
139
  * under a trigger other than `trigger`, a programming error
117
140
  */
118
- export async function runMenderBlock({ registry, trigger, held, route, deps, logger, registrations, seed, onOutcome }) {
141
+ export async function runMenderBlock({ registry, trigger, held, route, deps, logger, registrations, seed, mends, onOutcome }) {
119
142
  const report = [];
120
- const collect = (entries) => {
121
- for (const entry of entries) {
122
- report.push(entry);
123
- onOutcome?.(entry);
124
- // The diagnostics twin of the report entry. The entry carries
125
- // `errorName` alone, so the event carries no `err`; the registration's
126
- // declared warn keeps the error.
127
- menderEvent({ log: logger, entry });
128
- }
129
- };
130
143
  for (const supplied of [...(seed ? [seed] : []), ...(registrations ?? [])]) {
131
144
  if (supplied.trigger !== trigger) {
132
145
  throw new TypeError(`A ${supplied.trigger} registration was handed to the ${trigger} block`);
@@ -138,14 +151,19 @@ export async function runMenderBlock({ registry, trigger, held, route, deps, log
138
151
  // ends the block.
139
152
  const steps = seed && admitted(seed) ? [seed, ...listed] : listed;
140
153
  for (const registration of steps) {
141
- const outcome = await runRegistration({
154
+ // Reports each entry into `mends`, or emits its mender event, before
155
+ // `onOutcome` sees it.
156
+ const outcome = await runMenderRegistration({
142
157
  registry,
143
158
  registration,
144
159
  deps,
145
160
  logger,
146
- trigger
161
+ mends
147
162
  });
148
- collect(outcome.entries);
163
+ for (const entry of outcome.entries) {
164
+ report.push(entry);
165
+ onOutcome?.(entry);
166
+ }
149
167
  if (outcome.threw && registration === seed) {
150
168
  return report;
151
169
  }
@@ -153,10 +171,61 @@ export async function runMenderBlock({ registry, trigger, held, route, deps, log
153
171
  return report;
154
172
  }
155
173
  /**
156
- * Runs one registration under the block's discipline, returning its entries
157
- * and whether it threw.
174
+ * Runs one registration under the runner's discipline and reports its
175
+ * entries. `runMenderBlock` calls it for each step, and a wallet calls it
176
+ * for a registration its own call site fires, such as an encounter site. It
177
+ * admits nothing: the caller has already checked the authority and any
178
+ * route.
179
+ *
180
+ * A registration that throws warns once per reported invariant with that
181
+ * declaration's own `warn` string, carrying the error, and yields one
182
+ * `failed` entry per reported id with the error's name alone
183
+ * (`errorNameOf`). A registration that resolves with entries that do not
184
+ * name its reported invariants, in order, warns once and yields `failed`
185
+ * entries carrying {@link MEND_REPORT_SHAPE_ERROR}. The run never rejects.
186
+ *
187
+ * Each entry emits exactly one `'ceremony mender'` event. Given `mends`,
188
+ * each entry is reported into that accumulator, whose own logger emits the
189
+ * event. Without `mends`, the event goes through `logger`. The event carries
190
+ * no `err`; the declared warn keeps the error.
191
+ *
192
+ * @param options {object}
193
+ * @param options.registry {MenderRegistry} the wallet's declarations,
194
+ * read for each reported invariant's `warn` and ceremonies
195
+ * @param options.registration {Registration} the registration to run
196
+ * @param options.deps {Deps} passed to `converge` unread
197
+ * @param options.logger {Logger} the wallet's own sink for the warn copy,
198
+ * and for the mender events when no `mends` is given
199
+ * @param [options.mends] {MendReportAccumulator} the accumulator each
200
+ * entry is reported into
201
+ * @returns {Promise<{ entries: MendReport, threw: boolean }>} the entries,
202
+ * one per reported id in order, and whether `converge` threw
203
+ */
204
+ export async function runMenderRegistration({ registry, registration, deps, logger, mends }) {
205
+ const outcome = await convergeUnderDiscipline({
206
+ registry,
207
+ registration,
208
+ deps,
209
+ logger
210
+ });
211
+ for (const entry of outcome.entries) {
212
+ // The diagnostics twin of the report entry, emitted once: by the
213
+ // accumulator when one is given, through `logger` otherwise.
214
+ if (mends) {
215
+ mends.report(entry);
216
+ }
217
+ else {
218
+ menderEvent({ log: logger, entry });
219
+ }
220
+ }
221
+ return outcome;
222
+ }
223
+ /**
224
+ * Calls one registration's `converge`, normalizing a throw or a malformed
225
+ * return to `failed` entries.
158
226
  */
159
- async function runRegistration({ registry, registration, deps, logger, trigger }) {
227
+ async function convergeUnderDiscipline({ registry, registration, deps, logger }) {
228
+ const { trigger } = registration;
160
229
  try {
161
230
  const entries = await registration.converge(deps);
162
231
  if (!matchesReports({ registration, entries })) {
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/menders/runner.ts"],"names":[],"mappings":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G,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,CAAA;QAChD,OAAO;YACL,SAAS,EAAE,EAAE;YACb,OAAO,EAAE,QAAiB;YAC1B,SAAS;YACT,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/D,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -67,7 +67,8 @@ export interface InvariantDeclaration<Deps, Ceremony extends string = string> {
67
67
  warn: string;
68
68
  /**
69
69
  * The popup axis: whether the entry runs on this login route. Absent
70
- * means every route.
70
+ * means every route. It filters chain registrations alone; an encounter
71
+ * site is not given a route, so it never evaluates this.
71
72
  */
72
73
  when?(route: LoginRoute): boolean;
73
74
  /**
@@ -83,20 +84,33 @@ export interface InvariantDeclaration<Deps, Ceremony extends string = string> {
83
84
  * client-key-record probe says so, since only a browser holding such a
84
85
  * record reaches it; the guard is a routing-site member alone, so a chain
85
86
  * or ceremony-tail site cannot carry one and the chain readers never have
86
- * to honor it.
87
+ * to honor it. An encounter site says which session kinds reach the read or
88
+ * write it rides, in `reachedBy`, since an encounter on a page a transient
89
+ * session never renders mends nothing on a credential-anchored account. One
90
+ * site carries one reach: a call converging two invariants with different
91
+ * reach is declared as two sites.
87
92
  */
88
93
  export type RegistrationSite = {
89
- trigger: Exclude<Trigger, 'login-routing'>;
94
+ trigger: Exclude<Trigger, 'login-routing' | 'encounter'>;
90
95
  reports: ReadonlyArray<InvariantId>;
91
96
  guardedBy?: undefined;
97
+ reachedBy?: undefined;
92
98
  } | {
93
99
  trigger: 'login-routing';
94
100
  reports: ReadonlyArray<InvariantId>;
95
101
  guardedBy?: 'client-key-record';
102
+ reachedBy?: undefined;
103
+ } | {
104
+ trigger: 'encounter';
105
+ reports: ReadonlyArray<InvariantId>;
106
+ guardedBy?: undefined;
107
+ reachedBy: ReadonlyArray<'remembered' | 'transient'>;
96
108
  };
97
109
  /**
98
110
  * A registration: the code that converges the invariants it reports.
99
111
  * `converge` returns exactly one entry per id in `reports`, in that order.
112
+ * An encounter site may be one, run from its own call site through
113
+ * `runMenderRegistration`, or report-only like a routing site.
100
114
  */
101
115
  export type Registration<Deps, Ceremony extends string = string> = RegistrationSite & {
102
116
  converge(deps: Deps): Promise<ReadonlyArray<MendReportEntry<Ceremony>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/menders/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,eAAe,EACf,OAAO,EACR,MAAM,iBAAiB,CAAA;AAExB;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,OAAO,CAAA;CACf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB,CAAC,IAAI,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC1E;;OAEG;IACH,EAAE,EAAE,WAAW,CAAA;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACrC;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAChC;;;OAGG;IACH,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IACnC;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAA;IACjC;;;;OAIG;IACH,SAAS,CAAC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AAa,CAAC,QAAQ,CAAC,CAAA;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,aAAa,CACtE,eAAe,CAAC,QAAQ,CAAC,CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAA;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CACd"}
@@ -31,7 +31,9 @@ export type Authority = (typeof AUTHORITIES)[number];
31
31
  * inside a ceremony's own sequenced code and only report through the
32
32
  * registry; `encounter` entries run where an ordinary read or write meets
33
33
  * the state they converge (a sweep-on-read, or a refusal a page handles),
34
- * inside a live session, and are not on a login chain.
34
+ * inside a live session, and are not on a login chain. An encounter site
35
+ * names the session kinds that reach it, and does not evaluate a
36
+ * declaration's `when`.
35
37
  */
36
38
  export declare const TRIGGERS: readonly ["remembered-login-chain", "transient-login-chain", "login-routing", "ceremony-tail", "encounter"];
37
39
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vocabulary.d.ts","sourceRoot":"","sources":["../../src/menders/vocabulary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,oDAAqD,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AAEpD;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,6GAMX,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,cAAc,8DAGjB,CAAA;AAEV;;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E1D;;;;;GAKG;AACH,eAAO,MAAM,cAAc,0CAA2C,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,8KAUX,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,aAAa,4DAMhB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,kCAAmC,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA"}
@@ -27,7 +27,9 @@ export const AUTHORITIES = ['none', 'account', 'enrolled', 'ladder'];
27
27
  * inside a ceremony's own sequenced code and only report through the
28
28
  * registry; `encounter` entries run where an ordinary read or write meets
29
29
  * the state they converge (a sweep-on-read, or a refusal a page handles),
30
- * inside a live session, and are not on a login chain.
30
+ * inside a live session, and are not on a login chain. An encounter site
31
+ * names the session kinds that reach it, and does not evaluate a
32
+ * declaration's `when`.
31
33
  */
32
34
  export const TRIGGERS = [
33
35
  'remembered-login-chain',
@@ -1 +1 @@
1
- {"version":3,"file":"vocabulary.js","sourceRoot":"","sources":["../../src/menders/vocabulary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAA;AAO7E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,wBAAwB;IACxB,uBAAuB;IACvB,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B,iBAAiB;IACjB,sBAAsB;IACtB,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,cAAc;IACd,aAAa;CACL,CAAA;AAOV;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;CACA,CAAA;AAOV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@interop/wallet-core",
3
3
  "description": "Shared wallet-domain logic (WAS sync engine core and wallet Space layout contracts) for Interop wallet apps.",
4
- "version": "0.87.0",
4
+ "version": "0.89.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "pnpm run clear && tsc",