@stigmer/server 3.40.1 → 3.41.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 (527) hide show
  1. package/dist/authorization/authorizer.d.ts +16 -10
  2. package/dist/authorization/authorizer.d.ts.map +1 -1
  3. package/dist/authorization/authorizer.js +17 -9
  4. package/dist/authorization/authorizer.js.map +1 -1
  5. package/dist/authorization/derived-tuples.d.ts +7 -3
  6. package/dist/authorization/derived-tuples.d.ts.map +1 -1
  7. package/dist/authorization/derived-tuples.js +62 -6
  8. package/dist/authorization/derived-tuples.js.map +1 -1
  9. package/dist/authorization/evaluator.d.ts +11 -7
  10. package/dist/authorization/evaluator.d.ts.map +1 -1
  11. package/dist/authorization/evaluator.js +16 -10
  12. package/dist/authorization/evaluator.js.map +1 -1
  13. package/dist/authorization/list-read-scope.d.ts +4 -0
  14. package/dist/authorization/list-read-scope.d.ts.map +1 -1
  15. package/dist/authorization/list-read-scope.js +1 -0
  16. package/dist/authorization/list-read-scope.js.map +1 -1
  17. package/dist/authorization/model/data/authorization-model.json +830 -67
  18. package/dist/authorization/model/execution-viewer.d.ts.map +1 -1
  19. package/dist/authorization/model/execution-viewer.js +26 -24
  20. package/dist/authorization/model/execution-viewer.js.map +1 -1
  21. package/dist/authorization/model/index.d.ts +4 -1
  22. package/dist/authorization/model/index.d.ts.map +1 -1
  23. package/dist/authorization/model/index.js +4 -1
  24. package/dist/authorization/model/index.js.map +1 -1
  25. package/dist/authorization/model/rewrite.d.ts +5 -3
  26. package/dist/authorization/model/rewrite.d.ts.map +1 -1
  27. package/dist/authorization/organization-directory.d.ts +44 -0
  28. package/dist/authorization/organization-directory.d.ts.map +1 -1
  29. package/dist/authorization/organization-directory.js +1 -0
  30. package/dist/authorization/organization-directory.js.map +1 -1
  31. package/dist/authorization/person.d.ts +14 -1
  32. package/dist/authorization/person.d.ts.map +1 -1
  33. package/dist/authorization/person.js +16 -0
  34. package/dist/authorization/person.js.map +1 -1
  35. package/dist/authorization/policy-check.d.ts +52 -0
  36. package/dist/authorization/policy-check.d.ts.map +1 -0
  37. package/dist/authorization/policy-check.js +35 -0
  38. package/dist/authorization/policy-check.js.map +1 -0
  39. package/dist/authorization/posture.d.ts +30 -4
  40. package/dist/authorization/posture.d.ts.map +1 -1
  41. package/dist/authorization/posture.js +58 -0
  42. package/dist/authorization/posture.js.map +1 -1
  43. package/dist/authorization/resource-creators.d.ts +4 -0
  44. package/dist/authorization/resource-creators.d.ts.map +1 -0
  45. package/dist/authorization/resource-creators.js +44 -0
  46. package/dist/authorization/resource-creators.js.map +1 -0
  47. package/dist/authorization/trusted-local-authorizer.d.ts +9 -0
  48. package/dist/authorization/trusted-local-authorizer.d.ts.map +1 -0
  49. package/dist/authorization/trusted-local-authorizer.js +70 -0
  50. package/dist/authorization/trusted-local-authorizer.js.map +1 -0
  51. package/dist/authorization/tuples.d.ts +12 -0
  52. package/dist/authorization/tuples.d.ts.map +1 -1
  53. package/dist/authorization/tuples.js +3 -0
  54. package/dist/authorization/tuples.js.map +1 -1
  55. package/dist/boot/compose.d.ts.map +1 -1
  56. package/dist/boot/compose.js +132 -43
  57. package/dist/boot/compose.js.map +1 -1
  58. package/dist/boot/config.d.ts +22 -7
  59. package/dist/boot/config.d.ts.map +1 -1
  60. package/dist/boot/config.js +2 -1
  61. package/dist/boot/config.js.map +1 -1
  62. package/dist/boot/inprocess.d.ts.map +1 -1
  63. package/dist/boot/inprocess.js +10 -4
  64. package/dist/boot/inprocess.js.map +1 -1
  65. package/dist/boot/list-indexes.d.ts.map +1 -1
  66. package/dist/boot/list-indexes.js +6 -1
  67. package/dist/boot/list-indexes.js.map +1 -1
  68. package/dist/boot/logger.d.ts +3 -1
  69. package/dist/boot/logger.d.ts.map +1 -1
  70. package/dist/boot/logger.js +3 -1
  71. package/dist/boot/logger.js.map +1 -1
  72. package/dist/boot/oauth-redirect-uri.d.ts +33 -12
  73. package/dist/boot/oauth-redirect-uri.d.ts.map +1 -1
  74. package/dist/boot/oauth-redirect-uri.js +43 -14
  75. package/dist/boot/oauth-redirect-uri.js.map +1 -1
  76. package/dist/boot/skill-transfer-origin.d.ts +46 -14
  77. package/dist/boot/skill-transfer-origin.d.ts.map +1 -1
  78. package/dist/boot/skill-transfer-origin.js +53 -13
  79. package/dist/boot/skill-transfer-origin.js.map +1 -1
  80. package/dist/domain/agentchannel/steps.d.ts +8 -6
  81. package/dist/domain/agentchannel/steps.d.ts.map +1 -1
  82. package/dist/domain/agentchannel/steps.js +9 -7
  83. package/dist/domain/agentchannel/steps.js.map +1 -1
  84. package/dist/domain/agentexecution/controller.d.ts +7 -0
  85. package/dist/domain/agentexecution/controller.d.ts.map +1 -1
  86. package/dist/domain/agentexecution/controller.js +1 -1
  87. package/dist/domain/agentexecution/controller.js.map +1 -1
  88. package/dist/domain/agentexecution/create-steps.d.ts +26 -12
  89. package/dist/domain/agentexecution/create-steps.d.ts.map +1 -1
  90. package/dist/domain/agentexecution/create-steps.js +61 -43
  91. package/dist/domain/agentexecution/create-steps.js.map +1 -1
  92. package/dist/domain/agentexecution/submit-approval.d.ts.map +1 -1
  93. package/dist/domain/agentexecution/submit-approval.js +9 -6
  94. package/dist/domain/agentexecution/submit-approval.js.map +1 -1
  95. package/dist/domain/agentexecution/submit-file-decision.d.ts.map +1 -1
  96. package/dist/domain/agentexecution/submit-file-decision.js +5 -4
  97. package/dist/domain/agentexecution/submit-file-decision.js.map +1 -1
  98. package/dist/domain/agentshare/steps.d.ts +5 -3
  99. package/dist/domain/agentshare/steps.d.ts.map +1 -1
  100. package/dist/domain/agentshare/steps.js +6 -4
  101. package/dist/domain/agentshare/steps.js.map +1 -1
  102. package/dist/domain/apikey/verifier.d.ts +7 -0
  103. package/dist/domain/apikey/verifier.d.ts.map +1 -1
  104. package/dist/domain/apikey/verifier.js +34 -1
  105. package/dist/domain/apikey/verifier.js.map +1 -1
  106. package/dist/domain/channelapp/controller.d.ts +4 -3
  107. package/dist/domain/channelapp/controller.d.ts.map +1 -1
  108. package/dist/domain/channelapp/controller.js.map +1 -1
  109. package/dist/domain/executioncontext/steps.d.ts +2 -1
  110. package/dist/domain/executioncontext/steps.d.ts.map +1 -1
  111. package/dist/domain/executioncontext/steps.js +2 -1
  112. package/dist/domain/executioncontext/steps.js.map +1 -1
  113. package/dist/domain/iampolicy/access-lists.d.ts.map +1 -1
  114. package/dist/domain/iampolicy/access-lists.js +57 -2
  115. package/dist/domain/iampolicy/access-lists.js.map +1 -1
  116. package/dist/domain/iampolicy/change.d.ts +53 -0
  117. package/dist/domain/iampolicy/change.d.ts.map +1 -0
  118. package/dist/domain/iampolicy/change.js +44 -0
  119. package/dist/domain/iampolicy/change.js.map +1 -0
  120. package/dist/domain/iampolicy/constants.d.ts +6 -0
  121. package/dist/domain/iampolicy/constants.d.ts.map +1 -1
  122. package/dist/domain/iampolicy/constants.js +6 -0
  123. package/dist/domain/iampolicy/constants.js.map +1 -1
  124. package/dist/domain/iampolicy/controller.d.ts.map +1 -1
  125. package/dist/domain/iampolicy/controller.js +9 -5
  126. package/dist/domain/iampolicy/controller.js.map +1 -1
  127. package/dist/domain/iampolicy/grant-path.d.ts +31 -13
  128. package/dist/domain/iampolicy/grant-path.d.ts.map +1 -1
  129. package/dist/domain/iampolicy/grant-path.js +216 -19
  130. package/dist/domain/iampolicy/grant-path.js.map +1 -1
  131. package/dist/domain/iampolicy/membership.d.ts +11 -3
  132. package/dist/domain/iampolicy/membership.d.ts.map +1 -1
  133. package/dist/domain/iampolicy/membership.js +18 -13
  134. package/dist/domain/iampolicy/membership.js.map +1 -1
  135. package/dist/domain/iampolicy/resource-store.d.ts.map +1 -1
  136. package/dist/domain/iampolicy/resource-store.js +4 -0
  137. package/dist/domain/iampolicy/resource-store.js.map +1 -1
  138. package/dist/domain/iampolicy/role-lifecycle.d.ts.map +1 -1
  139. package/dist/domain/iampolicy/role-lifecycle.js +2 -2
  140. package/dist/domain/iampolicy/role-lifecycle.js.map +1 -1
  141. package/dist/domain/iampolicy/roles.d.ts.map +1 -1
  142. package/dist/domain/iampolicy/roles.js +7 -0
  143. package/dist/domain/iampolicy/roles.js.map +1 -1
  144. package/dist/domain/iampolicy/steps.d.ts +4 -3
  145. package/dist/domain/iampolicy/steps.d.ts.map +1 -1
  146. package/dist/domain/iampolicy/steps.js +7 -7
  147. package/dist/domain/iampolicy/steps.js.map +1 -1
  148. package/dist/domain/iampolicy/store-contract.d.ts.map +1 -1
  149. package/dist/domain/iampolicy/store-contract.js +22 -1
  150. package/dist/domain/iampolicy/store-contract.js.map +1 -1
  151. package/dist/domain/iampolicy/store.d.ts +18 -5
  152. package/dist/domain/iampolicy/store.d.ts.map +1 -1
  153. package/dist/domain/iampolicy/store.js.map +1 -1
  154. package/dist/domain/identityaccount/constants.d.ts +15 -0
  155. package/dist/domain/identityaccount/constants.d.ts.map +1 -1
  156. package/dist/domain/identityaccount/constants.js +17 -0
  157. package/dist/domain/identityaccount/constants.js.map +1 -1
  158. package/dist/domain/identityaccount/controller.d.ts.map +1 -1
  159. package/dist/domain/identityaccount/controller.js +17 -6
  160. package/dist/domain/identityaccount/controller.js.map +1 -1
  161. package/dist/domain/identityaccount/resolve.d.ts +47 -0
  162. package/dist/domain/identityaccount/resolve.d.ts.map +1 -1
  163. package/dist/domain/identityaccount/resolve.js +38 -1
  164. package/dist/domain/identityaccount/resolve.js.map +1 -1
  165. package/dist/domain/identityaccount/resource-store.d.ts.map +1 -1
  166. package/dist/domain/identityaccount/resource-store.js +11 -1
  167. package/dist/domain/identityaccount/resource-store.js.map +1 -1
  168. package/dist/domain/identityaccount/steps.d.ts +2 -1
  169. package/dist/domain/identityaccount/steps.d.ts.map +1 -1
  170. package/dist/domain/identityaccount/steps.js +4 -3
  171. package/dist/domain/identityaccount/steps.js.map +1 -1
  172. package/dist/domain/identityaccount/store-contract.js +2 -2
  173. package/dist/domain/identityaccount/store-contract.js.map +1 -1
  174. package/dist/domain/identityaccount/store.d.ts +6 -1
  175. package/dist/domain/identityaccount/store.d.ts.map +1 -1
  176. package/dist/domain/mcpserver/connect-sandbox.d.ts +67 -0
  177. package/dist/domain/mcpserver/connect-sandbox.d.ts.map +1 -0
  178. package/dist/domain/mcpserver/connect-sandbox.js +64 -0
  179. package/dist/domain/mcpserver/connect-sandbox.js.map +1 -0
  180. package/dist/domain/mcpserver/connect.d.ts +42 -10
  181. package/dist/domain/mcpserver/connect.d.ts.map +1 -1
  182. package/dist/domain/mcpserver/connect.js +147 -40
  183. package/dist/domain/mcpserver/connect.js.map +1 -1
  184. package/dist/domain/mcpserver/controller.js +4 -2
  185. package/dist/domain/mcpserver/controller.js.map +1 -1
  186. package/dist/domain/mcpserver/engine.d.ts +26 -7
  187. package/dist/domain/mcpserver/engine.d.ts.map +1 -1
  188. package/dist/domain/mcpserver/engine.js.map +1 -1
  189. package/dist/domain/mcpserver/start-connect.d.ts +5 -0
  190. package/dist/domain/mcpserver/start-connect.d.ts.map +1 -1
  191. package/dist/domain/mcpserver/start-connect.js +38 -15
  192. package/dist/domain/mcpserver/start-connect.js.map +1 -1
  193. package/dist/domain/memory/controller.js +2 -1
  194. package/dist/domain/memory/controller.js.map +1 -1
  195. package/dist/domain/memory/list-index.d.ts +2 -0
  196. package/dist/domain/memory/list-index.d.ts.map +1 -0
  197. package/dist/domain/memory/list-index.js +31 -0
  198. package/dist/domain/memory/list-index.js.map +1 -0
  199. package/dist/domain/memory/queries.d.ts +10 -0
  200. package/dist/domain/memory/queries.d.ts.map +1 -0
  201. package/dist/domain/memory/queries.js +54 -0
  202. package/dist/domain/memory/queries.js.map +1 -0
  203. package/dist/domain/memory/steps.d.ts +13 -11
  204. package/dist/domain/memory/steps.d.ts.map +1 -1
  205. package/dist/domain/memory/steps.js +26 -57
  206. package/dist/domain/memory/steps.js.map +1 -1
  207. package/dist/domain/organization/steps.d.ts.map +1 -1
  208. package/dist/domain/organization/steps.js +1 -1
  209. package/dist/domain/organization/steps.js.map +1 -1
  210. package/dist/domain/platformclient/mint.d.ts.map +1 -1
  211. package/dist/domain/platformclient/mint.js +2 -2
  212. package/dist/domain/platformclient/mint.js.map +1 -1
  213. package/dist/domain/platformclient/verifier.d.ts.map +1 -1
  214. package/dist/domain/platformclient/verifier.js +6 -3
  215. package/dist/domain/platformclient/verifier.js.map +1 -1
  216. package/dist/domain/plugin/push.d.ts.map +1 -1
  217. package/dist/domain/plugin/push.js +1 -0
  218. package/dist/domain/plugin/push.js.map +1 -1
  219. package/dist/domain/schedule/steps.d.ts +3 -1
  220. package/dist/domain/schedule/steps.d.ts.map +1 -1
  221. package/dist/domain/schedule/steps.js +3 -1
  222. package/dist/domain/schedule/steps.js.map +1 -1
  223. package/dist/domain/skill/push.d.ts.map +1 -1
  224. package/dist/domain/skill/push.js +1 -0
  225. package/dist/domain/skill/push.js.map +1 -1
  226. package/dist/domain/workflow/registry/data/task-kind-registry.json +27 -1
  227. package/dist/domain/workflowexecution/submit-approval.d.ts +5 -2
  228. package/dist/domain/workflowexecution/submit-approval.d.ts.map +1 -1
  229. package/dist/domain/workflowexecution/submit-approval.js +1 -1
  230. package/dist/domain/workflowexecution/submit-approval.js.map +1 -1
  231. package/dist/domain/workflowexecution/submit-file-decision.d.ts +5 -2
  232. package/dist/domain/workflowexecution/submit-file-decision.d.ts.map +1 -1
  233. package/dist/domain/workflowexecution/submit-file-decision.js +1 -1
  234. package/dist/domain/workflowexecution/submit-file-decision.js.map +1 -1
  235. package/dist/domain/workflowexecution/submit-workflow-task-approval.d.ts.map +1 -1
  236. package/dist/domain/workflowexecution/submit-workflow-task-approval.js +12 -1
  237. package/dist/domain/workflowexecution/submit-workflow-task-approval.js.map +1 -1
  238. package/dist/domain/workflowinstance/controller.d.ts +6 -3
  239. package/dist/domain/workflowinstance/controller.d.ts.map +1 -1
  240. package/dist/domain/workflowinstance/controller.js +12 -7
  241. package/dist/domain/workflowinstance/controller.js.map +1 -1
  242. package/dist/domain/workflowinstance/steps.d.ts +31 -0
  243. package/dist/domain/workflowinstance/steps.d.ts.map +1 -1
  244. package/dist/domain/workflowinstance/steps.js +88 -1
  245. package/dist/domain/workflowinstance/steps.js.map +1 -1
  246. package/dist/extensions/composed-services.d.ts +56 -0
  247. package/dist/extensions/composed-services.d.ts.map +1 -0
  248. package/dist/extensions/composed-services.js +2 -0
  249. package/dist/extensions/composed-services.js.map +1 -0
  250. package/dist/extensions/drivers.d.ts +32 -1
  251. package/dist/extensions/drivers.d.ts.map +1 -1
  252. package/dist/extensions/identity.d.ts +4 -1
  253. package/dist/extensions/identity.d.ts.map +1 -1
  254. package/dist/extensions/identity.js +4 -1
  255. package/dist/extensions/identity.js.map +1 -1
  256. package/dist/extensions/registry.d.ts +37 -0
  257. package/dist/extensions/registry.d.ts.map +1 -1
  258. package/dist/extensions/registry.js +50 -0
  259. package/dist/extensions/registry.js.map +1 -1
  260. package/dist/extensions/resource-authorization.d.ts +78 -0
  261. package/dist/extensions/resource-authorization.d.ts.map +1 -1
  262. package/dist/extensions/resource-row-reader.d.ts +43 -0
  263. package/dist/extensions/resource-row-reader.d.ts.map +1 -0
  264. package/dist/extensions/resource-row-reader.js +2 -0
  265. package/dist/extensions/resource-row-reader.js.map +1 -0
  266. package/dist/extensions/visitor-classifier.d.ts +41 -0
  267. package/dist/extensions/visitor-classifier.d.ts.map +1 -0
  268. package/dist/extensions/visitor-classifier.js +2 -0
  269. package/dist/extensions/visitor-classifier.js.map +1 -0
  270. package/dist/identity/oidc-userinfo.d.ts +6 -1
  271. package/dist/identity/oidc-userinfo.d.ts.map +1 -1
  272. package/dist/identity/oidc-userinfo.js.map +1 -1
  273. package/dist/identity/oidc-verifier.d.ts.map +1 -1
  274. package/dist/identity/oidc-verifier.js +37 -8
  275. package/dist/identity/oidc-verifier.js.map +1 -1
  276. package/dist/index.d.ts +14 -6
  277. package/dist/index.d.ts.map +1 -1
  278. package/dist/index.js +25 -9
  279. package/dist/index.js.map +1 -1
  280. package/dist/pipeline/errors.d.ts +8 -0
  281. package/dist/pipeline/errors.d.ts.map +1 -1
  282. package/dist/pipeline/errors.js +25 -16
  283. package/dist/pipeline/errors.js.map +1 -1
  284. package/dist/pipeline/interceptors/auth.d.ts +17 -9
  285. package/dist/pipeline/interceptors/auth.d.ts.map +1 -1
  286. package/dist/pipeline/interceptors/auth.js +17 -9
  287. package/dist/pipeline/interceptors/auth.js.map +1 -1
  288. package/dist/pipeline/steps/authorization-tuples.d.ts +23 -1
  289. package/dist/pipeline/steps/authorization-tuples.d.ts.map +1 -1
  290. package/dist/pipeline/steps/authorization-tuples.js +42 -0
  291. package/dist/pipeline/steps/authorization-tuples.js.map +1 -1
  292. package/dist/pipeline/steps/authorize.d.ts +6 -5
  293. package/dist/pipeline/steps/authorize.d.ts.map +1 -1
  294. package/dist/pipeline/steps/authorize.js +6 -5
  295. package/dist/pipeline/steps/authorize.js.map +1 -1
  296. package/dist/pipeline/steps/defaults.d.ts +12 -0
  297. package/dist/pipeline/steps/defaults.d.ts.map +1 -1
  298. package/dist/pipeline/steps/defaults.js +42 -7
  299. package/dist/pipeline/steps/defaults.js.map +1 -1
  300. package/dist/pipeline/steps/guard-memory-capture.d.ts +13 -15
  301. package/dist/pipeline/steps/guard-memory-capture.d.ts.map +1 -1
  302. package/dist/pipeline/steps/guard-memory-capture.js +2 -3
  303. package/dist/pipeline/steps/guard-memory-capture.js.map +1 -1
  304. package/dist/runnerauth/built-in-runner-credential-provider.d.ts +0 -2
  305. package/dist/runnerauth/built-in-runner-credential-provider.d.ts.map +1 -1
  306. package/dist/runnerauth/built-in-runner-credential-provider.js +8 -17
  307. package/dist/runnerauth/built-in-runner-credential-provider.js.map +1 -1
  308. package/dist/runnerauth/runner-credential-provider.d.ts +17 -7
  309. package/dist/runnerauth/runner-credential-provider.d.ts.map +1 -1
  310. package/dist/runnerauth/runner-credential-provider.js.map +1 -1
  311. package/dist/sandbox/docker.d.ts.map +1 -1
  312. package/dist/sandbox/docker.js +3 -0
  313. package/dist/sandbox/docker.js.map +1 -1
  314. package/dist/sandbox/kubernetes.d.ts.map +1 -1
  315. package/dist/sandbox/kubernetes.js +3 -0
  316. package/dist/sandbox/kubernetes.js.map +1 -1
  317. package/dist/sandbox/local-process.d.ts.map +1 -1
  318. package/dist/sandbox/local-process.js +4 -0
  319. package/dist/sandbox/local-process.js.map +1 -1
  320. package/dist/sandbox/provisioner.d.ts +18 -6
  321. package/dist/sandbox/provisioner.d.ts.map +1 -1
  322. package/dist/sandbox/provisioner.js.map +1 -1
  323. package/dist/temporal/manager.d.ts +5 -0
  324. package/dist/temporal/manager.d.ts.map +1 -1
  325. package/dist/temporal/manager.js +9 -0
  326. package/dist/temporal/manager.js.map +1 -1
  327. package/dist/temporal/mcpserver/engine-client.d.ts +2 -2
  328. package/dist/temporal/mcpserver/engine-client.d.ts.map +1 -1
  329. package/dist/temporal/mcpserver/engine-client.js +6 -4
  330. package/dist/temporal/mcpserver/engine-client.js.map +1 -1
  331. package/dist/temporal/mcpserver/names.d.ts +13 -2
  332. package/dist/temporal/mcpserver/names.d.ts.map +1 -1
  333. package/dist/temporal/mcpserver/names.js +15 -2
  334. package/dist/temporal/mcpserver/names.js.map +1 -1
  335. package/dist/temporal/sdk-logger.d.ts +74 -0
  336. package/dist/temporal/sdk-logger.d.ts.map +1 -0
  337. package/dist/temporal/sdk-logger.js +143 -0
  338. package/dist/temporal/sdk-logger.js.map +1 -0
  339. package/package.json +6 -6
  340. package/src/authorization/README.md +18 -6
  341. package/src/authorization/__tests__/authorizer.test.ts +5 -1
  342. package/src/authorization/__tests__/derived-tuples.test.ts +26 -0
  343. package/src/authorization/__tests__/evaluator.test.ts +4 -0
  344. package/src/authorization/__tests__/list-read-scope.test.ts +11 -5
  345. package/src/authorization/__tests__/store-tests.test.ts +3 -1
  346. package/src/authorization/__tests__/trusted-local-authorizer.test.ts +155 -0
  347. package/src/authorization/__tests__/unit-owned-kinds.test.ts +420 -0
  348. package/src/authorization/__tests__/wire-permissions.test.ts +31 -2
  349. package/src/authorization/authorizer.ts +21 -10
  350. package/src/authorization/derived-tuples.ts +92 -18
  351. package/src/authorization/evaluator.ts +30 -15
  352. package/src/authorization/list-read-scope.ts +4 -0
  353. package/src/authorization/model/__tests__/registry.test.ts +23 -0
  354. package/src/authorization/model/data/authorization-model.json +830 -67
  355. package/src/authorization/model/execution-viewer.ts +32 -27
  356. package/src/authorization/model/index.ts +4 -1
  357. package/src/authorization/model/rewrite.ts +5 -3
  358. package/src/authorization/organization-directory.ts +4 -0
  359. package/src/authorization/person.ts +32 -1
  360. package/src/authorization/policy-check.ts +105 -0
  361. package/src/authorization/posture.ts +45 -4
  362. package/src/authorization/resource-creators.ts +48 -0
  363. package/src/authorization/trusted-local-authorizer.ts +91 -0
  364. package/src/authorization/tuples.ts +17 -0
  365. package/src/boot/__tests__/compose.test.ts +120 -4
  366. package/src/boot/__tests__/list-indexes.test.ts +4 -0
  367. package/src/boot/__tests__/oauth-redirect-uri.test.ts +121 -10
  368. package/src/boot/__tests__/skill-transfer-origin.test.ts +96 -25
  369. package/src/boot/compose.ts +153 -61
  370. package/src/boot/config.ts +28 -12
  371. package/src/boot/inprocess.ts +18 -4
  372. package/src/boot/list-indexes.ts +6 -1
  373. package/src/boot/logger.ts +3 -1
  374. package/src/boot/oauth-redirect-uri.ts +62 -17
  375. package/src/boot/skill-transfer-origin.ts +71 -16
  376. package/src/domain/agent/__tests__/agent.test.ts +42 -1
  377. package/src/domain/agentchannel/__tests__/agentchannel.test.ts +9 -0
  378. package/src/domain/agentchannel/__tests__/channel-runtime.test.ts +2 -0
  379. package/src/domain/agentchannel/__tests__/create-authorization.test.ts +7 -6
  380. package/src/domain/agentchannel/steps.ts +9 -7
  381. package/src/domain/agentexecution/__tests__/agentexecution.test.ts +148 -56
  382. package/src/domain/agentexecution/__tests__/create-steps.test.ts +175 -12
  383. package/src/domain/agentexecution/__tests__/file-review-seed.ts +91 -0
  384. package/src/domain/agentexecution/controller.ts +8 -0
  385. package/src/domain/agentexecution/create-steps.ts +74 -44
  386. package/src/domain/agentexecution/submit-approval.ts +9 -6
  387. package/src/domain/agentexecution/submit-file-decision.ts +5 -4
  388. package/src/domain/agentinstance/__tests__/agentinstance.test.ts +2 -0
  389. package/src/domain/agentshare/__tests__/agentshare.test.ts +17 -0
  390. package/src/domain/agentshare/__tests__/create-authorization.test.ts +5 -4
  391. package/src/domain/agentshare/steps.ts +6 -4
  392. package/src/domain/apikey/__tests__/verifier.test.ts +73 -1
  393. package/src/domain/apikey/verifier.ts +45 -1
  394. package/src/domain/artifact/__tests__/artifact.test.ts +13 -24
  395. package/src/domain/channelapp/__tests__/channelapp.test.ts +7 -0
  396. package/src/domain/channelapp/controller.ts +4 -3
  397. package/src/domain/environment/__tests__/environment.test.ts +13 -0
  398. package/src/domain/executioncontext/__tests__/executioncontext.test.ts +2 -0
  399. package/src/domain/executioncontext/steps.ts +2 -1
  400. package/src/domain/iampolicy/__tests__/access-lists.test.ts +79 -0
  401. package/src/domain/iampolicy/__tests__/change.test.ts +63 -0
  402. package/src/domain/iampolicy/__tests__/controller.test.ts +39 -3
  403. package/src/domain/iampolicy/__tests__/grant-path.test.ts +595 -27
  404. package/src/domain/iampolicy/__tests__/iampolicy.test.ts +33 -2
  405. package/src/domain/iampolicy/__tests__/membership.test.ts +47 -5
  406. package/src/domain/iampolicy/__tests__/resource-store.test.ts +1 -0
  407. package/src/domain/iampolicy/__tests__/role-lifecycle.test.ts +41 -8
  408. package/src/domain/iampolicy/__tests__/roles.test.ts +3 -2
  409. package/src/domain/iampolicy/__tests__/steps.test.ts +75 -6
  410. package/src/domain/iampolicy/__tests__/support.ts +68 -4
  411. package/src/domain/iampolicy/access-lists.ts +70 -2
  412. package/src/domain/iampolicy/change.ts +109 -0
  413. package/src/domain/iampolicy/constants.ts +8 -0
  414. package/src/domain/iampolicy/controller.ts +17 -3
  415. package/src/domain/iampolicy/grant-path.ts +349 -31
  416. package/src/domain/iampolicy/membership.ts +32 -12
  417. package/src/domain/iampolicy/resource-store.ts +4 -0
  418. package/src/domain/iampolicy/role-lifecycle.ts +2 -0
  419. package/src/domain/iampolicy/roles.ts +8 -0
  420. package/src/domain/iampolicy/steps.ts +15 -5
  421. package/src/domain/iampolicy/store-contract.ts +37 -1
  422. package/src/domain/iampolicy/store.ts +19 -5
  423. package/src/domain/identityaccount/__tests__/resolve.test.ts +246 -2
  424. package/src/domain/identityaccount/__tests__/resource-store.test.ts +1 -1
  425. package/src/domain/identityaccount/constants.ts +20 -0
  426. package/src/domain/identityaccount/controller.ts +20 -5
  427. package/src/domain/identityaccount/resolve.ts +80 -1
  428. package/src/domain/identityaccount/resource-store.ts +14 -1
  429. package/src/domain/identityaccount/steps.ts +4 -3
  430. package/src/domain/identityaccount/store-contract.ts +4 -4
  431. package/src/domain/identityaccount/store.ts +6 -1
  432. package/src/domain/mcpserver/__tests__/connect-authorization.test.ts +1 -0
  433. package/src/domain/mcpserver/__tests__/connect.test.ts +358 -15
  434. package/src/domain/mcpserver/__tests__/mcpserver.test.ts +2 -0
  435. package/src/domain/mcpserver/__tests__/oauth-handshake.test.ts +2 -0
  436. package/src/domain/mcpserver/__tests__/store-faults.test.ts +2 -0
  437. package/src/domain/mcpserver/connect-sandbox.ts +135 -0
  438. package/src/domain/mcpserver/connect.ts +226 -56
  439. package/src/domain/mcpserver/controller.ts +8 -2
  440. package/src/domain/mcpserver/engine.ts +24 -6
  441. package/src/domain/mcpserver/start-connect.ts +49 -10
  442. package/src/domain/memory/__tests__/memory.test.ts +92 -22
  443. package/src/domain/memory/__tests__/queries.test.ts +173 -0
  444. package/src/domain/memory/controller.ts +2 -1
  445. package/src/domain/memory/list-index.ts +32 -0
  446. package/src/domain/memory/queries.ts +72 -0
  447. package/src/domain/memory/steps.ts +26 -63
  448. package/src/domain/oauthapp/__tests__/oauthapp.test.ts +14 -0
  449. package/src/domain/organization/__tests__/support.ts +41 -0
  450. package/src/domain/organization/steps.ts +1 -0
  451. package/src/domain/platformclient/mint.ts +6 -2
  452. package/src/domain/platformclient/verifier.ts +6 -3
  453. package/src/domain/plugin/__tests__/plugin.test.ts +11 -24
  454. package/src/domain/plugin/push.ts +1 -0
  455. package/src/domain/schedule/__tests__/schedule.composed.test.ts +2 -0
  456. package/src/domain/schedule/steps.ts +3 -1
  457. package/src/domain/session/__tests__/session.test.ts +2 -0
  458. package/src/domain/skill/__tests__/skill.test.ts +7 -25
  459. package/src/domain/skill/push.ts +1 -0
  460. package/src/domain/workflow/__tests__/workflow.test.ts +2 -0
  461. package/src/domain/workflow/registry/data/task-kind-registry.json +27 -1
  462. package/src/domain/workflowexecution/__tests__/forward-attribution-composed.test.ts +270 -0
  463. package/src/domain/workflowexecution/__tests__/submit-workflow-task-approval.test.ts +196 -0
  464. package/src/domain/workflowexecution/__tests__/workflowexecution.test.ts +3 -57
  465. package/src/domain/workflowexecution/submit-approval.ts +9 -2
  466. package/src/domain/workflowexecution/submit-file-decision.ts +6 -1
  467. package/src/domain/workflowexecution/submit-workflow-task-approval.ts +23 -5
  468. package/src/domain/workflowinstance/controller.ts +27 -9
  469. package/src/domain/workflowinstance/steps.ts +123 -1
  470. package/src/extensions/__tests__/apikey-before-sign-in-composed.test.ts +172 -0
  471. package/src/extensions/__tests__/built-in-authorization-composed.test.ts +80 -1
  472. package/src/extensions/__tests__/composed-services-composed.test.ts +236 -0
  473. package/src/extensions/__tests__/extension-composition.test.ts +229 -16
  474. package/src/extensions/__tests__/identity-account-composed.test.ts +84 -4
  475. package/src/extensions/__tests__/list-read-scope-composed.test.ts +2 -0
  476. package/src/extensions/__tests__/registry.test.ts +147 -1
  477. package/src/extensions/__tests__/secret-cleanup-composed.test.ts +2 -0
  478. package/src/extensions/__tests__/visitor-classifier-points.test.ts +42 -0
  479. package/src/extensions/composed-services.ts +61 -0
  480. package/src/extensions/drivers.ts +33 -1
  481. package/src/extensions/identity.ts +4 -1
  482. package/src/extensions/registry.ts +105 -0
  483. package/src/extensions/resource-authorization.ts +87 -0
  484. package/src/extensions/resource-row-reader.ts +43 -0
  485. package/src/extensions/visitor-classifier.ts +41 -0
  486. package/src/identity/__tests__/oidc-verifier.test.ts +38 -12
  487. package/src/identity/oidc-userinfo.ts +6 -1
  488. package/src/identity/oidc-verifier.ts +42 -8
  489. package/src/index.ts +61 -6
  490. package/src/pipeline/__tests__/steps.test.ts +31 -4
  491. package/src/pipeline/errors.ts +30 -16
  492. package/src/pipeline/interceptors/auth.ts +17 -9
  493. package/src/pipeline/steps/__tests__/authorization-tuples.test.ts +20 -0
  494. package/src/pipeline/steps/__tests__/guard-memory-capture.test.ts +72 -15
  495. package/src/pipeline/steps/authorization-tuples.ts +54 -0
  496. package/src/pipeline/steps/authorize.ts +6 -5
  497. package/src/pipeline/steps/defaults.ts +52 -7
  498. package/src/pipeline/steps/guard-memory-capture.ts +15 -20
  499. package/src/runnerauth/__tests__/built-in-runner-credential-provider.test.ts +1 -1
  500. package/src/runnerauth/__tests__/runner-subject-composed.test.ts +13 -0
  501. package/src/runnerauth/bound-execution.ts +2 -2
  502. package/src/runnerauth/built-in-runner-credential-provider.ts +8 -21
  503. package/src/runnerauth/runner-credential-provider.ts +17 -7
  504. package/src/sandbox/__tests__/docker.integration.test.ts +4 -0
  505. package/src/sandbox/__tests__/kubernetes.test.ts +18 -1
  506. package/src/sandbox/__tests__/local-process.integration.test.ts +4 -0
  507. package/src/sandbox/__tests__/provisioner.test.ts +1 -0
  508. package/src/sandbox/docker.ts +3 -0
  509. package/src/sandbox/kubernetes.ts +3 -0
  510. package/src/sandbox/local-process.ts +4 -0
  511. package/src/sandbox/provisioner.ts +18 -6
  512. package/src/store/postgres/__tests__/support.ts +11 -2
  513. package/src/temporal/README.md +1 -0
  514. package/src/temporal/__tests__/manager.test.ts +56 -4
  515. package/src/temporal/__tests__/sdk-log-workflows.ts +26 -0
  516. package/src/temporal/__tests__/sdk-logger.e2e.test.ts +150 -0
  517. package/src/temporal/__tests__/sdk-logger.test.ts +238 -0
  518. package/src/temporal/manager.ts +9 -0
  519. package/src/temporal/mcpserver/engine-client.ts +8 -3
  520. package/src/temporal/mcpserver/names.ts +16 -2
  521. package/src/temporal/sdk-logger.ts +173 -0
  522. package/dist/authorization/lane-admission.d.ts +0 -50
  523. package/dist/authorization/lane-admission.d.ts.map +0 -1
  524. package/dist/authorization/lane-admission.js +0 -13
  525. package/dist/authorization/lane-admission.js.map +0 -1
  526. package/src/authorization/__tests__/lane-admission.test.ts +0 -115
  527. package/src/authorization/lane-admission.ts +0 -73
@@ -12,12 +12,15 @@
12
12
  *
13
13
  * Deliberately NO search-extractor and NO index steps anywhere in this
14
14
  * domain: memory is not_search_indexed by design (privacy — content is
15
- * subject-only and must not surface in org-visible search).
15
+ * subject-only and must not surface in org-visible search). The list
16
+ * index the reads use (list-index.ts) is not search: the store keeps it
17
+ * beside the row, and it holds the org, the subject id and the creation
18
+ * instant, never content.
16
19
  *
17
20
  * Proven by memory.conformance.test.ts (CONFORMANCE_TARGET=local) and
18
21
  * __tests__/memory.test.ts.
19
22
  */
20
- import { create, equals, fromBinary, isMessage } from "@bufbuild/protobuf";
23
+ import { create, equals, isMessage } from "@bufbuild/protobuf";
21
24
  import { timestampNow } from "@bufbuild/protobuf/wkt";
22
25
  import type { ConnectError } from "@connectrpc/connect";
23
26
 
@@ -48,11 +51,11 @@ import type { RequestContext } from "../../pipeline/request-context.js";
48
51
  import { isServerComposedRequest } from "../../extensions/identity.js";
49
52
  import type { AuthorizationTarget } from "../../pipeline/steps/authorize.js";
50
53
  import {
54
+ assignServerId,
51
55
  generateId,
52
56
  setAuditFieldsForUpdate,
53
57
  } from "../../pipeline/steps/defaults.js";
54
58
  import { memoryCaptureCredentialOf } from "../../pipeline/steps/guard-memory-capture.js";
55
- import { compareCreatedAtDesc } from "../../pipeline/steps/helpers.js";
56
59
  import { EXISTING_RESOURCE_KEY } from "../../pipeline/steps/load-existing.js";
57
60
  import type { AccountsByCaller } from "../identityaccount/resolve.js";
58
61
  import {
@@ -61,6 +64,7 @@ import {
61
64
  } from "../identityaccount/resolve.js";
62
65
  import { ResourceNotFoundError } from "../../store/interface.js";
63
66
  import type { Store } from "../../store/interface.js";
67
+ import { listOrganizationMemories, listSubjectMemories } from "./queries.js";
64
68
  import {
65
69
  MAX_MEMORIES_PER_SUBJECT,
66
70
  MEMORY_ACCOUNT_DISABLED_MESSAGE,
@@ -80,11 +84,14 @@ export const LIST_RESULT_KEY = "listResult";
80
84
  *
81
85
  * 1. Requires metadata.org — memory records are org-scoped (DD-004), so
82
86
  * the org can never be inferred.
83
- * 2. Mints metadata.id here (not in BuildNewState) when absent, so an
87
+ * 2. Mints metadata.id here (not in BuildNewState), always, so an
84
88
  * unnamed record can default its name/slug from its own identity:
85
89
  * memories are id-addressed records (the remember tool sends content
86
90
  * only), and the platform's slug machinery requires a name. A
87
91
  * client-supplied name still wins — the default only fills absence.
92
+ * The id is claimed through `assignServerId`, so BuildNewState keeps
93
+ * it; an id the request carried is replaced, as every create's is
94
+ * (stigmer/stigmer#1266).
88
95
  * 3. Overwrites spec.subject_identity_account_id, server-derived and
89
96
  * never client-supplied (DD-005 D2), by posture. Under the
90
97
  * single-operator posture (no `personAccounts` composed) it is the
@@ -141,9 +148,7 @@ export function newResolveMemoryDefaultsStep(
141
148
  throw internalError(new Error("metadata is nil"), "metadata is nil");
142
149
  }
143
150
 
144
- if (metadata.id === "") {
145
- metadata.id = generateId("mem");
146
- }
151
+ assignServerId(ctx, generateId("mem"));
147
152
  if (metadata.name === "" && metadata.slug === "") {
148
153
  metadata.name = metadata.id;
149
154
  }
@@ -349,10 +354,9 @@ export function newCheckMemoryEnablementStep(
349
354
  /**
350
355
  * CheckMemoryCap — Go checkMemoryCapStep: enforces the
351
356
  * per-subject-per-org record ceiling at create (DD-006 D5). Counted
352
- * across all lifecycle states. A full-scan count matches the store's
353
- * local/OSS posture at the kind's dozens-of-records scale (the schedule
354
- * list precedent); the cloud edition counts through an indexed
355
- * repository query.
357
+ * across all lifecycle states, from the subject's own rows in the org
358
+ * through the memory list index (queries.ts), so a capture never reads
359
+ * another person's or another organization's memories.
356
360
  */
357
361
  export function newCheckMemoryCapStep(
358
362
  store: Store,
@@ -364,28 +368,13 @@ export function newCheckMemoryCapStep(
364
368
  const org = newState.metadata?.org ?? "";
365
369
  const subject = newState.spec?.subjectIdentityAccountId ?? "";
366
370
 
367
- let rows: Uint8Array[];
371
+ let count: number;
368
372
  try {
369
- rows = await store.listResources(ApiResourceKind.memory);
373
+ count = (await listSubjectMemories(store, org, subject)).length;
370
374
  } catch (error) {
371
375
  throw internalError(error, "failed to count memories for cap check");
372
376
  }
373
377
 
374
- let count = 0;
375
- for (const bytes of rows) {
376
- const existing = unmarshalMemory(bytes);
377
- if (existing === undefined) {
378
- continue;
379
- }
380
- if ((existing.metadata?.org ?? "") !== org) {
381
- continue;
382
- }
383
- if ((existing.spec?.subjectIdentityAccountId ?? "") !== subject) {
384
- continue;
385
- }
386
- count++;
387
- }
388
-
389
378
  if (count >= MAX_MEMORIES_PER_SUBJECT) {
390
379
  throw failedPreconditionError(MEMORY_FULL_MESSAGE);
391
380
  }
@@ -643,12 +632,12 @@ export function newTransitionMemoryLifecycleStep(
643
632
  }
644
633
 
645
634
  /**
646
- * ListMemoriesByOrg — Go listMemoriesByOrgStep (list.go): loads all
647
- * memories and filters by org, sorted by created_at descending (newest
648
- * first) — the schedule list posture. Ordering is chronological only;
649
- * grouping pending proposals first is the console's presentation concern
650
- * (DD-005 D4), deliberately not an RPC parameter at the kind's
651
- * dozens-of-records scale.
635
+ * ListMemoriesByOrg — Go listMemoriesByOrgStep (list.go): reads the
636
+ * org's memories through the memory list index (queries.ts), created_at
637
+ * descending (newest first) — the index order, which the read scope
638
+ * keeps. Ordering is chronological only; grouping pending proposals first
639
+ * is the console's presentation concern (DD-005 D4), deliberately not an
640
+ * RPC parameter at the kind's dozens-of-records scale.
652
641
  */
653
642
  export function newListMemoriesByOrgStep(
654
643
  store: Store,
@@ -661,20 +650,13 @@ export function newListMemoriesByOrgStep(
661
650
  ): Promise<void> {
662
651
  const org = ctx.input.org;
663
652
 
664
- let rows: Uint8Array[];
653
+ let orgMemories: Memory[];
665
654
  try {
666
- rows = await store.listResources(ApiResourceKind.memory);
655
+ orgMemories = await listOrganizationMemories(store, org);
667
656
  } catch (error) {
668
657
  throw internalError(error, "failed to list memories");
669
658
  }
670
659
 
671
- const decoded: Memory[] = [];
672
- for (const bytes of rows) {
673
- const memory = unmarshalMemory(bytes);
674
- if (memory !== undefined) {
675
- decoded.push(memory);
676
- }
677
- }
678
660
  // 20260830.01 census lane 11: the org equality serves the Java
679
661
  // handler's org arm in both editions and runs FIRST; the scope
680
662
  // narrows the org's rows last (the scope is the last per-row
@@ -683,17 +665,10 @@ export function newListMemoriesByOrgStep(
683
665
  listReadScope,
684
666
  ctx.callerIdentity,
685
667
  ApiResourceKind.memory,
686
- decoded.filter((memory) => (memory.metadata?.org ?? "") === org),
668
+ orgMemories,
687
669
  "",
688
670
  );
689
671
 
690
- memories.sort((a, b) =>
691
- compareCreatedAtDesc(
692
- a.status?.audit?.specAudit?.createdAt,
693
- b.status?.audit?.specAudit?.createdAt,
694
- ),
695
- );
696
-
697
672
  ctx.set(
698
673
  LIST_RESULT_KEY,
699
674
  create(MemoryListSchema, {
@@ -704,15 +679,3 @@ export function newListMemoriesByOrgStep(
704
679
  },
705
680
  };
706
681
  }
707
-
708
- /**
709
- * Decodes a stored memory, skipping invalid entries (should not happen in
710
- * normal operation) — Go unmarshalMemory.
711
- */
712
- function unmarshalMemory(data: Uint8Array): Memory | undefined {
713
- try {
714
- return fromBinary(MemorySchema, data);
715
- } catch {
716
- return undefined;
717
- }
718
- }
@@ -53,6 +53,7 @@ import {
53
53
  deleteBlockedByMcpServerMessage,
54
54
  } from "../constants.js";
55
55
  import { resolveOAuthAppRef } from "../refresolution.js";
56
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
56
57
 
57
58
  const silentLogger = createLogger({ level: "error", pretty: false, write: () => {} });
58
59
 
@@ -94,6 +95,19 @@ async function startServer(env: Record<string, string>): Promise<TestServer> {
94
95
  const transport: Transport = createGrpcTransport({
95
96
  baseUrl: `http://127.0.0.1:${port}`,
96
97
  });
98
+ // Not "stigmer" or "res-org-none": the ref-resolution cases need an org
99
+ // that does not exist here.
100
+ await seedOrganizations(transport, [
101
+ ORG,
102
+ "other-org",
103
+ "org-a",
104
+ "org-b",
105
+ "res-org-a",
106
+ "res-org-b",
107
+ "res-org-c",
108
+ "res-org-d",
109
+ "res-org-e",
110
+ ]);
97
111
  return {
98
112
  server,
99
113
  command: createClient(OAuthAppCommandController, transport),
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Test fixtures for the Organization domain, shared by every composed
3
+ * suite that writes into an Organization: `organizationInput` is the
4
+ * smallest create the chain accepts, and `seedOrganizations` creates each
5
+ * named Organization through the server's own create RPC, so the rows are
6
+ * exactly what a person's first create writes (the slug is the id,
7
+ * domain/organization/steps.ts).
8
+ *
9
+ * Why every such suite needs it: every org-scoped lane authorizes on the
10
+ * Organization it names, and under every posture a missing one answers
11
+ * NOT_FOUND before any other step (the trusted-local driver since
12
+ * stigmer#1163, authorization/trusted-local-authorizer.ts). A suite that
13
+ * writes under a slug nobody created is testing the phantom write that
14
+ * fix removed, so it seeds the slugs it uses in its `beforeAll`, once the
15
+ * server listens. A slug a test means to be absent is simply not seeded.
16
+ */
17
+ import { createClient } from "@connectrpc/connect";
18
+ import type { Transport } from "@connectrpc/connect";
19
+
20
+ import { OrganizationCommandController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/command_pb";
21
+
22
+ /** The smallest Organization create: slug, name and description all `slug`. */
23
+ export function organizationInput(slug: string) {
24
+ return {
25
+ apiVersion: "tenancy.stigmer.ai/v1",
26
+ kind: "Organization",
27
+ metadata: { name: slug, slug, org: "" },
28
+ spec: { description: slug },
29
+ };
30
+ }
31
+
32
+ /** Creates each Organization, in order, as the transport's caller. */
33
+ export async function seedOrganizations(
34
+ transport: Transport,
35
+ slugs: ReadonlyArray<string>,
36
+ ): Promise<void> {
37
+ const organizations = createClient(OrganizationCommandController, transport);
38
+ for (const slug of slugs) {
39
+ await organizations.create(organizationInput(slug));
40
+ }
41
+ }
@@ -174,6 +174,7 @@ export function newRevokeOrganizationPoliciesStep<Desc extends DescMessage>(
174
174
  kind: ApiResourceKind[ApiResourceKind.organization],
175
175
  id,
176
176
  }),
177
+ ctx.callerIdentity,
177
178
  );
178
179
  } catch (error) {
179
180
  throw internalError(
@@ -294,7 +294,7 @@ async function resolveOrProvisionAccount(
294
294
  }
295
295
  }
296
296
 
297
- /** The account under the subject, any mode; a store fault is INTERNAL, never "no account". */
297
+ /** The account under the subject in any mode but federated; a store fault is INTERNAL, never "no account". */
298
298
  async function findAccount(
299
299
  deps: PlatformClientMintDeps,
300
300
  idpId: string,
@@ -390,7 +390,11 @@ async function grantAutoRole(
390
390
  ? DEFAULT_AUTO_GRANT_ROLE
391
391
  : configured;
392
392
  try {
393
- await deps.grantPath.grant(organizationRole(accountId, role, org), actor);
393
+ await deps.grantPath.grant(
394
+ organizationRole(accountId, role, org),
395
+ actor,
396
+ "platform_client_grant",
397
+ );
394
398
  } catch (error) {
395
399
  deps.logger.error(
396
400
  "platform client auto-grant failed; nothing was provisioned",
@@ -19,9 +19,12 @@
19
19
  * infrastructure fault it is, never as a revocation.
20
20
  *
21
21
  * Composed between `apikey` and `oidc`, only under an authentication
22
- * posture (compose.ts): the OIDC verifier claims every JWT-shaped token and
23
- * throws on one it cannot verify, so a platform token must be claimed
24
- * before it gets there (stigmer#1137's lesson).
22
+ * posture (compose.ts). Until 2026-09-29 the OIDC verifier claimed every
23
+ * JWT-shaped token and threw on one it could not verify, so a platform
24
+ * token had to be claimed before it got there (stigmer#1137's lesson); it
25
+ * now claims only its configured issuer's tokens, and the order is kept
26
+ * so a platform token is claimed by its own lane whatever issuer an
27
+ * operator configures.
25
28
  *
26
29
  * The identity is the account the token was minted for: `sub` IS the
27
30
  * account id (the mint signs it), so no account read is needed; class
@@ -19,7 +19,6 @@
19
19
  * identical push refused before the slug is judged.
20
20
  */
21
21
  import { mkdtempSync, rmSync } from "node:fs";
22
- import net from "node:net";
23
22
  import { tmpdir } from "node:os";
24
23
  import path from "node:path";
25
24
 
@@ -66,6 +65,7 @@ import {
66
65
  PLUGIN_VERSION_LABEL,
67
66
  SYSTEM_LABEL,
68
67
  } from "../../../pipeline/apiresource-labels.js";
68
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
69
69
 
70
70
  const silentLogger = createLogger({
71
71
  level: "error",
@@ -85,40 +85,31 @@ let mcpServers: Client<typeof McpServerCommandController>;
85
85
  let mcpServerQuery: Client<typeof McpServerQueryController>;
86
86
  let dir: string;
87
87
 
88
- async function reserveFreePort(): Promise<number> {
89
- return new Promise((resolve, reject) => {
90
- const probe = net.createServer();
91
- probe.once("error", reject);
92
- probe.listen(0, "127.0.0.1", () => {
93
- const { port } = probe.address() as net.AddressInfo;
94
- probe.close(() => resolve(port));
95
- });
96
- });
97
- }
98
-
99
88
  beforeAll(async () => {
100
89
  dir = mkdtempSync(path.join(tmpdir(), "plugin-domain-test-"));
101
- const grpcPort = await reserveFreePort();
90
+ // An ephemeral port needs no reservation: the transfer lane mints its
91
+ // capability URLs for the port the listener actually binds
92
+ // (boot/skill-transfer-origin.ts, stigmer#1386), and the artifact lane
93
+ // binds ephemeral beside it (boot/artifact-lane.ts). A port probed and
94
+ // released first could be taken by another worker before the bind
95
+ // (stigmer#1353).
102
96
  server = await composeServer({
103
97
  config: loadConfig({
104
98
  STIGMER_MODEL_REGISTRY_REFRESH: "off",
105
99
  TEMPORAL_HOST_PORT: "127.0.0.1:1",
106
- GRPC_PORT: String(grpcPort),
107
- // The reserved port is the unified one only; its +1 neighbour is not
108
- // reserved, and a lane that cannot bind fails the boot (#1089), so
109
- // the artifact lane binds ephemeral.
110
- ARTIFACT_HTTP_PORT: "0",
111
100
  DB_PATH: path.join(dir, "stigmer.db"),
112
101
  ARTIFACT_LOCAL_BASE_PATH: path.join(dir, "artifacts"),
113
102
  STORAGE_PATH: path.join(dir, "storage"),
114
103
  }),
115
104
  logger: silentLogger,
105
+ portOverride: 0,
116
106
  host: "127.0.0.1",
117
107
  });
118
108
  const port = await server.start();
119
109
  const transport: Transport = createGrpcTransport({
120
110
  baseUrl: `http://127.0.0.1:${port}`,
121
111
  });
112
+ await seedOrganizations(transport, [ORG]);
122
113
  plugins = createClient(PluginCommandController, transport);
123
114
  pluginQuery = createClient(PluginQueryController, transport);
124
115
  agents = createClient(AgentCommandController, transport);
@@ -786,7 +777,6 @@ describe("Plugin push under an authorizer that enforces reserved labels", () =>
786
777
 
787
778
  beforeAll(async () => {
788
779
  enforcingDir = mkdtempSync(path.join(tmpdir(), "plugin-domain-enforcing-"));
789
- const grpcPort = await reserveFreePort();
790
780
  const authorizer: Authorizer = {
791
781
  authorize(_caller, check) {
792
782
  if (check.permission === IamPermission.can_write_reserved_labels) {
@@ -804,16 +794,13 @@ describe("Plugin push under an authorizer that enforces reserved labels", () =>
804
794
  config: loadConfig({
805
795
  STIGMER_MODEL_REGISTRY_REFRESH: "off",
806
796
  TEMPORAL_HOST_PORT: "127.0.0.1:1",
807
- GRPC_PORT: String(grpcPort),
808
- // The reserved port is the unified one only; its +1 neighbour is not
809
- // reserved, and a lane that cannot bind fails the boot (#1089), so
810
- // the artifact lane binds ephemeral.
811
- ARTIFACT_HTTP_PORT: "0",
812
797
  DB_PATH: path.join(enforcingDir, "stigmer.db"),
813
798
  ARTIFACT_LOCAL_BASE_PATH: path.join(enforcingDir, "artifacts"),
814
799
  STORAGE_PATH: path.join(enforcingDir, "storage"),
815
800
  }),
816
801
  logger: silentLogger,
802
+ // Ephemeral, as the composition above: no port is reserved ahead.
803
+ portOverride: 0,
817
804
  host: "127.0.0.1",
818
805
  extensions: [{ name: "reserved-labels-enforced", authorizer }],
819
806
  });
@@ -956,6 +956,7 @@ export function newPluginPushAuthorizationTuplesStep(
956
956
  kind: ctx.apiResourceKind,
957
957
  resourceId: plugin.metadata?.id ?? "",
958
958
  orgId: plugin.metadata?.org ?? "",
959
+ caller: ctx.callerIdentity,
959
960
  shapesToCreate,
960
961
  shapesToDelete,
961
962
  });
@@ -44,6 +44,7 @@ import { composeServer } from "../../../boot/compose.js";
44
44
  import type { ComposedServer } from "../../../boot/compose.js";
45
45
  import { createLogger } from "../../../boot/logger.js";
46
46
  import { TRIGGER_DISABLED_MESSAGE } from "../trigger.js";
47
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
47
48
 
48
49
  const silentLogger = createLogger({ level: "error", pretty: false, write: () => {} });
49
50
 
@@ -73,6 +74,7 @@ beforeAll(async () => {
73
74
  });
74
75
  const port = await server.start();
75
76
  transport = createGrpcTransport({ baseUrl: `http://127.0.0.1:${port}` });
77
+ await seedOrganizations(transport, ["acme", "other-org"]);
76
78
  command = createClient(ScheduleCommandController, transport);
77
79
  query = createClient(ScheduleQueryController, transport);
78
80
  agentCommand = createClient(AgentCommandController, transport);
@@ -153,7 +153,9 @@ export const SCHEDULE_CREATE_DENIED_MESSAGE =
153
153
  * a slug, not a request field; and there is deliberately no organization
154
154
  * bar — a schedule is unattended spend on an agent, an editor's act, and
155
155
  * the same-org invariant the resolve step enforces already binds the
156
- * schedule's organization to the agent's (command.proto).
156
+ * schedule's organization to the agent's (command.proto). An editor, who
157
+ * maintains the definition, may run it on a clock: a schedule widens no
158
+ * one's access, and each fire re-checks its creator's can_execute.
157
159
  */
158
160
  export function resolveScheduleCreateTargets(
159
161
  ctx: RequestContext<typeof ScheduleSchema>,
@@ -64,6 +64,7 @@ import {
64
64
  newConfigFromEnv,
65
65
  } from "../../agentexecution/temporal/config.js";
66
66
  import { newValidateExecutionTargetImmutabilityStep } from "../steps.js";
67
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
67
68
 
68
69
  const silentLogger = createLogger({
69
70
  level: "error",
@@ -107,6 +108,7 @@ beforeAll(async () => {
107
108
  });
108
109
  const port = await server.start();
109
110
  transport = createGrpcTransport({ baseUrl: `http://127.0.0.1:${port}` });
111
+ await seedOrganizations(transport, [ORG]);
110
112
  agentCommand = createClient(AgentCommandController, transport);
111
113
  command = createClient(SessionCommandController, transport);
112
114
  query = createClient(SessionQueryController, transport);
@@ -12,7 +12,6 @@
12
12
  */
13
13
  import { mkdtempSync, rmSync } from "node:fs";
14
14
  import http2 from "node:http2";
15
- import net from "node:net";
16
15
  import { tmpdir } from "node:os";
17
16
  import path from "node:path";
18
17
 
@@ -31,6 +30,7 @@ import { loadConfig } from "../../../boot/config.js";
31
30
  import { composeServer } from "../../../boot/compose.js";
32
31
  import type { ComposedServer } from "../../../boot/compose.js";
33
32
  import { createLogger } from "../../../boot/logger.js";
33
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
34
34
 
35
35
  const silentLogger = createLogger({ level: "error", pretty: false, write: () => {} });
36
36
 
@@ -45,27 +45,12 @@ let query: QueryClient;
45
45
  let baseUrl: string;
46
46
  let dir: string;
47
47
 
48
- /**
49
- * Reserves a free port the way the CLI/conformance harness does: the
50
- * transfer lane mints capability URLs from CONFIG (base defaults to
51
- * http://localhost:{grpcPort}), so the server must boot with GRPC_PORT set
52
- * to its real port — a portOverride would leave minted URLs pointing at
53
- * the config default.
54
- */
55
- async function reserveFreePort(): Promise<number> {
56
- return new Promise((resolve, reject) => {
57
- const probe = net.createServer();
58
- probe.once("error", reject);
59
- probe.listen(0, "127.0.0.1", () => {
60
- const { port } = probe.address() as net.AddressInfo;
61
- probe.close(() => resolve(port));
62
- });
63
- });
64
- }
65
-
66
48
  beforeAll(async () => {
67
49
  dir = mkdtempSync(path.join(tmpdir(), "skill-domain-test-"));
68
- const grpcPort = await reserveFreePort();
50
+ // An ephemeral port needs no reservation: the transfer lane mints its
51
+ // capability URLs for the port the listener actually binds
52
+ // (boot/skill-transfer-origin.ts, stigmer#1386), and the artifact lane
53
+ // binds ephemeral beside it (boot/artifact-lane.ts).
69
54
  server = await composeServer({
70
55
  config: loadConfig({
71
56
  STIGMER_MODEL_REGISTRY_REFRESH: "off",
@@ -73,21 +58,18 @@ beforeAll(async () => {
73
58
  // closed, so boots fail the non-fatal connect fast and can never touch
74
59
  // a live local Temporal (the conformance CRUD harness does the same).
75
60
  TEMPORAL_HOST_PORT: "127.0.0.1:1",
76
- GRPC_PORT: String(grpcPort),
77
- // The reserved port is the unified one only; its +1 neighbour is not
78
- // reserved, and a lane that cannot bind fails the boot (#1089), so
79
- // the artifact lane binds ephemeral.
80
- ARTIFACT_HTTP_PORT: "0",
81
61
  DB_PATH: path.join(dir, "stigmer.db"),
82
62
  ARTIFACT_LOCAL_BASE_PATH: path.join(dir, "artifacts"),
83
63
  STORAGE_PATH: path.join(dir, "storage"),
84
64
  }),
85
65
  logger: silentLogger,
66
+ portOverride: 0,
86
67
  host: "127.0.0.1",
87
68
  });
88
69
  const port = await server.start();
89
70
  baseUrl = `http://127.0.0.1:${port}`;
90
71
  const transport: Transport = createGrpcTransport({ baseUrl });
72
+ await seedOrganizations(transport, [ORG, "other-org"]);
91
73
  command = createClient(SkillCommandController, transport);
92
74
  query = createClient(SkillQueryController, transport);
93
75
  });
@@ -469,6 +469,7 @@ export function newSkillPushAuthorizationTuplesStep(
469
469
  kind: ctx.apiResourceKind,
470
470
  resourceId: skill.metadata?.id ?? "",
471
471
  orgId: skill.metadata?.org ?? "",
472
+ caller: ctx.callerIdentity,
472
473
  shapesToCreate,
473
474
  shapesToDelete,
474
475
  });
@@ -46,6 +46,7 @@ import {
46
46
  SYSTEM_MANAGED_LABEL,
47
47
  } from "../../../pipeline/apiresource-labels.js";
48
48
  import { defaultWorkflowInstanceSlug } from "../../workflowinstance/defaultinstance.js";
49
+ import { seedOrganizations } from "../../organization/__tests__/support.js";
49
50
 
50
51
  const silentLogger = createLogger({ level: "error", pretty: false, write: () => {} });
51
52
 
@@ -83,6 +84,7 @@ beforeAll(async () => {
83
84
  });
84
85
  const port = await server.start();
85
86
  transport = createGrpcTransport({ baseUrl: `http://127.0.0.1:${port}` });
87
+ await seedOrganizations(transport, [ORG, "other-org"]);
86
88
  command = createClient(WorkflowCommandController, transport);
87
89
  query = createClient(WorkflowQueryController, transport);
88
90
  instanceCommand = createClient(WorkflowInstanceCommandController, transport);
@@ -2325,6 +2325,10 @@
2325
2325
  "outputJsonSchema": {
2326
2326
  "description": "Reviewer response including selected outcome and form data.",
2327
2327
  "properties": {
2328
+ "comment": {
2329
+ "description": "Free-text comment the reviewer attached; absent when none was written, and on a timeout.",
2330
+ "type": "string"
2331
+ },
2328
2332
  "form_data": {
2329
2333
  "description": "Validated form response (when form_schema is configured).",
2330
2334
  "type": "object"
@@ -2338,8 +2342,30 @@
2338
2342
  "type": "string"
2339
2343
  },
2340
2344
  "reviewer": {
2341
- "description": "Identity of the user who responded.",
2345
+ "description": "Identity-account id of the person who responded.",
2342
2346
  "type": "string"
2347
+ },
2348
+ "reviewer_actor": {
2349
+ "description": "Display snapshot of the reviewer, taken when they responded.",
2350
+ "properties": {
2351
+ "avatar": {
2352
+ "description": "Avatar URL; empty when unknown.",
2353
+ "type": "string"
2354
+ },
2355
+ "display_name": {
2356
+ "description": "Human-readable name; empty when unknown.",
2357
+ "type": "string"
2358
+ },
2359
+ "email": {
2360
+ "description": "Email address; empty when unknown.",
2361
+ "type": "string"
2362
+ },
2363
+ "id": {
2364
+ "description": "Identity-account id (the same value as reviewer).",
2365
+ "type": "string"
2366
+ }
2367
+ },
2368
+ "type": "object"
2343
2369
  }
2344
2370
  },
2345
2371
  "type": "object"