farseer-cli 1.19.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.
- package/README.md +31 -8
- package/dist/commands/app.js +42 -3
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/cells.js +120 -85
- package/dist/commands/cells.js.map +1 -1
- package/dist/commands/dashboards.js +246 -12
- package/dist/commands/dashboards.js.map +1 -1
- package/dist/commands/dimensions.js +52 -27
- package/dist/commands/dimensions.js.map +1 -1
- package/dist/commands/docs.js +82 -0
- package/dist/commands/docs.js.map +6 -0
- package/dist/commands/files.js +49 -0
- package/dist/commands/files.js.map +2 -2
- package/dist/commands/folders.js +76 -0
- package/dist/commands/folders.js.map +6 -0
- package/dist/commands/formula.js +38 -30
- package/dist/commands/formula.js.map +1 -1
- package/dist/commands/install.js +32 -30
- package/dist/commands/install.js.map +2 -2
- package/dist/commands/model.js +30 -5
- package/dist/commands/model.js.map +2 -2
- package/dist/commands/push.js +5 -3
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/sheets.js +289 -52
- package/dist/commands/sheets.js.map +1 -1
- package/dist/commands/skills.js +157 -0
- package/dist/commands/skills.js.map +6 -0
- package/dist/commands/variables.js +246 -82
- package/dist/commands/variables.js.map +1 -1
- package/dist/index.js +93 -13
- package/dist/index.js.map +1 -1
- package/dist/mcp/resources/documentation.js +19 -12
- package/dist/mcp/resources/documentation.js.map +1 -1
- package/dist/mcp/tools/appTools.js +1 -7
- package/dist/mcp/tools/appTools.js.map +1 -1
- package/dist/mcp/tools/cellTools.js +6 -19
- package/dist/mcp/tools/cellTools.js.map +1 -1
- package/dist/mcp/tools/dashboardTools.js +30 -412
- package/dist/mcp/tools/dashboardTools.js.map +2 -2
- package/dist/mcp/tools/dataTools.js +15 -146
- package/dist/mcp/tools/dataTools.js.map +1 -1
- package/dist/mcp/tools/folderTools.js +12 -78
- package/dist/mcp/tools/folderTools.js.map +1 -1
- package/dist/mcp/tools/modelTools.js +23 -372
- package/dist/mcp/tools/modelTools.js.map +1 -1
- package/dist/mcp/tools/pipelineContract.js +5 -1
- package/dist/mcp/tools/pipelineContract.js.map +1 -1
- package/dist/mcp/tools/runTools.js +8 -69
- package/dist/mcp/tools/runTools.js.map +1 -1
- package/dist/mcp/tools/sheetTools.js +14 -264
- package/dist/mcp/tools/sheetTools.js.map +1 -1
- package/dist/mcp/tools/syncTools.js +5 -1
- package/dist/mcp/tools/syncTools.js.map +1 -1
- package/dist/mcp/utils/operationResponse.js +41 -0
- package/dist/mcp/utils/operationResponse.js.map +6 -0
- package/dist/operations/cells.js +444 -0
- package/dist/operations/cells.js.map +6 -0
- package/dist/operations/dashboards.js +357 -0
- package/dist/operations/dashboards.js.map +6 -0
- package/dist/operations/data.js +206 -0
- package/dist/operations/data.js.map +6 -0
- package/dist/operations/errors.js +64 -0
- package/dist/operations/errors.js.map +6 -0
- package/dist/operations/exportModel.js +59 -0
- package/dist/operations/exportModel.js.map +6 -0
- package/dist/operations/folderPath.js +128 -0
- package/dist/operations/folderPath.js.map +6 -0
- package/dist/operations/folders.js +80 -0
- package/dist/operations/folders.js.map +6 -0
- package/dist/operations/install.js +109 -0
- package/dist/operations/install.js.map +6 -0
- package/dist/operations/model.js +271 -0
- package/dist/operations/model.js.map +6 -0
- package/dist/operations/sheets.js +428 -0
- package/dist/operations/sheets.js.map +6 -0
- package/dist/pipeline/failStep.js +43 -0
- package/dist/pipeline/failStep.js.map +6 -0
- package/dist/pipeline/generated-reference.json +10 -10
- package/dist/pipeline/queryWorker.js +3 -1
- package/dist/pipeline/queryWorker.js.map +1 -1
- package/dist/pipeline/requests.js +3 -32
- package/dist/pipeline/requests.js.map +1 -1
- package/dist/pipeline/service.js +46 -2
- package/dist/pipeline/service.js.map +1 -1
- package/dist/services/appSyncService.js +59 -9
- package/dist/services/appSyncService.js.map +1 -1
- package/dist/services/apps.js +10 -0
- package/dist/services/apps.js.map +1 -1
- package/dist/services/farseerService.js +28 -6
- package/dist/services/farseerService.js.map +1 -1
- package/dist/skills/bundled.js +106 -0
- package/dist/skills/bundled.js.map +6 -0
- package/dist/skills/install.js +257 -0
- package/dist/skills/install.js.map +6 -0
- package/dist/skills/pipeline.js +10 -18
- package/dist/skills/pipeline.js.map +1 -1
- package/dist/utils/agentSandbox.js +1 -1
- package/dist/utils/entityResolver.js +72 -25
- package/dist/utils/entityResolver.js.map +1 -1
- package/dist/utils/errorFormatter.js +13 -0
- package/dist/utils/errorFormatter.js.map +1 -1
- package/dist/utils/formulaFilters.js +11 -2
- package/dist/utils/formulaFilters.js.map +1 -1
- package/dist/utils/operationCli.js +102 -0
- package/dist/utils/operationCli.js.map +6 -0
- package/docs/cli-guide.md +181 -1
- package/docs/pipeline-reference.md +13 -7
- package/docs/troubleshooting.md +18 -0
- package/package.json +1 -1
- package/skills/farseer-app-dev/SKILL.md +131 -0
- package/skills/farseer-app-dev/assignments.md +185 -0
- package/skills/farseer-app-dev/farseer-client-api-guide.md +907 -0
- package/skills/farseer-app-dev/farseer-client-release-notes.md +212 -0
- package/skills/farseer-app-dev/working-patterns.md +876 -0
- package/skills/farseer-authenticate-to-tenant/SKILL.md +60 -0
- package/skills/farseer-authenticate-to-tenant/app-authentication.md +91 -0
- package/skills/farseer-author-import-job/SKILL.md +114 -0
- package/skills/farseer-author-import-job/cell-writes.md +530 -0
- package/skills/farseer-author-import-job/deploying-a-farseer-app.md +383 -0
- package/skills/farseer-author-import-job/import-job-pattern.md +232 -0
- package/skills/farseer-build-model/SKILL.md +122 -0
- package/skills/farseer-build-model/formula-grain-alignment.md +612 -0
- package/skills/farseer-build-model/naming-conventions.md +435 -0
- package/skills/farseer-build-model/sparse-formulas-pattern.md +330 -0
- package/skills/farseer-build-pipeline/SKILL.md +190 -0
- package/skills/farseer-build-pipeline/erp-sales/README.md +108 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_invoice_lines_raw.yaml +23 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/bronze/erp_sales_item_product_map_raw.yaml +11 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml +40 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml +35 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml +43 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_unmapped_items.yaml +28 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/main.py +49 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells.yaml +17 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml +14 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml +47 -0
- package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/main.py +44 -0
- package/skills/farseer-build-pipeline/erp-sales/item_to_product.csv +5 -0
- package/skills/farseer-build-pipeline/pipeline-app-failure-report-pattern.md +103 -0
- package/skills/farseer-build-pipeline/pipeline-source-encoding.md +68 -0
- package/skills/farseer-dashboards/SKILL.md +1 -1
- package/skills/farseer-help-center/SKILL.md +66 -0
- package/skills/farseer-modify-model/SKILL.md +158 -0
- package/skills/farseer-modify-model/model-validation-pattern.md +251 -0
- package/skills/farseer-optimize-model/SKILL.md +314 -0
- package/skills/farseer-optimize-model/stats-dump.ts +139 -0
- package/skills/farseer-pnl/SKILL.md +220 -0
- package/skills/farseer-review-model/SKILL.md +172 -0
- package/skills/farseer-run-apps/SKILL.md +102 -0
- package/skills/pipeline-authoring/SKILL.md +4 -4
- package/skills/pipeline-authoring/practices.md +15 -3
- package/dist/services/agentApprovalFetch.js +0 -90
- package/dist/services/agentApprovalFetch.js.map +0 -6
|
@@ -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"
|
package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/gold/erp_sales_cells.yaml
ADDED
|
@@ -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] }
|
package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_lines.yaml
ADDED
|
@@ -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 }
|
package/skills/farseer-build-pipeline/erp-sales/erp-sales-etl/Models/silver/erp_sales_recon.yaml
ADDED
|
@@ -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 }
|
package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/in/erp_sales_cells_raw.yaml
ADDED
|
@@ -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') }}"
|
package/skills/farseer-build-pipeline/erp-sales/erp-sales-load/Models/load/erp_sales_to_model.yaml
ADDED
|
@@ -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,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).
|
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Dashboards
|
|
9
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.
|
|
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
11
|
|
|
12
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
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}]}}`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: farseer-help-center
|
|
3
|
+
description: Answer how-to questions about Farseer as a product from its help center at support.farseer.io. Topics include interface navigation, concepts such as variables, dimensions, sheets, dashboards and IBCS, setup, imports, permissions, sharing, audit logs and API access. Covers when to search, phrasing a query in product terms, which collection to look in, reading the full article and citing it. Use for "how do I…" questions about Farseer itself, not about the user's own data or formulas.
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Farseer help center
|
|
9
|
+
|
|
10
|
+
Farseer's help center (`support.farseer.io`) explains how to use Farseer as a product. How you reach it depends on your environment: a tool that searches it and one that reads an article, or, where your environment allows web access, a fetch limited to `support.farseer.io`. If you have neither, say you cannot check the help center and point the user to `support.farseer.io`.
|
|
11
|
+
|
|
12
|
+
## When to search
|
|
13
|
+
|
|
14
|
+
Search the help center when the user asks how to **use Farseer as a product**: interface navigation, concepts, setup steps, admin tasks, integrations. Examples that should start a search:
|
|
15
|
+
|
|
16
|
+
- "how do I create a dimension?"
|
|
17
|
+
- "what's the difference between a variable and a sheet?"
|
|
18
|
+
- "how do permissions work?"
|
|
19
|
+
- "how do I import a CSV?"
|
|
20
|
+
- "what is IBCS?"
|
|
21
|
+
|
|
22
|
+
Do **not** search for:
|
|
23
|
+
|
|
24
|
+
- Questions about the user's own data, model contents or formula results: answer those from the model.
|
|
25
|
+
- General finance, accounting or math questions that are not about Farseer.
|
|
26
|
+
- Small talk.
|
|
27
|
+
|
|
28
|
+
## How to phrase the query
|
|
29
|
+
|
|
30
|
+
The help center is organized into collections. Use their topics to phrase queries in the help center's own vocabulary:
|
|
31
|
+
|
|
32
|
+
| Collection | Topics |
|
|
33
|
+
|------------|--------|
|
|
34
|
+
| Getting Started | Farseer Basics, Navigating Interface, Signing In, Profile, Global Search, Farseer AI |
|
|
35
|
+
| Core Concepts | Formula Functions, Dimensions, Variables, Versions, Input Setup, Value Formatting |
|
|
36
|
+
| Advanced Modeling | Database Topology, Dimensional Model, Calculation Model, Performance, Glossary |
|
|
37
|
+
| Sheets & Data Entry | Sheet Basics, Data Entry, Rows, Columns, Comments, Filtering & Sorting, Sheet Toolbar, Cells |
|
|
38
|
+
| Dashboards & Visualization | Dashboards, Preparing Data, Table Tiles, Dashboard Tables, Export to Image, IBCS |
|
|
39
|
+
| Import & Apps | Import Module, Apps, Files & File Preview |
|
|
40
|
+
| Admin & Settings | Users & Permissions, Locks, Sharing, Backup & Restore, Audit Logs, Model Import & Export, Maintenance Mode |
|
|
41
|
+
| API & Integrations | API Access, API File Upload |
|
|
42
|
+
|
|
43
|
+
Keep queries short (2–5 words) and use Farseer's own vocabulary from the table above. If the first query returns no hits or only weak ones, try one rephrasing with a synonym from a related collection. Do not loop.
|
|
44
|
+
|
|
45
|
+
## How to answer
|
|
46
|
+
|
|
47
|
+
A search hit carries a title, a link and a short snippet. A snippet is a one-line summary, **not** instructions: never answer a "how do I…" question from a snippet alone, or you will give vague, made-up-sounding steps.
|
|
48
|
+
|
|
49
|
+
Two steps:
|
|
50
|
+
|
|
51
|
+
1. **Search.** Look at the hits and decide which single article best matches what the user actually asked about.
|
|
52
|
+
2. **Read the best hit** in full, and base your answer on its body. For a "how do I…" question you almost always need this step: the steps live in the body, not the snippet.
|
|
53
|
+
|
|
54
|
+
Then write the answer:
|
|
55
|
+
|
|
56
|
+
- Give the actual steps or explanation from the article body, in your own words and concisely. **Never paste the whole body**; summarize the part that matters.
|
|
57
|
+
- Always end with a citation: `Source: [<article title>](<article url>)`.
|
|
58
|
+
- If a couple of other articles are clearly relevant, add them under "See also:".
|
|
59
|
+
|
|
60
|
+
## When the help center has no good answer
|
|
61
|
+
|
|
62
|
+
Be strict about relevance. The search almost always returns hits, even when nothing actually matches: a non-empty result is **not** proof that the topic is covered.
|
|
63
|
+
|
|
64
|
+
If no hit clearly matches the specific thing the user asked about (for example, they named a feature that appears in no hit's title or body), do **not** stitch tangential articles into a confident-sounding answer. That is a fabrication and is not acceptable.
|
|
65
|
+
|
|
66
|
+
Instead, say you do not have specific information on that, neutrally, without implying that the feature does or does not exist and without blaming anyone. For example: *"I don't have specific information on that in the help center. Could you tell me a bit more about what you're trying to do?"* You may then offer a related article, but only if it is genuinely relevant and clearly labelled as related rather than a direct answer.
|