@funnelsgrove/cli 0.1.50 → 0.1.53

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 CHANGED
@@ -48,6 +48,9 @@ Create an experiment draft from a strict JSON spec:
48
48
  ```bash
49
49
  fgrove experiments create --spec experiment.json --dir .
50
50
  fgrove experiments create --spec experiment.json --dir . --json
51
+ fgrove experiments start <experiment-uuid>
52
+ fgrove experiments stop <experiment-uuid>
53
+ fgrove experiments restart <experiment-uuid> --json
51
54
  fgrove validate
52
55
  ```
53
56
 
package/dist/cli.d.ts CHANGED
@@ -267,6 +267,14 @@ export declare const formatOfferSetSyncSuccess: (input: {
267
267
  offerSetLabel: string;
268
268
  generatedFileCount: number;
269
269
  }) => string[];
270
+ type ExperimentLifecycleAction = 'start' | 'stop' | 'restart';
271
+ type ExperimentLifecycleResult = {
272
+ id: string;
273
+ funnel_id: string;
274
+ name?: string | null;
275
+ status: string;
276
+ };
277
+ export declare const formatExperimentLifecycleSuccess: (action: ExperimentLifecycleAction, result: ExperimentLifecycleResult, json: boolean) => string;
270
278
  export declare const program: Command;
271
279
  type AnalyticsApiCall = (input: {
272
280
  path: string;
package/dist/cli.js CHANGED
@@ -1499,6 +1499,18 @@ export const formatOfferSetSyncSuccess = (input) => [
1499
1499
  `Synced offer set ${input.offerSetLabel} to funnel draft`,
1500
1500
  `Wrote ${formatGeneratedFileCount(input.generatedFileCount)}`,
1501
1501
  ];
1502
+ export const formatExperimentLifecycleSuccess = (action, result, json) => {
1503
+ const payload = {
1504
+ experimentId: result.id,
1505
+ funnelId: result.funnel_id,
1506
+ status: result.status,
1507
+ };
1508
+ if (json) {
1509
+ return `${JSON.stringify(payload)}\n`;
1510
+ }
1511
+ const verb = action === 'stop' ? 'Stopped' : action === 'restart' ? 'Restarted' : 'Started';
1512
+ return `${verb} experiment ${result.name?.trim() || result.id} (${result.status})\n`;
1513
+ };
1502
1514
  /**
1503
1515
  * @deprecated Compatibility path for fgrove generated-config sync only.
1504
1516
  * Dashboard and analytics step discovery must use projects.funnelSteps/version stepMetadata.
@@ -1779,6 +1791,24 @@ addExamples(experimentsCommand
1779
1791
  });
1780
1792
  process.stdout.write(formatExperimentCreateSuccess(result, options.json === true));
1781
1793
  });
1794
+ const registerExperimentLifecycleCommand = (action, description) => {
1795
+ addExamples(experimentsCommand
1796
+ .command(`${action} <id>`)
1797
+ .description(description)
1798
+ .option('--json', 'Emit one machine-readable success object'), [`fgrove experiments ${action} 22222222-2222-4222-8222-222222222222`])
1799
+ .action(async (id, options) => {
1800
+ const result = await callApi({
1801
+ path: `funnelExperiments.${action}`,
1802
+ type: 'mutation',
1803
+ token: await readAuthToken(),
1804
+ data: { id },
1805
+ });
1806
+ process.stdout.write(formatExperimentLifecycleSuccess(action, result, options.json === true));
1807
+ });
1808
+ };
1809
+ registerExperimentLifecycleCommand('start', 'Start a draft or stopped experiment');
1810
+ registerExperimentLifecycleCommand('stop', 'Stop traffic without ending the experiment');
1811
+ registerExperimentLifecycleCommand('restart', 'Stop and start an experiment, preserving its variants');
1782
1812
  addExamples(experimentsCommand
1783
1813
  .command('sync')
1784
1814
  .description('Write generated experiment config for a funnel')
@@ -4,10 +4,10 @@
4
4
  "minimumCliVersion": "0.1.20",
5
5
  "entries": [
6
6
  {
7
- "repositoryCliVersion": "0.1.50",
7
+ "repositoryCliVersion": "0.1.53",
8
8
  "manifest": {
9
9
  "schemaVersion": 1,
10
- "bundleVersion": "2.0.38",
10
+ "bundleVersion": "2.0.41",
11
11
  "stepContractVersion": 3,
12
12
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
13
13
  "managedFiles": [
@@ -45,7 +45,7 @@
45
45
  },
46
46
  {
47
47
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
48
- "sha256": "056fccc3085ebde480cf0725fab45410bc369fc1434754cd25187e44d3615e28"
48
+ "sha256": "7993d09cd90636290a43ee9ed0cdebf62a4fea99c77625b7880d2641b6175ba0"
49
49
  },
50
50
  {
51
51
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  {
67
67
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
68
- "sha256": "9918b577f47a9577c3c98d9a6a7a8762ddfeedb667efe13000900d1a1daee1f9"
68
+ "sha256": "7b2d28d84042c7b22f1cc26f0407389c4bfc6d38f82b473cb128a822f750b0d8"
69
69
  },
70
70
  {
71
71
  "path": "docs/funnelsgrove/recipes/add-step.md",
@@ -145,16 +145,16 @@
145
145
  },
146
146
  {
147
147
  "path": "funnel-docs.config.json",
148
- "sha256": "d3643ea1a8b9c63b28a18465e4afae1771aab6972559828ebf4802c7ad1df8cb"
148
+ "sha256": "dd7eeb6a8028af400f7c28565b622a3ae824e67c9830b71f4c83fbb2487d2159"
149
149
  }
150
150
  ]
151
151
  }
152
152
  },
153
153
  {
154
- "repositoryCliVersion": "0.1.49",
154
+ "repositoryCliVersion": "0.1.52",
155
155
  "manifest": {
156
156
  "schemaVersion": 1,
157
- "bundleVersion": "2.0.37",
157
+ "bundleVersion": "2.0.40",
158
158
  "stepContractVersion": 3,
159
159
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
160
160
  "managedFiles": [
@@ -192,7 +192,7 @@
192
192
  },
193
193
  {
194
194
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
195
- "sha256": "6268f1d754bc29586cc134032f199bcb7d449a096eafe90cf917e501b9768fe6"
195
+ "sha256": "bbde1c301b2d4ca0a7a3cbfd9b198263a9106d1c42a2dfd0ef802f581fd45988"
196
196
  },
197
197
  {
198
198
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -212,7 +212,7 @@
212
212
  },
213
213
  {
214
214
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
215
- "sha256": "9918b577f47a9577c3c98d9a6a7a8762ddfeedb667efe13000900d1a1daee1f9"
215
+ "sha256": "7b2d28d84042c7b22f1cc26f0407389c4bfc6d38f82b473cb128a822f750b0d8"
216
216
  },
217
217
  {
218
218
  "path": "docs/funnelsgrove/recipes/add-step.md",
@@ -292,16 +292,16 @@
292
292
  },
293
293
  {
294
294
  "path": "funnel-docs.config.json",
295
- "sha256": "99bc93eab4e586a84507821d8ad859f20e87d839a6d9eee2cdf83f72de4a51ae"
295
+ "sha256": "9b68227426254a9b5563019abb36c552d598ccc2fed3266b432421e3908ddbc7"
296
296
  }
297
297
  ]
298
298
  }
299
299
  },
300
300
  {
301
- "repositoryCliVersion": "0.1.48",
301
+ "repositoryCliVersion": "0.1.51",
302
302
  "manifest": {
303
303
  "schemaVersion": 1,
304
- "bundleVersion": "2.0.36",
304
+ "bundleVersion": "2.0.39",
305
305
  "stepContractVersion": 3,
306
306
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
307
307
  "managedFiles": [
@@ -339,7 +339,7 @@
339
339
  },
340
340
  {
341
341
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
342
- "sha256": "196f56b9138501b1cec0678422c1434d462a01ca5578ebfec607d323b1801234"
342
+ "sha256": "26382941b09aa65edc147d2aa7336a745179047b6ec9a308c9572f88516c5e01"
343
343
  },
344
344
  {
345
345
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -439,16 +439,16 @@
439
439
  },
440
440
  {
441
441
  "path": "funnel-docs.config.json",
442
- "sha256": "3f95a918c742c06e3130b20e2edc0820aee8ed213cd6bcdeb09cacb8c428143b"
442
+ "sha256": "61864db071b802bc5570df67e5eecd8bf43dfbd3e0c5c08abe3a1745df662503"
443
443
  }
444
444
  ]
445
445
  }
446
446
  },
447
447
  {
448
- "repositoryCliVersion": "0.1.47",
448
+ "repositoryCliVersion": "0.1.50",
449
449
  "manifest": {
450
450
  "schemaVersion": 1,
451
- "bundleVersion": "2.0.35",
451
+ "bundleVersion": "2.0.38",
452
452
  "stepContractVersion": 3,
453
453
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
454
454
  "managedFiles": [
@@ -486,7 +486,7 @@
486
486
  },
487
487
  {
488
488
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
489
- "sha256": "164ce4a6860a5d44cf6fad9a9df4c711cc246f1b3982501679645c9971173c70"
489
+ "sha256": "056fccc3085ebde480cf0725fab45410bc369fc1434754cd25187e44d3615e28"
490
490
  },
491
491
  {
492
492
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -586,16 +586,16 @@
586
586
  },
587
587
  {
588
588
  "path": "funnel-docs.config.json",
589
- "sha256": "d4195ce4a134209e1dd5afb93744d5fbf3ff27f0e64f1c19ff210d09487368b1"
589
+ "sha256": "d3643ea1a8b9c63b28a18465e4afae1771aab6972559828ebf4802c7ad1df8cb"
590
590
  }
591
591
  ]
592
592
  }
593
593
  },
594
594
  {
595
- "repositoryCliVersion": "0.1.46",
595
+ "repositoryCliVersion": "0.1.49",
596
596
  "manifest": {
597
597
  "schemaVersion": 1,
598
- "bundleVersion": "2.0.34",
598
+ "bundleVersion": "2.0.37",
599
599
  "stepContractVersion": 3,
600
600
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
601
601
  "managedFiles": [
@@ -633,7 +633,7 @@
633
633
  },
634
634
  {
635
635
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
636
- "sha256": "9f52af57ef30e30f477c2fc898940032a8233fc42cb885d2fd7e2f258b6e6b90"
636
+ "sha256": "6268f1d754bc29586cc134032f199bcb7d449a096eafe90cf917e501b9768fe6"
637
637
  },
638
638
  {
639
639
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -733,16 +733,16 @@
733
733
  },
734
734
  {
735
735
  "path": "funnel-docs.config.json",
736
- "sha256": "7060891cfa234dedd6da01a3615ca22147509af8222a8e1ff86cdcffcdf2423a"
736
+ "sha256": "99bc93eab4e586a84507821d8ad859f20e87d839a6d9eee2cdf83f72de4a51ae"
737
737
  }
738
738
  ]
739
739
  }
740
740
  },
741
741
  {
742
- "repositoryCliVersion": "0.1.45",
742
+ "repositoryCliVersion": "0.1.48",
743
743
  "manifest": {
744
744
  "schemaVersion": 1,
745
- "bundleVersion": "2.0.33",
745
+ "bundleVersion": "2.0.36",
746
746
  "stepContractVersion": 3,
747
747
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
748
748
  "managedFiles": [
@@ -780,7 +780,7 @@
780
780
  },
781
781
  {
782
782
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
783
- "sha256": "d9d05a001bce39b97dd6dc3f3c1af132675fcf25513ffe055e89b25f715925ab"
783
+ "sha256": "196f56b9138501b1cec0678422c1434d462a01ca5578ebfec607d323b1801234"
784
784
  },
785
785
  {
786
786
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -880,16 +880,16 @@
880
880
  },
881
881
  {
882
882
  "path": "funnel-docs.config.json",
883
- "sha256": "ba10520da19cd1dfd3474665d80278feda32b28b0be35e16336c8883f0b5dab7"
883
+ "sha256": "3f95a918c742c06e3130b20e2edc0820aee8ed213cd6bcdeb09cacb8c428143b"
884
884
  }
885
885
  ]
886
886
  }
887
887
  },
888
888
  {
889
- "repositoryCliVersion": "0.1.44",
889
+ "repositoryCliVersion": "0.1.47",
890
890
  "manifest": {
891
891
  "schemaVersion": 1,
892
- "bundleVersion": "2.0.32",
892
+ "bundleVersion": "2.0.35",
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": "31b593f08e1aa61c5c0591278696bde421777f1cc0e43c62372bf1073afdaf86"
930
+ "sha256": "164ce4a6860a5d44cf6fad9a9df4c711cc246f1b3982501679645c9971173c70"
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": "246d66da4931f5426828b1617f5a87b5e352d8691df7f556645cc221c8e3a1e8"
1030
+ "sha256": "d4195ce4a134209e1dd5afb93744d5fbf3ff27f0e64f1c19ff210d09487368b1"
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.50",
3
+ "version": "0.1.53",
4
4
  "description": "FunnelsGrove command-line tools for editing, syncing, and publishing funnels",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "typescript": "^5.8.3"
40
40
  },
41
41
  "devDependencies": {
42
- "@funnelsgrove/analytics": "0.1.43",
42
+ "@funnelsgrove/analytics": "0.1.44",
43
43
  "@funnelsgrove/payments": "0.2.0",
44
44
  "vitest": "^3.0.0"
45
45
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.38",
3
+ "bundleVersion": "2.0.41",
4
4
  "stepContractVersion": 3,
5
5
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
6
6
  "managedFiles": [
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
41
- "sha256": "056fccc3085ebde480cf0725fab45410bc369fc1434754cd25187e44d3615e28"
41
+ "sha256": "7993d09cd90636290a43ee9ed0cdebf62a4fea99c77625b7880d2641b6175ba0"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  {
60
60
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
61
- "sha256": "9918b577f47a9577c3c98d9a6a7a8762ddfeedb667efe13000900d1a1daee1f9"
61
+ "sha256": "7b2d28d84042c7b22f1cc26f0407389c4bfc6d38f82b473cb128a822f750b0d8"
62
62
  },
63
63
  {
64
64
  "path": "docs/funnelsgrove/recipes/add-step.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "d3643ea1a8b9c63b28a18465e4afae1771aab6972559828ebf4802c7ad1df8cb"
141
+ "sha256": "dd7eeb6a8028af400f7c28565b622a3ae824e67c9830b71f4c83fbb2487d2159"
142
142
  }
143
143
  ]
144
144
  }
@@ -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/runtime` `0.2.0` first, then `@funnelsgrove/analytics` `0.1.43`, then `@funnelsgrove/payments` `0.2.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.50`. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/runtime` `0.2.0` first, then `@funnelsgrove/analytics` `0.1.44`, then `@funnelsgrove/payments` `0.2.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.53`. 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
@@ -150,7 +150,17 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
150
150
 
151
151
  The stable `id` becomes the experiment key. Keep it unchanged for an exact retry: an identical same-key draft is reused, while a different definition or non-draft experiment is rejected rather than overwritten.
152
152
 
153
- Creation always produces a draft. It does not create or activate a PostHog flag, start traffic, or make unfinished variant steps or offer sets runnable. Activation remains a separate pre-activation UI/API action.
153
+ Creation always produces a draft. It does not create or activate a PostHog flag, start traffic, or make unfinished variant steps or offer sets runnable. After QA, manage traffic through the lifecycle API exposed by the CLI:
154
+
155
+ ```bash
156
+ fgrove experiments start <experiment-uuid>
157
+ fgrove experiments stop <experiment-uuid>
158
+ fgrove experiments restart <experiment-uuid>
159
+ ```
160
+
161
+ `stop` is reversible: it pauses traffic and keeps the experiment, variants, and PostHog flag available for a later `start`. `restart` stops a running experiment when necessary and starts it again while preserving the existing definition. Each command updates PostHog and commits the final experiment status to the hosted generated funnel config. Use `--json` for agent-readable output. Run `fgrove experiments sync` afterward when the local generated config also needs to reflect the lifecycle change.
162
+
163
+ The corresponding authenticated API mutations are `funnelExperiments.start`, `funnelExperiments.stop`, and `funnelExperiments.restart`; each accepts `{ "id": "<experiment-uuid>" }`.
154
164
 
155
165
  The API creates the experiment and variants atomically, commits the matching generated snapshot to the hosted draft, and only then returns. The draft is immediately visible in the FunnelsGrove UI and hosted previews use the same snapshot. The CLI installs the exact returned bytes at `src/config/experiments.generated.ts` and `src/config/experiments.ts`, then updates the sync manifest last. `.funnelsgrove-sync.json` stays local and ignored; never commit or push it.
156
166
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.38",
3
+ "bundleVersion": "2.0.41",
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.38",
3
+ "bundleVersion": "2.0.41",
4
4
  "stepContractVersion": 3,
5
5
  "contractHash": "d761e91d5ac6ff9e72c6d49c5bcd014270912473a66f99c49d726c65998085cf",
6
6
  "managedFiles": [
@@ -38,7 +38,7 @@
38
38
  },
39
39
  {
40
40
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
41
- "sha256": "056fccc3085ebde480cf0725fab45410bc369fc1434754cd25187e44d3615e28"
41
+ "sha256": "7993d09cd90636290a43ee9ed0cdebf62a4fea99c77625b7880d2641b6175ba0"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  {
60
60
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
61
- "sha256": "9918b577f47a9577c3c98d9a6a7a8762ddfeedb667efe13000900d1a1daee1f9"
61
+ "sha256": "7b2d28d84042c7b22f1cc26f0407389c4bfc6d38f82b473cb128a822f750b0d8"
62
62
  },
63
63
  {
64
64
  "path": "docs/funnelsgrove/recipes/add-step.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "d3643ea1a8b9c63b28a18465e4afae1771aab6972559828ebf4802c7ad1df8cb"
141
+ "sha256": "dd7eeb6a8028af400f7c28565b622a3ae824e67c9830b71f4c83fbb2487d2159"
142
142
  }
143
143
  ]
144
144
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sourceTreeHash": "d76d1033af84ec94dea8ebc9718c44b8d23c960c469cc92f238be550288fc74b",
3
+ "sourceTreeHash": "b107f26e31b2a06f00850b109581caf0f80844e3764d1355660dd4172fd8f0d4",
4
4
  "stepContractVersion": 3,
5
- "docsBundleVersion": "2.0.38",
5
+ "docsBundleVersion": "2.0.41",
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": "b4d1d8b5092c3de8eebefcd5706d897395bc01e4f9085264a941d75ad9191a68",
19
+ "sha256": "6624839df385e4c7494b8ce4ffb3a07a793c0668cceb8737cde9478883ac7b33",
20
20
  "mode": "100644"
21
21
  },
22
22
  {
@@ -101,7 +101,7 @@
101
101
  },
102
102
  {
103
103
  "path": "docs/funnelsgrove/migrations/step-contract-v3.md",
104
- "sha256": "056fccc3085ebde480cf0725fab45410bc369fc1434754cd25187e44d3615e28",
104
+ "sha256": "7993d09cd90636290a43ee9ed0cdebf62a4fea99c77625b7880d2641b6175ba0",
105
105
  "mode": "100644"
106
106
  },
107
107
  {
@@ -126,7 +126,7 @@
126
126
  },
127
127
  {
128
128
  "path": "docs/funnelsgrove/recipes/add-experiment.md",
129
- "sha256": "9918b577f47a9577c3c98d9a6a7a8762ddfeedb667efe13000900d1a1daee1f9",
129
+ "sha256": "7b2d28d84042c7b22f1cc26f0407389c4bfc6d38f82b473cb128a822f750b0d8",
130
130
  "mode": "100644"
131
131
  },
132
132
  {
@@ -236,7 +236,7 @@
236
236
  },
237
237
  {
238
238
  "path": "funnel-docs.config.json",
239
- "sha256": "d3643ea1a8b9c63b28a18465e4afae1771aab6972559828ebf4802c7ad1df8cb",
239
+ "sha256": "dd7eeb6a8028af400f7c28565b622a3ae824e67c9830b71f4c83fbb2487d2159",
240
240
  "mode": "100644"
241
241
  },
242
242
  {
@@ -261,12 +261,12 @@
261
261
  },
262
262
  {
263
263
  "path": "package-lock.json",
264
- "sha256": "0b2debf3c0cb9d605b44ee168f5dec472b4490e11b7399c40c9e5c74654b3c79",
264
+ "sha256": "4d1df3b0e2f67faf62f0f13f7cfacedbcc7a2ada0538b2df245ff474a4b7accb",
265
265
  "mode": "100644"
266
266
  },
267
267
  {
268
268
  "path": "package.json",
269
- "sha256": "f236e5fb6c4c6d1f1b2e25d731caf96be2546d23b189b99e86c9e460172911e0",
269
+ "sha256": "e15293d4839b59fb1d9fbab3ea4e98105a0661eac1d40a4af449265a1b9fb718",
270
270
  "mode": "100644"
271
271
  },
272
272
  {
@@ -926,7 +926,7 @@
926
926
  },
927
927
  {
928
928
  "path": "tests/funnel-agent-docs.test.ts",
929
- "sha256": "53668d24f8f2982900a3ff47ce29646325b57b4e226973b72bd13b9faad086f2",
929
+ "sha256": "e4a3fbae68ca1a11dcd531d8992a84ab416060f50becc5d6d6c4aaf56f931c0e",
930
930
  "mode": "100644"
931
931
  },
932
932
  {
@@ -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/runtime` `0.2.0` first, then `@funnelsgrove/analytics` `0.1.43`, then `@funnelsgrove/payments` `0.2.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.50`. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/runtime` `0.2.0` first, then `@funnelsgrove/analytics` `0.1.44`, then `@funnelsgrove/payments` `0.2.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.53`. 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
@@ -150,7 +150,17 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
150
150
 
151
151
  The stable `id` becomes the experiment key. Keep it unchanged for an exact retry: an identical same-key draft is reused, while a different definition or non-draft experiment is rejected rather than overwritten.
152
152
 
153
- Creation always produces a draft. It does not create or activate a PostHog flag, start traffic, or make unfinished variant steps or offer sets runnable. Activation remains a separate pre-activation UI/API action.
153
+ Creation always produces a draft. It does not create or activate a PostHog flag, start traffic, or make unfinished variant steps or offer sets runnable. After QA, manage traffic through the lifecycle API exposed by the CLI:
154
+
155
+ ```bash
156
+ fgrove experiments start <experiment-uuid>
157
+ fgrove experiments stop <experiment-uuid>
158
+ fgrove experiments restart <experiment-uuid>
159
+ ```
160
+
161
+ `stop` is reversible: it pauses traffic and keeps the experiment, variants, and PostHog flag available for a later `start`. `restart` stops a running experiment when necessary and starts it again while preserving the existing definition. Each command updates PostHog and commits the final experiment status to the hosted generated funnel config. Use `--json` for agent-readable output. Run `fgrove experiments sync` afterward when the local generated config also needs to reflect the lifecycle change.
162
+
163
+ The corresponding authenticated API mutations are `funnelExperiments.start`, `funnelExperiments.stop`, and `funnelExperiments.restart`; each accepts `{ "id": "<experiment-uuid>" }`.
154
164
 
155
165
  The API creates the experiment and variants atomically, commits the matching generated snapshot to the hosted draft, and only then returns. The draft is immediately visible in the FunnelsGrove UI and hosted previews use the same snapshot. The CLI installs the exact returned bytes at `src/config/experiments.generated.ts` and `src/config/experiments.ts`, then updates the sync manifest last. `.funnelsgrove-sync.json` stays local and ignored; never commit or push it.
156
166
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.38",
3
+ "bundleVersion": "2.0.41",
4
4
  "contractSource": "funnelsgrove-repository://apps/funnel-runtime/contracts/step-contract-v2.json",
5
5
  "fullyGenerated": [
6
6
  ".funnelsgrove-docs.json",
@@ -8,7 +8,7 @@
8
8
  "name": "funnel-template",
9
9
  "version": "0.1.0",
10
10
  "dependencies": {
11
- "@funnelsgrove/analytics": "^0.1.43",
11
+ "@funnelsgrove/analytics": "^0.1.44",
12
12
  "@funnelsgrove/payments": "^0.2.0",
13
13
  "@funnelsgrove/runtime": "^0.2.0",
14
14
  "@stripe/react-stripe-js": "^5.6.0",
@@ -891,9 +891,9 @@
891
891
  }
892
892
  },
893
893
  "node_modules/@funnelsgrove/analytics": {
894
- "version": "0.1.43",
895
- "resolved": "https://registry.npmjs.org/@funnelsgrove/analytics/-/analytics-0.1.43.tgz",
896
- "integrity": "sha512-PJp35ncXSR6OPeX5LmKKyTzs1I9CELX5jN6X5DN+7qSf7q5V/OL0dQHj5U1GOzqHpLLkbjL+293Sk/7z/I3Heg==",
894
+ "version": "0.1.44",
895
+ "resolved": "https://registry.npmjs.org/@funnelsgrove/analytics/-/analytics-0.1.44.tgz",
896
+ "integrity": "sha512-pjobnnHWV5ODAftTOXvFbBlDPekfaWHHF1jwTtVFdGfc/RAP3gwObmIoUJMM/BGWBpaDrmQr0xDPobPagATh5A==",
897
897
  "dependencies": {
898
898
  "@funnelsgrove/runtime": "0.2.0"
899
899
  }
@@ -12,7 +12,7 @@
12
12
  "validate:funnel": "vite-node --config src/contract/funnel-validator.vite.config.ts src/contract/validate-funnel.cli.ts"
13
13
  },
14
14
  "dependencies": {
15
- "@funnelsgrove/analytics": "^0.1.43",
15
+ "@funnelsgrove/analytics": "^0.1.44",
16
16
  "@funnelsgrove/payments": "^0.2.0",
17
17
  "@funnelsgrove/runtime": "^0.2.0",
18
18
  "@stripe/react-stripe-js": "^5.6.0",
@@ -362,7 +362,7 @@ describe('funnel agent documentation supply', () => {
362
362
 
363
363
  expect(manifest).toMatchObject({
364
364
  schemaVersion: 1,
365
- bundleVersion: '2.0.38',
365
+ bundleVersion: '2.0.41',
366
366
  stepContractVersion: contract.stepContractVersion,
367
367
  contractHash: contract.contractHash,
368
368
  });