@stigmer/server 3.27.2 → 3.29.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.
Files changed (227) hide show
  1. package/README.md +2 -0
  2. package/dist/authorization/authorizer.d.ts +3 -3
  3. package/dist/authorization/authorizer.js +3 -3
  4. package/dist/authorization/derived-tuples.js +6 -1
  5. package/dist/authorization/derived-tuples.js.map +1 -1
  6. package/dist/authorization/evaluator.d.ts +9 -10
  7. package/dist/authorization/evaluator.d.ts.map +1 -1
  8. package/dist/authorization/evaluator.js.map +1 -1
  9. package/dist/authorization/list-read-scope.d.ts.map +1 -1
  10. package/dist/authorization/list-read-scope.js +29 -18
  11. package/dist/authorization/list-read-scope.js.map +1 -1
  12. package/dist/authorization/model/bindings.d.ts +41 -0
  13. package/dist/authorization/model/bindings.d.ts.map +1 -0
  14. package/dist/authorization/model/bindings.js +89 -0
  15. package/dist/authorization/model/bindings.js.map +1 -0
  16. package/dist/authorization/model/data/authorization-model.json +3141 -0
  17. package/dist/authorization/model/default-of.d.ts +2 -2
  18. package/dist/authorization/model/execution-viewer.d.ts +3 -0
  19. package/dist/authorization/model/execution-viewer.d.ts.map +1 -0
  20. package/dist/authorization/model/execution-viewer.js +50 -0
  21. package/dist/authorization/model/execution-viewer.js.map +1 -0
  22. package/dist/authorization/model/index.d.ts +33 -21
  23. package/dist/authorization/model/index.d.ts.map +1 -1
  24. package/dist/authorization/model/index.js +74 -52
  25. package/dist/authorization/model/index.js.map +1 -1
  26. package/dist/authorization/model/openfga-json.d.ts +18 -0
  27. package/dist/authorization/model/openfga-json.d.ts.map +1 -0
  28. package/dist/authorization/model/openfga-json.js +266 -0
  29. package/dist/authorization/model/openfga-json.js.map +1 -0
  30. package/dist/authorization/model/rewrite.d.ts +39 -67
  31. package/dist/authorization/model/rewrite.d.ts.map +1 -1
  32. package/dist/authorization/model/rewrite.js +1 -117
  33. package/dist/authorization/model/rewrite.js.map +1 -1
  34. package/dist/authorization/strict-json.d.ts +20 -0
  35. package/dist/authorization/strict-json.d.ts.map +1 -0
  36. package/dist/authorization/strict-json.js +45 -0
  37. package/dist/authorization/strict-json.js.map +1 -0
  38. package/dist/boot/compose.d.ts.map +1 -1
  39. package/dist/boot/compose.js +9 -7
  40. package/dist/boot/compose.js.map +1 -1
  41. package/dist/domain/workflowexecution/list-index.d.ts +1 -1
  42. package/dist/extensions/list-read-scope.d.ts +20 -3
  43. package/dist/extensions/list-read-scope.d.ts.map +1 -1
  44. package/dist/extensions/list-read-scope.js +20 -1
  45. package/dist/extensions/list-read-scope.js.map +1 -1
  46. package/dist/index.d.ts +7 -8
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +15 -5
  49. package/dist/index.js.map +1 -1
  50. package/package.json +7 -6
  51. package/src/authorization/README.md +41 -34
  52. package/src/authorization/__tests__/authorizer.test.ts +5 -14
  53. package/src/authorization/__tests__/derived-tuples.test.ts +29 -27
  54. package/src/authorization/__tests__/evaluator.test.ts +53 -160
  55. package/src/authorization/__tests__/facts.test.ts +5 -11
  56. package/src/authorization/__tests__/list-read-scope.measure.test.ts +12 -20
  57. package/src/authorization/__tests__/list-read-scope.test.ts +15 -14
  58. package/src/authorization/__tests__/organization-directory.test.ts +2 -2
  59. package/src/authorization/__tests__/store-test-kit.ts +246 -0
  60. package/src/authorization/__tests__/store-tests.test.ts +92 -223
  61. package/src/authorization/__tests__/support.ts +30 -2
  62. package/src/authorization/__tests__/throwaway-model.ts +75 -0
  63. package/src/authorization/__tests__/wire-permissions.test.ts +141 -107
  64. package/src/authorization/authorizer.ts +3 -3
  65. package/src/authorization/derived-tuples.ts +7 -2
  66. package/src/authorization/evaluator.ts +8 -10
  67. package/src/authorization/list-read-scope.ts +37 -22
  68. package/src/authorization/model/__tests__/openfga-json.test.ts +353 -0
  69. package/src/authorization/model/__tests__/registry.test.ts +345 -277
  70. package/src/authorization/model/bindings.ts +131 -0
  71. package/src/authorization/model/data/authorization-model.json +3141 -0
  72. package/src/authorization/model/default-of.ts +2 -2
  73. package/src/authorization/model/execution-viewer.ts +56 -0
  74. package/src/authorization/model/index.ts +81 -72
  75. package/src/authorization/model/openfga-json.ts +310 -0
  76. package/src/authorization/model/rewrite.ts +39 -188
  77. package/src/authorization/strict-json.ts +52 -0
  78. package/src/boot/compose.ts +9 -7
  79. package/src/extensions/__tests__/built-in-authorization-composed.test.ts +3 -6
  80. package/src/extensions/list-read-scope.ts +32 -4
  81. package/src/index.ts +15 -44
  82. package/dist/authorization/model/agent.d.ts +0 -2
  83. package/dist/authorization/model/agent.d.ts.map +0 -1
  84. package/dist/authorization/model/agent.js +0 -43
  85. package/dist/authorization/model/agent.js.map +0 -1
  86. package/dist/authorization/model/agent_channel.d.ts +0 -2
  87. package/dist/authorization/model/agent_channel.d.ts.map +0 -1
  88. package/dist/authorization/model/agent_channel.js +0 -39
  89. package/dist/authorization/model/agent_channel.js.map +0 -1
  90. package/dist/authorization/model/agent_execution.d.ts +0 -2
  91. package/dist/authorization/model/agent_execution.d.ts.map +0 -1
  92. package/dist/authorization/model/agent_execution.js +0 -25
  93. package/dist/authorization/model/agent_execution.js.map +0 -1
  94. package/dist/authorization/model/agent_instance.d.ts +0 -2
  95. package/dist/authorization/model/agent_instance.d.ts.map +0 -1
  96. package/dist/authorization/model/agent_instance.js +0 -48
  97. package/dist/authorization/model/agent_instance.js.map +0 -1
  98. package/dist/authorization/model/agent_share.d.ts +0 -2
  99. package/dist/authorization/model/agent_share.d.ts.map +0 -1
  100. package/dist/authorization/model/agent_share.js +0 -29
  101. package/dist/authorization/model/agent_share.js.map +0 -1
  102. package/dist/authorization/model/api_key.d.ts +0 -2
  103. package/dist/authorization/model/api_key.d.ts.map +0 -1
  104. package/dist/authorization/model/api_key.js +0 -27
  105. package/dist/authorization/model/api_key.js.map +0 -1
  106. package/dist/authorization/model/artifact.d.ts +0 -2
  107. package/dist/authorization/model/artifact.d.ts.map +0 -1
  108. package/dist/authorization/model/artifact.js +0 -27
  109. package/dist/authorization/model/artifact.js.map +0 -1
  110. package/dist/authorization/model/channel_app.d.ts +0 -2
  111. package/dist/authorization/model/channel_app.d.ts.map +0 -1
  112. package/dist/authorization/model/channel_app.js +0 -28
  113. package/dist/authorization/model/channel_app.js.map +0 -1
  114. package/dist/authorization/model/environment.d.ts +0 -2
  115. package/dist/authorization/model/environment.d.ts.map +0 -1
  116. package/dist/authorization/model/environment.js +0 -33
  117. package/dist/authorization/model/environment.js.map +0 -1
  118. package/dist/authorization/model/execution_context.d.ts +0 -2
  119. package/dist/authorization/model/execution_context.d.ts.map +0 -1
  120. package/dist/authorization/model/execution_context.js +0 -19
  121. package/dist/authorization/model/execution_context.js.map +0 -1
  122. package/dist/authorization/model/iam_policy.d.ts +0 -2
  123. package/dist/authorization/model/iam_policy.d.ts.map +0 -1
  124. package/dist/authorization/model/iam_policy.js +0 -31
  125. package/dist/authorization/model/iam_policy.js.map +0 -1
  126. package/dist/authorization/model/identity_account.d.ts +0 -2
  127. package/dist/authorization/model/identity_account.d.ts.map +0 -1
  128. package/dist/authorization/model/identity_account.js +0 -25
  129. package/dist/authorization/model/identity_account.js.map +0 -1
  130. package/dist/authorization/model/mcp_server.d.ts +0 -2
  131. package/dist/authorization/model/mcp_server.d.ts.map +0 -1
  132. package/dist/authorization/model/mcp_server.js +0 -38
  133. package/dist/authorization/model/mcp_server.js.map +0 -1
  134. package/dist/authorization/model/memory.d.ts +0 -2
  135. package/dist/authorization/model/memory.d.ts.map +0 -1
  136. package/dist/authorization/model/memory.js +0 -26
  137. package/dist/authorization/model/memory.js.map +0 -1
  138. package/dist/authorization/model/oauth_app.d.ts +0 -2
  139. package/dist/authorization/model/oauth_app.d.ts.map +0 -1
  140. package/dist/authorization/model/oauth_app.js +0 -31
  141. package/dist/authorization/model/oauth_app.js.map +0 -1
  142. package/dist/authorization/model/organization.d.ts +0 -2
  143. package/dist/authorization/model/organization.d.ts.map +0 -1
  144. package/dist/authorization/model/organization.js +0 -58
  145. package/dist/authorization/model/organization.js.map +0 -1
  146. package/dist/authorization/model/platform_client.d.ts +0 -2
  147. package/dist/authorization/model/platform_client.d.ts.map +0 -1
  148. package/dist/authorization/model/platform_client.js +0 -31
  149. package/dist/authorization/model/platform_client.js.map +0 -1
  150. package/dist/authorization/model/plugin.d.ts +0 -2
  151. package/dist/authorization/model/plugin.d.ts.map +0 -1
  152. package/dist/authorization/model/plugin.js +0 -45
  153. package/dist/authorization/model/plugin.js.map +0 -1
  154. package/dist/authorization/model/schedule.d.ts +0 -2
  155. package/dist/authorization/model/schedule.d.ts.map +0 -1
  156. package/dist/authorization/model/schedule.js +0 -34
  157. package/dist/authorization/model/schedule.js.map +0 -1
  158. package/dist/authorization/model/session.d.ts +0 -2
  159. package/dist/authorization/model/session.d.ts.map +0 -1
  160. package/dist/authorization/model/session.js +0 -38
  161. package/dist/authorization/model/session.js.map +0 -1
  162. package/dist/authorization/model/skill.d.ts +0 -2
  163. package/dist/authorization/model/skill.d.ts.map +0 -1
  164. package/dist/authorization/model/skill.js +0 -39
  165. package/dist/authorization/model/skill.js.map +0 -1
  166. package/dist/authorization/model/workflow.d.ts +0 -2
  167. package/dist/authorization/model/workflow.d.ts.map +0 -1
  168. package/dist/authorization/model/workflow.js +0 -39
  169. package/dist/authorization/model/workflow.js.map +0 -1
  170. package/dist/authorization/model/workflow_execution.d.ts +0 -2
  171. package/dist/authorization/model/workflow_execution.d.ts.map +0 -1
  172. package/dist/authorization/model/workflow_execution.js +0 -33
  173. package/dist/authorization/model/workflow_execution.js.map +0 -1
  174. package/dist/authorization/model/workflow_instance.d.ts +0 -2
  175. package/dist/authorization/model/workflow_instance.d.ts.map +0 -1
  176. package/dist/authorization/model/workflow_instance.js +0 -96
  177. package/dist/authorization/model/workflow_instance.js.map +0 -1
  178. package/dist/authorization/store-test-kit.d.ts +0 -62
  179. package/dist/authorization/store-test-kit.d.ts.map +0 -1
  180. package/dist/authorization/store-test-kit.js +0 -265
  181. package/dist/authorization/store-test-kit.js.map +0 -1
  182. package/src/authorization/__tests__/enterprise-model.ts +0 -59
  183. package/src/authorization/__tests__/fixtures/fga/agent-channel-owner.fga.yaml +0 -112
  184. package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +0 -177
  185. package/src/authorization/__tests__/fixtures/fga/agent-share-owner.fga.yaml +0 -109
  186. package/src/authorization/__tests__/fixtures/fga/artifact-org-and-owner.fga.yaml +0 -128
  187. package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +0 -318
  188. package/src/authorization/__tests__/fixtures/fga/channel-app-owner.fga.yaml +0 -125
  189. package/src/authorization/__tests__/fixtures/fga/channel-participation.fga.yaml +0 -201
  190. package/src/authorization/__tests__/fixtures/fga/channel-session-visibility.fga.yaml +0 -187
  191. package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +0 -214
  192. package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +0 -129
  193. package/src/authorization/__tests__/fixtures/fga/memory-subject-only.fga.yaml +0 -72
  194. package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +0 -308
  195. package/src/authorization/__tests__/fixtures/fga/org-shared-environment.fga.yaml +0 -144
  196. package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +0 -199
  197. package/src/authorization/__tests__/fixtures/fga/provider-standing-viewer.fga.yaml +0 -40
  198. package/src/authorization/__tests__/fixtures/fga/reserved-label-writer.fga.yaml +0 -41
  199. package/src/authorization/__tests__/fixtures/fga/schedule-owner.fga.yaml +0 -113
  200. package/src/authorization/__tests__/fixtures/fga/schedule-session-visibility.fga.yaml +0 -214
  201. package/src/authorization/__tests__/fixtures/fga/session-personal-resource.fga.yaml +0 -117
  202. package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +0 -190
  203. package/src/authorization/model/agent.ts +0 -64
  204. package/src/authorization/model/agent_channel.ts +0 -57
  205. package/src/authorization/model/agent_execution.ts +0 -33
  206. package/src/authorization/model/agent_instance.ts +0 -66
  207. package/src/authorization/model/agent_share.ts +0 -40
  208. package/src/authorization/model/api_key.ts +0 -28
  209. package/src/authorization/model/artifact.ts +0 -38
  210. package/src/authorization/model/channel_app.ts +0 -39
  211. package/src/authorization/model/environment.ts +0 -48
  212. package/src/authorization/model/execution_context.ts +0 -20
  213. package/src/authorization/model/iam_policy.ts +0 -42
  214. package/src/authorization/model/identity_account.ts +0 -26
  215. package/src/authorization/model/mcp_server.ts +0 -59
  216. package/src/authorization/model/memory.ts +0 -27
  217. package/src/authorization/model/oauth_app.ts +0 -43
  218. package/src/authorization/model/organization.ts +0 -59
  219. package/src/authorization/model/platform_client.ts +0 -43
  220. package/src/authorization/model/plugin.ts +0 -66
  221. package/src/authorization/model/schedule.ts +0 -49
  222. package/src/authorization/model/session.ts +0 -50
  223. package/src/authorization/model/skill.ts +0 -60
  224. package/src/authorization/model/workflow.ts +0 -60
  225. package/src/authorization/model/workflow_execution.ts +0 -46
  226. package/src/authorization/model/workflow_instance.ts +0 -125
  227. package/src/authorization/store-test-kit.ts +0 -395
@@ -99,7 +99,8 @@
99
99
  * with. A driver MAY answer the parent's question in place of the
100
100
  * child's: by the model's construction the two answers are identical
101
101
  * (the child's `owner`, `viewer` and `can_view` are all `from` the
102
- * parent), and the parent's resolution is direct tuples where the
102
+ * parent; authorization/model/__tests__/registry.test.ts holds that
103
+ * for every such kind), and the parent's resolution is direct tuples where the
103
104
  * child's walks the parent's whole set (OpenFGA's learned `weight2`
104
105
  * strategy read the founder's 423 sessions per execution; that is what
105
106
  * rolled back twice on 2026-09-14). A driver that ignores the field is
@@ -174,11 +175,27 @@ export interface ListReadScope {
174
175
  * `caller` is never the `internal` class: `restrictListByReadScope`,
175
176
  * the one consumption idiom, answers that class before any driver is
176
177
  * asked (the header's contract line). A driver that is offered it has
177
- * been reached around the idiom and should refuse loudly rather than
178
- * evaluate the server as a person (the built-in driver does).
178
+ * been reached around the idiom and refuses with
179
+ * `InternalCallerOfferedError` rather than evaluate the server as a
180
+ * person.
179
181
  */
180
182
  restrictListEntries(caller: CallerIdentity, kind: ApiResourceKind, entries: ReadonlyArray<ListEntryMeta>): Promise<ReadonlySet<string>>;
181
183
  }
184
+ /**
185
+ * The restrict verb's refusal of the `internal` class (its doc above):
186
+ * thrown by a driver that is offered the server acting as itself, which
187
+ * `restrictListByReadScope` answers before any driver is asked. Being
188
+ * offered it means a list lane reached the driver around that idiom, and
189
+ * evaluating the server as a person would answer a quiet short list, the
190
+ * failure stigmer#1207 fixed. It is a consumer bug, never a denial (a
191
+ * denial is an empty set): the lane faults and the pipeline answers its
192
+ * sanitized INTERNAL. One type for every edition's driver, so each refuses
193
+ * the class the same way.
194
+ */
195
+ export declare class InternalCallerOfferedError extends Error {
196
+ readonly kind: ApiResourceKind;
197
+ constructor(kind: ApiResourceKind);
198
+ }
182
199
  /**
183
200
  * The shape every stored API resource message presents to the shared
184
201
  * helper — the metadata fields the scope's candidates are built from, the
@@ -1 +1 @@
1
- {"version":3,"file":"list-read-scope.d.ts","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AAC3H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAUjG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,aAAc,SAAQ,qBAAqB;IAC1D,QAAQ,CAAC,MAAM,EAAE,QA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ACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE;QACT,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,UAAU,CAAC,EAAE,qBAAqB,CAAC;KACpC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,SAAS,kBAAkB,EACxE,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,eAAe,EACrB,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,EAAE,CAAC,CA2Bd"}
@@ -3,8 +3,27 @@
3
3
  // protos and each other, so there is no cycle. Deliberate — one resolver
4
4
  // for the tuple writer, the point-check driver and the list reader beats
5
5
  // a copy in the seam.
6
- import { inheritedAuthorizationParentOf } from "../pipeline/apiresource-meta.js";
6
+ import { inheritedAuthorizationParentOf, kindEnumName, } from "../pipeline/apiresource-meta.js";
7
7
  import { rowAuthorizationFactsOf } from "../pipeline/steps/authorization-facts.js";
8
+ /**
9
+ * The restrict verb's refusal of the `internal` class (its doc above):
10
+ * thrown by a driver that is offered the server acting as itself, which
11
+ * `restrictListByReadScope` answers before any driver is asked. Being
12
+ * offered it means a list lane reached the driver around that idiom, and
13
+ * evaluating the server as a person would answer a quiet short list, the
14
+ * failure stigmer#1207 fixed. It is a consumer bug, never a denial (a
15
+ * denial is an empty set): the lane faults and the pipeline answers its
16
+ * sanitized INTERNAL. One type for every edition's driver, so each refuses
17
+ * the class the same way.
18
+ */
19
+ export class InternalCallerOfferedError extends Error {
20
+ kind;
21
+ constructor(kind) {
22
+ super(`the internal caller class was offered to the list scope for kind '${kindEnumName(kind)}' — the shared helper answers that class before any driver; a list lane reached the driver around it`);
23
+ this.name = "InternalCallerOfferedError";
24
+ this.kind = kind;
25
+ }
26
+ }
8
27
  /**
9
28
  * The ONE consumption idiom for post-scan lanes (the shared-step
10
29
  * discipline of pipeline/steps/authorization-tuples.ts, rendered as a
@@ -1 +1 @@
1
- {"version":3,"file":"list-read-scope.js","sourceRoot":"","sources":["../../src/extensions/list-read-scope.ts"],"names":[],"mappings":"AAgIA,sEAAsE;AACtE,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,sBAAsB;AACtB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAyFnF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,KAAgC,EAChC,MAAsB,EACtB,IAAqB,EACrB,SAA2B,EAC3B,UAAkB;IAElB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GACX,UAAU,KAAK,EAAE;QACf,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,KAAK,UAAU,CAAC,CAAC;IAC5E,sEAAsE;IACtE,wEAAwE;IACxE,qEAAqE;IACrE,IAAI,MAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;IACtB,CAAC;IACD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,OAAO,GAAoB,OAAO,CAAC,GAAG,CAAC,CA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B,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,mBAAmB,KAAK,SAAS;YACtC,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAChC,IAAqB;IAIrB,MAAM,MAAM,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IACzB,CAAC;IACD,OAAO,CAAC,WAAW,EAAE,EAAE,CACrB,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -10,6 +10,12 @@
10
10
  * to this file are owner-visible surface changes, extended only through
11
11
  * gates (the DD-005 review property: a surface change is a one-file diff).
12
12
  *
13
+ * One data file is published beside it, through its own exports entry:
14
+ * `@stigmer/server/authorization-model.json`, the compiled authorization
15
+ * model (OpenFGA's JSON, generated from fga/model, whose README states the
16
+ * file's contract). Every edition reads those bytes: this server
17
+ * evaluates them, and an edition that runs OpenFGA applies them.
18
+ *
13
19
  * The surface is exactly what the ratified architecture names (blueprint
14
20
  * 20260826.02/03 §1) and the parameter types those entries force:
15
21
  * - the compose entry and config loading (composeServer + its options'
@@ -85,17 +91,10 @@ export type { PlatformTokenClaimValue, PlatformTokenRefusal, PlatformTokenSignin
85
91
  export { PLATFORM_TOKEN_ISSUER, PLATFORM_TOKEN_REFUSAL_MESSAGES, TOKEN_TYPE_CLAIM, decodeVerifiedPlatformTokenPayload, platformTokenRefusalError, signPlatformToken, stringClaim, verifyPlatformToken, } from "./platformtoken/envelope.js";
86
92
  export type { PlatformTokenKeyMaterial, PlatformTokenKeyRing, PlatformTokenSigner, SigningPlatformTokenKeyRing, } from "./platformtoken/key-ring.js";
87
93
  export { DEFAULT_PLATFORM_TOKEN_TTL_SECONDS, canSign, platformTokenKeyRingFromPem, } from "./platformtoken/key-ring.js";
88
- export type { DerivedRelation, KindDeclaration, Rewrite, SubjectType, } from "./authorization/model/rewrite.js";
89
- export type { Model } from "./authorization/model/index.js";
90
- export { builtInModel, declarationFor, newModel, } from "./authorization/model/index.js";
91
- export type { ObjectRef, Person, Subject, Tuple, TupleSource, } from "./authorization/tuples.js";
92
- export type { EvaluationFault } from "./authorization/evaluator.js";
93
- export { AuthorizationEvaluationError, MAX_RESOLUTION_DEPTH, checkRelation, } from "./authorization/evaluator.js";
94
- export type { StoreTestCase, StoreTestDocument, StoreTestKit, StoreTestSkip, StoreTestSkipReason, } from "./authorization/store-test-kit.js";
95
- export { parseStoreTestDocument, storeTestCases, } from "./authorization/store-test-kit.js";
96
94
  export { NOT_FOUND_EXEMPT_KINDS } from "./authorization/authorizer.js";
97
95
  export type { ListReadScope, ListEntryMeta, } from "./extensions/list-read-scope.js";
98
96
  export { restrictListByReadScope } from "./extensions/list-read-scope.js";
97
+ export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
99
98
  export type { ScheduleFireCallerMint } from "./extensions/schedule-fire-caller.js";
100
99
  export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
101
100
  export type { VisitorErrorPolicy } from "./pipeline/interceptors/error-boundary.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -10,6 +10,12 @@
10
10
  * to this file are owner-visible surface changes, extended only through
11
11
  * gates (the DD-005 review property: a surface change is a one-file diff).
12
12
  *
13
+ * One data file is published beside it, through its own exports entry:
14
+ * `@stigmer/server/authorization-model.json`, the compiled authorization
15
+ * model (OpenFGA's JSON, generated from fga/model, whose README states the
16
+ * file's contract). Every edition reads those bytes: this server
17
+ * evaluates them, and an edition that runs OpenFGA applies them.
18
+ *
13
19
  * The surface is exactly what the ratified architecture names (blueprint
14
20
  * 20260826.02/03 §1) and the parameter types those entries force:
15
21
  * - the compose entry and config loading (composeServer + its options'
@@ -56,18 +62,22 @@ export { newSystemManagedPlatformClient } from "./domain/platformclient/system-m
56
62
  export { SYSTEM_SHARE_CLIENT_SLUG } from "./domain/platformclient/constants.js";
57
63
  export { PLATFORM_TOKEN_ISSUER, PLATFORM_TOKEN_REFUSAL_MESSAGES, TOKEN_TYPE_CLAIM, decodeVerifiedPlatformTokenPayload, platformTokenRefusalError, signPlatformToken, stringClaim, verifyPlatformToken, } from "./platformtoken/envelope.js";
58
64
  export { DEFAULT_PLATFORM_TOKEN_TTL_SECONDS, canSign, platformTokenKeyRingFromPem, } from "./platformtoken/key-ring.js";
59
- export { builtInModel, declarationFor, newModel, } from "./authorization/model/index.js";
60
- export { AuthorizationEvaluationError, MAX_RESOLUTION_DEPTH, checkRelation, } from "./authorization/evaluator.js";
61
- export { parseStoreTestDocument, storeTestCases, } from "./authorization/store-test-kit.js";
62
65
  // The kinds whose missing row the built-in authorizer denies instead of
63
- // answering not-found — the cloud's probe exemption over the open-source
64
- // tier; exported so the cloud's drift test pins the two sets equal.
66
+ // answering not-found: exported so a composition that authorizes with its
67
+ // own engine and probes existence itself pins its exemptions to this set.
68
+ // The model the authorizer evaluates is not exported as code: it is the
69
+ // data subpath `@stigmer/server/authorization-model.json` (this file's
70
+ // header).
65
71
  export { NOT_FOUND_EXEMPT_KINDS } from "./authorization/authorizer.js";
66
72
  // The one consumption idiom of the list read scope for post-scan list lanes:
67
73
  // exported so a list lane a composition serves from its own table narrows
68
74
  // its rows exactly as the library's lanes do, instead of building each
69
75
  // candidate's authorization facts by hand.
70
76
  export { restrictListByReadScope } from "./extensions/list-read-scope.js";
77
+ // The seam's refusal of the `internal` caller class on the restrict verb,
78
+ // which that idiom answers before any driver is asked: exported so a
79
+ // composition's driver refuses the class exactly as the built-in one does.
80
+ export { InternalCallerOfferedError } from "./extensions/list-read-scope.js";
71
81
  export { ScheduleFireCallerRefusedError } from "./extensions/schedule-fire-caller.js";
72
82
  export { createErrorBoundaryInterceptor } from "./pipeline/interceptors/error-boundary.js";
73
83
  // The tuple lifecycle's resolution, for a kind a composition serves outside
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,wCAAwC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAkEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAe3E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAQ1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAW1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAKnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAQ9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAU3E,OAAO,EAAE,4BAA4B,EAAE,MAA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iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAEpC,qEAAqE;AACrE,uEAAuE;AACvE,0EAA0E;AAC1E,qEAAqE;AACrE,6DAA6D;AAC7D,uEAAuE;AACvE,qEAAqE;AACrE,gEAAgE;AAChE,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,iEAAiE;AACjE,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AAepC,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAE9E,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,kDAAkD;AAClD,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,gBAAgB,IAAI,sCAAsC,GAC3D,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AA0BrE,oEAAoE;AACpE,yEAAyE;AACzE,iDAAiD;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/server",
3
- "version": "3.27.2",
3
+ "version": "3.29.0",
4
4
  "description": "The Stigmer OSS control plane as a composable library: composeServer, the extension registry and the driver seams a composition builds on. The self-contained deployable of the same server is @stigmer/server-slim.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -9,6 +9,7 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "import": "./dist/index.js"
11
11
  },
12
+ "./authorization-model.json": "./src/authorization/model/data/authorization-model.json",
12
13
  "./package.json": "./package.json"
13
14
  },
14
15
  "files": [
@@ -62,11 +63,11 @@
62
63
  "@connectrpc/connect-node": "^2.0.0",
63
64
  "@kubernetes/client-node": "2.0.0",
64
65
  "@opentelemetry/api": "^1.9.0",
65
- "@stigmer/outbound": "3.27.2",
66
- "@stigmer/plugin-package": "3.27.2",
67
- "@stigmer/protos": "3.27.2",
68
- "@stigmer/temporal-codecs": "3.27.2",
69
- "@stigmer/zip-structure": "3.27.2",
66
+ "@stigmer/outbound": "3.29.0",
67
+ "@stigmer/plugin-package": "3.29.0",
68
+ "@stigmer/protos": "3.29.0",
69
+ "@stigmer/temporal-codecs": "3.29.0",
70
+ "@stigmer/zip-structure": "3.29.0",
70
71
  "@temporalio/activity": "1.16.2",
71
72
  "@temporalio/client": "1.16.2",
72
73
  "@temporalio/common": "1.16.2",
@@ -11,27 +11,35 @@ reading aggregates it does not own — resources through the generic `Store`,
11
11
  accounts through the `IdentityAccountStore` port, roles through the
12
12
  `IamPolicyStore` port — and writes nothing.
13
13
 
14
- The idea, once: in the cloud, authorization is the OpenFGA model evaluated over
15
- stored tuples, and every tuple is derived from a row by
16
- `kind_meta.authorization` except the one that is a fact, the IamPolicy row. So
17
- open source evaluates the same model over the same tuples, derived from the row
18
- when a check asks instead of stored. One meaning of authorization in both
19
- editions; the cloud stores what open source computes.
14
+ The idea, once: authorization is one OpenFGA model (`../../fga/model`, compiled
15
+ into `model/data/authorization-model.json`), and every tuple it reads is derived
16
+ from a row by `kind_meta.authorization` except the one that is a fact, the
17
+ IamPolicy row. An edition that runs OpenFGA applies that model and stores the
18
+ tuples; this server evaluates the same bytes over the same tuples, derived from
19
+ the row when a check asks instead of stored. One model and one meaning of
20
+ authorization in every edition; the hosted edition stores what open source
21
+ computes.
20
22
 
21
23
  ## Parts
22
24
 
23
- - `model/rewrite.ts` — the four relation-rewrite forms the 27 `.fga` files use
24
- (`this` with its type restrictions, `computed`, `from`, `union`), the
25
- builders, and `declareKind`, which refuses a transcript that cannot be right
26
- at module load.
27
- - `model/<kind>.ts` — one transcript per open-source kind (twenty-four), the
28
- `.fga` file's relations in the file's order, its path in the header.
29
- `model/index.ts` registers them in `fga.mod` order and answers by kind or by
30
- FGA type name. Two relations no row carries as a `kind_meta` fact have a
31
- `derived` rule beside their transcript: `default_of` on the two instance kinds
32
- (`model/default-of.ts`, from the blueprint's `status.default_instance_id`) and
33
- `execution_viewer` on the workflow instance (from
34
- `spec.execution_visibility`).
25
+ - `model/rewrite.ts` — the evaluator's vocabulary: the five relation-rewrite
26
+ forms the model uses (`this` with its type restrictions, `computed`, `from`,
27
+ `union`, `intersection`, nested to any depth) and a kind's declaration.
28
+ - `model/openfga-json.ts` — the reader of the compiled model: OpenFGA's JSON as
29
+ `unknown`, turned into that vocabulary, every unknown key and every form the
30
+ evaluator does not run (`but not`, wildcards, conditions) refused by name at
31
+ module load, and what OpenFGA's validator proved re-asserted, so a hand edit
32
+ fails the boot, never an answer.
33
+ - `model/bindings.ts` — what JSON cannot carry: each type's row schema
34
+ (`ROWLESS` for `platform`, which resolves over tuples alone) and the two
35
+ relations no row carries as a `kind_meta` fact: `default_of` on the two
36
+ instance kinds (`model/default-of.ts`, from the blueprint's
37
+ `status.default_instance_id`) and `execution_viewer` on the workflow instance
38
+ (`model/execution-viewer.ts`, from `spec.execution_visibility`).
39
+ - `model/index.ts` — the built-in model: the reader joined with the bindings,
40
+ every type in `fga.mod` order, answered by kind or by FGA type name. It
41
+ declares every type, whichever edition serves it; the tier decides what an
42
+ edition evaluates (`authorizer.ts`, arm 2).
35
43
  - `tuples.ts` — the tuple vocabulary (object, relation, subject; the string
36
44
  notation), the `Person` type (the caller as the model sees them: account id
37
45
  plus the aliases a creator stamp may carry). The model declares no wildcard
@@ -61,14 +69,9 @@ editions; the cloud stores what open source computes.
61
69
  source may be seeded with candidates' facts (the list scope), so a seeded
62
70
  object's tuples derive without a read of its row; a `derived` rule still reads
63
71
  the row it needs.
64
- - `store-test-kit.ts` — runs an OpenFGA store test (`.fga.yaml`) against the
65
- evaluator, vitest-free, exported from the barrel. Open source runs it over
66
- pinned copies of the cloud's own model tests (`__tests__/fixtures/fga/`, a
67
- byte-exact mirror of the cloud's `fga/tests/`); the cloud runs it over the
68
- live files at the re-pin. What it does not run it reports in three reasons: a
69
- target kind the model does not declare, a `list_objects` assertion, and an
70
- assertion whose walk read a grant through a type the model does not declare
71
- (the cloud's platform tenancy, `identity_provider#platform_user`).
72
+ - `strict-json.ts` — the strict reads both data inputs share (the compiled
73
+ model and the store tests): an unknown key or a wrong shape is a fault naming
74
+ where, never a half-read input.
72
75
 
73
76
  - `authorizer.ts` — the `Authorizer` driver, arm for arm the cloud's
74
77
  (`stigmer-cloud src/authorizer/fga-authorizer.ts`): the four pre-check denials
@@ -103,14 +106,18 @@ editions; the cloud stores what open source computes.
103
106
  ## Proof
104
107
 
105
108
  `__tests__/store-tests.test.ts` is the proof that this evaluator answers the
106
- cloud's model the cloud's way: every `checkRelation` assertion of all twenty
107
- documents on a declared kind, in the documents' own words, with what is not run
108
- pinned as a named list. `__tests__/facts.test.ts` pins that the derivation reads
109
- a row to the same links and shapes the tuple lifecycle writes from, for every
110
- kind. `model/__tests__/registry.test.ts` pins the declared set to the
111
- open-source tier and each kind's wire permissions to its file;
112
- `__tests__/wire-permissions.test.ts` pins that every static `(kind, permission)`
113
- a served RPC asks about is a declared relation. The rest pin the machinery:
109
+ model the way OpenFGA does: it runs every suite under `../../fga/tests/` through
110
+ the store-test kit (`__tests__/store-test-kit.ts`), every `check` and every
111
+ `list_objects` assertion, nothing skipped, and the same suites run on the real
112
+ engine (`make test-authorization-model`, CI's `ci.authorization-model`).
113
+ `__tests__/facts.test.ts` pins that the derivation reads a row to the same links
114
+ and shapes the tuple lifecycle writes from, for every kind with stored rows.
115
+ `model/__tests__/registry.test.ts` pins the model to `fga.mod`, each binding to
116
+ the message `kind_meta` names, and the team grants to `team_grantable_roles`;
117
+ `model/__tests__/openfga-json.test.ts` pins every refusal of the reader;
118
+ `__tests__/wire-permissions.test.ts` pins that every question an RPC annotation
119
+ in `@stigmer/protos` asks is a relation the model defines, today's known gaps
120
+ pinned by name. The rest pin the machinery:
114
121
  alias matching, the memo, the bounds, the source and the two derived rules on
115
122
  both store drivers. The four drivers are pinned arm by arm on both store drivers
116
123
  (`__tests__/authorizer.test.ts`, `organization-directory.test.ts`,
@@ -50,11 +50,10 @@ import {
50
50
  newBuiltInAuthorizer,
51
51
  } from "../authorizer.js";
52
52
  import { builtInModel, newModel } from "../model/index.js";
53
- import type { KindDeclaration } from "../model/rewrite.js";
54
- import { computed, declareKind } from "../model/rewrite.js";
55
53
  import { driverFixtures, dropPostgresFixture } from "./drivers.js";
56
54
  import type { OpenedStore } from "./drivers.js";
57
- import { fixtureRow } from "./support.js";
55
+ import { fixtureRow, storedDeclaration } from "./support.js";
56
+ import { computed, throwawayDeclaration } from "./throwaway-model.js";
58
57
 
59
58
  const silentLogger = createLogger({
60
59
  level: "error",
@@ -104,14 +103,6 @@ function check(
104
103
  return { permission, resourceKind, resourceId };
105
104
  }
106
105
 
107
- function declared(type: string): KindDeclaration {
108
- const declaration = builtInModel.byType(type);
109
- if (declaration === undefined) {
110
- throw new Error(`${type} is declared`);
111
- }
112
- return declaration;
113
- }
114
-
115
106
  const SEEDED_KINDS: ReadonlyArray<ApiResourceKind> = [
116
107
  ApiResourceKind.iam_policy,
117
108
  ApiResourceKind.identity_account,
@@ -200,7 +191,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
200
191
  spec?: Record<string, unknown>;
201
192
  },
202
193
  ) {
203
- const declaration = declared(type);
194
+ const declaration = storedDeclaration(type);
204
195
  await opened.store.saveResource(
205
196
  declaration.kind,
206
197
  id,
@@ -649,9 +640,9 @@ describe.each(driverFixtures(SEEDED_KINDS))(
649
640
  });
650
641
 
651
642
  it("a broken model (a relation cycle) is a fault, not a lockout", async () => {
652
- const cyclic = declareKind({
643
+ const cyclic = throwawayDeclaration({
653
644
  kind: ApiResourceKind.agent,
654
- schema: declared("agent").schema,
645
+ schema: storedDeclaration("agent").schema,
655
646
  source: "test",
656
647
  relations: [
657
648
  ["a", computed("b")],
@@ -14,8 +14,8 @@
14
14
  * source, an absent object answering nothing, a store fault propagating
15
15
  * as the fault it is — the ratified store-fault mapping, which is what
16
16
  * lets the driver above fold it to `unavailable` and never to a denial.
17
- * Its grants-to-teams arm evaluates the Enterprise team type
18
- * (enterprise-model.ts): a grant to a team reaches its members and nobody
17
+ * Its grants-to-teams arm evaluates the built-in model's Enterprise team
18
+ * type: a grant to a team reaches its members and nobody
19
19
  * who left the organization, and a person in no team — every open-source
20
20
  * caller — still costs the source exactly one read.
21
21
  */
@@ -44,21 +44,12 @@ import { deriveTuples, newDerivedTupleSource } from "../derived-tuples.js";
44
44
  import { checkRelation } from "../evaluator.js";
45
45
  import { rowFactsOf } from "../facts.js";
46
46
  import { builtInModel } from "../model/index.js";
47
- import type { KindDeclaration } from "../model/rewrite.js";
48
47
  import type { Person } from "../tuples.js";
49
48
  import { formatTuple, parseObjectRef } from "../tuples.js";
50
49
  import { driverFixtures, dropPostgresFixture } from "./drivers.js";
51
50
  import type { OpenedStore } from "./drivers.js";
52
- import { enterpriseModel, teamDeclaration } from "./enterprise-model.js";
53
- import { fixtureRow } from "./support.js";
54
-
55
- function declared(type: string): KindDeclaration {
56
- const declaration = builtInModel.byType(type);
57
- if (declaration === undefined) {
58
- throw new Error(`${type} is declared in this slice`);
59
- }
60
- return declaration;
61
- }
51
+ import { fixtureRow, storedDeclaration } from "./support.js";
52
+ import type { StoredKindDeclaration } from "./support.js";
62
53
 
63
54
  function derivedFor(
64
55
  type: string,
@@ -69,7 +60,7 @@ function derivedFor(
69
60
  spec?: Readonly<Record<string, unknown>>;
70
61
  },
71
62
  ): string[] {
72
- const declaration = declared(type);
63
+ const declaration = storedDeclaration(type);
73
64
  const row = fixtureRow(declaration, {
74
65
  id: `${type}-1`,
75
66
  org: facts.org ?? "acme",
@@ -301,7 +292,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
301
292
  opened = await fixture.open();
302
293
  counted = countingPolicies(newResourceIamPolicyStore(opened.store));
303
294
  accounts = newResourceIdentityAccountStore(opened.store);
304
- const organization = declared("organization");
295
+ const organization = storedDeclaration("organization");
305
296
  await opened.store.saveResource(
306
297
  ApiResourceKind.organization,
307
298
  "acme",
@@ -313,7 +304,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
313
304
  createdBy: ROOT.accountId,
314
305
  }),
315
306
  );
316
- const agent = declared("agent");
307
+ const agent = storedDeclaration("agent");
317
308
  await opened.store.saveResource(
318
309
  ApiResourceKind.agent,
319
310
  "agt_team",
@@ -439,17 +430,28 @@ describe.each(driverFixtures(SEEDED_KINDS))(
439
430
  ).toEqual([]);
440
431
  });
441
432
 
442
- it("an absent object, or an object of a kind this edition does not declare, answers no tuples", async () => {
433
+ it("an absent object, a declared kind this edition stores no row of, a rowless kind, or a kind the model does not declare answers no tuples", async () => {
443
434
  const source = sourceFor(ROOT);
444
435
  expect(
445
436
  await source.tuplesOf(parseObjectRef("agent:agt_missing"), "owner"),
446
437
  ).toEqual([]);
438
+ // Declared, served by the wider editions: the store has no such row.
447
439
  expect(
448
440
  await source.tuplesOf(
449
441
  parseObjectRef("identity_provider:idp"),
450
442
  "owner",
451
443
  ),
452
444
  ).toEqual([]);
445
+ // Rowless: no row is loaded for it at all.
446
+ expect(
447
+ await source.tuplesOf(parseObjectRef("platform:stigmer"), "operator"),
448
+ ).toEqual([]);
449
+ expect(
450
+ await source.tuplesOf(
451
+ parseObjectRef("api_resource_version:v1"),
452
+ "owner",
453
+ ),
454
+ ).toEqual([]);
453
455
  expect(
454
456
  await source.tuplesOf(parseObjectRef("nonsense:x"), "owner"),
455
457
  ).toEqual([]);
@@ -468,7 +470,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
468
470
 
469
471
  it("a source seeded with a candidate's facts derives that object's tuples WITHOUT loading its row; the parent hop still loads", async () => {
470
472
  let rowReads = 0;
471
- const agent = declared("agent");
473
+ const agent = storedDeclaration("agent");
472
474
  const seeded = newDerivedTupleSource(
473
475
  {
474
476
  store: {
@@ -523,7 +525,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
523
525
  // carry, so the rule loads the row — one read, stated in the list
524
526
  // scope's cost pin as well.
525
527
  let rowReads = 0;
526
- const instance = declared("agent_instance");
528
+ const instance = storedDeclaration("agent_instance");
527
529
  const row = fixtureRow(instance, {
528
530
  id: "ai_seeded",
529
531
  org: "acme",
@@ -575,7 +577,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
575
577
 
576
578
  /**
577
579
  * The grants made to a person's teams, through the real source and the
578
- * evaluator over the Enterprise team type (enterprise-model.ts). Seeded:
580
+ * evaluator over the built-in model's Enterprise team type. Seeded:
579
581
  * `acme` with Dave a member and Root its owner; `tm_core` and
580
582
  * `tm_other` in `acme`; Dave and Erin granted `member` on `tm_core`,
581
583
  * Erin holding no organization role (she left); `agt_core` shared with
@@ -591,7 +593,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
591
593
  };
592
594
 
593
595
  async function seed(
594
- declaration: KindDeclaration,
596
+ declaration: StoredKindDeclaration,
595
597
  facts: Parameters<typeof fixtureRow>[1],
596
598
  ): Promise<void> {
597
599
  await opened.store.saveResource(
@@ -605,14 +607,14 @@ describe.each(driverFixtures(SEEDED_KINDS))(
605
607
  beforeEach(async () => {
606
608
  opened = await fixture.open();
607
609
  counted = countingPolicies(newResourceIamPolicyStore(opened.store));
608
- await seed(declared("organization"), {
610
+ await seed(storedDeclaration("organization"), {
609
611
  id: "acme",
610
612
  org: "",
611
613
  visibility: ApiResourceVisibility.visibility_private,
612
614
  createdBy: ROOT.accountId,
613
615
  });
614
616
  for (const id of ["tm_core", "tm_other"]) {
615
- await seed(teamDeclaration, {
617
+ await seed(storedDeclaration("team"), {
616
618
  id,
617
619
  org: "acme",
618
620
  visibility: ApiResourceVisibility.visibility_private,
@@ -623,7 +625,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
623
625
  ["agt_core", "tm_core"],
624
626
  ["agt_other", "tm_other"],
625
627
  ] as const) {
626
- await seed(declared("agent"), {
628
+ await seed(storedDeclaration("agent"), {
627
629
  id,
628
630
  org: "acme",
629
631
  visibility: ApiResourceVisibility.visibility_private,
@@ -664,7 +666,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
664
666
  store: opened.store,
665
667
  policies: counted.policies,
666
668
  accounts: newResourceIdentityAccountStore(opened.store),
667
- model: enterpriseModel,
669
+ model: builtInModel,
668
670
  },
669
671
  person,
670
672
  );
@@ -676,7 +678,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
676
678
  relation: string,
677
679
  ): Promise<boolean> {
678
680
  return checkRelation(
679
- { model: enterpriseModel, source: sourceFor(person) },
681
+ { model: builtInModel, source: sourceFor(person) },
680
682
  parseObjectRef(object),
681
683
  relation,
682
684
  person,
@@ -762,7 +764,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
762
764
  id: string,
763
765
  facts: Omit<Parameters<typeof fixtureRow>[1], "id">,
764
766
  ): Promise<void> {
765
- const declaration = declared(type);
767
+ const declaration = storedDeclaration(type);
766
768
  await opened.store.saveResource(
767
769
  declaration.kind,
768
770
  id,