@databricks-solutions/lakebase-scm-utils 0.2.46 → 0.2.48

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 (63) hide show
  1. package/dist/{pr-D3CteJaf.d.cts → pr-e-E4aP4j.d.cts} +6 -0
  2. package/dist/{pr-D3CteJaf.d.ts → pr-e-E4aP4j.d.ts} +6 -0
  3. package/dist/scripts/github/index.cjs +2 -0
  4. package/dist/scripts/github/index.d.cts +1 -1
  5. package/dist/scripts/github/index.d.ts +1 -1
  6. package/dist/scripts/github/index.js +2 -0
  7. package/dist/scripts/github/pr.cli.cjs +2 -0
  8. package/dist/scripts/github/pr.cli.js +2 -0
  9. package/dist/scripts/index.cjs +81 -4
  10. package/dist/scripts/index.d.cts +3 -3
  11. package/dist/scripts/index.d.ts +3 -3
  12. package/dist/scripts/index.js +78 -4
  13. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +2 -2
  14. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +2 -2
  15. package/dist/scripts/lakebase/collapse-heads.cli.cjs +2 -2
  16. package/dist/scripts/lakebase/collapse-heads.cli.js +2 -2
  17. package/dist/scripts/lakebase/detect-language.cli.cjs +2 -2
  18. package/dist/scripts/lakebase/detect-language.cli.js +2 -2
  19. package/dist/scripts/lakebase/doctor.cli.cjs +2 -2
  20. package/dist/scripts/lakebase/doctor.cli.js +2 -2
  21. package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
  22. package/dist/scripts/lakebase/get-connection.cli.js +2 -2
  23. package/dist/scripts/lakebase/index.cjs +87 -4
  24. package/dist/scripts/lakebase/index.d.cts +32 -14
  25. package/dist/scripts/lakebase/index.d.ts +32 -14
  26. package/dist/scripts/lakebase/index.js +86 -4
  27. package/dist/scripts/lakebase/infra-runner.cli.cjs +2 -2
  28. package/dist/scripts/lakebase/infra-runner.cli.js +2 -2
  29. package/dist/scripts/lakebase/new-migration.cli.cjs +2 -2
  30. package/dist/scripts/lakebase/new-migration.cli.js +2 -2
  31. package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
  32. package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
  33. package/dist/scripts/lakebase/schema-migrate.cli.cjs +2 -2
  34. package/dist/scripts/lakebase/schema-migrate.cli.js +2 -2
  35. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +2 -2
  36. package/dist/scripts/lakebase/scm-claim-feature.cli.js +2 -2
  37. package/dist/scripts/lakebase/scm-doctor.cli.cjs +2 -2
  38. package/dist/scripts/lakebase/scm-doctor.cli.js +2 -2
  39. package/dist/scripts/lakebase/scm-merge.cli.cjs +131 -2
  40. package/dist/scripts/lakebase/scm-merge.cli.js +131 -2
  41. package/dist/scripts/lakebase/scm-prepare-pr.cli.cjs +2 -0
  42. package/dist/scripts/lakebase/scm-prepare-pr.cli.js +2 -0
  43. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +2 -2
  44. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +2 -2
  45. package/dist/scripts/lakebase/scm-wait-ci.cli.cjs +8 -0
  46. package/dist/scripts/lakebase/scm-wait-ci.cli.js +8 -0
  47. package/dist/scripts/lakebase/sync-ci-secrets.cli.cjs +8610 -0
  48. package/dist/scripts/lakebase/sync-ci-secrets.cli.d.cts +4 -0
  49. package/dist/scripts/lakebase/sync-ci-secrets.cli.d.ts +4 -0
  50. package/dist/scripts/lakebase/sync-ci-secrets.cli.js +8597 -0
  51. package/dist/scripts/util/index.cjs +21 -2
  52. package/dist/scripts/util/index.d.cts +9 -1
  53. package/dist/scripts/util/index.d.ts +9 -1
  54. package/dist/scripts/util/index.js +19 -2
  55. package/package.json +3 -2
  56. package/scripts/github/pr.ts +8 -0
  57. package/scripts/lakebase/create-project.ts +14 -3
  58. package/scripts/lakebase/scm-merge.ts +91 -0
  59. package/scripts/lakebase/scm-wait-ci.ts +13 -0
  60. package/scripts/lakebase/sync-ci-secrets.cli.ts +122 -0
  61. package/scripts/util/ci-secrets.ts +14 -1
  62. package/templates/project/common/.gitignore.base +4 -0
  63. package/templates/project/common/scripts/lk +22 -4
@@ -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.2.46".length > 0) {
79289
- cached = "0.2.46";
79288
+ if ("0.2.48".length > 0) {
79289
+ cached = "0.2.48";
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.2.46".length > 0) {
393
- cached = "0.2.46";
392
+ if ("0.2.48".length > 0) {
393
+ cached = "0.2.48";
394
394
  return cached;
395
395
  }
396
396
  cached = "unknown";
@@ -79094,6 +79094,7 @@ __export(lakebase_exports, {
79094
79094
  readEnvVar: () => readEnvVar,
79095
79095
  readTargets: () => readTargets,
79096
79096
  readWorkflowState: () => readWorkflowState,
79097
+ reconcilePromoteRunState: () => reconcilePromoteRunState,
79097
79098
  reconcileTierToOrigin: () => reconcileTierToOrigin,
79098
79099
  recoverOrphans: () => recoverOrphans,
79099
79100
  release: () => release,
@@ -81589,8 +81590,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
81589
81590
  var cached;
81590
81591
  function substrateSelfVersion() {
81591
81592
  if (cached !== void 0) return cached;
81592
- if ("0.2.46".length > 0) {
81593
- cached = "0.2.46";
81593
+ if ("0.2.48".length > 0) {
81594
+ cached = "0.2.48";
81594
81595
  return cached;
81595
81596
  }
81596
81597
  cached = "unknown";
@@ -89745,6 +89746,8 @@ async function getPullRequest(ownerRepo, headBranch) {
89745
89746
  isDraft: pr.draft || false,
89746
89747
  ciStatus,
89747
89748
  checks,
89749
+ mergeable: pr.mergeable,
89750
+ mergeableState: pr.mergeable_state,
89748
89751
  headBranch: pr.head?.ref || headBranch,
89749
89752
  baseBranch: pr.base?.ref || "",
89750
89753
  body: pr.body || void 0,
@@ -91993,6 +91996,16 @@ async function setRepoSecrets(ownerRepo, secrets) {
91993
91996
  await setRepoSecret(ownerRepo, name, value);
91994
91997
  }
91995
91998
  }
91999
+ async function listSecretNames(ownerRepo) {
92000
+ try {
92001
+ const { owner, repo } = parseOwnerRepo(ownerRepo);
92002
+ const octokit2 = await getOctokit2();
92003
+ const { data } = await octokit2.rest.actions.listRepoSecrets({ owner, repo });
92004
+ return data.secrets.map((s2) => s2.name);
92005
+ } catch {
92006
+ return [];
92007
+ }
92008
+ }
91996
92009
 
91997
92010
  // scripts/git/remote.ts
91998
92011
  init_cjs_shims();
@@ -92032,6 +92045,11 @@ async function getOwnerRepo(cwd) {
92032
92045
  }
92033
92046
 
92034
92047
  // scripts/util/ci-secrets.ts
92048
+ var REQUIRED_CI_SECRETS = ["DATABRICKS_HOST", "LAKEBASE_PROJECT_ID", "DATABRICKS_TOKEN"];
92049
+ async function missingCiSecrets(ownerRepo) {
92050
+ const present = new Set(await listSecretNames(ownerRepo));
92051
+ return REQUIRED_CI_SECRETS.filter((n) => !present.has(n));
92052
+ }
92035
92053
  async function syncCiSecrets(args) {
92036
92054
  const lifetime = args.lifetimeSeconds ?? 86400;
92037
92055
  const comment = args.comment ?? "GitHub Actions CI";
@@ -92548,10 +92566,17 @@ Last probe error:
92548
92566
  lifetimeSeconds: 86400,
92549
92567
  ownerRepo: fullRepoName
92550
92568
  });
92569
+ const missing = await missingCiSecrets(fullRepoName);
92570
+ if (missing.length > 0) {
92571
+ const m2 = `CI auth incomplete \u2014 repo secret(s) MISSING: ${missing.join(", ")}. CI cannot provision a per-PR Lakebase branch until fixed. Repair with: lakebase-sync-ci-secrets (run in the project).`;
92572
+ warnings.push(m2);
92573
+ report(`WARNING: ${m2}`);
92574
+ }
92551
92575
  } catch (err) {
92552
92576
  const msg = err instanceof Error ? err.message : String(err);
92553
- warnings.push(`CI auth setup failed: ${msg}`);
92554
- report(`Warning: CI auth setup failed (${msg})`);
92577
+ const m2 = `CI auth setup failed: ${msg}. CI will fail (no DATABASE_URL) until repaired \u2014 run: lakebase-sync-ci-secrets (in the project).`;
92578
+ warnings.push(m2);
92579
+ report(`WARNING: ${m2}`);
92555
92580
  }
92556
92581
  }
92557
92582
  if (useGithub && runnerType === "self-hosted") {
@@ -94903,6 +94928,12 @@ async function waitForCi(args) {
94903
94928
  if (lastPr.ciStatus === "success") {
94904
94929
  return { done: true, value: lastPr };
94905
94930
  }
94931
+ if (lastPr.mergeableState === "dirty" && lastPr.checks.length === 0) {
94932
+ throw new ScmWaitCiError(
94933
+ `PR ${lastPr.url} is CONFLICTING with ${lastPr.baseBranch} \u2014 GitHub will not dispatch CI (0 runs) until the conflict is resolved. Reconcile the branch and re-push; the synchronize event will trigger CI.`,
94934
+ "pr-conflicting"
94935
+ );
94936
+ }
94906
94937
  if (lastPr.ciStatus === "failure") {
94907
94938
  const failed = lastPr.checks.filter((c) => /(FAILURE|TIMED_OUT|CANCELLED|ACTION_REQUIRED)/i.test(c.conclusion)).map((c) => `${c.name} (${c.conclusion})`);
94908
94939
  throw new ScmWaitCiError(
@@ -95282,6 +95313,48 @@ function shaMigratePredicate(mergeCommitSha) {
95282
95313
  return !!run.headSha && run.headSha === mergeCommitSha;
95283
95314
  };
95284
95315
  }
95316
+ var PROMOTE_RUNSTATE_CONFLICT = /(^|\/)\.consort\/(features\/[^/]+\/)?pipeline\.json$/;
95317
+ async function reconcilePromoteRunState(projectDir, baseBranch) {
95318
+ const o = { cwd: projectDir, timeout: 3e4 };
95319
+ const dirty = (await exec2("git status --porcelain", o).catch(() => "")).split("\n").map((l) => l.slice(3).trim()).filter(Boolean);
95320
+ const nonRunStateDirty = dirty.filter((p) => !p.startsWith(".consort/"));
95321
+ if (nonRunStateDirty.length > 0) {
95322
+ throw new ScmMergeError(
95323
+ `working tree has uncommitted non-run-state changes (${nonRunStateDirty.slice(0, 5).join(", ")}${nonRunStateDirty.length > 5 ? ", \u2026" : ""}); commit or stash before promoting.`,
95324
+ "promote-conflict"
95325
+ );
95326
+ }
95327
+ if (dirty.length > 0) {
95328
+ await exec2(`git add ${shellEscape2(".consort")}`, o);
95329
+ await exec2(`git commit -m ${shellEscape2("chore(run): checkpoint run state before promotion")}`, o);
95330
+ }
95331
+ await exec2(`git fetch origin ${shellEscape2(baseBranch)}`, o).catch(() => {
95332
+ });
95333
+ let conflicted = false;
95334
+ try {
95335
+ await exec2(`git merge --no-ff -m ${shellEscape2(`merge ${baseBranch} for promotion`)} ${shellEscape2(`origin/${baseBranch}`)}`, o);
95336
+ } catch {
95337
+ conflicted = true;
95338
+ }
95339
+ if (!conflicted) return { reconciled: false };
95340
+ const u = (await exec2("git diff --name-only --diff-filter=U", o).catch(() => "")).split("\n").map((s2) => s2.trim()).filter(Boolean);
95341
+ const other = u.filter((p) => !PROMOTE_RUNSTATE_CONFLICT.test(p));
95342
+ if (u.length === 0 || other.length > 0) {
95343
+ await exec2("git merge --abort", o).catch(() => {
95344
+ });
95345
+ throw new ScmMergeError(
95346
+ other.length > 0 ? `promotion conflicts on non-ledger file(s): ${other.join(", ")}. Resolve the real divergence manually, then re-run the promote.` : `promotion merge failed with no resolvable conflicts; resolve manually and re-run.`,
95347
+ "promote-conflict"
95348
+ );
95349
+ }
95350
+ for (const p of u) {
95351
+ await exec2(`git checkout --ours -- ${shellEscape2(p)}`, o);
95352
+ await exec2(`git add -- ${shellEscape2(p)}`, o);
95353
+ }
95354
+ await exec2(`git commit -m ${shellEscape2(`merge ${baseBranch} for promotion (pipeline.json ledger kept at run state)`)}`, o);
95355
+ await pushCurrentBranchForPr({ cwd: projectDir });
95356
+ return { reconciled: true, detail: `reconciled ${u.length} ledger path(s) to the run side + pushed` };
95357
+ }
95285
95358
  async function defaultRefreshPromoteWorkflows(projectDir) {
95286
95359
  const drift = detectWorkflowDrift({ projectDir });
95287
95360
  const touched = drift.files.filter((f3) => f3.status === "drifted").map((f3) => f3.name);
@@ -95371,6 +95444,15 @@ async function mergeFeature(args) {
95371
95444
  );
95372
95445
  }
95373
95446
  }
95447
+ {
95448
+ const fetchState = args.fetchPrState ?? ((o, h2) => getPullRequest(o, h2));
95449
+ const prState = await fetchState(ownerRepo, current.branch).catch(() => void 0);
95450
+ if (prState?.mergeableState === "dirty") {
95451
+ const reconcile = args.reconcileRunState ?? ((base) => reconcilePromoteRunState(args.projectDir, base));
95452
+ const r2 = await reconcile(gitBase);
95453
+ if (r2.reconciled) preflightNotes.push(`Reconciled a pipeline.json-ledger promotion conflict to the run side${r2.detail ? ` (${r2.detail})` : ""}.`);
95454
+ }
95455
+ }
95374
95456
  let paired;
95375
95457
  try {
95376
95458
  paired = await mergePairedPullRequest({
@@ -96993,6 +97075,7 @@ function isUcMissingError(msg) {
96993
97075
  readEnvVar,
96994
97076
  readTargets,
96995
97077
  readWorkflowState,
97078
+ reconcilePromoteRunState,
96996
97079
  reconcileTierToOrigin,
96997
97080
  recoverOrphans,
96998
97081
  release,
@@ -1,4 +1,4 @@
1
- import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-D3CteJaf.cjs';
1
+ import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-e-E4aP4j.cjs';
2
2
  import { Pool } from 'pg';
3
3
 
4
4
  declare const BRAND: unique symbol;
@@ -3122,8 +3122,8 @@ declare function preparePr(args: PreparePrArgs): Promise<PreparePrResult>;
3122
3122
  declare function pushFailureHint(rawMessage: string): string;
3123
3123
 
3124
3124
  declare class ScmWaitCiError extends Error {
3125
- readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "timeout" | "pr-not-found";
3126
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "timeout" | "pr-not-found");
3125
+ readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "pr-conflicting" | "timeout" | "pr-not-found";
3126
+ constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "pr-conflicting" | "timeout" | "pr-not-found");
3127
3127
  }
3128
3128
  interface WaitCiArgs {
3129
3129
  projectDir: string;
@@ -3171,8 +3171,8 @@ declare function reconcileTierToOrigin(args: {
3171
3171
  }): Promise<string | null>;
3172
3172
 
3173
3173
  declare class ScmMergeError extends Error {
3174
- readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth";
3175
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth");
3174
+ readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "promote-conflict" | "migrate-failed" | "migrate-timeout" | "migrate-auth";
3175
+ constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "promote-conflict" | "migrate-failed" | "migrate-timeout" | "migrate-auth");
3176
3176
  }
3177
3177
  interface MergeArgs {
3178
3178
  projectDir: string;
@@ -3272,6 +3272,18 @@ interface MergeArgs {
3272
3272
  refreshed: boolean;
3273
3273
  detail?: string;
3274
3274
  }>;
3275
+ /** Pre-merge reconcile of a pipeline.json-ledger promotion conflict to the run side (keeps it
3276
+ * tracked). Called ONLY when the PR is CONFLICTING. Defaults to {@link reconcilePromoteRunState};
3277
+ * injected in tests. */
3278
+ reconcileRunState?: (baseBranch: string) => Promise<{
3279
+ reconciled: boolean;
3280
+ detail?: string;
3281
+ }>;
3282
+ /** Fetch the PR's mergeability (to gate the reconcile). Defaults to the real getPullRequest;
3283
+ * injected in tests so the gate is exercised without the network. */
3284
+ fetchPrState?: (ownerRepo: string, headBranch: string) => Promise<{
3285
+ mergeableState?: string;
3286
+ } | undefined>;
3275
3287
  }
3276
3288
  interface MergeResult {
3277
3289
  state: ScmWorkflowState;
@@ -3300,15 +3312,21 @@ interface MergeResult {
3300
3312
  warnings: string[];
3301
3313
  }
3302
3314
  /**
3303
- * Built-in {@link MergeArgs.refreshWorkflows}. Refreshes drifted scaffolded
3304
- * `.github/workflows/*.yml` to the pinned template and commits + pushes them onto
3305
- * the PR head, so the merge commit carries the corrected promote workflow (the
3306
- * `migrate-target` step's `lakebase-schema-migrate apply-tier`) and the triggered
3307
- * `<tier> Merge` run passes instead of failing on the tier guard. No-op when
3308
- * nothing drifted. Scoped to `.github/workflows` so it never sweeps unrelated
3309
- * working-tree changes. Callers invoke it BEST-EFFORT — a failure here must never
3310
- * block the merge (the local migrate fallback still keeps git + schema in sync).
3315
+ * Clear a promotion-merge conflict that is ONLY the pipeline.json ledger, so GitHub can dispatch CI
3316
+ * and merge — WITHOUT untracking the ledger (it's durable run-state that must persist). Merges the
3317
+ * base into the PR head and resolves the ledger path(s) to the head (run) side, then pushes. This is
3318
+ * the merge-layer fix for the "pipeline.json conflict blocks promotion" defect, replacing the wrong
3319
+ * earlier approach of gitignoring/untracking it. Behavior:
3320
+ * - a dirty tree under `.consort/` only is checkpointed first (the run's own bookkeeping);
3321
+ * - a dirty tree OUTSIDE `.consort/` aborts (never auto-commit app code);
3322
+ * - a conflict on any NON-ledger path aborts the merge + surfaces (real divergence isn't resolved);
3323
+ * - a clean merge (no conflict) is a no-op (reconciled:false).
3324
+ * Only call this when the PR is actually CONFLICTING — a clean promote needs no merge commit.
3311
3325
  */
3326
+ declare function reconcilePromoteRunState(projectDir: string, baseBranch: string): Promise<{
3327
+ reconciled: boolean;
3328
+ detail?: string;
3329
+ }>;
3312
3330
  declare function defaultRefreshPromoteWorkflows(projectDir: string): Promise<{
3313
3331
  refreshed: boolean;
3314
3332
  detail?: string;
@@ -4099,4 +4117,4 @@ declare function applySchemaMigrations(args: ApplySchemaMigrationsArgs): Promise
4099
4117
  declare function rollbackSchemaMigration(args: RollbackSchemaMigrationArgs): Promise<RollbackSchemaMigrationResult>;
4100
4118
  declare function schemaMigrationStatus(args: SchemaMigrationStatusArgs): Promise<SchemaMigrationStatusResult>;
4101
4119
 
4102
- export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState };
4120
+ export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcilePromoteRunState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState };
@@ -1,4 +1,4 @@
1
- import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-D3CteJaf.js';
1
+ import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-e-E4aP4j.js';
2
2
  import { Pool } from 'pg';
3
3
 
4
4
  declare const BRAND: unique symbol;
@@ -3122,8 +3122,8 @@ declare function preparePr(args: PreparePrArgs): Promise<PreparePrResult>;
3122
3122
  declare function pushFailureHint(rawMessage: string): string;
3123
3123
 
3124
3124
  declare class ScmWaitCiError extends Error {
3125
- readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "timeout" | "pr-not-found";
3126
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "timeout" | "pr-not-found");
3125
+ readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "pr-conflicting" | "timeout" | "pr-not-found";
3126
+ constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "ci-failed" | "pr-conflicting" | "timeout" | "pr-not-found");
3127
3127
  }
3128
3128
  interface WaitCiArgs {
3129
3129
  projectDir: string;
@@ -3171,8 +3171,8 @@ declare function reconcileTierToOrigin(args: {
3171
3171
  }): Promise<string | null>;
3172
3172
 
3173
3173
  declare class ScmMergeError extends Error {
3174
- readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth";
3175
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth");
3174
+ readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "promote-conflict" | "migrate-failed" | "migrate-timeout" | "migrate-auth";
3175
+ constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "promote-conflict" | "migrate-failed" | "migrate-timeout" | "migrate-auth");
3176
3176
  }
3177
3177
  interface MergeArgs {
3178
3178
  projectDir: string;
@@ -3272,6 +3272,18 @@ interface MergeArgs {
3272
3272
  refreshed: boolean;
3273
3273
  detail?: string;
3274
3274
  }>;
3275
+ /** Pre-merge reconcile of a pipeline.json-ledger promotion conflict to the run side (keeps it
3276
+ * tracked). Called ONLY when the PR is CONFLICTING. Defaults to {@link reconcilePromoteRunState};
3277
+ * injected in tests. */
3278
+ reconcileRunState?: (baseBranch: string) => Promise<{
3279
+ reconciled: boolean;
3280
+ detail?: string;
3281
+ }>;
3282
+ /** Fetch the PR's mergeability (to gate the reconcile). Defaults to the real getPullRequest;
3283
+ * injected in tests so the gate is exercised without the network. */
3284
+ fetchPrState?: (ownerRepo: string, headBranch: string) => Promise<{
3285
+ mergeableState?: string;
3286
+ } | undefined>;
3275
3287
  }
3276
3288
  interface MergeResult {
3277
3289
  state: ScmWorkflowState;
@@ -3300,15 +3312,21 @@ interface MergeResult {
3300
3312
  warnings: string[];
3301
3313
  }
3302
3314
  /**
3303
- * Built-in {@link MergeArgs.refreshWorkflows}. Refreshes drifted scaffolded
3304
- * `.github/workflows/*.yml` to the pinned template and commits + pushes them onto
3305
- * the PR head, so the merge commit carries the corrected promote workflow (the
3306
- * `migrate-target` step's `lakebase-schema-migrate apply-tier`) and the triggered
3307
- * `<tier> Merge` run passes instead of failing on the tier guard. No-op when
3308
- * nothing drifted. Scoped to `.github/workflows` so it never sweeps unrelated
3309
- * working-tree changes. Callers invoke it BEST-EFFORT — a failure here must never
3310
- * block the merge (the local migrate fallback still keeps git + schema in sync).
3315
+ * Clear a promotion-merge conflict that is ONLY the pipeline.json ledger, so GitHub can dispatch CI
3316
+ * and merge — WITHOUT untracking the ledger (it's durable run-state that must persist). Merges the
3317
+ * base into the PR head and resolves the ledger path(s) to the head (run) side, then pushes. This is
3318
+ * the merge-layer fix for the "pipeline.json conflict blocks promotion" defect, replacing the wrong
3319
+ * earlier approach of gitignoring/untracking it. Behavior:
3320
+ * - a dirty tree under `.consort/` only is checkpointed first (the run's own bookkeeping);
3321
+ * - a dirty tree OUTSIDE `.consort/` aborts (never auto-commit app code);
3322
+ * - a conflict on any NON-ledger path aborts the merge + surfaces (real divergence isn't resolved);
3323
+ * - a clean merge (no conflict) is a no-op (reconciled:false).
3324
+ * Only call this when the PR is actually CONFLICTING — a clean promote needs no merge commit.
3311
3325
  */
3326
+ declare function reconcilePromoteRunState(projectDir: string, baseBranch: string): Promise<{
3327
+ reconciled: boolean;
3328
+ detail?: string;
3329
+ }>;
3312
3330
  declare function defaultRefreshPromoteWorkflows(projectDir: string): Promise<{
3313
3331
  refreshed: boolean;
3314
3332
  detail?: string;
@@ -4099,4 +4117,4 @@ declare function applySchemaMigrations(args: ApplySchemaMigrationsArgs): Promise
4099
4117
  declare function rollbackSchemaMigration(args: RollbackSchemaMigrationArgs): Promise<RollbackSchemaMigrationResult>;
4100
4118
  declare function schemaMigrationStatus(args: SchemaMigrationStatusArgs): Promise<SchemaMigrationStatusResult>;
4101
4119
 
4102
- export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState };
4120
+ export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcilePromoteRunState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState };
@@ -2518,8 +2518,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
2518
2518
  var cached;
2519
2519
  function substrateSelfVersion() {
2520
2520
  if (cached !== void 0) return cached;
2521
- if ("0.2.46".length > 0) {
2522
- cached = "0.2.46";
2521
+ if ("0.2.48".length > 0) {
2522
+ cached = "0.2.48";
2523
2523
  return cached;
2524
2524
  }
2525
2525
  cached = "unknown";
@@ -10674,6 +10674,8 @@ async function getPullRequest(ownerRepo, headBranch) {
10674
10674
  isDraft: pr.draft || false,
10675
10675
  ciStatus,
10676
10676
  checks,
10677
+ mergeable: pr.mergeable,
10678
+ mergeableState: pr.mergeable_state,
10677
10679
  headBranch: pr.head?.ref || headBranch,
10678
10680
  baseBranch: pr.base?.ref || "",
10679
10681
  body: pr.body || void 0,
@@ -12922,6 +12924,16 @@ async function setRepoSecrets(ownerRepo, secrets) {
12922
12924
  await setRepoSecret(ownerRepo, name, value);
12923
12925
  }
12924
12926
  }
12927
+ async function listSecretNames(ownerRepo) {
12928
+ try {
12929
+ const { owner, repo } = parseOwnerRepo(ownerRepo);
12930
+ const octokit2 = await getOctokit2();
12931
+ const { data } = await octokit2.rest.actions.listRepoSecrets({ owner, repo });
12932
+ return data.secrets.map((s) => s.name);
12933
+ } catch {
12934
+ return [];
12935
+ }
12936
+ }
12925
12937
 
12926
12938
  // scripts/git/remote.ts
12927
12939
  init_esm_shims();
@@ -12961,6 +12973,11 @@ async function getOwnerRepo(cwd) {
12961
12973
  }
12962
12974
 
12963
12975
  // scripts/util/ci-secrets.ts
12976
+ var REQUIRED_CI_SECRETS = ["DATABRICKS_HOST", "LAKEBASE_PROJECT_ID", "DATABRICKS_TOKEN"];
12977
+ async function missingCiSecrets(ownerRepo) {
12978
+ const present = new Set(await listSecretNames(ownerRepo));
12979
+ return REQUIRED_CI_SECRETS.filter((n) => !present.has(n));
12980
+ }
12964
12981
  async function syncCiSecrets(args) {
12965
12982
  const lifetime = args.lifetimeSeconds ?? 86400;
12966
12983
  const comment = args.comment ?? "GitHub Actions CI";
@@ -13477,10 +13494,17 @@ Last probe error:
13477
13494
  lifetimeSeconds: 86400,
13478
13495
  ownerRepo: fullRepoName
13479
13496
  });
13497
+ const missing = await missingCiSecrets(fullRepoName);
13498
+ if (missing.length > 0) {
13499
+ const m = `CI auth incomplete \u2014 repo secret(s) MISSING: ${missing.join(", ")}. CI cannot provision a per-PR Lakebase branch until fixed. Repair with: lakebase-sync-ci-secrets (run in the project).`;
13500
+ warnings.push(m);
13501
+ report(`WARNING: ${m}`);
13502
+ }
13480
13503
  } catch (err) {
13481
13504
  const msg = err instanceof Error ? err.message : String(err);
13482
- warnings.push(`CI auth setup failed: ${msg}`);
13483
- report(`Warning: CI auth setup failed (${msg})`);
13505
+ const m = `CI auth setup failed: ${msg}. CI will fail (no DATABASE_URL) until repaired \u2014 run: lakebase-sync-ci-secrets (in the project).`;
13506
+ warnings.push(m);
13507
+ report(`WARNING: ${m}`);
13484
13508
  }
13485
13509
  }
13486
13510
  if (useGithub && runnerType === "self-hosted") {
@@ -15832,6 +15856,12 @@ async function waitForCi(args) {
15832
15856
  if (lastPr.ciStatus === "success") {
15833
15857
  return { done: true, value: lastPr };
15834
15858
  }
15859
+ if (lastPr.mergeableState === "dirty" && lastPr.checks.length === 0) {
15860
+ throw new ScmWaitCiError(
15861
+ `PR ${lastPr.url} is CONFLICTING with ${lastPr.baseBranch} \u2014 GitHub will not dispatch CI (0 runs) until the conflict is resolved. Reconcile the branch and re-push; the synchronize event will trigger CI.`,
15862
+ "pr-conflicting"
15863
+ );
15864
+ }
15835
15865
  if (lastPr.ciStatus === "failure") {
15836
15866
  const failed = lastPr.checks.filter((c) => /(FAILURE|TIMED_OUT|CANCELLED|ACTION_REQUIRED)/i.test(c.conclusion)).map((c) => `${c.name} (${c.conclusion})`);
15837
15867
  throw new ScmWaitCiError(
@@ -16211,6 +16241,48 @@ function shaMigratePredicate(mergeCommitSha) {
16211
16241
  return !!run.headSha && run.headSha === mergeCommitSha;
16212
16242
  };
16213
16243
  }
16244
+ var PROMOTE_RUNSTATE_CONFLICT = /(^|\/)\.consort\/(features\/[^/]+\/)?pipeline\.json$/;
16245
+ async function reconcilePromoteRunState(projectDir, baseBranch) {
16246
+ const o = { cwd: projectDir, timeout: 3e4 };
16247
+ const dirty = (await exec2("git status --porcelain", o).catch(() => "")).split("\n").map((l) => l.slice(3).trim()).filter(Boolean);
16248
+ const nonRunStateDirty = dirty.filter((p) => !p.startsWith(".consort/"));
16249
+ if (nonRunStateDirty.length > 0) {
16250
+ throw new ScmMergeError(
16251
+ `working tree has uncommitted non-run-state changes (${nonRunStateDirty.slice(0, 5).join(", ")}${nonRunStateDirty.length > 5 ? ", \u2026" : ""}); commit or stash before promoting.`,
16252
+ "promote-conflict"
16253
+ );
16254
+ }
16255
+ if (dirty.length > 0) {
16256
+ await exec2(`git add ${shellEscape2(".consort")}`, o);
16257
+ await exec2(`git commit -m ${shellEscape2("chore(run): checkpoint run state before promotion")}`, o);
16258
+ }
16259
+ await exec2(`git fetch origin ${shellEscape2(baseBranch)}`, o).catch(() => {
16260
+ });
16261
+ let conflicted = false;
16262
+ try {
16263
+ await exec2(`git merge --no-ff -m ${shellEscape2(`merge ${baseBranch} for promotion`)} ${shellEscape2(`origin/${baseBranch}`)}`, o);
16264
+ } catch {
16265
+ conflicted = true;
16266
+ }
16267
+ if (!conflicted) return { reconciled: false };
16268
+ const u = (await exec2("git diff --name-only --diff-filter=U", o).catch(() => "")).split("\n").map((s) => s.trim()).filter(Boolean);
16269
+ const other = u.filter((p) => !PROMOTE_RUNSTATE_CONFLICT.test(p));
16270
+ if (u.length === 0 || other.length > 0) {
16271
+ await exec2("git merge --abort", o).catch(() => {
16272
+ });
16273
+ throw new ScmMergeError(
16274
+ other.length > 0 ? `promotion conflicts on non-ledger file(s): ${other.join(", ")}. Resolve the real divergence manually, then re-run the promote.` : `promotion merge failed with no resolvable conflicts; resolve manually and re-run.`,
16275
+ "promote-conflict"
16276
+ );
16277
+ }
16278
+ for (const p of u) {
16279
+ await exec2(`git checkout --ours -- ${shellEscape2(p)}`, o);
16280
+ await exec2(`git add -- ${shellEscape2(p)}`, o);
16281
+ }
16282
+ await exec2(`git commit -m ${shellEscape2(`merge ${baseBranch} for promotion (pipeline.json ledger kept at run state)`)}`, o);
16283
+ await pushCurrentBranchForPr({ cwd: projectDir });
16284
+ return { reconciled: true, detail: `reconciled ${u.length} ledger path(s) to the run side + pushed` };
16285
+ }
16214
16286
  async function defaultRefreshPromoteWorkflows(projectDir) {
16215
16287
  const drift = detectWorkflowDrift({ projectDir });
16216
16288
  const touched = drift.files.filter((f) => f.status === "drifted").map((f) => f.name);
@@ -16300,6 +16372,15 @@ async function mergeFeature(args) {
16300
16372
  );
16301
16373
  }
16302
16374
  }
16375
+ {
16376
+ const fetchState = args.fetchPrState ?? ((o, h) => getPullRequest(o, h));
16377
+ const prState = await fetchState(ownerRepo, current.branch).catch(() => void 0);
16378
+ if (prState?.mergeableState === "dirty") {
16379
+ const reconcile = args.reconcileRunState ?? ((base) => reconcilePromoteRunState(args.projectDir, base));
16380
+ const r = await reconcile(gitBase);
16381
+ if (r.reconciled) preflightNotes.push(`Reconciled a pipeline.json-ledger promotion conflict to the run side${r.detail ? ` (${r.detail})` : ""}.`);
16382
+ }
16383
+ }
16303
16384
  let paired;
16304
16385
  try {
16305
16386
  paired = await mergePairedPullRequest({
@@ -17921,6 +18002,7 @@ export {
17921
18002
  readEnvVar,
17922
18003
  readTargets,
17923
18004
  readWorkflowState,
18005
+ reconcilePromoteRunState,
17924
18006
  reconcileTierToOrigin,
17925
18007
  recoverOrphans,
17926
18008
  release,
@@ -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.2.46".length > 0) {
79294
- cached = "0.2.46";
79293
+ if ("0.2.48".length > 0) {
79294
+ cached = "0.2.48";
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.2.46".length > 0) {
397
- cached = "0.2.46";
396
+ if ("0.2.48".length > 0) {
397
+ cached = "0.2.48";
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.2.46".length > 0) {
79294
- cached = "0.2.46";
79293
+ if ("0.2.48".length > 0) {
79294
+ cached = "0.2.48";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";