afv-library/skills/explaining-batch-data-transform/assets/sample_bdts/window_and_aggregate.json

98 lines
3.5 KiB
JSON
Raw Normal View History

feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
{
"version": "66.0",
"nodes": {
"LOAD_ORDERS": {
"action": "load",
"sources": [],
"parameters": {
"dataset": {"name": "ssot__SalesOrder__dlm", "type": "dataModelObject"},
"fields": ["ssot__Id__c", "ssot__AccountId__c", "ssot__CreatedDate__c", "ssot__GrandTotalAmount__c"],
"sampleDetails": {"type": "TopN", "sortBy": []}
}
},
"RANK_ORDERS": {
"action": "computeRelative",
"sources": ["LOAD_ORDERS"],
"parameters": {
"partitionBy": ["ssot__AccountId__c"],
"orderBy": [{"fieldName": "ssot__CreatedDate__c", "direction": "ASC"}],
"expressionType": "SQL",
"fields": [
{
"name": "OrderRank__c",
"label": "Order Rank",
"formulaExpression": "row_number()",
"type": "NUMBER",
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
"businessType": "NUMBER",
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
"precision": 18,
"scale": 0,
"defaultValue": ""
}
]
}
},
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
"FIRST_ORDER_AMOUNT": {
"action": "formula",
"sources": ["RANK_ORDERS"],
"parameters": {
"expressionType": "SQL",
"fields": [
{
"name": "FirstOrderAmount__c",
"label": "First Order Amount (per account)",
"formulaExpression": "case when OrderRank__c = 1 then ssot__GrandTotalAmount__c else 0 end",
"type": "NUMBER",
"businessType": "NUMBER",
"precision": 18,
"scale": 2,
"defaultValue": "0"
}
]
}
},
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
"AGG_BY_ACCOUNT": {
"action": "aggregate",
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
"sources": ["FIRST_ORDER_AMOUNT"],
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
"parameters": {
"groupings": ["ssot__AccountId__c"],
"aggregations": [
{"action": "SUM", "name": "TotalAmount__c", "source": "ssot__GrandTotalAmount__c"},
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
{"action": "SUM", "name": "FirstOrderTotal__c", "source": "FirstOrderAmount__c"},
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
{"action": "COUNT", "name": "OrderCount__c", "source": "ssot__Id__c"}
],
"nodeType": "STANDARD"
}
},
"OUTPUT_SUMMARY": {
"action": "outputD360",
"sources": ["AGG_BY_ACCOUNT"],
"parameters": {
"name": "Account_Summary__dlm",
"type": "dataModelObject",
"writeMode": "OVERWRITE",
"fieldsMappings": [
{"sourceField": "ssot__AccountId__c", "targetField": "AccountId__c"},
{"sourceField": "TotalAmount__c", "targetField": "TotalAmount__c"},
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
{"sourceField": "FirstOrderTotal__c", "targetField": "FirstOrderAmount__c"},
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
{"sourceField": "OrderCount__c", "targetField": "OrderCount__c"}
]
}
}
},
"ui": {
"nodes": {
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
"LOAD_ORDERS": {"label": "Sales Orders", "type": "LOAD_DATASET", "top": 100, "left": 100},
"RANK_ORDERS": {"label": "Rank by account", "type": "COMPUTE_RELATIVE", "top": 100, "left": 260},
"FIRST_ORDER_AMOUNT": {"label": "Extract first order amount", "type": "FORMULA", "top": 100, "left": 420},
"AGG_BY_ACCOUNT": {"label": "Totals per account", "type": "AGGREGATE", "top": 100, "left": 580},
"OUTPUT_SUMMARY": {"label": "Account Summary", "type": "OUTPUT", "top": 100, "left": 740}
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
},
"connectors": [
{"source": "LOAD_ORDERS", "target": "RANK_ORDERS"},
fix: address PRizm round-2 review findings from internal port @W-22196528@ Ports the 14 applicable round-2 fixes from the internal PRizm review to the external afv-library source. (plugin.json finding #13 is internal-only and does not apply here.) Accepted fixes: 1 bdt_analyze.py select_definition: isinstance(index, int) -> type(index) is int (reject bool subclass of int). 2 bdt_analyze.py cmd_formula: precompute upstream fields_produced map to eliminate O(consumed x upstream) recomputation. 3 bdt_analyze.py topo_order: replace sort-on-every-iteration with deque-based Kahn (preserves deterministic order). 4 test_bdt_analyze.py test_all_subcommands_work_on_api_input: wrap loop in self.subTest for per-iteration failure reporting. 5 test_bdt_analyze.py test_invalid_json_raises: register addCleanup BEFORE write_text so cleanup runs even if write fails. 6 SKILL.md: remove misleading "strip __c suffix" field-trace troubleshooting advice; replace with source-DMO passthrough guidance. 7 SKILL.md: rewrite cycle error message to direct user to Data Cloud viewer (re-export will not fix a cycle in the BDT definition). 8 SKILL.md: add explicit --definition N flag documentation and list every subcommand that accepts it. 9 SKILL.md: refine I2 routing guidance — pick the earliest formula/ computeRelative node, not the output mapping. 11 bdt-function-catalog.md: clean floor() wording ("always rounds down on the number line"). 12 bdt-node-catalog.md: businessType enum — assert list is canonical/complete; instruct skill to surface+flag any unknown value. 14 append_and_split.json: change split subject from fragile CustomerFullName__c split-on-space to ChannelOrderKey__c split-on-hyphen; avoids name-parsing pitfall (middle names / multi-space). 15 window_and_aggregate.json: use the computed OrderRank__c via a new FIRST_ORDER_AMOUNT formula node (case when rank=1 then amount else 0) feeding AGG_BY_ACCOUNT; illustrates the rank+formula+aggregate idiom. 16 joins_and_filters.json: add explicit IS_NOT_NULL filter expression on GrandTotalAmount__c (defense-in-depth beyond GREATER_THAN 0). Rejected finding (rationale posted as PR comment): 10 bdt-node-catalog.md split section — reviewer claimed split is a pipeline-branching node. Canonical sources (core-262 SplitParametersInputRepresentation.java + Salesforce help DITA c360_a_batch_transform_split.xml) both describe split as a string-splitting operation. Current docs are correct; not changing. Tests: 92/92 passing.
2026-04-24 13:25:18 +08:00
{"source": "RANK_ORDERS", "target": "FIRST_ORDER_AMOUNT"},
{"source": "FIRST_ORDER_AMOUNT", "target": "AGG_BY_ACCOUNT"},
feat(bdt): reference docs + sample BDTs @W-22196528@ Adds the curated reference library the skill loads on demand, plus four synthetic sample BDTs used by docs, tests, and LLM-mode demos. references/ (4 curated Markdown files): - bdt-reference.md — top-level BDT JSON anatomy: envelope, nodes, edges, UI layer, definitions, businessType semantics. Cites the core-262 upstream JSON schema and Connect API spec. - bdt-node-catalog.md — every node type (DMO Source, DMO Sink, Filter, Join, Union, Aggregate, Window, Formula, Split, Append, etc.) with its required/optional fields and typical usage. Audited against core-262 enums. - bdt-function-catalog.md — the expression-language function surface (string, numeric, date, conditional, aggregate). Grouped by category with signature + one-line semantics. - bdt-window-functions.md — windowing operators (ROW_NUMBER, RANK, LEAD/LAG, running aggregates) with PARTITION BY / ORDER BY grammar and gotchas. assets/sample_bdts/ (4 synthetic, dependency-free BDTs): - minimal_dmo_to_dmo.json — smallest valid BDT (1 source, 1 sink). - joins_and_filters.json — join + filter composition. - window_and_aggregate.json — window function + aggregate in one graph. - append_and_split.json — append-then-split branching topology. Grounding rules enforced in this commit: - Every claim in references/ cites an upstream source (core-262 JSON schema, Connect API reference, or the Data Cloud BDT editor spec). No speculative content. - No raw DITA or internal-only documentation is shipped; references are synthesized from public-facing material. - BusinessTypeEnum values use the canonical camelCase casing from core-262 (case-cleanup fix included here). - Sample BDTs are original synthetic fixtures, not redacted customer data. Each is small enough to read end-to-end. @W-22196528@
2026-04-24 01:15:27 +08:00
{"source": "AGG_BY_ACCOUNT", "target": "OUTPUT_SUMMARY"}
]
}
}