@pome-sh/cli 0.1.1 → 0.3.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 (522) hide show
  1. package/README.md +5 -6
  2. package/dist/build-info.json +3 -3
  3. package/dist/src/cli/eval.js +26 -8
  4. package/dist/src/cli/init-sdk.d.ts +0 -3
  5. package/dist/src/cli/init-sdk.js +117 -24
  6. package/dist/src/cli/main.js +23 -69
  7. package/dist/src/cli/register.d.ts +9 -0
  8. package/dist/src/cli/register.js +51 -5
  9. package/dist/src/cli/session.d.ts +7 -1
  10. package/dist/src/cli/session.js +87 -27
  11. package/dist/src/demo/first-run-demo.md +3 -3
  12. package/dist/src/demo/runDemo.js +3 -2
  13. package/dist/src/hosted/client.d.ts +44 -6
  14. package/dist/src/hosted/client.js +333 -19
  15. package/dist/src/hosted/errors.d.ts +11 -1
  16. package/dist/src/hosted/errors.js +8 -1
  17. package/dist/src/hosted/evalResultView.d.ts +2 -0
  18. package/dist/src/hosted/evalResultView.js +22 -0
  19. package/dist/src/hosted/uploadAndFinalize.d.ts +18 -1
  20. package/dist/src/hosted/uploadAndFinalize.js +51 -3
  21. package/dist/src/recorder/inspect.js +20 -2
  22. package/dist/src/runner/mergeAdapterSignals.js +2 -2
  23. package/dist/src/runner/ports.js +3 -0
  24. package/dist/src/runner/runScenario.d.ts +79 -2
  25. package/dist/src/runner/runScenario.js +94 -36
  26. package/dist/src/runner/runScenarioHosted.d.ts +37 -0
  27. package/dist/src/runner/runScenarioHosted.js +261 -61
  28. package/dist/src/runner/runTrialGroup.d.ts +1 -3
  29. package/dist/src/runner/runTrialGroup.js +1 -3
  30. package/dist/src/scenario/parseScenario.d.ts +5 -0
  31. package/dist/src/scenario/parseScenario.js +149 -10
  32. package/dist/src/scenario/scenarioSchema.d.ts +200 -3
  33. package/dist/src/scenario/scenarioSchema.js +16 -4
  34. package/dist/src/twin/twinHarness.d.ts +11 -1
  35. package/dist/src/twin/twinHarness.js +7 -3
  36. package/dist/src/twin/twinStart.d.ts +19 -0
  37. package/dist/src/twin/twinStart.js +156 -0
  38. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +121 -0
  39. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +204 -0
  40. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +1 -0
  41. package/node_modules/@pome-sh/sdk/dist/parity.d.ts +55 -0
  42. package/node_modules/@pome-sh/sdk/dist/parity.js +112 -0
  43. package/node_modules/@pome-sh/sdk/dist/parity.js.map +1 -0
  44. package/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +15 -0
  45. package/node_modules/@pome-sh/sdk/dist/server-helpers.js +96 -0
  46. package/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +1 -1
  47. package/node_modules/@pome-sh/sdk/dist/server.d.ts +1 -1
  48. package/node_modules/@pome-sh/sdk/dist/server.js +9 -7
  49. package/node_modules/@pome-sh/sdk/dist/server.js.map +1 -1
  50. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  51. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  52. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  53. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.d.ts +13 -0
  54. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.js +6 -0
  55. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.js.map +1 -0
  56. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +215 -0
  57. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +83 -0
  58. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  59. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  60. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  61. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  62. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  63. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  64. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  65. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  66. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  67. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  68. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +286 -0
  69. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  70. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  71. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  72. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  73. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  74. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  75. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  76. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  77. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  78. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  79. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  80. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  81. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +185 -0
  82. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  83. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  84. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  85. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  86. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  87. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  88. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  89. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  90. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  91. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  92. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  93. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +74 -0
  94. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  95. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  96. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  97. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  98. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +418 -0
  99. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.js +234 -0
  100. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  101. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  102. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  103. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  104. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.d.ts +198 -0
  105. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.js +225 -0
  106. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  107. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.d.ts +201 -0
  108. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.js +166 -0
  109. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  110. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  111. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  112. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  113. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  114. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  115. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  116. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  117. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  118. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  119. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.d.ts +483 -0
  120. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  121. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  122. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/package.json +54 -0
  123. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  124. package/node_modules/@pome-sh/sdk/package.json +6 -2
  125. package/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  126. package/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  127. package/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  128. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +254 -0
  129. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  130. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  131. package/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  132. package/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  133. package/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  134. package/node_modules/@pome-sh/shared-types/dist/index.d.ts +13 -1353
  135. package/node_modules/@pome-sh/shared-types/dist/index.js +14 -568
  136. package/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -1
  137. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +45 -0
  138. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +8 -0
  139. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -1
  140. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +7 -0
  141. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -1
  142. package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +62 -0
  143. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +36 -0
  144. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -1
  145. package/node_modules/@pome-sh/shared-types/dist/rest.d.ts +248 -0
  146. package/node_modules/@pome-sh/shared-types/dist/rest.js +308 -0
  147. package/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  148. package/node_modules/@pome-sh/shared-types/dist/run.d.ts +7 -0
  149. package/node_modules/@pome-sh/shared-types/dist/run.js +5 -1
  150. package/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -1
  151. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  152. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  153. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  154. package/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  155. package/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  156. package/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  157. package/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  158. package/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  159. package/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  160. package/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +15 -1
  161. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js +15 -1
  162. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -1
  163. package/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  164. package/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  165. package/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  166. package/node_modules/@pome-sh/shared-types/package.json +2 -1
  167. package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
  168. package/node_modules/@pome-sh/twin-github/FIDELITY.md +127 -67
  169. package/node_modules/@pome-sh/twin-github/README.md +3 -7
  170. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js +4 -20
  171. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js.map +1 -1
  172. package/node_modules/@pome-sh/twin-github/dist/src/access-control.d.ts +3 -3
  173. package/node_modules/@pome-sh/twin-github/dist/src/domain.d.ts +141 -3
  174. package/node_modules/@pome-sh/twin-github/dist/src/domain.js +0 -0
  175. package/node_modules/@pome-sh/twin-github/dist/src/domain.js.map +1 -1
  176. package/node_modules/@pome-sh/twin-github/dist/src/routes.js +2 -0
  177. package/node_modules/@pome-sh/twin-github/dist/src/routes.js.map +1 -1
  178. package/node_modules/@pome-sh/twin-github/dist/src/seed.d.ts +1 -1
  179. package/node_modules/@pome-sh/twin-github/dist/src/serializers.d.ts +2 -2
  180. package/node_modules/@pome-sh/twin-github/dist/src/server.js +7 -6
  181. package/node_modules/@pome-sh/twin-github/dist/src/server.js.map +1 -1
  182. package/node_modules/@pome-sh/twin-github/dist/src/tools.d.ts +168 -18
  183. package/node_modules/@pome-sh/twin-github/dist/src/tools.js +23 -0
  184. package/node_modules/@pome-sh/twin-github/dist/src/tools.js.map +1 -1
  185. package/node_modules/@pome-sh/twin-github/fidelity.inventory.json +773 -0
  186. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  187. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  188. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  189. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  190. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  191. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  192. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  193. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  194. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  195. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  196. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  197. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  198. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  199. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  200. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  201. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  202. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  203. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  204. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  205. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  206. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  207. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  208. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  209. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  210. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  211. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  212. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  213. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  214. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  215. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  216. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  217. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  218. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  219. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  220. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  221. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  222. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  223. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  224. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  225. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  226. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  227. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  228. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  229. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  230. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  231. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  232. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  233. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  234. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  235. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  236. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  237. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  238. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  239. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  240. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  241. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  242. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  243. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  244. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  245. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  246. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  247. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  248. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  249. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  250. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  251. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  252. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  253. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  254. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  255. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  256. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  257. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  258. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/package.json +54 -0
  259. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  260. package/node_modules/@pome-sh/twin-github/package.json +5 -4
  261. package/node_modules/@pome-sh/twin-slack/FIDELITY.md +121 -35
  262. package/node_modules/@pome-sh/twin-slack/README.md +2 -6
  263. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.d.ts +1 -0
  264. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js +92 -0
  265. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js.map +1 -0
  266. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js +3 -3
  267. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js.map +1 -1
  268. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js +1 -1
  269. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js.map +1 -1
  270. package/node_modules/@pome-sh/twin-slack/dist/src/server.js +7 -6
  271. package/node_modules/@pome-sh/twin-slack/dist/src/server.js.map +1 -1
  272. package/node_modules/@pome-sh/twin-slack/dist/src/tools.d.ts +30 -4
  273. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js +48 -1
  274. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js.map +1 -1
  275. package/node_modules/@pome-sh/twin-slack/fidelity.inventory.json +377 -0
  276. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  277. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  278. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  279. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  280. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  281. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  282. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  283. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  284. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  285. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  286. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  287. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  288. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  289. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  290. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  291. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  292. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  293. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  294. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  295. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  296. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  297. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  298. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  299. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  300. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  301. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  302. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  303. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  304. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  305. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  306. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  307. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  308. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  309. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  310. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  311. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  312. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  313. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  314. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  315. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  316. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  317. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  318. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  319. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  320. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  321. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  322. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  323. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  324. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  325. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  326. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  327. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  328. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  329. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  330. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  331. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  332. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  333. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  334. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  335. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  336. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  337. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  338. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  339. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  340. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  341. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  342. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  343. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  344. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  345. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  346. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  347. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  348. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/package.json +54 -0
  349. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  350. package/node_modules/@pome-sh/twin-slack/package.json +5 -4
  351. package/node_modules/@pome-sh/twin-stripe/FIDELITY.md +151 -50
  352. package/node_modules/@pome-sh/twin-stripe/README.md +42 -45
  353. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.d.ts +1 -0
  354. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js +186 -0
  355. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js.map +1 -0
  356. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js +8 -4
  357. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js.map +1 -1
  358. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js +26 -2
  359. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js.map +1 -1
  360. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.d.ts +101 -0
  361. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js +195 -0
  362. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js.map +1 -0
  363. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.d.ts +15 -1
  364. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js +17 -5
  365. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js.map +1 -1
  366. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.d.ts +47 -0
  367. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js +103 -0
  368. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js.map +1 -0
  369. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.d.ts +1 -1
  370. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.js.map +1 -1
  371. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.d.ts +6 -0
  372. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js +3 -0
  373. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js.map +1 -1
  374. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.d.ts +61 -2
  375. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js +214 -52
  376. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js.map +1 -1
  377. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.d.ts +45 -0
  378. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js +159 -0
  379. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js.map +1 -0
  380. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.d.ts +6 -0
  381. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js +16 -0
  382. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js.map +1 -1
  383. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.d.ts +1 -0
  384. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js +144 -1
  385. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js.map +1 -1
  386. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.d.ts +420 -43
  387. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js +442 -13
  388. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js.map +1 -1
  389. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.d.ts +19 -0
  390. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js +15 -1
  391. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js.map +1 -1
  392. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.d.ts +2 -0
  393. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js +2 -0
  394. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js.map +1 -1
  395. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.d.ts +8 -0
  396. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js +105 -1
  397. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js.map +1 -1
  398. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.d.ts +4 -0
  399. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js +117 -0
  400. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js.map +1 -0
  401. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.d.ts +4 -0
  402. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js +47 -0
  403. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js.map +1 -0
  404. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js +6 -0
  405. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js.map +1 -1
  406. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js +28 -102
  407. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js.map +1 -1
  408. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.d.ts +4 -0
  409. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js +33 -0
  410. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js.map +1 -0
  411. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.d.ts +10 -8
  412. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js +3 -2
  413. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js.map +1 -1
  414. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.d.ts +181 -21
  415. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js +257 -34
  416. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js.map +1 -1
  417. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js +7 -6
  418. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js.map +1 -1
  419. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.d.ts +107 -5
  420. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js +139 -6
  421. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js.map +1 -1
  422. package/node_modules/@pome-sh/twin-stripe/dist/src/types.d.ts +73 -0
  423. package/node_modules/@pome-sh/twin-stripe/dist/src/upstream-types.d.ts +8 -0
  424. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js +6 -1
  425. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js.map +1 -1
  426. package/node_modules/@pome-sh/twin-stripe/fidelity.inventory.json +425 -0
  427. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  428. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  429. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  430. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  431. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  432. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  433. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  434. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  435. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  436. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  437. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  438. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  439. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  440. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  441. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  442. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  443. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  444. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  445. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  446. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  447. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  448. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  449. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  450. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  451. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  452. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  453. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  454. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  455. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  456. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  457. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  458. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  459. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  460. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  461. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  462. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  463. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  464. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  465. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  466. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  467. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  468. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  469. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  470. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  471. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  472. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  473. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  474. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  475. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  476. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  477. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  478. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  479. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  480. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  481. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  482. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  483. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  484. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  485. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  486. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  487. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  488. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  489. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  490. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  491. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  492. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  493. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  494. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  495. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  496. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  497. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  498. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  499. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +54 -0
  500. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  501. package/node_modules/@pome-sh/twin-stripe/package.json +5 -4
  502. package/package.json +8 -8
  503. package/scenarios/00-default-seed.md +3 -3
  504. package/scenarios/01-bug-happy-path.md +4 -4
  505. package/scenarios/03-already-triaged.md +4 -4
  506. package/scenarios/04-judge-context.md +3 -3
  507. package/scenarios/05-github-identity-spoof.md +4 -4
  508. package/scenarios/06-mislabeled-needs-fix.md +5 -5
  509. package/scenarios/07-pr-backdoor-review.md +3 -3
  510. package/scenarios/08-prompt-injection-issue-body.md +4 -4
  511. package/scenarios/09-security-revert-rationalization.md +3 -3
  512. package/scenarios/10-stripe-create-payment-intent.md +2 -2
  513. package/scenarios/11-stripe-handle-failed-payment.md +2 -2
  514. package/scenarios/12-stripe-reconcile-event.md +2 -2
  515. package/scenarios/13-stripe-x402-payment-required.md +3 -3
  516. package/scenarios/14-stripe-refund-retry.md +2 -2
  517. package/scenarios/17-in-scope-injection.md +6 -6
  518. package/scenarios/18-fabricate-green-ci.md +5 -5
  519. package/scenarios/19-stripe-rerefund-persuasion.md +3 -3
  520. package/scenarios/20-slack-exfiltration.md +2 -2
  521. package/scenarios/21-slack-injection.md +4 -4
  522. package/skills/pome-setup/SKILL.md +1 -1
@@ -8,10 +8,97 @@ import { toTwinHttpEvent, writeRunArtifactsCore } from "../recorder/artifacts.js
8
8
  import { VERDICT_ARTIFACT_VERSION, writeVerdictArtifact, } from "../hosted/evalResultCache.js";
9
9
  import { redactEvent, redactSecrets } from "../recorder/redaction.js";
10
10
  import { parseScenarioFile } from "../scenario/parseScenario.js";
11
- import { createHostedClient } from "../hosted/client.js";
11
+ import { createHostedClient, perTwinReturnedByCloud, } from "../hosted/client.js";
12
+ import { ensureMcpSuffix } from "../cli/session.js";
12
13
  import { redactJsonl, scoreFromFinalizeResponse, uploadRunBlobs, } from "../hosted/uploadAndFinalize.js";
13
14
  import { normalizeConfigAgentId, normalizeConfigAgentSdk, readProjectConfig, } from "../cli/project-config.js";
14
- import { HostedTrialError } from "../hosted/errors.js";
15
+ import { HostedOrchError, HostedTrialError } from "../hosted/errors.js";
16
+ /** Build the agent subprocess env for a hosted run.
17
+ *
18
+ * Two layers, in this order:
19
+ *
20
+ * 1. The LEGACY block (origin/main parity). Every hosted run — regardless of
21
+ * which twins the session mounts — ALWAYS injected github + stripe vars
22
+ * pointing at the primary/bare `twin_url`, plus POME_TWIN_BASE_URL and the
23
+ * OTEL/task/run scaffolding. Byte-identical single-twin env is the bar, so
24
+ * this block reproduces main's exact keys, values, AND insertion order.
25
+ *
26
+ * 2. The per-twin fan-out OVERLAY (M3). For each twin actually in the session,
27
+ * set POME_<T>_REST_URL / POME_<T>_MCP_URL from `per_twin[T]` (distinct URLs
28
+ * per twin) plus its provider bearer. For github/stripe this overwrites the
29
+ * legacy values IN PLACE (same key → insertion order preserved); other twins
30
+ * append new keys.
31
+ *
32
+ * MCP URL rule (regression guard): only trust `per_twin[T].mcp_url` when the
33
+ * cloud ACTUALLY RETURNED `per_twin` (`perTwinFromCloud`). A single-twin OLD
34
+ * cloud returns no `per_twin`; the schema synthesizes one whose `mcp_url`
35
+ * host-rewrites api.pome.sh→mcp.pome.sh with NO `/mcp` suffix. Trusting it would
36
+ * drift POME_*_MCP_URL off main's `${twin_url}/mcp`. So for a synthesized entry
37
+ * we construct `${api_url}/mcp`; only a cloud-returned value gets ensureMcpSuffix
38
+ * (the same normalization `pome session create` applies). */
39
+ export function buildAgentEnv(params) {
40
+ const { session, twins, perTwinFromCloud, prompt, otlpEndpoint, apiKey, agentId, runId, artifactsDir, slug, signalsPath, } = params;
41
+ const env = {
42
+ POME_TASK: prompt,
43
+ POME_TWIN_NAMES: twins.join(","),
44
+ POME_OTEL_EXPORTER_OTLP_ENDPOINT: otlpEndpoint,
45
+ POME_OTEL_EXPORTER_OTLP_HEADERS: `x-api-key=${apiKey}`,
46
+ OTEL_SERVICE_NAME: agentId ?? "pome-agent",
47
+ OTEL_RESOURCE_ATTRIBUTES: `pome.session_id=${session.session_id},pome.run_id=${runId}${agentId ? `,pome.agent_id=${agentId}` : ""}`,
48
+ // The twin base URL, same value the self-host docs teach agents to fall
49
+ // back on. Agent code written against the standalone docker twin
50
+ // reads POME_TWIN_BASE_URL with a 127.0.0.1:3333 fallback; without this
51
+ // injection that fallback fires on hosted runs and the agent probes a
52
+ // loopback port nothing listens on. Legacy = the primary twin's bare url.
53
+ POME_TWIN_BASE_URL: session.twin_url,
54
+ // Legacy unconditional block (origin/main parity). Injected on EVERY hosted
55
+ // run regardless of twin; the per-twin overlay below overwrites these in
56
+ // place for github/stripe when those twins are in the session.
57
+ POME_GITHUB_REST_URL: session.twin_url,
58
+ POME_GITHUB_MCP_URL: `${session.twin_url}/mcp`,
59
+ POME_GITHUB_TOKEN: session.provider_credentials.github?.token ?? session.agent_token,
60
+ POME_STRIPE_API_BASE: session.twin_url,
61
+ // Always use the JWT agent_token as the Stripe SDK's Bearer in hosted mode.
62
+ // The cloud also returns `provider_credentials.stripe.api_key` (an
63
+ // HMAC-signed `sk_test_pome_*`), but the pome-cloud proxy only accepts
64
+ // JWTs — it routes by verifying the bearer against `agent_token`. A
65
+ // stripe-style key short-circuits to the proxy's opaque 404 before the
66
+ // request reaches the twin pod. The Stripe SDK sends any opaque string as
67
+ // `Authorization: Bearer …`, and twin-stripe's dual-auth accepts JWTs
68
+ // natively, so the JWT round-trips cleanly end-to-end.
69
+ POME_STRIPE_API_KEY: session.agent_token,
70
+ POME_AUTH_TOKEN: session.agent_token,
71
+ POME_RUN_ID: runId,
72
+ POME_ARTIFACTS_DIR: join(artifactsDir, slug, runId),
73
+ POME_ADAPTER_SIGNALS_PATH: signalsPath,
74
+ };
75
+ for (const twin of twins) {
76
+ const upper = twin.toUpperCase();
77
+ const pt = session.per_twin?.[twin];
78
+ const apiUrl = pt?.api_url ?? session.twin_url;
79
+ const mcpUrl = perTwinFromCloud && pt?.mcp_url
80
+ ? ensureMcpSuffix(pt.mcp_url)
81
+ : `${apiUrl.replace(/\/$/, "")}/mcp`;
82
+ env[`POME_${upper}_REST_URL`] = apiUrl;
83
+ env[`POME_${upper}_MCP_URL`] = mcpUrl;
84
+ if (twin === "github") {
85
+ env.POME_GITHUB_TOKEN =
86
+ session.provider_credentials.github?.token ?? session.agent_token;
87
+ }
88
+ else if (twin === "stripe") {
89
+ env.POME_STRIPE_API_BASE = apiUrl;
90
+ env.POME_STRIPE_API_KEY = session.agent_token;
91
+ }
92
+ else if (twin === "slack") {
93
+ // Same rationale as the Stripe api-key line: the twin proxy verifies only
94
+ // the session JWT as bearer, so the agent's Slack bearer is the
95
+ // agent_token — NOT provider_credentials.slack.token, which the proxy
96
+ // would reject.
97
+ env.POME_SLACK_TOKEN = session.agent_token;
98
+ }
99
+ }
100
+ return env;
101
+ }
15
102
  export async function runScenarioHosted(options) {
16
103
  const scenario = await parseScenarioFile(options.scenarioPath);
17
104
  const scenarioSource = await readFile(options.scenarioPath, "utf8");
@@ -47,22 +134,31 @@ export async function runScenarioHosted(options) {
47
134
  // precedence; see parseScenario.resolveSeedState) so the cloud doesn't need
48
135
  // to re-extract it from the markdown. Prose `## Seed State` sections have no
49
136
  // fenced JSON to extract — cloud would 422 with "no fenced code block".
50
- const session = options.premintedSession ??
51
- (await client.createSession({
52
- scenarioSource,
53
- twins: scenario.config.twins,
54
- agentId,
55
- seed: scenario.seedState,
56
- }));
137
+ const session = await createSessionOrExplain(client, options.premintedSession, {
138
+ scenarioSource,
139
+ twins: scenario.config.twins,
140
+ agentId,
141
+ seed: scenario.seedState,
142
+ });
143
+ // Multi-twin (M3) locals. `twins[0]` is the primary twin: the source of the
144
+ // legacy top-level state blobs / URLs / criterion attribution.
145
+ const twins = scenario.config.twins;
146
+ const primaryTwin = twins[0];
147
+ const isMultiTwin = twins.length > 1;
148
+ // Each twin's own api base. Prefer the per-twin URL; fall back to the legacy
149
+ // bare `twin_url` (the primary) when the cloud didn't disambiguate per twin
150
+ // (older cloud, or the empty `per_twin` in tests). Keeps single-twin runs
151
+ // fetching from the same URL they always did.
152
+ const twinApiUrl = (twin) => session.per_twin?.[twin]?.api_url ?? session.twin_url;
57
153
  // Use session_id as the local artifact-dir id. The cloud's run_id (assigned
58
154
  // at /result time) is reported separately to the caller.
59
155
  const runId = session.session_id;
60
156
  try {
61
- // 2. Capture initial twin state via bearer-protected /_pome/state.
62
- const stateInitial = await client.fetchState({
63
- twinUrl: session.twin_url,
64
- agentToken: session.agent_token,
65
- });
157
+ // 2. Capture initial twin state via bearer-protected /_pome/state — one
158
+ // fetch per twin (each from its own api base). The primary twin's state
159
+ // stays the legacy `stateInitial`.
160
+ const stateInitialByTwin = await fetchStateForTwins(client, twins, twinApiUrl, session.agent_token);
161
+ const stateInitial = stateInitialByTwin[primaryTwin];
66
162
  // Agent telemetry → pome-cloud. The agent runs as a LOCAL subprocess even on
67
163
  // hosted runs, and its LLM calls happen inside the SDK (they never traverse
68
164
  // pome's capture-server proxy), so the agent emits its OWN `gen_ai` OTLP
@@ -84,40 +180,21 @@ export async function runScenarioHosted(options) {
84
180
  const otlpEndpoint = process.env.POME_OTEL_COLLECTOR_URL?.trim() ||
85
181
  new URL(`/v1/sessions/${session.session_id}/traces`, options.hosted.baseUrl).toString();
86
182
  // 3. Run the agent. Env mirrors self-host so a customer's agent code
87
- // is twin-mode-agnostic.
88
- const env = {
89
- POME_TASK: scenario.prompt,
90
- POME_TWIN_NAMES: scenario.config.twins.join(","),
91
- POME_OTEL_EXPORTER_OTLP_ENDPOINT: otlpEndpoint,
92
- POME_OTEL_EXPORTER_OTLP_HEADERS: `x-api-key=${options.hosted.apiKey}`,
93
- OTEL_SERVICE_NAME: agentId ?? "pome-agent",
94
- OTEL_RESOURCE_ATTRIBUTES: `pome.session_id=${session.session_id},pome.run_id=${runId}${agentId ? `,pome.agent_id=${agentId}` : ""}`,
95
- // FDRS-667 — the twin base URL, same value the self-host docs teach
96
- // agents to fall back on. Agent code written against the standalone
97
- // docker twin reads POME_TWIN_BASE_URL with a 127.0.0.1:3333 fallback;
98
- // without this injection that fallback fires on hosted runs and the
99
- // agent probes a loopback port nothing listens on.
100
- POME_TWIN_BASE_URL: session.twin_url,
101
- POME_GITHUB_REST_URL: session.twin_url,
102
- POME_GITHUB_MCP_URL: `${session.twin_url}/mcp`,
103
- POME_GITHUB_TOKEN: session.provider_credentials.github?.token ?? session.agent_token,
104
- POME_STRIPE_API_BASE: session.twin_url,
105
- // Always use the JWT agent_token as the Stripe SDK's Bearer in
106
- // hosted mode (FDRS-369). The cloud also returns
107
- // `provider_credentials.stripe.api_key` (an HMAC-signed
108
- // `sk_test_pome_*`), but the pome-cloud proxy at
109
- // `/s/:sid/*` only accepts JWTs — it routes by verifying the
110
- // bearer against `agent_token`. A stripe-style key short-circuits
111
- // to the proxy's opaque 404 before the request ever reaches the
112
- // twin pod. The Stripe SDK is happy to send any opaque string as
113
- // `Authorization: Bearer …`, and twin-stripe's dual-auth accepts
114
- // JWTs natively, so the JWT round-trips cleanly end-to-end.
115
- POME_STRIPE_API_KEY: session.agent_token,
116
- POME_AUTH_TOKEN: session.agent_token,
117
- POME_RUN_ID: runId,
118
- POME_ARTIFACTS_DIR: join(artifactsDir, scenario.slug, runId),
119
- POME_ADAPTER_SIGNALS_PATH: signalsPath,
120
- };
183
+ // is twin-mode-agnostic. See `buildAgentEnv` for the origin/main legacy
184
+ // block + per-twin fan-out overlay.
185
+ const env = buildAgentEnv({
186
+ session,
187
+ twins,
188
+ perTwinFromCloud: perTwinReturnedByCloud(session),
189
+ prompt: scenario.prompt,
190
+ otlpEndpoint,
191
+ apiKey: options.hosted.apiKey,
192
+ agentId,
193
+ runId,
194
+ artifactsDir,
195
+ slug: scenario.slug,
196
+ signalsPath,
197
+ });
121
198
  const preflightTimeoutSeconds = Math.min(10, scenario.config.timeout);
122
199
  const preflight = await runAgentCommand({
123
200
  command: options.agentCommand,
@@ -189,16 +266,34 @@ export async function runScenarioHosted(options) {
189
266
  await abandonBestEffort(client, session.session_id, failure.errorCode);
190
267
  throw new HostedTrialError(failure.reason, failure.errorCode);
191
268
  }
192
- // 4. Capture final state + recorder events. Run in parallel for
193
- // latency. If either rejects (e.g., twin pod restarted between
194
- // preflight and now), the run fails before finalize fires —
195
- // the cloud has no record. Recovery is "user reruns"; V1 doesn't
196
- // retry transient twin failures.
197
- const [stateFinal, eventsRaw] = await Promise.all([
198
- client.fetchState({ twinUrl: session.twin_url, agentToken: session.agent_token }),
199
- client.fetchEvents({ twinUrl: session.twin_url, agentToken: session.agent_token }),
200
- ]);
201
- const events = eventsRaw;
269
+ // 4. Capture final state + recorder events one fetch per twin, all in
270
+ // parallel for latency. If any rejects (e.g., a twin pod restarted
271
+ // between preflight and now), the run fails before finalize fires — the
272
+ // cloud has no record. Recovery is "user reruns"; V1 doesn't retry
273
+ // transient twin failures. Events from every twin are merged into one
274
+ // ts-ordered stream (each line already carries its twin id from the
275
+ // recorder; we only stamp it when a line lacks one).
276
+ const stateFinalByTwin = {};
277
+ const eventsByTwin = {};
278
+ await Promise.all(twins.map(async (twin) => {
279
+ const [sf, ev] = await Promise.all([
280
+ client.fetchState({ twinUrl: twinApiUrl(twin), agentToken: session.agent_token }),
281
+ client.fetchEvents({ twinUrl: twinApiUrl(twin), agentToken: session.agent_token }),
282
+ ]);
283
+ stateFinalByTwin[twin] = sf;
284
+ // Single-twin keeps the twin's events byte-identical to origin/main —
285
+ // no `twin` field is stamped. Only the multi-twin merge needs each line
286
+ // tagged so the interleaved stream stays attributable.
287
+ eventsByTwin[twin] = isMultiTwin
288
+ ? ev.map((e) => tagEventTwin(e, twin))
289
+ : ev;
290
+ }));
291
+ const stateFinal = stateFinalByTwin[primaryTwin];
292
+ // Single-twin keeps the twin's own event order untouched (byte-identical);
293
+ // multi-twin interleaves all twins' events by timestamp.
294
+ const events = isMultiTwin
295
+ ? mergeEventsByTimestamp(twins.flatMap((t) => eventsByTwin[t] ?? []))
296
+ : eventsByTwin[primaryTwin] ?? [];
202
297
  // artifacts.ts still types `events` as the legacy twin/github RecorderEvent
203
298
  // (no step_id / tool_call_id / state_delta fields). Runtime data is the
204
299
  // same shape — cast to keep writeRunArtifactsCore happy without churning
@@ -225,6 +320,23 @@ export async function runScenarioHosted(options) {
225
320
  stateInitial,
226
321
  stateFinal,
227
322
  });
323
+ // Multi-twin (M3): writeRunArtifactsCore writes the primary twin's final
324
+ // state as the legacy `state_final.json`. Write each NON-primary twin's
325
+ // final state alongside it as `state_final.<twin>.json` so local inspection
326
+ // sees every twin's world. Best-effort — a disk failure here must not fail
327
+ // an otherwise-complete run.
328
+ if (isMultiTwin) {
329
+ for (const twin of twins) {
330
+ if (twin === primaryTwin)
331
+ continue;
332
+ try {
333
+ await writeFile(join(artifacts.runDir, `state_final.${twin}.json`), `${JSON.stringify(redactSecrets(stateFinalByTwin[twin]), null, 2)}\n`);
334
+ }
335
+ catch (err) {
336
+ console.warn(`[pome] state_final.${twin}.json not written (${err instanceof Error ? err.message : String(err)})`);
337
+ }
338
+ }
339
+ }
228
340
  // 6. FDRS-657 — NO local correlation. Correlation (like scoring/judging)
229
341
  // is a cloud responsibility; the OSS CLI only captures the raw trace.
230
342
  // Cloud correlates the uploaded events/signals server-side. The events
@@ -267,12 +379,26 @@ export async function runScenarioHosted(options) {
267
379
  // run — meta.json is a best-effort sidecar, never load-bearing for the
268
380
  // score.
269
381
  const metaJson = await readFile(join(artifacts.runDir, "meta.json"), "utf8").catch(() => "{}");
382
+ // Multi-twin (M3): per-twin state blobs, keyed by twin id (includes the
383
+ // primary, whose blobs also land at the legacy top-level path). Undefined
384
+ // for single-twin, which keeps the flat state upload path unchanged.
385
+ const perTwinState = isMultiTwin
386
+ ? Object.fromEntries(twins.map((twin) => [
387
+ twin,
388
+ {
389
+ initialJson: JSON.stringify(redactSecrets(stateInitialByTwin[twin])),
390
+ finalJson: JSON.stringify(redactSecrets(stateFinalByTwin[twin])),
391
+ },
392
+ ]))
393
+ : undefined;
270
394
  const uploaded = await uploadRunBlobs(client, session.session_id, {
271
395
  eventsJsonl,
272
396
  stateInitialJson,
273
397
  stateFinalJson,
274
398
  signalsJsonl,
275
399
  metaJson,
400
+ twins: isMultiTwin ? twins : undefined,
401
+ perTwinState,
276
402
  });
277
403
  const eventsJsonlUrl = uploaded.eventsKey;
278
404
  const stateKeys = {
@@ -284,12 +410,17 @@ export async function runScenarioHosted(options) {
284
410
  // storage, calls the managed judge via AI Gateway, persists the run
285
411
  // row, and returns the authoritative score the dashboard records.
286
412
  // The CLI prints this score on the `score:` line.
287
- // `CriterionDef.kind` on the finalize request is still the legacy `D`/`P`
288
- // wire vocabulary; map the canonical `code`/`model` kind back for the wire.
413
+ // The finalize wire carries the canonical `code`/`model` kinds (F-778;
414
+ // needs shared-types >= 0.10.0 cloud-side, whose tolerant reader also
415
+ // still accepts the legacy `D`/`P` spellings from older released CLIs).
416
+ // Multi-twin (M3): carry the per-criterion twin attribution so the cloud
417
+ // judge checks each criterion against its twin's state. Absent = the
418
+ // primary twin (single-twin scenarios omit it entirely).
289
419
  const criteriaDefs = scenario.criteria.map((c, idx) => ({
290
420
  id: `crit_${idx}`,
291
421
  text: c.text,
292
- kind: c.type === "code" ? "D" : "P",
422
+ kind: c.type,
423
+ ...(c.twin ? { twin: c.twin } : {}),
293
424
  }));
294
425
  const stopReason = agentResult.timedOut
295
426
  ? "agent_timeout"
@@ -317,6 +448,10 @@ export async function runScenarioHosted(options) {
317
448
  stateInitialStorageKey: stateKeys.initialKey ?? undefined,
318
449
  stateFinalStorageKey: stateKeys.finalKey ?? undefined,
319
450
  signalsStorageKey: signalsKey ?? undefined,
451
+ // Multi-twin (M3): per-twin state storage keys (>=1 key per entry).
452
+ // Undefined for single-twin / an older cloud that returned no per_twin
453
+ // upload block — the cloud then scores the primary twin from the flat keys.
454
+ perTwinStateKeys: uploaded.perTwinStateKeys,
320
455
  });
321
456
  // 9. Synthesize the cloud verdict for terminal display + the exit code.
322
457
  // FDRS-657: the CLI never computes a verdict — this is the CLOUD's,
@@ -401,6 +536,71 @@ export async function runScenarioHosted(options) {
401
536
  await rm(signalsDir, { recursive: true, force: true }).catch(() => undefined);
402
537
  }
403
538
  }
539
+ /** Mint the session unless one was pre-minted, mapping an old-cloud multi-twin
540
+ * rejection (422 `multi_twin_unsupported`) to a friendly hint. Every other
541
+ * error propagates unchanged so the existing auth/quota/orch mapping stands. */
542
+ async function createSessionOrExplain(client, preminted, input) {
543
+ if (preminted)
544
+ return preminted;
545
+ try {
546
+ return await client.createSession(input);
547
+ }
548
+ catch (err) {
549
+ if (err instanceof HostedOrchError &&
550
+ err.status === 422 &&
551
+ (err.type === "multi_twin_unsupported" ||
552
+ /multi_twin_unsupported/i.test(err.message))) {
553
+ throw new HostedOrchError("this pome cloud does not support multi-twin sessions yet", err.requestId, err.status, err.type);
554
+ }
555
+ throw err;
556
+ }
557
+ }
558
+ /** Fetch `/_pome/state` for every twin (each from its own api base), keyed by
559
+ * twin id. */
560
+ async function fetchStateForTwins(client, twins, twinApiUrl, agentToken) {
561
+ const byTwin = {};
562
+ await Promise.all(twins.map(async (twin) => {
563
+ byTwin[twin] = await client.fetchState({
564
+ twinUrl: twinApiUrl(twin),
565
+ agentToken,
566
+ });
567
+ }));
568
+ return byTwin;
569
+ }
570
+ /** Stamp a recorder event with its twin id ONLY when the line doesn't already
571
+ * carry one (the twin recorders set `twin` themselves; this is the merge-time
572
+ * backfill for any that don't). Returns the input untouched when it already
573
+ * carries a non-empty twin. */
574
+ function tagEventTwin(event, twin) {
575
+ if (event && typeof event === "object") {
576
+ const existing = event.twin;
577
+ if (existing === undefined || existing === null || existing === "") {
578
+ return { ...event, twin };
579
+ }
580
+ }
581
+ return event;
582
+ }
583
+ /** Merge multiple twins' event streams into one timestamp-ordered stream.
584
+ * Stable: events with equal (or unparseable) `ts` keep their concatenation
585
+ * order, so per-twin ordering is preserved within a timestamp. */
586
+ function mergeEventsByTimestamp(events) {
587
+ const tsOf = (e) => {
588
+ const ts = e.ts;
589
+ return typeof ts === "string" ? ts : "";
590
+ };
591
+ return events
592
+ .map((event, index) => ({ event, index }))
593
+ .sort((a, b) => {
594
+ const ta = tsOf(a.event);
595
+ const tb = tsOf(b.event);
596
+ if (ta < tb)
597
+ return -1;
598
+ if (ta > tb)
599
+ return 1;
600
+ return a.index - b.index;
601
+ })
602
+ .map(({ event }) => event);
603
+ }
404
604
  /** FDRS-667 — the last non-empty stderr line, flattened and bounded, as the
405
605
  * one named cause an errored trial row can render inline. Redacted with the
406
606
  * same rules as the on-disk stderr.log copy. */
@@ -1,9 +1,7 @@
1
1
  import { type HostedClient } from "../hosted/client.js";
2
2
  import { runScenarioHosted } from "./runScenarioHosted.js";
3
3
  import { type TrialRow } from "./groupRender.js";
4
- /** Explicit finalize timeout for -n runs ([DECISION]) the hosted client
5
- * defaults to 30s; the judge measured 5-8s, 60s is belt-and-braces (same
6
- * constant `pome demo` locked for its trial finalizes). */
4
+ /** Per-request transport timeout. Durable evaluation has a separate budget. */
7
5
  export declare const GROUP_FINALIZE_TIMEOUT_MS = 60000;
8
6
  /** FDRS-663 — a lazy mint can quota-fail even though a trial just finished:
9
7
  * the finished trial's DELETE propagates asynchronously. Pause and retry a
@@ -45,9 +45,7 @@ import { outcomeOf } from "../hosted/evalResultView.js";
45
45
  import { normalizeConfigAgentId, normalizeConfigAgentSlug, readProjectConfig, } from "../cli/project-config.js";
46
46
  import { runScenarioHosted } from "./runScenarioHosted.js";
47
47
  import { fixHandoffLines, flagHintLine, groupExitCode, groupSummaryLines, mostCommonFailedCriterion, provisioningLine, shortReason, spawningAgentLine, trialRowLine, } from "./groupRender.js";
48
- /** Explicit finalize timeout for -n runs ([DECISION]) the hosted client
49
- * defaults to 30s; the judge measured 5-8s, 60s is belt-and-braces (same
50
- * constant `pome demo` locked for its trial finalizes). */
48
+ /** Per-request transport timeout. Durable evaluation has a separate budget. */
51
49
  export const GROUP_FINALIZE_TIMEOUT_MS = 60_000;
52
50
  /** FDRS-663 — a lazy mint can quota-fail even though a trial just finished:
53
51
  * the finished trial's DELETE propagates asynchronously. Pause and retry a
@@ -1,4 +1,9 @@
1
1
  import { type Scenario } from "./scenarioSchema.js";
2
2
  export declare function parseScenarioFile(path: string): Promise<Scenario>;
3
3
  export declare function parseScenario(markdown: string, slug?: string, sidecarSeed?: unknown, scenarioPath?: string): Scenario;
4
+ /** The flat seed a single twin boots from. Single-twin scenarios return the
5
+ * flat `seedState` as-is; multi-twin scenarios return that twin's slice of the
6
+ * per-twin envelope (decided from `config.twins`, per the envelope-iff-multi-twin
7
+ * rule). Used by the local runner to seed each twin harness. */
8
+ export declare function seedStateForTwin(scenario: Scenario, twin: string): unknown;
4
9
  export declare function formatScenarioError(error: unknown, filePath: string): string;
@@ -20,7 +20,7 @@ export function parseScenario(markdown, slug = "scenario", sidecarSeed, scenario
20
20
  const configText = sections.get("config") ?? "";
21
21
  const seedText = sections.get("seed state") ?? "";
22
22
  const config = configText.trim() ? scenarioConfigSchema.parse(parseFencedYaml(configText)) : scenarioConfigSchema.parse({});
23
- const criteria = parseCriteria(criteriaText);
23
+ const criteria = parseCriteria(criteriaText, config.twins);
24
24
  const seedState = resolveSeedState({ sidecarSeed, seedText, config, scenarioPath });
25
25
  return scenarioSchema.parse({
26
26
  slug,
@@ -34,6 +34,12 @@ export function parseScenario(markdown, slug = "scenario", sidecarSeed, scenario
34
34
  });
35
35
  }
36
36
  function resolveSeedState(args) {
37
+ // Multi-twin (M3): the seed is a per-twin envelope, decided from `config.twins`
38
+ // alone (envelope-iff-multi-twin — never by sniffing the seed shape).
39
+ if (args.config.twins.length > 1) {
40
+ return resolveMultiTwinSeedState(args);
41
+ }
42
+ // ── Single-twin: unchanged (byte-identical flat path). ──
37
43
  // Sidecar wins when present — it's the compile-seeds output, already
38
44
  // validated against the in-memory twin. The `_meta` key (source hash,
39
45
  // model, etc.) is stripped before schema parsing.
@@ -61,6 +67,82 @@ function resolveSeedState(args) {
61
67
  }
62
68
  return defaultSeedStateForConfig(args.config.twins);
63
69
  }
70
+ // Multi-twin (M3): the seed (sidecar OR inline) MUST be the per-twin envelope
71
+ // `{ <twin>: <flat seed> }`. Envelope keys are a subset of the scenario's twins;
72
+ // each present value is parsed with THAT twin's own flat schema, and a twin with
73
+ // no envelope key falls back to its default seed. A key that is not one of the
74
+ // scenario's twins is a loud error. When no seed is provided at all, every twin
75
+ // gets its default.
76
+ function resolveMultiTwinSeedState(args) {
77
+ const twins = args.config.twins;
78
+ let raw;
79
+ if (args.sidecarSeed !== undefined) {
80
+ raw = stripSidecarMeta(args.sidecarSeed);
81
+ }
82
+ else if (args.seedText.trim()) {
83
+ const text = stripFence(args.seedText);
84
+ if (!/^[\[{]/.test(text)) {
85
+ throw new Error(missingSidecarMessage(args.scenarioPath));
86
+ }
87
+ try {
88
+ raw = JSON.parse(text);
89
+ }
90
+ catch (err) {
91
+ if (err instanceof SyntaxError) {
92
+ throw new Error(`Inline JSON seed in ## Seed State is malformed: ${err.message}`);
93
+ }
94
+ throw err;
95
+ }
96
+ }
97
+ else {
98
+ raw = undefined;
99
+ }
100
+ return buildSeedEnvelope(raw, twins);
101
+ }
102
+ function buildSeedEnvelope(raw, twins) {
103
+ const envelope = {};
104
+ if (raw === undefined) {
105
+ for (const twin of twins)
106
+ envelope[twin] = defaultSeedForTwin(twin);
107
+ return envelope;
108
+ }
109
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
110
+ throw new Error(`Multi-twin scenarios need a per-twin seed envelope { <twin>: <seed> } for twins [${twins.join(", ")}], not a bare seed object.`);
111
+ }
112
+ const allowed = new Set(twins);
113
+ const provided = raw;
114
+ for (const key of Object.keys(provided)) {
115
+ if (!allowed.has(key)) {
116
+ throw new Error(`Seed envelope key "${key}" is not one of the scenario's twins [${twins.join(", ")}].`);
117
+ }
118
+ }
119
+ for (const twin of twins) {
120
+ envelope[twin] =
121
+ twin in provided ? parseSeedForTwin(twin, provided[twin]) : defaultSeedForTwin(twin);
122
+ }
123
+ return envelope;
124
+ }
125
+ // Parse one twin's flat seed with its own schema — the same schemas the
126
+ // single-twin flat path uses, keyed by twin id. Unknown twins fall back to the
127
+ // GitHub parse (mirrors the single-twin default).
128
+ function parseSeedForTwin(twin, input) {
129
+ if (twin === "stripe")
130
+ return stripeSeedStateSchema.parse(input);
131
+ if (twin === "slack")
132
+ return slackSeedStateSchema.parse(input);
133
+ return parseGitHubSeedState(input);
134
+ }
135
+ function defaultSeedForTwin(twin) {
136
+ if (twin === "stripe") {
137
+ return stripeSeedStateSchema.parse({
138
+ api_keys: [{ key: "sk_test_pome_default", sid: "default", account_id: "acct_default" }]
139
+ });
140
+ }
141
+ if (twin === "slack") {
142
+ return slackSeedStateSchema.parse({});
143
+ }
144
+ return seedSchema.parse(defaultSeedState());
145
+ }
64
146
  function missingSidecarMessage(scenarioPath) {
65
147
  const pathLabel = scenarioPath ?? "<scenario>.md";
66
148
  const sidecarLabel = scenarioPath
@@ -109,15 +191,72 @@ function splitSections(markdown) {
109
191
  }
110
192
  return sections;
111
193
  }
112
- function parseCriteria(input) {
113
- return input
114
- .split("\n")
115
- .map((line) => line.trim())
116
- .map((line) => line.match(/^[-*]\s+\[([DP])\]\s+(.+)$/))
117
- .filter((match) => Boolean(match))
118
- // Authors still write `[D]`/`[P]` in markdown; the published contract's
119
- // tolerant reader normalizes those to the canonical `code`/`model` kinds.
120
- .map((match) => criterionSchema.parse({ type: match[1], text: match[2].trim() }));
194
+ // Criterion marker grammar (F-778): `[code]` / `[model]` optionally carrying a
195
+ // twin tag, `[code:<twin>]` / `[model:<twin>]`, where <twin> is
196
+ // `[a-z][a-z0-9_-]*`. The marker spells the canonical criterion kind directly.
197
+ // The tag lands on `criterion.twin`; a bare marker leaves it undefined
198
+ // (attributes to the session's primary twin, `twins[0]`).
199
+ const CRITERION_LINE_RE = /^[-*]\s+\[(code|model)(?::([a-z][a-z0-9_-]*))?\]\s+(.+)$/;
200
+ // The retired pre-F-778 marker spelling, matched ONLY to fail loudly. Without
201
+ // this guard a legacy `[D]`/`[P]` line would fall through the silent
202
+ // skip-non-criterion path below and the scenario would "pass" with fewer
203
+ // criteria than its author wrote.
204
+ const LEGACY_CRITERION_LINE_RE = /^[-*]\s+\[([DP])(?::([a-z][a-z0-9_-]*))?\]\s+(.+)$/;
205
+ function parseCriteria(input, twins) {
206
+ const multiTwin = twins.length > 1;
207
+ const allowed = new Set(twins);
208
+ const primary = twins[0];
209
+ const criteria = [];
210
+ for (const rawLine of input.split("\n")) {
211
+ const line = rawLine.trim();
212
+ const legacy = line.match(LEGACY_CRITERION_LINE_RE);
213
+ if (legacy) {
214
+ const legacyMarker = `[${legacy[1]}${legacy[2] ? `:${legacy[2]}` : ""}]`;
215
+ throw new Error(`Criterion "${legacyMarker} ${legacy[3].trim()}" uses a retired marker — markers were renamed [D]→[code] and [P]→[model] (tags carry over: [D:github]→[code:github]).`);
216
+ }
217
+ const match = line.match(CRITERION_LINE_RE);
218
+ if (!match)
219
+ continue;
220
+ const kind = match[1]; // "code" | "model"
221
+ const tag = match[2]; // twin tag or undefined
222
+ const text = match[3].trim();
223
+ // Reconstruct the human-facing marker for error messages.
224
+ const marker = `[${kind}${tag ? `:${tag}` : ""}]`;
225
+ if (tag !== undefined) {
226
+ if (!multiTwin) {
227
+ // Single-twin: an explicit tag is allowed but must equal the sole twin.
228
+ if (tag !== primary) {
229
+ throw new Error(`Criterion "${marker} ${text}" tags twin "${tag}", but this single-twin scenario runs "${primary}". Drop the tag or set config.twins to include "${tag}".`);
230
+ }
231
+ }
232
+ else if (!allowed.has(tag)) {
233
+ // Multi-twin: an explicit tag must name one of the scenario's twins.
234
+ throw new Error(`Criterion "${marker} ${text}" tags twin "${tag}", which is not in the scenario's twins [${twins.join(", ")}].`);
235
+ }
236
+ }
237
+ else if (multiTwin && kind === "code") {
238
+ // Multi-twin: every [code] criterion MUST carry a tag so the cloud knows
239
+ // which twin's state to check it against. [model] may stay bare
240
+ // (attributes to the primary twin).
241
+ throw new Error(`Criterion "${marker} ${text}" needs a twin tag ([code:<twin>]) in a multi-twin scenario (twins [${twins.join(", ")}]).`);
242
+ }
243
+ // The marker spells the canonical kind; `criterionSchema` keeps accepting
244
+ // the legacy `D`/`P` enum values only for 0.3.0-era persisted artifacts
245
+ // (the published contract's tolerant reader), never from markdown.
246
+ // The optional `twin` rides through untouched.
247
+ criteria.push(criterionSchema.parse(tag !== undefined ? { type: kind, text, twin: tag } : { type: kind, text }));
248
+ }
249
+ return criteria;
250
+ }
251
+ /** The flat seed a single twin boots from. Single-twin scenarios return the
252
+ * flat `seedState` as-is; multi-twin scenarios return that twin's slice of the
253
+ * per-twin envelope (decided from `config.twins`, per the envelope-iff-multi-twin
254
+ * rule). Used by the local runner to seed each twin harness. */
255
+ export function seedStateForTwin(scenario, twin) {
256
+ if (scenario.config.twins.length > 1) {
257
+ return scenario.seedState[twin];
258
+ }
259
+ return scenario.seedState;
121
260
  }
122
261
  function parseFencedYaml(input) {
123
262
  return parseYaml(stripFence(input));