farseer-cli 1.18.0 → 1.20.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 (262) hide show
  1. package/README.md +33 -10
  2. package/dist/commands/app.js +42 -3
  3. package/dist/commands/app.js.map +1 -2
  4. package/dist/commands/apps.js.map +0 -1
  5. package/dist/commands/cells.js +120 -85
  6. package/dist/commands/cells.js.map +1 -2
  7. package/dist/commands/code.js.map +0 -1
  8. package/dist/commands/config.js.map +0 -1
  9. package/dist/commands/dashboards.js +246 -12
  10. package/dist/commands/dashboards.js.map +1 -2
  11. package/dist/commands/diff.js.map +0 -1
  12. package/dist/commands/dimensions.js +52 -27
  13. package/dist/commands/dimensions.js.map +1 -2
  14. package/dist/commands/docs.js +82 -0
  15. package/dist/commands/docs.js.map +6 -0
  16. package/dist/commands/files.js +49 -0
  17. package/dist/commands/files.js.map +2 -3
  18. package/dist/commands/folders.js +76 -0
  19. package/dist/commands/folders.js.map +6 -0
  20. package/dist/commands/formula.js +38 -30
  21. package/dist/commands/formula.js.map +1 -2
  22. package/dist/commands/install.js +32 -30
  23. package/dist/commands/install.js.map +2 -3
  24. package/dist/commands/list.js.map +0 -1
  25. package/dist/commands/login.js +3 -3
  26. package/dist/commands/login.js.map +1 -2
  27. package/dist/commands/logout.js.map +0 -1
  28. package/dist/commands/mcp-server.js.map +0 -1
  29. package/dist/commands/model.js +30 -5
  30. package/dist/commands/model.js.map +2 -3
  31. package/dist/commands/pipeline.js.map +0 -1
  32. package/dist/commands/pull.js +1 -1
  33. package/dist/commands/pull.js.map +1 -2
  34. package/dist/commands/push.js +6 -4
  35. package/dist/commands/push.js.map +1 -2
  36. package/dist/commands/refresh.js.map +0 -1
  37. package/dist/commands/run.js.map +0 -1
  38. package/dist/commands/sheets.js +289 -52
  39. package/dist/commands/sheets.js.map +1 -2
  40. package/dist/commands/skills.js +157 -0
  41. package/dist/commands/skills.js.map +6 -0
  42. package/dist/commands/status.js.map +0 -1
  43. package/dist/commands/tool.js.map +0 -1
  44. package/dist/commands/variables.js +246 -82
  45. package/dist/commands/variables.js.map +1 -2
  46. package/dist/commands/whoami.js.map +0 -1
  47. package/dist/index.js +117 -23
  48. package/dist/index.js.map +1 -2
  49. package/dist/mcp/index.js.map +0 -1
  50. package/dist/mcp/prompts/workflows.js.map +0 -1
  51. package/dist/mcp/resources/documentation.js +19 -12
  52. package/dist/mcp/resources/documentation.js.map +1 -2
  53. package/dist/mcp/server.js.map +0 -1
  54. package/dist/mcp/skills.js.map +0 -1
  55. package/dist/mcp/tools/appTools.js +1 -7
  56. package/dist/mcp/tools/appTools.js.map +1 -2
  57. package/dist/mcp/tools/authTools.js +1 -1
  58. package/dist/mcp/tools/authTools.js.map +1 -2
  59. package/dist/mcp/tools/cellTools.js +6 -19
  60. package/dist/mcp/tools/cellTools.js.map +1 -2
  61. package/dist/mcp/tools/dashboardTools.js +30 -412
  62. package/dist/mcp/tools/dashboardTools.js.map +2 -3
  63. package/dist/mcp/tools/dataTools.js +15 -146
  64. package/dist/mcp/tools/dataTools.js.map +1 -2
  65. package/dist/mcp/tools/folderTools.js +12 -78
  66. package/dist/mcp/tools/folderTools.js.map +1 -2
  67. package/dist/mcp/tools/modelTools.js +23 -372
  68. package/dist/mcp/tools/modelTools.js.map +1 -2
  69. package/dist/mcp/tools/pipelineContract.js +5 -1
  70. package/dist/mcp/tools/pipelineContract.js.map +1 -2
  71. package/dist/mcp/tools/pipelineTools.js.map +0 -1
  72. package/dist/mcp/tools/runTools.js +8 -69
  73. package/dist/mcp/tools/runTools.js.map +1 -2
  74. package/dist/mcp/tools/sheetTools.js +14 -264
  75. package/dist/mcp/tools/sheetTools.js.map +1 -2
  76. package/dist/mcp/tools/syncTools.js +7 -3
  77. package/dist/mcp/tools/syncTools.js.map +1 -2
  78. package/dist/mcp/utils/helpers.js.map +0 -1
  79. package/dist/mcp/utils/launchPin.js.map +0 -1
  80. package/dist/mcp/utils/operationResponse.js +41 -0
  81. package/dist/mcp/utils/operationResponse.js.map +6 -0
  82. package/dist/mcp/utils/registerTool.js.map +0 -1
  83. package/dist/mcp/utils/session.js.map +0 -1
  84. package/dist/mcp/utils/tenantPin.js.map +0 -1
  85. package/dist/operations/cells.js +444 -0
  86. package/dist/operations/cells.js.map +6 -0
  87. package/dist/operations/dashboards.js +357 -0
  88. package/dist/operations/dashboards.js.map +6 -0
  89. package/dist/operations/data.js +206 -0
  90. package/dist/operations/data.js.map +6 -0
  91. package/dist/operations/errors.js +64 -0
  92. package/dist/operations/errors.js.map +6 -0
  93. package/dist/operations/exportModel.js +59 -0
  94. package/dist/operations/exportModel.js.map +6 -0
  95. package/dist/operations/folderPath.js +128 -0
  96. package/dist/operations/folderPath.js.map +6 -0
  97. package/dist/operations/folders.js +80 -0
  98. package/dist/operations/folders.js.map +6 -0
  99. package/dist/operations/install.js +109 -0
  100. package/dist/operations/install.js.map +6 -0
  101. package/dist/operations/model.js +271 -0
  102. package/dist/operations/model.js.map +6 -0
  103. package/dist/operations/sheets.js +428 -0
  104. package/dist/operations/sheets.js.map +6 -0
  105. package/dist/pipeline/compatibility.js.map +0 -1
  106. package/dist/pipeline/connect.js.map +0 -1
  107. package/dist/pipeline/create.js.map +0 -1
  108. package/dist/pipeline/errors.js.map +0 -1
  109. package/dist/pipeline/failStep.js +43 -0
  110. package/dist/pipeline/failStep.js.map +6 -0
  111. package/dist/pipeline/generated-reference.json +25 -13
  112. package/dist/pipeline/guide.js.map +0 -1
  113. package/dist/pipeline/init.js.map +0 -1
  114. package/dist/pipeline/operations.js.map +0 -1
  115. package/dist/pipeline/query.js.map +0 -1
  116. package/dist/pipeline/queryDownloads.js.map +0 -1
  117. package/dist/pipeline/queryWorker.js +3 -1
  118. package/dist/pipeline/queryWorker.js.map +1 -2
  119. package/dist/pipeline/readiness.js.map +0 -1
  120. package/dist/pipeline/reference.js.map +0 -1
  121. package/dist/pipeline/requests.js +3 -32
  122. package/dist/pipeline/requests.js.map +1 -2
  123. package/dist/pipeline/runArguments.js.map +0 -1
  124. package/dist/pipeline/runtime.js.map +0 -1
  125. package/dist/pipeline/service.js +46 -2
  126. package/dist/pipeline/service.js.map +1 -2
  127. package/dist/services/appSyncService.js +59 -9
  128. package/dist/services/appSyncService.js.map +1 -2
  129. package/dist/services/apps.js +10 -0
  130. package/dist/services/apps.js.map +1 -2
  131. package/dist/services/authErrors.js.map +0 -1
  132. package/dist/services/codefirst/api.js +38 -5
  133. package/dist/services/codefirst/api.js.map +1 -2
  134. package/dist/services/codefirst/binaryDisk.js.map +0 -1
  135. package/dist/services/codefirst/byteHashes.js +5 -0
  136. package/dist/services/codefirst/byteHashes.js.map +1 -2
  137. package/dist/services/codefirst/documents.js +41 -15
  138. package/dist/services/codefirst/documents.js.map +1 -2
  139. package/dist/services/codefirst/layoutBinaryProjection.js +24 -13
  140. package/dist/services/codefirst/layoutBinaryProjection.js.map +1 -2
  141. package/dist/services/codefirst/layoutCompose.js +44 -38
  142. package/dist/services/codefirst/layoutCompose.js.map +1 -2
  143. package/dist/services/codefirst/layoutCore.js +14 -1
  144. package/dist/services/codefirst/layoutCore.js.map +1 -2
  145. package/dist/services/codefirst/layoutPaths.js +80 -4
  146. package/dist/services/codefirst/layoutPaths.js.map +1 -2
  147. package/dist/services/codefirst/layoutProjection.js +73 -39
  148. package/dist/services/codefirst/layoutProjection.js.map +1 -2
  149. package/dist/services/codefirst/layoutReadback.js +357 -130
  150. package/dist/services/codefirst/layoutReadback.js.map +2 -3
  151. package/dist/services/codefirst/layoutReadbackPlacement.js +94 -57
  152. package/dist/services/codefirst/layoutReadbackPlacement.js.map +2 -3
  153. package/dist/services/codefirst/layoutReceipt.js +283 -243
  154. package/dist/services/codefirst/layoutReceipt.js.map +2 -3
  155. package/dist/services/codefirst/layoutScan.js +208 -110
  156. package/dist/services/codefirst/layoutScan.js.map +1 -2
  157. package/dist/services/codefirst/output.js +76 -10
  158. package/dist/services/codefirst/output.js.map +1 -2
  159. package/dist/services/codefirst/types.js.map +0 -1
  160. package/dist/services/codefirst/workflow.js +65 -29
  161. package/dist/services/codefirst/workflow.js.map +2 -3
  162. package/dist/services/codefirst/workspace.js.map +0 -1
  163. package/dist/services/codefirst/workspaceLock.js.map +0 -1
  164. package/dist/services/codefirst/workspaceRoot.js +2 -1
  165. package/dist/services/codefirst/workspaceRoot.js.map +1 -2
  166. package/dist/services/configService.js.map +0 -1
  167. package/dist/services/credentials.js.map +0 -1
  168. package/dist/services/farseerService.js +31 -7
  169. package/dist/services/farseerService.js.map +1 -2
  170. package/dist/services/httpError.js.map +0 -1
  171. package/dist/services/modelExport.js.map +0 -1
  172. package/dist/services/organisation.js.map +0 -1
  173. package/dist/services/preflight.js.map +0 -1
  174. package/dist/services/realms.js.map +0 -1
  175. package/dist/services/syncService.js +3 -3
  176. package/dist/services/syncService.js.map +1 -2
  177. package/dist/skills/bundled.js +106 -0
  178. package/dist/skills/bundled.js.map +6 -0
  179. package/dist/skills/install.js +257 -0
  180. package/dist/skills/install.js.map +6 -0
  181. package/dist/skills/pipeline.js +10 -18
  182. package/dist/skills/pipeline.js.map +1 -2
  183. package/dist/utils/agentSandbox.js +1 -1
  184. package/dist/utils/agentSandbox.js.map +0 -1
  185. package/dist/utils/cliOptions.js.map +0 -1
  186. package/dist/utils/constants.js.map +0 -1
  187. package/dist/utils/entityResolver.js +72 -25
  188. package/dist/utils/entityResolver.js.map +1 -2
  189. package/dist/utils/errorFormatter.js +72 -11
  190. package/dist/utils/errorFormatter.js.map +1 -2
  191. package/dist/utils/fileLogger.js.map +0 -1
  192. package/dist/utils/fileValidation.js.map +0 -1
  193. package/dist/utils/folderMatch.js.map +0 -1
  194. package/dist/utils/formulaFilters.js +11 -2
  195. package/dist/utils/formulaFilters.js.map +1 -2
  196. package/dist/utils/helpers.js.map +0 -1
  197. package/dist/utils/logger.js.map +0 -1
  198. package/dist/utils/nameResolver.js.map +0 -1
  199. package/dist/utils/operationCli.js +102 -0
  200. package/dist/utils/operationCli.js.map +6 -0
  201. package/dist/utils/packageManager.js.map +0 -1
  202. package/dist/utils/syncReporting.js.map +0 -1
  203. package/dist/utils/syncScope.js.map +0 -1
  204. package/dist/utils/updateCheck.js.map +0 -1
  205. package/dist/utils/variableValues.js.map +0 -1
  206. package/dist/utils/workspace.js.map +0 -1
  207. package/docs/cli-guide.md +182 -2
  208. package/docs/import-workflows.md +14 -14
  209. package/docs/new-app-template.md +1 -1
  210. package/docs/pipeline-client-guide.md +1 -1
  211. package/docs/pipeline-reference.md +304 -9
  212. package/docs/troubleshooting.md +18 -0
  213. package/package.json +2 -2
  214. package/skills/farseer-analysis/SKILL.md +132 -0
  215. package/skills/farseer-app-dev/SKILL.md +131 -0
  216. package/skills/farseer-app-dev/assignments.md +185 -0
  217. package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
  218. package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
  219. package/skills/farseer-app-dev/working-patterns.md +876 -0
  220. package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
  221. package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
  222. package/skills/farseer-author-import-job/SKILL.md +114 -0
  223. package/skills/farseer-author-import-job/cell-writes.md +530 -0
  224. package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
  225. package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
  226. package/skills/farseer-build-model/SKILL.md +122 -0
  227. package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
  228. package/skills/farseer-build-model/naming-conventions.md +435 -0
  229. package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
  230. package/skills/farseer-build-pipeline/SKILL.md +190 -0
  231. package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
  232. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
  233. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
  234. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
  235. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
  236. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
  237. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
  238. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
  239. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
  240. package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
  241. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
  242. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
  243. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
  244. package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
  245. package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
  246. package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
  247. package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
  248. package/skills/farseer-dashboards/SKILL.md +40 -0
  249. package/skills/farseer-formulas/SKILL.md +165 -0
  250. package/skills/farseer-help-center/SKILL.md +66 -0
  251. package/skills/farseer-model/SKILL.md +119 -0
  252. package/skills/farseer-modify-model/SKILL.md +158 -0
  253. package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
  254. package/skills/farseer-optimize-model/SKILL.md +314 -0
  255. package/skills/farseer-optimize-model/stats-dump.ts +139 -0
  256. package/skills/farseer-pnl/SKILL.md +220 -0
  257. package/skills/farseer-review-model/SKILL.md +172 -0
  258. package/skills/farseer-run-apps/SKILL.md +102 -0
  259. package/skills/pipeline-authoring/SKILL.md +7 -5
  260. package/skills/pipeline-authoring/practices.md +21 -8
  261. package/dist/services/agentApprovalFetch.js +0 -86
  262. package/dist/services/agentApprovalFetch.js.map +0 -7
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/runtime.ts"],
4
- "sourcesContent": ["import reference from './generated-reference.json';\nimport { CLI_UPDATE_INSTRUCTION } from './reference';\nimport { PipelineError } from './errors';\nimport { inAgentSandbox } from '../utils/agentSandbox';\n\n/** The runner image tag this CLI was released in tandem with, as `<repository>:<version>`. */\nexport const PIPELINE_RUNNER_IMAGE: string = reference.runnerImage;\n\nexport interface RuntimeComparison {\n status: 'match' | 'behind' | 'ahead' | 'unversioned' | 'incompatible';\n /** Version parsed from the job's image tag, or null when the tag is not a release version. */\n jobVersion: string | null;\n /** Version this CLI authors for. */\n expected: string;\n nextAction: string;\n}\n\nconst RELEASE_VERSION = /^\\d+\\.\\d+\\.\\d+$/;\n\nfunction split(image: string): { repository: string; tag: string | null } {\n const name = image.slice(image.lastIndexOf('/') + 1);\n if (name.includes('@')) return { repository: name.slice(0, name.indexOf('@')).split(':')[0], tag: null };\n const colon = name.indexOf(':');\n return colon < 0\n ? { repository: name, tag: null }\n : { repository: name.slice(0, colon), tag: name.slice(colon + 1) };\n}\n\n/** Numeric three-part comparison; negative when `a` is older than `b`. */\nexport function compareVersions(a: string, b: string): number {\n const [pa, pb] = [a, b].map((v) => v.split('.').map(Number));\n for (let i = 0; i < 3; i++) if (pa[i] !== pb[i]) return pa[i] < pb[i] ? -1 : 1;\n return 0;\n}\n\n/**\n * The CLI authors for exactly one engine: the one inside the runner image it was\n * released with. It never changes a job's image on its own: a job behind it is moved\n * up only by upgrade-runtime, a CLI behind a job is updated, and nothing moves down.\n */\nexport function compareRuntime(jobImage: string): RuntimeComparison {\n const bundled = split(PIPELINE_RUNNER_IMAGE);\n const expected = bundled.tag ?? '';\n const job = split(jobImage);\n if (job.repository !== bundled.repository)\n return {\n status: 'incompatible',\n jobVersion: null,\n expected,\n nextAction:\n 'Use the existing app tools to inspect, run or maintain this app in its current implementation. Do not change its runner or entrypoint to satisfy pipeline setup. Migration to Simple Pipelines requires an explicit migration request.',\n };\n if (!job.tag || !RELEASE_VERSION.test(job.tag))\n return {\n status: 'unversioned',\n jobVersion: null,\n expected,\n nextAction: `The job's image \"${jobImage}\" is a moving tag or digest, not a released ${bundled.repository} version, so this CLI leaves the image as it is. Each run reports the engine it started on: read engine in inspect.`,\n };\n const order = compareVersions(job.tag, expected);\n if (order === 0) return { status: 'match', jobVersion: job.tag, expected, nextAction: '' };\n if (order < 0)\n return {\n status: 'behind',\n jobVersion: job.tag,\n expected,\n nextAction: `The job runs ${bundled.repository}:${job.tag}; this CLI authors for ${expected}. Run, pull and reads work on the job's image, but push is refused until the job is upgraded: ask the user, then run upgrade-runtime, which moves the job to ${PIPELINE_RUNNER_IMAGE} for everyone on the tenant and for its next scheduled run.${inAgentSandbox() ? '' : ' Or keep the job on its image and author with the CLI release that targets it.'}`,\n };\n return {\n status: 'ahead',\n jobVersion: job.tag,\n expected,\n nextAction: `The job runs ${bundled.repository}:${job.tag}; this CLI authors for ${expected}. Run and push work on the job's image, but this CLI does not describe what the newer engine added. ${CLI_UPDATE_INSTRUCTION}`,\n };\n}\n\n/** Version pinning may upgrade Simple Pipelines, but must never convert another kind of app. */\nexport function assertPipelineRuntime(jobImage: string): RuntimeComparison {\n const runtime = compareRuntime(jobImage);\n if (runtime.status === 'incompatible')\n throw new PipelineError(\n 'refused',\n 'PIPELINE_RUNTIME_UNSUPPORTED',\n `Runner image \"${jobImage || '(tenant default or unknown)'}\" is not a Simple Pipelines runner. The existing app must be preserved.`,\n runtime.nextAction,\n );\n return runtime;\n}\n"],
5
4
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAsB;AACtB,uB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U;AAAA,IAC7G;AACJ,QAAM,QAAQ,gBAAgB,IAAI,KAAK,QAAQ;AAC/C,MAAI,UAAU,EAAG,QAAO,EAAE,QAAQ,SAAS,YAAY,IAAI,KAAK,UAAU,YAAY,GAAG;AACzF,MAAI,QAAQ;AACR,WAAO;AAAA,MACH,QAAQ;AAAA,MACR,YAAY,IAAI;AAAA,MAChB;AAAA,MACA,YAAY,gBAAgB,QAAQ,UAAU,IAAI,IAAI,GAAG,0BAA0B,QAAQ,gKAAgK,qBAAqB,kEAA8D,oCAAe,IAAI,KAAK,gFAAgF;AAAA,IAC1b;AACJ,SAAO;AAAA,IACH,QAAQ;AAAA,IACR,YAAY,IAAI;AAAA,IAChB;AAAA,IACA,YAAY,gBAAgB,QAAQ,UAAU,IAAI,IAAI,GAAG,0BAA0B,QAAQ,uGAAuG,uCAAsB;AAAA,EAC5N;AACJ;AAGO,SAAS,sBAAsB,UAAqC;AACvE,QAAM,UAAU,eAAe,QAAQ;AACvC,MAAI,QAAQ,WAAW;AACnB,UAAM,IAAI;AAAA,MACN;AAAA,MACA;AAAA,MACA,iBAAiB,YAAY,6BAA6B;AAAA,MAC1D,QAAQ;AAAA,IACZ;AACJ,SAAO;AACX;",
6
5
  "names": ["reference"]
7
6
  }
@@ -29,8 +29,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var service_exports = {};
30
30
  __export(service_exports, {
31
31
  BLANK_SETUP: () => BLANK_SETUP,
32
+ DESCRIPTION_LIMIT: () => DESCRIPTION_LIMIT,
32
33
  PipelineService: () => PipelineService,
33
34
  SCHEDULE_NOTE: () => SCHEDULE_NOTE,
35
+ describedSteps: () => describedSteps,
34
36
  loadOutcomes: () => loadOutcomes,
35
37
  localSourceFiles: () => localSourceFiles,
36
38
  pipelineArgumentNames: () => pipelineArgumentNames,
@@ -57,6 +59,7 @@ var import_requests = require("./requests");
57
59
  var import_readiness = require("./readiness");
58
60
  var import_errors = require("./errors");
59
61
  var import_agentSandbox = require("../utils/agentSandbox");
62
+ const { load: loadYaml } = require("js-yaml");
60
63
  const relative = import_zod.z.string().min(1).refine(
61
64
  (s) => !s.includes("\\") && !s.startsWith("/") && s.split("/").every((p) => p && p !== "." && p !== ".." && !p.startsWith(".")),
62
65
  "Expected a non-hidden relative path"
@@ -132,6 +135,25 @@ function pipelineArgumentNames(files) {
132
135
  }
133
136
  return names;
134
137
  }
138
+ const DESCRIPTION_LIMIT = 300;
139
+ function describedSteps(files) {
140
+ const missing = [];
141
+ const long = [];
142
+ for (const file of files) {
143
+ let step;
144
+ try {
145
+ step = loadYaml(fs.readFileSync(file, "utf8"));
146
+ } catch {
147
+ continue;
148
+ }
149
+ const expand = step?.expand;
150
+ const description = (expand?.template ?? step)?.description;
151
+ const text = typeof description === "string" ? description.trim() : "";
152
+ if (!text) missing.push(file);
153
+ else if (text.length > DESCRIPTION_LIMIT) long.push(file);
154
+ }
155
+ return { missing, long };
156
+ }
135
157
  const SCHEDULE_NOTE = "Source you push runs at the next scheduled start. Verify it with run first, or pause the schedule for multi-step edits.";
136
158
  function scheduleCheck(recorded, live, jobId) {
137
159
  const restore = (cron) => `Restore it with farseer_configure_app schedule="${cron}" when done, or rerun init jobId=${jobId} force=true if the change was intended.`;
@@ -312,6 +334,25 @@ class PipelineService {
312
334
  );
313
335
  }
314
336
  const models = this.localSources().filter((f) => /\/Models\/.+\.ya?ml$/.test(f));
337
+ if (models.length) {
338
+ const shown = (files) => files.map((f) => f.slice(f.indexOf("Models/"))).join(", ");
339
+ const { missing, long } = describedSteps(models.map((f) => path.join(this.filesDir, f)));
340
+ const gaps = [
341
+ missing.length ? `No description: ${shown(missing)}.` : "",
342
+ long.length ? `Over ${DESCRIPTION_LIMIT} characters: ${shown(long)}.` : ""
343
+ ].filter(Boolean);
344
+ checks.push(
345
+ gaps.length ? {
346
+ name: "step-descriptions",
347
+ status: "warn",
348
+ detail: `${gaps.join(" ")} The client reads a step's description in its panel on the Pipeline tab: what the step does and any rule needed to judge its result, in plain words. This never blocks a run.`
349
+ } : {
350
+ name: "step-descriptions",
351
+ status: "pass",
352
+ detail: "Every step has a description for the client"
353
+ }
354
+ );
355
+ }
315
356
  if (!this.profile.datasetIds.length)
316
357
  checks.push({
317
358
  name: "declared-outputs",
@@ -377,7 +418,8 @@ class PipelineService {
377
418
  return `Version ${versionId}: ${manifest.files.length} Parquet file(s), ${bytes} bytes. ${access} verified on the first file; full-query performance is not established by this probe.`;
378
419
  });
379
420
  }
380
- const automatedReady = checks.every((c) => c.status === "pass");
421
+ const ready = (c) => c.status === "pass" || c.status === "warn";
422
+ const automatedReady = checks.every(ready);
381
423
  const setup = readSetup(this.profile.setup);
382
424
  checks.push(
383
425
  "recorded" in setup ? {
@@ -394,7 +436,7 @@ class PipelineService {
394
436
  tenant: this.profile.tenant,
395
437
  jobId: this.profile.jobId,
396
438
  automatedReady,
397
- readyForAcceptance: checks.every((c) => c.status === "pass"),
439
+ readyForAcceptance: checks.every(ready),
398
440
  checks,
399
441
  limits: import_query.DEFAULT_LIMITS,
400
442
  remainingAcceptance: "Run the two-person client exercise and the configured source/reconciliation task. This read-only check does not validate source credentials, replay, business results or client-provider agreements."
@@ -1012,8 +1054,10 @@ function setArgumentNames(source) {
1012
1054
  // Annotate the CommonJS export names for ESM import in node:
1013
1055
  0 && (module.exports = {
1014
1056
  BLANK_SETUP,
1057
+ DESCRIPTION_LIMIT,
1015
1058
  PipelineService,
1016
1059
  SCHEDULE_NOTE,
1060
+ describedSteps,
1017
1061
  loadOutcomes,
1018
1062
  localSourceFiles,
1019
1063
  pipelineArgumentNames,
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/pipeline/service.ts"],
4
- "sourcesContent": ["import { resolveRunArguments } from './runArguments';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { createHash, randomUUID } from 'crypto';\nimport { z } from 'zod';\nimport { FarseerService, RemoteFile } from '../services/farseerService';\nimport { SyncService, SyncState } from '../services/syncService';\nimport { DEFAULT_LIMITS, queryFiles } from './query';\nimport { PIPELINE_ENGINE_PROFILE, CLI_UPDATE_INSTRUCTION, engineReport } from './reference';\nimport { assertPipelineRuntime, compareRuntime, compareVersions, PIPELINE_RUNNER_IMAGE } from './runtime';\nimport { CLI_VERSION } from '../utils/constants';\nimport { resolveRunnerImage, type RemoteApp } from '../services/apps';\nimport { setTimeout as delay } from 'timers/promises';\nimport { boundedPipelineClient } from './requests';\nimport { probeParquetAccess, probeParquetPrefix } from './readiness';\nimport { PipelineError, httpStatus } from './errors';\nimport { inAgentSandbox } from '../utils/agentSandbox';\n\nconst relative = z\n .string()\n .min(1)\n .refine(\n (s) =>\n !s.includes('\\\\') &&\n !s.startsWith('/') &&\n s.split('/').every((p) => p && p !== '.' && p !== '..' && !p.startsWith('.')),\n 'Expected a non-hidden relative path',\n );\n// Owner statements, filled in by hand after init writes the blank record. The profile loads whatever\n// the owner has written so far, so a record part-way through never stops the other commands; only a\n// complete record passes check, and check names what is still missing.\nconst recordedSetupSchema = z\n .object({\n owner: z.string().min(1),\n checkedAt: z.string().datetime({ offset: true }),\n evidence: z.string().min(1),\n retentionDays: z.number().int().positive(),\n otherWritersExcluded: z.literal(true),\n runtimeVerified: z.literal(true),\n })\n .strict();\nexport const profileSchema = z\n .object({\n organisation: z.string().min(1),\n tenant: z.string().min(1),\n author: z.string().min(1).default('shared'),\n datasetIds: z.array(z.string().uuid()).max(100).default([]),\n jobId: z.number().int().positive(),\n sourceFolderId: z.number().int().positive(),\n workspace: relative,\n entrypoint: relative,\n /** Recorded by older profiles; the job's live image is what counts. */\n runnerImage: z.string().min(1).optional(),\n /** The job's schedule when init ran; null for none, absent in profiles from before this was recorded. */\n schedule: z.string().min(1).nullable().optional(),\n engine: z.string().min(1),\n configFiles: z.array(relative).default([]),\n setup: z.record(z.unknown()).optional(),\n })\n .strict();\nexport type PipelineProfile = z.infer<typeof profileSchema>;\nexport type RecordedSetup = z.infer<typeof recordedSetupSchema>;\nexport function readPipelineProfileFile(file: string): PipelineProfile {\n return profileSchema.parse(JSON.parse(fs.readFileSync(file, 'utf8')));\n}\nexport const BLANK_SETUP = {\n owner: '',\n checkedAt: '',\n evidence: '',\n retentionDays: 0,\n otherWritersExcluded: false,\n runtimeVerified: false,\n};\n/** The complete record, or the fields that keep it from being one, in the order the record lists them. */\nfunction readSetup(setup: PipelineProfile['setup']): { recorded: RecordedSetup } | { missing: string } {\n const parsed = recordedSetupSchema.safeParse(setup ?? {});\n if (parsed.success) return { recorded: parsed.data };\n const fields = parsed.error.issues.flatMap((issue) =>\n issue.code === 'unrecognized_keys'\n ? issue.keys.map((key) => `${key} (not a setup field)`)\n : [String(issue.path[0])],\n );\n return { missing: [...new Set(fields)].join(', ') };\n}\nexport interface Run {\n id: number;\n uuid: string;\n remoteJobId: number;\n status: string;\n logs: string[];\n startedAt: string;\n}\n/**\n * How far the laptop's clock may run ahead of the backend's before a run the backend admitted could\n * look older than the receipt that submitted it. Generous on purpose: a wider window only lists more\n * runs for the author to choose from, never clears a receipt whose run exists.\n */\nconst CLOCK_SKEW_MARGIN_MS = 10 * 60 * 1000;\nconst RECOVER_HINT =\n 'In a terminal, `farseer pipeline recover` clears the receipt if run history has no run since the submission, and `farseer pipeline recover --uuid <uuid>` attaches the run that is this submission.';\nexport type PipelineClient = FarseerService & {\n pipelineRequest<T>(method: 'GET' | 'POST', route: string, body?: unknown): Promise<T>;\n};\ntype Receipt = {\n organisation: string;\n tenant: string;\n jobId: number;\n workspace: string;\n author: string;\n submittedAt: string;\n phase: 'unconfirmed' | 'accepted';\n runUuid?: string;\n};\nconst terminal = (status: string) => ['FINISHED', 'ERROR'].includes(status);\nconst digest = (data: string | Buffer) => createHash('sha256').update(data).digest('hex');\n// The existing tenant-wide baseline is a shared mutable JSON file. Separate workspace\n// baselines prevent two simultaneous syncs from losing each other's recorded hashes.\nclass WorkspaceSync extends SyncService {\n constructor(\n tenant: string,\n client: FarseerService,\n private stateFile: string,\n ) {\n super(tenant, client);\n }\n loadSyncState(): SyncState {\n return fs.existsSync(this.stateFile)\n ? JSON.parse(fs.readFileSync(this.stateFile, 'utf8'))\n : { lastSync: '', files: {} };\n }\n saveSyncState(state: SyncState) {\n const tmp = `${this.stateFile}.${randomUUID()}`;\n fs.writeFileSync(tmp, JSON.stringify(state), { mode: 0o600 });\n fs.renameSync(tmp, this.stateFile);\n }\n}\n\n/** Every distinct `pipeline_args.NAME` the given source files reference, in first-seen order. */\nexport function pipelineArgumentNames(files: string[]): string[] {\n const names: string[] = [];\n for (const file of files) {\n if (!fs.existsSync(file)) continue;\n for (const match of fs.readFileSync(file, 'utf8').matchAll(/pipeline_args\\.([A-Za-z_][A-Za-z0-9_]*)/g))\n if (!names.includes(match[1])) names.push(match[1]);\n }\n return names;\n}\n\nexport const SCHEDULE_NOTE =\n 'Source you push runs at the next scheduled start. Verify it with run first, or pause the schedule for multi-step edits.';\n\n/**\n * A scheduled job is allowed, but its schedule must never be lost by accident: init records it,\n * and a schedule that has since been removed or changed fails check with the way back.\n */\nexport function scheduleCheck(recorded: string | null | undefined, live: string | null | undefined, jobId: number) {\n // init refuses force together with name, so the way back names the job.\n const restore = (cron: string) =>\n `Restore it with farseer_configure_app schedule=\"${cron}\" when done, or rerun init jobId=${jobId} force=true if the change was intended.`;\n if (recorded && !live)\n return {\n status: 'fail' as const,\n detail: `The job's schedule \"${recorded}\" was removed since init. ${restore(recorded)}`,\n };\n if (recorded && live && recorded !== live)\n return {\n status: 'fail' as const,\n detail: `The job's schedule changed from \"${recorded}\" to \"${live}\" since init. ${restore(recorded)}`,\n };\n if (live) return { status: 'pass' as const, detail: `Job runs on schedule \"${live}\". ${SCHEDULE_NOTE}` };\n return { status: 'pass' as const, detail: 'Job has no schedule' };\n}\n\n/** The engine's PIPELINE_VISUALIZATION_MARKER payloads in the given log lines, in order. */\nfunction parseMarkers(lines: string[]): Record<string, unknown>[] {\n return lines.flatMap((line) => {\n const pos = line.indexOf('PIPELINE_VISUALIZATION_MARKER');\n if (pos < 0) return [];\n try {\n return [JSON.parse(line.slice(line.indexOf('{', pos)))];\n } catch {\n return [{ event: 'unreadable_marker' }];\n }\n });\n}\n\nexport interface LoadOutcome {\n name: string;\n importId: number | null;\n outcome: string;\n}\n\n/**\n * Every import each load ran, in the order they ran, with its last reported outcome: commit_confirmed,\n * not_committed or unknown. A load runs one import per cells entry, all observed under the load's\n * name, so an import is told apart by its id. An import whose create failed is observed once, with\n * no id, and is an import of its own.\n */\nexport function loadOutcomes(markers: Record<string, unknown>[]): LoadOutcome[] {\n const loads: LoadOutcome[] = [];\n for (const m of markers) {\n if (m.event !== 'import_observation') continue;\n const name = String(m.name);\n const importId = typeof m.import_id === 'number' ? m.import_id : null;\n const known = importId === null ? undefined : loads.find((l) => l.name === name && l.importId === importId);\n if (known) known.outcome = String(m.outcome);\n else loads.push({ name, importId, outcome: String(m.outcome) });\n }\n return loads;\n}\n\nexport interface SkippedOutput {\n name: string;\n type: 'load' | 'export';\n reason: string;\n}\n\n/**\n * Loads and exports the run skipped. An optional source that is missing skips everything that\n * depends on it, and the run still finishes successfully, so this is the only place it shows.\n */\nexport function skippedOutputs(markers: Record<string, unknown>[]): SkippedOutput[] {\n const types = new Map<string, unknown>();\n for (const m of markers) if (m.event === 'dataset_registered') types.set(String(m.name), m.type);\n return markers.flatMap((m) => {\n const type = types.get(String(m.name));\n return m.event === 'step_skipped' && (type === 'load' || type === 'export')\n ? [{ name: String(m.name), type, reason: String(m.reason ?? '') }]\n : [];\n });\n}\n\nfunction skippedAttention(status: string, skipped: SkippedOutput[]): string {\n const count = (type: 'load' | 'export') => skipped.filter((s) => s.type === type).length;\n const phrase = (n: number, word: string) => (n ? `${n} ${word}${n > 1 ? 's' : ''}` : '');\n const parts = [phrase(count('load'), 'load'), phrase(count('export'), 'export')].filter(Boolean);\n const verb = skipped.length > 1 ? 'were' : 'was';\n const ended = status === 'FINISHED' ? 'Finished' : `Ended ${status}`;\n return `${ended}, but ${parts.join(' and ')} ${verb} skipped: ${skipped\n .map((s) => `${s.name} (${s.reason})`)\n .join(\n ', ',\n )}. Nothing reached the model or Files through them. While building a pipeline, treat this as a defect to fix.`;\n}\n\n/** The fields of a profile that decide which files are pipeline source. */\nexport type SourceScope = Pick<PipelineProfile, 'workspace' | 'entrypoint' | 'configFiles'>;\n\nexport function sourcePath(profile: SourceScope, file: string): boolean {\n if (!relative.safeParse(file).success || !file.startsWith(profile.workspace + '/')) return false;\n const inner = file.slice(profile.workspace.length + 1);\n if (inner.split('/').some((p) => ['Data', 'node_modules', '__pycache__'].includes(p))) return false;\n return (\n inner === profile.entrypoint ||\n profile.configFiles.includes(inner) ||\n (/^(Models|Code)\\//.test(inner) && /\\.(py|ya?ml|json|md)$/.test(inner))\n );\n}\n\n/** Workspace source files in the pull/push scope, as tenant-relative paths. */\nexport function localSourceFiles(profile: SourceScope, filesDir: string): string[] {\n const found: string[] = [];\n const walk = (dir: string, rel: string) => {\n if (!fs.existsSync(dir)) return;\n if (fs.lstatSync(dir).isSymbolicLink()) throw new Error(`Workspace symlinks are not supported: ${rel}`);\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n if (entry.name.startsWith('.') || ['Data', 'node_modules', '__pycache__'].includes(entry.name)) continue;\n const next = `${rel}/${entry.name}`;\n if (entry.isSymbolicLink()) throw new Error(`Workspace symlinks are not supported: ${next}`);\n if (entry.isDirectory()) walk(path.join(dir, entry.name), next);\n else if (sourcePath(profile, next)) found.push(next);\n }\n };\n // Check every ancestor as well; otherwise a linked parent escapes the workspace.\n let dir = filesDir;\n for (const part of profile.workspace.split('/')) {\n dir = path.join(dir, part);\n if (fs.existsSync(dir) && fs.lstatSync(dir).isSymbolicLink())\n throw new Error('Workspace symlinks are not supported');\n }\n walk(dir, profile.workspace);\n return found;\n}\n\nexport class PipelineService {\n readonly profile: PipelineProfile;\n readonly stateDir: string;\n private readonly operationDir: string;\n private readonly sync: SyncService;\n constructor(\n profile: PipelineProfile,\n private client: PipelineClient,\n private filesDir: string,\n stateRoot: string,\n sync?: SyncService,\n ) {\n this.client = boundedPipelineClient(client);\n this.profile = profileSchema.parse(profile);\n // The profile records the grammar line it was set up with. An older line of the same major\n // still opens after a CLI update: push checks the job's own runtime before anything is written.\n const grammar = /^(\\d+)\\.(\\d+)(?:\\.\\d+)?$/.exec(this.profile.engine)?.slice(1).map(Number);\n const [major, minor] = PIPELINE_ENGINE_PROFILE.split('.').map(Number);\n if (grammar && (grammar[0] > major || (grammar[0] === major && grammar[1] > minor)))\n throw new Error(\n `This CLI's bundled grammar is ${PIPELINE_ENGINE_PROFILE}; the profile was set up for ${this.profile.engine}. ${CLI_UPDATE_INSTRUCTION}`,\n );\n if (!grammar || grammar[0] < major)\n throw new Error(\n `The profile was set up for grammar ${this.profile.engine}, which this CLI (${PIPELINE_ENGINE_PROFILE}) does not continue. Set the profile up again with init jobId=${this.profile.jobId} force=true${inAgentSandbox() ? '' : `, or keep using the CLI release that targets ${this.profile.engine}`}.`,\n );\n if (!profile.entrypoint.endsWith('.py'))\n throw new PipelineError(\n 'refused',\n 'PIPELINE_ENTRYPOINT_UNSUPPORTED',\n 'Pipeline entrypoint must be Python. The existing app must be preserved.',\n 'Use the existing app tools to inspect, run or maintain this app. Do not replace its entrypoint; migration to Simple Pipelines requires an explicit migration request.',\n );\n // Local receipts/baselines are job-scoped, without server ownership.\n this.stateDir = path.join(stateRoot, digest(`${profile.organisation}/${profile.tenant}/${profile.jobId}`));\n this.operationDir = this.stateDir;\n fs.mkdirSync(this.stateDir, { recursive: true, mode: 0o700 });\n this.sync = sync ?? new WorkspaceSync(profile.tenant, this.client, path.join(this.stateDir, 'sync.json'));\n }\n async versions(datasetId: string) {\n z.string().uuid().parse(datasetId);\n const [dataset, versions] = await Promise.all([\n this.client.pipelineRequest('GET', `/labs/datasets/${datasetId}`),\n this.client.pipelineRequest('GET', `/labs/datasets/${datasetId}/versions`),\n ]);\n return { dataset, versions };\n }\n async check(signal?: AbortSignal) {\n const checks: { name: string; status: 'pass' | 'fail' | 'pending'; detail: string }[] = [];\n const attempt = async (name: string, fn: () => Promise<string>) => {\n signal?.throwIfAborted();\n try {\n checks.push({ name, status: 'pass', detail: await fn() });\n } catch (error) {\n signal?.throwIfAborted();\n checks.push({ name, status: 'fail', detail: redact(String(error)) });\n }\n };\n await attempt('prepared-job', async () => {\n await this.verifyJob();\n return 'Job, entrypoint and source folder match';\n });\n let job: RemoteApp | null = null;\n try {\n signal?.throwIfAborted();\n job = await this.client.getApp(String(this.profile.jobId));\n if (job)\n checks.push({\n name: 'schedule',\n ...scheduleCheck(this.profile.schedule, job.schedule, this.profile.jobId),\n });\n const runtime = compareRuntime(job?.runnerImage ?? '');\n checks.push({\n name: 'runner-image',\n status:\n runtime.status === 'match'\n ? 'pass'\n : runtime.status === 'behind' || runtime.status === 'incompatible'\n ? 'fail'\n : 'pending',\n detail:\n runtime.status === 'match'\n ? `Job runs ${PIPELINE_RUNNER_IMAGE}, the image this CLI authors for`\n : runtime.nextAction,\n });\n } catch (error) {\n signal?.throwIfAborted();\n checks.push({ name: 'runner-image', status: 'fail', detail: redact(String(error)) });\n }\n // Secrets reach a pipeline only through job arguments the YAML names as\n // {{ pipeline_args.NAME }}; a name the job does not define fails at run time.\n if (job) {\n const used = pipelineArgumentNames(this.localSources().map((f) => path.join(this.filesDir, f)));\n const defined = new Set((job.expectedArguments ?? []).map((a) => a.name));\n const unset = used.filter((name) => !defined.has(name));\n // main.py may compute an argument and write it into FARSEER_ARGS before run_pipeline\n // (the practices guide's pattern for a canonical MONTH); that one exists at run time.\n const entry = path.join(this.filesDir, this.profile.workspace, this.profile.entrypoint);\n const setByMain = setArgumentNames(fs.existsSync(entry) ? fs.readFileSync(entry, 'utf8') : '');\n const missing = unset.filter((name) => !setByMain.has(name));\n const derived = unset.filter((name) => setByMain.has(name));\n checks.push(\n missing.length\n ? {\n name: 'job-arguments',\n status: 'fail',\n detail: `The source uses pipeline_args ${missing.join(', ')} but the job defines no such argument. Add each one to the job (secret: true for keys and passwords) with farseer_configure_app or in the web app, then set its value.`,\n }\n : derived.length\n ? {\n name: 'job-arguments',\n status: 'pending',\n detail: `${derived.join(', ')} ${derived.length === 1 ? 'is' : 'are'} not job arguments: main.py sets ${derived.length === 1 ? 'it' : 'them'} before run_pipeline, so ${derived.length === 1 ? 'it is' : 'they are'} not checked here. Make sure main.py sets ${derived.length === 1 ? 'it' : 'them'} on every path. The job defines the rest.`,\n }\n : {\n name: 'job-arguments',\n status: 'pass',\n detail: used.length\n ? `Job defines every argument the source uses (${used.join(', ')})`\n : 'Source uses no job arguments',\n },\n );\n }\n // The engine creates a dataset on its first write, so a profile without IDs is\n // a pipeline that has not run yet, not a broken setup.\n const models = this.localSources().filter((f) => /\\/Models\\/.+\\.ya?ml$/.test(f));\n if (!this.profile.datasetIds.length)\n checks.push({\n name: 'declared-outputs',\n status: 'pending',\n detail: models.length\n ? `No output dataset IDs recorded yet; datasets are created on the first run. After it, rerun init jobId=${this.profile.jobId} force=true to record their IDs.`\n : 'No dataset YAML under Models/ yet. Write the first one there: the guide topics FarseerFilesExtractConfig, ParseConfig, TransformConfig and LoadCellsConfig each end with a complete example.',\n });\n else\n await attempt('declared-outputs', async () => {\n return `${this.profile.datasetIds.length} prepared output(s); this is configuration, not an ownership lock`;\n });\n let latestCli: string | undefined;\n try {\n signal?.throwIfAborted();\n ({ latestCliVersion: latestCli } = await this.client.pipelineRequest<{ latestCliVersion?: string }>(\n 'GET',\n '/pipelineAuthoring',\n ));\n } catch (error) {\n signal?.throwIfAborted();\n checks.push({ name: 'cli-version', status: 'fail', detail: redact(String(error)) });\n }\n if (latestCli !== undefined)\n checks.push(\n compareVersions(CLI_VERSION, latestCli) < 0\n ? {\n name: 'cli-version',\n status: 'pending',\n detail: `CLI ${CLI_VERSION} is installed; ${latestCli} is the CLI released with this tenant's current runner image. ${CLI_UPDATE_INSTRUCTION}`,\n }\n : { name: 'cli-version', status: 'pass', detail: `CLI ${CLI_VERSION} is current` },\n );\n for (const datasetId of this.profile.datasetIds) {\n await attempt(`dataset:${datasetId}`, async () => {\n const dataset = await this.client.pipelineRequest<{ id: string; currentVersionId?: string | null }>(\n 'GET',\n `/labs/datasets/${datasetId}`,\n );\n if (dataset.id !== datasetId) throw new Error('Dataset identity did not match');\n if (!dataset.currentVersionId) {\n checks.push({\n name: `signed-read:${datasetId}`,\n status: 'pending',\n detail: 'No published version yet. Complete the prepared first run, then check again.',\n });\n return 'Prepared dataset exists; it has no current version';\n }\n const manifest = await this.client.pipelineRequest<{\n files: { filename: string; size: number; signedUrl: string }[];\n }>('GET', `/labs/datasets/${datasetId}/versions/${dataset.currentVersionId}/downloadUrls`);\n if (\n !manifest.files?.length ||\n manifest.files.length > 512 ||\n manifest.files.some(\n (f) => !f.filename.endsWith('.parquet') || !Number.isSafeInteger(f.size) || f.size < 0,\n )\n )\n throw new Error('A complete supported Parquet manifest is required');\n const bytes = manifest.files.reduce((sum, f) => sum + f.size, 0);\n if (bytes > DEFAULT_LIMITS.inputBytes)\n throw new Error(\n 'This version exceeds the 256 MiB query download limit; prepare a smaller pipeline output',\n );\n // A sandbox reaches only the API, so a turn key probes through it, as query does.\n const versionId = dataset.currentVersionId;\n const first = manifest.files[0];\n if (this.client.agentSession)\n await probeParquetPrefix((probeSignal) =>\n this.client.downloadDatasetVersionFile(datasetId, versionId, first.filename, probeSignal),\n );\n else await probeParquetAccess(first.signedUrl);\n const access = this.client.agentSession ? 'Read through the API' : 'Signed GET';\n return `Version ${versionId}: ${manifest.files.length} Parquet file(s), ${bytes} bytes. ${access} verified on the first file; full-query performance is not established by this probe.`;\n });\n }\n const automatedReady = checks.every((c) => c.status === 'pass');\n const setup = readSetup(this.profile.setup);\n checks.push(\n 'recorded' in setup\n ? {\n name: 'setup-evidence',\n status: 'pass',\n detail: `Recorded by ${setup.recorded.owner} at ${setup.recorded.checkedAt}: ${setup.recorded.retentionDays} days retention, other writers excluded, runtime contents verified. Evidence: ${setup.recorded.evidence}. Reconfirm after setup changes; these are owner statements, not API-verified facts.`,\n }\n : {\n name: 'setup-evidence',\n status: 'pending',\n detail: `Setup owner must record runtime verification, agreed retention and exclusion of other writers in the profile setup field. Not yet recorded: ${setup.missing}. This command cannot verify them from the APIs.`,\n },\n );\n return {\n tenant: this.profile.tenant,\n jobId: this.profile.jobId,\n automatedReady,\n readyForAcceptance: checks.every((c) => c.status === 'pass'),\n checks,\n limits: DEFAULT_LIMITS,\n remainingAcceptance:\n 'Run the two-person client exercise and the configured source/reconciliation task. This read-only check does not validate source credentials, replay, business results or client-provider agreements.',\n };\n }\n async queryVersions(\n bindings: { name: string; datasetId: string; versionId: string }[],\n sql: string,\n signal?: AbortSignal,\n ) {\n z.array(\n z\n .object({\n name: z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/),\n datasetId: z.string().uuid(),\n versionId: z.string().uuid(),\n })\n .strict(),\n )\n .min(1)\n .max(16)\n .parse(bindings);\n if (new Set(bindings.map((b) => b.name.toLowerCase())).size !== bindings.length)\n throw new Error('SQL binding names must be distinct');\n type VersionFile = { filename: string; size: number; signedUrl: string };\n // Typed, not inferred: the sandbox download callback below reads it, and strict tsc cannot\n // infer an empty array's element type inside a callback.\n const inputs: ((typeof bindings)[number] & { files: VersionFile[] })[] = [];\n for (const b of bindings) {\n const result = await this.client.pipelineRequest<{\n files: VersionFile[];\n }>('GET', `/labs/datasets/${b.datasetId}/versions/${b.versionId}/downloadUrls`);\n if (!result.files?.length || result.files.some((f) => !f.filename.endsWith('.parquet')))\n throw new Error('This version has no supported Parquet contents');\n inputs.push({ ...b, files: result.files });\n }\n const total = inputs.reduce((sum, b) => sum + b.files.reduce((n, f) => n + f.size, 0), 0);\n if (total > DEFAULT_LIMITS.inputBytes) throw new Error('Input download byte limit exceeded');\n const result = await queryFiles(\n {\n bindings: inputs.map((b) => ({ name: b.name, urls: b.files.map((f) => f.signedUrl) })),\n sql,\n limits: DEFAULT_LIMITS,\n },\n signal,\n this.client.agentSession\n ? (binding, file, downloadSignal) => {\n const input = inputs[binding];\n return this.client.downloadDatasetVersionFile(\n input.datasetId,\n input.versionId,\n input.files[file].filename,\n downloadSignal,\n );\n }\n : undefined,\n );\n return {\n ...result,\n tenant: this.profile.tenant,\n semantics: 'explicit immutable dataset versions',\n inputs: inputs.map(({ files, ...binding }) => ({\n ...binding,\n files: files.map(({ signedUrl: _url, ...file }) => file),\n })),\n };\n }\n async restore(datasetId: string, versionId: string, expectedCurrentVersionId: string) {\n [datasetId, versionId, expectedCurrentVersionId].forEach((id) => z.string().uuid().parse(id));\n if (!this.profile.datasetIds.includes(datasetId))\n throw new PipelineError(\n 'refused',\n 'RESTORE_SCOPE',\n 'Restore only a declared output dataset',\n 'Use an output dataset from the prepared profile.',\n );\n return this.exclusive(async () => {\n await this.idle();\n let dataset: unknown;\n try {\n dataset = await this.client.pipelineRequest(\n 'POST',\n `/labs/datasets/${datasetId}/versions/${versionId}/restore`,\n { expectedCurrentVersionId },\n );\n } catch (error) {\n const refused = [400, 401, 403, 404, 409].includes(httpStatus(error) ?? 0);\n throw new PipelineError(\n refused ? 'refused' : 'unknown',\n refused ? 'RESTORE_REFUSED' : 'RESTORE_UNCONFIRMED',\n redact(String(error)),\n 'Read versions and current dataset state before any further restore. Do not blindly retry.',\n );\n }\n return {\n dataset,\n note: 'A state-changing restore also cancels outstanding unpublished candidates and restores the matching reading position. Inspect model imports separately.',\n };\n });\n }\n private receipt(): Receipt | undefined {\n const name = path.join(this.stateDir, 'current.json');\n return fs.existsSync(name) ? JSON.parse(fs.readFileSync(name, 'utf8')) : undefined;\n }\n private save(receipt: Receipt) {\n const tmp = path.join(this.stateDir, randomUUID());\n fs.writeFileSync(tmp, JSON.stringify(receipt, null, 2), { mode: 0o600 });\n fs.renameSync(tmp, path.join(this.stateDir, 'current.json'));\n if (receipt.runUuid)\n fs.writeFileSync(path.join(this.stateDir, `${receipt.runUuid}.json`), JSON.stringify(receipt), {\n mode: 0o600,\n });\n }\n private async exclusive<T>(fn: () => Promise<T>): Promise<T> {\n const name = path.join(this.operationDir, 'operation.lock');\n let fd: number;\n try {\n fd = fs.openSync(name, 'wx', 0o600);\n } catch (error: any) {\n if (error.code !== 'EEXIST') throw error;\n throw new PipelineError(\n 'refused',\n 'PIPELINE_LOCAL_BUSY',\n 'Workspace operation in progress. An abandoned lock requires local recovery; do not resubmit.',\n 'Inspect the existing local command; use CLI recovery only after its process has stopped.',\n );\n }\n fs.writeFileSync(fd, String(process.pid));\n fs.closeSync(fd);\n try {\n return await fn();\n } finally {\n fs.unlinkSync(name);\n }\n }\n /**\n * Ends a queued run of this job: one a runner never started, which would otherwise stay queued\n * in the job's history. A running run is refused: stopping work part-way is a person's call, made\n * with Stop in the web app. The result reads the run back, so it says whether the run closed.\n */\n async terminate(uuid: string): Promise<{ runUuid: string; status: string; terminated: boolean; note?: string }> {\n z.string().uuid().parse(uuid);\n const run = await this.findRun(uuid);\n if (!run)\n throw new PipelineError(\n 'refused',\n 'RUN_NOT_FOUND',\n `Run ${uuid} is not a run of job ${this.profile.jobId}.`,\n 'Take the run UUID from runs or from the refusal that named it.',\n );\n if (run.status === 'RUNNING')\n throw new PipelineError(\n 'refused',\n 'RUN_NOT_QUEUED',\n `Run ${uuid} is running. Stopping a run part-way is a person's call. Nothing was sent.`,\n 'Ask a person to stop it with Stop in the web app, then wait for it to end. Do not retry terminate.',\n uuid,\n );\n if (run.status !== 'QUEUED')\n throw new PipelineError(\n 'refused',\n 'RUN_NOT_QUEUED',\n `Run ${uuid} has already ended (${run.status}).`,\n 'Nothing to terminate; inspect it if you need its outcome.',\n uuid,\n );\n try {\n await this.client.pipelineRequest('POST', `/remoteJobs/${this.profile.jobId}/cancelQueued/${uuid}`);\n } catch (error) {\n if (httpStatus(error) === 409)\n throw new PipelineError(\n 'refused',\n 'RUN_NOT_QUEUED',\n `Run ${uuid} started before cancellation. It was not stopped.`,\n 'Ask a person to stop it with Stop in the web app. Do not retry terminate.',\n uuid,\n );\n if (httpStatus(error) === 404 || httpStatus(error) === 405)\n throw new PipelineError(\n 'refused',\n 'QUEUED_CANCELLATION_UNAVAILABLE',\n 'Queued-only cancellation is unavailable, or the job or run no longer exists.',\n 'Inspect the run and check that the backend supports queued-only cancellation. Do not fall back to the general Stop endpoint.',\n uuid,\n );\n throw error;\n }\n const status = (await this.findRun(uuid))?.status ?? 'unknown';\n if (status !== 'QUEUED')\n return { runUuid: uuid, status, terminated: status === 'ERROR' || status === 'FINISHED' };\n return {\n runUuid: uuid,\n status,\n terminated: false,\n note: 'The termination was sent, but the run is still queued. Check it again with inspect; if it stays queued, ask a person to look at it in the web app.',\n };\n }\n async findRun(uuid: string): Promise<Run | undefined> {\n if (!/^[a-f0-9-]{36}$/i.test(uuid)) throw new Error('Invalid run UUID');\n return (await this.history()).find((r) => r.uuid === uuid);\n }\n private async history(): Promise<Run[]> {\n const runs = await this.client.pipelineRequest<Run[]>('GET', `/remoteJobs/${this.profile.jobId}/remoteJobRuns`);\n return runs.filter((r) => r.remoteJobId === this.profile.jobId);\n }\n private async idle(requireRun = false) {\n const receipt = this.receipt();\n if (!receipt) {\n if (requireRun) throw new Error('Run this workspace before querying outputs');\n return;\n }\n if (!receipt.runUuid)\n throw new PipelineError(\n 'unknown',\n 'SUBMISSION_UNCONFIRMED',\n `Submission outcome unknown; no automatic retry. ${RECOVER_HINT}`,\n 'Ask the author to run farseer pipeline recover in a terminal: it clears the receipt when history shows no run was accepted, or attaches the exact run with --uuid. Do not resubmit.',\n );\n const run = await this.findRun(receipt.runUuid);\n if (!run || !terminal(run.status))\n throw new PipelineError(\n run ? 'refused' : 'unknown',\n run ? 'RUN_ACTIVE' : 'RUN_UNCONFIRMED',\n `Workspace run ${receipt.runUuid} is ${run?.status ?? 'unconfirmed'}`,\n 'Inspect this run by UUID before any further changes or submission.',\n receipt.runUuid,\n );\n }\n private async verifyJob() {\n const p = this.profile;\n const job = await this.client.getApp(String(p.jobId));\n // Check the live family before reporting setup drift: a TypeScript app must not\n // be reconfigured back to the profile's Python entrypoint as a \"repair\".\n if (job) assertPipelineRuntime(job.runnerImage ?? '');\n const folder = await this.client.resolveSourceFolder(p.workspace);\n if (\n !job ||\n !folder ||\n job.sourceFolderId !== p.sourceFolderId ||\n folder.id !== p.sourceFolderId ||\n !folder.scripts.some((s) => s.id === job.mainScriptFileId && s.name === p.entrypoint)\n ) {\n throw new PipelineError(\n 'refused',\n 'SETUP_CHANGED',\n 'Prepared job, entrypoint or workspace changed. Repair pipeline setup before continuing.',\n 'Ask the setup owner to reconcile the prepared job and profile before continuing.',\n );\n }\n return job;\n }\n /** Workspace source files in the pull/push scope, as tenant-relative paths. */\n localSources(): string[] {\n return localSourceFiles(this.profile, this.filesDir);\n }\n /** The job's run history, newest first, with whether a local receipt names each run. */\n async runs(limit = 20) {\n z.number().int().positive().parse(limit);\n const history = await this.client.pipelineRequest<(Run & { startedAt: string; finishedAt?: string })[]>(\n 'GET',\n `/remoteJobs/${this.profile.jobId}/remoteJobRuns`,\n );\n const runs = history\n .filter((r) => r.remoteJobId === this.profile.jobId)\n .sort((a, b) => Date.parse(b.startedAt) - Date.parse(a.startedAt) || b.id - a.id)\n .slice(0, limit)\n .map((r) => ({\n uuid: r.uuid,\n status: r.status,\n startedAt: r.startedAt,\n ...(r.finishedAt ? { finishedAt: r.finishedAt } : {}),\n receipt: fs.existsSync(path.join(this.stateDir, `${r.uuid}.json`)),\n }));\n return { tenant: this.profile.tenant, jobId: this.profile.jobId, runs };\n }\n private async sources() {\n const local = this.localSources();\n const remote = (await this.client.listFiles(['Files', ...this.profile.workspace.split('/')])).filter((f) =>\n sourcePath(this.profile, f.path),\n );\n const onlyFiles = [\n ...new Set([\n ...local,\n ...remote.map((f) => f.path),\n ...Object.keys(this.sync.loadSyncState().files).filter((f) => sourcePath(this.profile, f)),\n ]),\n ];\n if (!onlyFiles.length) throw new Error('Empty source scope; refusing tenant-wide fallback');\n return { local, remote, onlyFiles };\n }\n async syncSources(direction: 'pull' | 'push') {\n return this.exclusive(async () => {\n await this.idle();\n const job = await this.verifyJob();\n // Source written with this CLI's grammar may use what an older engine does not know.\n const runtime = compareRuntime(job.runnerImage ?? '');\n if (direction === 'push' && runtime.status === 'behind')\n throw new PipelineError(\n 'refused',\n 'RUNTIME_UPGRADE_REQUIRED',\n `The job runs ${job.runnerImage}, older than ${PIPELINE_RUNNER_IMAGE} this CLI authors for. Nothing was pushed.`,\n runtime.nextAction,\n );\n // Nothing here keeps this CLI's source off another engine major on a newer image or a moving\n // tag: the tag does not show the engine major (runner 1.12.2 runs engine 2.9), and\n // minimumCliVersion is not tied to it. Before an engine major ships, the engine must refuse\n // source that does not declare that major.\n const { onlyFiles } = await this.sources();\n // Calls file sync directly: never the generic MCP push that also updates apps.\n let result: Awaited<ReturnType<SyncService['push']>> | Awaited<ReturnType<SyncService['pull']>>;\n try {\n result = await (direction === 'pull' ? this.sync.pull({ onlyFiles }) : this.sync.push({ onlyFiles }));\n } catch (error) {\n throw new PipelineError(\n 'unknown',\n 'SYNC_INCOMPLETE',\n redact(String(error)),\n 'Some files may already have changed. Pull and reconcile source differences before running.',\n );\n }\n // On a scheduled job a push is a deploy: say so in the result the author reads.\n return direction === 'push' && job.schedule\n ? { ...result, schedule: { cron: job.schedule, note: SCHEDULE_NOTE } }\n : result;\n });\n }\n /**\n * Move the job to the image this CLI authors for. Only a job behind it moves: a job on a\n * moving tag or digest may already run a newer engine, and a job ahead needs a newer CLI.\n */\n async upgradeRuntime(): Promise<{\n jobId: number;\n from: string;\n to: string;\n changed: boolean;\n schedule?: { cron: string; note: string };\n }> {\n return this.exclusive(async () => {\n await this.idle();\n const job = await this.verifyJob();\n const from = job.runnerImage ?? '';\n const runtime = compareRuntime(from);\n if (runtime.status === 'match') return { jobId: job.id, from, to: from, changed: false };\n if (runtime.status === 'ahead')\n throw new PipelineError(\n 'refused',\n 'CLI_UPDATE_REQUIRED',\n `The job runs ${from}, newer than ${PIPELINE_RUNNER_IMAGE} this CLI authors for.`,\n CLI_UPDATE_INSTRUCTION,\n );\n if (runtime.status !== 'behind')\n throw new PipelineError(\n 'refused',\n 'RUNTIME_UNVERSIONED',\n `The job runs ${from}, a moving tag or digest, so this CLI cannot tell whether ${PIPELINE_RUNNER_IMAGE} is older or newer.`,\n 'Leave the job on its image, or pin an exact image deliberately in the web app.',\n );\n const image = resolveRunnerImage(PIPELINE_RUNNER_IMAGE, await this.client.getRunnerImageRepositories());\n if ('error' in image) throw new Error(image.error);\n try {\n await this.client.updateApp(String(job.id), { runnerImage: image.image }, job);\n } catch (error) {\n // A 4xx changed nothing. Anything else may have saved the new image, and a scheduled\n // job would then run it at its next start, so the outcome is unknown, not failed.\n const status = httpStatus(error) ?? 0;\n if (status >= 400 && status < 500)\n throw new PipelineError(\n 'refused',\n 'RUNTIME_UPGRADE_REFUSED',\n `The backend refused the image change; the job stays on ${from}. ${redact(String(error))}`,\n 'Read the reason, fix the setup it names or ask the setup owner, then try again.',\n );\n throw new PipelineError(\n 'unknown',\n 'RUNTIME_UPGRADE_UNCONFIRMED',\n `The image change may have been saved: the job is on ${from} or ${image.image}. ${redact(String(error))}`,\n \"Run check to read the job's image before anything else. Do not retry blindly.\",\n );\n }\n const moved = { jobId: job.id, from, to: image.image, changed: true };\n return job.schedule\n ? {\n ...moved,\n schedule: {\n cron: job.schedule,\n note: 'The next scheduled run uses the new engine with the source already on the tenant. Run it once now to see what the new engine refuses.',\n },\n }\n : moved;\n });\n }\n async submit(args: string[] = []) {\n z.array(z.string()).parse(args);\n return this.exclusive(async () => {\n await this.idle();\n // A scheduled run or another workspace's: no receipt here names it, and nothing on the\n // backend refuses a second run of the job. Read just before submitting, so not a lock.\n const active = (await this.history()).find((r) => !terminal(r.status));\n if (active)\n throw new PipelineError(\n 'refused',\n 'RUN_ACTIVE',\n `Run ${active.uuid} of job ${this.profile.jobId} is ${active.status} (startedAt ${active.startedAt}), and a second run would overlap it. No receipt here names it, so it is the schedule's or a colleague's.`,\n \"Wait until runs shows it ended, then run again. Ask the user before terminating it: a run waiting behind other jobs in the runner's queue also stays queued with no start in its log. Do not retry run while it is active.\",\n active.uuid,\n );\n const job = await this.verifyJob();\n const runArguments = resolveRunArguments(job.expectedArguments ?? [], args);\n const { local, remote } = await this.sources();\n const differences: string[] = [];\n for (const file of new Set([...local, ...remote.map((f) => f.path)])) {\n const reference = remote.find((r) => r.path === file);\n if (\n !local.includes(file) ||\n !reference ||\n digest(fs.readFileSync(path.join(this.filesDir, file))) !==\n digest(await this.client.getFileContentAsBuffer(reference.reference))\n )\n differences.push(file);\n }\n if (!local.includes(`${this.profile.workspace}/${this.profile.entrypoint}`))\n differences.push(this.profile.entrypoint);\n if (differences.length)\n throw new PipelineError(\n 'refused',\n 'UNSYNCED_SOURCES',\n `Unsynced source files: ${differences.join(', ')}`,\n 'Pull and reconcile the listed source files, then push the intended changes before running.',\n );\n const { organisation, tenant, jobId, workspace, author } = this.profile;\n const receipt: Receipt = {\n organisation,\n tenant,\n jobId,\n workspace,\n author,\n submittedAt: new Date().toISOString(),\n phase: 'unconfirmed',\n };\n const previousReceipt = this.receipt();\n this.save(receipt); // Before POST: a lost response must survive client restart.\n let result: { runUuid: string };\n try {\n result = await this.client.pipelineRequest<{ runUuid: string }>('POST', `/remoteJobs/${jobId}/run`, {\n arguments: runArguments.positional,\n });\n } catch (error: any) {\n const status = httpStatus(error);\n // Every 4xx is the backend refusing before any runner received the job: permissions,\n // validation, or no runner to dispatch to (the backend closes the recorded row in that\n // case). No run was accepted, so keep the previous receipt.\n if (status !== undefined && status >= 400 && status < 500) {\n if (previousReceipt) this.save(previousReceipt);\n else fs.rmSync(path.join(this.stateDir, 'current.json'), { force: true });\n const reason = error.response?.data?.message ?? String(error);\n throw new PipelineError(\n 'refused',\n 'REQUEST_REFUSED',\n `Submission refused by the backend (HTTP ${status}). No new run was accepted. ${redact(String(reason))}`,\n 'Read the reason, fix the setup it names or ask the setup owner, then run again.',\n );\n }\n throw new PipelineError(\n 'unknown',\n 'SUBMISSION_UNCONFIRMED',\n `Submission outcome unconfirmed; the receipt was saved. ${RECOVER_HINT} ${redact(String(error))}`,\n 'Ask the author to run farseer pipeline recover in a terminal: it clears the receipt when history shows no run was accepted, or attaches the exact run with --uuid. Do not resubmit.',\n );\n }\n if (!result?.runUuid || !/^[a-f0-9-]{36}$/i.test(result.runUuid))\n throw new PipelineError(\n 'unknown',\n 'SUBMISSION_UNCONFIRMED',\n 'Backend did not return a run UUID; submission remains unconfirmed',\n 'Ask the author to run farseer pipeline recover in a terminal: it clears the receipt when history shows no run was accepted, or attaches the exact run with --uuid. Do not resubmit.',\n );\n try {\n this.save({ ...receipt, runUuid: result.runUuid, phase: 'accepted' });\n } catch (error) {\n throw new PipelineError(\n 'unknown',\n 'RECEIPT_SAVE_FAILED',\n `Run accepted but its local receipt could not be updated. ${redact(String(error))}`,\n 'Save this runUuid and inspect it. Do not resubmit.',\n result.runUuid,\n );\n }\n return {\n ...receipt,\n ...result,\n phase: 'accepted',\n observation: 'pending',\n arguments: runArguments.given,\n };\n });\n }\n async inspect(uuid = this.receipt()?.runUuid, offset = 0) {\n z.number().int().nonnegative().parse(offset);\n const receipt = this.receipt();\n // Only a receipt is a submission whose outcome can be unconfirmed; with none there is no run.\n if (!uuid && !receipt)\n throw new PipelineError(\n 'refused',\n 'NO_RUN_RECORDED',\n 'No run has been submitted from this profile, so there is no run to inspect.',\n 'Pass a uuid from runs to inspect an earlier run, or run the pipeline.',\n );\n if (!uuid) return { status: 'unconfirmed', receipt };\n const run = await this.findRun(uuid);\n if (!run) return { runUuid: uuid, status: 'unconfirmed', receipt: this.receipt() };\n const logs = run.logs ?? [];\n const page: string[] = [];\n let bytes = 0;\n let next = Math.max(0, offset);\n for (; next < logs.length && page.length < 100; next++) {\n const line = redact(logs[next]).slice(0, 4000);\n if (bytes + Buffer.byteLength(line) > 32_000) break;\n page.push(line);\n bytes += Buffer.byteLength(line);\n }\n // Markers come from the whole log, not the page: what each load did, and what was skipped,\n // must be answered by the first call, wherever in the log the run printed it.\n const observations = parseMarkers(logs.map((line) => redact(line).slice(0, 4000)));\n const skipped = skippedOutputs(observations);\n return {\n tenant: this.profile.tenant,\n workspace: this.profile.workspace,\n jobId: this.profile.jobId,\n runUuid: uuid,\n status: run.status,\n logs: page,\n observations,\n engine: engineReport(observations),\n loads: loadOutcomes(observations),\n skippedOutputs: skipped,\n ...(skipped.length ? { attention: skippedAttention(run.status, skipped) } : {}),\n // Until the run ends more lines can come, so null means the run ended and nothing is left.\n nextOffset: next < logs.length || !terminal(run.status) ? next : null,\n // From what this run reported, not the profile: before init records dataset IDs, a run\n // that writes datasets still reports their versions and never an output_written marker.\n outputSemantics: observations.some((o) => String(o.event).startsWith('dataset_'))\n ? 'version identifiers are reported in dataset observations'\n : observations.some((o) => o.event === 'output_written')\n ? 'current files; writes require an observed output_written marker'\n : 'no output markers observed yet',\n };\n }\n async query(bindings: { name: string; file: string }[], sql: string, signal?: AbortSignal) {\n z.array(z.object({ name: z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/), file: relative }).strict())\n .min(1)\n .max(16)\n .parse(bindings);\n if (new Set(bindings.map((b) => b.name.toLowerCase())).size !== bindings.length)\n throw new Error('SQL binding names must be distinct');\n return this.exclusive(async () => {\n await this.idle(true);\n const inputs: (RemoteFile & { name: string; url: string })[] = [];\n for (const binding of bindings) {\n relative.parse(binding.file);\n if (!binding.file.startsWith('Data/') || !binding.file.endsWith('.parquet'))\n throw new Error('Query inputs must be Parquet files under this workspace\u2019s Data/');\n const file = await this.client.getFileByPath(`${this.profile.workspace}/${binding.file}`);\n if (!file || file.path !== `${this.profile.workspace}/${binding.file}`)\n throw new Error('Workspace output not found');\n // A sandbox reaches only the API, so a turn key reads the file through it instead.\n let url = `farseer-file:${file.reference}`;\n if (!this.client.agentSession) {\n const access = await this.client.pipelineRequest<{ url: string }>(\n 'GET',\n `/farseerFiles/${encodeURIComponent(file.reference)}/downloadUrl`,\n );\n if (!access?.url?.startsWith('https://')) throw new Error('Signed object read access unavailable');\n url = access.url;\n }\n inputs.push({\n ...file,\n metadata: (await this.client.getFileMetadata(file.reference)) ?? undefined,\n name: binding.name,\n url,\n });\n }\n // The API's file route buffers a whole file before its first byte, which the streaming cap\n // cannot stop, so refuse on the recorded sizes first. A missing size falls back to that cap.\n const total = inputs.reduce((sum, input) => sum + (input.metadata?.size ?? 0), 0);\n if (total > DEFAULT_LIMITS.inputBytes) throw new Error('Input download byte limit exceeded');\n const result = await queryFiles(\n { bindings: inputs, sql, limits: DEFAULT_LIMITS },\n signal,\n this.client.agentSession\n ? (binding, _file, downloadSignal) =>\n this.client.downloadFarseerFile(inputs[binding].reference, downloadSignal)\n : undefined,\n );\n return {\n ...result,\n tenant: this.profile.tenant,\n workspace: this.profile.workspace,\n queryTime: new Date().toISOString(),\n semantics: 'current-file read; not a historical run snapshot',\n inputs: inputs.map(({ url: _url, ...file }) => file),\n };\n });\n }\n async inspectImport(importId: number) {\n z.number().int().positive().parse(importId);\n const job = await this.client\n .pipelineRequest<{\n id: number;\n title: string;\n status: string;\n createdAt: string;\n }>('GET', `/importJobs/${importId}`)\n .catch((error) => {\n // A later run's undo_previous deletes the earlier import, so its ID then answers 404.\n if (httpStatus(error) !== 404) throw error;\n throw new PipelineError(\n 'refused',\n 'IMPORT_NOT_FOUND',\n `Import ${importId} does not exist on ${this.profile.tenant}.`,\n \"A later run's undo_previous may have removed it: look for import_undone in that run's inspect, and read the import it committed instead. Do not retry.\",\n );\n });\n return {\n tenant: this.profile.tenant,\n importId: job.id,\n title: redact(job.title).slice(0, 500),\n status: job.status,\n createdAt: job.createdAt,\n commitConfirmed: job.status === 'COMMITED',\n note: 'An uncommitted status does not rule out an in-flight commit. Inspect before retrying; no automatic retry.',\n };\n }\n /**\n * Direct CLI recovery only, after the author resolves submission uncertainty in history. With a\n * uuid, attach that run. Without one, clear a receipt whose submission history shows was never\n * accepted: the backend records an admitted run before dispatching it, so no run of this job since\n * the submission means none was accepted. Any run in that window is listed, never guessed at.\n */\n async recover(uuid?: string) {\n return this.exclusive(async () => {\n const receipt = this.receipt();\n if (!receipt) throw new Error('No submission receipt to recover');\n if (uuid !== undefined) {\n const run = await this.findRun(uuid);\n if (!run) throw new Error('Cannot attach an unobserved run');\n this.save({ ...receipt, runUuid: uuid, phase: 'accepted' });\n return this.inspect(uuid);\n }\n if (receipt.runUuid)\n throw new Error(`The receipt already names run ${receipt.runUuid}; inspect it instead`);\n const since = Date.parse(receipt.submittedAt) - CLOCK_SKEW_MARGIN_MS;\n const candidates = (await this.history()).filter((r) => Date.parse(r.startedAt) >= since);\n if (candidates.length)\n throw new Error(\n `Run history has ${candidates.length} run(s) of this job since the submission at ${receipt.submittedAt}: ` +\n candidates.map((r) => `${r.uuid} (${r.status}, started ${r.startedAt})`).join('; ') +\n '. If one is this submission, attach it with recover --uuid <uuid>. Nothing was cleared.',\n );\n fs.rmSync(path.join(this.stateDir, 'current.json'), { force: true });\n return {\n cleared: true,\n submittedAt: receipt.submittedAt,\n note: 'Run history has no run of this job since the submission, so it was never accepted. The receipt was cleared; run again when ready.',\n };\n });\n }\n /** A local operator resolves a crashed command. Never clears its submission receipt. */\n unlockAbandonedOperation() {\n const name = path.join(this.operationDir, 'operation.lock');\n if (!fs.existsSync(name)) return { unlocked: false };\n const pid = Number(fs.readFileSync(name, 'utf8'));\n if (!Number.isSafeInteger(pid) || pid <= 0) throw new Error('Unrecognized lock; inspect it manually');\n try {\n process.kill(pid, 0);\n } catch (error: any) {\n if (error.code === 'ESRCH') {\n fs.unlinkSync(name);\n return { unlocked: true, receiptRetained: true };\n }\n throw error;\n }\n throw new Error('The workspace command is still running');\n }\n}\nexport function redact(s: string) {\n return s.replace(/https?:\\/\\/[^\\s'\"<>]+/g, '[URL redacted]');\n}\n\n/** Names main.py assigns into its arguments: args[\"NAME\"] = ..., .setdefault(\"NAME\", ...), or a \"NAME\": dict key. */\nfunction setArgumentNames(source: string): Set<string> {\n const names = new Set<string>();\n for (const pattern of [\n /\\[\\s*[\"']([A-Za-z_][A-Za-z0-9_]*)[\"']\\s*\\]\\s*=(?!=)/g,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;AACI,eAAW,SAAS,OAAO,SAAS,OAAO,EAAG,OAAM,IAAI,MAAM,CAAC,CAAC;AACpE,SAAO;AACX;",
6
5
  "names": ["dir", "result"]
7
6
  }
@@ -28,10 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var appSyncService_exports = {};
30
30
  __export(appSyncService_exports, {
31
- AppSyncService: () => AppSyncService
31
+ AppSyncService: () => AppSyncService,
32
+ notificationsFingerprint: () => notificationsFingerprint
32
33
  });
33
34
  module.exports = __toCommonJS(appSyncService_exports);
35
+ var import_crypto = require("crypto");
34
36
  var fs = __toESM(require("fs"));
37
+ var import_layoutCore = require("./codefirst/layoutCore");
35
38
  var path = __toESM(require("path"));
36
39
  var import_apps = require("./apps");
37
40
  var import_helpers = require("../utils/helpers");
@@ -123,10 +126,35 @@ function migrateLegacyArguments(config) {
123
126
  });
124
127
  return config;
125
128
  }
126
- const RUN_SETTING_KEYS = ["schedule", "runnerImage", "compute"];
129
+ const SYNCED_SETTING_KEYS = ["schedule", "runnerImage", "compute", "notifications"];
127
130
  const RETIRED_KEYS = ["runner", "predefinedActions"];
131
+ function storedNotifications(notifications) {
132
+ if (!(0, import_layoutCore.isObject)(notifications) || !(0, import_layoutCore.isObject)(notifications.email)) {
133
+ return JSON.stringify(notifications);
134
+ }
135
+ const { email, ...channels } = notifications;
136
+ const { groups = [], ...keys } = email;
137
+ if (!Array.isArray(groups)) {
138
+ return JSON.stringify(notifications);
139
+ }
140
+ const stored = groups.map((entry) => {
141
+ if (!(0, import_layoutCore.isObject)(entry)) return entry;
142
+ const { send, enabled = true, addresses, ...rest } = entry;
143
+ const trimmed = Array.isArray(addresses) ? addresses.map((address) => typeof address === "string" ? address.trim() : address) : addresses;
144
+ return { ...rest, send, enabled, addresses: trimmed };
145
+ });
146
+ return JSON.stringify({ ...channels, email: { ...keys, groups: stored } });
147
+ }
148
+ function notificationsFingerprint(notifications) {
149
+ return (0, import_crypto.createHash)("sha256").update(storedNotifications(notifications)).digest("hex").slice(0, 16);
150
+ }
151
+ function notificationsEdited(local) {
152
+ if (!("notifications" in local)) return false;
153
+ const pulled = local._remote?.notifications;
154
+ return pulled === void 0 || notificationsFingerprint(local.notifications) !== pulled;
155
+ }
128
156
  function fileNeedsRewrite(local) {
129
- return !RUN_SETTING_KEYS.every((key) => key in local) || RETIRED_KEYS.some((key) => key in local);
157
+ return !SYNCED_SETTING_KEYS.every((key) => key in local) || RETIRED_KEYS.some((key) => key in local) || local._remote !== void 0 && local._remote.notifications === void 0;
130
158
  }
131
159
  class AppSyncService {
132
160
  constructor(tenant, api) {
@@ -228,16 +256,18 @@ class AppSyncService {
228
256
  schedule: remote.schedule || null,
229
257
  runnerImage: remote.runnerImage || null,
230
258
  compute: (0, import_apps.formatCompute)(remote.compute),
259
+ notifications: remote.notifications ?? {},
231
260
  _remote: {
232
261
  id: remote.id,
233
- reference
262
+ reference,
263
+ notifications: notificationsFingerprint(remote.notifications ?? {})
234
264
  }
235
265
  };
236
266
  }
237
267
  /**
238
268
  * Check if local and remote app configs are equivalent
239
269
  */
240
- areAppsEqual(local, remote) {
270
+ areAppsEqual(local, remote, compareNotifications = true) {
241
271
  if (local.name !== remote.name) return false;
242
272
  if ((local.description || "") !== (remote.description || "")) return false;
243
273
  const remoteScriptFiles = remote.scriptFiles ?? [];
@@ -258,6 +288,9 @@ class AppSyncService {
258
288
  if ("runnerImage" in local && (local.runnerImage || null) !== (remote.runnerImage || null)) return false;
259
289
  const declaredCompute = "compute" in local && local.compute ? (0, import_apps.parseComputeChoice)(local.compute) : null;
260
290
  if (declaredCompute && (0, import_apps.formatCompute)(declaredCompute) !== (0, import_apps.formatCompute)(remote.compute)) return false;
291
+ if (compareNotifications && "notifications" in local && storedNotifications(local.notifications) !== storedNotifications(remote.notifications ?? {})) {
292
+ return false;
293
+ }
261
294
  return true;
262
295
  }
263
296
  /**
@@ -372,19 +405,27 @@ class AppSyncService {
372
405
  await this.api.updateApp(created.id.toString(), update, created);
373
406
  local._remote = {
374
407
  id: created.id,
375
- reference: created.id.toString()
408
+ reference: created.id.toString(),
409
+ notifications: "notifications" in local ? notificationsFingerprint(local.notifications) : void 0
376
410
  };
377
411
  this.saveLocalApp(local);
378
412
  result.created.push(local.name);
379
413
  } catch (error) {
380
414
  import_logger.logger.error(`Failed to create app ${local.name}: ${await (0, import_errorFormatter.formatClientError)(error)}`);
381
415
  }
382
- } else if (!this.areAppsEqual(local, remote.app)) {
416
+ } else if (!this.areAppsEqual(local, remote.app, notificationsEdited(local))) {
383
417
  try {
384
418
  const update = this.buildUpdatePayload(local, findScriptId);
385
419
  update.name = local.name;
386
420
  update.description = local.description;
387
421
  await this.api.updateApp(remote.reference, update, remote.app);
422
+ if (update.notifications !== void 0) {
423
+ local._remote = {
424
+ ...local._remote,
425
+ notifications: notificationsFingerprint(update.notifications)
426
+ };
427
+ this.saveLocalApp(local);
428
+ }
388
429
  result.updated.push(local.name);
389
430
  } catch (error) {
390
431
  import_logger.logger.error(`Failed to update app ${local.name}: ${await (0, import_errorFormatter.formatClientError)(error)}`);
@@ -392,6 +433,11 @@ class AppSyncService {
392
433
  } else {
393
434
  result.unchanged.push(local.name);
394
435
  }
436
+ if (remote && "notifications" in local && !notificationsEdited(local) && storedNotifications(local.notifications) !== storedNotifications(remote.app.notifications ?? {})) {
437
+ import_logger.logger.info(
438
+ `Kept the email groups ${local.name} has in the tenant: the file's are as last pulled. Pull to update the file.`
439
+ );
440
+ }
395
441
  }
396
442
  return result;
397
443
  }
@@ -433,6 +479,9 @@ class AppSyncService {
433
479
  );
434
480
  }
435
481
  }
482
+ if (notificationsEdited(local)) {
483
+ update.notifications = local.notifications;
484
+ }
436
485
  return update;
437
486
  }
438
487
  /**
@@ -465,7 +514,7 @@ class AppSyncService {
465
514
  const remote = remoteApps.get(key);
466
515
  if (!remote) {
467
516
  status.newLocal.push(local.name);
468
- } else if (!this.areAppsEqual(local, remote.app)) {
517
+ } else if (!this.areAppsEqual(local, remote.app, notificationsEdited(local))) {
469
518
  status.modified.push(local.name);
470
519
  } else {
471
520
  status.synced.push(local.name);
@@ -481,6 +530,7 @@ class AppSyncService {
481
530
  }
482
531
  // Annotate the CommonJS export names for ESM import in node:
483
532
  0 && (module.exports = {
484
- AppSyncService
533
+ AppSyncService,
534
+ notificationsFingerprint
485
535
  });
486
536
  //# sourceMappingURL=appSyncService.js.map