@fougere/core 0.4.0-alpha.0 → 0.5.0-alpha.1

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.
Files changed (124) hide show
  1. package/dist/boot/Emissions.js +1 -1
  2. package/dist/boot/Emissions.js.map +1 -1
  3. package/dist/boot/binding.d.ts +1 -1
  4. package/dist/boot/binding.d.ts.map +1 -1
  5. package/dist/boot/bootstrap.d.ts.map +1 -1
  6. package/dist/boot/bootstrap.js +12 -4
  7. package/dist/boot/bootstrap.js.map +1 -1
  8. package/dist/boot/hosted.d.ts +29 -0
  9. package/dist/boot/hosted.d.ts.map +1 -0
  10. package/dist/boot/hosted.js +38 -0
  11. package/dist/boot/hosted.js.map +1 -0
  12. package/dist/boot/ownership.d.ts +0 -3
  13. package/dist/boot/ownership.d.ts.map +1 -1
  14. package/dist/boot/ownership.js.map +1 -1
  15. package/dist/boot/remote.d.ts +1 -1
  16. package/dist/boot/remote.d.ts.map +1 -1
  17. package/dist/boot/remote.js +1 -1
  18. package/dist/boot/remote.js.map +1 -1
  19. package/dist/boot/statement-drift.d.ts +24 -0
  20. package/dist/boot/statement-drift.d.ts.map +1 -0
  21. package/dist/boot/statement-drift.js +38 -0
  22. package/dist/boot/statement-drift.js.map +1 -0
  23. package/dist/boot/types.d.ts +15 -2
  24. package/dist/boot/types.d.ts.map +1 -1
  25. package/dist/contract/CallLog.d.ts +57 -0
  26. package/dist/contract/CallLog.d.ts.map +1 -0
  27. package/dist/contract/CallLog.js +2 -0
  28. package/dist/contract/CallLog.js.map +1 -0
  29. package/dist/contract.d.ts +8 -3
  30. package/dist/contract.d.ts.map +1 -1
  31. package/dist/contract.js +9 -2
  32. package/dist/contract.js.map +1 -1
  33. package/dist/dispatch/DispatchLifecycle.d.ts +9 -1
  34. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
  35. package/dist/dispatch/DispatchLifecycle.js +17 -2
  36. package/dist/dispatch/DispatchLifecycle.js.map +1 -1
  37. package/dist/dispatch/InFlight.d.ts +0 -1
  38. package/dist/dispatch/InFlight.d.ts.map +1 -1
  39. package/dist/dispatch/InFlight.js +0 -3
  40. package/dist/dispatch/InFlight.js.map +1 -1
  41. package/dist/effective-operation.d.ts.map +1 -1
  42. package/dist/effective-operation.js +4 -0
  43. package/dist/effective-operation.js.map +1 -1
  44. package/dist/index.d.ts +8 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +12 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/node.d.ts +4 -2
  49. package/dist/node.d.ts.map +1 -1
  50. package/dist/node.js +4 -2
  51. package/dist/node.js.map +1 -1
  52. package/dist/scan/bundling.d.ts +14 -0
  53. package/dist/scan/bundling.d.ts.map +1 -0
  54. package/dist/scan/bundling.js +26 -0
  55. package/dist/scan/bundling.js.map +1 -0
  56. package/dist/scan/conventions.d.ts +8 -12
  57. package/dist/scan/conventions.d.ts.map +1 -1
  58. package/dist/scan/conventions.js +0 -13
  59. package/dist/scan/conventions.js.map +1 -1
  60. package/dist/scan/declare.d.ts +71 -0
  61. package/dist/scan/declare.d.ts.map +1 -0
  62. package/dist/scan/declare.js +125 -0
  63. package/dist/scan/declare.js.map +1 -0
  64. package/dist/scan/handler-parser.js +0 -1
  65. package/dist/scan/handler-parser.js.map +1 -1
  66. package/dist/scan/scanner.d.ts +17 -0
  67. package/dist/scan/scanner.d.ts.map +1 -1
  68. package/dist/scan/scanner.js +17 -1
  69. package/dist/scan/scanner.js.map +1 -1
  70. package/dist/scan/statement.d.ts +4 -0
  71. package/dist/scan/statement.d.ts.map +1 -0
  72. package/dist/scan/statement.js +112 -0
  73. package/dist/scan/statement.js.map +1 -0
  74. package/dist/wire/call.d.ts +12 -1
  75. package/dist/wire/call.d.ts.map +1 -1
  76. package/dist/wire/call.js +11 -0
  77. package/dist/wire/call.js.map +1 -1
  78. package/dist/wire/drift.d.ts +55 -0
  79. package/dist/wire/drift.d.ts.map +1 -0
  80. package/dist/wire/drift.js +121 -0
  81. package/dist/wire/drift.js.map +1 -0
  82. package/dist/wire/middleware.d.ts +1 -1
  83. package/dist/wire/middleware.d.ts.map +1 -1
  84. package/package.json +3 -3
  85. package/src/boot/Emissions.ts +1 -1
  86. package/src/boot/HandlerFacade.ts +1 -1
  87. package/src/boot/binding.ts +1 -1
  88. package/src/boot/bootstrap.ts +12 -4
  89. package/src/boot/hosted.ts +77 -0
  90. package/src/boot/ownership.ts +1 -4
  91. package/src/boot/remote.ts +1 -1
  92. package/src/boot/statement-drift.ts +60 -0
  93. package/src/boot/types.ts +15 -2
  94. package/src/contract/CallLog.ts +55 -0
  95. package/src/contract.ts +12 -3
  96. package/src/dispatch/DispatchLifecycle.ts +22 -2
  97. package/src/dispatch/InFlight.ts +0 -4
  98. package/src/effective-operation.ts +4 -0
  99. package/src/index.ts +16 -2
  100. package/src/node.ts +4 -2
  101. package/src/scan/bundling.ts +25 -0
  102. package/src/scan/conventions.ts +0 -18
  103. package/src/scan/declare.ts +188 -0
  104. package/src/scan/handler-parser.ts +0 -1
  105. package/src/scan/scanner.ts +22 -1
  106. package/src/scan/statement.ts +126 -0
  107. package/src/wire/call.ts +13 -1
  108. package/src/wire/drift.ts +131 -0
  109. package/src/wire/middleware.ts +1 -1
  110. package/dist/boot/Lifecycle.d.ts +0 -4
  111. package/dist/boot/Lifecycle.d.ts.map +0 -1
  112. package/dist/boot/Lifecycle.js +0 -3
  113. package/dist/boot/Lifecycle.js.map +0 -1
  114. package/dist/scan/scan-cache.d.ts +0 -16
  115. package/dist/scan/scan-cache.d.ts.map +0 -1
  116. package/dist/scan/scan-cache.js +0 -99
  117. package/dist/scan/scan-cache.js.map +0 -1
  118. package/dist/wire/invocation.d.ts +0 -4
  119. package/dist/wire/invocation.d.ts.map +0 -1
  120. package/dist/wire/invocation.js +0 -3
  121. package/dist/wire/invocation.js.map +0 -1
  122. package/src/boot/Lifecycle.ts +0 -3
  123. package/src/scan/scan-cache.ts +0 -115
  124. package/src/wire/invocation.ts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} from './invocation.js';
10
+ import type { InvocationContext } from '../contract/Invocation.js';
11
11
  import type { App } from '../boot/types.js';
12
12
  /** Target of a call — which façade operation, wherever it lives. */
13
13
  export interface FrondCall {
@@ -21,6 +21,17 @@ export interface FrondCall {
21
21
  /** A transport executes a call somewhere else. Failures surface as thrown FougereError. */
22
22
  export type Transport = (call: FrondCall, invocation: InvocationContext) => Promise<unknown>;
23
23
  /** Reserved namespace — calls the runner answers itself, never a façade. */
24
+ /**
25
+ * What a receiver accepts before it stops reading a body.
26
+ *
27
+ * Stated once because it was stated FOUR times — `transport/http/policy.ts` said so in its
28
+ * own comment ("spelled in four packages") while three doors kept their own literal, so
29
+ * raising the cap here used to leave three of them refusing at the old one.
30
+ *
31
+ * `@fougere/http` keeps a fourth copy on purpose: it declares no Fougere dependency at all,
32
+ * and giving a leaf port a dependency on the kernel to share a number is the wrong trade.
33
+ */
34
+ export declare const MAX_BODY_BYTES: number;
24
35
  export declare const RPC_ENTITY = "rpc";
25
36
  /**
26
37
  * What an `rpc` op answers — the door for what the app says about ITSELF, never about a row.
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/wire/call.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAG5C,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,2FAA2F;AAC3F,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,KAAK,OAA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vE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAErE"}
package/dist/wire/call.js CHANGED
@@ -11,6 +11,17 @@ import { factsAnnouncedBy } from '../emit.js';
11
11
  import { FougereError, ErrorCode } from './errors.js';
12
12
  import { createTransportEntry } from '../entry/TransportEntry.js';
13
13
  /** Reserved namespace — calls the runner answers itself, never a façade. */
14
+ /**
15
+ * What a receiver accepts before it stops reading a body.
16
+ *
17
+ * Stated once because it was stated FOUR times — `transport/http/policy.ts` said so in its
18
+ * own comment ("spelled in four packages") while three doors kept their own literal, so
19
+ * raising the cap here used to leave three of them refusing at the old one.
20
+ *
21
+ * `@fougere/http` keeps a fourth copy on purpose: it declares no Fougere dependency at all,
22
+ * and giving a leaf port a dependency on the kernel to share a number is the wrong trade.
23
+ */
24
+ export const MAX_BODY_BYTES = 1024 * 1024;
14
25
  export const RPC_ENTITY = 'rpc';
15
26
  /**
16
27
  * The shape a card must have to be walked — `fronds`, and each frond's `doors`.
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/wire/call.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAyB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAelE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAqIhC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc,EAAE,MAAc;IAC/D,MAAM,IAAI,GAAG,KAAiC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,M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,0 +1,55 @@
1
+ import { type Change } from '@fougere/schema';
2
+ import type { IdentityCard } from './call.js';
3
+ /**
4
+ * What separates the copy a consumer holds from what the producer actually serves.
5
+ *
6
+ * It lives beside `IdentityCard` and not in `@fougere/testing` for the reason the card
7
+ * itself does: the subject is the card, and a second reader arrived — the dev panel, which
8
+ * must not drag a 426 KB faker in to compare two of them.
9
+ */
10
+ export interface CardDrift {
11
+ frond: string;
12
+ /** A door the consumer calls that the producer no longer serves. */
13
+ missingDoors: string[];
14
+ /** An operation the consumer calls that the door no longer has. */
15
+ missingOps: {
16
+ door: string;
17
+ ops: string[];
18
+ }[];
19
+ /** A shape that moved under a door the consumer still calls. */
20
+ shapes: {
21
+ door: string;
22
+ changes: Change[];
23
+ }[];
24
+ /** A fact the consumer subscribes to whose shape moved, or that is gone. */
25
+ facts: {
26
+ fact: string;
27
+ changes: Change[] | 'gone';
28
+ }[];
29
+ }
30
+ /**
31
+ * What a consumer's synced copy no longer matches in what the producer serves.
32
+ *
33
+ * The gap TypeScript cannot see, and the only place the gradient genuinely lies: the code
34
+ * is identical in-process and split, but one side may have aged. `fougere sync` wrote the
35
+ * consumer's copy three weeks ago, the producer moved on, and it still compiles —
36
+ * production is where that is found today. This is what Pact sells; the material was
37
+ * already here, in `rpc.discover` and in `Card.diff`.
38
+ *
39
+ * Read in ONE direction on purpose: what the consumer holds, checked against what is
40
+ * served. A producer serving MORE than the consumer knows is not drift — it is a producer
41
+ * that moved forward without breaking anyone, which is the whole point of the order the
42
+ * repo already states (re-sync the readers, then deploy the sender).
43
+ */
44
+ export declare function driftOf(mine: IdentityCard, theirs: IdentityCard, frond: string): CardDrift;
45
+ /** Whether anything at all separates the two cards. */
46
+ export declare function agrees(drift: CardDrift): boolean;
47
+ /**
48
+ * The drift, in the words a deploy needs.
49
+ *
50
+ * A fact says the order out loud, because the repo already states it as a rule and
51
+ * nothing enforced it: a fact is judged strictly, so a reader that has not been re-synced
52
+ * refuses what the sender now announces.
53
+ */
54
+ export declare function explain(drift: CardDrift): string[];
55
+ //# sourceMappingURL=drift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift.d.ts","sourceRoot":"","sources":["../../src/wire/drift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAyB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mEAAmE;IACnE,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9C,gEAAgE;IAChE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9C,4EAA4E;IAC5E,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;KAAE,EAAE,CAAC;CACvD;AAuBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAgC1F;AAED,uDAAuD;AACvD,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAKhD;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,CAYlD"}
@@ -0,0 +1,121 @@
1
+ import { Card } from '@fougere/schema';
2
+ /** Every door of a card, by name. */
3
+ function doorsOf(card, frond) {
4
+ const found = new Map();
5
+ for (const one of card.fronds) {
6
+ if (one.name !== frond)
7
+ continue;
8
+ for (const door of one.doors) {
9
+ found.set(door.name, { ops: new Set(door.ops.map((op) => op.name)), schema: door.schema });
10
+ }
11
+ }
12
+ return found;
13
+ }
14
+ function factsOf(card, frond) {
15
+ const found = new Map();
16
+ for (const one of card.fronds) {
17
+ if (one.name !== frond)
18
+ continue;
19
+ for (const fact of one.facts ?? [])
20
+ found.set(fact.name, fact.schema);
21
+ }
22
+ return found;
23
+ }
24
+ /**
25
+ * What a consumer's synced copy no longer matches in what the producer serves.
26
+ *
27
+ * The gap TypeScript cannot see, and the only place the gradient genuinely lies: the code
28
+ * is identical in-process and split, but one side may have aged. `fougere sync` wrote the
29
+ * consumer's copy three weeks ago, the producer moved on, and it still compiles —
30
+ * production is where that is found today. This is what Pact sells; the material was
31
+ * already here, in `rpc.discover` and in `Card.diff`.
32
+ *
33
+ * Read in ONE direction on purpose: what the consumer holds, checked against what is
34
+ * served. A producer serving MORE than the consumer knows is not drift — it is a producer
35
+ * that moved forward without breaking anyone, which is the whole point of the order the
36
+ * repo already states (re-sync the readers, then deploy the sender).
37
+ */
38
+ export function driftOf(mine, theirs, frond) {
39
+ const held = doorsOf(mine, frond);
40
+ const served = doorsOf(theirs, frond);
41
+ const drift = { frond, missingDoors: [], missingOps: [], shapes: [], facts: [] };
42
+ for (const [name, door] of held) {
43
+ const there = served.get(name);
44
+ if (!there) {
45
+ drift.missingDoors.push(name);
46
+ continue;
47
+ }
48
+ const missing = [...door.ops].filter((op) => !there.ops.has(op));
49
+ if (missing.length > 0)
50
+ drift.missingOps.push({ door: name, ops: missing.sort() });
51
+ if (door.schema && there.schema) {
52
+ // `Card.diff` never guesses a rename — a field gone plus a field appeared lands in
53
+ // `ambiguous`, and only a declaration settles it. Here nobody can declare one, so
54
+ // the pair is reported as it is and a human reads it.
55
+ const moved = Card.fromDescriptor(door.schema).diff(Card.fromDescriptor(there.schema));
56
+ if (moved.changes.length > 0)
57
+ drift.shapes.push({ door: name, changes: moved.changes });
58
+ }
59
+ }
60
+ const heldFacts = factsOf(mine, frond);
61
+ const servedFacts = factsOf(theirs, frond);
62
+ for (const [name, shape] of heldFacts) {
63
+ if (!servedFacts.has(name)) {
64
+ drift.facts.push({ fact: name, changes: 'gone' });
65
+ continue;
66
+ }
67
+ const there = servedFacts.get(name);
68
+ if (!shape || !there)
69
+ continue;
70
+ const moved = Card.fromDescriptor(shape).diff(Card.fromDescriptor(there));
71
+ if (moved.changes.length > 0)
72
+ drift.facts.push({ fact: name, changes: moved.changes });
73
+ }
74
+ return drift;
75
+ }
76
+ /** Whether anything at all separates the two cards. */
77
+ export function agrees(drift) {
78
+ return drift.missingDoors.length === 0
79
+ && drift.missingOps.length === 0
80
+ && drift.shapes.length === 0
81
+ && drift.facts.length === 0;
82
+ }
83
+ /**
84
+ * The drift, in the words a deploy needs.
85
+ *
86
+ * A fact says the order out loud, because the repo already states it as a rule and
87
+ * nothing enforced it: a fact is judged strictly, so a reader that has not been re-synced
88
+ * refuses what the sender now announces.
89
+ */
90
+ export function explain(drift) {
91
+ const lines = [];
92
+ for (const door of drift.missingDoors)
93
+ lines.push(`${drift.frond}.${door} — you call it, it is not served`);
94
+ for (const { door, ops } of drift.missingOps)
95
+ lines.push(`${drift.frond}.${door} — gone: ${ops.join(', ')}`);
96
+ for (const { door, changes } of drift.shapes) {
97
+ for (const change of changes)
98
+ lines.push(`${drift.frond}.${door} — ${describe(change)}`);
99
+ }
100
+ for (const { fact, changes } of drift.facts) {
101
+ if (changes === 'gone') {
102
+ lines.push(`${fact} — you subscribe to it, it is no longer announced`);
103
+ continue;
104
+ }
105
+ for (const change of changes)
106
+ lines.push(`${fact} — ${describe(change)} → re-sync and deploy the readers, THEN the sender`);
107
+ }
108
+ return lines;
109
+ }
110
+ function describe(change) {
111
+ switch (change.kind) {
112
+ case 'added': return `+ ${change.field}${change.required ? ' (required)' : ''}`;
113
+ case 'removed': return `- ${change.field}`;
114
+ case 'renamed': return `${change.from} → ${change.to}`;
115
+ case 'retyped': return `${change.field}: ${[...change.from].join('|')} → ${[...change.to].join('|')}`;
116
+ case 'reshaped': return `${change.field}: its bounds moved`;
117
+ case 'required': return `${change.field}: ${change.from ? 'no longer' : 'now'} required`;
118
+ case 'restated': return `${change.field}: its ${change.axis} moved`;
119
+ }
120
+ }
121
+ //# sourceMappingURL=drift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drift.js","sourceRoot":"","sources":["../../src/wire/drift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsC,MAAM,iBAAiB,CAAC;AAsB3E,qCAAqC;AACrC,SAAS,OAAO,CAAC,IAAkB,EAAE,KAAa;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAA2D,CAAC;IACjF,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK;YAAE,SAAS;QACjC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YAC7B,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,IAAkB,EAAE,KAAa;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAwC,CAAC;IAC9D,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK;YAAE,SAAS;QACjC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,IAAI,EAAE;YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAsC,CAAC,CAAC;IAC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Q,CAAC,MAAc;IAC9B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,OAAO,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAChF,KAAK,SAAS,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;QAC3C,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,EAAE,EAAE,CAAC;QACvD,KAAK,SAAS,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACtG,KAAK,UAAU,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,oBAAoB,CAAC;QAC5D,KAAK,UAAU,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC;QACzF,KAAK,UAAU,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC;IACtE,CAAC;AACH,CAAC"}
@@ -18,7 +18,7 @@ export interface OperationContext {
18
18
  /** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
19
19
  state: Record<string, unknown>;
20
20
  /** Transport-agnostic invocation context (params, query, body, state). */
21
- invocation?: import('./invocation.js').InvocationContext;
21
+ invocation?: import('../contract/Invocation.js').InvocationContext;
22
22
  }
23
23
  export type AppNext = () => Promise<unknown>;
24
24
  export type AppMiddleware = (ctx: OperationContext, next: AppNext) => Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,iBAAiB,EAAE,iBAAiB,CAAC;CAC1D;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,2BAA2B,EAAE,iBAAiB,CAAC;CACpE;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fougere/core",
3
- "version": "0.4.0-alpha.0",
3
+ "version": "0.5.0-alpha.1",
4
4
  "description": "The core — scan, call contract, façades, remote stand-ins.",
5
5
  "keywords": [
6
6
  "fougere",
@@ -56,8 +56,8 @@
56
56
  "dependencies": {
57
57
  "@typescript/typescript6": "^6.0.2",
58
58
  "dequal": "^2.0.3",
59
- "@fougere/container": "0.4.0-alpha.0",
60
- "@fougere/schema": "0.4.0-alpha.0"
59
+ "@fougere/container": "0.5.0-alpha.1",
60
+ "@fougere/schema": "0.5.0-alpha.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "^22.0.0"
@@ -3,7 +3,7 @@ import type { Container } from '@fougere/container';
3
3
  import { validationErrorsOf } from '../wire/errors.js';
4
4
  import { emitKeyOf, factsAnnouncedBy } from '../emit.js';
5
5
  import { ambient } from '#ambient';
6
- import { EMPTY_INVOCATION } from '../wire/invocation.js';
6
+ import { EMPTY_INVOCATION } from '../contract/Invocation.js';
7
7
  import type { Logger } from '../builtins/logger.js';
8
8
  import type { Fronds } from '../scan/Fronds.js';
9
9
  import type { OperationsMap } from '../wire/operation.js';
@@ -8,7 +8,7 @@ import { repositoryKeyOf } from '../prefab/repository.js';
8
8
  import { targetOf } from '../prefab/prefab.js';
9
9
  import type { OperationContract, OperationsMap } from '../wire/operation.js';
10
10
  import type { EffectiveOperation, EffectiveOperationsMap } from '../effective-operation.js';
11
- import type { InvocationContext } from '../wire/invocation.js';
11
+ import type { InvocationContext } from '../contract/Invocation.js';
12
12
  import type { Emissions } from './Emissions.js';
13
13
  import type { Logger } from '../builtins/logger.js';
14
14
  import type { EntityEntry, HandlerEntry, PresenterEntry } from '../scan/frond.js';
@@ -7,7 +7,7 @@
7
7
  * load-bearing, since the fall-through would otherwise hand it the caller's body.
8
8
  */
9
9
  import type { ParsedParam } from '../scan/handler-parser.js';
10
- import type { InvocationContext } from '../wire/invocation.js';
10
+ import type { InvocationContext } from '../contract/Invocation.js';
11
11
  import { lowerFirst } from '@fougere/schema';
12
12
 
13
13
  // ── Types ─────────────────────────────────────
@@ -1,6 +1,7 @@
1
1
  import type { Container } from '@fougere/container';
2
2
  import { lowerFirst, type SchemaView } from '@fougere/schema';
3
3
  import type { EntityEntry, HandlerEntry, PresenterEntry } from '../scan/frond.js';
4
+ import { hostedBy } from './hosted.js';
4
5
  import type { AuthRuntime } from './auth.js';
5
6
  import type { CreateAppOptions, App } from './types.js';
6
7
  import type { AppMiddleware } from '../wire/middleware.js';
@@ -106,11 +107,11 @@ export async function createApp(options: CreateAppOptions): Promise<App> {
106
107
  container.register('Config', Config, { lifetime: 'singleton' });
107
108
  log.debug('builtins registered (Logger, Config)');
108
109
 
109
- // The scan is HANDED IN. Producing it reads a disk, consuming it does not — which is
110
- // the whole reason this file names no builtin and a Worker can run what it builds.
111
- // `scanProject` (`@fougere/core/node`) is one producer; a module a build wrote is another.
110
+ // What this app hosts is HANDED IN — stated, scanned, or both (`hostedBy`). Producing
111
+ // it may read a disk; consuming it never does, which is the whole reason this file names
112
+ // no builtin and a Worker can run what it builds.
112
113
  const scanStart = performance.now();
113
- const { fronds, diagnostics } = await (typeof options.scan === 'function' ? options.scan() : options.scan);
114
+ const { fronds, diagnostics } = await hostedBy(options);
114
115
  const operationModel = resolveEffectiveOperations(fronds, {
115
116
  diagnostics,
116
117
  remotes: options.remotes,
@@ -786,6 +787,10 @@ export async function createApp(options: CreateAppOptions): Promise<App> {
786
787
  // What this app publishes, straight from fougere.config.ts — the doors read it,
787
788
  // so an undeclared adapter serves nothing whatever a host mounted.
788
789
  adapters: options.adapters ?? {},
790
+ // Where a call goes, as DECLARED. Kept because a reader needs it beside what the
791
+ // runtime OBSERVED — `rpc.topology` calls a frond remote because it answered, never
792
+ // because a key said so, and the two disagree exactly when something is misconfigured.
793
+ remotes: Object.freeze({ ...(options.remotes ?? {}) }),
789
794
  dispatch: (call) => dispatcher.dispatch(call),
790
795
  local: localDispatcher,
791
796
  resolve,
@@ -814,6 +819,9 @@ export async function createApp(options: CreateAppOptions): Promise<App> {
814
819
  ));
815
820
  },
816
821
  extensions: () => appLifecycle.names(),
822
+ observe(observer) {
823
+ return dispatchLifecycle.add(observer);
824
+ },
817
825
  use(...args: [AppMiddleware] | [string, AppMiddleware]): void {
818
826
  if (typeof args[0] === 'string') {
819
827
  const [entity, mw] = args as [string, AppMiddleware];
@@ -0,0 +1,77 @@
1
+ /**
2
+ * What this app hosts — what it STATED, or what a scan FOUND.
3
+ *
4
+ * The PRESENCE of the key is the decision, the way `remotes:` states a topology: an app
5
+ * that passes `fronds:` is saying "do not scan", and one that passes `scan:` is handing
6
+ * over what a scanner read. There is no mode to configure because there is no third
7
+ * behaviour to name.
8
+ *
9
+ * Both may arrive, and then they MERGE — but only where a scan costs nothing at runtime.
10
+ * Under Nuxt the scan is a build artifact, so an app may state the frond it wants to own
11
+ * and leave the rest to what the build found. Anywhere the scan would run at START, half a
12
+ * statement buys nothing the whole one does: the disk is read either way.
13
+ *
14
+ * Merging is per frond NAME and per member. A stated frond wins outright on the members it
15
+ * names — stating `entities: [Post]` where a scan found `[Post, Author]` yields `[Post]`,
16
+ * because the point of stating is to decide. Empty is what "I named none" looks like, and
17
+ * `frond()` builds every member, so an empty one is filled rather than enforced.
18
+ */
19
+ import type { FrondDescriptor, ScanResult } from '../scan/frond.js';
20
+ import { Fronds } from '../scan/Fronds.js';
21
+
22
+ /** Where an app's fronds come from — either, or both. */
23
+ export interface HostedSources {
24
+ /** What the app states. No disk was read, so no diagnostic can come from it. */
25
+ fronds?: readonly FrondDescriptor[];
26
+ /** What a scanner found, and what it could not do. */
27
+ scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
28
+ }
29
+
30
+ /** The members a stated frond takes from a scan when it named none of its own. */
31
+ type Fillable = 'providers' | 'entities' | 'handlers' | 'presenters' | 'collectors' | 'seeds';
32
+
33
+ /** A stated frond, completed by what a scan found under the same name. */
34
+ function completed(stated: FrondDescriptor, found: FrondDescriptor | undefined): FrondDescriptor {
35
+ if (!found) return stated;
36
+
37
+ // Written out rather than looped: a loop over the key union asks TypeScript to prove
38
+ // `found[k]` fits `stated[k]` for every k at once, which it cannot — and the cast that
39
+ // silences it would also silence a member added to the descriptor and forgotten here.
40
+ const fill = <K extends Fillable>(member: K): FrondDescriptor[K] =>
41
+ (stated[member].length === 0 ? found[member] : stated[member]);
42
+
43
+ return {
44
+ ...found,
45
+ ...stated,
46
+ providers: fill('providers'),
47
+ entities: fill('entities'),
48
+ handlers: fill('handlers'),
49
+ presenters: fill('presenters'),
50
+ collectors: fill('collectors'),
51
+ seeds: fill('seeds'),
52
+ };
53
+ }
54
+
55
+ /** What the app hosts, and what the scan — if it ran — could not do. */
56
+ export async function hostedBy(sources: HostedSources): Promise<ScanResult> {
57
+ const scanned = sources.scan
58
+ ? await (typeof sources.scan === 'function' ? sources.scan() : sources.scan)
59
+ : undefined;
60
+
61
+ if (!sources.fronds) {
62
+ if (!scanned) {
63
+ throw new Error(
64
+ 'createApp needs `fronds:` (what this app states) or `scan:` (what a scanner found). '
65
+ + 'Neither was given, so nothing is hosted.',
66
+ );
67
+ }
68
+
69
+ return scanned;
70
+ }
71
+
72
+ const found = scanned?.fronds ?? [];
73
+ const stated = sources.fronds.map((f) => completed(f, found.find((s) => s.name === f.name)));
74
+ const unstated = found.filter((f) => !sources.fronds!.some((s) => s.name === f.name));
75
+
76
+ return { fronds: Fronds.scanned([...stated, ...unstated]), diagnostics: scanned?.diagnostics ?? [] };
77
+ }
@@ -1,4 +1,4 @@
1
- import { lowerFirst, type EntityConstructor } from '@fougere/schema';
1
+ import { lowerFirst } from '@fougere/schema';
2
2
  import type { FrondDescriptor, ProviderEntry } from '../scan/frond.js';
3
3
  import { targetOf } from '../prefab/prefab.js';
4
4
  import { ownedBy, repositoryKeyOf } from '../prefab/repository.js';
@@ -135,6 +135,3 @@ function entityOfOrmKey(dep: string): string | undefined {
135
135
  const entity = lowerFirst(dep.slice(0, -'Orm'.length));
136
136
  return ormKeyOf(entity) === dep ? entity : undefined;
137
137
  }
138
-
139
- /** Placeholder so the module's imports stay honest if a caller wants the entity list. */
140
- export type { EntityConstructor };
@@ -11,7 +11,7 @@
11
11
  import type { FrondCall, Transport } from '../wire/call.js';
12
12
  import { assertIdentityCard, RPC_ENTITY } from '../wire/call.js';
13
13
  import { runMiddlewares, type AppMiddleware, type OperationContext } from '../wire/middleware.js';
14
- import { EMPTY_INVOCATION, type InvocationContext } from '../wire/invocation.js';
14
+ import { EMPTY_INVOCATION, type InvocationContext } from '../contract/Invocation.js';
15
15
  import { FougereError, ErrorCode } from '../wire/errors.js';
16
16
  import { Card, type SchemaView, type SchemaDescriptor } from '@fougere/schema';
17
17
  import { DynamicFacade } from '../entry/DynamicFacade.js';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Where a STATED contract and the signature it is about have stopped agreeing.
3
+ *
4
+ * `frond.config.ts` states an operation's contract and wins over the scan — that order is
5
+ * deliberate, and it is the only answer for a method inherited from an installed base class
6
+ * the workspace scan cannot see. But winning silently is how a statement made about
7
+ * `publish(id: string)` keeps applying after the parameter was renamed to `postId`: the
8
+ * façade binds what the config said, the method receives `undefined`, and nothing anywhere
9
+ * says the two disagree.
10
+ *
11
+ * So this compares, and only where BOTH exist — a statement about a signature the scan
12
+ * never read is not drift, it is the case config was built for. It is a `warning` and not
13
+ * a refusal: the statement is still the author's word, and a boot that ran yesterday must
14
+ * not stop running because a parameter moved. What it must not do is stay quiet.
15
+ */
16
+ import type { FrondDescriptor, HandlerEntry, ScanDiagnostic } from '../scan/frond.js';
17
+ import type { BindingPlan } from './binding.js';
18
+ import type { ParsedMethod } from '../scan/handler-parser.js';
19
+
20
+ /** The parameters a stated binding names, against the ones the method declares. */
21
+ function namesDisagreeing(stated: BindingPlan, signature: ParsedMethod): string[] {
22
+ const declared = new Set(signature.params.map((p: { name: string }) => p.name));
23
+
24
+ return stated.map((b) => b.name).filter((name) => !declared.has(name));
25
+ }
26
+
27
+ /**
28
+ * What a frond's stated contracts no longer match.
29
+ *
30
+ * Read by `resolveEffectiveOperations`, so the same answer reaches `fougere check` and a
31
+ * boot — one comparison, two readers, no second opinion to drift on its own.
32
+ */
33
+ export function statementDrift(frond: FrondDescriptor, handler: HandlerEntry): ScanDiagnostic[] {
34
+ const found: ScanDiagnostic[] = [];
35
+
36
+ for (const [name, override] of Object.entries(frond.operationsOverrides ?? {})) {
37
+ if (!override.binding) continue;
38
+
39
+ // The scan's own reading of this method. Absent means config is stating what nothing
40
+ // read — an installed base class, a handler outside the workspace — which is legal.
41
+ const signature = handler.operations.get(name)?.signature;
42
+ if (!signature) continue;
43
+
44
+ const orphans = namesDisagreeing(override.binding, signature);
45
+ if (orphans.length === 0) continue;
46
+
47
+ found.push({
48
+ severity: 'warning',
49
+ code: 'stated-binding-drifted',
50
+ filePath: handler.filePath,
51
+ frond: frond.name,
52
+ subject: `${handler.ctor.name}.${name}`,
53
+ message: `frond.config.ts binds ${orphans.map((o) => `\`${o}\``).join(', ')} on `
54
+ + `${handler.ctor.name}.${name}, which declares (${signature.params.map((p: { name: string }) => p.name).join(', ')}). `
55
+ + `The statement wins, so those parameters receive nothing.`,
56
+ });
57
+ }
58
+
59
+ return found;
60
+ }
package/src/boot/types.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import type { Container } from '@fougere/container';
9
9
  import type { Fronds } from '../scan/Fronds.js';
10
- import type { ScanResult } from '../scan/frond.js';
10
+ import type { FrondDescriptor, ScanResult } from '../scan/frond.js';
11
11
  import type { SchemaView } from '@fougere/schema';
12
12
  import type { OrmFactory } from '../orm.js';
13
13
  import type { AppMiddleware } from '../wire/middleware.js';
@@ -55,7 +55,16 @@ export interface CreateAppOptions {
55
55
  * apart, and that is the point: it names no builtin, so a runtime without `node:fs`
56
56
  * runs it. `root` and `fronds` used to live here — both were arguments to the scan.
57
57
  */
58
- scan: ScanResult | (() => Promise<ScanResult> | ScanResult);
58
+ scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
59
+ /**
60
+ * What this app STATES it hosts — `frond('blog', { entities: [Post] })`.
61
+ *
62
+ * Passing this and not `scan:` is how an app says "do not scan": nothing reads a disk,
63
+ * nothing loads `typescript`, and what was not named does not exist. Passing both fills
64
+ * the members left unnamed from what the scan found — the app's word wins, the way
65
+ * `frond.config.ts` wins over the scan one level down.
66
+ */
67
+ fronds?: readonly FrondDescriptor[];
59
68
  /**
60
69
  * Remote fronds — label → address. What each remote hosts is discovered
61
70
  * at the first miss (rpc.discover), never declared here.
@@ -140,6 +149,8 @@ export interface App extends DispatchPort {
140
149
  * the answer is still "not here".
141
150
  */
142
151
  adapters: Record<string, boolean | undefined>;
152
+ /** Where a call goes, as the config declared it — frond name to address. */
153
+ remotes: Readonly<Record<string, string>>;
143
154
  /** Discovered fronds metadata. */
144
155
  fronds: Fronds;
145
156
  /** Resolve from root container (shortcut). */
@@ -253,6 +264,8 @@ export interface App extends DispatchPort {
253
264
  */
254
265
  serveRpc(op: string, answer: RpcAnswer): void;
255
266
  /** Register a global app middleware (runs on every operation). */
267
+ /** Watch every dispatch transition; the returned function unsubscribes. */
268
+ observe(observer: DispatchObserver): () => void;
256
269
  use(middleware: AppMiddleware): void;
257
270
  /** Register an app middleware scoped to a specific entity. */
258
271
  use(entity: string, middleware: AppMiddleware): void;