@databricks-solutions/lakebase-scm-utils 0.3.5 → 0.3.6

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.
Files changed (34) hide show
  1. package/dist/scripts/index.cjs +17 -6
  2. package/dist/scripts/index.js +17 -6
  3. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +2 -2
  4. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +2 -2
  5. package/dist/scripts/lakebase/collapse-heads.cli.cjs +2 -2
  6. package/dist/scripts/lakebase/collapse-heads.cli.js +2 -2
  7. package/dist/scripts/lakebase/detect-language.cli.cjs +2 -2
  8. package/dist/scripts/lakebase/detect-language.cli.js +2 -2
  9. package/dist/scripts/lakebase/doctor.cli.cjs +2 -2
  10. package/dist/scripts/lakebase/doctor.cli.js +2 -2
  11. package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
  12. package/dist/scripts/lakebase/get-connection.cli.js +2 -2
  13. package/dist/scripts/lakebase/index.cjs +17 -6
  14. package/dist/scripts/lakebase/index.js +17 -6
  15. package/dist/scripts/lakebase/infra-runner.cli.cjs +2 -2
  16. package/dist/scripts/lakebase/infra-runner.cli.js +2 -2
  17. package/dist/scripts/lakebase/new-migration.cli.cjs +2 -2
  18. package/dist/scripts/lakebase/new-migration.cli.js +2 -2
  19. package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
  20. package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
  21. package/dist/scripts/lakebase/schema-migrate.cli.cjs +2 -2
  22. package/dist/scripts/lakebase/schema-migrate.cli.js +2 -2
  23. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +2 -2
  24. package/dist/scripts/lakebase/scm-claim-feature.cli.js +2 -2
  25. package/dist/scripts/lakebase/scm-doctor.cli.cjs +2 -2
  26. package/dist/scripts/lakebase/scm-doctor.cli.js +2 -2
  27. package/dist/scripts/lakebase/scm-merge.cli.cjs +2 -2
  28. package/dist/scripts/lakebase/scm-merge.cli.js +2 -2
  29. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +2 -2
  30. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +2 -2
  31. package/dist/scripts/util/index.cjs +2 -2
  32. package/dist/scripts/util/index.js +2 -2
  33. package/package.json +1 -1
  34. package/scripts/lakebase/enable-e2e.ts +34 -4
@@ -88958,8 +88958,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
88958
88958
  var cached;
88959
88959
  function substrateSelfVersion() {
88960
88960
  if (cached !== void 0) return cached;
88961
- if ("0.3.5".length > 0) {
88962
- cached = "0.3.5";
88961
+ if ("0.3.6".length > 0) {
88962
+ cached = "0.3.6";
88963
88963
  return cached;
88964
88964
  }
88965
88965
  cached = "unknown";
@@ -91844,6 +91844,9 @@ function ensurePythonBddDeps(args) {
91844
91844
  }
91845
91845
  var RUN_TESTS_E2E_MARKER = "# run Playwright E2E suite when configured";
91846
91846
  var CLIENT_E2E_MARKER = "# run client Playwright E2E suite when configured";
91847
+ var escapeRe = (s2) => s2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
91848
+ var RUN_TESTS_E2E_MARKER_LINE = new RegExp(`^${escapeRe(RUN_TESTS_E2E_MARKER)}$`, "m");
91849
+ var CLIENT_E2E_MARKER_LINE = new RegExp(`^${escapeRe(CLIENT_E2E_MARKER)}$`, "m");
91847
91850
  function runTestsE2eBlock() {
91848
91851
  return [
91849
91852
  "",
@@ -91935,14 +91938,22 @@ function addE2eToRunTestsScript(args) {
91935
91938
  return { patched: false, inserted: false };
91936
91939
  }
91937
91940
  const original = fs15.readFileSync(scriptPath, "utf8");
91938
- const hasBase = original.includes(RUN_TESTS_E2E_MARKER);
91939
- const hasClient = original.includes(CLIENT_E2E_MARKER);
91941
+ const baseMarker = RUN_TESTS_E2E_MARKER_LINE.exec(original);
91942
+ const hasBase = baseMarker !== null;
91943
+ const hasClient = CLIENT_E2E_MARKER_LINE.test(original);
91940
91944
  if (hasBase && hasClient) {
91941
91945
  return { patched: true, inserted: false };
91942
91946
  }
91943
- const cut = hasBase ? original.slice(0, original.indexOf(RUN_TESTS_E2E_MARKER)) : original;
91947
+ const cut = hasBase ? original.slice(0, baseMarker.index) : original;
91944
91948
  const base = cut.replace(/\n+$/, "\n");
91945
- fs15.writeFileSync(scriptPath, base + runTestsE2eBlock(), "utf8");
91949
+ const assembled = base + runTestsE2eBlock();
91950
+ const BODY_SENTINEL = 'REPO_ROOT="$(cd';
91951
+ if (original.includes(BODY_SENTINEL) && !assembled.includes(BODY_SENTINEL)) {
91952
+ throw new Error(
91953
+ `addE2eToRunTestsScript: refusing to write ${scriptPath} \u2014 the E2E assembly would drop the primary-suite body (REPO_ROOT/pytest/vitest). This is the marker-match clobber; the marker must anchor to the appended block's own line, not a prose mention.`
91954
+ );
91955
+ }
91956
+ fs15.writeFileSync(scriptPath, assembled, "utf8");
91946
91957
  return { patched: true, inserted: true };
91947
91958
  }
91948
91959
  function enableE2eForProject(args) {
@@ -9737,8 +9737,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
9737
9737
  var cached;
9738
9738
  function substrateSelfVersion() {
9739
9739
  if (cached !== void 0) return cached;
9740
- if ("0.3.5".length > 0) {
9741
- cached = "0.3.5";
9740
+ if ("0.3.6".length > 0) {
9741
+ cached = "0.3.6";
9742
9742
  return cached;
9743
9743
  }
9744
9744
  cached = "unknown";
@@ -12623,6 +12623,9 @@ function ensurePythonBddDeps(args) {
12623
12623
  }
12624
12624
  var RUN_TESTS_E2E_MARKER = "# run Playwright E2E suite when configured";
12625
12625
  var CLIENT_E2E_MARKER = "# run client Playwright E2E suite when configured";
12626
+ var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12627
+ var RUN_TESTS_E2E_MARKER_LINE = new RegExp(`^${escapeRe(RUN_TESTS_E2E_MARKER)}$`, "m");
12628
+ var CLIENT_E2E_MARKER_LINE = new RegExp(`^${escapeRe(CLIENT_E2E_MARKER)}$`, "m");
12626
12629
  function runTestsE2eBlock() {
12627
12630
  return [
12628
12631
  "",
@@ -12714,14 +12717,22 @@ function addE2eToRunTestsScript(args) {
12714
12717
  return { patched: false, inserted: false };
12715
12718
  }
12716
12719
  const original = fs14.readFileSync(scriptPath, "utf8");
12717
- const hasBase = original.includes(RUN_TESTS_E2E_MARKER);
12718
- const hasClient = original.includes(CLIENT_E2E_MARKER);
12720
+ const baseMarker = RUN_TESTS_E2E_MARKER_LINE.exec(original);
12721
+ const hasBase = baseMarker !== null;
12722
+ const hasClient = CLIENT_E2E_MARKER_LINE.test(original);
12719
12723
  if (hasBase && hasClient) {
12720
12724
  return { patched: true, inserted: false };
12721
12725
  }
12722
- const cut = hasBase ? original.slice(0, original.indexOf(RUN_TESTS_E2E_MARKER)) : original;
12726
+ const cut = hasBase ? original.slice(0, baseMarker.index) : original;
12723
12727
  const base = cut.replace(/\n+$/, "\n");
12724
- fs14.writeFileSync(scriptPath, base + runTestsE2eBlock(), "utf8");
12728
+ const assembled = base + runTestsE2eBlock();
12729
+ const BODY_SENTINEL = 'REPO_ROOT="$(cd';
12730
+ if (original.includes(BODY_SENTINEL) && !assembled.includes(BODY_SENTINEL)) {
12731
+ throw new Error(
12732
+ `addE2eToRunTestsScript: refusing to write ${scriptPath} \u2014 the E2E assembly would drop the primary-suite body (REPO_ROOT/pytest/vitest). This is the marker-match clobber; the marker must anchor to the appended block's own line, not a prose mention.`
12733
+ );
12734
+ }
12735
+ fs14.writeFileSync(scriptPath, assembled, "utf8");
12725
12736
  return { patched: true, inserted: true };
12726
12737
  }
12727
12738
  function enableE2eForProject(args) {
@@ -79629,8 +79629,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79629
79629
  var cached;
79630
79630
  function substrateSelfVersion() {
79631
79631
  if (cached !== void 0) return cached;
79632
- if ("0.3.5".length > 0) {
79633
- cached = "0.3.5";
79632
+ if ("0.3.6".length > 0) {
79633
+ cached = "0.3.6";
79634
79634
  return cached;
79635
79635
  }
79636
79636
  cached = "unknown";
@@ -721,8 +721,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
721
721
  var cached;
722
722
  function substrateSelfVersion() {
723
723
  if (cached !== void 0) return cached;
724
- if ("0.3.5".length > 0) {
725
- cached = "0.3.5";
724
+ if ("0.3.6".length > 0) {
725
+ cached = "0.3.6";
726
726
  return cached;
727
727
  }
728
728
  cached = "unknown";
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.5".length > 0) {
79294
- cached = "0.3.5";
79293
+ if ("0.3.6".length > 0) {
79294
+ cached = "0.3.6";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.5".length > 0) {
397
- cached = "0.3.5";
396
+ if ("0.3.6".length > 0) {
397
+ cached = "0.3.6";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.5".length > 0) {
79294
- cached = "0.3.5";
79293
+ if ("0.3.6".length > 0) {
79294
+ cached = "0.3.6";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.5".length > 0) {
397
- cached = "0.3.5";
396
+ if ("0.3.6".length > 0) {
397
+ cached = "0.3.6";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -80800,8 +80800,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
80800
80800
  var cached;
80801
80801
  function substrateSelfVersion() {
80802
80802
  if (cached !== void 0) return cached;
80803
- if ("0.3.5".length > 0) {
80804
- cached = "0.3.5";
80803
+ if ("0.3.6".length > 0) {
80804
+ cached = "0.3.6";
80805
80805
  return cached;
80806
80806
  }
80807
80807
  cached = "unknown";
@@ -1959,8 +1959,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
1959
1959
  var cached;
1960
1960
  function substrateSelfVersion() {
1961
1961
  if (cached !== void 0) return cached;
1962
- if ("0.3.5".length > 0) {
1963
- cached = "0.3.5";
1962
+ if ("0.3.6".length > 0) {
1963
+ cached = "0.3.6";
1964
1964
  return cached;
1965
1965
  }
1966
1966
  cached = "unknown";
@@ -79285,8 +79285,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79285
79285
  var cached;
79286
79286
  function substrateSelfVersion() {
79287
79287
  if (cached !== void 0) return cached;
79288
- if ("0.3.5".length > 0) {
79289
- cached = "0.3.5";
79288
+ if ("0.3.6".length > 0) {
79289
+ cached = "0.3.6";
79290
79290
  return cached;
79291
79291
  }
79292
79292
  cached = "unknown";
@@ -389,8 +389,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
389
389
  var cached;
390
390
  function substrateSelfVersion() {
391
391
  if (cached !== void 0) return cached;
392
- if ("0.3.5".length > 0) {
393
- cached = "0.3.5";
392
+ if ("0.3.6".length > 0) {
393
+ cached = "0.3.6";
394
394
  return cached;
395
395
  }
396
396
  cached = "unknown";
@@ -81606,8 +81606,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
81606
81606
  var cached;
81607
81607
  function substrateSelfVersion() {
81608
81608
  if (cached !== void 0) return cached;
81609
- if ("0.3.5".length > 0) {
81610
- cached = "0.3.5";
81609
+ if ("0.3.6".length > 0) {
81610
+ cached = "0.3.6";
81611
81611
  return cached;
81612
81612
  }
81613
81613
  cached = "unknown";
@@ -91433,6 +91433,9 @@ function ensurePythonBddDeps(args) {
91433
91433
  }
91434
91434
  var RUN_TESTS_E2E_MARKER = "# run Playwright E2E suite when configured";
91435
91435
  var CLIENT_E2E_MARKER = "# run client Playwright E2E suite when configured";
91436
+ var escapeRe = (s2) => s2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
91437
+ var RUN_TESTS_E2E_MARKER_LINE = new RegExp(`^${escapeRe(RUN_TESTS_E2E_MARKER)}$`, "m");
91438
+ var CLIENT_E2E_MARKER_LINE = new RegExp(`^${escapeRe(CLIENT_E2E_MARKER)}$`, "m");
91436
91439
  function runTestsE2eBlock() {
91437
91440
  return [
91438
91441
  "",
@@ -91524,14 +91527,22 @@ function addE2eToRunTestsScript(args) {
91524
91527
  return { patched: false, inserted: false };
91525
91528
  }
91526
91529
  const original = fs15.readFileSync(scriptPath, "utf8");
91527
- const hasBase = original.includes(RUN_TESTS_E2E_MARKER);
91528
- const hasClient = original.includes(CLIENT_E2E_MARKER);
91530
+ const baseMarker = RUN_TESTS_E2E_MARKER_LINE.exec(original);
91531
+ const hasBase = baseMarker !== null;
91532
+ const hasClient = CLIENT_E2E_MARKER_LINE.test(original);
91529
91533
  if (hasBase && hasClient) {
91530
91534
  return { patched: true, inserted: false };
91531
91535
  }
91532
- const cut = hasBase ? original.slice(0, original.indexOf(RUN_TESTS_E2E_MARKER)) : original;
91536
+ const cut = hasBase ? original.slice(0, baseMarker.index) : original;
91533
91537
  const base = cut.replace(/\n+$/, "\n");
91534
- fs15.writeFileSync(scriptPath, base + runTestsE2eBlock(), "utf8");
91538
+ const assembled = base + runTestsE2eBlock();
91539
+ const BODY_SENTINEL = 'REPO_ROOT="$(cd';
91540
+ if (original.includes(BODY_SENTINEL) && !assembled.includes(BODY_SENTINEL)) {
91541
+ throw new Error(
91542
+ `addE2eToRunTestsScript: refusing to write ${scriptPath} \u2014 the E2E assembly would drop the primary-suite body (REPO_ROOT/pytest/vitest). This is the marker-match clobber; the marker must anchor to the appended block's own line, not a prose mention.`
91543
+ );
91544
+ }
91545
+ fs15.writeFileSync(scriptPath, assembled, "utf8");
91535
91546
  return { patched: true, inserted: true };
91536
91547
  }
91537
91548
  function enableE2eForProject(args) {
@@ -2521,8 +2521,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
2521
2521
  var cached;
2522
2522
  function substrateSelfVersion() {
2523
2523
  if (cached !== void 0) return cached;
2524
- if ("0.3.5".length > 0) {
2525
- cached = "0.3.5";
2524
+ if ("0.3.6".length > 0) {
2525
+ cached = "0.3.6";
2526
2526
  return cached;
2527
2527
  }
2528
2528
  cached = "unknown";
@@ -12348,6 +12348,9 @@ function ensurePythonBddDeps(args) {
12348
12348
  }
12349
12349
  var RUN_TESTS_E2E_MARKER = "# run Playwright E2E suite when configured";
12350
12350
  var CLIENT_E2E_MARKER = "# run client Playwright E2E suite when configured";
12351
+ var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12352
+ var RUN_TESTS_E2E_MARKER_LINE = new RegExp(`^${escapeRe(RUN_TESTS_E2E_MARKER)}$`, "m");
12353
+ var CLIENT_E2E_MARKER_LINE = new RegExp(`^${escapeRe(CLIENT_E2E_MARKER)}$`, "m");
12351
12354
  function runTestsE2eBlock() {
12352
12355
  return [
12353
12356
  "",
@@ -12439,14 +12442,22 @@ function addE2eToRunTestsScript(args) {
12439
12442
  return { patched: false, inserted: false };
12440
12443
  }
12441
12444
  const original = fs14.readFileSync(scriptPath, "utf8");
12442
- const hasBase = original.includes(RUN_TESTS_E2E_MARKER);
12443
- const hasClient = original.includes(CLIENT_E2E_MARKER);
12445
+ const baseMarker = RUN_TESTS_E2E_MARKER_LINE.exec(original);
12446
+ const hasBase = baseMarker !== null;
12447
+ const hasClient = CLIENT_E2E_MARKER_LINE.test(original);
12444
12448
  if (hasBase && hasClient) {
12445
12449
  return { patched: true, inserted: false };
12446
12450
  }
12447
- const cut = hasBase ? original.slice(0, original.indexOf(RUN_TESTS_E2E_MARKER)) : original;
12451
+ const cut = hasBase ? original.slice(0, baseMarker.index) : original;
12448
12452
  const base = cut.replace(/\n+$/, "\n");
12449
- fs14.writeFileSync(scriptPath, base + runTestsE2eBlock(), "utf8");
12453
+ const assembled = base + runTestsE2eBlock();
12454
+ const BODY_SENTINEL = 'REPO_ROOT="$(cd';
12455
+ if (original.includes(BODY_SENTINEL) && !assembled.includes(BODY_SENTINEL)) {
12456
+ throw new Error(
12457
+ `addE2eToRunTestsScript: refusing to write ${scriptPath} \u2014 the E2E assembly would drop the primary-suite body (REPO_ROOT/pytest/vitest). This is the marker-match clobber; the marker must anchor to the appended block's own line, not a prose mention.`
12458
+ );
12459
+ }
12460
+ fs14.writeFileSync(scriptPath, assembled, "utf8");
12450
12461
  return { patched: true, inserted: true };
12451
12462
  }
12452
12463
  function enableE2eForProject(args) {
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.5".length > 0) {
79294
- cached = "0.3.5";
79293
+ if ("0.3.6".length > 0) {
79294
+ cached = "0.3.6";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.5".length > 0) {
397
- cached = "0.3.5";
396
+ if ("0.3.6".length > 0) {
397
+ cached = "0.3.6";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.5".length > 0) {
79294
- cached = "0.3.5";
79293
+ if ("0.3.6".length > 0) {
79294
+ cached = "0.3.6";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.5".length > 0) {
397
- cached = "0.3.5";
396
+ if ("0.3.6".length > 0) {
397
+ cached = "0.3.6";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -79288,8 +79288,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79288
79288
  var cached;
79289
79289
  function substrateSelfVersion() {
79290
79290
  if (cached !== void 0) return cached;
79291
- if ("0.3.5".length > 0) {
79292
- cached = "0.3.5";
79291
+ if ("0.3.6".length > 0) {
79292
+ cached = "0.3.6";
79293
79293
  return cached;
79294
79294
  }
79295
79295
  cached = "unknown";
@@ -389,8 +389,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
389
389
  var cached;
390
390
  function substrateSelfVersion() {
391
391
  if (cached !== void 0) return cached;
392
- if ("0.3.5".length > 0) {
393
- cached = "0.3.5";
392
+ if ("0.3.6".length > 0) {
393
+ cached = "0.3.6";
394
394
  return cached;
395
395
  }
396
396
  cached = "unknown";
@@ -79324,8 +79324,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79324
79324
  var cached;
79325
79325
  function substrateSelfVersion() {
79326
79326
  if (cached !== void 0) return cached;
79327
- if ("0.3.5".length > 0) {
79328
- cached = "0.3.5";
79327
+ if ("0.3.6".length > 0) {
79328
+ cached = "0.3.6";
79329
79329
  return cached;
79330
79330
  }
79331
79331
  cached = "unknown";
@@ -427,8 +427,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
427
427
  var cached;
428
428
  function substrateSelfVersion() {
429
429
  if (cached !== void 0) return cached;
430
- if ("0.3.5".length > 0) {
431
- cached = "0.3.5";
430
+ if ("0.3.6".length > 0) {
431
+ cached = "0.3.6";
432
432
  return cached;
433
433
  }
434
434
  cached = "unknown";
@@ -79783,8 +79783,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79783
79783
  var cached;
79784
79784
  function substrateSelfVersion() {
79785
79785
  if (cached !== void 0) return cached;
79786
- if ("0.3.5".length > 0) {
79787
- cached = "0.3.5";
79786
+ if ("0.3.6".length > 0) {
79787
+ cached = "0.3.6";
79788
79788
  return cached;
79789
79789
  }
79790
79790
  cached = "unknown";
@@ -864,8 +864,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
864
864
  var cached;
865
865
  function substrateSelfVersion() {
866
866
  if (cached !== void 0) return cached;
867
- if ("0.3.5".length > 0) {
868
- cached = "0.3.5";
867
+ if ("0.3.6".length > 0) {
868
+ cached = "0.3.6";
869
869
  return cached;
870
870
  }
871
871
  cached = "unknown";
@@ -88240,8 +88240,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
88240
88240
  var cached;
88241
88241
  function substrateSelfVersion() {
88242
88242
  if (cached !== void 0) return cached;
88243
- if ("0.3.5".length > 0) {
88244
- cached = "0.3.5";
88243
+ if ("0.3.6".length > 0) {
88244
+ cached = "0.3.6";
88245
88245
  return cached;
88246
88246
  }
88247
88247
  cached = "unknown";
@@ -9393,8 +9393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
9393
9393
  var cached;
9394
9394
  function substrateSelfVersion() {
9395
9395
  if (cached !== void 0) return cached;
9396
- if ("0.3.5".length > 0) {
9397
- cached = "0.3.5";
9396
+ if ("0.3.6".length > 0) {
9397
+ cached = "0.3.6";
9398
9398
  return cached;
9399
9399
  }
9400
9400
  cached = "unknown";
@@ -88825,8 +88825,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
88825
88825
  var cached;
88826
88826
  function substrateSelfVersion() {
88827
88827
  if (cached !== void 0) return cached;
88828
- if ("0.3.5".length > 0) {
88829
- cached = "0.3.5";
88828
+ if ("0.3.6".length > 0) {
88829
+ cached = "0.3.6";
88830
88830
  return cached;
88831
88831
  }
88832
88832
  cached = "unknown";
@@ -9978,8 +9978,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
9978
9978
  var cached;
9979
9979
  function substrateSelfVersion() {
9980
9980
  if (cached !== void 0) return cached;
9981
- if ("0.3.5".length > 0) {
9982
- cached = "0.3.5";
9981
+ if ("0.3.6".length > 0) {
9982
+ cached = "0.3.6";
9983
9983
  return cached;
9984
9984
  }
9985
9985
  cached = "unknown";
@@ -79288,8 +79288,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79288
79288
  var cached;
79289
79289
  function substrateSelfVersion() {
79290
79290
  if (cached !== void 0) return cached;
79291
- if ("0.3.5".length > 0) {
79292
- cached = "0.3.5";
79291
+ if ("0.3.6".length > 0) {
79292
+ cached = "0.3.6";
79293
79293
  return cached;
79294
79294
  }
79295
79295
  cached = "unknown";
@@ -389,8 +389,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
389
389
  var cached;
390
390
  function substrateSelfVersion() {
391
391
  if (cached !== void 0) return cached;
392
- if ("0.3.5".length > 0) {
393
- cached = "0.3.5";
392
+ if ("0.3.6".length > 0) {
393
+ cached = "0.3.6";
394
394
  return cached;
395
395
  }
396
396
  cached = "unknown";
@@ -1667,8 +1667,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
1667
1667
  var cached;
1668
1668
  function substrateSelfVersion() {
1669
1669
  if (cached !== void 0) return cached;
1670
- if ("0.3.5".length > 0) {
1671
- cached = "0.3.5";
1670
+ if ("0.3.6".length > 0) {
1671
+ cached = "0.3.6";
1672
1672
  return cached;
1673
1673
  }
1674
1674
  cached = "unknown";
@@ -1630,8 +1630,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
1630
1630
  var cached;
1631
1631
  function substrateSelfVersion() {
1632
1632
  if (cached !== void 0) return cached;
1633
- if ("0.3.5".length > 0) {
1634
- cached = "0.3.5";
1633
+ if ("0.3.6".length > 0) {
1634
+ cached = "0.3.6";
1635
1635
  return cached;
1636
1636
  }
1637
1637
  cached = "unknown";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databricks-solutions/lakebase-scm-utils",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Lakebase SCM + substrate engine: database branching, paired-branch SCM workflows, connection/credential minting, schema migration, project scaffold + deploy primitives, and the git/github utility layer. Extracted from consort for portable, standalone consumption by lakebase-scm-extension and the SFTDD orchestration.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -202,6 +202,19 @@ const RUN_TESTS_E2E_MARKER = "# run Playwright E2E suite when configured";
202
202
  */
203
203
  const CLIENT_E2E_MARKER = "# run client Playwright E2E suite when configured";
204
204
 
205
+ /**
206
+ * The markers matched ONLY as standalone lines (the appended block's own opening
207
+ * comment lines), never as substrings. The base run-tests.sh TEMPLATE documents the
208
+ * E2E-assembly contract in a header comment that QUOTES RUN_TESTS_E2E_MARKER verbatim
209
+ * inside backticks; a substring `includes`/`indexOf` match there matched the prose
210
+ * mention and truncated the ENTIRE primary-suite body (the run-tests.sh clobber that
211
+ * silently made every honest-GREEN + deploy verify exit 0). A line-anchored (`^…$`,
212
+ * multiline) match only ever finds the real block, never the documentation comment.
213
+ */
214
+ const escapeRe = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
215
+ const RUN_TESTS_E2E_MARKER_LINE = new RegExp(`^${escapeRe(RUN_TESTS_E2E_MARKER)}$`, "m");
216
+ const CLIENT_E2E_MARKER_LINE = new RegExp(`^${escapeRe(CLIENT_E2E_MARKER)}$`, "m");
217
+
205
218
  /** The full E2E block appended to run-tests.sh (project-root layout + Python +
206
219
  * the client-workspace layout). Built once so the fresh-insert and the in-place
207
220
  * upgrade write byte-identical content. */
@@ -307,16 +320,33 @@ export function addE2eToRunTestsScript(
307
320
  return { patched: false, inserted: false };
308
321
  }
309
322
  const original = fs.readFileSync(scriptPath, "utf8");
310
- const hasBase = original.includes(RUN_TESTS_E2E_MARKER);
311
- const hasClient = original.includes(CLIENT_E2E_MARKER);
323
+ // Match markers as standalone LINES, not substrings (see RUN_TESTS_E2E_MARKER_LINE):
324
+ // a prose mention in the template header must never be treated as the block boundary.
325
+ const baseMarker = RUN_TESTS_E2E_MARKER_LINE.exec(original);
326
+ const hasBase = baseMarker !== null;
327
+ const hasClient = CLIENT_E2E_MARKER_LINE.test(original);
312
328
  if (hasBase && hasClient) {
313
329
  return { patched: true, inserted: false }; // already the current block
314
330
  }
315
331
  // Truncate an OLD block (base marker present, client branch missing) so we replace
316
332
  // rather than duplicate; else append to the end after the language-specific suite.
317
- const cut = hasBase ? original.slice(0, original.indexOf(RUN_TESTS_E2E_MARKER)) : original;
333
+ const cut = hasBase ? original.slice(0, baseMarker!.index) : original;
318
334
  const base = cut.replace(/\n+$/, "\n");
319
- fs.writeFileSync(scriptPath, base + runTestsE2eBlock(), "utf8");
335
+ const assembled = base + runTestsE2eBlock();
336
+ // FAIL-CLOSED: never ship a run-tests.sh that lost its primary suite. The base
337
+ // template assigns REPO_ROOT and runs the pytest/vitest body; if the ORIGINAL
338
+ // carried that body but the ASSEMBLED result would not, the cut dropped real
339
+ // content — throw rather than write a hollow, always-exit-0 harness (the clobber
340
+ // defect). A genuinely body-less original (nothing to preserve) is untouched.
341
+ const BODY_SENTINEL = 'REPO_ROOT="$(cd';
342
+ if (original.includes(BODY_SENTINEL) && !assembled.includes(BODY_SENTINEL)) {
343
+ throw new Error(
344
+ `addE2eToRunTestsScript: refusing to write ${scriptPath} — the E2E assembly would drop the ` +
345
+ `primary-suite body (REPO_ROOT/pytest/vitest). This is the marker-match clobber; the marker ` +
346
+ `must anchor to the appended block's own line, not a prose mention.`,
347
+ );
348
+ }
349
+ fs.writeFileSync(scriptPath, assembled, "utf8");
320
350
  return { patched: true, inserted: true };
321
351
  }
322
352