@funnelsgrove/cli 0.1.299 → 0.1.303

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.
@@ -16,6 +16,7 @@ const MANAGED_VALIDATOR_PATHS = [
16
16
  ];
17
17
  const RUNNER_SCRIPT = 'vite-node --config src/contract/funnel-validator.vite.config.ts src/contract/validate-funnel.cli.ts';
18
18
  const MIGRATION_COMMAND = 'fgrove migrate step-contract --to 3';
19
+ const FLOW_CONTROLLER_PATH = 'src/runtime/use-funnel-flow-controller.ts';
19
20
  const resultWith = (diagnostics, exitCode, contractVersion = PROJECT_VALIDATOR_CONTRACT_VERSION) => ({
20
21
  schemaVersion: 1,
21
22
  contractVersion,
@@ -56,6 +57,71 @@ const clientDiagnostic = (received) => createValidationDiagnostic({
56
57
  guide: 'docs/funnelsgrove/qa/local.md',
57
58
  repair: 'Restore the managed validator runner and rerun fgrove validate.',
58
59
  });
60
+ const flowAnalyticsDiagnostic = (received) => createValidationDiagnostic({
61
+ code: 'FG-ANALYTICS-001',
62
+ file: FLOW_CONTROLLER_PATH,
63
+ expected: 'useFunnelFlowController({ analytics: publicAnalyticsSdk }) with publicAnalyticsSdk imported from @funnelsgrove/analytics',
64
+ received,
65
+ reason: 'A partial or wrapped analytics adapter silently drops step lifecycle events.',
66
+ guide: 'docs/funnelsgrove/contracts/analytics-events.md',
67
+ repair: 'Pass publicAnalyticsSdk directly as analytics; never subset the analytics adapter. To limit events for a third-party destination, use NEXT_PUBLIC_AMPLITUDE_EXCLUDED_EVENTS.',
68
+ });
69
+ const namedImportBindings = (sourceFile, moduleName, exportName) => {
70
+ const bindings = new Set();
71
+ for (const statement of sourceFile.statements) {
72
+ if (!ts.isImportDeclaration(statement)
73
+ || !ts.isStringLiteral(statement.moduleSpecifier)
74
+ || statement.moduleSpecifier.text !== moduleName
75
+ || statement.importClause?.isTypeOnly
76
+ || !statement.importClause?.namedBindings
77
+ || !ts.isNamedImports(statement.importClause.namedBindings))
78
+ continue;
79
+ for (const element of statement.importClause.namedBindings.elements) {
80
+ if (!element.isTypeOnly && (element.propertyName?.text ?? element.name.text) === exportName) {
81
+ bindings.add(element.name.text);
82
+ }
83
+ }
84
+ }
85
+ return bindings;
86
+ };
87
+ /** Every shared controller call must receive the SDK itself, so no lifecycle method can be dropped. */
88
+ const inspectFlowControllerAnalytics = async (projectDir) => {
89
+ let source;
90
+ try {
91
+ source = await readFile(path.join(projectDir, FLOW_CONTROLLER_PATH), 'utf8');
92
+ }
93
+ catch {
94
+ return flowAnalyticsDiagnostic('missing flow controller wrapper');
95
+ }
96
+ const sourceFile = ts.createSourceFile(FLOW_CONTROLLER_PATH, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
97
+ const sdkBindings = namedImportBindings(sourceFile, '@funnelsgrove/analytics', 'publicAnalyticsSdk');
98
+ const controllerBindings = namedImportBindings(sourceFile, '@funnelsgrove/runtime', 'useFunnelFlowController');
99
+ const passesSdk = (call) => {
100
+ const input = call.arguments[0] && unwrapExpression(call.arguments[0]);
101
+ if (!input || !ts.isObjectLiteralExpression(input))
102
+ return false;
103
+ return input.properties.some((property) => {
104
+ if (ts.isShorthandPropertyAssignment(property)) {
105
+ return property.name.text === 'analytics' && sdkBindings.has('analytics');
106
+ }
107
+ if (!ts.isPropertyAssignment(property) || property.name.getText(sourceFile) !== 'analytics')
108
+ return false;
109
+ const value = unwrapExpression(property.initializer);
110
+ return ts.isIdentifier(value) && sdkBindings.has(value.text);
111
+ });
112
+ };
113
+ const calls = [];
114
+ const visit = (node) => {
115
+ if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && controllerBindings.has(node.expression.text)) {
116
+ calls.push(node);
117
+ }
118
+ ts.forEachChild(node, visit);
119
+ };
120
+ visit(sourceFile);
121
+ if (calls.length === 0)
122
+ return flowAnalyticsDiagnostic('no useFunnelFlowController call from @funnelsgrove/runtime');
123
+ return calls.every(passesSdk) ? null : flowAnalyticsDiagnostic('analytics is not publicAnalyticsSdk');
124
+ };
59
125
  const unwrapExpression = (input) => {
60
126
  let expression = input;
61
127
  while (ts.isParenthesizedExpression(expression)
@@ -286,6 +352,9 @@ export const validateFunnel = async (options) => {
286
352
  const packageDiagnostics = inspectPackageCompatibility(projectDir);
287
353
  if (packageDiagnostics.length)
288
354
  return resultWith(packageDiagnostics, 1);
355
+ const flowAnalytics = await inspectFlowControllerAnalytics(projectDir);
356
+ if (flowAnalytics)
357
+ return resultWith([flowAnalytics], 1);
289
358
  let childResult;
290
359
  try {
291
360
  childResult = await (options.runProjectValidator ?? runCheckedInProjectValidator)({
@@ -4,10 +4,10 @@
4
4
  "minimumCliVersion": "0.1.20",
5
5
  "entries": [
6
6
  {
7
- "repositoryCliVersion": "0.1.299",
7
+ "repositoryCliVersion": "0.1.303",
8
8
  "manifest": {
9
9
  "schemaVersion": 1,
10
- "bundleVersion": "2.0.292",
10
+ "bundleVersion": "2.0.296",
11
11
  "stepContractVersion": 3,
12
12
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
13
13
  "managedFiles": [
@@ -25,7 +25,7 @@
25
25
  },
26
26
  {
27
27
  "path": "docs/funnelsgrove/contracts/analytics-events.md",
28
- "sha256": "30a445a2042549fe4bc87e0635785b5ff7876cbba0c8c27db2fcb04de3976f47"
28
+ "sha256": "11c79bd21570374ae591f21594c7235cc2bb015067ad901eddc1420a9998cd25"
29
29
  },
30
30
  {
31
31
  "path": "docs/funnelsgrove/contracts/content-answers.md",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  {
47
47
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
48
- "sha256": "c0dd6a75b2a824e38686b0ef29721b8bf6c61267254cfefeb036279eb40ddc0b"
48
+ "sha256": "b54e093d99f163b399ca52788beabc94530accea7b3c7d60caaf9f067a5aeb04"
49
49
  },
50
50
  {
51
51
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  {
63
63
  "path": "docs/funnelsgrove/qa/publish.md",
64
- "sha256": "67391a8bf5e1ddeab2e7430f48a589c28ce5fb986f06fee74f78f09649086603"
64
+ "sha256": "dd1584f08ffd779375b4ffec6890d6ef731734925d7abb2d021f7f0ad15d11f6"
65
65
  },
66
66
  {
67
67
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
@@ -145,16 +145,16 @@
145
145
  },
146
146
  {
147
147
  "path": "funnel-docs.config.json",
148
- "sha256": "f381938717d2b2bf89f9ee4a8b671ac6a7618d63aad64f4abbeb214d1426de39"
148
+ "sha256": "51ad1bfe95afe002bc2fabefe00655881cc41ab34cfb1d13a0dbf92b31ab0c7e"
149
149
  }
150
150
  ]
151
151
  }
152
152
  },
153
153
  {
154
- "repositoryCliVersion": "0.1.298",
154
+ "repositoryCliVersion": "0.1.302",
155
155
  "manifest": {
156
156
  "schemaVersion": 1,
157
- "bundleVersion": "2.0.291",
157
+ "bundleVersion": "2.0.295",
158
158
  "stepContractVersion": 3,
159
159
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
160
160
  "managedFiles": [
@@ -172,7 +172,7 @@
172
172
  },
173
173
  {
174
174
  "path": "docs/funnelsgrove/contracts/analytics-events.md",
175
- "sha256": "30a445a2042549fe4bc87e0635785b5ff7876cbba0c8c27db2fcb04de3976f47"
175
+ "sha256": "482b159a6b88a86009b9d2bec643d3e6dc4389c7693e1ab26c8df60b1eeb1f19"
176
176
  },
177
177
  {
178
178
  "path": "docs/funnelsgrove/contracts/content-answers.md",
@@ -192,7 +192,7 @@
192
192
  },
193
193
  {
194
194
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
195
- "sha256": "df3f4992dbf8ebbdb06b2da5fa93084f2a8e509e633ab84031677b6adfa34f1c"
195
+ "sha256": "373b181e673ad2fffcbcb68a11fa43186a57cac67493a746aafec03bd0a0ab94"
196
196
  },
197
197
  {
198
198
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -208,7 +208,7 @@
208
208
  },
209
209
  {
210
210
  "path": "docs/funnelsgrove/qa/publish.md",
211
- "sha256": "67391a8bf5e1ddeab2e7430f48a589c28ce5fb986f06fee74f78f09649086603"
211
+ "sha256": "dd1584f08ffd779375b4ffec6890d6ef731734925d7abb2d021f7f0ad15d11f6"
212
212
  },
213
213
  {
214
214
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
@@ -292,16 +292,16 @@
292
292
  },
293
293
  {
294
294
  "path": "funnel-docs.config.json",
295
- "sha256": "2c04ca52e82df96a208fc3f16f38fd98b92b01062505dce8b4b9bd01a6917811"
295
+ "sha256": "df1b6615d35d8d2385038e26580604bae5921075126dd01159bf7300ba675bf9"
296
296
  }
297
297
  ]
298
298
  }
299
299
  },
300
300
  {
301
- "repositoryCliVersion": "0.1.297",
301
+ "repositoryCliVersion": "0.1.301",
302
302
  "manifest": {
303
303
  "schemaVersion": 1,
304
- "bundleVersion": "2.0.290",
304
+ "bundleVersion": "2.0.294",
305
305
  "stepContractVersion": 3,
306
306
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
307
307
  "managedFiles": [
@@ -331,7 +331,7 @@
331
331
  },
332
332
  {
333
333
  "path": "docs/funnelsgrove/contracts/payments.md",
334
- "sha256": "6f9c9782340fef18a39fb6321ee2c80f5dcfaf210114a4dd0351b6f27aeacc11"
334
+ "sha256": "6e64acdf171351fddedc96e908f4135e2240751a726c05d938c6e8644ab42082"
335
335
  },
336
336
  {
337
337
  "path": "docs/funnelsgrove/contracts/step-metadata.md",
@@ -339,7 +339,7 @@
339
339
  },
340
340
  {
341
341
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
342
- "sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe"
342
+ "sha256": "39d41b41132bf4ecbae9f2e98500cea9045c66889bd4b6daf67673a566f282d3"
343
343
  },
344
344
  {
345
345
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -431,7 +431,7 @@
431
431
  },
432
432
  {
433
433
  "path": "docs/funnelsgrove/steps/upsell_offer.md",
434
- "sha256": "ba549a9355e9171193c765cc8744f68ae150c279bd9ffa08ef0f6fda0b71847b"
434
+ "sha256": "4a4d6122e868bbef1ca9e11238f6e7f4f8e03b5bf7dba7a1a0205c3ac422d4bd"
435
435
  },
436
436
  {
437
437
  "path": "docs/funnelsgrove/steps/value_prop_story.md",
@@ -439,16 +439,16 @@
439
439
  },
440
440
  {
441
441
  "path": "funnel-docs.config.json",
442
- "sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127"
442
+ "sha256": "69f6150b16fa1293a238fdc56d2f097dec4f626f3cdf32dc51f75b0f5cb06485"
443
443
  }
444
444
  ]
445
445
  }
446
446
  },
447
447
  {
448
- "repositoryCliVersion": "0.1.296",
448
+ "repositoryCliVersion": "0.1.300",
449
449
  "manifest": {
450
450
  "schemaVersion": 1,
451
- "bundleVersion": "2.0.289",
451
+ "bundleVersion": "2.0.293",
452
452
  "stepContractVersion": 3,
453
453
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
454
454
  "managedFiles": [
@@ -478,7 +478,7 @@
478
478
  },
479
479
  {
480
480
  "path": "docs/funnelsgrove/contracts/payments.md",
481
- "sha256": "6f9c9782340fef18a39fb6321ee2c80f5dcfaf210114a4dd0351b6f27aeacc11"
481
+ "sha256": "6e64acdf171351fddedc96e908f4135e2240751a726c05d938c6e8644ab42082"
482
482
  },
483
483
  {
484
484
  "path": "docs/funnelsgrove/contracts/step-metadata.md",
@@ -486,7 +486,7 @@
486
486
  },
487
487
  {
488
488
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
489
- "sha256": "f822b4943245eed41a35a42ec4e88712213d4f456d6bfeba73138168b292acb8"
489
+ "sha256": "24c93bea6e2b118908401b7ef82d36ae846669f7cf62d0b4cc18674caf531866"
490
490
  },
491
491
  {
492
492
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -578,7 +578,7 @@
578
578
  },
579
579
  {
580
580
  "path": "docs/funnelsgrove/steps/upsell_offer.md",
581
- "sha256": "ba549a9355e9171193c765cc8744f68ae150c279bd9ffa08ef0f6fda0b71847b"
581
+ "sha256": "4a4d6122e868bbef1ca9e11238f6e7f4f8e03b5bf7dba7a1a0205c3ac422d4bd"
582
582
  },
583
583
  {
584
584
  "path": "docs/funnelsgrove/steps/value_prop_story.md",
@@ -586,16 +586,16 @@
586
586
  },
587
587
  {
588
588
  "path": "funnel-docs.config.json",
589
- "sha256": "3e3cdfabee902dfdb2fe31dc439d71c9b3a2137ea4222fcc1a7169b431ab8680"
589
+ "sha256": "ec0d3caed99d53b09e28ecf2e59fd3100caf0d32c08c507651611a05c7019b6d"
590
590
  }
591
591
  ]
592
592
  }
593
593
  },
594
594
  {
595
- "repositoryCliVersion": "0.1.295",
595
+ "repositoryCliVersion": "0.1.299",
596
596
  "manifest": {
597
597
  "schemaVersion": 1,
598
- "bundleVersion": "2.0.288",
598
+ "bundleVersion": "2.0.292",
599
599
  "stepContractVersion": 3,
600
600
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
601
601
  "managedFiles": [
@@ -625,7 +625,7 @@
625
625
  },
626
626
  {
627
627
  "path": "docs/funnelsgrove/contracts/payments.md",
628
- "sha256": "6f9c9782340fef18a39fb6321ee2c80f5dcfaf210114a4dd0351b6f27aeacc11"
628
+ "sha256": "6e64acdf171351fddedc96e908f4135e2240751a726c05d938c6e8644ab42082"
629
629
  },
630
630
  {
631
631
  "path": "docs/funnelsgrove/contracts/step-metadata.md",
@@ -633,7 +633,7 @@
633
633
  },
634
634
  {
635
635
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
636
- "sha256": "93b18e9d64291582895c0236b6dfb95c8b261f7fce375ed4163598891d2504e5"
636
+ "sha256": "c0dd6a75b2a824e38686b0ef29721b8bf6c61267254cfefeb036279eb40ddc0b"
637
637
  },
638
638
  {
639
639
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -725,7 +725,7 @@
725
725
  },
726
726
  {
727
727
  "path": "docs/funnelsgrove/steps/upsell_offer.md",
728
- "sha256": "ba549a9355e9171193c765cc8744f68ae150c279bd9ffa08ef0f6fda0b71847b"
728
+ "sha256": "4a4d6122e868bbef1ca9e11238f6e7f4f8e03b5bf7dba7a1a0205c3ac422d4bd"
729
729
  },
730
730
  {
731
731
  "path": "docs/funnelsgrove/steps/value_prop_story.md",
@@ -733,16 +733,16 @@
733
733
  },
734
734
  {
735
735
  "path": "funnel-docs.config.json",
736
- "sha256": "af0ab4eb198669c6a97291986a6f17b80ea93294f8e15633cfe58e71f6b172ed"
736
+ "sha256": "f381938717d2b2bf89f9ee4a8b671ac6a7618d63aad64f4abbeb214d1426de39"
737
737
  }
738
738
  ]
739
739
  }
740
740
  },
741
741
  {
742
- "repositoryCliVersion": "0.1.294",
742
+ "repositoryCliVersion": "0.1.298",
743
743
  "manifest": {
744
744
  "schemaVersion": 1,
745
- "bundleVersion": "2.0.287",
745
+ "bundleVersion": "2.0.291",
746
746
  "stepContractVersion": 3,
747
747
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
748
748
  "managedFiles": [
@@ -772,7 +772,7 @@
772
772
  },
773
773
  {
774
774
  "path": "docs/funnelsgrove/contracts/payments.md",
775
- "sha256": "6f9c9782340fef18a39fb6321ee2c80f5dcfaf210114a4dd0351b6f27aeacc11"
775
+ "sha256": "6e64acdf171351fddedc96e908f4135e2240751a726c05d938c6e8644ab42082"
776
776
  },
777
777
  {
778
778
  "path": "docs/funnelsgrove/contracts/step-metadata.md",
@@ -780,7 +780,7 @@
780
780
  },
781
781
  {
782
782
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
783
- "sha256": "1f7f3d76856b2096ebde3bb0dd83dfabd131823476c8be151849e3bf57c91c28"
783
+ "sha256": "df3f4992dbf8ebbdb06b2da5fa93084f2a8e509e633ab84031677b6adfa34f1c"
784
784
  },
785
785
  {
786
786
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -872,7 +872,7 @@
872
872
  },
873
873
  {
874
874
  "path": "docs/funnelsgrove/steps/upsell_offer.md",
875
- "sha256": "ba549a9355e9171193c765cc8744f68ae150c279bd9ffa08ef0f6fda0b71847b"
875
+ "sha256": "4a4d6122e868bbef1ca9e11238f6e7f4f8e03b5bf7dba7a1a0205c3ac422d4bd"
876
876
  },
877
877
  {
878
878
  "path": "docs/funnelsgrove/steps/value_prop_story.md",
@@ -880,16 +880,16 @@
880
880
  },
881
881
  {
882
882
  "path": "funnel-docs.config.json",
883
- "sha256": "8470d2655720e6c3bb6e210b98d61fb7222deeef9607db6d03cca40e3b06fec7"
883
+ "sha256": "2c04ca52e82df96a208fc3f16f38fd98b92b01062505dce8b4b9bd01a6917811"
884
884
  }
885
885
  ]
886
886
  }
887
887
  },
888
888
  {
889
- "repositoryCliVersion": "0.1.293",
889
+ "repositoryCliVersion": "0.1.297",
890
890
  "manifest": {
891
891
  "schemaVersion": 1,
892
- "bundleVersion": "2.0.286",
892
+ "bundleVersion": "2.0.290",
893
893
  "stepContractVersion": 3,
894
894
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
895
895
  "managedFiles": [
@@ -927,7 +927,7 @@
927
927
  },
928
928
  {
929
929
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
930
- "sha256": "f1831876670eae6a6029f8f48d12038de408d4fb31a3332f7cec5cb3c7e4ff1d"
930
+ "sha256": "7bc1a8807979f1804f27ec95c049ea18c8637438c5e4c7f8cfb502a856f1d7fe"
931
931
  },
932
932
  {
933
933
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -1027,7 +1027,7 @@
1027
1027
  },
1028
1028
  {
1029
1029
  "path": "funnel-docs.config.json",
1030
- "sha256": "53e951dfdadfc634fa7bbd53615a5e2e3019cd1bce24b3a4d667e50557268dd7"
1030
+ "sha256": "75d2fc9faa26a9f5eb31048efd086908d75c0dfcad3a9cd91d79a738dff74127"
1031
1031
  }
1032
1032
  ]
1033
1033
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/cli",
3
- "version": "0.1.299",
3
+ "version": "0.1.303",
4
4
  "description": "FunnelsGrove command-line tools for editing, syncing, and publishing funnels",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.292",
3
+ "bundleVersion": "2.0.296",
4
4
  "stepContractVersion": 3,
5
5
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
6
6
  "managedFiles": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "path": "docs/funnelsgrove/contracts/analytics-events.md",
21
- "sha256": "30a445a2042549fe4bc87e0635785b5ff7876cbba0c8c27db2fcb04de3976f47"
21
+ "sha256": "11c79bd21570374ae591f21594c7235cc2bb015067ad901eddc1420a9998cd25"
22
22
  },
23
23
  {
24
24
  "path": "docs/funnelsgrove/contracts/content-answers.md",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
41
- "sha256": "c0dd6a75b2a824e38686b0ef29721b8bf6c61267254cfefeb036279eb40ddc0b"
41
+ "sha256": "b54e093d99f163b399ca52788beabc94530accea7b3c7d60caaf9f067a5aeb04"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  {
56
56
  "path": "docs/funnelsgrove/qa/publish.md",
57
- "sha256": "67391a8bf5e1ddeab2e7430f48a589c28ce5fb986f06fee74f78f09649086603"
57
+ "sha256": "dd1584f08ffd779375b4ffec6890d6ef731734925d7abb2d021f7f0ad15d11f6"
58
58
  },
59
59
  {
60
60
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "f381938717d2b2bf89f9ee4a8b671ac6a7618d63aad64f4abbeb214d1426de39"
141
+ "sha256": "51ad1bfe95afe002bc2fabefe00655881cc41ab34cfb1d13a0dbf92b31ab0c7e"
142
142
  }
143
143
  ]
144
144
  }
@@ -32,6 +32,8 @@ The `purchase_completed` event is owned by `trusted-server` and is recorded only
32
32
  ## Ownership rules
33
33
 
34
34
  - The flow controller emits lifecycle events. Step components do not duplicate them.
35
+ - `src/runtime/use-funnel-flow-controller.ts` passes `publicAnalyticsSdk` as `analytics` unchanged; never wrap, subset, or replace it (`FG-ANALYTICS-001`). Limit Amplitude events with `NEXT_PUBLIC_AMPLITUDE_EXCLUDED_EVENTS`.
36
+ - When porting from another funnel, take `src/runtime/` and `src/contract/` from the current template.
35
37
  - `step_engaged` is non-automatic and absent by default; only an explicit, centralized, tested policy may emit it through the approved controller/helper boundary.
36
38
  - `submitEmailCapture` creates `email_captured` transactionally, then routes only after success.
37
39
  - Shared payments components emit checkout semantic events at real payment boundaries when given `checkoutAnalytics`: a visible checkout form or wallet button owns `checkout_shown`, dialog/wallet intent owns `checkout_started`, actual submit owns `add_payment_info`, and verified success owns `checkout_completed`. Funnel components do not call those SDK methods directly.
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
17
17
 
18
18
  ### Package release order
19
19
 
20
- Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.35.0`, then `@funnelsgrove/analytics` `0.17.0`, then `@funnelsgrove/payments` `0.47.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.299`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.36.0`, then `@funnelsgrove/analytics` `0.18.0`, then `@funnelsgrove/payments` `0.49.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.303`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
21
21
  <!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
22
22
 
23
23
  ## Version-last policy
@@ -31,3 +31,11 @@ Contract hash: `d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf
31
31
  ## Production gate
32
32
 
33
33
  Publish production only after explicit approval and successful preview QA. Confirm the selected project/funnel/environment immediately before publishing, then smoke-test the live journey without creating duplicate conversions.
34
+
35
+ ## Paid-traffic launch gate
36
+
37
+ Run on production before paid traffic reaches a new or cloned funnel and after runtime, analytics, or payment wiring changes. Preview cannot pass it. Missing evidence means NOT ready, never skipped or blocked.
38
+
39
+ 1. In the live domain's network panel, the first step sends `step_started` and `first_step_viewed` to `/ingest` with the funnel id; `fgrove analytics transitions` shows them within ~1h.
40
+ 2. The live payment webhook shows verified for the current secret. Unverified means live purchases are not recorded.
41
+ 3. One real live purchase records the subscription and sends the purchase conversion; then refund it.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.292",
3
+ "bundleVersion": "2.0.296",
4
4
  "contractSource": "funnelsgrove-repository://apps/funnel-runtime/contracts/step-contract-v2.json",
5
5
  "fullyGenerated": [
6
6
  ".funnelsgrove-docs.json",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.292",
3
+ "bundleVersion": "2.0.296",
4
4
  "stepContractVersion": 3,
5
5
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
6
6
  "managedFiles": [
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "path": "docs/funnelsgrove/contracts/analytics-events.md",
21
- "sha256": "30a445a2042549fe4bc87e0635785b5ff7876cbba0c8c27db2fcb04de3976f47"
21
+ "sha256": "11c79bd21570374ae591f21594c7235cc2bb015067ad901eddc1420a9998cd25"
22
22
  },
23
23
  {
24
24
  "path": "docs/funnelsgrove/contracts/content-answers.md",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
41
- "sha256": "c0dd6a75b2a824e38686b0ef29721b8bf6c61267254cfefeb036279eb40ddc0b"
41
+ "sha256": "b54e093d99f163b399ca52788beabc94530accea7b3c7d60caaf9f067a5aeb04"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  {
56
56
  "path": "docs/funnelsgrove/qa/publish.md",
57
- "sha256": "67391a8bf5e1ddeab2e7430f48a589c28ce5fb986f06fee74f78f09649086603"
57
+ "sha256": "dd1584f08ffd779375b4ffec6890d6ef731734925d7abb2d021f7f0ad15d11f6"
58
58
  },
59
59
  {
60
60
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "f381938717d2b2bf89f9ee4a8b671ac6a7618d63aad64f4abbeb214d1426de39"
141
+ "sha256": "51ad1bfe95afe002bc2fabefe00655881cc41ab34cfb1d13a0dbf92b31ab0c7e"
142
142
  }
143
143
  ]
144
144
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sourceTreeHash": "e75b4bf2583c7982713b3cf96489f70404a0c6585572d60f59caa611ff0f2b28",
3
+ "sourceTreeHash": "ea37051f39f4b0f6fbf0daa151f62426957540425b107e7c9ffa6389cf2aff71",
4
4
  "stepContractVersion": 3,
5
- "docsBundleVersion": "2.0.292",
5
+ "docsBundleVersion": "2.0.296",
6
6
  "files": [
7
7
  {
8
8
  "path": ".env.example",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  {
18
18
  "path": ".funnelsgrove-docs.json",
19
- "sha256": "ea0ddb1dae13a686a35f24c12d88d9df3bb567d08e1338c2c04428b50a09876e",
19
+ "sha256": "8fc0263e60c93327d2ab3161668c9fa150de8259fbe9fa5c618fadf394e723db",
20
20
  "mode": "100644"
21
21
  },
22
22
  {
@@ -51,7 +51,7 @@
51
51
  },
52
52
  {
53
53
  "path": "docs/funnelsgrove/contracts/analytics-events.md",
54
- "sha256": "30a445a2042549fe4bc87e0635785b5ff7876cbba0c8c27db2fcb04de3976f47",
54
+ "sha256": "11c79bd21570374ae591f21594c7235cc2bb015067ad901eddc1420a9998cd25",
55
55
  "mode": "100644"
56
56
  },
57
57
  {
@@ -76,7 +76,7 @@
76
76
  },
77
77
  {
78
78
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
79
- "sha256": "c0dd6a75b2a824e38686b0ef29721b8bf6c61267254cfefeb036279eb40ddc0b",
79
+ "sha256": "b54e093d99f163b399ca52788beabc94530accea7b3c7d60caaf9f067a5aeb04",
80
80
  "mode": "100644"
81
81
  },
82
82
  {
@@ -96,7 +96,7 @@
96
96
  },
97
97
  {
98
98
  "path": "docs/funnelsgrove/qa/publish.md",
99
- "sha256": "67391a8bf5e1ddeab2e7430f48a589c28ce5fb986f06fee74f78f09649086603",
99
+ "sha256": "dd1584f08ffd779375b4ffec6890d6ef731734925d7abb2d021f7f0ad15d11f6",
100
100
  "mode": "100644"
101
101
  },
102
102
  {
@@ -206,7 +206,7 @@
206
206
  },
207
207
  {
208
208
  "path": "funnel-docs.config.json",
209
- "sha256": "f381938717d2b2bf89f9ee4a8b671ac6a7618d63aad64f4abbeb214d1426de39",
209
+ "sha256": "51ad1bfe95afe002bc2fabefe00655881cc41ab34cfb1d13a0dbf92b31ab0c7e",
210
210
  "mode": "100644"
211
211
  },
212
212
  {
@@ -32,6 +32,8 @@ The `purchase_completed` event is owned by `trusted-server` and is recorded only
32
32
  ## Ownership rules
33
33
 
34
34
  - The flow controller emits lifecycle events. Step components do not duplicate them.
35
+ - `src/runtime/use-funnel-flow-controller.ts` passes `publicAnalyticsSdk` as `analytics` unchanged; never wrap, subset, or replace it (`FG-ANALYTICS-001`). Limit Amplitude events with `NEXT_PUBLIC_AMPLITUDE_EXCLUDED_EVENTS`.
36
+ - When porting from another funnel, take `src/runtime/` and `src/contract/` from the current template.
35
37
  - `step_engaged` is non-automatic and absent by default; only an explicit, centralized, tested policy may emit it through the approved controller/helper boundary.
36
38
  - `submitEmailCapture` creates `email_captured` transactionally, then routes only after success.
37
39
  - Shared payments components emit checkout semantic events at real payment boundaries when given `checkoutAnalytics`: a visible checkout form or wallet button owns `checkout_shown`, dialog/wallet intent owns `checkout_started`, actual submit owns `add_payment_info`, and verified success owns `checkout_completed`. Funnel components do not call those SDK methods directly.
@@ -17,7 +17,7 @@ Supported read versions: `1`, `2`, `3`. Authoring and publish target version `3`
17
17
 
18
18
  ### Package release order
19
19
 
20
- Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.35.0`, then `@funnelsgrove/analytics` `0.17.0`, then `@funnelsgrove/payments` `0.47.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.299`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/sdk` `0.4.0` first, then `@funnelsgrove/runtime` `0.36.0`, then `@funnelsgrove/analytics` `0.18.0`, then `@funnelsgrove/payments` `0.49.0`. The production deploy verifies the zero-traffic API candidate, publishes and verifies `@funnelsgrove/cli` `0.1.303`, and only then promotes the candidate to production traffic. The serving API must never advertise an unpublished preferred CLI. Publishing packages and deploying production remain separately approved operational actions.
21
21
  <!-- funnelsgrove:generated:end contract-v3/migration/step-contract-v3 -->
22
22
 
23
23
  ## Version-last policy
@@ -31,3 +31,11 @@ Contract hash: `d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf
31
31
  ## Production gate
32
32
 
33
33
  Publish production only after explicit approval and successful preview QA. Confirm the selected project/funnel/environment immediately before publishing, then smoke-test the live journey without creating duplicate conversions.
34
+
35
+ ## Paid-traffic launch gate
36
+
37
+ Run on production before paid traffic reaches a new or cloned funnel and after runtime, analytics, or payment wiring changes. Preview cannot pass it. Missing evidence means NOT ready, never skipped or blocked.
38
+
39
+ 1. In the live domain's network panel, the first step sends `step_started` and `first_step_viewed` to `/ingest` with the funnel id; `fgrove analytics transitions` shows them within ~1h.
40
+ 2. The live payment webhook shows verified for the current secret. Unverified means live purchases are not recorded.
41
+ 3. One real live purchase records the subscription and sends the purchase conversion; then refund it.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.292",
3
+ "bundleVersion": "2.0.296",
4
4
  "contractSource": "funnelsgrove-repository://apps/funnel-runtime/contracts/step-contract-v2.json",
5
5
  "fullyGenerated": [
6
6
  ".funnelsgrove-docs.json",