@stigmer/server 3.22.1-dev.20260922095755 → 3.23.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 (330) hide show
  1. package/dist/artifactstorage/artifact-storage.d.ts +29 -31
  2. package/dist/artifactstorage/artifact-storage.d.ts.map +1 -1
  3. package/dist/artifactstorage/artifact-storage.js +5 -7
  4. package/dist/artifactstorage/artifact-storage.js.map +1 -1
  5. package/dist/artifactstorage/r2-storage.d.ts +12 -7
  6. package/dist/artifactstorage/r2-storage.d.ts.map +1 -1
  7. package/dist/artifactstorage/r2-storage.js +6 -14
  8. package/dist/artifactstorage/r2-storage.js.map +1 -1
  9. package/dist/authorization/authorizer.d.ts +8 -4
  10. package/dist/authorization/authorizer.d.ts.map +1 -1
  11. package/dist/authorization/authorizer.js +9 -5
  12. package/dist/authorization/authorizer.js.map +1 -1
  13. package/dist/authorization/derived-tuples.d.ts.map +1 -1
  14. package/dist/authorization/derived-tuples.js +25 -10
  15. package/dist/authorization/derived-tuples.js.map +1 -1
  16. package/dist/authorization/evaluator.d.ts +8 -7
  17. package/dist/authorization/evaluator.d.ts.map +1 -1
  18. package/dist/authorization/evaluator.js +20 -4
  19. package/dist/authorization/evaluator.js.map +1 -1
  20. package/dist/authorization/list-read-scope.d.ts.map +1 -1
  21. package/dist/authorization/list-read-scope.js +9 -5
  22. package/dist/authorization/list-read-scope.js.map +1 -1
  23. package/dist/authorization/model/agent.d.ts.map +1 -1
  24. package/dist/authorization/model/agent.js +5 -4
  25. package/dist/authorization/model/agent.js.map +1 -1
  26. package/dist/authorization/model/agent_instance.d.ts.map +1 -1
  27. package/dist/authorization/model/agent_instance.js +2 -2
  28. package/dist/authorization/model/agent_instance.js.map +1 -1
  29. package/dist/authorization/model/mcp_server.d.ts.map +1 -1
  30. package/dist/authorization/model/mcp_server.js +2 -2
  31. package/dist/authorization/model/mcp_server.js.map +1 -1
  32. package/dist/authorization/model/plugin.d.ts.map +1 -1
  33. package/dist/authorization/model/plugin.js +4 -3
  34. package/dist/authorization/model/plugin.js.map +1 -1
  35. package/dist/authorization/model/rewrite.d.ts +10 -8
  36. package/dist/authorization/model/rewrite.d.ts.map +1 -1
  37. package/dist/authorization/model/rewrite.js +3 -0
  38. package/dist/authorization/model/rewrite.js.map +1 -1
  39. package/dist/authorization/model/skill.d.ts.map +1 -1
  40. package/dist/authorization/model/skill.js +2 -2
  41. package/dist/authorization/model/skill.js.map +1 -1
  42. package/dist/authorization/model/workflow.d.ts.map +1 -1
  43. package/dist/authorization/model/workflow.js +2 -2
  44. package/dist/authorization/model/workflow.js.map +1 -1
  45. package/dist/authorization/model/workflow_instance.d.ts.map +1 -1
  46. package/dist/authorization/model/workflow_instance.js +2 -2
  47. package/dist/authorization/model/workflow_instance.js.map +1 -1
  48. package/dist/authorization/organization-directory.d.ts.map +1 -1
  49. package/dist/authorization/organization-directory.js +3 -2
  50. package/dist/authorization/organization-directory.js.map +1 -1
  51. package/dist/authorization/store-test-kit.d.ts +6 -0
  52. package/dist/authorization/store-test-kit.d.ts.map +1 -1
  53. package/dist/authorization/store-test-kit.js +62 -16
  54. package/dist/authorization/store-test-kit.js.map +1 -1
  55. package/dist/authorization/tuples.d.ts +32 -13
  56. package/dist/authorization/tuples.d.ts.map +1 -1
  57. package/dist/authorization/tuples.js +11 -3
  58. package/dist/authorization/tuples.js.map +1 -1
  59. package/dist/boot/compose.d.ts.map +1 -1
  60. package/dist/boot/compose.js +49 -24
  61. package/dist/boot/compose.js.map +1 -1
  62. package/dist/boot/config.d.ts +4 -3
  63. package/dist/boot/config.d.ts.map +1 -1
  64. package/dist/boot/config.js.map +1 -1
  65. package/dist/boot/skill-transfer-origin.d.ts +52 -0
  66. package/dist/boot/skill-transfer-origin.d.ts.map +1 -0
  67. package/dist/boot/skill-transfer-origin.js +54 -0
  68. package/dist/boot/skill-transfer-origin.js.map +1 -0
  69. package/dist/domain/agent/controller.d.ts.map +1 -1
  70. package/dist/domain/agent/controller.js +4 -4
  71. package/dist/domain/agent/controller.js.map +1 -1
  72. package/dist/domain/agentchannel/controller.d.ts.map +1 -1
  73. package/dist/domain/agentchannel/controller.js +1 -3
  74. package/dist/domain/agentchannel/controller.js.map +1 -1
  75. package/dist/domain/agentexecution/controller.d.ts.map +1 -1
  76. package/dist/domain/agentexecution/controller.js +1 -3
  77. package/dist/domain/agentexecution/controller.js.map +1 -1
  78. package/dist/domain/agentinstance/controller.d.ts.map +1 -1
  79. package/dist/domain/agentinstance/controller.js +4 -3
  80. package/dist/domain/agentinstance/controller.js.map +1 -1
  81. package/dist/domain/agentshare/constants.d.ts +11 -6
  82. package/dist/domain/agentshare/constants.d.ts.map +1 -1
  83. package/dist/domain/agentshare/constants.js +16 -8
  84. package/dist/domain/agentshare/constants.js.map +1 -1
  85. package/dist/domain/agentshare/controller.d.ts.map +1 -1
  86. package/dist/domain/agentshare/controller.js +1 -3
  87. package/dist/domain/agentshare/controller.js.map +1 -1
  88. package/dist/domain/agentshare/steps.d.ts +25 -18
  89. package/dist/domain/agentshare/steps.d.ts.map +1 -1
  90. package/dist/domain/agentshare/steps.js +142 -41
  91. package/dist/domain/agentshare/steps.js.map +1 -1
  92. package/dist/domain/environment/controller.d.ts.map +1 -1
  93. package/dist/domain/environment/controller.js +3 -2
  94. package/dist/domain/environment/controller.js.map +1 -1
  95. package/dist/domain/executioncontext/controller.d.ts.map +1 -1
  96. package/dist/domain/executioncontext/controller.js +1 -2
  97. package/dist/domain/executioncontext/controller.js.map +1 -1
  98. package/dist/domain/mcpserver/controller.d.ts.map +1 -1
  99. package/dist/domain/mcpserver/controller.js +4 -3
  100. package/dist/domain/mcpserver/controller.js.map +1 -1
  101. package/dist/domain/plugin/controller.d.ts +3 -7
  102. package/dist/domain/plugin/controller.d.ts.map +1 -1
  103. package/dist/domain/plugin/controller.js +11 -9
  104. package/dist/domain/plugin/controller.js.map +1 -1
  105. package/dist/domain/plugin/push.d.ts +5 -7
  106. package/dist/domain/plugin/push.d.ts.map +1 -1
  107. package/dist/domain/plugin/push.js +14 -8
  108. package/dist/domain/plugin/push.js.map +1 -1
  109. package/dist/domain/schedule/controller.d.ts.map +1 -1
  110. package/dist/domain/schedule/controller.js +1 -3
  111. package/dist/domain/schedule/controller.js.map +1 -1
  112. package/dist/domain/session/controller.d.ts.map +1 -1
  113. package/dist/domain/session/controller.js +2 -3
  114. package/dist/domain/session/controller.js.map +1 -1
  115. package/dist/domain/skill/constants.d.ts +26 -3
  116. package/dist/domain/skill/constants.d.ts.map +1 -1
  117. package/dist/domain/skill/constants.js +26 -3
  118. package/dist/domain/skill/constants.js.map +1 -1
  119. package/dist/domain/skill/controller.d.ts +6 -11
  120. package/dist/domain/skill/controller.d.ts.map +1 -1
  121. package/dist/domain/skill/controller.js +35 -22
  122. package/dist/domain/skill/controller.js.map +1 -1
  123. package/dist/domain/skill/push.d.ts +2 -2
  124. package/dist/domain/skill/push.d.ts.map +1 -1
  125. package/dist/domain/skill/push.js +2 -2
  126. package/dist/domain/skill/push.js.map +1 -1
  127. package/dist/domain/skill/transfer/handler.d.ts +17 -9
  128. package/dist/domain/skill/transfer/handler.d.ts.map +1 -1
  129. package/dist/domain/skill/transfer/handler.js +19 -8
  130. package/dist/domain/skill/transfer/handler.js.map +1 -1
  131. package/dist/domain/skill/transfer/slots.d.ts +26 -41
  132. package/dist/domain/skill/transfer/slots.d.ts.map +1 -1
  133. package/dist/domain/skill/transfer/slots.js +80 -87
  134. package/dist/domain/skill/transfer/slots.js.map +1 -1
  135. package/dist/domain/skill/transfer/staging.d.ts +48 -0
  136. package/dist/domain/skill/transfer/staging.d.ts.map +1 -0
  137. package/dist/domain/skill/transfer/staging.js +127 -0
  138. package/dist/domain/skill/transfer/staging.js.map +1 -0
  139. package/dist/domain/workflow/controller.d.ts.map +1 -1
  140. package/dist/domain/workflow/controller.js +6 -14
  141. package/dist/domain/workflow/controller.js.map +1 -1
  142. package/dist/domain/workflow/registry/data/task-kind-registry.json +1 -1
  143. package/dist/domain/workflow/validation/task-config-constraints.d.ts +1 -10
  144. package/dist/domain/workflow/validation/task-config-constraints.d.ts.map +1 -1
  145. package/dist/domain/workflow/validation/task-config-constraints.js +2 -3
  146. package/dist/domain/workflow/validation/task-config-constraints.js.map +1 -1
  147. package/dist/domain/workflowexecution/controller.d.ts.map +1 -1
  148. package/dist/domain/workflowexecution/controller.js +2 -4
  149. package/dist/domain/workflowexecution/controller.js.map +1 -1
  150. package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
  151. package/dist/domain/workflowinstance/controller.js +4 -3
  152. package/dist/domain/workflowinstance/controller.js.map +1 -1
  153. package/dist/extensions/authorization-queries.d.ts +5 -6
  154. package/dist/extensions/authorization-queries.d.ts.map +1 -1
  155. package/dist/extensions/list-read-scope.d.ts +1 -1
  156. package/dist/extensions/resource-authorization.d.ts +2 -3
  157. package/dist/extensions/resource-authorization.d.ts.map +1 -1
  158. package/dist/index.d.ts +3 -1
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +13 -0
  161. package/dist/index.js.map +1 -1
  162. package/dist/pipeline/apiresource-meta.d.ts +3 -12
  163. package/dist/pipeline/apiresource-meta.d.ts.map +1 -1
  164. package/dist/pipeline/apiresource-meta.js +10 -21
  165. package/dist/pipeline/apiresource-meta.js.map +1 -1
  166. package/dist/pipeline/steps/authorization-tuples.d.ts +3 -9
  167. package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
  168. package/dist/pipeline/steps/authorization-tuples.js +11 -9
  169. package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
  170. package/dist/pipeline/steps/references.d.ts +20 -178
  171. package/dist/pipeline/steps/references.d.ts.map +1 -1
  172. package/dist/pipeline/steps/references.js +43 -344
  173. package/dist/pipeline/steps/references.js.map +1 -1
  174. package/dist/pipeline/steps/resolve-artifact-source.d.ts +11 -8
  175. package/dist/pipeline/steps/resolve-artifact-source.d.ts.map +1 -1
  176. package/dist/pipeline/steps/resolve-artifact-source.js +8 -4
  177. package/dist/pipeline/steps/resolve-artifact-source.js.map +1 -1
  178. package/dist/pipeline/steps/visibility-gates.d.ts +27 -0
  179. package/dist/pipeline/steps/visibility-gates.d.ts.map +1 -0
  180. package/dist/pipeline/steps/visibility-gates.js +139 -0
  181. package/dist/pipeline/steps/visibility-gates.js.map +1 -0
  182. package/dist/query/search/controller.js +1 -0
  183. package/dist/query/search/controller.js.map +1 -1
  184. package/dist/query/search/criteria.d.ts +5 -1
  185. package/dist/query/search/criteria.d.ts.map +1 -1
  186. package/dist/query/search/criteria.js +13 -3
  187. package/dist/query/search/criteria.js.map +1 -1
  188. package/dist/query/search/handler.d.ts +4 -5
  189. package/dist/query/search/handler.d.ts.map +1 -1
  190. package/dist/query/search/handler.js +6 -7
  191. package/dist/query/search/handler.js.map +1 -1
  192. package/dist/query/search/query-store.d.ts.map +1 -1
  193. package/dist/query/search/query-store.js +2 -0
  194. package/dist/query/search/query-store.js.map +1 -1
  195. package/dist/store/interface.d.ts +6 -3
  196. package/dist/store/interface.d.ts.map +1 -1
  197. package/dist/store/interface.js.map +1 -1
  198. package/dist/store/postgres/migrations.d.ts +1 -3
  199. package/dist/store/postgres/migrations.d.ts.map +1 -1
  200. package/dist/store/postgres/migrations.js +1 -35
  201. package/dist/store/postgres/migrations.js.map +1 -1
  202. package/dist/store/postgres/store.d.ts.map +1 -1
  203. package/dist/store/postgres/store.js +9 -4
  204. package/dist/store/postgres/store.js.map +1 -1
  205. package/dist/store/sqlite/migrations.d.ts +1 -3
  206. package/dist/store/sqlite/migrations.d.ts.map +1 -1
  207. package/dist/store/sqlite/migrations.js +1 -36
  208. package/dist/store/sqlite/migrations.js.map +1 -1
  209. package/dist/store/sqlite/store.d.ts.map +1 -1
  210. package/dist/store/sqlite/store.js +8 -4
  211. package/dist/store/sqlite/store.js.map +1 -1
  212. package/package.json +6 -6
  213. package/src/artifactstorage/__tests__/artifact-storage.test.ts +36 -33
  214. package/src/artifactstorage/__tests__/r2-storage.test.ts +11 -13
  215. package/src/artifactstorage/artifact-storage.ts +37 -33
  216. package/src/artifactstorage/r2-storage.ts +6 -15
  217. package/src/authorization/README.md +26 -24
  218. package/src/authorization/__tests__/authorizer.test.ts +9 -10
  219. package/src/authorization/__tests__/derived-tuples.test.ts +11 -4
  220. package/src/authorization/__tests__/evaluator.test.ts +73 -14
  221. package/src/authorization/__tests__/facts.test.ts +2 -2
  222. package/src/authorization/__tests__/fixtures/fga/agent-instance-creation.fga.yaml +185 -0
  223. package/src/authorization/__tests__/fixtures/fga/blueprint-private-visibility.fga.yaml +98 -6
  224. package/src/authorization/__tests__/fixtures/fga/cross-org-share-creation.fga.yaml +98 -0
  225. package/src/authorization/__tests__/fixtures/fga/default-instance-inheritance.fga.yaml +61 -4
  226. package/src/authorization/__tests__/fixtures/fga/mcp-server-authoring.fga.yaml +143 -0
  227. package/src/authorization/__tests__/fixtures/fga/org-admin-owner-inheritance.fga.yaml +21 -1
  228. package/src/authorization/__tests__/fixtures/fga/platform-visibility.fga.yaml +25 -1
  229. package/src/authorization/__tests__/fixtures/fga/public-visibility-setter.fga.yaml +52 -0
  230. package/src/authorization/__tests__/fixtures/fga/workflow-execution-sharing.fga.yaml +3 -1
  231. package/src/authorization/__tests__/list-read-scope.test.ts +17 -18
  232. package/src/authorization/__tests__/store-tests.test.ts +8 -1
  233. package/src/authorization/__tests__/tuples.test.ts +11 -12
  234. package/src/authorization/authorizer.ts +9 -4
  235. package/src/authorization/derived-tuples.ts +31 -14
  236. package/src/authorization/evaluator.ts +44 -8
  237. package/src/authorization/list-read-scope.ts +11 -5
  238. package/src/authorization/model/agent.ts +5 -2
  239. package/src/authorization/model/agent_instance.ts +2 -0
  240. package/src/authorization/model/mcp_server.ts +2 -0
  241. package/src/authorization/model/plugin.ts +4 -1
  242. package/src/authorization/model/rewrite.ts +13 -8
  243. package/src/authorization/model/skill.ts +2 -0
  244. package/src/authorization/model/workflow.ts +2 -0
  245. package/src/authorization/model/workflow_instance.ts +2 -0
  246. package/src/authorization/organization-directory.ts +3 -1
  247. package/src/authorization/store-test-kit.ts +75 -16
  248. package/src/authorization/tuples.ts +39 -16
  249. package/src/boot/__tests__/skill-transfer-origin.test.ts +72 -0
  250. package/src/boot/compose.ts +62 -25
  251. package/src/boot/config.ts +4 -3
  252. package/src/boot/skill-transfer-origin.ts +76 -0
  253. package/src/domain/agent/__tests__/agent.test.ts +4 -11
  254. package/src/domain/agent/controller.ts +7 -7
  255. package/src/domain/agentchannel/__tests__/agentchannel.test.ts +48 -223
  256. package/src/domain/agentchannel/controller.ts +1 -6
  257. package/src/domain/agentexecution/controller.ts +1 -6
  258. package/src/domain/agentinstance/controller.ts +12 -6
  259. package/src/domain/agentshare/__tests__/agentshare.test.ts +172 -196
  260. package/src/domain/agentshare/__tests__/create-authorization.test.ts +31 -16
  261. package/src/domain/agentshare/constants.ts +26 -14
  262. package/src/domain/agentshare/controller.ts +1 -6
  263. package/src/domain/agentshare/steps.ts +194 -41
  264. package/src/domain/environment/controller.ts +8 -5
  265. package/src/domain/executioncontext/controller.ts +1 -5
  266. package/src/domain/mcpserver/__tests__/mcpserver.test.ts +28 -115
  267. package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +18 -53
  268. package/src/domain/mcpserver/controller.ts +12 -6
  269. package/src/domain/plugin/controller.ts +23 -18
  270. package/src/domain/plugin/push.ts +16 -8
  271. package/src/domain/schedule/controller.ts +1 -6
  272. package/src/domain/session/controller.ts +4 -12
  273. package/src/domain/skill/__tests__/skill.test.ts +5 -3
  274. package/src/domain/skill/__tests__/slots.test.ts +113 -60
  275. package/src/domain/skill/__tests__/staging.test.ts +304 -0
  276. package/src/domain/skill/constants.ts +28 -3
  277. package/src/domain/skill/controller.ts +51 -35
  278. package/src/domain/skill/push.ts +3 -3
  279. package/src/domain/skill/transfer/handler.ts +33 -15
  280. package/src/domain/skill/transfer/slots.ts +89 -100
  281. package/src/domain/skill/transfer/staging.ts +191 -0
  282. package/src/domain/workflow/controller.ts +10 -28
  283. package/src/domain/workflow/registry/data/task-kind-registry.json +1 -1
  284. package/src/domain/workflow/validation/task-config-constraints.ts +3 -7
  285. package/src/domain/workflowexecution/controller.ts +2 -7
  286. package/src/domain/workflowinstance/controller.ts +12 -6
  287. package/src/extensions/__tests__/built-in-authorization-composed.test.ts +19 -32
  288. package/src/extensions/__tests__/extension-composition.test.ts +4 -4
  289. package/src/extensions/__tests__/list-read-scope-composed.test.ts +6 -9
  290. package/src/extensions/authorization-queries.ts +5 -6
  291. package/src/extensions/list-read-scope.ts +1 -1
  292. package/src/extensions/resource-authorization.ts +5 -3
  293. package/src/index.ts +14 -0
  294. package/src/pipeline/apiresource-meta.ts +10 -21
  295. package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +31 -18
  296. package/src/pipeline/steps/__tests__/visibility-gates.test.ts +187 -0
  297. package/src/pipeline/steps/authorization-tuples.ts +11 -9
  298. package/src/pipeline/steps/references.ts +70 -578
  299. package/src/pipeline/steps/resolve-artifact-source.ts +20 -13
  300. package/src/pipeline/steps/visibility-gates.ts +174 -0
  301. package/src/query/search/__tests__/criteria.test.ts +4 -0
  302. package/src/query/search/__tests__/query-store.test.ts +40 -11
  303. package/src/query/search/controller.ts +1 -0
  304. package/src/query/search/criteria.ts +14 -0
  305. package/src/query/search/handler.ts +7 -6
  306. package/src/query/search/query-store.ts +2 -0
  307. package/src/store/__tests__/store-contract.ts +51 -6
  308. package/src/store/interface.ts +6 -3
  309. package/src/store/postgres/__tests__/migrations.test.ts +6 -187
  310. package/src/store/postgres/__tests__/store-contract.test.ts +2 -0
  311. package/src/store/postgres/migrations.ts +1 -48
  312. package/src/store/postgres/store.ts +11 -4
  313. package/src/store/sqlite/__tests__/migrations.test.ts +5 -191
  314. package/src/store/sqlite/migrations.ts +1 -45
  315. package/src/store/sqlite/store.ts +10 -4
  316. package/src/transport/registry/__tests__/lanes.test.ts +1 -1
  317. package/dist/domain/workflow/agent-call-references.d.ts +0 -54
  318. package/dist/domain/workflow/agent-call-references.d.ts.map +0 -1
  319. package/dist/domain/workflow/agent-call-references.js +0 -97
  320. package/dist/domain/workflow/agent-call-references.js.map +0 -1
  321. package/dist/store/public-visibility-retired.d.ts +0 -67
  322. package/dist/store/public-visibility-retired.d.ts.map +0 -1
  323. package/dist/store/public-visibility-retired.js +0 -55
  324. package/dist/store/public-visibility-retired.js.map +0 -1
  325. package/src/domain/workflow/__tests__/agent-call-references.test.ts +0 -222
  326. package/src/domain/workflow/agent-call-references.ts +0 -157
  327. package/src/pipeline/__tests__/supports-visibility.test.ts +0 -112
  328. package/src/pipeline/steps/__tests__/references.test.ts +0 -703
  329. package/src/store/__tests__/public-visibility-retired.test.ts +0 -127
  330. package/src/store/public-visibility-retired.ts +0 -119
@@ -1,5 +1,5 @@
1
1
  # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/default-instance-inheritance.fga.yaml
2
- # as changed by stigmer-cloud#765 (the OpenFGA store test the cloud runs against its live model).
2
+ # at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
3
3
  # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
4
  # file against this evaluator at the re-pin, so a stale copy is caught there.
5
5
  # Store tests for default-instance structural inheritance (default_of).
@@ -7,8 +7,8 @@
7
7
  # A blueprint's system-managed default instance carries a single
8
8
  # instance#default_of@<blueprint>:<id>
9
9
  # tuple and inherits the blueprint's ENTIRE viewer set through
10
- # `viewer from default_of` — org members and platform users
11
- # (identity_provider#platform_user). No enum-derived
10
+ # `viewer from default_of` — org members, public users (allow_public), and
11
+ # platform users (identity_provider#platform_user). No enum-derived
12
12
  # visibility tuples are ever written on default instances, so their access
13
13
  # can never drift from the template's.
14
14
  #
@@ -20,7 +20,8 @@
20
20
  # visibility level; each has a default instance linked via default_of.
21
21
  # Alice (acme member) reaches default instances of platform-shared
22
22
  # blueprints; planton members reach default instances of org-visible ones;
23
- # personal instances never leak.
23
+ # everyone reaches default instances of public ones; personal instances
24
+ # never leak.
24
25
  name: default-instance-inheritance
25
26
  model_file: ../model/fga.mod
26
27
 
@@ -114,6 +115,35 @@ tuples:
114
115
  relation: default_of
115
116
  object: agent_instance:internal-default
116
117
 
118
+ # --- Public agent + its default instance ---
119
+ # PUBLIC carries the org floor tuple too (viewer@org#viewer).
120
+ - user: organization:planton
121
+ relation: organization
122
+ object: agent:public-bot
123
+ - user: identity_account:swarup
124
+ relation: owner
125
+ object: agent:public-bot
126
+ - user: identity_account:*
127
+ relation: viewer
128
+ object: agent:public-bot
129
+ condition:
130
+ name: allow_public
131
+ - user: organization:planton#viewer
132
+ relation: viewer
133
+ object: agent:public-bot
134
+ - user: organization:planton
135
+ relation: organization
136
+ object: agent_instance:public-bot-default
137
+ - user: agent:public-bot
138
+ relation: agent
139
+ object: agent_instance:public-bot-default
140
+ - user: identity_account:swarup
141
+ relation: owner
142
+ object: agent_instance:public-bot-default
143
+ - user: agent:public-bot
144
+ relation: default_of
145
+ object: agent_instance:public-bot-default
146
+
117
147
  # --- Platform-shared workflow + its default instance ---
118
148
  - user: organization:planton
119
149
  relation: organization
@@ -145,6 +175,8 @@ tests:
145
175
  check:
146
176
  - user: identity_account:alice
147
177
  object: agent_instance:sara-default
178
+ context:
179
+ allow: false
148
180
  assertions:
149
181
  can_view: true
150
182
  can_execute: true
@@ -155,6 +187,8 @@ tests:
155
187
  check:
156
188
  - user: identity_account:mallory
157
189
  object: agent_instance:sara-default
190
+ context:
191
+ allow: false
158
192
  assertions:
159
193
  can_view: false
160
194
  can_execute: false
@@ -165,10 +199,14 @@ tests:
165
199
  # default_of tuple — only she (its owner) can reach it.
166
200
  - user: identity_account:swarup
167
201
  object: agent_instance:alice-personal
202
+ context:
203
+ allow: false
168
204
  assertions:
169
205
  can_view: false
170
206
  - user: identity_account:alice
171
207
  object: agent_instance:alice-personal
208
+ context:
209
+ allow: false
172
210
  assertions:
173
211
  can_view: true
174
212
  can_edit: true
@@ -177,6 +215,8 @@ tests:
177
215
  check:
178
216
  - user: identity_account:priya
179
217
  object: agent_instance:internal-default
218
+ context:
219
+ allow: false
180
220
  assertions:
181
221
  can_view: true
182
222
  can_execute: true
@@ -186,19 +226,34 @@ tests:
186
226
  # read audience, and the default instance inherits it structurally.
187
227
  - user: identity_account:veda
188
228
  object: agent_instance:internal-default
229
+ context:
230
+ allow: false
189
231
  assertions:
190
232
  can_view: true
191
233
  can_edit: false
192
234
  # Managed-org membership grants nothing on non-platform-shared agents.
193
235
  - user: identity_account:alice
194
236
  object: agent_instance:internal-default
237
+ context:
238
+ allow: false
195
239
  assertions:
196
240
  can_view: false
197
241
 
242
+ - name: everyone reaches the default instance of a public agent
243
+ check:
244
+ - user: identity_account:mallory
245
+ object: agent_instance:public-bot-default
246
+ context:
247
+ allow: true
248
+ assertions:
249
+ can_view: true
250
+
198
251
  - name: managed-org member reaches the default instance of a platform-shared workflow
199
252
  check:
200
253
  - user: identity_account:alice
201
254
  object: workflow_instance:onboarding-default
255
+ context:
256
+ allow: false
202
257
  assertions:
203
258
  can_view: true
204
259
  can_execute: true
@@ -208,6 +263,8 @@ tests:
208
263
  list_objects:
209
264
  - user: identity_account:alice
210
265
  type: agent_instance
266
+ context:
267
+ allow: false
211
268
  assertions:
212
269
  can_view:
213
270
  - agent_instance:sara-default
@@ -0,0 +1,143 @@
1
+ # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/mcp-server-authoring.fga.yaml
2
+ # at commit 4c03c38d2 (the OpenFGA store test the cloud runs against its live model).
3
+ # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
+ # file against this evaluator at the re-pin, so a stale copy is caught there.
5
+ # Store tests for MCP-server authoring: an MCP server is an organization's
6
+ # blueprint, so creating one takes the organization's admin bar
7
+ # (can_create_mcp_server: admin), the bar agents, workflows and skills
8
+ # already take. Until stigmer#1209 (v3.22.0) the create ran no check in
9
+ # either edition and any member could author one; these pin the bar and
10
+ # the story it leaves for members: an admin authors the server org-visible
11
+ # and a member connects it (can_connect) with their own credentials, while
12
+ # a private server stays the owner's and the admins'.
13
+ #
14
+ # Run: fga model test --tests mcp-server-authoring.fga.yaml
15
+
16
+ name: mcp-server-authoring
17
+ model_file: ../model/fga.mod
18
+
19
+ tuples:
20
+ # Org acme: olivia owns it, oscar administers, dave is a plain member,
21
+ # vera a read-only viewer; mallory belongs to an unrelated org.
22
+ - user: identity_account:olivia
23
+ relation: owner
24
+ object: organization:acme
25
+ - user: identity_account:oscar
26
+ relation: admin
27
+ object: organization:acme
28
+ - user: identity_account:dave
29
+ relation: member
30
+ object: organization:acme
31
+ - user: identity_account:vera
32
+ relation: viewer
33
+ object: organization:acme
34
+ - user: identity_account:mallory
35
+ relation: member
36
+ object: organization:other
37
+
38
+ # An ORG-visible server oscar authored (the org viewer tuple the
39
+ # visibility writer emits).
40
+ - user: organization:acme
41
+ relation: organization
42
+ object: mcp_server:github
43
+ - user: identity_account:oscar
44
+ relation: owner
45
+ object: mcp_server:github
46
+ - user: organization:acme#viewer
47
+ relation: viewer
48
+ object: mcp_server:github
49
+
50
+ # A PRIVATE server oscar authored (no visibility tuple).
51
+ - user: organization:acme
52
+ relation: organization
53
+ object: mcp_server:vault
54
+ - user: identity_account:oscar
55
+ relation: owner
56
+ object: mcp_server:vault
57
+
58
+ tests:
59
+ - name: authoring an MCP server is an admin act, the blueprint bar
60
+ check:
61
+ - user: identity_account:olivia
62
+ object: organization:acme
63
+ assertions:
64
+ can_create_mcp_server: true
65
+ can_create_agent: true
66
+ - user: identity_account:oscar
67
+ object: organization:acme
68
+ assertions:
69
+ can_create_mcp_server: true
70
+ can_create_agent: true
71
+
72
+ - name: a member, a viewer and an outsider cannot author one
73
+ check:
74
+ - user: identity_account:dave
75
+ object: organization:acme
76
+ assertions:
77
+ can_create_mcp_server: false
78
+ - user: identity_account:vera
79
+ object: organization:acme
80
+ assertions:
81
+ can_create_mcp_server: false
82
+ - user: identity_account:mallory
83
+ object: organization:acme
84
+ assertions:
85
+ can_create_mcp_server: false
86
+
87
+ - name: a member connects an admin-authored org-visible server with their own credentials
88
+ check:
89
+ - user: identity_account:dave
90
+ object: mcp_server:github
91
+ context:
92
+ allow: false
93
+ assertions:
94
+ can_view: true
95
+ can_connect: true
96
+ can_edit: false
97
+ - user: identity_account:vera
98
+ object: mcp_server:github
99
+ context:
100
+ allow: false
101
+ assertions:
102
+ can_view: true
103
+ can_connect: true
104
+ can_edit: false
105
+ - user: identity_account:mallory
106
+ object: mcp_server:github
107
+ context:
108
+ allow: false
109
+ assertions:
110
+ can_view: false
111
+ can_connect: false
112
+
113
+ - name: a private server stays with its author and the org admins
114
+ check:
115
+ - user: identity_account:oscar
116
+ object: mcp_server:vault
117
+ context:
118
+ allow: false
119
+ assertions:
120
+ can_view: true
121
+ can_connect: true
122
+ can_edit: true
123
+ - user: identity_account:olivia
124
+ object: mcp_server:vault
125
+ context:
126
+ allow: false
127
+ assertions:
128
+ can_view: true
129
+ can_edit: true
130
+ - user: identity_account:dave
131
+ object: mcp_server:vault
132
+ context:
133
+ allow: false
134
+ assertions:
135
+ can_view: false
136
+ can_connect: false
137
+ - user: identity_account:vera
138
+ object: mcp_server:vault
139
+ context:
140
+ allow: false
141
+ assertions:
142
+ can_view: false
143
+ can_connect: false
@@ -1,5 +1,5 @@
1
1
  # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/org-admin-owner-inheritance.fga.yaml
2
- # as changed by stigmer-cloud#765 (the OpenFGA store test the cloud runs against its live model).
2
+ # as changed by stigmer-cloud#757 (the OpenFGA store test the cloud runs against its live model).
3
3
  # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
4
  # file against this evaluator at the re-pin, so a stale copy is caught there.
5
5
  # Store tests for org-admin owner inheritance (T08).
@@ -131,6 +131,8 @@ tests:
131
131
  check:
132
132
  - user: identity_account:ana
133
133
  object: agent:carols-bot
134
+ context:
135
+ allow: false
134
136
  assertions:
135
137
  can_view: true
136
138
  can_edit: true
@@ -167,6 +169,8 @@ tests:
167
169
  can_grant_access: true
168
170
  - user: identity_account:ana
169
171
  object: skill:carols-notes
172
+ context:
173
+ allow: false
170
174
  assertions:
171
175
  can_view: true
172
176
  can_edit: true
@@ -174,6 +178,8 @@ tests:
174
178
  can_grant_access: true
175
179
  - user: identity_account:ana
176
180
  object: workflow:carols-flow
181
+ context:
182
+ allow: false
177
183
  assertions:
178
184
  can_view: true
179
185
  can_edit: true
@@ -191,6 +197,8 @@ tests:
191
197
  check:
192
198
  - user: identity_account:root
193
199
  object: agent:carols-bot
200
+ context:
201
+ allow: false
194
202
  assertions:
195
203
  can_edit: true
196
204
  can_delete: true
@@ -210,6 +218,8 @@ tests:
210
218
  check:
211
219
  - user: identity_account:dave
212
220
  object: agent:carols-bot
221
+ context:
222
+ allow: false
213
223
  assertions:
214
224
  can_view: false
215
225
  can_edit: false
@@ -240,6 +250,8 @@ tests:
240
250
  check:
241
251
  - user: identity_account:zara
242
252
  object: agent:carols-bot
253
+ context:
254
+ allow: false
243
255
  assertions:
244
256
  can_view: false
245
257
  can_edit: false
@@ -254,6 +266,8 @@ tests:
254
266
  check:
255
267
  - user: identity_account:ana
256
268
  object: agent_instance:carols-instance
269
+ context:
270
+ allow: false
257
271
  assertions:
258
272
  can_view: false
259
273
  can_edit: false
@@ -283,6 +297,8 @@ tests:
283
297
  check:
284
298
  - user: identity_account:carol
285
299
  object: agent:carols-bot
300
+ context:
301
+ allow: false
286
302
  assertions:
287
303
  can_view: true
288
304
  can_edit: true
@@ -293,6 +309,8 @@ tests:
293
309
  list_objects:
294
310
  - user: identity_account:ana
295
311
  type: agent
312
+ context:
313
+ allow: false
296
314
  assertions:
297
315
  can_view:
298
316
  - agent:carols-bot
@@ -300,6 +318,8 @@ tests:
300
318
  - agent:carols-bot
301
319
  - user: identity_account:ana
302
320
  type: agent_instance
321
+ context:
322
+ allow: false
303
323
  assertions:
304
324
  can_view: []
305
325
  - user: identity_account:ana
@@ -1,5 +1,5 @@
1
1
  # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/platform-visibility.fga.yaml
2
- # as changed by stigmer-cloud#765 (the OpenFGA store test the cloud runs against its live model).
2
+ # at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
3
3
  # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
4
  # file against this evaluator at the re-pin, so a stale copy is caught there.
5
5
  # Store tests for platform visibility (visibility_platform).
@@ -102,6 +102,8 @@ tests:
102
102
  check:
103
103
  - user: identity_account:alice
104
104
  object: agent:sara
105
+ context:
106
+ allow: false
105
107
  assertions:
106
108
  can_view: true
107
109
  can_execute: true
@@ -110,6 +112,8 @@ tests:
110
112
  can_delete: false
111
113
  - user: identity_account:bob
112
114
  object: agent:sara
115
+ context:
116
+ allow: false
113
117
  assertions:
114
118
  can_view: true
115
119
  can_execute: true
@@ -118,6 +122,8 @@ tests:
118
122
  check:
119
123
  - user: identity_account:mallory
120
124
  object: agent:sara
125
+ context:
126
+ allow: false
121
127
  assertions:
122
128
  can_view: false
123
129
  can_execute: false
@@ -127,6 +133,8 @@ tests:
127
133
  check:
128
134
  - user: identity_account:priya
129
135
  object: agent:sara
136
+ context:
137
+ allow: false
130
138
  assertions:
131
139
  can_view: true
132
140
  can_execute: true
@@ -136,6 +144,8 @@ tests:
136
144
  # narrower: platform_user resolves member-from-managed_org.)
137
145
  - user: identity_account:veda
138
146
  object: agent:sara
147
+ context:
148
+ allow: false
139
149
  assertions:
140
150
  can_view: true
141
151
  can_edit: false
@@ -144,6 +154,8 @@ tests:
144
154
  check:
145
155
  - user: identity_account:alice
146
156
  object: agent:internal-bot
157
+ context:
158
+ allow: false
147
159
  assertions:
148
160
  can_view: false
149
161
  can_execute: false
@@ -151,6 +163,8 @@ tests:
151
163
  # without an explicit visibility tuple.
152
164
  - user: identity_account:priya
153
165
  object: agent:internal-bot
166
+ context:
167
+ allow: false
154
168
  assertions:
155
169
  can_view: false
156
170
  can_execute: false
@@ -159,6 +173,8 @@ tests:
159
173
  check:
160
174
  - user: identity_account:alice
161
175
  object: skill:research
176
+ context:
177
+ allow: false
162
178
  assertions:
163
179
  can_view: true
164
180
  can_use: true
@@ -168,6 +184,8 @@ tests:
168
184
  check:
169
185
  - user: identity_account:alice
170
186
  object: workflow:onboarding
187
+ context:
188
+ allow: false
171
189
  assertions:
172
190
  can_view: true
173
191
  can_execute: true
@@ -176,6 +194,8 @@ tests:
176
194
  check:
177
195
  - user: identity_account:alice
178
196
  object: mcp_server:github
197
+ context:
198
+ allow: false
179
199
  assertions:
180
200
  can_view: true
181
201
  can_use: true
@@ -185,6 +205,8 @@ tests:
185
205
  check:
186
206
  - user: identity_account:swarup
187
207
  object: agent:sara
208
+ context:
209
+ allow: false
188
210
  assertions:
189
211
  can_view: true
190
212
  can_edit: true
@@ -194,6 +216,8 @@ tests:
194
216
  list_objects:
195
217
  - user: identity_account:alice
196
218
  type: agent
219
+ context:
220
+ allow: false
197
221
  assertions:
198
222
  can_view:
199
223
  - agent:sara
@@ -0,0 +1,52 @@
1
+ # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/public-visibility-setter.fga.yaml
2
+ # at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
3
+ # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
+ # file against this evaluator at the re-pin, so a stale copy is caught there.
5
+ # Store tests for the public-visibility permission (marketplace curation).
6
+ #
7
+ # can_set_public_visibility gates who may set a resource's visibility to
8
+ # PUBLIC — the only level that crosses every org boundary. It derives
9
+ # from the platform operator role: operators (human curators and the
10
+ # seeding machine account) hold it; ordinary tenants — even org owners,
11
+ # who can otherwise fully manage their resources — never do. Enforced by
12
+ # PublicVisibilityEscalationPolicy at both write doors (updateVisibility
13
+ # escalation and create-with-public).
14
+ #
15
+ # Run with:
16
+ # fga model test --tests public-visibility-setter.fga.yaml
17
+ name: public-visibility-setter
18
+ model_file: ../model/fga.mod
19
+
20
+ tuples:
21
+ # The bootstrap machine account is the platform operator
22
+ # (BootstrapIdentitySeeder re-asserts this tuple on every boot).
23
+ - user: identity_account:machine
24
+ relation: operator
25
+ object: platform:stigmer
26
+
27
+ # A human operator granted the same platform role.
28
+ - user: identity_account:opal
29
+ relation: operator
30
+ object: platform:stigmer
31
+
32
+ # A tenant org owner — owns everything in their org, nothing on the
33
+ # platform.
34
+ - user: identity_account:mallory
35
+ relation: owner
36
+ object: organization:acme
37
+
38
+ tests:
39
+ - name: operators may set public visibility, tenants may not
40
+ check:
41
+ - user: identity_account:machine
42
+ object: platform:stigmer
43
+ assertions:
44
+ can_set_public_visibility: true
45
+ - user: identity_account:opal
46
+ object: platform:stigmer
47
+ assertions:
48
+ can_set_public_visibility: true
49
+ - user: identity_account:mallory
50
+ object: platform:stigmer
51
+ assertions:
52
+ can_set_public_visibility: false
@@ -1,5 +1,5 @@
1
1
  # Pinned copy of stigmer-cloud backend/services/stigmer-server/fga/tests/workflow-execution-sharing.fga.yaml
2
- # as changed by stigmer-cloud#765 (the OpenFGA store test the cloud runs against its live model).
2
+ # at commit b87dd1170 (the OpenFGA store test the cloud runs against its live model).
3
3
  # The body below is byte-identical to the source; the cloud re-runs the LIVE
4
4
  # file against this evaluator at the re-pin, so a stale copy is caught there.
5
5
  # Store tests for workflow_execution sharing and run observability.
@@ -173,6 +173,8 @@ tests:
173
173
  # never alice's run history.
174
174
  - user: identity_account:vera
175
175
  object: workflow_instance:inst1
176
+ context:
177
+ allow: false
176
178
  assertions:
177
179
  can_view: true
178
180
  - user: identity_account:vera
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Pins the built-in list read scope on both store drivers as the twin of
3
3
  * the cloud's driver (stigmer-cloud iam/list-read-scope.ts): every
4
- * candidate a list lane offers is answered by `can_view` through the same
5
- * evaluator the Authorizer uses, over tuples derived from the facts the
6
- * candidate carries — no candidate row is read twice.
4
+ * candidate a list lane offers is answered by `can_view` under the
5
+ * LISTING context (`allow: false`, the public wildcard suppressed) through
6
+ * the same evaluator the Authorizer uses, over tuples derived from the
7
+ * facts the candidate carries — no candidate row is read twice.
7
8
  *
8
9
  * The adversarial cells come first, because until slice 5's sibling
9
10
  * cells this file and the composed proof are the only proof that a
10
- * member's list is a member's list: the outsider sees nothing (a row
11
- * still carrying the retired public level included); the viewer rung sees
12
- * the org-visible blueprints
11
+ * member's list is a member's list: the outsider sees nothing (a legacy
12
+ * PUBLIC row included); the viewer rung sees the org-visible blueprints
13
13
  * and nothing personal; the founder — an admin — sees the organization's
14
14
  * blueprints and NOT its members' sessions, keys, environments or
15
15
  * memories (the model's own line, now list-visible); an execution is its session's and
@@ -280,10 +280,9 @@ describe.each(driverFixtures(SEEDED_KINDS))(
280
280
  await grant(orgRole(VIEWER, "viewer", ORG));
281
281
 
282
282
  // Blueprints: the founder's private and org-visible agents, a
283
- // member's private one, one still carrying the retired public
284
- // level (a row the store migration has not met, which derives no
285
- // viewer grant and so reads as its owner's alone), and one
286
- // stamped by the 3.14 verifiers' raw subject.
283
+ // member's private one, a legacy PUBLIC one (nobody can set public
284
+ // under the built-in posture; a row from before it can carry it),
285
+ // and one stamped by the 3.14 verifiers' raw subject.
287
286
  await save("agent", {
288
287
  id: "agt_private",
289
288
  org: ORG,
@@ -428,7 +427,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
428
427
  });
429
428
 
430
429
  describe("the adversarial cells", () => {
431
- it("an OUTSIDER lists nothing of the organization's — a row still carrying the retired public level included", async () => {
430
+ it("an OUTSIDER lists nothing of the organization's — not even the legacy PUBLIC blueprint, which the listing context suppresses", async () => {
432
431
  for (const kind of SEEDED_KINDS.filter(
433
432
  (k) =>
434
433
  k !== ApiResourceKind.iam_policy &&
@@ -442,13 +441,13 @@ describe.each(driverFixtures(SEEDED_KINDS))(
442
441
  }
443
442
  });
444
443
 
445
- it("a VIEWER lists the org-visible blueprint and nothing private; a MEMBER adds their own private one; the retired level grants neither anything", async () => {
444
+ it("a VIEWER lists the org-visible and the public blueprints and nothing private; a MEMBER adds their own private one", async () => {
446
445
  expect(
447
446
  await listAs(resolved(VIEWER), ApiResourceKind.agent),
448
- ).toEqual(["agt_org"]);
447
+ ).toEqual(["agt_org", "agt_public"]);
449
448
  expect(
450
449
  await listAs(resolved(MEMBER), ApiResourceKind.agent),
451
- ).toEqual(["agt_org", "agt_member_private"]);
450
+ ).toEqual(["agt_org", "agt_member_private", "agt_public"]);
452
451
  });
453
452
 
454
453
  it("the FOUNDER and the ADMIN list every blueprint (`owner: … or admin from organization`), including a member's private one", async () => {
@@ -543,7 +542,7 @@ describe.each(driverFixtures(SEEDED_KINDS))(
543
542
  const offered = [
544
543
  entryOf(
545
544
  ApiResourceKind.agent,
546
- rows.get(ApiResourceKind.agent)!.get("agt_member_private")!,
545
+ rows.get(ApiResourceKind.agent)!.get("agt_public")!,
547
546
  ),
548
547
  entryOf(
549
548
  ApiResourceKind.agent,
@@ -563,15 +562,15 @@ describe.each(driverFixtures(SEEDED_KINDS))(
563
562
  ApiResourceKind.agent,
564
563
  offered,
565
564
  );
566
- expect([...kept]).toEqual(["agt_member_private", "agt_org"]);
565
+ expect([...kept]).toEqual(["agt_public", "agt_org"]);
567
566
  // The lane's order is the lane's: the helper filters its own
568
567
  // array by the kept set.
569
568
  expect(
570
569
  await listAs(resolved(MEMBER), ApiResourceKind.agent, [
571
- rows.get(ApiResourceKind.agent)!.get("agt_member_private")!,
570
+ rows.get(ApiResourceKind.agent)!.get("agt_public")!,
572
571
  rows.get(ApiResourceKind.agent)!.get("agt_org")!,
573
572
  ]),
574
- ).toEqual(["agt_member_private", "agt_org"]);
573
+ ).toEqual(["agt_public", "agt_org"]);
575
574
  });
576
575
 
577
576
  it("no candidates: the empty set, with no read of any kind", async () => {