@funnelsgrove/cli 0.1.59 → 0.1.62
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/dist/cli.js +1 -1
- package/dist/experimentCreate.d.ts +3 -8
- package/dist/experimentCreate.js +19 -18
- package/funnel-contract-compatibility.json +34 -34
- package/package.json +4 -4
- package/template_docs/.funnelsgrove-docs.json +4 -4
- package/template_docs/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_docs/docs/funnelsgrove/recipes/add-experiment.md +8 -9
- package/template_docs/funnel-docs.config.json +1 -1
- package/template_scaffold/.funnelsgrove-contract-tools.json +1 -1
- package/template_scaffold/.funnelsgrove-docs.json +4 -4
- package/template_scaffold/.funnelsgrove-scaffold.json +14 -29
- package/template_scaffold/docs/funnelsgrove/migrations/step-contract-v3.md +1 -1
- package/template_scaffold/docs/funnelsgrove/recipes/add-experiment.md +8 -9
- package/template_scaffold/funnel-docs.config.json +1 -1
- package/template_scaffold/package-lock.json +14 -14
- package/template_scaffold/package.json +3 -3
- package/template_scaffold/src/config/funnel.manifest.ts +2 -2
- package/template_scaffold/src/contract/funnel-project.validation.ts +1 -2
- package/template_scaffold/src/runtime/funnel-runtime.ts +2 -10
- package/template_scaffold/tests/funnel-agent-docs.test.ts +5 -4
- package/template_scaffold/tests/src/contract/funnel-project.validation.test.ts +1 -2
- package/template_validation/.funnelsgrove-contract-tools.json +1 -1
- package/template_validation/src/contract/funnel-project.validation.ts +1 -2
- package/template_scaffold/src/config/experiments.generated.ts +0 -4
- package/template_scaffold/src/config/experiments.ts +0 -9
- package/template_scaffold/tests/src/config/experiments.test.ts +0 -12
package/dist/cli.js
CHANGED
|
@@ -1048,7 +1048,7 @@ const GENERATED_CONFIG_PATH_BY_KIND = {
|
|
|
1048
1048
|
offerSets: 'src/config/offer-sets.generated.ts',
|
|
1049
1049
|
experiments: 'src/config/experiments.generated.ts',
|
|
1050
1050
|
};
|
|
1051
|
-
export const SYNC_DOWN_GENERATED_CONFIG_KINDS = ['offerSets'
|
|
1051
|
+
export const SYNC_DOWN_GENERATED_CONFIG_KINDS = ['offerSets'];
|
|
1052
1052
|
export const EXPERIMENT_TRANSACTION_RECOVERY_COMMANDS = [
|
|
1053
1053
|
'sync down',
|
|
1054
1054
|
'sync up',
|
|
@@ -11,7 +11,7 @@ export type AgentExperimentVariant = {
|
|
|
11
11
|
isControl: boolean;
|
|
12
12
|
};
|
|
13
13
|
export type AgentPricingExperimentVariant = AgentExperimentVariant & {
|
|
14
|
-
|
|
14
|
+
offerSetId: string;
|
|
15
15
|
};
|
|
16
16
|
type SharedAgentExperimentSpec = {
|
|
17
17
|
id: string;
|
|
@@ -47,7 +47,7 @@ export type ExperimentCreateResponse = {
|
|
|
47
47
|
is_control: boolean;
|
|
48
48
|
}>;
|
|
49
49
|
draftVersionId: string;
|
|
50
|
-
generatedFiles: [
|
|
50
|
+
generatedFiles: [];
|
|
51
51
|
githubConnected: boolean;
|
|
52
52
|
};
|
|
53
53
|
export declare class ExperimentCreateContractError extends Error {
|
|
@@ -81,19 +81,14 @@ export type ExperimentCreateSuccess = {
|
|
|
81
81
|
experimentId: string;
|
|
82
82
|
experimentKey: string;
|
|
83
83
|
draftVersionId: string;
|
|
84
|
-
writtenPaths: [
|
|
84
|
+
writtenPaths: [];
|
|
85
85
|
githubConnected: boolean;
|
|
86
86
|
};
|
|
87
87
|
type ExecuteExperimentCreateDependencies = {
|
|
88
88
|
recover: typeof recoverExperimentCreateTransaction;
|
|
89
89
|
readManifest: typeof readSyncManifest;
|
|
90
90
|
readSpec: typeof readAgentExperimentSpec;
|
|
91
|
-
assertGeneratedFilesUnchanged: typeof assertGeneratedExperimentFilesUnchanged;
|
|
92
91
|
parseResponse: typeof parseExperimentCreateResponse;
|
|
93
|
-
install: (sourceDir: string, input: {
|
|
94
|
-
generatedFiles: unknown;
|
|
95
|
-
manifest: SyncManifest;
|
|
96
|
-
}) => Promise<void>;
|
|
97
92
|
};
|
|
98
93
|
export declare function executeExperimentCreate(input: ExecuteExperimentCreateInput, dependencyOverrides?: Partial<ExecuteExperimentCreateDependencies>): Promise<ExperimentCreateSuccess>;
|
|
99
94
|
export declare function formatExperimentCreateSuccess(result: ExperimentCreateSuccess, json: boolean): string;
|
package/dist/experimentCreate.js
CHANGED
|
@@ -11,6 +11,7 @@ export const EXPERIMENT_GENERATED_PATHS = [
|
|
|
11
11
|
];
|
|
12
12
|
const EXPERIMENT_GENERATED_CONTENT_TYPE = 'text/typescript';
|
|
13
13
|
const LOWERCASE_SHA256 = /^[a-f0-9]{64}$/;
|
|
14
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
14
15
|
const EXPERIMENT_METRICS = [
|
|
15
16
|
'step_completion',
|
|
16
17
|
'next_step_reached',
|
|
@@ -54,6 +55,13 @@ const requireString = (value, fieldPath, maxLength) => {
|
|
|
54
55
|
}
|
|
55
56
|
return trimmed;
|
|
56
57
|
};
|
|
58
|
+
const requireUuid = (value, fieldPath) => {
|
|
59
|
+
const parsed = requireString(value, fieldPath, 36);
|
|
60
|
+
if (!UUID_PATTERN.test(parsed)) {
|
|
61
|
+
fail(fieldPath, 'must be a UUID');
|
|
62
|
+
}
|
|
63
|
+
return parsed;
|
|
64
|
+
};
|
|
57
65
|
const requireBoolean = (value, fieldPath) => {
|
|
58
66
|
if (typeof value !== 'boolean') {
|
|
59
67
|
fail(fieldPath, 'must be a boolean');
|
|
@@ -95,7 +103,7 @@ const parseVariant = (value, index, type) => {
|
|
|
95
103
|
'routeToStepId',
|
|
96
104
|
'trafficPercent',
|
|
97
105
|
'isControl',
|
|
98
|
-
...(type === 'pricing' ? ['
|
|
106
|
+
...(type === 'pricing' ? ['offerSetId'] : []),
|
|
99
107
|
];
|
|
100
108
|
assertExactKeys(record, keys, fieldPath);
|
|
101
109
|
const shared = {
|
|
@@ -110,7 +118,7 @@ const parseVariant = (value, index, type) => {
|
|
|
110
118
|
}
|
|
111
119
|
return {
|
|
112
120
|
...shared,
|
|
113
|
-
|
|
121
|
+
offerSetId: requireUuid(record.offerSetId, `${fieldPath}.offerSetId`),
|
|
114
122
|
};
|
|
115
123
|
};
|
|
116
124
|
export function parseAgentExperimentSpec(value) {
|
|
@@ -257,7 +265,7 @@ const expectedConversionConfig = (spec) => (spec.type === 'pricing'
|
|
|
257
265
|
source: 'agent',
|
|
258
266
|
type: 'pricing',
|
|
259
267
|
paywallStepId: spec.stepId,
|
|
260
|
-
|
|
268
|
+
offerSetIds: spec.variants.map((variant) => variant.offerSetId),
|
|
261
269
|
}
|
|
262
270
|
: {
|
|
263
271
|
source: 'agent',
|
|
@@ -343,13 +351,15 @@ export function parseExperimentCreateResponse(value, requestedSpec, expectedFunn
|
|
|
343
351
|
fail('variants', 'must contain unique persisted variant ids');
|
|
344
352
|
}
|
|
345
353
|
const draftVersionId = requireString(response.draftVersionId, 'draftVersionId');
|
|
346
|
-
|
|
354
|
+
if (!Array.isArray(response.generatedFiles) || response.generatedFiles.length !== 0) {
|
|
355
|
+
fail('generatedFiles', 'must be empty because experiments are runtime artifacts');
|
|
356
|
+
}
|
|
347
357
|
const githubConnected = requireBoolean(response.githubConnected, 'githubConnected');
|
|
348
358
|
return {
|
|
349
359
|
experiment: experiment,
|
|
350
360
|
variants,
|
|
351
361
|
draftVersionId,
|
|
352
|
-
generatedFiles,
|
|
362
|
+
generatedFiles: [],
|
|
353
363
|
githubConnected,
|
|
354
364
|
};
|
|
355
365
|
}
|
|
@@ -830,9 +840,7 @@ const executeExperimentCreateDependencies = {
|
|
|
830
840
|
recover: recoverExperimentCreateTransaction,
|
|
831
841
|
readManifest: readSyncManifest,
|
|
832
842
|
readSpec: readAgentExperimentSpec,
|
|
833
|
-
assertGeneratedFilesUnchanged: assertGeneratedExperimentFilesUnchanged,
|
|
834
843
|
parseResponse: parseExperimentCreateResponse,
|
|
835
|
-
install: installExperimentCreateTransaction,
|
|
836
844
|
};
|
|
837
845
|
export async function executeExperimentCreate(input, dependencyOverrides = {}) {
|
|
838
846
|
const dependencies = { ...executeExperimentCreateDependencies, ...dependencyOverrides };
|
|
@@ -842,7 +850,6 @@ export async function executeExperimentCreate(input, dependencyOverrides = {}) {
|
|
|
842
850
|
throw new Error(`No ${SYNC_MANIFEST_FILE} found. Run \`fgrove sync down --dir ${input.sourceDir}\` first.`);
|
|
843
851
|
}
|
|
844
852
|
const spec = await dependencies.readSpec(input.specPath);
|
|
845
|
-
await dependencies.assertGeneratedFilesUnchanged(input.sourceDir, manifest);
|
|
846
853
|
const rawResponse = await input.createFromSpec({
|
|
847
854
|
workspaceId: manifest.workspaceId,
|
|
848
855
|
funnelId: manifest.funnelId,
|
|
@@ -850,17 +857,11 @@ export async function executeExperimentCreate(input, dependencyOverrides = {}) {
|
|
|
850
857
|
spec,
|
|
851
858
|
});
|
|
852
859
|
const response = dependencies.parseResponse(rawResponse, spec, manifest.funnelId);
|
|
853
|
-
await dependencies.assertGeneratedFilesUnchanged(input.sourceDir, manifest);
|
|
854
|
-
const nextManifest = buildExperimentCreateManifest(manifest, response.draftVersionId, response.generatedFiles);
|
|
855
|
-
await dependencies.install(input.sourceDir, {
|
|
856
|
-
generatedFiles: response.generatedFiles,
|
|
857
|
-
manifest: nextManifest,
|
|
858
|
-
});
|
|
859
860
|
return {
|
|
860
861
|
experimentId: response.experiment.id,
|
|
861
862
|
experimentKey: response.experiment.posthog_flag_key,
|
|
862
863
|
draftVersionId: response.draftVersionId,
|
|
863
|
-
writtenPaths: [
|
|
864
|
+
writtenPaths: [],
|
|
864
865
|
githubConnected: response.githubConnected,
|
|
865
866
|
};
|
|
866
867
|
}
|
|
@@ -875,12 +876,12 @@ export function formatExperimentCreateSuccess(result, json) {
|
|
|
875
876
|
return `${JSON.stringify(machineOutput, null, 2)}\n`;
|
|
876
877
|
}
|
|
877
878
|
const guidance = result.githubConnected
|
|
878
|
-
? '
|
|
879
|
-
: 'Run `fgrove sync up`
|
|
879
|
+
? 'The experiment is stored in FunnelsGrove. Commit and push any variant source changes, then run `fgrove github pull`; no generated experiment files were written.'
|
|
880
|
+
: 'The experiment is stored in FunnelsGrove. Run `fgrove sync up` only if the local funnel source also changed; no generated experiment files were written.';
|
|
880
881
|
return [
|
|
881
882
|
`Created experiment ${result.experimentId} (${result.experimentKey})`,
|
|
882
883
|
`Draft version ${result.draftVersionId}`,
|
|
883
|
-
|
|
884
|
+
'Wrote no generated experiment files',
|
|
884
885
|
guidance,
|
|
885
886
|
'',
|
|
886
887
|
].join('\n');
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"minimumCliVersion": "0.1.20",
|
|
5
5
|
"entries": [
|
|
6
6
|
{
|
|
7
|
-
"repositoryCliVersion": "0.1.
|
|
7
|
+
"repositoryCliVersion": "0.1.62",
|
|
8
8
|
"manifest": {
|
|
9
9
|
"schemaVersion": 1,
|
|
10
|
-
"bundleVersion": "2.0.
|
|
10
|
+
"bundleVersion": "2.0.51",
|
|
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": "
|
|
48
|
+
"sha256": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121"
|
|
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": "
|
|
68
|
+
"sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a"
|
|
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": "
|
|
148
|
+
"sha256": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc"
|
|
149
149
|
}
|
|
150
150
|
]
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
|
-
"repositoryCliVersion": "0.1.
|
|
154
|
+
"repositoryCliVersion": "0.1.61",
|
|
155
155
|
"manifest": {
|
|
156
156
|
"schemaVersion": 1,
|
|
157
|
-
"bundleVersion": "2.0.
|
|
157
|
+
"bundleVersion": "2.0.50",
|
|
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": "
|
|
195
|
+
"sha256": "88942be6d27cf6f8526d01dfbf143948dd7f82f4b9a17469e18243900a736139"
|
|
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": "
|
|
215
|
+
"sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a"
|
|
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": "
|
|
295
|
+
"sha256": "a39599a33bdbed2eaa5660371d25912dae392a5cefda40798014bd8b933db50e"
|
|
296
296
|
}
|
|
297
297
|
]
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
|
-
"repositoryCliVersion": "0.1.
|
|
301
|
+
"repositoryCliVersion": "0.1.60",
|
|
302
302
|
"manifest": {
|
|
303
303
|
"schemaVersion": 1,
|
|
304
|
-
"bundleVersion": "2.0.
|
|
304
|
+
"bundleVersion": "2.0.49",
|
|
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": "
|
|
342
|
+
"sha256": "f0294b0f21fc24ab69d2f41917869a885a5901d6138d25df11140174e4fb4e72"
|
|
343
343
|
},
|
|
344
344
|
{
|
|
345
345
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
361
|
"path": "docs/funnelsgrove/recipes/add-experiment.md",
|
|
362
|
-
"sha256": "
|
|
362
|
+
"sha256": "dda3f6d812a18ec6be690f76ba82a520ba9e07b4a23f2278e14a0eecb801c729"
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
365
|
"path": "docs/funnelsgrove/recipes/add-step.md",
|
|
@@ -439,16 +439,16 @@
|
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
"path": "funnel-docs.config.json",
|
|
442
|
-
"sha256": "
|
|
442
|
+
"sha256": "70200599749b518b879b32539ea67ada93bd138237c1a5fab57d64203c06cda1"
|
|
443
443
|
}
|
|
444
444
|
]
|
|
445
445
|
}
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
|
-
"repositoryCliVersion": "0.1.
|
|
448
|
+
"repositoryCliVersion": "0.1.59",
|
|
449
449
|
"manifest": {
|
|
450
450
|
"schemaVersion": 1,
|
|
451
|
-
"bundleVersion": "2.0.
|
|
451
|
+
"bundleVersion": "2.0.48",
|
|
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": "
|
|
489
|
+
"sha256": "ad72376d6e98c3908bc57e6853387008dca3367f9dba2d7b43cdc4b90148ef4e"
|
|
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": "
|
|
589
|
+
"sha256": "9d1cb3d86bb1eaa518d04151829b71bb72c21a13c175fcec5ad798393b2f4340"
|
|
590
590
|
}
|
|
591
591
|
]
|
|
592
592
|
}
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
|
-
"repositoryCliVersion": "0.1.
|
|
595
|
+
"repositoryCliVersion": "0.1.58",
|
|
596
596
|
"manifest": {
|
|
597
597
|
"schemaVersion": 1,
|
|
598
|
-
"bundleVersion": "2.0.
|
|
598
|
+
"bundleVersion": "2.0.47",
|
|
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": "
|
|
636
|
+
"sha256": "4ea96f97ccad5bd9b01f0eeb30936557dec46f9b272599f12f96ffc6bcdc1883"
|
|
637
637
|
},
|
|
638
638
|
{
|
|
639
639
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -653,7 +653,7 @@
|
|
|
653
653
|
},
|
|
654
654
|
{
|
|
655
655
|
"path": "docs/funnelsgrove/recipes/add-experiment.md",
|
|
656
|
-
"sha256": "
|
|
656
|
+
"sha256": "ccc216612e0d532790a81d556111417876b0408944cae0eb8cd13e758a196bb8"
|
|
657
657
|
},
|
|
658
658
|
{
|
|
659
659
|
"path": "docs/funnelsgrove/recipes/add-step.md",
|
|
@@ -733,16 +733,16 @@
|
|
|
733
733
|
},
|
|
734
734
|
{
|
|
735
735
|
"path": "funnel-docs.config.json",
|
|
736
|
-
"sha256": "
|
|
736
|
+
"sha256": "acd7e0c21d82218ed385a5606c1824af2d452368e0e9857cf2b2ddf341f1b855"
|
|
737
737
|
}
|
|
738
738
|
]
|
|
739
739
|
}
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
|
-
"repositoryCliVersion": "0.1.
|
|
742
|
+
"repositoryCliVersion": "0.1.57",
|
|
743
743
|
"manifest": {
|
|
744
744
|
"schemaVersion": 1,
|
|
745
|
-
"bundleVersion": "2.0.
|
|
745
|
+
"bundleVersion": "2.0.46",
|
|
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": "
|
|
783
|
+
"sha256": "f7c68708397ff163bfbb29bf49d3e92a8d043100587efe9401478a2365f797c8"
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -800,7 +800,7 @@
|
|
|
800
800
|
},
|
|
801
801
|
{
|
|
802
802
|
"path": "docs/funnelsgrove/recipes/add-experiment.md",
|
|
803
|
-
"sha256": "
|
|
803
|
+
"sha256": "ccc216612e0d532790a81d556111417876b0408944cae0eb8cd13e758a196bb8"
|
|
804
804
|
},
|
|
805
805
|
{
|
|
806
806
|
"path": "docs/funnelsgrove/recipes/add-step.md",
|
|
@@ -880,16 +880,16 @@
|
|
|
880
880
|
},
|
|
881
881
|
{
|
|
882
882
|
"path": "funnel-docs.config.json",
|
|
883
|
-
"sha256": "
|
|
883
|
+
"sha256": "00a3c1130a35be8d05380788e2d73444c78a65f661eb45963b929b5b7eda005a"
|
|
884
884
|
}
|
|
885
885
|
]
|
|
886
886
|
}
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
|
-
"repositoryCliVersion": "0.1.
|
|
889
|
+
"repositoryCliVersion": "0.1.56",
|
|
890
890
|
"manifest": {
|
|
891
891
|
"schemaVersion": 1,
|
|
892
|
-
"bundleVersion": "2.0.
|
|
892
|
+
"bundleVersion": "2.0.44",
|
|
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": "
|
|
930
|
+
"sha256": "3bec55a8b14cb0c308d83597af78a59e3c5e8056605a0edc11411ee4e9441c93"
|
|
931
931
|
},
|
|
932
932
|
{
|
|
933
933
|
"path": "docs/funnelsgrove/qa/analytics.md",
|
|
@@ -947,7 +947,7 @@
|
|
|
947
947
|
},
|
|
948
948
|
{
|
|
949
949
|
"path": "docs/funnelsgrove/recipes/add-experiment.md",
|
|
950
|
-
"sha256": "
|
|
950
|
+
"sha256": "ccc216612e0d532790a81d556111417876b0408944cae0eb8cd13e758a196bb8"
|
|
951
951
|
},
|
|
952
952
|
{
|
|
953
953
|
"path": "docs/funnelsgrove/recipes/add-step.md",
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
},
|
|
1028
1028
|
{
|
|
1029
1029
|
"path": "funnel-docs.config.json",
|
|
1030
|
-
"sha256": "
|
|
1030
|
+
"sha256": "bcfdb025c8123433ec0c8647fc7f4ce899b49479f91b10d06b354315854302cf"
|
|
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.
|
|
3
|
+
"version": "0.1.62",
|
|
4
4
|
"description": "FunnelsGrove command-line tools for editing, syncing, and publishing funnels",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"test": "vitest run"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@funnelsgrove/runtime": "0.
|
|
37
|
+
"@funnelsgrove/runtime": "0.7.0",
|
|
38
38
|
"commander": "^12.0.0",
|
|
39
39
|
"typescript": "^5.8.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@funnelsgrove/analytics": "0.1.
|
|
43
|
-
"@funnelsgrove/payments": "0.
|
|
42
|
+
"@funnelsgrove/analytics": "0.1.49",
|
|
43
|
+
"@funnelsgrove/payments": "0.7.0",
|
|
44
44
|
"vitest": "^3.0.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.51",
|
|
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": "
|
|
41
|
+
"sha256": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121"
|
|
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": "
|
|
61
|
+
"sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a"
|
|
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": "
|
|
141
|
+
"sha256": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc"
|
|
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.
|
|
20
|
+
Release `@funnelsgrove/runtime` `0.7.0` first, then `@funnelsgrove/analytics` `0.1.49`, then `@funnelsgrove/payments` `0.7.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.62`. 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
|
|
@@ -38,7 +38,7 @@ Use only the documented fields. Unknown top-level and variant fields are rejecte
|
|
|
38
38
|
|
|
39
39
|
All experiment types require non-empty `id`, `name`, and `stepId`; one `primaryMetric`; at least one unique `trackedMetrics` entry containing the primary metric; and two to five variants. Each variant requires a unique non-empty `variantKey`, `label`, and `routeToStepId`, an integer `trafficPercent` from 0 through 100, and `isControl`. Exactly one variant is the control and traffic must total 100.
|
|
40
40
|
|
|
41
|
-
Length limits are enforced after surrounding whitespace is trimmed: `variantKey` is at most 120 characters. `id`, `name`, `stepId`, `label`,
|
|
41
|
+
Length limits are enforced after surrounding whitespace is trimmed: `variantKey` is at most 120 characters. `id`, `name`, `stepId`, `label`, and `routeToStepId` are each at most 200 characters after trimming. Pricing variants additionally require `offerSetId` as a UUID.
|
|
42
42
|
|
|
43
43
|
Metrics are exactly `step_completion`, `next_step_reached`, `checkout_opened`, `funnel_completed`, or `paying_customer`.
|
|
44
44
|
|
|
@@ -112,7 +112,7 @@ Like `step`, every variant has a route target. Use `type: "paywall"` when the ro
|
|
|
112
112
|
|
|
113
113
|
### Pricing experiment
|
|
114
114
|
|
|
115
|
-
Each pricing variant also requires
|
|
115
|
+
Each pricing variant also requires the immutable UUID `offerSetId` of an active offer set in the same project. Every `routeToStepId` must exactly equal the top-level `stepId`.
|
|
116
116
|
|
|
117
117
|
```json
|
|
118
118
|
{
|
|
@@ -132,7 +132,7 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
|
|
|
132
132
|
"routeToStepId": "paywall",
|
|
133
133
|
"trafficPercent": 50,
|
|
134
134
|
"isControl": true,
|
|
135
|
-
"
|
|
135
|
+
"offerSetId": "11111111-1111-4111-8111-111111111111"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"variantKey": "annual_focus",
|
|
@@ -140,7 +140,7 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
|
|
|
140
140
|
"routeToStepId": "paywall",
|
|
141
141
|
"trafficPercent": 50,
|
|
142
142
|
"isControl": false,
|
|
143
|
-
"
|
|
143
|
+
"offerSetId": "22222222-2222-4222-8222-222222222222"
|
|
144
144
|
}
|
|
145
145
|
]
|
|
146
146
|
}
|
|
@@ -160,11 +160,11 @@ fgrove experiments end <experiment-uuid>
|
|
|
160
160
|
fgrove experiments delete <experiment-uuid>
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
`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. `end` permanently archives the experiment; `delete` removes a draft. Each command updates PostHog when required and
|
|
163
|
+
`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. `end` permanently archives the experiment; `delete` removes a draft. Each command updates PostHog when required and persists the final status in the control plane. Use `--json` for agent-readable output.
|
|
164
164
|
|
|
165
165
|
The corresponding authenticated API mutations are agent-only. Normal browser sessions cannot call experiment lifecycle mutations.
|
|
166
166
|
|
|
167
|
-
The API creates the experiment and variants atomically
|
|
167
|
+
The API creates the experiment and variants atomically through ordinary data services. Experiments are stored in the control plane and included in the version-bound runtime artifact when the funnel is published. `src/config/experiments.generated.ts` and `src/config/experiments.ts` are deprecated compatibility files: new funnels and experiment creation do not generate, install, or update them.
|
|
168
168
|
|
|
169
169
|
## Recovery and errors
|
|
170
170
|
|
|
@@ -172,8 +172,7 @@ The API creates the experiment and variants atomically, commits the matching gen
|
|
|
172
172
|
- Invalid local JSON or `[FG-EXPERIMENT-SPEC]`: fix the reported field and retry with the same stable `id`.
|
|
173
173
|
- `[FG-EXPERIMENT-STALE-DRAFT]`: do not overwrite remote work. Download the latest draft into a clean temporary directory, merge deliberately, rerun validation, and retry the same exact spec.
|
|
174
174
|
- `[FG-EXPERIMENT-DRAFT-CONFLICT]`: the stable key already belongs to a different definition, owner, or lifecycle state. Reuse the original exact definition for a retry, or choose a new stable `id` only for a genuinely new experiment.
|
|
175
|
-
-
|
|
176
|
-
- If the API succeeded but the process stopped, retry safely with the same `id`. A ready local journal is automatically recovered before the next create or sync command; an interruption before the journal simply repeats the exact API request.
|
|
175
|
+
- If the API succeeded but the process stopped, retry safely with the same `id`; no source transaction is required.
|
|
177
176
|
|
|
178
177
|
## Validate and deliver
|
|
179
178
|
|
|
@@ -186,7 +185,7 @@ git status --short
|
|
|
186
185
|
|
|
187
186
|
For a funnel without GitHub source sync, deliver all local source changes with `fgrove sync up`.
|
|
188
187
|
|
|
189
|
-
For a GitHub-connected funnel, commit and push the
|
|
188
|
+
For a GitHub-connected funnel, commit and push only the variant step or offer-set source changes, then run `fgrove github pull`. The experiment itself is stored in the control plane and does not create a source file. Never use `fgrove sync up` for the same GitHub-connected diff; `.funnelsgrove-sync.json` stays local and ignored.
|
|
190
189
|
|
|
191
190
|
## Pre-activation QA
|
|
192
191
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"managedFiles": [
|
|
6
6
|
{
|
|
7
7
|
"path": "src/contract/funnel-project.validation.ts",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "99299cfb96414dd24272439cd1c57191a0863749c920a5eb03ff786f7972ab0e"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "src/contract/funnel-validator.vite.config.ts",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"bundleVersion": "2.0.
|
|
3
|
+
"bundleVersion": "2.0.51",
|
|
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": "
|
|
41
|
+
"sha256": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121"
|
|
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": "
|
|
61
|
+
"sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a"
|
|
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": "
|
|
141
|
+
"sha256": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
144
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sourceTreeHash": "
|
|
3
|
+
"sourceTreeHash": "f9b7bcf2ed6d8cbd3e12112af153af6b832d43a6be26364505e65c4c597b9a3a",
|
|
4
4
|
"stepContractVersion": 3,
|
|
5
|
-
"docsBundleVersion": "2.0.
|
|
5
|
+
"docsBundleVersion": "2.0.51",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": ".env.example",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"path": ".funnelsgrove-contract-tools.json",
|
|
14
|
-
"sha256": "
|
|
14
|
+
"sha256": "630aa1d0bdc4fede66d6bc1467bead2b51fd0e060569e3ec392773dce8773566",
|
|
15
15
|
"mode": "100644"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"path": ".funnelsgrove-docs.json",
|
|
19
|
-
"sha256": "
|
|
19
|
+
"sha256": "ed4582b4aa0c6044b8638ec004aaedde53b35836dbe78240a14371e4252e5d70",
|
|
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": "
|
|
104
|
+
"sha256": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121",
|
|
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": "
|
|
129
|
+
"sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a",
|
|
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": "
|
|
239
|
+
"sha256": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc",
|
|
240
240
|
"mode": "100644"
|
|
241
241
|
},
|
|
242
242
|
{
|
|
@@ -261,12 +261,12 @@
|
|
|
261
261
|
},
|
|
262
262
|
{
|
|
263
263
|
"path": "package-lock.json",
|
|
264
|
-
"sha256": "
|
|
264
|
+
"sha256": "2f392e1a5801855e5ff3416da793db39ba95b1647957ddba93e127eb8aedc331",
|
|
265
265
|
"mode": "100644"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"path": "package.json",
|
|
269
|
-
"sha256": "
|
|
269
|
+
"sha256": "28258db9fd734208b0d4cf6755f20f541977c7a0e6f10cc6160f5d22b706fa61",
|
|
270
270
|
"mode": "100644"
|
|
271
271
|
},
|
|
272
272
|
{
|
|
@@ -554,16 +554,6 @@
|
|
|
554
554
|
"sha256": "1a5ac5f14321748a7d19631adf32ca4412f2d129ed31080683ae2e25b21a1ef8",
|
|
555
555
|
"mode": "100644"
|
|
556
556
|
},
|
|
557
|
-
{
|
|
558
|
-
"path": "src/config/experiments.generated.ts",
|
|
559
|
-
"sha256": "f25744dcebf4932ce25f378c76f2bd270c997f7792093b07ed0abdd7c74a1049",
|
|
560
|
-
"mode": "100644"
|
|
561
|
-
},
|
|
562
|
-
{
|
|
563
|
-
"path": "src/config/experiments.ts",
|
|
564
|
-
"sha256": "f008ff0c04a267f03204e34e9d13bc0d897d14053e78287f700801484fc3f937",
|
|
565
|
-
"mode": "100644"
|
|
566
|
-
},
|
|
567
557
|
{
|
|
568
558
|
"path": "src/config/funnel.config.ts",
|
|
569
559
|
"sha256": "6826189cdc984b448b9049d80f94fbe78a96cc6101b868a93554004011a3c424",
|
|
@@ -571,7 +561,7 @@
|
|
|
571
561
|
},
|
|
572
562
|
{
|
|
573
563
|
"path": "src/config/funnel.manifest.ts",
|
|
574
|
-
"sha256": "
|
|
564
|
+
"sha256": "e52fea6fa35fd7ef43835d92ab15a9748ae5356b5d2c8cdee593ef0fa3eca61f",
|
|
575
565
|
"mode": "100644"
|
|
576
566
|
},
|
|
577
567
|
{
|
|
@@ -581,7 +571,7 @@
|
|
|
581
571
|
},
|
|
582
572
|
{
|
|
583
573
|
"path": "src/contract/funnel-project.validation.ts",
|
|
584
|
-
"sha256": "
|
|
574
|
+
"sha256": "99299cfb96414dd24272439cd1c57191a0863749c920a5eb03ff786f7972ab0e",
|
|
585
575
|
"mode": "100644"
|
|
586
576
|
},
|
|
587
577
|
{
|
|
@@ -681,7 +671,7 @@
|
|
|
681
671
|
},
|
|
682
672
|
{
|
|
683
673
|
"path": "src/runtime/funnel-runtime.ts",
|
|
684
|
-
"sha256": "
|
|
674
|
+
"sha256": "4bae48bfc47b38394d39b1f03978d12b3d2e886ea24f212269bc40ee96e6901e",
|
|
685
675
|
"mode": "100644"
|
|
686
676
|
},
|
|
687
677
|
{
|
|
@@ -926,7 +916,7 @@
|
|
|
926
916
|
},
|
|
927
917
|
{
|
|
928
918
|
"path": "tests/funnel-agent-docs.test.ts",
|
|
929
|
-
"sha256": "
|
|
919
|
+
"sha256": "e7d621ad4e17cad954f7de6528f6ca99b7f3c0171e1e159bd2769a05d63f4255",
|
|
930
920
|
"mode": "100644"
|
|
931
921
|
},
|
|
932
922
|
{
|
|
@@ -959,11 +949,6 @@
|
|
|
959
949
|
"sha256": "f91727fc8cbfe09c7aeb48231d0a8f816e87b464d9df4cdca32ac03d95d72c4d",
|
|
960
950
|
"mode": "100644"
|
|
961
951
|
},
|
|
962
|
-
{
|
|
963
|
-
"path": "tests/src/config/experiments.test.ts",
|
|
964
|
-
"sha256": "b50890b91b7bcafd38d61794be56346e882884262140006545b6779038163ef1",
|
|
965
|
-
"mode": "100644"
|
|
966
|
-
},
|
|
967
952
|
{
|
|
968
953
|
"path": "tests/src/config/funnel.manifest.test.ts",
|
|
969
954
|
"sha256": "3fac92396bb0af26be2a9fc2253fd0aad14c89eb94e9a4f08ba720d8411479b6",
|
|
@@ -971,7 +956,7 @@
|
|
|
971
956
|
},
|
|
972
957
|
{
|
|
973
958
|
"path": "tests/src/contract/funnel-project.validation.test.ts",
|
|
974
|
-
"sha256": "
|
|
959
|
+
"sha256": "4a5f0f3b6d11d91b900d8edfffdd7bd4ee63c31014b6093231d0fbd33f8ccc35",
|
|
975
960
|
"mode": "100644"
|
|
976
961
|
},
|
|
977
962
|
{
|
|
@@ -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.
|
|
20
|
+
Release `@funnelsgrove/runtime` `0.7.0` first, then `@funnelsgrove/analytics` `0.1.49`, then `@funnelsgrove/payments` `0.7.0`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.62`. 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
|
|
@@ -38,7 +38,7 @@ Use only the documented fields. Unknown top-level and variant fields are rejecte
|
|
|
38
38
|
|
|
39
39
|
All experiment types require non-empty `id`, `name`, and `stepId`; one `primaryMetric`; at least one unique `trackedMetrics` entry containing the primary metric; and two to five variants. Each variant requires a unique non-empty `variantKey`, `label`, and `routeToStepId`, an integer `trafficPercent` from 0 through 100, and `isControl`. Exactly one variant is the control and traffic must total 100.
|
|
40
40
|
|
|
41
|
-
Length limits are enforced after surrounding whitespace is trimmed: `variantKey` is at most 120 characters. `id`, `name`, `stepId`, `label`,
|
|
41
|
+
Length limits are enforced after surrounding whitespace is trimmed: `variantKey` is at most 120 characters. `id`, `name`, `stepId`, `label`, and `routeToStepId` are each at most 200 characters after trimming. Pricing variants additionally require `offerSetId` as a UUID.
|
|
42
42
|
|
|
43
43
|
Metrics are exactly `step_completion`, `next_step_reached`, `checkout_opened`, `funnel_completed`, or `paying_customer`.
|
|
44
44
|
|
|
@@ -112,7 +112,7 @@ Like `step`, every variant has a route target. Use `type: "paywall"` when the ro
|
|
|
112
112
|
|
|
113
113
|
### Pricing experiment
|
|
114
114
|
|
|
115
|
-
Each pricing variant also requires
|
|
115
|
+
Each pricing variant also requires the immutable UUID `offerSetId` of an active offer set in the same project. Every `routeToStepId` must exactly equal the top-level `stepId`.
|
|
116
116
|
|
|
117
117
|
```json
|
|
118
118
|
{
|
|
@@ -132,7 +132,7 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
|
|
|
132
132
|
"routeToStepId": "paywall",
|
|
133
133
|
"trafficPercent": 50,
|
|
134
134
|
"isControl": true,
|
|
135
|
-
"
|
|
135
|
+
"offerSetId": "11111111-1111-4111-8111-111111111111"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"variantKey": "annual_focus",
|
|
@@ -140,7 +140,7 @@ Each pricing variant also requires a non-empty `offerSetKey`, and every `routeTo
|
|
|
140
140
|
"routeToStepId": "paywall",
|
|
141
141
|
"trafficPercent": 50,
|
|
142
142
|
"isControl": false,
|
|
143
|
-
"
|
|
143
|
+
"offerSetId": "22222222-2222-4222-8222-222222222222"
|
|
144
144
|
}
|
|
145
145
|
]
|
|
146
146
|
}
|
|
@@ -160,11 +160,11 @@ fgrove experiments end <experiment-uuid>
|
|
|
160
160
|
fgrove experiments delete <experiment-uuid>
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
`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. `end` permanently archives the experiment; `delete` removes a draft. Each command updates PostHog when required and
|
|
163
|
+
`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. `end` permanently archives the experiment; `delete` removes a draft. Each command updates PostHog when required and persists the final status in the control plane. Use `--json` for agent-readable output.
|
|
164
164
|
|
|
165
165
|
The corresponding authenticated API mutations are agent-only. Normal browser sessions cannot call experiment lifecycle mutations.
|
|
166
166
|
|
|
167
|
-
The API creates the experiment and variants atomically
|
|
167
|
+
The API creates the experiment and variants atomically through ordinary data services. Experiments are stored in the control plane and included in the version-bound runtime artifact when the funnel is published. `src/config/experiments.generated.ts` and `src/config/experiments.ts` are deprecated compatibility files: new funnels and experiment creation do not generate, install, or update them.
|
|
168
168
|
|
|
169
169
|
## Recovery and errors
|
|
170
170
|
|
|
@@ -172,8 +172,7 @@ The API creates the experiment and variants atomically, commits the matching gen
|
|
|
172
172
|
- Invalid local JSON or `[FG-EXPERIMENT-SPEC]`: fix the reported field and retry with the same stable `id`.
|
|
173
173
|
- `[FG-EXPERIMENT-STALE-DRAFT]`: do not overwrite remote work. Download the latest draft into a clean temporary directory, merge deliberately, rerun validation, and retry the same exact spec.
|
|
174
174
|
- `[FG-EXPERIMENT-DRAFT-CONFLICT]`: the stable key already belongs to a different definition, owner, or lifecycle state. Reuse the original exact definition for a retry, or choose a new stable `id` only for a genuinely new experiment.
|
|
175
|
-
-
|
|
176
|
-
- If the API succeeded but the process stopped, retry safely with the same `id`. A ready local journal is automatically recovered before the next create or sync command; an interruption before the journal simply repeats the exact API request.
|
|
175
|
+
- If the API succeeded but the process stopped, retry safely with the same `id`; no source transaction is required.
|
|
177
176
|
|
|
178
177
|
## Validate and deliver
|
|
179
178
|
|
|
@@ -186,7 +185,7 @@ git status --short
|
|
|
186
185
|
|
|
187
186
|
For a funnel without GitHub source sync, deliver all local source changes with `fgrove sync up`.
|
|
188
187
|
|
|
189
|
-
For a GitHub-connected funnel, commit and push the
|
|
188
|
+
For a GitHub-connected funnel, commit and push only the variant step or offer-set source changes, then run `fgrove github pull`. The experiment itself is stored in the control plane and does not create a source file. Never use `fgrove sync up` for the same GitHub-connected diff; `.funnelsgrove-sync.json` stays local and ignored.
|
|
190
189
|
|
|
191
190
|
## Pre-activation QA
|
|
192
191
|
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"name": "funnel-template",
|
|
9
9
|
"version": "0.1.0",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@funnelsgrove/analytics": "^0.1.
|
|
12
|
-
"@funnelsgrove/payments": "^0.
|
|
13
|
-
"@funnelsgrove/runtime": "^0.
|
|
11
|
+
"@funnelsgrove/analytics": "^0.1.49",
|
|
12
|
+
"@funnelsgrove/payments": "^0.7.0",
|
|
13
|
+
"@funnelsgrove/runtime": "^0.7.0",
|
|
14
14
|
"@stripe/react-stripe-js": "^5.6.0",
|
|
15
15
|
"@stripe/stripe-js": "^8.7.0",
|
|
16
16
|
"lucide-react": "^0.553.0",
|
|
@@ -891,20 +891,20 @@
|
|
|
891
891
|
}
|
|
892
892
|
},
|
|
893
893
|
"node_modules/@funnelsgrove/analytics": {
|
|
894
|
-
"version": "0.1.
|
|
895
|
-
"resolved": "https://registry.npmjs.org/@funnelsgrove/analytics/-/analytics-0.1.
|
|
896
|
-
"integrity": "sha512-
|
|
894
|
+
"version": "0.1.49",
|
|
895
|
+
"resolved": "https://registry.npmjs.org/@funnelsgrove/analytics/-/analytics-0.1.49.tgz",
|
|
896
|
+
"integrity": "sha512-HpPsrP+HVWQj1M+T9wDX8eCBgOTx0ffe29np1BiFwJj/o4QKuu+pT8jTXYMTG/VjqdUQGxU5591H8VmQh/HsOw==",
|
|
897
897
|
"dependencies": {
|
|
898
|
-
"@funnelsgrove/runtime": "0.
|
|
898
|
+
"@funnelsgrove/runtime": "0.7.0"
|
|
899
899
|
}
|
|
900
900
|
},
|
|
901
901
|
"node_modules/@funnelsgrove/payments": {
|
|
902
|
-
"version": "0.
|
|
903
|
-
"resolved": "https://registry.npmjs.org/@funnelsgrove/payments/-/payments-0.
|
|
904
|
-
"integrity": "sha512-
|
|
902
|
+
"version": "0.7.0",
|
|
903
|
+
"resolved": "https://registry.npmjs.org/@funnelsgrove/payments/-/payments-0.7.0.tgz",
|
|
904
|
+
"integrity": "sha512-H44LfRjJdyOpSNgY4VzDsvibqiuqvdflojjg5qoWH5cPT4PuDR6mtV7IUp/xrWcwYQ78uedmesO2T0i4AXENdw==",
|
|
905
905
|
"dependencies": {
|
|
906
906
|
"@funnelsgrove/analytics": "^0.1.28",
|
|
907
|
-
"@funnelsgrove/runtime": "^0.
|
|
907
|
+
"@funnelsgrove/runtime": "^0.7.0",
|
|
908
908
|
"@stripe/react-stripe-js": "^5.6.0",
|
|
909
909
|
"@stripe/stripe-js": "^8.7.0",
|
|
910
910
|
"react": "19.2.3",
|
|
@@ -913,9 +913,9 @@
|
|
|
913
913
|
}
|
|
914
914
|
},
|
|
915
915
|
"node_modules/@funnelsgrove/runtime": {
|
|
916
|
-
"version": "0.
|
|
917
|
-
"resolved": "https://registry.npmjs.org/@funnelsgrove/runtime/-/runtime-0.
|
|
918
|
-
"integrity": "sha512-
|
|
916
|
+
"version": "0.7.0",
|
|
917
|
+
"resolved": "https://registry.npmjs.org/@funnelsgrove/runtime/-/runtime-0.7.0.tgz",
|
|
918
|
+
"integrity": "sha512-CFU89b3ezuVudAmg+SbsNkoxxEhxxj8+6xtZGV0c0vpHs2z5O1CAoTkZW5RTJ6QGvktvr1d+IuRRpxjuU8CqeQ==",
|
|
919
919
|
"dependencies": {
|
|
920
920
|
"posthog-js": "^1.369.2",
|
|
921
921
|
"react": "19.2.3",
|
|
@@ -12,9 +12,9 @@
|
|
|
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.
|
|
16
|
-
"@funnelsgrove/payments": "^0.
|
|
17
|
-
"@funnelsgrove/runtime": "^0.
|
|
15
|
+
"@funnelsgrove/analytics": "^0.1.49",
|
|
16
|
+
"@funnelsgrove/payments": "^0.7.0",
|
|
17
|
+
"@funnelsgrove/runtime": "^0.7.0",
|
|
18
18
|
"@stripe/react-stripe-js": "^5.6.0",
|
|
19
19
|
"@stripe/stripe-js": "^8.7.0",
|
|
20
20
|
"lucide-react": "^0.553.0",
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
CURRENT_STEP_CONTRACT_VERSION,
|
|
4
4
|
DEFAULT_FUNNEL_BREAKPOINTS,
|
|
5
5
|
} from '@funnelsgrove/runtime';
|
|
6
|
-
import { manifestExperiments } from './experiments';
|
|
7
6
|
|
|
8
7
|
export const templateArchitectureVersion = 1;
|
|
9
8
|
|
|
@@ -121,7 +120,8 @@ export const rawFunnelManifest = {
|
|
|
121
120
|
'paywall-b': [{ toStepId: 'subscription-started' }],
|
|
122
121
|
'manage-subscription': [{ toStepId: 'step-1' }],
|
|
123
122
|
},
|
|
124
|
-
|
|
123
|
+
// Experiments are delivered by the version-bound runtime artifact.
|
|
124
|
+
experiments: [],
|
|
125
125
|
} as const satisfies FunnelManifest;
|
|
126
126
|
|
|
127
127
|
// Keep the authored object readable by the project validator. Eager validation
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type FunnelStepMeta,
|
|
7
7
|
} from '@funnelsgrove/runtime';
|
|
8
8
|
import docsManifest from '../../.funnelsgrove-docs.json';
|
|
9
|
-
import { manifestExperiments } from '@/config/experiments';
|
|
10
9
|
import { rawFunnelManifest } from '@/config/funnel.manifest';
|
|
11
10
|
import { stepRegistry } from '@/runtime/step-registry';
|
|
12
11
|
import { contentOptionsByStepId } from '@/steps/step-content.registry';
|
|
@@ -24,7 +23,7 @@ export const buildFunnelProjectSnapshot = (): FunnelStepContractProjectSnapshot
|
|
|
24
23
|
registeredComponentKeys: Object.keys(stepRegistry),
|
|
25
24
|
contentOptionsByStepId,
|
|
26
25
|
edgesByStepId: rawFunnelManifest.edgesByStepId,
|
|
27
|
-
experiments:
|
|
26
|
+
experiments: rawFunnelManifest.experiments,
|
|
28
27
|
docs: {
|
|
29
28
|
schemaVersion: docsManifest.schemaVersion,
|
|
30
29
|
bundleVersion: docsManifest.bundleVersion,
|
|
@@ -18,16 +18,8 @@ export type FunnelExperimentConfig = FunnelManifestExperiment & {
|
|
|
18
18
|
}
|
|
19
19
|
)[];
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...experiment,
|
|
24
|
-
stepId: experiment.stepId as FunnelStepId,
|
|
25
|
-
variants: experiment.variants.map((variant) => ({
|
|
26
|
-
...variant,
|
|
27
|
-
routeToStepId: variant.routeToStepId as FunnelStepId,
|
|
28
|
-
})),
|
|
29
|
-
}),
|
|
30
|
-
);
|
|
21
|
+
/** @deprecated Builder-only fallback. Published experiments come from runtime config. */
|
|
22
|
+
export const funnelExperiments: FunnelExperimentConfig[] = [];
|
|
31
23
|
|
|
32
24
|
export const defaultFunnelStepId: FunnelStepId = funnelStepSequence[0];
|
|
33
25
|
|
|
@@ -254,11 +254,12 @@ describe('funnel agent documentation supply', () => {
|
|
|
254
254
|
expect(content).toContain('fgrove experiments create --spec experiment.json --dir . --json');
|
|
255
255
|
expect(content).toContain('`experimentId`, `experimentKey`, `draftVersionId`, and `writtenPaths`');
|
|
256
256
|
expect(content).toContain(
|
|
257
|
-
'
|
|
257
|
+
'Pricing variants additionally require `offerSetId` as a UUID.',
|
|
258
258
|
);
|
|
259
|
+
expect(content).not.toContain('offerSetKey');
|
|
259
260
|
expect(content).toContain('does not create or activate a PostHog flag');
|
|
260
|
-
expect(content).toContain('
|
|
261
|
-
expect(content).toContain('
|
|
261
|
+
expect(content).toContain('included in the version-bound runtime artifact');
|
|
262
|
+
expect(content).toContain('deprecated compatibility files');
|
|
262
263
|
expect(content).toContain('[FG-EXPERIMENT-STALE-DRAFT]');
|
|
263
264
|
expect(content).toContain('[FG-EXPERIMENT-DRAFT-CONFLICT]');
|
|
264
265
|
expect(content).toContain('[FG-EXPERIMENT-SPEC]');
|
|
@@ -362,7 +363,7 @@ describe('funnel agent documentation supply', () => {
|
|
|
362
363
|
|
|
363
364
|
expect(manifest).toMatchObject({
|
|
364
365
|
schemaVersion: 1,
|
|
365
|
-
bundleVersion: '2.0.
|
|
366
|
+
bundleVersion: '2.0.51',
|
|
366
367
|
stepContractVersion: contract.stepContractVersion,
|
|
367
368
|
contractHash: contract.contractHash,
|
|
368
369
|
});
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type FunnelStepContractProjectSnapshot,
|
|
7
7
|
} from '@funnelsgrove/runtime';
|
|
8
8
|
import docsManifest from '../../../.funnelsgrove-docs.json';
|
|
9
|
-
import { manifestExperiments } from '@/config/experiments';
|
|
10
9
|
import { funnelManifest, rawFunnelManifest } from '@/config/funnel.manifest';
|
|
11
10
|
import { stepRegistry } from '@/runtime/step-registry';
|
|
12
11
|
import { contentOptionsByStepId } from '@/steps/step-content.registry';
|
|
@@ -30,7 +29,7 @@ describe('funnel project validation', () => {
|
|
|
30
29
|
registeredComponentKeys: Object.keys(stepRegistry),
|
|
31
30
|
contentOptionsByStepId,
|
|
32
31
|
edgesByStepId: rawFunnelManifest.edgesByStepId,
|
|
33
|
-
experiments:
|
|
32
|
+
experiments: rawFunnelManifest.experiments,
|
|
34
33
|
docs: {
|
|
35
34
|
schemaVersion: docsManifest.schemaVersion,
|
|
36
35
|
bundleVersion: docsManifest.bundleVersion,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"managedFiles": [
|
|
6
6
|
{
|
|
7
7
|
"path": "src/contract/funnel-project.validation.ts",
|
|
8
|
-
"sha256": "
|
|
8
|
+
"sha256": "99299cfb96414dd24272439cd1c57191a0863749c920a5eb03ff786f7972ab0e"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "src/contract/funnel-validator.vite.config.ts",
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
type FunnelStepMeta,
|
|
7
7
|
} from '@funnelsgrove/runtime';
|
|
8
8
|
import docsManifest from '../../.funnelsgrove-docs.json';
|
|
9
|
-
import { manifestExperiments } from '@/config/experiments';
|
|
10
9
|
import { rawFunnelManifest } from '@/config/funnel.manifest';
|
|
11
10
|
import { stepRegistry } from '@/runtime/step-registry';
|
|
12
11
|
import { contentOptionsByStepId } from '@/steps/step-content.registry';
|
|
@@ -24,7 +23,7 @@ export const buildFunnelProjectSnapshot = (): FunnelStepContractProjectSnapshot
|
|
|
24
23
|
registeredComponentKeys: Object.keys(stepRegistry),
|
|
25
24
|
contentOptionsByStepId,
|
|
26
25
|
edgesByStepId: rawFunnelManifest.edgesByStepId,
|
|
27
|
-
experiments:
|
|
26
|
+
experiments: rawFunnelManifest.experiments,
|
|
28
27
|
docs: {
|
|
29
28
|
schemaVersion: docsManifest.schemaVersion,
|
|
30
29
|
bundleVersion: docsManifest.bundleVersion,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineFunnelExperiments,
|
|
3
|
-
toManifestExperiments,
|
|
4
|
-
} from '@funnelsgrove/runtime';
|
|
5
|
-
import { generatedExperiments } from './experiments.generated';
|
|
6
|
-
|
|
7
|
-
export const experiments = defineFunnelExperiments(generatedExperiments);
|
|
8
|
-
|
|
9
|
-
export const manifestExperiments = toManifestExperiments(experiments);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { experiments, manifestExperiments } from '../../../src/config/experiments';
|
|
3
|
-
|
|
4
|
-
describe('funnel experiments config', () => {
|
|
5
|
-
it('ships the generic template without brand-specific experiments', () => {
|
|
6
|
-
expect(experiments).toEqual([]);
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it('maps code-defined experiments into the runtime manifest shape', () => {
|
|
10
|
-
expect(manifestExperiments).toEqual([]);
|
|
11
|
-
});
|
|
12
|
-
});
|