@funnelsgrove/cli 0.1.66 → 0.1.68

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
@@ -30,9 +30,12 @@ fgrove publish --env preview
30
30
  Inside a synced folder, `fgrove` reads `.funnelsgrove-sync.json` first, so you do not need to run `fgrove use` when switching between local funnel directories. Use `fgrove use` only when you want a global fallback context for commands outside a synced folder.
31
31
 
32
32
  `fgrove sync down` refuses to overwrite local changes in an existing synced
33
- folder unless `--force` is passed. If `fgrove sync up` says the remote draft
34
- changed since your local sync, download the latest draft into a clean temporary
35
- directory, merge your local changes, rerun checks, and sync again.
33
+ folder. If `fgrove sync up` says the remote draft changed since your local sync,
34
+ run `fgrove sync rebase`: it performs a three-way merge from the recorded base,
35
+ preserves CLI-managed files, and leaves the working tree untouched when it finds
36
+ conflicts. Review the merged diff, rerun `fgrove validate`, then sync up again.
37
+ `sync down --force` is the explicit discard path and writes an automatic source
38
+ backup under `.funnelsgrove/rebase-backups/` before replacing hosted paths.
36
39
 
37
40
  `fgrove sync up` is for funnels without GitHub source sync. When GitHub is
38
41
  connected, commit and push source changes with normal git, then run `fgrove
package/dist/cli.d.ts CHANGED
@@ -94,7 +94,13 @@ export type StepContractMigrationCommandResult = {
94
94
  exitCode: 0 | 1 | 2;
95
95
  output: string;
96
96
  };
97
- export declare const copyManagedValidationFiles: (targetDir: string, sourceDir?: string) => Promise<void>;
97
+ export declare const copyManagedValidationFiles: (targetDir: string, sourceDir?: string, options?: {
98
+ replaceConflicts?: boolean;
99
+ }) => Promise<void>;
100
+ export declare const repairDownloadedManagedFiles: (targetDir: string, options?: {
101
+ docsSourceDir?: string;
102
+ validationSourceDir?: string;
103
+ }) => Promise<void>;
98
104
  export type BoundedNpmCommandOptions = {
99
105
  timeoutMs?: number;
100
106
  terminationGraceMs?: number;
@@ -145,7 +151,7 @@ type SyncTargetIdInput = {
145
151
  };
146
152
  type GeneratedConfigKind = 'offerSets' | 'experiments';
147
153
  export declare const SYNC_DOWN_GENERATED_CONFIG_KINDS: GeneratedConfigKind[];
148
- export declare const EXPERIMENT_TRANSACTION_RECOVERY_COMMANDS: readonly ["sync down", "sync up", "experiments sync", "offer-sets sync"];
154
+ export declare const EXPERIMENT_TRANSACTION_RECOVERY_COMMANDS: readonly ["sync down", "sync rebase", "sync up", "experiments sync", "offer-sets sync"];
149
155
  export declare function resolveSyncTargetIds(input: SyncTargetIdInput): {
150
156
  workspaceId: string;
151
157
  funnelId?: string;
package/dist/cli.js CHANGED
@@ -11,7 +11,8 @@ import { CURRENT_STEP_CONTRACT_VERSION, FUNNEL_CONTRACT_DIAGNOSTIC_CODES, PREVIO
11
11
  import { abortFunnelSourceCandidate, beginFunnelSourceCandidate, callTrpcProcedure, createFunnelExperimentFromSpec, finalizeFunnelSourceCandidate, stageFunnelSourceCandidate, } from './apiClient.js';
12
12
  import { cliReleaseIdentity } from './cliIdentity.js';
13
13
  import { clearActiveContext, getDefaultAuthConfigPath, loadActiveContext, loadAuthToken, saveActiveContext, saveAuthToken, } from './authStore.js';
14
- import { buildCommittedSyncManifest, buildDownloadedSyncManifest, buildSourceCandidateOperations, collectChangedSourceFiles, collectSourceSnapshot, ensureGitignore, formatSyncUploadSummary, hasLocalSourceChanges, readSyncManifest, runSyncDownLocalLifecycle, runSourceCandidateSync, writeLocalEnvFile, writeSourceFiles, writeSyncManifest, } from './localSync.js';
14
+ import { buildCommittedSyncManifest, buildDownloadedSyncManifest, buildSourceCandidateOperations, collectChangedSourceFiles, collectSourceFiles, collectSourceSnapshot, ensureGitignore, formatSyncUploadSummary, hasLocalSourceChanges, rebaseSourceFiles, readSyncManifest, replaceSourceFiles, runSyncDownLocalLifecycle, runSourceCandidateSync, writeLocalEnvFile, writeSourceFiles, writeSourceRebaseBackup, writeSyncManifest, } from './localSync.js';
15
+ import { mergeTextSourceWithGit } from './sourceRebase.js';
15
16
  import { executeExperimentCreate, formatExperimentCreateSuccess, recoverExperimentCreateTransaction, } from './experimentCreate.js';
16
17
  import { pullEnvFile } from './envSync.js';
17
18
  import { formatGitHubConnectRows, formatGitHubJobRows, formatGitHubStatusRows, } from './githubOutput.js';
@@ -481,7 +482,7 @@ const readTargetRegularFile = async (rootDir, relativePath) => {
481
482
  }
482
483
  return readFile(path.join(rootDir, relativePath));
483
484
  };
484
- export const copyManagedValidationFiles = async (targetDir, sourceDir = resolveTemplateValidationPath()) => {
485
+ export const copyManagedValidationFiles = async (targetDir, sourceDir = resolveTemplateValidationPath(), options = {}) => {
485
486
  const sourcePaths = await listManagedValidatorSourceFiles(sourceDir);
486
487
  const sourceManifestBytes = await readFile(path.join(sourceDir, CONTRACT_TOOLS_MANIFEST_PATH));
487
488
  const sourceManifest = parseContractToolsManifest(sourceManifestBytes, 'FG-DOC-001');
@@ -502,7 +503,7 @@ export const copyManagedValidationFiles = async (targetDir, sourceDir = resolveT
502
503
  sourceFiles.set(entry.path, bytes);
503
504
  }
504
505
  const priorManifestBytes = await readTargetRegularFile(targetDir, CONTRACT_TOOLS_MANIFEST_PATH);
505
- const priorManifest = priorManifestBytes === null
506
+ const priorManifest = priorManifestBytes === null || options.replaceConflicts === true
506
507
  ? null
507
508
  : parseContractToolsManifest(priorManifestBytes, 'FG-DOC-002');
508
509
  const priorHashes = new Map(priorManifest?.managedFiles.map((entry) => [entry.path, entry.sha256]) ?? []);
@@ -512,7 +513,7 @@ export const copyManagedValidationFiles = async (targetDir, sourceDir = resolveT
512
513
  continue;
513
514
  }
514
515
  const currentHash = createHash('sha256').update(currentBytes).digest('hex');
515
- if (priorHashes.get(relativePath) !== currentHash) {
516
+ if (options.replaceConflicts !== true && priorHashes.get(relativePath) !== currentHash) {
516
517
  throw new CliContractError('FG-DOC-002', `Managed validator conflicts with local changes: ${relativePath}`);
517
518
  }
518
519
  }
@@ -523,6 +524,25 @@ export const copyManagedValidationFiles = async (targetDir, sourceDir = resolveT
523
524
  }
524
525
  await writeFile(path.join(targetDir, CONTRACT_TOOLS_MANIFEST_PATH), sourceManifestBytes);
525
526
  };
527
+ export const repairDownloadedManagedFiles = async (targetDir, options = {}) => {
528
+ await copyManagedValidationFiles(targetDir, options.validationSourceDir ?? resolveTemplateValidationPath(), { replaceConflicts: true });
529
+ await recoverTemplateDocs(targetDir);
530
+ const bundle = await loadBundledDocs(options.docsSourceDir ?? resolveTemplateDocsPath());
531
+ const status = planTemplateDocsUpdate(await inspectTemplateDocs(bundle, targetDir));
532
+ for (const conflict of status.files.filter((file) => (file.action === 'conflict' && bundle.files.has(file.path)))) {
533
+ await resolveTemplateDocsConflict(bundle, targetDir, conflict.path);
534
+ }
535
+ };
536
+ const loadManagedSyncPaths = async () => {
537
+ const docsBundle = await loadBundledDocs(resolveTemplateDocsPath());
538
+ const validationManifest = parseContractToolsManifest(await readFile(path.join(resolveTemplateValidationPath(), CONTRACT_TOOLS_MANIFEST_PATH)), 'FG-DOC-001');
539
+ return new Set([
540
+ '.funnelsgrove-docs.json',
541
+ CONTRACT_TOOLS_MANIFEST_PATH,
542
+ ...docsBundle.files.keys(),
543
+ ...validationManifest.managedFiles.map((file) => file.path),
544
+ ]);
545
+ };
526
546
  const MANAGED_VALIDATOR_SCRIPT = 'vite-node --config src/contract/funnel-validator.vite.config.ts src/contract/validate-funnel.cli.ts';
527
547
  const ensureManagedValidatorPackage = async (targetDir) => {
528
548
  const packagePath = path.join(targetDir, 'package.json');
@@ -1051,6 +1071,7 @@ const GENERATED_CONFIG_PATH_BY_KIND = {
1051
1071
  export const SYNC_DOWN_GENERATED_CONFIG_KINDS = ['offerSets'];
1052
1072
  export const EXPERIMENT_TRANSACTION_RECOVERY_COMMANDS = [
1053
1073
  'sync down',
1074
+ 'sync rebase',
1054
1075
  'sync up',
1055
1076
  'experiments sync',
1056
1077
  'offer-sets sync',
@@ -2115,15 +2136,27 @@ addExamples(analyticsCommand
2115
2136
  });
2116
2137
  const syncCommand = addExamples(program.command('sync').description('Sync funnel source'), [
2117
2138
  'fgrove sync down --funnel claimbee-ios --dir ./claimbee-ios',
2139
+ 'fgrove sync rebase --dir ./claimbee-ios',
2118
2140
  'fgrove sync up --message "Update copy"',
2119
2141
  ]);
2142
+ const assertHistoricalSyncBaseline = (input) => {
2143
+ const historical = buildDownloadedSyncManifest({
2144
+ workspaceId: input.manifest.workspaceId,
2145
+ funnelId: input.manifest.funnelId,
2146
+ draftVersionId: input.manifest.draftVersionId,
2147
+ files: input.files,
2148
+ });
2149
+ if (JSON.stringify(historical.files) !== JSON.stringify(input.manifest.files)) {
2150
+ throw Object.assign(new Error('The historical hosted draft no longer matches this local sync baseline. The rebase was not applied; preserve the local directory and contact FunnelsGrove support.'), { code: 'FG-SYNC-REBASE-BASE' });
2151
+ }
2152
+ };
2120
2153
  addExamples(syncCommand
2121
2154
  .command('down')
2122
2155
  .description('Download funnel draft source to a local directory')
2123
2156
  .option('--workspace <id-or-slug-or-name>', 'Workspace id, slug, or name')
2124
2157
  .option('--funnel <id-or-slug>', 'Funnel id or slug')
2125
2158
  .requiredOption('--dir <path>', 'Local target directory')
2126
- .option('--force', 'Overwrite local changes in an existing synced directory'), [
2159
+ .option('--force', 'Replace hosted source paths after saving an automatic local source backup'), [
2127
2160
  'fgrove sync down --funnel claimbee-ios --dir ./claimbee-ios',
2128
2161
  ])
2129
2162
  .action(async (options) => {
@@ -2134,8 +2167,11 @@ addExamples(syncCommand
2134
2167
  funnel: options.funnel,
2135
2168
  dir: options.dir,
2136
2169
  });
2137
- if (!options.force && target.manifest && await hasLocalSourceChanges(target.sourceDir, target.manifest)) {
2138
- throw new Error('Local sync directory has unuploaded changes. Commit, stash, sync up, or merge them before `fgrove sync down`; pass `--force` only if overwriting local changes is intentional.');
2170
+ const hasLocalChanges = target.manifest
2171
+ ? await hasLocalSourceChanges(target.sourceDir, target.manifest)
2172
+ : false;
2173
+ if (!options.force && hasLocalChanges) {
2174
+ throw new Error('Local sync directory has unuploaded changes. Run `fgrove sync rebase --dir <path>` to preserve them, or pass `--force` only if replacing hosted source paths is intentional; force creates an automatic backup.');
2139
2175
  }
2140
2176
  const result = await callApi({
2141
2177
  path: 'funnels.exportSource',
@@ -2152,6 +2188,16 @@ addExamples(syncCommand
2152
2188
  draftVersionId: result.draftVersionId,
2153
2189
  files: result.files,
2154
2190
  });
2191
+ if (options.force && target.manifest && hasLocalChanges) {
2192
+ const localFiles = await collectSourceFiles(target.sourceDir);
2193
+ const backupPath = await writeSourceRebaseBackup({
2194
+ rootDir: target.sourceDir,
2195
+ files: localFiles,
2196
+ manifest: target.manifest,
2197
+ remoteDraftVersionId: result.draftVersionId,
2198
+ });
2199
+ console.log(`Saved the pre-force source backup to ${path.join(target.sourceDir, backupPath)}`);
2200
+ }
2155
2201
  await mkdir(target.sourceDir, { recursive: true });
2156
2202
  await writeSourceFiles(target.sourceDir, result.files);
2157
2203
  const generatedFiles = await syncGeneratedConfigFilesForCli({
@@ -2163,7 +2209,7 @@ addExamples(syncCommand
2163
2209
  await ensureGitignore(target.sourceDir);
2164
2210
  await runSyncDownLocalLifecycle({
2165
2211
  recoverMigration: async () => recoverStepContractV2Migration(target.sourceDir),
2166
- recoverDocs: async () => recoverTemplateDocs(target.sourceDir),
2212
+ recoverDocs: async () => repairDownloadedManagedFiles(target.sourceDir),
2167
2213
  refreshDocs: async () => {
2168
2214
  const docs = await executeDocsCommand({
2169
2215
  targetDir: target.sourceDir,
@@ -2180,6 +2226,115 @@ addExamples(syncCommand
2180
2226
  console.log(`Synced ${result.files.length} files to ${target.sourceDir}`);
2181
2227
  console.log(`Wrote ${formatGeneratedFileCount(generatedFiles.length)}`);
2182
2228
  });
2229
+ addExamples(syncCommand
2230
+ .command('rebase')
2231
+ .description('Merge local source changes onto the latest hosted draft without discarding them')
2232
+ .option('--workspace <id-or-slug-or-name>', 'Workspace id, slug, or name')
2233
+ .option('--funnel <id-or-slug>', 'Funnel id or slug')
2234
+ .option('--dir <path>', 'Local funnel directory', '.'), [
2235
+ 'fgrove sync rebase',
2236
+ 'fgrove sync rebase --dir ./claimbee-ios',
2237
+ ])
2238
+ .action(async (options) => {
2239
+ const token = await readAuthToken();
2240
+ const target = await resolveSyncTarget({
2241
+ token,
2242
+ workspace: options.workspace,
2243
+ funnel: options.funnel,
2244
+ dir: options.dir,
2245
+ });
2246
+ if (!target.manifest) {
2247
+ throw Object.assign(new Error('No local sync baseline found. Run `fgrove sync down` into a new directory before rebasing.'), { code: 'FG-SYNC-REBASE-BASE' });
2248
+ }
2249
+ const remote = await callApi({
2250
+ path: 'funnels.exportSource',
2251
+ type: 'query',
2252
+ token,
2253
+ data: {
2254
+ workspaceId: target.workspaceId,
2255
+ funnelId: target.funnelId,
2256
+ },
2257
+ });
2258
+ if (remote.draftVersionId === target.manifest.draftVersionId) {
2259
+ console.log(`Local source is already based on hosted draft ${remote.draftVersionId}; no rebase is needed.`);
2260
+ return;
2261
+ }
2262
+ const base = await callApi({
2263
+ path: 'funnels.exportSource',
2264
+ type: 'query',
2265
+ token,
2266
+ data: {
2267
+ workspaceId: target.workspaceId,
2268
+ funnelId: target.funnelId,
2269
+ versionId: target.manifest.draftVersionId,
2270
+ },
2271
+ });
2272
+ if (base.draftVersionId !== target.manifest.draftVersionId) {
2273
+ throw Object.assign(new Error('The hosted historical export returned the wrong sync baseline. The rebase was not applied.'), { code: 'FG-SYNC-REBASE-BASE' });
2274
+ }
2275
+ assertHistoricalSyncBaseline({ manifest: target.manifest, files: base.files });
2276
+ const localFiles = await collectSourceFiles(target.sourceDir);
2277
+ const merged = await rebaseSourceFiles({
2278
+ baseFiles: base.files,
2279
+ localFiles,
2280
+ remoteFiles: remote.files,
2281
+ remoteOwnedPaths: await loadManagedSyncPaths(),
2282
+ mergeText: mergeTextSourceWithGit,
2283
+ });
2284
+ if (merged.conflicts.length > 0) {
2285
+ const conflictLines = merged.conflicts.map((conflict) => ` ${conflict.kind.padEnd(15)} ${conflict.path}`);
2286
+ throw Object.assign(new Error([
2287
+ `Rebase found ${merged.conflicts.length} conflicting ${merged.conflicts.length === 1 ? 'path' : 'paths'}; no local files were changed.`,
2288
+ ...conflictLines,
2289
+ 'Resolve these paths against a fresh sync directory, or commit the local work and retry after reconciling the overlapping edits.',
2290
+ ].join('\n')), { code: 'FG-SYNC-REBASE-CONFLICT' });
2291
+ }
2292
+ const backupPath = await writeSourceRebaseBackup({
2293
+ rootDir: target.sourceDir,
2294
+ files: localFiles,
2295
+ manifest: target.manifest,
2296
+ remoteDraftVersionId: remote.draftVersionId,
2297
+ });
2298
+ console.log(`Saved the pre-rebase source backup to ${path.join(target.sourceDir, backupPath)}`);
2299
+ const downloadedSyncManifest = buildDownloadedSyncManifest({
2300
+ workspaceId: target.workspaceId,
2301
+ funnelId: target.funnelId,
2302
+ draftVersionId: remote.draftVersionId,
2303
+ files: remote.files,
2304
+ });
2305
+ await replaceSourceFiles({
2306
+ rootDir: target.sourceDir,
2307
+ currentFiles: localFiles,
2308
+ nextFiles: merged.files,
2309
+ });
2310
+ const generatedFiles = await syncGeneratedConfigFilesForCli({
2311
+ token,
2312
+ target,
2313
+ kinds: SYNC_DOWN_GENERATED_CONFIG_KINDS,
2314
+ });
2315
+ await writeLocalEnvFile(target.sourceDir, remote.envFile);
2316
+ await ensureGitignore(target.sourceDir);
2317
+ await runSyncDownLocalLifecycle({
2318
+ recoverMigration: async () => recoverStepContractV2Migration(target.sourceDir),
2319
+ recoverDocs: async () => repairDownloadedManagedFiles(target.sourceDir),
2320
+ refreshDocs: async () => {
2321
+ const docs = await executeDocsCommand({
2322
+ targetDir: target.sourceDir,
2323
+ options: { json: true },
2324
+ });
2325
+ if (docs.exitCode !== 0) {
2326
+ const output = JSON.parse(docs.output);
2327
+ const diagnostic = output.diagnostics?.[0];
2328
+ throw new CliContractError(diagnostic?.code ?? 'FG-DOC-001', diagnostic?.message ?? 'Managed documentation refresh failed after sync rebase.');
2329
+ }
2330
+ },
2331
+ writeSyncState: async () => writeSyncManifest(target.sourceDir, downloadedSyncManifest),
2332
+ });
2333
+ const localChanges = await collectChangedSourceFiles(target.sourceDir, downloadedSyncManifest);
2334
+ console.log(`Rebased ${localChanges.files.length + localChanges.deletedPaths.length} local changes onto hosted draft ${remote.draftVersionId}.`);
2335
+ console.log(`Wrote ${formatGeneratedFileCount(generatedFiles.length)}`);
2336
+ console.log('Run `fgrove validate`, review the diff, then run `fgrove sync up`.');
2337
+ });
2183
2338
  const envCommand = addExamples(program.command('env').description('Manage local funnel environment files'), [
2184
2339
  'fgrove env pull --dir ./claimbee-ios',
2185
2340
  ]);
@@ -2528,13 +2683,25 @@ addExamples(program
2528
2683
  .command('validate')
2529
2684
  .description('Validate a local funnel against the current authoring contract')
2530
2685
  .option('--dir <path>', 'Local funnel directory', '.')
2686
+ .option('--repair-managed', 'Restore CLI-owned docs and validator files before validation')
2531
2687
  .option('--json', 'Emit one machine-readable validation object'), [
2532
2688
  'fgrove validate',
2689
+ 'fgrove validate --repair-managed',
2533
2690
  'fgrove validate --dir ./claimbee-ios --json',
2534
2691
  ])
2535
2692
  .action(async (options) => {
2693
+ const targetDir = path.resolve(process.cwd(), options.dir);
2694
+ if (options.repairManaged === true) {
2695
+ await repairDownloadedManagedFiles(targetDir);
2696
+ const docs = await executeDocsCommand({ targetDir, options: { json: true } });
2697
+ if (docs.exitCode !== 0) {
2698
+ const output = JSON.parse(docs.output);
2699
+ const diagnostic = output.diagnostics?.[0];
2700
+ throw new CliContractError(diagnostic?.code ?? 'FG-DOC-001', diagnostic?.message ?? 'Managed files could not be repaired.');
2701
+ }
2702
+ }
2536
2703
  const result = await executeValidateCommand({
2537
- targetDir: path.resolve(process.cwd(), options.dir),
2704
+ targetDir,
2538
2705
  json: options.json,
2539
2706
  });
2540
2707
  process.stdout.write(result.output);
@@ -30,6 +30,24 @@ export type SourceFilePatchBatch = {
30
30
  deletedPaths: string[];
31
31
  files: SourceFile[];
32
32
  };
33
+ export type SourceRebaseConflictKind = 'add-add' | 'delete-modify' | 'modify-delete' | 'modify-modify';
34
+ export type SourceRebaseConflict = {
35
+ path: string;
36
+ kind: SourceRebaseConflictKind;
37
+ };
38
+ export type SourceTextMerge = (input: {
39
+ path: string;
40
+ base: string;
41
+ local: string;
42
+ remote: string;
43
+ }) => Promise<{
44
+ content: string;
45
+ clean: boolean;
46
+ }>;
47
+ export type SourceRebaseResult = {
48
+ files: SourceFile[];
49
+ conflicts: SourceRebaseConflict[];
50
+ };
33
51
  export type SourceCandidateOperation = {
34
52
  type: 'create' | 'modify';
35
53
  path: string;
@@ -86,6 +104,7 @@ export type SyncDownLocalLifecycle = {
86
104
  export declare function runSyncDownLocalLifecycle(lifecycle: SyncDownLocalLifecycle): Promise<void>;
87
105
  export declare const assertSafeRootFileWriteTarget: (rootDir: string, relativePath: string) => Promise<void>;
88
106
  export declare const readSafeRootFile: (rootDir: string, relativePath: string) => Promise<Buffer>;
107
+ export declare const removeSafeRootFile: (rootDir: string, relativePath: string) => Promise<void>;
89
108
  export declare const writeSafeRootFile: (rootDir: string, relativePath: string, content: string | Buffer, hooks?: SafeRootWriteHooks) => Promise<void>;
90
109
  export declare function normalizeSyncPath(filePath: string): string;
91
110
  export declare function assertSafeSyncPath(filePath: string): string;
@@ -109,6 +128,24 @@ export declare function collectSourceSnapshot(rootDir: string): Promise<{
109
128
  sourceFiles: SourceFile[];
110
129
  }>;
111
130
  export declare function collectSourceFiles(rootDir: string): Promise<SourceFile[]>;
131
+ export declare function rebaseSourceFiles(input: {
132
+ baseFiles: readonly SourceFile[];
133
+ localFiles: readonly SourceFile[];
134
+ remoteFiles: readonly SourceFile[];
135
+ remoteOwnedPaths?: ReadonlySet<string>;
136
+ mergeText?: SourceTextMerge;
137
+ }): Promise<SourceRebaseResult>;
138
+ export declare function replaceSourceFiles(input: {
139
+ rootDir: string;
140
+ currentFiles: readonly SourceFile[];
141
+ nextFiles: readonly SourceFile[];
142
+ }): Promise<void>;
143
+ export declare function writeSourceRebaseBackup(input: {
144
+ rootDir: string;
145
+ files: readonly SourceFile[];
146
+ manifest: SyncManifest;
147
+ remoteDraftVersionId: string;
148
+ }): Promise<string>;
112
149
  export declare function collectChangedSourceFiles(rootDir: string, previousManifest: SyncManifest): Promise<ChangedSourceFiles>;
113
150
  export declare function hasLocalSourceChanges(rootDir: string, previousManifest: SyncManifest): Promise<boolean>;
114
151
  export declare function chunkChangedSourceFiles(changes: Pick<ChangedSourceFiles, 'deletedPaths' | 'files'>, maxContentChars?: number): SourceFilePatchBatch[];
package/dist/localSync.js CHANGED
@@ -186,6 +186,23 @@ export const readSafeRootFile = async (rootDir, relativePath) => {
186
186
  await handle.close();
187
187
  }
188
188
  };
189
+ export const removeSafeRootFile = async (rootDir, relativePath) => {
190
+ const resolvedRoot = await resolveSafeRoot(rootDir, false);
191
+ const absolutePath = await assertSafeExistingPath(resolvedRoot, relativePath, false, true);
192
+ try {
193
+ const metadata = await lstat(absolutePath);
194
+ if (metadata.isSymbolicLink() || !metadata.isFile()) {
195
+ throw sourceCandidateInvariantError(`Local sync path is not a regular file: ${relativePath}`);
196
+ }
197
+ }
198
+ catch (error) {
199
+ if (isErrno(error, 'ENOENT'))
200
+ return;
201
+ throw error;
202
+ }
203
+ await rm(absolutePath);
204
+ await syncDirectory(path.dirname(absolutePath));
205
+ };
189
206
  export const writeSafeRootFile = async (rootDir, relativePath, content, hooks = {}) => {
190
207
  const resolvedRoot = await resolveSafeRoot(rootDir, true);
191
208
  const absolutePath = await assertSafeExistingPath(resolvedRoot, relativePath, true, false, hooks);
@@ -365,6 +382,119 @@ export async function collectSourceSnapshot(rootDir) {
365
382
  export async function collectSourceFiles(rootDir) {
366
383
  return (await collectSourceSnapshot(rootDir)).sourceFiles;
367
384
  }
385
+ const sourceFileBytes = (file) => (decodeBinarySourceContent(file) ?? Buffer.from(file.content, 'utf8'));
386
+ const sourceFilesEqual = (left, right) => {
387
+ if (!left || !right)
388
+ return left === right;
389
+ return sourceFileBytes(left).equals(sourceFileBytes(right));
390
+ };
391
+ const mapSourceFiles = (files, label) => {
392
+ const output = new Map();
393
+ const pathByFolded = new Map();
394
+ for (const file of files) {
395
+ const filePath = assertSafeSyncTargetPath(file.path);
396
+ const folded = filePath.toLocaleLowerCase('en-US');
397
+ const previousPath = pathByFolded.get(folded);
398
+ if (previousPath) {
399
+ throw sourceCandidateInvariantError(`${label} source repeats or case-collides at: ${previousPath}, ${filePath}`);
400
+ }
401
+ pathByFolded.set(folded, filePath);
402
+ output.set(filePath, file);
403
+ }
404
+ return output;
405
+ };
406
+ const isTextSourceFile = (file) => (decodeBinarySourceContent(file) === null && !Buffer.from(file.content, 'utf8').includes(0));
407
+ export async function rebaseSourceFiles(input) {
408
+ const base = mapSourceFiles(input.baseFiles, 'Base');
409
+ const local = mapSourceFiles(input.localFiles, 'Local');
410
+ const remote = mapSourceFiles(input.remoteFiles, 'Remote');
411
+ const paths = Array.from(new Set([...base.keys(), ...local.keys(), ...remote.keys()]))
412
+ .sort((left, right) => left.localeCompare(right));
413
+ const files = [];
414
+ const conflicts = [];
415
+ for (const filePath of paths) {
416
+ const baseFile = base.get(filePath);
417
+ const localFile = local.get(filePath);
418
+ const remoteFile = remote.get(filePath);
419
+ if (input.remoteOwnedPaths?.has(filePath)) {
420
+ if (remoteFile)
421
+ files.push(remoteFile);
422
+ continue;
423
+ }
424
+ if (sourceFilesEqual(localFile, remoteFile)) {
425
+ if (localFile)
426
+ files.push(localFile);
427
+ continue;
428
+ }
429
+ if (sourceFilesEqual(localFile, baseFile)) {
430
+ if (remoteFile)
431
+ files.push(remoteFile);
432
+ continue;
433
+ }
434
+ if (sourceFilesEqual(remoteFile, baseFile)) {
435
+ if (localFile)
436
+ files.push(localFile);
437
+ continue;
438
+ }
439
+ if (!baseFile) {
440
+ conflicts.push({ path: filePath, kind: 'add-add' });
441
+ continue;
442
+ }
443
+ if (!localFile) {
444
+ conflicts.push({ path: filePath, kind: 'delete-modify' });
445
+ continue;
446
+ }
447
+ if (!remoteFile) {
448
+ conflicts.push({ path: filePath, kind: 'modify-delete' });
449
+ continue;
450
+ }
451
+ if (input.mergeText
452
+ && isTextSourceFile(baseFile)
453
+ && isTextSourceFile(localFile)
454
+ && isTextSourceFile(remoteFile)) {
455
+ const merged = await input.mergeText({
456
+ path: filePath,
457
+ base: sourceFileBytes(baseFile).toString('utf8'),
458
+ local: sourceFileBytes(localFile).toString('utf8'),
459
+ remote: sourceFileBytes(remoteFile).toString('utf8'),
460
+ });
461
+ if (merged.clean) {
462
+ files.push({ path: filePath, content: merged.content, contentType: 'text/plain' });
463
+ continue;
464
+ }
465
+ }
466
+ conflicts.push({ path: filePath, kind: 'modify-modify' });
467
+ }
468
+ return { files, conflicts };
469
+ }
470
+ export async function replaceSourceFiles(input) {
471
+ const current = mapSourceFiles(input.currentFiles, 'Current');
472
+ const next = mapSourceFiles(input.nextFiles, 'Next');
473
+ const deletedPaths = Array.from(current.keys())
474
+ .filter((filePath) => !next.has(filePath))
475
+ .sort((left, right) => left.localeCompare(right));
476
+ for (const filePath of deletedPaths) {
477
+ await removeSafeRootFile(input.rootDir, filePath);
478
+ }
479
+ await writeSourceFiles(input.rootDir, Array.from(next.values()));
480
+ }
481
+ export async function writeSourceRebaseBackup(input) {
482
+ mapSourceFiles(input.files, 'Backup');
483
+ const backupId = `${new Date().toISOString().replace(/[:.]/g, '-')}-${randomUUID()}`;
484
+ const backupRoot = `.funnelsgrove/rebase-backups/${backupId}`;
485
+ for (const file of input.files) {
486
+ await writeSafeRootFile(input.rootDir, `${backupRoot}/source/${file.path}`, sourceFileBytes(file));
487
+ }
488
+ await writeSafeRootFile(input.rootDir, `${backupRoot}/metadata.json`, `${JSON.stringify({
489
+ schemaVersion: 1,
490
+ createdAt: new Date().toISOString(),
491
+ baseDraftVersionId: input.manifest.draftVersionId,
492
+ remoteDraftVersionId: input.remoteDraftVersionId,
493
+ sourcePaths: input.files.map((file) => file.path).sort((left, right) => left.localeCompare(right)),
494
+ syncManifest: input.manifest,
495
+ }, null, 2)}\n`);
496
+ return backupRoot;
497
+ }
368
498
  export async function collectChangedSourceFiles(rootDir, previousManifest) {
369
499
  const currentManifest = await buildSyncManifest(rootDir, {
370
500
  workspaceId: previousManifest.workspaceId,
@@ -0,0 +1,2 @@
1
+ import type { SourceTextMerge } from './localSync.js';
2
+ export declare const mergeTextSourceWithGit: SourceTextMerge;
@@ -0,0 +1,66 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { mkdtemp, rm, writeFile } from 'node:fs/promises';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ const MAX_MERGE_OUTPUT_BYTES = 15 * 1024 * 1024;
6
+ const runGitMergeFile = async (input) => new Promise((resolve, reject) => {
7
+ const child = spawn('git', [
8
+ 'merge-file',
9
+ '--stdout',
10
+ '--diff3',
11
+ '-L', 'LOCAL',
12
+ '-L', 'BASE',
13
+ '-L', 'REMOTE',
14
+ input.localPath,
15
+ input.basePath,
16
+ input.remotePath,
17
+ ], { stdio: ['ignore', 'pipe', 'pipe'] });
18
+ const stdout = [];
19
+ const stderr = [];
20
+ let outputBytes = 0;
21
+ child.stdout.on('data', (chunk) => {
22
+ outputBytes += chunk.length;
23
+ if (outputBytes > MAX_MERGE_OUTPUT_BYTES) {
24
+ child.kill('SIGKILL');
25
+ return;
26
+ }
27
+ stdout.push(chunk);
28
+ });
29
+ child.stderr.on('data', (chunk) => stderr.push(chunk));
30
+ child.once('error', (error) => {
31
+ reject(new Error(error.code === 'ENOENT'
32
+ ? 'fgrove sync rebase requires Git for overlapping text-file changes.'
33
+ : `Unable to run git merge-file: ${error.message}`));
34
+ });
35
+ child.once('close', (code) => {
36
+ if (outputBytes > MAX_MERGE_OUTPUT_BYTES) {
37
+ reject(new Error('Merged file exceeds the 15 MiB safety limit.'));
38
+ return;
39
+ }
40
+ if (code !== 0 && code !== 1) {
41
+ reject(new Error(`git merge-file failed${stderr.length > 0 ? `: ${Buffer.concat(stderr).toString('utf8').trim()}` : '.'}`));
42
+ return;
43
+ }
44
+ resolve({
45
+ content: Buffer.concat(stdout).toString('utf8'),
46
+ clean: code === 0,
47
+ });
48
+ });
49
+ });
50
+ export const mergeTextSourceWithGit = async (input) => {
51
+ const tempDir = await mkdtemp(path.join(os.tmpdir(), 'fgrove-rebase-'));
52
+ const localPath = path.join(tempDir, 'local');
53
+ const basePath = path.join(tempDir, 'base');
54
+ const remotePath = path.join(tempDir, 'remote');
55
+ try {
56
+ await Promise.all([
57
+ writeFile(localPath, input.local),
58
+ writeFile(basePath, input.base),
59
+ writeFile(remotePath, input.remote),
60
+ ]);
61
+ return await runGitMergeFile({ localPath, basePath, remotePath });
62
+ }
63
+ finally {
64
+ await rm(tempDir, { recursive: true, force: true });
65
+ }
66
+ };
@@ -4,10 +4,10 @@
4
4
  "minimumCliVersion": "0.1.20",
5
5
  "entries": [
6
6
  {
7
- "repositoryCliVersion": "0.1.66",
7
+ "repositoryCliVersion": "0.1.68",
8
8
  "manifest": {
9
9
  "schemaVersion": 1,
10
- "bundleVersion": "2.0.55",
10
+ "bundleVersion": "2.0.57",
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": "c27e6c1a0fcf279e9fb36e53249021f46bb99117e7ae1f5cee3d0861b705395f"
48
+ "sha256": "d1defd086fb3d785e49ec5dd2114d493261a3bba14f6f9c4c8cd38285c563056"
49
49
  },
50
50
  {
51
51
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -145,16 +145,16 @@
145
145
  },
146
146
  {
147
147
  "path": "funnel-docs.config.json",
148
- "sha256": "c4c7bf1252585ecc3eaa0d8f93fdb056a50e0d3ded134c2e32a051dabd247959"
148
+ "sha256": "6e29f38b19aaf964d22ad205ca766a7a54c6b5c998892700e16103451adfec43"
149
149
  }
150
150
  ]
151
151
  }
152
152
  },
153
153
  {
154
- "repositoryCliVersion": "0.1.65",
154
+ "repositoryCliVersion": "0.1.67",
155
155
  "manifest": {
156
156
  "schemaVersion": 1,
157
- "bundleVersion": "2.0.54",
157
+ "bundleVersion": "2.0.56",
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": "1efb49d4c6adf05d1d64524110d4a651ad63b32c1862899d10cf4a9a56d50a41"
195
+ "sha256": "3f89ff9d4d5501c6d3562f4d60d5d2fbc46d0069866353d0fe9a899e4690ac24"
196
196
  },
197
197
  {
198
198
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -292,16 +292,16 @@
292
292
  },
293
293
  {
294
294
  "path": "funnel-docs.config.json",
295
- "sha256": "f52545efb1bc7fdf11ae4a792feb3b0eb50c45a01a08036136242bbd483162f2"
295
+ "sha256": "44a40a7630f8ffd287390886d48461cbfb982160daaa9c77a816fbdf446df683"
296
296
  }
297
297
  ]
298
298
  }
299
299
  },
300
300
  {
301
- "repositoryCliVersion": "0.1.64",
301
+ "repositoryCliVersion": "0.1.66",
302
302
  "manifest": {
303
303
  "schemaVersion": 1,
304
- "bundleVersion": "2.0.53",
304
+ "bundleVersion": "2.0.55",
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": "7488bcd0e73a7070aea003f5f5cbb2be59e63fad1e48c32e136c5a2e9f7f5360"
342
+ "sha256": "c27e6c1a0fcf279e9fb36e53249021f46bb99117e7ae1f5cee3d0861b705395f"
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": "cf2e7c92984818a28baa7ee330f5979225dc0b5a66aed8a25ffec89a11137e4b"
442
+ "sha256": "c4c7bf1252585ecc3eaa0d8f93fdb056a50e0d3ded134c2e32a051dabd247959"
443
443
  }
444
444
  ]
445
445
  }
446
446
  },
447
447
  {
448
- "repositoryCliVersion": "0.1.64",
448
+ "repositoryCliVersion": "0.1.65",
449
449
  "manifest": {
450
450
  "schemaVersion": 1,
451
- "bundleVersion": "2.0.52",
451
+ "bundleVersion": "2.0.54",
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": "7488bcd0e73a7070aea003f5f5cbb2be59e63fad1e48c32e136c5a2e9f7f5360"
489
+ "sha256": "1efb49d4c6adf05d1d64524110d4a651ad63b32c1862899d10cf4a9a56d50a41"
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": "63df77a196cbbf761f46bd5256dcca81fa933d49f3faf9f00619b33ec3cbf96a"
589
+ "sha256": "f52545efb1bc7fdf11ae4a792feb3b0eb50c45a01a08036136242bbd483162f2"
590
590
  }
591
591
  ]
592
592
  }
593
593
  },
594
594
  {
595
- "repositoryCliVersion": "0.1.62",
595
+ "repositoryCliVersion": "0.1.64",
596
596
  "manifest": {
597
597
  "schemaVersion": 1,
598
- "bundleVersion": "2.0.51",
598
+ "bundleVersion": "2.0.53",
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": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121"
636
+ "sha256": "7488bcd0e73a7070aea003f5f5cbb2be59e63fad1e48c32e136c5a2e9f7f5360"
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": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc"
736
+ "sha256": "cf2e7c92984818a28baa7ee330f5979225dc0b5a66aed8a25ffec89a11137e4b"
737
737
  }
738
738
  ]
739
739
  }
740
740
  },
741
741
  {
742
- "repositoryCliVersion": "0.1.61",
742
+ "repositoryCliVersion": "0.1.64",
743
743
  "manifest": {
744
744
  "schemaVersion": 1,
745
- "bundleVersion": "2.0.50",
745
+ "bundleVersion": "2.0.52",
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": "88942be6d27cf6f8526d01dfbf143948dd7f82f4b9a17469e18243900a736139"
783
+ "sha256": "7488bcd0e73a7070aea003f5f5cbb2be59e63fad1e48c32e136c5a2e9f7f5360"
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": "a39599a33bdbed2eaa5660371d25912dae392a5cefda40798014bd8b933db50e"
883
+ "sha256": "63df77a196cbbf761f46bd5256dcca81fa933d49f3faf9f00619b33ec3cbf96a"
884
884
  }
885
885
  ]
886
886
  }
887
887
  },
888
888
  {
889
- "repositoryCliVersion": "0.1.60",
889
+ "repositoryCliVersion": "0.1.62",
890
890
  "manifest": {
891
891
  "schemaVersion": 1,
892
- "bundleVersion": "2.0.49",
892
+ "bundleVersion": "2.0.51",
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": "f0294b0f21fc24ab69d2f41917869a885a5901d6138d25df11140174e4fb4e72"
930
+ "sha256": "10cd5853ffbe09a300fe222b18d1f7d7c1dd0f61a02693dd8e6d586b283f2121"
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": "dda3f6d812a18ec6be690f76ba82a520ba9e07b4a23f2278e14a0eecb801c729"
950
+ "sha256": "c63a0f15884b2bf5d65f28d127345bd97641a7b38d047907d6d66f091e15a44a"
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": "70200599749b518b879b32539ea67ada93bd138237c1a5fab57d64203c06cda1"
1030
+ "sha256": "06c7a3e1b2885129c83e8dd405a9d37ef6f87a14702d92c420772e5bf733f9cc"
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.66",
3
+ "version": "0.1.68",
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.55",
3
+ "bundleVersion": "2.0.57",
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": "c27e6c1a0fcf279e9fb36e53249021f46bb99117e7ae1f5cee3d0861b705395f"
41
+ "sha256": "d1defd086fb3d785e49ec5dd2114d493261a3bba14f6f9c4c8cd38285c563056"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "c4c7bf1252585ecc3eaa0d8f93fdb056a50e0d3ded134c2e32a051dabd247959"
141
+ "sha256": "6e29f38b19aaf964d22ad205ca766a7a54c6b5c998892700e16103451adfec43"
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.7.2` first, then `@funnelsgrove/analytics` `0.1.51`, then `@funnelsgrove/payments` `0.7.1`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.66`. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/runtime` `0.7.2` first, then `@funnelsgrove/analytics` `0.1.51`, then `@funnelsgrove/payments` `0.7.1`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.68`. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.55",
3
+ "bundleVersion": "2.0.57",
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.55",
3
+ "bundleVersion": "2.0.57",
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": "c27e6c1a0fcf279e9fb36e53249021f46bb99117e7ae1f5cee3d0861b705395f"
41
+ "sha256": "d1defd086fb3d785e49ec5dd2114d493261a3bba14f6f9c4c8cd38285c563056"
42
42
  },
43
43
  {
44
44
  "path": "docs/funnelsgrove/qa/analytics.md",
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  "path": "funnel-docs.config.json",
141
- "sha256": "c4c7bf1252585ecc3eaa0d8f93fdb056a50e0d3ded134c2e32a051dabd247959"
141
+ "sha256": "6e29f38b19aaf964d22ad205ca766a7a54c6b5c998892700e16103451adfec43"
142
142
  }
143
143
  ]
144
144
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "sourceTreeHash": "2f00440db8705e5bf141bc11b7855a4f699cbf18b4b9fda9a6bdf5b5a454bd41",
3
+ "sourceTreeHash": "673367bb11c9f955f1b3b428596f478b2dad9344d474106a525bfbad43c76c0f",
4
4
  "stepContractVersion": 3,
5
- "docsBundleVersion": "2.0.55",
5
+ "docsBundleVersion": "2.0.57",
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": "56200ed2898a5fca164d6932cc62a440195b3251a85940248b1c7bad9211556c",
19
+ "sha256": "8670d5374613fb4055e850bb7a85da7817aa8613d41ec2859d44ae792bb1440d",
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": "c27e6c1a0fcf279e9fb36e53249021f46bb99117e7ae1f5cee3d0861b705395f",
104
+ "sha256": "d1defd086fb3d785e49ec5dd2114d493261a3bba14f6f9c4c8cd38285c563056",
105
105
  "mode": "100644"
106
106
  },
107
107
  {
@@ -236,7 +236,7 @@
236
236
  },
237
237
  {
238
238
  "path": "funnel-docs.config.json",
239
- "sha256": "c4c7bf1252585ecc3eaa0d8f93fdb056a50e0d3ded134c2e32a051dabd247959",
239
+ "sha256": "6e29f38b19aaf964d22ad205ca766a7a54c6b5c998892700e16103451adfec43",
240
240
  "mode": "100644"
241
241
  },
242
242
  {
@@ -916,7 +916,7 @@
916
916
  },
917
917
  {
918
918
  "path": "tests/funnel-agent-docs.test.ts",
919
- "sha256": "606c5737c5a298507adbda00ab88333152404ee102c73d0f23b85bc87e2675be",
919
+ "sha256": "27c7d7f3fca1dfea5b3884c6f6fcff549f226bc8d69215880edc329757dc5210",
920
920
  "mode": "100644"
921
921
  },
922
922
  {
@@ -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.7.2` first, then `@funnelsgrove/analytics` `0.1.51`, then `@funnelsgrove/payments` `0.7.1`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.66`. Publishing packages and deploying production remain separately approved operational actions.
20
+ Release `@funnelsgrove/runtime` `0.7.2` first, then `@funnelsgrove/analytics` `0.1.51`, then `@funnelsgrove/payments` `0.7.1`. Deploy the API and funnel template, then confirm production `/health` reports the new docs identity. Only then publish `@funnelsgrove/cli` `0.1.68`. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "bundleVersion": "2.0.55",
3
+ "bundleVersion": "2.0.57",
4
4
  "contractSource": "funnelsgrove-repository://apps/funnel-runtime/contracts/step-contract-v2.json",
5
5
  "fullyGenerated": [
6
6
  ".funnelsgrove-docs.json",
@@ -363,7 +363,7 @@ describe('funnel agent documentation supply', () => {
363
363
 
364
364
  expect(manifest).toMatchObject({
365
365
  schemaVersion: 1,
366
- bundleVersion: '2.0.55',
366
+ bundleVersion: '2.0.57',
367
367
  stepContractVersion: contract.stepContractVersion,
368
368
  contractHash: contract.contractHash,
369
369
  });