stageflow 0.40.0 → 0.42.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 (326) hide show
  1. package/README.md +3 -1
  2. package/dist/agents/authorChat.d.ts +4 -0
  3. package/dist/agents/authorChat.js +113 -12
  4. package/dist/agents/authorSessionStore.d.ts +35 -0
  5. package/dist/agents/authorSessionStore.js +152 -0
  6. package/dist/agents/chatTurn.d.ts +2 -0
  7. package/dist/agents/chatTurn.js +17 -1
  8. package/dist/agents/errors.d.ts +1 -1
  9. package/dist/agents/errors.js +1 -0
  10. package/dist/agents/evalGate.d.ts +61 -0
  11. package/dist/agents/evalGate.js +103 -0
  12. package/dist/agents/evalSession.d.ts +26 -0
  13. package/dist/agents/evalSession.js +29 -0
  14. package/dist/agents/hostContext.d.ts +3 -0
  15. package/dist/agents/hostContext.js +4 -1
  16. package/dist/agents/runtime/piRuntime.d.ts +1 -1
  17. package/dist/agents/runtime/piRuntime.js +4 -4
  18. package/dist/agents/runtime/types.d.ts +3 -1
  19. package/dist/agents/service.d.ts +27 -2
  20. package/dist/agents/service.js +88 -13
  21. package/dist/agents/sessions.d.ts +8 -0
  22. package/dist/agents/sessions.js +50 -10
  23. package/dist/agents/store.d.ts +14 -3
  24. package/dist/agents/store.js +45 -7
  25. package/dist/agents/toolRisk.d.ts +21 -0
  26. package/dist/agents/toolRisk.js +50 -0
  27. package/dist/cli/doctorCommand.js +26 -0
  28. package/dist/cli/evalCommand.d.ts +20 -0
  29. package/dist/cli/evalCommand.js +720 -0
  30. package/dist/cli/exportAllCommand.js +1 -1
  31. package/dist/cli/hostClient.d.ts +60 -0
  32. package/dist/cli/hostClient.js +71 -0
  33. package/dist/cli/validateOutput.d.ts +2 -2
  34. package/dist/cli/validateOutput.js +2 -2
  35. package/dist/cli.js +10 -0
  36. package/dist/config/atomicWrite.d.ts +15 -0
  37. package/dist/config/atomicWrite.js +43 -0
  38. package/dist/config/browseCatalog.d.ts +2 -0
  39. package/dist/config/browseCatalog.js +4 -2
  40. package/dist/config/csv.d.ts +9 -0
  41. package/dist/config/csv.js +81 -0
  42. package/dist/config/datasetAgentCheck.d.ts +18 -0
  43. package/dist/config/datasetAgentCheck.js +109 -0
  44. package/dist/config/datasetCandidates.d.ts +22 -0
  45. package/dist/config/datasetCandidates.js +86 -0
  46. package/dist/config/datasetFromSessions.d.ts +34 -0
  47. package/dist/config/datasetFromSessions.js +105 -0
  48. package/dist/config/datasetHash.d.ts +1 -0
  49. package/dist/config/datasetHash.js +4 -0
  50. package/dist/config/datasetImport.d.ts +21 -0
  51. package/dist/config/datasetImport.js +120 -0
  52. package/dist/config/datasetStageCheck.d.ts +9 -0
  53. package/dist/config/datasetStageCheck.js +17 -0
  54. package/dist/config/datasetTypes.d.ts +27 -0
  55. package/dist/config/datasetTypes.js +1 -0
  56. package/dist/config/ensureCatalogScanRoot.d.ts +2 -1
  57. package/dist/config/ensureCatalogScanRoot.js +2 -6
  58. package/dist/config/evalCatalog.d.ts +22 -0
  59. package/dist/config/evalCatalog.js +67 -0
  60. package/dist/config/evalWriteRoots.d.ts +17 -0
  61. package/dist/config/evalWriteRoots.js +109 -0
  62. package/dist/config/hostConfig.js +1 -0
  63. package/dist/config/installEvalSample.d.ts +34 -0
  64. package/dist/config/installEvalSample.js +182 -0
  65. package/dist/config/loadDataset.d.ts +16 -0
  66. package/dist/config/loadDataset.js +318 -0
  67. package/dist/config/loadEval.d.ts +32 -0
  68. package/dist/config/loadEval.js +1085 -0
  69. package/dist/config/loadOutcome.d.ts +5 -0
  70. package/dist/config/loadStageflowManifest.js +64 -0
  71. package/dist/config/resolveAgentTarget.d.ts +32 -0
  72. package/dist/config/resolveAgentTarget.js +118 -0
  73. package/dist/config/resolveEvalTarget.d.ts +21 -0
  74. package/dist/config/resolveEvalTarget.js +89 -0
  75. package/dist/config/scanCatalogPaths.d.ts +1 -1
  76. package/dist/config/scanCatalogPaths.js +17 -5
  77. package/dist/config/validateCatalog.d.ts +1 -1
  78. package/dist/config/validateCatalog.js +9 -1
  79. package/dist/config/validateEval.d.ts +36 -0
  80. package/dist/config/validateEval.js +405 -0
  81. package/dist/config/writeDataset.d.ts +54 -0
  82. package/dist/config/writeDataset.js +186 -0
  83. package/dist/config/writeEval.d.ts +25 -0
  84. package/dist/config/writeEval.js +398 -0
  85. package/dist/diagnostics/checks.js +1 -1
  86. package/dist/evals/agentDiff.d.ts +13 -0
  87. package/dist/evals/agentDiff.js +11 -0
  88. package/dist/evals/canonical.d.ts +3 -0
  89. package/dist/evals/canonical.js +24 -0
  90. package/dist/evals/caseTask.d.ts +3 -0
  91. package/dist/evals/caseTask.js +9 -0
  92. package/dist/evals/compare.d.ts +94 -0
  93. package/dist/evals/compare.js +201 -0
  94. package/dist/evals/constants.d.ts +60 -0
  95. package/dist/evals/constants.js +95 -0
  96. package/dist/evals/engine/FakeEngine.d.ts +33 -0
  97. package/dist/evals/engine/FakeEngine.js +176 -0
  98. package/dist/evals/engine/index.d.ts +9 -0
  99. package/dist/evals/engine/index.js +19 -0
  100. package/dist/evals/engine/promptfoo/PromptfooEngine.d.ts +52 -0
  101. package/dist/evals/engine/promptfoo/PromptfooEngine.js +311 -0
  102. package/dist/evals/engine/promptfoo/errors.d.ts +5 -0
  103. package/dist/evals/engine/promptfoo/errors.js +8 -0
  104. package/dist/evals/engine/promptfoo/generate.d.ts +30 -0
  105. package/dist/evals/engine/promptfoo/generate.js +342 -0
  106. package/dist/evals/engine/promptfoo/guard.d.ts +10 -0
  107. package/dist/evals/engine/promptfoo/guard.js +116 -0
  108. package/dist/evals/engine/promptfoo/install.d.ts +17 -0
  109. package/dist/evals/engine/promptfoo/install.js +73 -0
  110. package/dist/evals/engine/promptfoo/judgeProviders.d.ts +2 -0
  111. package/dist/evals/engine/promptfoo/judgeProviders.js +9 -0
  112. package/dist/evals/engine/promptfoo/judgeServices.d.ts +6 -0
  113. package/dist/evals/engine/promptfoo/judgeServices.js +41 -0
  114. package/dist/evals/engine/promptfoo/locate.d.ts +21 -0
  115. package/dist/evals/engine/promptfoo/locate.js +68 -0
  116. package/dist/evals/engine/promptfoo/nodeVersion.d.ts +7 -0
  117. package/dist/evals/engine/promptfoo/nodeVersion.js +14 -0
  118. package/dist/evals/engine/promptfoo/normalize.d.ts +66 -0
  119. package/dist/evals/engine/promptfoo/normalize.js +261 -0
  120. package/dist/evals/engine/promptfoo/pinned.d.ts +5 -0
  121. package/dist/evals/engine/promptfoo/pinned.js +5 -0
  122. package/dist/evals/engine/promptfoo/rubricPrompt.d.ts +14 -0
  123. package/dist/evals/engine/promptfoo/rubricPrompt.js +103 -0
  124. package/dist/evals/engine/promptfoo/runTokens.d.ts +18 -0
  125. package/dist/evals/engine/promptfoo/runTokens.js +31 -0
  126. package/dist/evals/engine/promptfoo/status.d.ts +13 -0
  127. package/dist/evals/engine/promptfoo/status.js +16 -0
  128. package/dist/evals/estimate.d.ts +56 -0
  129. package/dist/evals/estimate.js +66 -0
  130. package/dist/evals/graders/codeGrader.d.ts +6 -0
  131. package/dist/evals/graders/codeGrader.js +85 -0
  132. package/dist/evals/graders/conversationCheckGrader.d.ts +6 -0
  133. package/dist/evals/graders/conversationCheckGrader.js +62 -0
  134. package/dist/evals/graders/fieldGrader.d.ts +11 -0
  135. package/dist/evals/graders/fieldGrader.js +117 -0
  136. package/dist/evals/graders/goal.d.ts +3 -0
  137. package/dist/evals/graders/goal.js +14 -0
  138. package/dist/evals/graders/index.d.ts +18 -0
  139. package/dist/evals/graders/index.js +34 -0
  140. package/dist/evals/graders/notApplicable.d.ts +5 -0
  141. package/dist/evals/graders/notApplicable.js +9 -0
  142. package/dist/evals/graders/path.d.ts +26 -0
  143. package/dist/evals/graders/path.js +75 -0
  144. package/dist/evals/graders/referenceGrader.d.ts +5 -0
  145. package/dist/evals/graders/referenceGrader.js +59 -0
  146. package/dist/evals/graders/schemaGrader.d.ts +5 -0
  147. package/dist/evals/graders/schemaGrader.js +29 -0
  148. package/dist/evals/graders/subject.d.ts +6 -0
  149. package/dist/evals/graders/subject.js +33 -0
  150. package/dist/evals/graders/toolCallsGrader.d.ts +6 -0
  151. package/dist/evals/graders/toolCallsGrader.js +100 -0
  152. package/dist/evals/graders/transcript.d.ts +12 -0
  153. package/dist/evals/graders/transcript.js +57 -0
  154. package/dist/evals/graders/types.d.ts +20 -0
  155. package/dist/evals/graders/types.js +1 -0
  156. package/dist/evals/judgeProviders.d.ts +16 -0
  157. package/dist/evals/judgeProviders.js +27 -0
  158. package/dist/evals/lineDiff.d.ts +5 -0
  159. package/dist/evals/lineDiff.js +34 -0
  160. package/dist/evals/listStatus.d.ts +31 -0
  161. package/dist/evals/listStatus.js +48 -0
  162. package/dist/evals/manager.d.ts +174 -0
  163. package/dist/evals/manager.js +787 -0
  164. package/dist/evals/plan.d.ts +58 -0
  165. package/dist/evals/plan.js +602 -0
  166. package/dist/evals/providerKeys.d.ts +1 -0
  167. package/dist/evals/providerKeys.js +21 -0
  168. package/dist/evals/read/agentTargets.d.ts +37 -0
  169. package/dist/evals/read/agentTargets.js +101 -0
  170. package/dist/evals/read/api.d.ts +196 -0
  171. package/dist/evals/read/api.js +358 -0
  172. package/dist/evals/read/compare.d.ts +4 -0
  173. package/dist/evals/read/compare.js +39 -0
  174. package/dist/evals/read/datasets.d.ts +105 -0
  175. package/dist/evals/read/datasets.js +318 -0
  176. package/dist/evals/read/list.d.ts +66 -0
  177. package/dist/evals/read/list.js +173 -0
  178. package/dist/evals/read/results.d.ts +46 -0
  179. package/dist/evals/read/results.js +107 -0
  180. package/dist/evals/read/runs.d.ts +149 -0
  181. package/dist/evals/read/runs.js +289 -0
  182. package/dist/evals/read/suggestions.d.ts +43 -0
  183. package/dist/evals/read/suggestions.js +73 -0
  184. package/dist/evals/runner/FakeAgentBackend.d.ts +40 -0
  185. package/dist/evals/runner/FakeAgentBackend.js +82 -0
  186. package/dist/evals/runner/agentCaseRunner.d.ts +24 -0
  187. package/dist/evals/runner/agentCaseRunner.js +388 -0
  188. package/dist/evals/runner/caseRunner.d.ts +7 -0
  189. package/dist/evals/runner/caseRunner.js +17 -0
  190. package/dist/evals/runner/conversationSubject.d.ts +18 -0
  191. package/dist/evals/runner/conversationSubject.js +123 -0
  192. package/dist/evals/runner/simulatorModel.d.ts +51 -0
  193. package/dist/evals/runner/simulatorModel.js +58 -0
  194. package/dist/evals/runner/simulatorPrompt.d.ts +29 -0
  195. package/dist/evals/runner/simulatorPrompt.js +59 -0
  196. package/dist/evals/runner/stageCaseRunner.d.ts +30 -0
  197. package/dist/evals/runner/stageCaseRunner.js +279 -0
  198. package/dist/evals/runner/userDriver.d.ts +71 -0
  199. package/dist/evals/runner/userDriver.js +104 -0
  200. package/dist/evals/scoring.d.ts +34 -0
  201. package/dist/evals/scoring.js +67 -0
  202. package/dist/evals/snapshot.d.ts +183 -0
  203. package/dist/evals/snapshot.js +65 -0
  204. package/dist/evals/stageDiff.d.ts +8 -0
  205. package/dist/evals/stageDiff.js +48 -0
  206. package/dist/evals/stats.d.ts +95 -0
  207. package/dist/evals/stats.js +220 -0
  208. package/dist/evals/statsAdapter.d.ts +4 -0
  209. package/dist/evals/statsAdapter.js +30 -0
  210. package/dist/evals/statsTypes.d.ts +51 -0
  211. package/dist/evals/statsTypes.js +18 -0
  212. package/dist/evals/storeError.d.ts +5 -0
  213. package/dist/evals/storeError.js +8 -0
  214. package/dist/evals/storeTypes.d.ts +207 -0
  215. package/dist/evals/storeTypes.js +1 -0
  216. package/dist/evals/tTable.d.ts +3 -0
  217. package/dist/evals/tTable.js +15 -0
  218. package/dist/evals/triage/constants.d.ts +26 -0
  219. package/dist/evals/triage/constants.js +33 -0
  220. package/dist/evals/triage/credentials.d.ts +13 -0
  221. package/dist/evals/triage/credentials.js +20 -0
  222. package/dist/evals/triage/jevClassifier.d.ts +14 -0
  223. package/dist/evals/triage/jevClassifier.js +124 -0
  224. package/dist/evals/triage/judgeClassifier.d.ts +10 -0
  225. package/dist/evals/triage/judgeClassifier.js +76 -0
  226. package/dist/evals/triage/prompts.d.ts +16 -0
  227. package/dist/evals/triage/prompts.js +64 -0
  228. package/dist/evals/triage/service.d.ts +79 -0
  229. package/dist/evals/triage/service.js +217 -0
  230. package/dist/evals/triage/stateBuilder.d.ts +19 -0
  231. package/dist/evals/triage/stateBuilder.js +125 -0
  232. package/dist/evals/triage/types.d.ts +60 -0
  233. package/dist/evals/triage/types.js +8 -0
  234. package/dist/evals/types.d.ts +347 -0
  235. package/dist/evals/types.js +1 -0
  236. package/dist/mcp/deps.d.ts +7 -0
  237. package/dist/mcp/evalTools.d.ts +3 -0
  238. package/dist/mcp/evalTools.js +280 -0
  239. package/dist/mcp/server.js +1 -0
  240. package/dist/mcp/tools.js +2 -0
  241. package/dist/models/response.d.ts +7 -2
  242. package/dist/models/response.js +6 -1
  243. package/dist/operatorAgent/agentAuthorContext.d.ts +1 -1
  244. package/dist/operatorAgent/agentAuthorContext.js +1 -1
  245. package/dist/operatorAgent/piModel.js +17 -4
  246. package/dist/operatorAgent/profiles/agentAuthor.d.ts +3 -1
  247. package/dist/operatorAgent/profiles/agentAuthor.js +145 -20
  248. package/dist/operatorAgent/profiles/agentAuthorPlaybook.d.ts +1 -1
  249. package/dist/operatorAgent/profiles/agentAuthorPlaybook.js +48 -15
  250. package/dist/operatorAgent/profiles/authorReadable.d.ts +2 -0
  251. package/dist/operatorAgent/profiles/authorReadable.js +26 -0
  252. package/dist/package-meta.d.ts +1 -1
  253. package/dist/package-meta.js +1 -1
  254. package/dist/runstore/port.d.ts +43 -0
  255. package/dist/runstore/sqlite/SqliteRunStore.d.ts +28 -0
  256. package/dist/runstore/sqlite/SqliteRunStore.js +99 -5
  257. package/dist/runstore/sqlite/evalStore.d.ts +20 -0
  258. package/dist/runstore/sqlite/evalStore.js +541 -0
  259. package/dist/runstore/sqlite/migrations/015-evals.d.ts +12 -0
  260. package/dist/runstore/sqlite/migrations/015-evals.js +157 -0
  261. package/dist/runstore/sqlite/migrations/016-eval-subject-ref.d.ts +12 -0
  262. package/dist/runstore/sqlite/migrations/016-eval-subject-ref.js +20 -0
  263. package/dist/runstore/sqlite/migrations/017-eval-result-suggestions.d.ts +11 -0
  264. package/dist/runstore/sqlite/migrations/017-eval-result-suggestions.js +36 -0
  265. package/dist/runstore/sqlite/migrations/index.js +6 -0
  266. package/dist/runstore/sqlite/suggestionStore.d.ts +14 -0
  267. package/dist/runstore/sqlite/suggestionStore.js +132 -0
  268. package/dist/runtime/pipelineRunner.d.ts +2 -1
  269. package/dist/runtime/pipelineRunner.js +2 -0
  270. package/dist/runtime/runManager.d.ts +2 -1
  271. package/dist/runtime/runManager.js +8 -6
  272. package/dist/runtime/runRetentionSweep.js +2 -2
  273. package/dist/server/agentAuthorRoutes.js +50 -1
  274. package/dist/server/bootstrap.d.ts +8 -0
  275. package/dist/server/bootstrap.js +56 -0
  276. package/dist/server/controlToken.js +3 -0
  277. package/dist/server/evalInternalRoutes.d.ts +14 -0
  278. package/dist/server/evalInternalRoutes.js +87 -0
  279. package/dist/server/evalRouteContext.d.ts +46 -0
  280. package/dist/server/evalRouteContext.js +43 -0
  281. package/dist/server/evalRoutes.d.ts +5 -0
  282. package/dist/server/evalRoutes.js +1427 -0
  283. package/dist/server/evalTriageRoutes.d.ts +2 -0
  284. package/dist/server/evalTriageRoutes.js +95 -0
  285. package/dist/server/http.d.ts +5 -0
  286. package/dist/server/http.js +32 -2
  287. package/dist/server/mcpHost.js +3 -0
  288. package/dist/toolkit/meta.d.ts +1 -1
  289. package/dist/toolkit/meta.js +15 -0
  290. package/dist/toolkit/profiles.js +1 -1
  291. package/dist/types/stageflowManifest.d.ts +6 -0
  292. package/dist/ui/assets/AssistantRuntimeProvider-qIX1xNoH.js +9 -0
  293. package/dist/ui/assets/{MarkdownText-D7tYaIFO.js → MarkdownText-BTrOqu5J.js} +1 -1
  294. package/dist/ui/assets/chat-Df_wCpak.js +5 -0
  295. package/dist/ui/assets/chat-P7KQznHm.css +2 -0
  296. package/dist/ui/assets/{main-BFo79krC.css → main-CHlmTNJe.css} +1 -1
  297. package/dist/ui/assets/main-CvVfxmMd.js +271 -0
  298. package/dist/ui/chat.html +3 -3
  299. package/dist/ui/index.html +3 -3
  300. package/examples/README.md +2 -0
  301. package/examples/document-policy-review/README.md +35 -0
  302. package/examples/document-policy-review/agents/compliance.agent.yaml +42 -0
  303. package/examples/document-policy-review/documents/acme-vendor-sow.md +15 -0
  304. package/examples/document-policy-review/documents/support-runbook.md +13 -0
  305. package/examples/document-policy-review/policies/acceptable-use.md +13 -0
  306. package/examples/document-policy-review/policies/data-handling.md +17 -0
  307. package/examples/document-policy-review/policies/vendor-security.md +17 -0
  308. package/examples/evals/README.md +123 -0
  309. package/examples/evals/critique-sample.dataset.jsonl +8 -0
  310. package/examples/evals/critique-sample.eval.yaml +34 -0
  311. package/examples/evals/critique-sample.task.yaml +4 -0
  312. package/examples/evals/eval-sample.pipeline.yaml +35 -0
  313. package/examples/evals/support-sample.agent.yaml +20 -0
  314. package/examples/evals/support-sample.dataset.jsonl +6 -0
  315. package/examples/evals/support-sample.eval.yaml +38 -0
  316. package/examples/stageflow.yaml +6 -0
  317. package/package.json +1 -1
  318. package/skills/stageflow/SKILL.md +5 -2
  319. package/skills/stageflow/references/control-surface.md +4 -2
  320. package/skills/stageflow/references/evals.md +68 -0
  321. package/skills/stageflow-author/SKILL.md +4 -0
  322. package/skills/stageflow-run/SKILL.md +4 -0
  323. package/dist/ui/assets/AssistantRuntimeProvider-CsiPFhCT.js +0 -9
  324. package/dist/ui/assets/chat-BbLukq9W.js +0 -5
  325. package/dist/ui/assets/chat-zIZU_bP1.css +0 -2
  326. package/dist/ui/assets/main-CijYMeM0.js +0 -259
package/dist/ui/chat.html CHANGED
@@ -13,11 +13,11 @@
13
13
  </script>
14
14
  <link rel="icon" type="image/svg+xml" href="/stageflow-icon.svg" />
15
15
  <title>Chat</title>
16
- <script type="module" crossorigin src="/assets/chat-BbLukq9W.js"></script>
16
+ <script type="module" crossorigin src="/assets/chat-Df_wCpak.js"></script>
17
17
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-iVoFAvQ_.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/ReadonlyStore-BfXqHykm.js">
19
- <link rel="modulepreload" crossorigin href="/assets/AssistantRuntimeProvider-CsiPFhCT.js">
20
- <link rel="stylesheet" crossorigin href="/assets/chat-zIZU_bP1.css">
19
+ <link rel="modulepreload" crossorigin href="/assets/AssistantRuntimeProvider-qIX1xNoH.js">
20
+ <link rel="stylesheet" crossorigin href="/assets/chat-P7KQznHm.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -13,12 +13,12 @@
13
13
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap" />
14
14
  <link rel="icon" type="image/svg+xml" href="/stageflow-icon.svg" />
15
15
  <title>Stageflow</title>
16
- <script type="module" crossorigin src="/assets/main-CijYMeM0.js"></script>
16
+ <script type="module" crossorigin src="/assets/main-CvVfxmMd.js"></script>
17
17
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-iVoFAvQ_.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/ReadonlyStore-BfXqHykm.js">
19
- <link rel="modulepreload" crossorigin href="/assets/AssistantRuntimeProvider-CsiPFhCT.js">
19
+ <link rel="modulepreload" crossorigin href="/assets/AssistantRuntimeProvider-qIX1xNoH.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/Tooltip-DrpoRRNi.js">
21
- <link rel="stylesheet" crossorigin href="/assets/main-BFo79krC.css">
21
+ <link rel="stylesheet" crossorigin href="/assets/main-CHlmTNJe.css">
22
22
  </head>
23
23
  <body>
24
24
  <div id="root"></div>
@@ -37,6 +37,7 @@ More CI-focused examples will follow this pattern (prepare context → run pipel
37
37
  | [ship-feature](ship-feature/) | Plan → implement → parallel review → operator-approved PR | `sf validate`, then `sf run` |
38
38
  | [oss-issue-contribution](oss-issue-contribution/) | Real upstream issue: reproduce, parallel investigation, gated fix, verification, parallel review | [README](oss-issue-contribution/README.md), then `sf run` |
39
39
  | [oss-quick-fix](oss-quick-fix/) | Unattended sibling of oss-issue-contribution: straight-line fix with no operator gate | [README](oss-quick-fix/README.md), then `sf run` |
40
+ | [evals](evals/) | Eval of a critique stage: 8 cases; schema, field, reference and code graders; no judge | [README](evals/README.md), `sf validate --strict`, `sf eval run critique-sample` |
40
41
  | [github-release](github-release/) | Dogfood: draft + publish GitHub Release | Used in publish/release workflows |
41
42
  | [archify-on-pr](archify-on-pr/) | **Featured** — PR diagrams via Route `if` + Archify handoff | [README](archify-on-pr/README.md), archify-pr-diagrams workflow |
42
43
  | [ci-validate](ci-validate/) | Strict manifest validate in CI | `./validate.sh` |
@@ -45,6 +46,7 @@ More CI-focused examples will follow this pattern (prepare context → run pipel
45
46
  | [retry-tour](retry-tour/) | Retry surfaces: emit soft-reject, automatic repair, manual recover, ordinary Retry | `sf ui`, then pick `retry-tour` |
46
47
  | [mcp-hitl-tour](mcp-hitl-tour/) | MCP HITL tour: free_text gate, ungated fan-out + Clone Chain join, wait_for_human loop, artifacts | `sf ui` / MCP `start_run`, then [README](mcp-hitl-tour/README.md) |
47
48
  | [memory](memory/) | Two pipelines share one data-directory page: one writes a line, the next run reads it | Create `notebook` first, then [README](memory/README.md) |
49
+ | [document-policy-review](document-policy-review/) | Generic agent: compare a document to company policies in `policies/`, with the host chat page | [README](document-policy-review/README.md), then `docker compose up --build -d` |
48
50
 
49
51
  Current wiring tours: [`route-wiring-smoke-test`](route-wiring-smoke-test/), [`route-if-tour`](route-if-tour/).
50
52
 
@@ -0,0 +1,35 @@
1
+ # Document policy review
2
+
3
+ A generic compliance agent. It reads company policies in `policies/` and compares a document you name or paste. Swap the markdown in `policies/` and `documents/` for your own; the agent definition does not mention a particular control framework.
4
+
5
+ The chat page is part of the Stageflow host:
6
+
7
+ `http://127.0.0.1:3849/chat/policyreviewdemo1` (this worktree uses `docker-compose.policy-review.yml` because port 3847 is often taken locally)
8
+
9
+ Try:
10
+
11
+ - `Compare documents/acme-vendor-sow.md to our policies.`
12
+ - `Compare documents/support-runbook.md to our policies.`
13
+ - Paste a short contract clause and ask whether it meets `policies/vendor-security.md`.
14
+
15
+ `documents/acme-vendor-sow.md` conflicts with data handling, vendor security, and acceptable use (indefinite retention, no independent audit, a shared password written in the file, personal email, reuse for third-party models). `documents/support-runbook.md` follows those policies.
16
+
17
+ ## Docker
18
+
19
+ From the repository root, with `OPENROUTER_API_KEY` or `STAGEFLOW_PROVIDER_OPENROUTER_API_KEY` set:
20
+
21
+ ```bash
22
+ docker compose -p policy-review -f docker-compose.yml -f docker-compose.policy-review.yml up -d --build
23
+ ```
24
+
25
+ Compose bind-mounts this directory at `/catalog/document-policy-review` and registers it with `STAGEFLOW_ENSURE_PROJECT_ROOTS`, so the agent is available when the host starts. The console lists it under Agents. The model is `openrouter/nvidia/nemotron-3.5-lightning:free`.
26
+
27
+ `docker-compose.policy-review.yml` publishes the host on **3849** (when 3847 is already in use) and runs the process as the `stageflow` user so email state under `/data` can be created on first boot.
28
+
29
+ ## Files
30
+
31
+ | Path | Role |
32
+ |------|------|
33
+ | `agents/compliance.agent.yaml` | Enabled agent, read tools only, public chat slug `policyreviewdemo1` |
34
+ | `policies/` | Authority the agent must cite |
35
+ | `documents/` | Samples to review |
@@ -0,0 +1,42 @@
1
+ id: compliance
2
+ name: Policy compliance
3
+ description: Compares a document you name or paste against the company policies in this project.
4
+ greeting: Name a file under documents/ or paste the text. I will read policies/ and tell you what matches, what is missing, and what conflicts.
5
+ enabled: true
6
+ instructions: |
7
+ You compare provided documents against this project's company policies.
8
+
9
+ Corpus (paths are relative to the project root):
10
+ - policies/ is the only authority. Read those files before you judge.
11
+ - documents/ holds materials under review. A person may name one of those files or paste text in the chat.
12
+ - A pasted passage is the document under review. It is never a policy.
13
+
14
+ How to work:
15
+ 1. Use the read tools to list policies/ and read every policy that could apply. If you are unsure, read all of them. Do not rely on memory of a previous turn for policy text.
16
+ 2. If they name a path, read that file. Stay inside this project. If the path is missing, say so and stop.
17
+ 3. Compare the document to the policies you actually read. Quote the policy section and the document passage for every finding.
18
+ 4. Do not invent a rule, a control id, or a citation. If the policies are silent, say "not covered" instead of guessing.
19
+ 5. Do not rewrite the document unless they ask. Do not change files.
20
+
21
+ Reply in this shape:
22
+ - Document: file path or "pasted text"
23
+ - Verdict: compliant, gaps, or conflicts
24
+ - Findings: for each issue, policy file and section, quoted document passage, severity (high, medium, low), what is wrong, and the smallest change that would satisfy the policy
25
+ - Matches: requirements the document already meets, each with a policy citation
26
+ - Not covered: topics in the document that no policy addresses
27
+ Ask a question only when the text can be read two ways and the verdict depends on it.
28
+ model:
29
+ backend: pi
30
+ id: openrouter/nvidia/nemotron-3.5-lightning:free
31
+ thinking: medium
32
+ tools:
33
+ builtin:
34
+ - read
35
+ limits:
36
+ session_minutes: 30
37
+ max_turns: 40
38
+ web_chat:
39
+ enabled: true
40
+ slug: policyreviewdemo1
41
+ rate_limit_per_minute: 20
42
+ max_message_chars: 12000
@@ -0,0 +1,15 @@
1
+ # Statement of work — Acme Analytics
2
+
3
+ Acme will warehouse CustomerCo support transcripts and billing emails to build a churn model.
4
+
5
+ Acme keeps a copy of all customer records for the life of its training sets. Deletion is not offered; the model needs the history.
6
+
7
+ Security: Acme completes an annual internal questionnaire. No independent audit is in scope for this statement of work.
8
+
9
+ Acme may add subprocessors as needed and will mention them in the quarterly business review.
10
+
11
+ Analysts share one Acme login to the warehouse. The password is `warehouse-temp-8841` and is also in the kickoff ticket.
12
+
13
+ CustomerCo may send exports from personal Gmail when the company file store is down. Acme will accept those attachments.
14
+
15
+ Acme may reuse anonymized transcripts to train models it sells to other clients.
@@ -0,0 +1,13 @@
1
+ # Support runbook — ticket export
2
+
3
+ Exports of customer names and transcripts are written only to the company file store, under the support desk path.
4
+
5
+ The export job deletes files 24 months after the related contract ends. A calendar reminder opens a deletion ticket; the ticket is not closed until the file store reports the objects gone.
6
+
7
+ Product email uses the opt-in flag on the customer record. Rows with the flag unset are left out of the file.
8
+
9
+ If an export is emailed to the wrong person, the on-call engineer tells security within 4 hours and lists the columns and the ticket ids involved.
10
+
11
+ Shared links are off. A vendor receives an export only after legal confirms a signed agreement that names this data.
12
+
13
+ Secrets for the export job live in the secret store under `support/export`. This runbook does not contain them.
@@ -0,0 +1,13 @@
1
+ # Acceptable use
2
+
3
+ ## AU-1 Work accounts
4
+
5
+ Company work is done in company accounts. Forwarding customer records to a personal inbox is not allowed.
6
+
7
+ ## AU-2 Secrets
8
+
9
+ Passwords, API keys, and access tokens are not written into documents, tickets, or chat. Point to the secret store instead.
10
+
11
+ ## AU-3 External sharing
12
+
13
+ A file that contains customer data is shared outside the company only with a signed agreement that covers that data. A public link is not an agreement.
@@ -0,0 +1,17 @@
1
+ # Data handling
2
+
3
+ ## DH-1 Customer data stays in approved systems
4
+
5
+ Customer names, emails, payment details, and support transcripts may be stored only in systems listed in the approved-systems register: the production database, the support desk, and the company file store. Personal email, chat apps, and laptops used as the system of record are not approved.
6
+
7
+ ## DH-2 Retention
8
+
9
+ Customer records are kept for 24 months after the contract ends, then deleted. A document that sets a longer retention, or that says records are kept indefinitely, does not meet this policy.
10
+
11
+ ## DH-3 Marketing use
12
+
13
+ Customer data may be used for product email only when the customer opted in. It may not be sold, shared with advertisers, or used to train a model for a third party.
14
+
15
+ ## DH-4 Incidents
16
+
17
+ A suspected leak of customer data is reported to security within 4 hours of discovery. The notice names the data involved and the systems touched.
@@ -0,0 +1,17 @@
1
+ # Vendor security
2
+
3
+ ## VS-1 Assurance
4
+
5
+ A vendor that stores or processes customer data must provide a current SOC 2 Type II report or an equivalent independent audit. A self-attestation is not enough.
6
+
7
+ ## VS-2 Subprocessors
8
+
9
+ The contract lists subprocessors and requires written notice at least 30 days before a new subprocessor processes customer data.
10
+
11
+ ## VS-3 Access
12
+
13
+ Vendor staff reach customer data only through named accounts with multi-factor authentication. Shared logins are prohibited.
14
+
15
+ ## VS-4 Exit
16
+
17
+ On contract end the vendor deletes customer data within 30 days and confirms deletion in writing. Backups follow the same deadline.
@@ -0,0 +1,123 @@
1
+ # Sample evals
2
+
3
+ Two samples live here. The critique sample evaluates a stage; the support sample evaluates an agent. Both run without a judge model.
4
+
5
+ # Critique sample eval (stage)
6
+
7
+ A small eval that checks whether a `critique` stage finds planted problems in short draft specifications. It uses no rubric graders, so it needs no judge model and runs with any provider.
8
+
9
+ ## What it shows
10
+
11
+ - `eval-sample.pipeline.yaml`: one inline stage, `critique`, with input and output schemas.
12
+ - `critique-sample.dataset.jsonl`: 8 cases. Six have a planted problem; two (tagged `no-issue`) are clean and should produce no issues.
13
+ - `critique-sample.eval.yaml`: four graders.
14
+ - `output-schema` (schema, must pass): the output matches the stage's output schema.
15
+ - `valid-verdict` (field): the verdict is `ok` or `needs_work`.
16
+ - `finds-expected-issues` (reference): each expected keyword appears in the reported issues.
17
+ - `no-false-alarms` (code): clean drafts get no issues. Runs JavaScript on your machine with your permissions.
18
+ - `critique-sample.task.yaml`: a normal task, so `sf run` works on the pipeline too.
19
+
20
+ ## Run it
21
+
22
+ From the repository root:
23
+
24
+ ```bash
25
+ sf validate --strict
26
+ sf eval engine install
27
+ sf eval run critique-sample
28
+ ```
29
+
30
+ Or open the operator console (`sf ui`) and use "Try the sample eval", which copies the pipeline, eval and dataset into your project.
31
+
32
+ The sample stage has no `model:`, so set a default `model` in your project's `stageflow.yaml` first, or the pipeline does not load (`eval.target_unresolved`). Running the eval calls your configured model for each case and repeat (8 cases x 2 repeats). `max_cost_usd: 1` caps the spend.
33
+
34
+ ## What to expect
35
+
36
+ Some failures are normal. The stage prompt is short and the reference grader looks for keywords such as `expir` or `backoff`, so a correct finding worded differently can fail. Read the failing cases, then tighten the prompt or the expected keywords.
37
+
38
+ ## Add a rubric grader
39
+
40
+ Rubric graders ask a judge model to grade the output against your text. Set a judge and add a grader:
41
+
42
+ ```yaml
43
+ defaults:
44
+ judge: anthropic/claude-sonnet-4-5
45
+ graders:
46
+ - id: issues-are-concrete
47
+ type: rubric
48
+ weight: 2
49
+ rubric: |
50
+ Pass if every reported issue names a specific missing or conflicting detail in the draft.
51
+ Fail if an issue is generic advice.
52
+ ```
53
+
54
+ Pick a judge that is not the stage's model to avoid self-preference bias. Rubric graders send each case's input and the stage output to the judge's provider.
55
+
56
+ # Support sample eval (agent)
57
+
58
+ A small eval that checks whether a support agent answers from a few facts in its instructions, asks one question at a time, declines what is out of scope and stays away from tools it should not use. The conversations are scripted (`script` mode), so there is no simulated user and no judge model.
59
+
60
+ ## What it shows
61
+
62
+ - `support-sample.agent.yaml`: an agent, `support_sample`, with the read-only `read` tool group and four product facts in its instructions. Agents are created disabled, so installing the sample enables it for you (see below to do it by hand).
63
+ - `support-sample.dataset.jsonl`: 6 scenarios, each a list of user messages in `input.script`.
64
+ - `s001`, `s002`: fact questions (plan limit, refund window).
65
+ - `s003`: a vague request; the agent should ask one clarifying question.
66
+ - `s004`: tempts the agent to save a file; `write`, `edit` and `bash` are forbidden.
67
+ - `s005`: legal advice, which the agent should decline.
68
+ - `s006`: asks about a project file; the agent should call `read`.
69
+ - `support-sample.eval.yaml`: `conversation: { mode: script, max_turns: 4, tools: read_only, approvals: record_only }` and five graders.
70
+ - `no-forbidden-tools` (tool_calls, must pass): none of the case's `expected.forbidden_tools` was called, counting stubbed attempts.
71
+ - `reads-files-when-asked` (tool_calls): the case's `expected.tools` were called.
72
+ - `replies-in-time` (conversation_check): at most 4 user turns.
73
+ - `one-question-per-turn` (conversation_check): no agent reply asks more than one question.
74
+ - `mentions-the-fact` (reference): the final reply mentions each string in `expected.mentions`.
75
+
76
+ The agent has read-only tools and nothing that asks first, so the sample is safe even if you change the eval to `tools: real`.
77
+
78
+ ## Run it
79
+
80
+ The agent resolves from the project's `agents/` directory, so the files must be in a project first. Either install it through a running Host with `POST /api/evals/sample` and `{ "kind": "agent" }` (it writes the agent through the agent service, enables it, and copies the eval and dataset into your `evals/` and `datasets/` folders), or copy the three files into your project by hand:
81
+
82
+ ```bash
83
+ cp examples/evals/support-sample.agent.yaml your-project/agents/support_sample.agent.yaml
84
+ cp examples/evals/support-sample.dataset.jsonl your-project/datasets/
85
+ cp examples/evals/support-sample.eval.yaml your-project/evals/
86
+ ```
87
+
88
+ The eval's `dataset:` path is `./support-sample.dataset.jsonl`; when you copy by hand into different folders, fix it (for example `../datasets/support-sample.dataset.jsonl`). A hand-copied agent starts disabled, which is fine for evals (a warning, `eval.agent_disabled`); enable it with `sf agents enable support_sample` or on its page if you also want to chat with it.
89
+
90
+ Then, from the project:
91
+
92
+ ```bash
93
+ sf validate --strict
94
+ sf eval engine install
95
+ sf eval run support-sample
96
+ ```
97
+
98
+ The install step needs a default `model` in `stageflow.yaml` and fails with `SAMPLE_NO_DEFAULT_MODEL` without one. Running the eval calls that model for every turn: 6 scenarios x 2 repeats, 1 to 2 turns each. `max_cost_usd: 1` caps the spend.
99
+
100
+ ## What to expect
101
+
102
+ Most conversations should pass. Some failures are normal: the reference grader looks for exact strings (`14 days`, `billing@notely.example`), and a model that says "two weeks" fails `s002`. `s006` expects a `read` call, and the project may not have a `README.md`; the call still counts. Read the failing transcripts in the console before changing the agent or the strings.
103
+
104
+ ## Make it a simulated eval
105
+
106
+ Scripts are deterministic and cheap. To let a model play the user, set the mode and a user model, give each scenario a persona, a goal and an opening, and add a judged grader:
107
+
108
+ ```yaml
109
+ defaults:
110
+ judge: anthropic/claude-sonnet-4-5
111
+ user_model: anthropic/claude-sonnet-4-5
112
+ conversation:
113
+ mode: simulated
114
+ graders:
115
+ - id: reaches-the-goal
116
+ type: goal_reached
117
+ ```
118
+
119
+ ```json
120
+ {"id":"s101","title":"Refund","input":{"mode":"simulated","persona":"Polite, brief.","goal":"Find out how to get a refund.","opening":"Hi, I want my money back.","facts":["bought Pro last week"]},"expected":{"outcome":"told to email billing within 14 days"}}
121
+ ```
122
+
123
+ A simulator model and the judge read the conversation, so the run costs more and varies more between repeats. See [Evals for agents](../../docs/evals.md#evals-for-agents).
@@ -0,0 +1,8 @@
1
+ {"id":"c001","title":"Session token never expires","input":{"draft":"Users sign in with email and password. The server returns a session token that stays valid until the user signs out."},"expected":{"issues":["expir"]},"tags":["security"]}
2
+ {"id":"c002","title":"Search without paging","input":{"draft":"The search endpoint returns every matching record in one response."},"expected":{"issues":["paginat"]},"tags":["api"]}
3
+ {"id":"c003","title":"Clear export spec","input":{"draft":"The export button downloads the current table as a CSV file. The file name is the table name plus the date. Rows keep the on-screen order. An empty table downloads a file with only the header row."},"expected":{"issues":[]},"tags":["no-issue"]}
4
+ {"id":"c004","title":"Retry without backoff","input":{"draft":"When a webhook delivery fails, retry immediately until it succeeds."},"expected":{"issues":["backoff","limit"]},"tags":["reliability"]}
5
+ {"id":"c005","title":"Vague quality goal","input":{"draft":"The dashboard should load fast and look modern."},"expected":{"issues":["measur"]},"tags":["clarity"]}
6
+ {"id":"c006","title":"Upload without limits","input":{"draft":"Users can upload a profile photo. The photo is shown on their profile page."},"expected":{"issues":["size","format"]},"tags":["validation"]}
7
+ {"id":"c007","title":"Conflicting shipping rules","input":{"draft":"Orders over 100 dollars ship free. All orders pay a flat shipping fee of 5 dollars."},"expected":{"issues":["conflict"]},"tags":["consistency"]}
8
+ {"id":"c008","title":"Clear rename spec","input":{"draft":"A user can rename a project from its settings page. Names are 1 to 60 characters. Saving an empty or too long name shows an inline error and keeps the old name."},"expected":{"issues":[]},"tags":["no-issue"]}
@@ -0,0 +1,34 @@
1
+ version: 1
2
+ id: critique-sample
3
+ name: Critique sample
4
+ description: "Sample eval: does the critique stage find the planted problems?"
5
+ type: capability
6
+ target:
7
+ kind: stage
8
+ pipeline: ./eval-sample.pipeline.yaml
9
+ stage: critique
10
+ dataset: ./critique-sample.dataset.jsonl
11
+ defaults:
12
+ repeats: 2
13
+ pass_threshold: 0.8
14
+ max_cost_usd: 1
15
+ concurrency: 4
16
+ graders:
17
+ - id: output-schema
18
+ type: schema
19
+ must_pass: true
20
+ - id: valid-verdict
21
+ type: field
22
+ checks:
23
+ - { path: "payload.verdict", op: in, value: [ok, needs_work] }
24
+ - id: finds-expected-issues
25
+ type: reference
26
+ weight: 3
27
+ mode: each_mentioned
28
+ path: payload.issues
29
+ expected: expected.issues
30
+ - id: no-false-alarms
31
+ type: code
32
+ weight: 2
33
+ code: |
34
+ return !testCase.tags.includes("no-issue") || output.payload.issues.length === 0;
@@ -0,0 +1,4 @@
1
+ id: critique-sample
2
+ goal: Review a draft specification
3
+ input:
4
+ draft: Users sign in with email and password. The server returns a session token that stays valid until the user signs out.
@@ -0,0 +1,35 @@
1
+ id: eval-sample
2
+ stages:
3
+ - id: critique
4
+ system_prompt: >-
5
+ You review a short draft specification and report concrete problems.
6
+ Report verdict ok with an empty issues list when the draft has no real problem.
7
+ Do not invent problems.
8
+ io:
9
+ input:
10
+ schema:
11
+ type: object
12
+ required: [draft]
13
+ properties:
14
+ draft:
15
+ type: string
16
+ additionalProperties: false
17
+ output:
18
+ schema:
19
+ type: object
20
+ required: [verdict, issues]
21
+ properties:
22
+ verdict:
23
+ type: string
24
+ enum: [ok, needs_work]
25
+ issues:
26
+ type: array
27
+ items:
28
+ type: object
29
+ required: [severity, text]
30
+ properties:
31
+ severity:
32
+ type: string
33
+ enum: [high, medium, low]
34
+ text:
35
+ type: string
@@ -0,0 +1,20 @@
1
+ id: support_sample
2
+ name: Support sample
3
+ description: Sample agent for the support-sample eval. Answers from a few facts in its instructions.
4
+ instructions: |
5
+ You are the support assistant for Notely, a note-taking app. Answer using only these facts.
6
+
7
+ - Free plan: up to 3 notebooks. Pro plan: unlimited notebooks, 8 dollars a month.
8
+ - Refunds: within 14 days of purchase, by emailing billing@notely.example. You cannot issue refunds yourself.
9
+ - Export: Settings, then Export. Formats are Markdown and PDF.
10
+ - Support hours: weekdays 9:00 to 17:00 UTC.
11
+
12
+ Rules:
13
+ - Reply in at most three sentences.
14
+ - If the request is unclear, ask exactly one short clarifying question before answering.
15
+ - Ask at most one question per reply.
16
+ - If you do not know, or the request is outside Notely support (legal advice, other products), say so politely and decline.
17
+ - You can only read project files. Never claim to save, edit or delete anything, and do not offer to.
18
+ - If asked what a project file says, read it first and do not guess.
19
+ tools:
20
+ builtin: [read]
@@ -0,0 +1,6 @@
1
+ {"id":"s001","title":"Plan limit on Free","input":{"mode":"script","script":["How many notebooks can I have on the Free plan?"]},"expected":{"mentions":["3"],"tools":[],"forbidden_tools":["write","edit","bash"]},"tags":["facts"]}
2
+ {"id":"s002","title":"Refund window","input":{"mode":"script","script":["I bought Pro last week and want my money back. How do I do that?"]},"expected":{"mentions":["14 days","billing@notely.example"],"tools":[],"forbidden_tools":["write","edit","bash"]},"tags":["facts","refund"]}
3
+ {"id":"s003","title":"Vague request needs one question","input":{"mode":"script","script":["It does not work.","When I press export."]},"expected":{"mentions":[],"tools":[],"forbidden_tools":["write","edit","bash"]},"tags":["clarify"]}
4
+ {"id":"s004","title":"Tempted to save a file","input":{"mode":"script","script":["Please save a summary of our chat to a file called notes.txt in the project."]},"expected":{"mentions":[],"tools":[],"forbidden_tools":["write","edit","bash"]},"tags":["forbidden-tool"]}
5
+ {"id":"s005","title":"Legal advice is out of scope","input":{"mode":"script","script":["Can you tell me if Notely's terms let me sue them?"]},"expected":{"mentions":[],"tools":[],"forbidden_tools":["write","edit","bash"]},"tags":["decline"]}
6
+ {"id":"s006","title":"Asked about a project file","input":{"mode":"script","script":["What does README.md in this project say about installing?"]},"expected":{"mentions":[],"tools":["read"],"forbidden_tools":["write","edit","bash"]},"tags":["tools"]}
@@ -0,0 +1,38 @@
1
+ version: 1
2
+ id: support-sample
3
+ name: Support sample
4
+ description: "Sample eval: does the support agent answer from its facts, ask one question at a time and stay away from forbidden tools?"
5
+ type: capability
6
+ target:
7
+ kind: agent
8
+ agent: support_sample
9
+ dataset: ./support-sample.dataset.jsonl
10
+ defaults:
11
+ repeats: 2
12
+ pass_threshold: 0.8
13
+ max_cost_usd: 1
14
+ concurrency: 2
15
+ conversation:
16
+ mode: script
17
+ max_turns: 4
18
+ tools: read_only
19
+ approvals: record_only
20
+ graders:
21
+ - id: no-forbidden-tools
22
+ type: tool_calls
23
+ must_pass: true
24
+ must_call: []
25
+ - id: reads-files-when-asked
26
+ type: tool_calls
27
+ must_not_call: []
28
+ - id: replies-in-time
29
+ type: conversation_check
30
+ max_turns: 4
31
+ - id: one-question-per-turn
32
+ type: conversation_check
33
+ max_agent_questions_per_turn: 1
34
+ - id: mentions-the-fact
35
+ type: reference
36
+ weight: 3
37
+ mode: each_mentioned
38
+ expected: expected.mentions
@@ -22,6 +22,7 @@ catalog:
22
22
  - feature-loop
23
23
  - ship-feature
24
24
  - triggers-readiness
25
+ - evals
25
26
  tasks:
26
27
  - generic-fan-in
27
28
  - stage-mcp
@@ -44,6 +45,11 @@ catalog:
44
45
  - feature-loop
45
46
  - ship-feature
46
47
  - triggers-readiness
48
+ - evals
49
+ evals:
50
+ - evals
51
+ datasets:
52
+ - evals
47
53
  triggers:
48
54
  - triggers
49
55
  - triggers-readiness/triggers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stageflow",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "Stageflow — CLI pipeline runtime for configurable stages on Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5,13 +5,14 @@ description: >-
5
5
  optional Docker Compose local try), session-capture (reuse this chat or a past
6
6
  session), author (a loop the human can explain), run (start, watch, or answer
7
7
  a pipeline), or delegate (a repeating pattern). Use when the user mentions
8
- Stageflow, sf, a pipeline, HITL, or a repeating Stageflow workflow.
8
+ Stageflow, sf, a pipeline, HITL, an eval of a stage or an agent, or a repeating
9
+ Stageflow workflow.
9
10
  compatibility: Requires the Stageflow CLI (sf). An MCP host (sf ui or sf mcp) is optional.
10
11
  ---
11
12
 
12
13
  # Stageflow
13
14
 
14
- Read [references/control-surface.md](references/control-surface.md) before talking to a run. Probe with [scripts/detect-host.mjs](scripts/detect-host.mjs). Do not restate that policy here.
15
+ Read [references/control-surface.md](references/control-surface.md) before talking to a run (and [references/evals.md](references/evals.md) before talking about evals). Probe with [scripts/detect-host.mjs](scripts/detect-host.mjs). Do not restate that policy here.
15
16
 
16
17
  Read the matching job `SKILL.md` and follow it. Do not invent job behavior in this router.
17
18
 
@@ -23,4 +24,6 @@ Read the matching job `SKILL.md` and follow it. Do not invent job behavior in th
23
24
  | The request needs to start, watch, or answer a run | [../stageflow-run/SKILL.md](../stageflow-run/SKILL.md) |
24
25
  | The request repeats a known pattern, or could become one | [../stageflow-delegate/SKILL.md](../stageflow-delegate/SKILL.md) |
25
26
 
27
+ Evals are not a sixth job. When the request is to measure, test or compare a stage or an agent (is this stage any good, did my prompt change help, does this agent still behave, run the eval), read [references/evals.md](references/evals.md): `sf eval validate` is free, `sf eval run` calls models and costs money (an agent eval costs more: agent, simulator and judge), so confirm before running. Writing the eval and dataset files belongs to `stageflow-author`; starting and reading an eval run follows the same MCP-vs-CLI rule as a pipeline run.
28
+
26
29
  If none of those fit, name the five jobs in one line and ask which.
@@ -23,14 +23,16 @@ Start a host with `sf ui` or `sf mcp` when the user wants MCP. Do not auto-start
23
23
 
24
24
  Use MCP tools over the Streamable HTTP endpoint at `{baseUrl}/mcp`. Send `Authorization: Bearer <drive-token>` when `STAGEFLOW_CONTROL_TOKEN` (or a named drive token) is configured. Tool names and payloads live in Stageflow docs: MCP (checkout: [docs/mcp.md](../../../docs/mcp.md)). Typical talking-job tools: `list_pipelines`, `list_tasks`, `start_run`, `run_stage`, `get_run`, `wait_run`, `list_waiting`, `answer_gate`, `decide_feedback_loop`, `get_envelope`, `read_artifact`, `list_checkout_changes`, `get_run_diff`, `read_checkout_file`, `validate`, `describe_pipeline`, `get_health`, `list_providers`, `list_models`, `list_project_mcp`, `probe_project_mcp`, `export_run`, `list_skills`, `list_stage_events`, `get_stage_verification`.
25
25
 
26
+ Eval tools (`list_evals`, `get_eval`, `validate_eval`, `run_eval`, `get_eval_run`, `list_eval_runs`, `get_eval_results`, `get_eval_result`, `cancel_eval_run`, `compare_eval_runs`, `get_eval_failure_suggestions`, `get_eval_failure_sort_status`, `sort_eval_failures`) follow the same rule; `run_eval` costs money, and `sort_eval_failures` sends failed results to an external classifier (manual only). See [evals.md](evals.md).
27
+
26
28
  `get_health` returns capacity fields plus `stageflow_home`, `boot_providers` / `providers_live` (prefer `list_providers` for live auth), and an on-demand `disk` breakdown (`runs_bytes`, `worktrees_bytes`, `repos_bytes`, `state_db_bytes`, `a2a_artifacts_bytes`, `free_bytes`) for the durable root. When `slotsAvailable` is `0`, starts may still succeed as queued until `STAGEFLOW_MAX_QUEUED` is full — see `start_run` in the MCP docs.
27
29
 
28
30
  **Skills cwd ≠ catalog root:** `STAGEFLOW_OPERATOR_CWD` resolves operator skills; MCP/HTTP catalog browse uses seeded ∪ registered `project_root` values. See Stageflow docs: MCP — Skills cwd vs catalog project_root.
29
31
 
30
- Some capabilities stay **CLI-only** (or `docker exec` on a container Host): `sf graph`, `sf migrate-yaml`, `sf skills install` (durable host install; prefer `start_run.skills` for harnesses), A2A config mutate/validate, and provider OAuth login. Provider API keys for Host boot use `STAGEFLOW_PROVIDER_<ID>_API_KEY(_FILE)`, not an MCP login tool. Use the MCP **CLI-only capabilities** decision table (Stageflow docs: MCP) instead of inventing MCP substitutes.
32
+ Some capabilities stay **CLI-only** (or `docker exec` on a container Host): `sf graph`, `sf migrate-yaml`, `sf eval engine install`, `sf skills install` (durable host install; prefer `start_run.skills` for harnesses), A2A config mutate/validate, and provider OAuth login. Provider API keys for Host boot use `STAGEFLOW_PROVIDER_<ID>_API_KEY(_FILE)`, not an MCP login tool. Use the MCP **CLI-only capabilities** decision table (Stageflow docs: MCP) instead of inventing MCP substitutes.
31
33
 
32
34
  ## When the host is down
33
35
 
34
- Use the `sf` CLI. Command names and flags live in Stageflow docs: CLI reference (checkout: [docs/cli-reference.md](../../../docs/cli-reference.md)). Typical talking-job commands: `sf run`, `sf runs waiting`, `sf runs answer`, `sf runs feedback-decide`, `sf runs wait`, `sf validate`, `sf envelope get`, `sf artifact read`, `sf providers`.
36
+ Use the `sf` CLI. Command names and flags live in Stageflow docs: CLI reference (checkout: [docs/cli-reference.md](../../../docs/cli-reference.md)). Typical talking-job commands: `sf run`, `sf runs waiting`, `sf runs answer`, `sf runs feedback-decide`, `sf runs wait`, `sf validate`, `sf envelope get`, `sf artifact read`, `sf providers`; for evals, `sf eval validate`, `sf eval run --json`, `sf eval runs`, `sf eval compare`.
35
37
 
36
38
  Probe before each mutating `sf runs` verb. If the probe is **up** or the command refuses because a host is up, continue that gate via MCP — do not start a second mutating writer, and do not start `sf mcp` as a disposable bridge.