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
@@ -0,0 +1,23 @@
1
+ # Bronze extract: the ERP's invoice lines for the run's months, stored as the
2
+ # source hands them over; the parse step erp_sales_invoice_lines reads them.
3
+ # Casts happen in the source query: for a SQL source the schema only checks types.
4
+ # Codes are cast to nvarchar so the driver receives Unicode, not the column's
5
+ # legacy code page (see the skill's pipeline-source-encoding.md).
6
+ name: erp_sales_invoice_lines_raw
7
+ type: extract
8
+ extract:
9
+ type: sql_database
10
+ sql_database:
11
+ connection_string: "{{ pipeline_args.ERP_DB_URL }}"
12
+ query: >
13
+ SELECT
14
+ CAST(l.line_id AS nvarchar(64)) AS line_id,
15
+ CAST(h.invoice_date AS datetime2) AS invoice_date,
16
+ CAST(l.item_code AS nvarchar(64)) AS item_code,
17
+ CAST(h.customer_code AS nvarchar(64)) AS customer_code,
18
+ CAST(l.net_amount AS float) AS net_amount,
19
+ CAST(l.quantity AS float) AS quantity
20
+ FROM dbo.sales_invoice_lines l
21
+ JOIN dbo.sales_invoice_headers h ON h.invoice_id = l.invoice_id
22
+ WHERE h.invoice_date >= '{{ pipeline_args.FROM_MONTH }}-01'
23
+ AND h.invoice_date < '{{ pipeline_args.TO_MONTH | add_months(1) | strftime("%Y-%m-%d") }}'
@@ -0,0 +1,17 @@
1
+ # Bronze: which model Product each ERP item code belongs to. Kept as data in
2
+ # Farseer Files, maintained by finance, never as a CASE in the SQL. Read from
3
+ # the extract erp_sales_item_product_map_raw.
4
+ name: erp_sales_item_product_map
5
+ type: parse
6
+ deps: [bronze.erp_sales_item_product_map_raw]
7
+ parse:
8
+ format: csv
9
+ schema:
10
+ columns:
11
+ - name: item_code
12
+ type: str
13
+ not_null: true
14
+ quality_rules:
15
+ # A duplicate key would multiply the lines it joins to.
16
+ - type: custom__unique
17
+ - { name: product, type: str, not_null: true }
@@ -0,0 +1,11 @@
1
+ # Bronze: which model Product each ERP item code belongs to. Kept as data in
2
+ # Farseer Files, maintained by finance, never as a CASE in the SQL. This extract
3
+ # stores the file; the parse step erp_sales_item_product_map reads it.
4
+ name: erp_sales_item_product_map_raw
5
+ type: extract
6
+ extract:
7
+ type: farseer
8
+ farseer:
9
+ source: files
10
+ files:
11
+ file: "Mappings/erp-sales/item_to_product.csv"
@@ -0,0 +1,40 @@
1
+ # Gold: one row per target cell, one dataset per month. The columns are exactly
2
+ # what erp-sales-load maps: Product, Customer, the month as a date, two values.
3
+ expand:
4
+ values_expr: "{{ cartesian_product(m=months_in_range(pipeline_args.FROM_MONTH, pipeline_args.TO_MONTH)) }}"
5
+ template:
6
+ name: "erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"
7
+ type: transform
8
+ deps:
9
+ - silver.erp_sales_lines
10
+ - silver.erp_sales_unmapped_items
11
+ - "silver.erp_sales_recon_{{ each.m | strftime('%Y_%m') }}"
12
+ transform:
13
+ engine: duckdb
14
+ query: |
15
+ SELECT
16
+ product,
17
+ customer,
18
+ month,
19
+ SUM(net_amount)::DOUBLE AS revenue,
20
+ coalesce(SUM(quantity), 0)::DOUBLE AS quantity
21
+ FROM erp_sales_lines
22
+ WHERE month = '{{ each.m | strftime("%Y-%m-%d") }}'
23
+ GROUP BY ALL
24
+ ORDER BY ALL
25
+ schema:
26
+ columns:
27
+ - { name: product, type: str, not_null: true }
28
+ - { name: customer, type: str, not_null: true }
29
+ - name: month
30
+ type: str
31
+ not_null: true
32
+ quality_rules:
33
+ - type: isin
34
+ params: { allowed_values: ["{{ each.m | strftime('%Y-%m-%d') }}"] }
35
+ - { name: revenue, type: float, not_null: true }
36
+ - { name: quantity, type: float, not_null: true }
37
+ quality_rules:
38
+ # The import sums rows that share coordinates.
39
+ - type: custom__unique_composite
40
+ params: { columns: [product, customer, month] }
@@ -0,0 +1,35 @@
1
+ # Silver: conformed lines. Codes normalised, the mapping joined with a LEFT
2
+ # JOIN, and every line the mapping missed flagged instead of dropped.
3
+ name: erp_sales_lines
4
+ type: transform
5
+ deps: [bronze.erp_sales_invoice_lines, bronze.erp_sales_item_product_map]
6
+ transform:
7
+ engine: duckdb
8
+ query: |
9
+ SELECT
10
+ l.line_id,
11
+ strftime(date_trunc('month', l.invoice_date), '%Y-%m-%d') AS month,
12
+ upper(trim(l.item_code)) AS item_code,
13
+ m.product,
14
+ m.product IS NOT NULL AS product_mapped,
15
+ upper(trim(l.customer_code)) AS customer,
16
+ l.net_amount,
17
+ l.quantity
18
+ FROM erp_sales_invoice_lines l
19
+ LEFT JOIN erp_sales_item_product_map m
20
+ ON upper(trim(m.item_code)) = upper(trim(l.item_code))
21
+ ORDER BY l.line_id
22
+ schema:
23
+ columns:
24
+ - name: line_id
25
+ type: str
26
+ not_null: true
27
+ quality_rules:
28
+ - type: custom__unique
29
+ - { name: month, type: str, not_null: true }
30
+ - { name: item_code, type: str, not_null: true }
31
+ - { name: product, type: str }
32
+ - { name: product_mapped, type: bool, not_null: true }
33
+ - { name: customer, type: str, not_null: true }
34
+ - { name: net_amount, type: float, not_null: true }
35
+ - { name: quantity, type: float }
@@ -0,0 +1,43 @@
1
+ # Silver: source against silver, per month, in one row. A rule cannot compare
2
+ # two datasets, so this transform totals both sides and the rules assert them.
3
+ # Gold lists it in deps: a failed total stops gold, and the load with it.
4
+ expand:
5
+ values_expr: "{{ cartesian_product(m=months_in_range(pipeline_args.FROM_MONTH, pipeline_args.TO_MONTH)) }}"
6
+ template:
7
+ name: "erp_sales_recon_{{ each.m | strftime('%Y_%m') }}"
8
+ type: transform
9
+ deps: [bronze.erp_sales_invoice_lines, silver.erp_sales_lines]
10
+ transform:
11
+ engine: duckdb
12
+ query: |
13
+ WITH source AS (
14
+ SELECT COUNT(*)::BIGINT AS lines, coalesce(SUM(net_amount), 0)::DOUBLE AS net_amount
15
+ FROM erp_sales_invoice_lines
16
+ WHERE invoice_date >= DATE '{{ each.m | strftime("%Y-%m-%d") }}'
17
+ AND invoice_date < DATE '{{ each.m | add_months(1) | strftime("%Y-%m-%d") }}'
18
+ ),
19
+ conformed AS (
20
+ SELECT COUNT(*)::BIGINT AS lines, coalesce(SUM(net_amount), 0)::DOUBLE AS net_amount
21
+ FROM erp_sales_lines
22
+ WHERE month = '{{ each.m | strftime("%Y-%m-%d") }}'
23
+ )
24
+ SELECT
25
+ '{{ each.m | strftime("%Y-%m") }}' AS month,
26
+ source.lines AS source_lines,
27
+ conformed.lines AS silver_lines,
28
+ (source.net_amount - conformed.net_amount)::DOUBLE AS net_amount_difference
29
+ FROM source, conformed
30
+ schema:
31
+ columns:
32
+ - { name: month, type: str, not_null: true }
33
+ - { name: source_lines, type: int, not_null: true }
34
+ - { name: silver_lines, type: int, not_null: true }
35
+ - name: net_amount_difference
36
+ type: float
37
+ not_null: true
38
+ quality_rules:
39
+ - type: in_range
40
+ params: { min_value: -0.01, max_value: 0.01 }
41
+ quality_rules:
42
+ - type: custom__compare
43
+ params: { left: silver_lines, right: source_lines, operator: eq }
@@ -0,0 +1,28 @@
1
+ # Silver: item codes the mapping does not know. Gold depends on this dataset,
2
+ # so one unmapped code stops the run before anything reaches the model.
3
+ # Fix it by adding the code to Mappings/erp-sales/item_to_product.csv.
4
+ name: erp_sales_unmapped_items
5
+ type: transform
6
+ deps: [silver.erp_sales_lines]
7
+ transform:
8
+ engine: duckdb
9
+ query: |
10
+ SELECT
11
+ item_code,
12
+ COUNT(*)::BIGINT AS lines,
13
+ SUM(net_amount)::DOUBLE AS net_amount
14
+ FROM erp_sales_lines
15
+ WHERE NOT product_mapped
16
+ GROUP BY item_code
17
+ ORDER BY item_code
18
+ schema:
19
+ columns:
20
+ - name: item_code
21
+ type: str
22
+ not_null: true
23
+ quality_rules:
24
+ # Matches nothing, so every unmapped code fails and is named in the log.
25
+ - type: isin
26
+ params: { allowed_values: [] }
27
+ - { name: lines, type: int, not_null: true }
28
+ - { name: net_amount, type: float, not_null: true }
@@ -0,0 +1,49 @@
1
+ """ERP sales ETL: the only pipeline that reads the ERP database.
2
+
3
+ Bronze lands the invoice lines and the item mapping, silver conforms them,
4
+ gold holds one row per target cell, one dataset per month. Nothing here
5
+ touches the model: `erp-sales-load` imports the gold datasets and can rerun
6
+ without reading the ERP again.
7
+
8
+ Arguments (job arguments arrive as strings in FARSEER_ARGS):
9
+ FROM_MONTH, TO_MONTH YYYY-MM, inclusive. Both empty (a scheduled run)
10
+ means the previous calendar month.
11
+ ERP_DB_URL secret; the SQLAlchemy URL of the ERP database.
12
+ """
13
+
14
+ import json
15
+ import os
16
+ import re
17
+ import sys
18
+ from datetime import date, timedelta
19
+
20
+ from farseer_simple_pipelines.runner import run_pipeline
21
+ from farseer_simple_pipelines.storage import StoreType
22
+ from farseer_simple_pipelines.authoring import PipelinePolicy
23
+
24
+ MONTH = re.compile(r"(\d{4})-(\d{1,2})")
25
+
26
+
27
+ def canonical_month(name: str, value: str) -> str:
28
+ match = MONTH.fullmatch(value)
29
+ if not match or not 1 <= int(match[2]) <= 12:
30
+ sys.exit(f"{name} must look like 2026-03, got {value!r}")
31
+ return f"{match[1]}-{int(match[2]):02d}"
32
+
33
+
34
+ args = json.loads(os.environ.get("FARSEER_ARGS") or "{}")
35
+ from_month = (args.get("FROM_MONTH") or "").strip()
36
+ to_month = (args.get("TO_MONTH") or "").strip()
37
+ if not from_month and not to_month:
38
+ previous = date.today().replace(day=1) - timedelta(days=1)
39
+ from_month = to_month = f"{previous.year}-{previous.month:02d}"
40
+ # One spelling everywhere: dataset names and labels are built from these.
41
+ args["FROM_MONTH"] = canonical_month("FROM_MONTH", from_month or to_month)
42
+ args["TO_MONTH"] = canonical_month("TO_MONTH", to_month or from_month)
43
+ if args["TO_MONTH"] < args["FROM_MONTH"]:
44
+ sys.exit(f"TO_MONTH {args['TO_MONTH']} is before FROM_MONTH {args['FROM_MONTH']}")
45
+ if not (args.get("ERP_DB_URL") or "").strip():
46
+ sys.exit("ERP_DB_URL is not set: add it to the job as a secret argument")
47
+ os.environ["FARSEER_ARGS"] = json.dumps(args)
48
+
49
+ run_pipeline(store_type=StoreType.DATASETS, pipeline_policy=PipelinePolicy(), experimental__emit_pipeline_visualization_markers=True)
@@ -0,0 +1,17 @@
1
+ # In: the ETL pipeline's published gold, one dataset per month, read from the
2
+ # extract erp_sales_cells_raw as parquet.
3
+ expand:
4
+ values_expr: "{{ cartesian_product(m=months_in_range(pipeline_args.FROM_MONTH, pipeline_args.TO_MONTH)) }}"
5
+ template:
6
+ name: "erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"
7
+ type: parse
8
+ deps: ["in.erp_sales_cells_{{ each.m | strftime('%Y_%m') }}_raw"]
9
+ parse:
10
+ format: parquet
11
+ schema:
12
+ columns:
13
+ - { name: product, type: str, not_null: true }
14
+ - { name: customer, type: str, not_null: true }
15
+ - { name: month, type: str, not_null: true }
16
+ - { name: revenue, type: float, not_null: true }
17
+ - { name: quantity, type: float, not_null: true }
@@ -0,0 +1,14 @@
1
+ # In: the ETL pipeline's published gold, one dataset per month, stored unread;
2
+ # the parse step erp_sales_cells reads it. A month that was never published
3
+ # reads as missing and fails the run.
4
+ expand:
5
+ values_expr: "{{ cartesian_product(m=months_in_range(pipeline_args.FROM_MONTH, pipeline_args.TO_MONTH)) }}"
6
+ template:
7
+ name: "erp_sales_cells_{{ each.m | strftime('%Y_%m') }}_raw"
8
+ type: extract
9
+ extract:
10
+ type: farseer
11
+ farseer:
12
+ source: datasets
13
+ datasets:
14
+ qualified_name: "gold.erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"
@@ -0,0 +1,47 @@
1
+ # Load: maps gold columns onto the model and nothing else. One cells entry per
2
+ # variable, each with its own labels: two entries sharing labels would undo
3
+ # each other. The month is in the labels, so undo_previous replaces only the
4
+ # month this run loaded. Members are never created here: a code the model
5
+ # lacks fails the import (missing_member_policy DISALLOW, the default).
6
+ expand:
7
+ values_expr: "{{ cartesian_product(m=months_in_range(pipeline_args.FROM_MONTH, pipeline_args.TO_MONTH)) }}"
8
+ template:
9
+ name: "erp_sales_to_model_{{ each.m | strftime('%Y_%m') }}"
10
+ type: load
11
+ deps: ["in.erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"]
12
+ load:
13
+ target: farseer
14
+ farseer:
15
+ cells:
16
+ - source_dataset: "in.erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"
17
+ import_job_title: "erp-sales {{ each.m | strftime('%Y-%m') }} revenue"
18
+ mapping:
19
+ dimension_tables:
20
+ - { source_column: product, target_dimension_table: Product }
21
+ - { source_column: customer, target_dimension_table: Customer }
22
+ variables:
23
+ - source_column: revenue
24
+ target_variable: IMPORT_Revenue
25
+ fixed_dimension_members:
26
+ - { dimension_table: Versions, dimension_member: Actual }
27
+ date: { source_column: month, format: YYYY_MM_DD }
28
+ options:
29
+ overwrite_cells: true
30
+ labels: [erp-sales, actual, "{{ each.m | strftime('%Y-%m') }}", revenue]
31
+ undo_previous: true
32
+ - source_dataset: "in.erp_sales_cells_{{ each.m | strftime('%Y_%m') }}"
33
+ import_job_title: "erp-sales {{ each.m | strftime('%Y-%m') }} quantity"
34
+ mapping:
35
+ dimension_tables:
36
+ - { source_column: product, target_dimension_table: Product }
37
+ - { source_column: customer, target_dimension_table: Customer }
38
+ variables:
39
+ - source_column: quantity
40
+ target_variable: IMPORT_Quantity
41
+ fixed_dimension_members:
42
+ - { dimension_table: Versions, dimension_member: Actual }
43
+ date: { source_column: month, format: YYYY_MM_DD }
44
+ options:
45
+ overwrite_cells: true
46
+ labels: [erp-sales, actual, "{{ each.m | strftime('%Y-%m') }}", quantity]
47
+ undo_previous: true
@@ -0,0 +1,44 @@
1
+ """ERP sales load: imports erp-sales-etl's gold datasets into the model.
2
+
3
+ Never reads the ERP. Reads the last published gold dataset of each month and
4
+ imports it with per-month labels, so a rerun replaces that month's cells.
5
+
6
+ Arguments (job arguments arrive as strings in FARSEER_ARGS):
7
+ FROM_MONTH, TO_MONTH YYYY-MM, inclusive. Both empty (a scheduled run)
8
+ means the previous calendar month.
9
+ """
10
+
11
+ import json
12
+ import os
13
+ import re
14
+ import sys
15
+ from datetime import date, timedelta
16
+
17
+ from farseer_simple_pipelines.runner import run_pipeline
18
+ from farseer_simple_pipelines.storage import StoreType
19
+ from farseer_simple_pipelines.authoring import PipelinePolicy
20
+
21
+ MONTH = re.compile(r"(\d{4})-(\d{1,2})")
22
+
23
+
24
+ def canonical_month(name: str, value: str) -> str:
25
+ match = MONTH.fullmatch(value)
26
+ if not match or not 1 <= int(match[2]) <= 12:
27
+ sys.exit(f"{name} must look like 2026-03, got {value!r}")
28
+ return f"{match[1]}-{int(match[2]):02d}"
29
+
30
+
31
+ args = json.loads(os.environ.get("FARSEER_ARGS") or "{}")
32
+ from_month = (args.get("FROM_MONTH") or "").strip()
33
+ to_month = (args.get("TO_MONTH") or "").strip()
34
+ if not from_month and not to_month:
35
+ previous = date.today().replace(day=1) - timedelta(days=1)
36
+ from_month = to_month = f"{previous.year}-{previous.month:02d}"
37
+ # One spelling everywhere: dataset names and labels are built from these.
38
+ args["FROM_MONTH"] = canonical_month("FROM_MONTH", from_month or to_month)
39
+ args["TO_MONTH"] = canonical_month("TO_MONTH", to_month or from_month)
40
+ if args["TO_MONTH"] < args["FROM_MONTH"]:
41
+ sys.exit(f"TO_MONTH {args['TO_MONTH']} is before FROM_MONTH {args['FROM_MONTH']}")
42
+ os.environ["FARSEER_ARGS"] = json.dumps(args)
43
+
44
+ run_pipeline(store_type=StoreType.DATASETS, pipeline_policy=PipelinePolicy(), experimental__emit_pipeline_visualization_markers=True)
@@ -0,0 +1,5 @@
1
+ item_code,product
2
+ A-1001,Widgets
3
+ A-1002,Widgets
4
+ B-2001,Gadgets
5
+ C-3001,Services
@@ -0,0 +1,103 @@
1
+ # Pipeline-app failure reports — a readable page instead of a traceback
2
+
3
+ Every pipeline app fails the same way: a tester opens the run,
4
+ sees sixty lines of Python traceback, and has nothing actionable. The fix is
5
+ small, dependency-free, and copies between projects almost unchanged.
6
+
7
+ **The shape:** an `error_report` module next to `main.py`. `main.py` wraps its
8
+ entry point; on any failure it calls `publish(exc, preflight_message)` and then
9
+ **re-raises**. The report is a branded PDF uploaded to a dedicated Files
10
+ folder, in four sections — *What happened · What to do · Run details ·
11
+ Technical detail*.
12
+
13
+ ---
14
+
15
+ ## Two constraints that shape everything else
16
+
17
+ **The report must not change the job's outcome.** A failed job still ends
18
+ `ERROR` with its original traceback in the log; a successful job writes
19
+ nothing. Swallowing the exception to "finish cleanly" destroys the only signal
20
+ the platform has.
21
+
22
+ **On an app FAMILY, scope by job, not by folder.** Several manifests commonly
23
+ share one source folder, so the folder cannot tell you which app is running.
24
+ Gate `publish()` on a `JOB_NAME` allow-list — the plumbing apps sharing that
25
+ folder should not be filing operator-facing reports.
26
+
27
+ ---
28
+
29
+ ## The five things that are not obvious
30
+
31
+ ### 1. `except BaseException`, not `except Exception`
32
+
33
+ A pre-flight argument check that calls `sys.exit(1)` raises `SystemExit`,
34
+ which is a `BaseException`. An `except Exception` wrapper misses exactly the
35
+ failure class that is most common and most explainable — bad arguments.
36
+
37
+ ### 2. The reporting path must never be able to break the app
38
+
39
+ `publish()` wraps its whole body in `except BaseException` and degrades to a
40
+ single printed line. **Test this rather than assuming it:** break the report
41
+ module at import time on purpose and confirm the job still ends `ERROR` with
42
+ its *original* message plus one `Error report unavailable (…)` line.
43
+
44
+ ### 3. There is no PDF library in the runner image
45
+
46
+ No `reportlab`, `fpdf`, `weasyprint`, `PIL`. Write PDF 1.4 bytes directly over
47
+ the base-14 fonts (objects + xref, Helvetica / Helvetica-Bold / Courier,
48
+ `/WinAnsi` encoding). It is less work than it sounds and it removes a
49
+ dependency the image will not give you.
50
+
51
+ ### 4. 🔐 `FARSEER_ARGS` is UNMASKED inside the app process
52
+
53
+ The runner masks secrets in **its own** log. The app's copy of `FARSEER_ARGS`
54
+ is clean plaintext — client secrets, tenant ids, company GUIDs. Two defences,
55
+ both needed:
56
+
57
+ 1. **Echo only an explicit ALLOW-list** of argument names into the PDF. Never
58
+ a deny-list: the next argument added to the manifest would leak by default.
59
+ 2. **Scrub the exception text and traceback** — every non-echoed `FARSEER_ARGS`
60
+ value of 8+ characters by literal match, **plus** a regex pass over
61
+ `secret|client_id|client_secret|guid|token|key|password|assertion` query
62
+ parameters, which catches credentials minted at runtime that never appear
63
+ in `FARSEER_ARGS` at all.
64
+
65
+ Then **read a real generated PDF end to end, by eye, before the first push.**
66
+ A byte scan is not sufficient — one first render passed as bytes and was
67
+ unreadable as a page.
68
+
69
+ ### 5. `FarseerClient()` needs no arguments inside a runner
70
+
71
+ The API-key variable and `FARSEER_URL` are already in the runner environment. The
72
+ obvious-looking fallback — a secret argument on every manifest — is
73
+ unnecessary, and on a twelve-manifest family it is twelve manifest edits and
74
+ twelve places to paste a credential. Check the environment first.
75
+
76
+ ---
77
+
78
+ ## File naming: derive from `JOB_NAME`, overwrite in place
79
+
80
+ `f"{JOB_NAME} — error report.pdf"` gives one file per app: bounded, findable.
81
+ Each failure **overwrites** rather than accumulating dated copies, so a tester
82
+ looking for "my job's error" finds one file and not forty.
83
+
84
+ > **Design for the consequence rather than discovering it: a report survives a
85
+ > later SUCCESSFUL run of the same app.** Put the run-start timestamp and the
86
+ > job-run id in the PDF body so a reader can tell whether it is current, and
87
+ > say so in the handover — **a stale report is not evidence of a current
88
+ > failure.**
89
+
90
+ ## The error catalogue
91
+
92
+ An ordered list of `(compiled regex, explanation, action)` matched against the
93
+ exception text, so the common failures get a sentence a tester can act on
94
+ instead of a stack trace. Everything unmatched falls through to a generic
95
+ "what to do" plus the technical detail section — the catalogue improves over
96
+ time and must never be the thing that decides whether a report is produced.
97
+
98
+ ---
99
+
100
+ ## Cross-references
101
+
102
+ - [`deploying-a-farseer-app.md`](../farseer-author-import-job/deploying-a-farseer-app.md) — manifests,
103
+ arguments, and the Files service.
@@ -0,0 +1,68 @@
1
+ # Pipeline source encoding — legacy code pages in SQL sources
2
+
3
+ A Simple Pipelines extract from an older SQL Server database can hand the
4
+ pipeline codes whose national letters are wrong: `Š0024` arrives as
5
+ `\x8a0024`, `Č` as `È`. Nothing fails. The bad codes flow through silver and
6
+ gold, and the load either refuses them as unknown members or, with
7
+ `create_missing_members: true`, **creates a second, misspelled member for
8
+ every affected code**, permanently. One real project found dozens of duplicate
9
+ customers from a single month before anyone noticed.
10
+
11
+ ## Cause
12
+
13
+ The column is `varchar` in a database collation with a Windows code page
14
+ (Windows-1250 for Central European letters, Windows-1251 for Cyrillic). The
15
+ runner's SQL driver decodes those bytes as Latin-1, so every byte above `0x7F`
16
+ becomes a different character. ASCII is untouched, which is why most codes
17
+ look right and spot checks pass.
18
+
19
+ | Letter | Š | Ž | Č | Ć | Đ | š | ž | č | ć | đ |
20
+ |---|---|---|---|---|---|---|---|---|---|---|
21
+ | Arrives as `chr(n)` | 138 | 142 | 200 | 198 | 208 | 154 | 158 | 232 | 230 | 240 |
22
+
23
+ ## Detect it in bronze
24
+
25
+ Before writing silver, `query` the bronze dataset its parse step published for a code you
26
+ know contains a national letter, and for its mangled form:
27
+
28
+ ```sql
29
+ SELECT customer_code, COUNT(*) FROM erp_sales_invoice_lines
30
+ WHERE customer_code LIKE '%Š%' OR customer_code LIKE '%' || chr(138) || '%'
31
+ GROUP BY ALL
32
+ ```
33
+
34
+ Only the first form may come back. Repeat the check when the source, driver or
35
+ runner image changes.
36
+
37
+ ## Fix it
38
+
39
+ **At the source, preferred.** Cast text columns to `nvarchar` in the extract
40
+ query. The server converts with the column's own collation and the driver
41
+ receives Unicode:
42
+
43
+ ```sql
44
+ SELECT CAST(l.item_code AS nvarchar(64)) AS item_code, …
45
+ ```
46
+
47
+ This is the form used in [`erp-sales`](erp-sales/).
48
+ It has not yet been confirmed on a live legacy database; run the detection
49
+ query after adopting it.
50
+
51
+ **In silver, proven on a project.** When the query cannot change, map the
52
+ mangled characters back before any grouping or join (DuckDB):
53
+
54
+ ```sql
55
+ trim(translate(customer_code,
56
+ chr(138) || chr(142) || chr(200) || chr(198) || chr(208) ||
57
+ chr(154) || chr(158) || chr(232) || chr(230) || chr(240),
58
+ 'ŠŽČĆĐšžčćđ')) AS customer
59
+ ```
60
+
61
+ The table above is Windows-1250 only. For another code page, derive the
62
+ characters with `letter.encode("<code page>").decode("latin-1")`.
63
+
64
+ Either way, keep `create_missing_members: false` on the load until the
65
+ detection query is clean: a refused import costs one rerun, a misspelled
66
+ member stays in the model.
67
+
68
+ Related: [`SKILL.md`](SKILL.md) (bronze rules).
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: farseer-dashboards
3
+ description: How to build or change a Farseer dashboard through the API, with its folder, table and chart tiles, the sheet lines that give a tile its rows and columns, slicers and dashboard filters, and how to check a tile's values. Use when creating or changing a dashboard, a tile or a sheet.
4
+ metadata:
5
+ version: "1"
6
+ ---
7
+
8
+ # Dashboards
9
+
10
+ `farseer dashboards` only lists and inspects; build a dashboard with the API. Paths below are under `/api/v3`. A request missing a required field is refused with a bare `BadRequest`, so send these shapes whole. Variable gids come from `farseer variables list --json` (`gid`), and member gids from `farseer dimensions members TABLE --json`. The CLI doesn't print table gids yet; `POST /entities/type` with `["DTAB"]` lists each table's `id` with its `meta.name`.
11
+
12
+ 1. **Folder.** Only a dashboard needs a folder: variables, tables and other objects go in one only when the user names it. Use the folder the user names; otherwise the top dashboards folder. `POST /folders/search` with `{"name": "Dashboards", "types": ["FOLDER"], "limit": 20}` lists folders, and a dashboard can go in one whose `allowedTypes` includes `"DASHBOARD"`.
13
+ 2. **Dashboard.** `POST /dashboards` with `{"folderId": FOLDER_ID, "name": "..."}`. A filter that every tile follows goes in its `rows.filters` (`displayColumns` is required; `[2]` shows member names), as in `{"rows": {"onlyWithData": false, "owdIncludeMeasures": false, "emitNoResultRows": true, "filters": [{"tableId": TABLE_GID, "dimensionIds": [], "displayColumns": [2], "selectAll": true, "selectBlanks": false, "multiselect": true, "autoApply": true, "blanks": false}]}}`.
14
+ 3. **A table or chart tile.** `POST /dashboards/{dashboardId}/tiles` creates the tile and its own sheet, whose id is in the response's `data.sheet.id`:
15
+
16
+ ```json
17
+ {"name": "Net sales by category", "subtitle": "", "footnotes": "", "style": {},
18
+ "gridPlacements": {"large": {"h": 8, "w": 8, "x": 0, "y": 0}},
19
+ "data": {"type": "SHEET_BACKED", "useDashboardSort": false, "useDashboardFilters": true, "useDashboardTimeline": false,
20
+ "showTileSort": false, "showTileFilters": false, "showTileTimeline": false, "exportConfigurationId": null,
21
+ "visualization": {"type": "TABLE"}}}
22
+ ```
23
+
24
+ For a chart, use this `visualization` instead: `{"type": "CHART", "chart": {"type": "LINE_CHART", "layout": "VERTICAL", "labels": {"labelOutline": false}, "spacing": {"barSpacing": 0, "integratedLegendX": 100, "integratedLegendY": 20}, "display": {"showValueAxis": true, "showLegend": true, "showIntegratedLegend": false, "integratedLegendPosition": "START"}, "series": {"transposeData": true}, "rowVisualizationByPath": {}, "columnVisualizationByPath": {}}}`.
25
+ 4. **The tile's rows and columns** are sheet lines, one `POST /sheetLines` each. A row line lists a table's members: `{"sheetId": SHEET_ID, "parentId": null, "axis": "ROW", "type": "NUMBER", "name": "Product categories", "dimensionGenerationOptions": {"tableGids": [TABLE_GID], "hierarchyFlatten": false, "hierarchyMaxDepth": 0}}`. A column line is one variable at the members that filter it, such as a quarter, a version and a year: `{"sheetId": SHEET_ID, "parentId": null, "axis": "COLUMN", "type": "NUMBER", "name": "Net sales Q1 2025 Actual", "variableGid": VARIABLE_GID, "memberGids": [Q1_GID, ACTUAL_GID, Y2025_GID], "dimensionGenerationOptions": {"tableGids": [], "hierarchyFlatten": false, "hierarchyMaxDepth": 0}}`.
26
+ 5. **A slicer** is a tile with `"data": {"type": "DIMENSION_SLICER", "dimensionTableId": TABLE_GID, "multiselect": true, "displayType": "NAME"}`, beside the dashboard's `rows.filters` entry for the same table.
27
+ Steps 3 to 5 can go out from one script, which stops at the first refused write. `post` stands for the way your environment sends an API write:
28
+
29
+ ```python
30
+ tile = post("/api/v3/dashboards/DASHBOARD_ID/tiles", TABLE_TILE)
31
+ sheet = tile["data"]["sheet"]["id"]
32
+ for line in [ROW_LINE, *COLUMN_LINES]:
33
+ post("/api/v3/sheetLines", {**line, "sheetId": sheet})
34
+ ```
35
+
36
+ 6. **Check the values.** `POST /sheets/getData` with `{"path": "SHEET_ID", "includeData": true}` returns the tile's rows and columns with their numbers; `farseer sheets data` does not read a tile's sheet. Compare a cell or two with the same figures from `evaluate`. Also check that every row and column you sent came back with its variable, table or members: `POST /sheetLines` drops a gid it does not know and still answers 201, so a line made from a stale gid comes back empty.
37
+
38
+ ## Sheets
39
+
40
+ `farseer sheets list`, `show` and `data` read a sheet, and `farseer sheets set-data` writes one from a JSON file. Without `-y`, `set-data` only prints a preview and exits successfully, changing nothing: pass `-y` when you intend the write.