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

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 (48) hide show
  1. package/dist/scripts/index.cjs +40 -21
  2. package/dist/scripts/index.d.cts +1 -1
  3. package/dist/scripts/index.d.ts +1 -1
  4. package/dist/scripts/index.js +39 -21
  5. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +2 -2
  6. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +2 -2
  7. package/dist/scripts/lakebase/collapse-heads.cli.cjs +2 -2
  8. package/dist/scripts/lakebase/collapse-heads.cli.js +2 -2
  9. package/dist/scripts/lakebase/detect-language.cli.cjs +2 -2
  10. package/dist/scripts/lakebase/detect-language.cli.js +2 -2
  11. package/dist/scripts/lakebase/doctor.cli.cjs +2 -2
  12. package/dist/scripts/lakebase/doctor.cli.js +2 -2
  13. package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
  14. package/dist/scripts/lakebase/get-connection.cli.js +2 -2
  15. package/dist/scripts/lakebase/index.cjs +40 -21
  16. package/dist/scripts/lakebase/index.d.cts +13 -4
  17. package/dist/scripts/lakebase/index.d.ts +13 -4
  18. package/dist/scripts/lakebase/index.js +39 -21
  19. package/dist/scripts/lakebase/infra-runner.cli.cjs +2 -2
  20. package/dist/scripts/lakebase/infra-runner.cli.js +2 -2
  21. package/dist/scripts/lakebase/new-migration.cli.cjs +2 -2
  22. package/dist/scripts/lakebase/new-migration.cli.js +2 -2
  23. package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
  24. package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
  25. package/dist/scripts/lakebase/schema-migrate.cli.cjs +2 -2
  26. package/dist/scripts/lakebase/schema-migrate.cli.js +2 -2
  27. package/dist/scripts/lakebase/scm-abandon-feature.cli.cjs +37 -22
  28. package/dist/scripts/lakebase/scm-abandon-feature.cli.js +34 -22
  29. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +2 -2
  30. package/dist/scripts/lakebase/scm-claim-feature.cli.js +2 -2
  31. package/dist/scripts/lakebase/scm-doctor.cli.cjs +36 -21
  32. package/dist/scripts/lakebase/scm-doctor.cli.js +36 -21
  33. package/dist/scripts/lakebase/scm-merge.cli.cjs +2 -2
  34. package/dist/scripts/lakebase/scm-merge.cli.js +2 -2
  35. package/dist/scripts/lakebase/scm-park-feature.cli.cjs +586 -0
  36. package/dist/scripts/lakebase/scm-park-feature.cli.d.cts +4 -0
  37. package/dist/scripts/lakebase/scm-park-feature.cli.d.ts +4 -0
  38. package/dist/scripts/lakebase/scm-park-feature.cli.js +546 -0
  39. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +2 -2
  40. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +2 -2
  41. package/dist/scripts/util/index.cjs +2 -2
  42. package/dist/scripts/util/index.js +2 -2
  43. package/package.json +2 -1
  44. package/scripts/lakebase/scm-abandon-feature.cli.ts +3 -3
  45. package/scripts/lakebase/scm-abandon-feature.ts +19 -83
  46. package/scripts/lakebase/scm-park-feature.cli.ts +150 -0
  47. package/scripts/lakebase/scm-park-feature.ts +71 -0
  48. package/scripts/lakebase/scm-release-claim.ts +146 -0
@@ -3091,9 +3091,18 @@ interface AdoptStateResult {
3091
3091
  declare function inferTierTopology(branches: LakebaseBranchInfo[]): TierTopology;
3092
3092
  declare function adoptScmState(args: AdoptStateArgs): Promise<AdoptStateResult>;
3093
3093
 
3094
- declare class ScmAbandonError extends Error {
3095
- readonly code: "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields";
3096
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields");
3094
+ type ScmReleaseErrorCode = "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields";
3095
+ /** The shared error for a claim release. `abandon` keeps its own `ScmAbandonError` as a subclass for
3096
+ * back-compat; CLIs that map codes to exit statuses check `instanceof ScmReleaseError` (the base). */
3097
+ declare class ScmReleaseError extends Error {
3098
+ readonly code: ScmReleaseErrorCode;
3099
+ constructor(message: string, code: ScmReleaseErrorCode);
3100
+ }
3101
+
3102
+ /** Back-compat alias: abandon historically threw its own error class. It is now a subclass of the
3103
+ * shared `ScmReleaseError` so existing `instanceof ScmAbandonError` checks still narrow, while the
3104
+ * shared release core (which both abandon and park use) throws the base. */
3105
+ declare class ScmAbandonError extends ScmReleaseError {
3097
3106
  }
3098
3107
  interface AbandonFeatureArgs {
3099
3108
  projectDir: string;
@@ -4206,4 +4215,4 @@ declare function applySchemaMigrations(args: ApplySchemaMigrationsArgs): Promise
4206
4215
  declare function rollbackSchemaMigration(args: RollbackSchemaMigrationArgs): Promise<RollbackSchemaMigrationResult>;
4207
4216
  declare function schemaMigrationStatus(args: SchemaMigrationStatusArgs): Promise<SchemaMigrationStatusResult>;
4208
4217
 
4209
- 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, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, 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 DotnetMigrationTool, type DsnArgs, type DsnResult, EF_DESIGN_PACKAGE, type EfCoreProject, 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, MAVEN_FLYWAY_DIR, 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, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, 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, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, 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 };
4218
+ 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, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, 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 DotnetMigrationTool, type DsnArgs, type DsnResult, EF_DESIGN_PACKAGE, type EfCoreProject, 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, MAVEN_FLYWAY_DIR, 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, ScmReleaseError, 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, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, 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, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, 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 };
@@ -3091,9 +3091,18 @@ interface AdoptStateResult {
3091
3091
  declare function inferTierTopology(branches: LakebaseBranchInfo[]): TierTopology;
3092
3092
  declare function adoptScmState(args: AdoptStateArgs): Promise<AdoptStateResult>;
3093
3093
 
3094
- declare class ScmAbandonError extends Error {
3095
- readonly code: "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields";
3096
- constructor(message: string, code: "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields");
3094
+ type ScmReleaseErrorCode = "no-state-file" | "bad-precondition" | "dirty-working-tree" | "missing-claim-fields";
3095
+ /** The shared error for a claim release. `abandon` keeps its own `ScmAbandonError` as a subclass for
3096
+ * back-compat; CLIs that map codes to exit statuses check `instanceof ScmReleaseError` (the base). */
3097
+ declare class ScmReleaseError extends Error {
3098
+ readonly code: ScmReleaseErrorCode;
3099
+ constructor(message: string, code: ScmReleaseErrorCode);
3100
+ }
3101
+
3102
+ /** Back-compat alias: abandon historically threw its own error class. It is now a subclass of the
3103
+ * shared `ScmReleaseError` so existing `instanceof ScmAbandonError` checks still narrow, while the
3104
+ * shared release core (which both abandon and park use) throws the base. */
3105
+ declare class ScmAbandonError extends ScmReleaseError {
3097
3106
  }
3098
3107
  interface AbandonFeatureArgs {
3099
3108
  projectDir: string;
@@ -4206,4 +4215,4 @@ declare function applySchemaMigrations(args: ApplySchemaMigrationsArgs): Promise
4206
4215
  declare function rollbackSchemaMigration(args: RollbackSchemaMigrationArgs): Promise<RollbackSchemaMigrationResult>;
4207
4216
  declare function schemaMigrationStatus(args: SchemaMigrationStatusArgs): Promise<SchemaMigrationStatusResult>;
4208
4217
 
4209
- 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, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, 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 DotnetMigrationTool, type DsnArgs, type DsnResult, EF_DESIGN_PACKAGE, type EfCoreProject, 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, MAVEN_FLYWAY_DIR, 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, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, 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, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, 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 };
4218
+ 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, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, 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 DotnetMigrationTool, type DsnArgs, type DsnResult, EF_DESIGN_PACKAGE, type EfCoreProject, 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, MAVEN_FLYWAY_DIR, 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, ScmReleaseError, 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, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, 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, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, 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 };
@@ -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.6".length > 0) {
2525
- cached = "0.3.6";
2524
+ if ("0.3.7".length > 0) {
2525
+ cached = "0.3.7";
2526
2526
  return cached;
2527
2527
  }
2528
2528
  cached = "unknown";
@@ -16282,44 +16282,46 @@ async function adoptScmState(args) {
16282
16282
 
16283
16283
  // scripts/lakebase/scm-abandon-feature.ts
16284
16284
  init_esm_shims();
16285
- var ScmAbandonError = class extends Error {
16285
+
16286
+ // scripts/lakebase/scm-release-claim.ts
16287
+ init_esm_shims();
16288
+ var ScmReleaseError = class extends Error {
16286
16289
  constructor(message, code) {
16287
16290
  super(message);
16288
16291
  this.code = code;
16289
- this.name = "ScmAbandonError";
16292
+ this.name = "ScmReleaseError";
16290
16293
  }
16291
16294
  code;
16292
16295
  };
16293
- async function abandonFeatureBranch(args) {
16296
+ async function prepareClaimRelease(args, verb) {
16294
16297
  const current = readWorkflowState(args.projectDir);
16295
16298
  if (!current) {
16296
- throw new ScmAbandonError(
16299
+ throw new ScmReleaseError(
16297
16300
  `No SCM workflow state found at ${args.projectDir}/.lakebase/workflow-state.json.`,
16298
16301
  "no-state-file"
16299
16302
  );
16300
16303
  }
16301
16304
  if (current.state !== "feature-claimed") {
16302
- throw new ScmAbandonError(
16303
- `abandon refuses state "${current.state}". Only feature-claimed is abandonable; later states must complete or be reverted via gh.`,
16305
+ throw new ScmReleaseError(
16306
+ `${verb} refuses state "${current.state}". Only feature-claimed is ${verb}able; later states must complete or be reverted via gh.`,
16304
16307
  "bad-precondition"
16305
16308
  );
16306
16309
  }
16307
16310
  if (!current.feature_id || !current.branch || !current.parent_branch || !current.lakebase_branch_uid) {
16308
- throw new ScmAbandonError(
16309
- "feature-claimed row is missing required invariants. Cannot abandon safely; consider re-adopting state first.",
16311
+ throw new ScmReleaseError(
16312
+ `feature-claimed row is missing required invariants. Cannot ${verb} safely; consider re-adopting state first.`,
16310
16313
  "missing-claim-fields"
16311
16314
  );
16312
16315
  }
16313
16316
  if (!args.force) {
16314
16317
  const dirty = await isDirty({ cwd: args.projectDir });
16315
16318
  if (dirty) {
16316
- throw new ScmAbandonError(
16317
- "Working tree has uncommitted changes; refusing to abandon (the branch delete would lose them). Commit / stash / discard first, or pass --force.",
16319
+ throw new ScmReleaseError(
16320
+ `Working tree has uncommitted changes; refusing to ${verb} (switching HEAD off the feature branch would strand them). Commit / stash / discard first, or pass --force.`,
16318
16321
  "dirty-working-tree"
16319
16322
  );
16320
16323
  }
16321
16324
  }
16322
- const instance = args.instance ?? current.project_id;
16323
16325
  const switchTo = args.switchTo ?? current.parent_branch;
16324
16326
  const warnings = [];
16325
16327
  const headBranch = await getCurrentBranch({ cwd: args.projectDir });
@@ -16331,16 +16333,13 @@ async function abandonFeatureBranch(args) {
16331
16333
  });
16332
16334
  } catch (err) {
16333
16335
  warnings.push(
16334
- `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch delete may be skipped.`
16336
+ `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch state may be left on the feature branch.`
16335
16337
  );
16336
16338
  }
16337
16339
  }
16338
- const del = await deletePairedBranch({
16339
- instance,
16340
- branch: current.branch,
16341
- cwd: args.projectDir
16342
- });
16343
- warnings.push(...del.warnings);
16340
+ return { current, switchTo, warnings };
16341
+ }
16342
+ function resetToScaffoldComplete(projectDir, current) {
16344
16343
  const reset = {
16345
16344
  $schema: current.$schema,
16346
16345
  version: 1,
@@ -16348,7 +16347,25 @@ async function abandonFeatureBranch(args) {
16348
16347
  tier_topology: current.tier_topology,
16349
16348
  project_id: current.project_id
16350
16349
  };
16351
- writeWorkflowState(args.projectDir, reset);
16350
+ writeWorkflowState(projectDir, reset);
16351
+ return reset;
16352
+ }
16353
+
16354
+ // scripts/lakebase/scm-abandon-feature.ts
16355
+ var ScmAbandonError = class extends ScmReleaseError {
16356
+ };
16357
+ async function abandonFeatureBranch(args) {
16358
+ const { current, warnings } = await prepareClaimRelease(
16359
+ { projectDir: args.projectDir, force: args.force, switchTo: args.switchTo },
16360
+ "abandon"
16361
+ );
16362
+ const del = await deletePairedBranch({
16363
+ instance: args.instance ?? current.project_id,
16364
+ branch: current.branch,
16365
+ cwd: args.projectDir
16366
+ });
16367
+ warnings.push(...del.warnings);
16368
+ const reset = resetToScaffoldComplete(args.projectDir, current);
16352
16369
  return {
16353
16370
  state: reset,
16354
16371
  lakebaseDeleted: del.lakebaseDeleted,
@@ -18670,6 +18687,7 @@ export {
18670
18687
  ScmMergeError,
18671
18688
  ScmPreparePrError,
18672
18689
  ScmRecoverError,
18690
+ ScmReleaseError,
18673
18691
  ScmWaitCiError,
18674
18692
  SpringInitializrClient,
18675
18693
  _testMakeBrownfieldFixture,
@@ -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.6".length > 0) {
79294
- cached = "0.3.6";
79293
+ if ("0.3.7".length > 0) {
79294
+ cached = "0.3.7";
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.6".length > 0) {
397
- cached = "0.3.6";
396
+ if ("0.3.7".length > 0) {
397
+ cached = "0.3.7";
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.6".length > 0) {
79294
- cached = "0.3.6";
79293
+ if ("0.3.7".length > 0) {
79294
+ cached = "0.3.7";
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.6".length > 0) {
397
- cached = "0.3.6";
396
+ if ("0.3.7".length > 0) {
397
+ cached = "0.3.7";
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.6".length > 0) {
79292
- cached = "0.3.6";
79291
+ if ("0.3.7".length > 0) {
79292
+ cached = "0.3.7";
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.6".length > 0) {
393
- cached = "0.3.6";
392
+ if ("0.3.7".length > 0) {
393
+ cached = "0.3.7";
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.6".length > 0) {
79328
- cached = "0.3.6";
79327
+ if ("0.3.7".length > 0) {
79328
+ cached = "0.3.7";
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.6".length > 0) {
431
- cached = "0.3.6";
430
+ if ("0.3.7".length > 0) {
431
+ cached = "0.3.7";
432
432
  return cached;
433
433
  }
434
434
  cached = "unknown";
@@ -78155,6 +78155,9 @@ async function deletePairedBranch(args) {
78155
78155
  return { lakebaseDeleted, gitLocalDeleted, gitRemoteDeleted, warnings };
78156
78156
  }
78157
78157
 
78158
+ // scripts/lakebase/scm-release-claim.ts
78159
+ init_cjs_shims();
78160
+
78158
78161
  // scripts/lakebase/scm-workflow-state.ts
78159
78162
  init_cjs_shims();
78160
78163
  var fs6 = __toESM(require("fs"), 1);
@@ -78410,45 +78413,44 @@ function orderForOutput(state) {
78410
78413
  return out;
78411
78414
  }
78412
78415
 
78413
- // scripts/lakebase/scm-abandon-feature.ts
78414
- var ScmAbandonError = class extends Error {
78416
+ // scripts/lakebase/scm-release-claim.ts
78417
+ var ScmReleaseError = class extends Error {
78415
78418
  constructor(message, code) {
78416
78419
  super(message);
78417
78420
  this.code = code;
78418
- this.name = "ScmAbandonError";
78421
+ this.name = "ScmReleaseError";
78419
78422
  }
78420
78423
  code;
78421
78424
  };
78422
- async function abandonFeatureBranch(args) {
78425
+ async function prepareClaimRelease(args, verb) {
78423
78426
  const current = readWorkflowState(args.projectDir);
78424
78427
  if (!current) {
78425
- throw new ScmAbandonError(
78428
+ throw new ScmReleaseError(
78426
78429
  `No SCM workflow state found at ${args.projectDir}/.lakebase/workflow-state.json.`,
78427
78430
  "no-state-file"
78428
78431
  );
78429
78432
  }
78430
78433
  if (current.state !== "feature-claimed") {
78431
- throw new ScmAbandonError(
78432
- `abandon refuses state "${current.state}". Only feature-claimed is abandonable; later states must complete or be reverted via gh.`,
78434
+ throw new ScmReleaseError(
78435
+ `${verb} refuses state "${current.state}". Only feature-claimed is ${verb}able; later states must complete or be reverted via gh.`,
78433
78436
  "bad-precondition"
78434
78437
  );
78435
78438
  }
78436
78439
  if (!current.feature_id || !current.branch || !current.parent_branch || !current.lakebase_branch_uid) {
78437
- throw new ScmAbandonError(
78438
- "feature-claimed row is missing required invariants. Cannot abandon safely; consider re-adopting state first.",
78440
+ throw new ScmReleaseError(
78441
+ `feature-claimed row is missing required invariants. Cannot ${verb} safely; consider re-adopting state first.`,
78439
78442
  "missing-claim-fields"
78440
78443
  );
78441
78444
  }
78442
78445
  if (!args.force) {
78443
78446
  const dirty = await isDirty({ cwd: args.projectDir });
78444
78447
  if (dirty) {
78445
- throw new ScmAbandonError(
78446
- "Working tree has uncommitted changes; refusing to abandon (the branch delete would lose them). Commit / stash / discard first, or pass --force.",
78448
+ throw new ScmReleaseError(
78449
+ `Working tree has uncommitted changes; refusing to ${verb} (switching HEAD off the feature branch would strand them). Commit / stash / discard first, or pass --force.`,
78447
78450
  "dirty-working-tree"
78448
78451
  );
78449
78452
  }
78450
78453
  }
78451
- const instance = args.instance ?? current.project_id;
78452
78454
  const switchTo = args.switchTo ?? current.parent_branch;
78453
78455
  const warnings = [];
78454
78456
  const headBranch = await getCurrentBranch({ cwd: args.projectDir });
@@ -78460,16 +78462,13 @@ async function abandonFeatureBranch(args) {
78460
78462
  });
78461
78463
  } catch (err) {
78462
78464
  warnings.push(
78463
- `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch delete may be skipped.`
78465
+ `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch state may be left on the feature branch.`
78464
78466
  );
78465
78467
  }
78466
78468
  }
78467
- const del = await deletePairedBranch({
78468
- instance,
78469
- branch: current.branch,
78470
- cwd: args.projectDir
78471
- });
78472
- warnings.push(...del.warnings);
78469
+ return { current, switchTo, warnings };
78470
+ }
78471
+ function resetToScaffoldComplete(projectDir, current) {
78473
78472
  const reset = {
78474
78473
  $schema: current.$schema,
78475
78474
  version: 1,
@@ -78477,7 +78476,23 @@ async function abandonFeatureBranch(args) {
78477
78476
  tier_topology: current.tier_topology,
78478
78477
  project_id: current.project_id
78479
78478
  };
78480
- writeWorkflowState(args.projectDir, reset);
78479
+ writeWorkflowState(projectDir, reset);
78480
+ return reset;
78481
+ }
78482
+
78483
+ // scripts/lakebase/scm-abandon-feature.ts
78484
+ async function abandonFeatureBranch(args) {
78485
+ const { current, warnings } = await prepareClaimRelease(
78486
+ { projectDir: args.projectDir, force: args.force, switchTo: args.switchTo },
78487
+ "abandon"
78488
+ );
78489
+ const del = await deletePairedBranch({
78490
+ instance: args.instance ?? current.project_id,
78491
+ branch: current.branch,
78492
+ cwd: args.projectDir
78493
+ });
78494
+ warnings.push(...del.warnings);
78495
+ const reset = resetToScaffoldComplete(args.projectDir, current);
78481
78496
  return {
78482
78497
  state: reset,
78483
78498
  lakebaseDeleted: del.lakebaseDeleted,
@@ -78564,7 +78579,7 @@ function renderHuman(report) {
78564
78579
  return lines.join("\n");
78565
78580
  }
78566
78581
  function exitCodeForError(err) {
78567
- if (err instanceof ScmAbandonError) {
78582
+ if (err instanceof ScmReleaseError) {
78568
78583
  if (err.code === "no-state-file") return 1;
78569
78584
  return 2;
78570
78585
  }
@@ -78597,7 +78612,7 @@ async function runScmAbandonFeatureCli(argv) {
78597
78612
  return 0;
78598
78613
  } catch (e2) {
78599
78614
  const err = e2;
78600
- const code = err instanceof ScmAbandonError ? err.code : "substrate-failure";
78615
+ const code = err instanceof ScmReleaseError ? err.code : "substrate-failure";
78601
78616
  const report = {
78602
78617
  ok: false,
78603
78618
  error: { code, message: err.message }
@@ -815,45 +815,44 @@ function orderForOutput(state) {
815
815
  return out;
816
816
  }
817
817
 
818
- // scripts/lakebase/scm-abandon-feature.ts
819
- var ScmAbandonError = class extends Error {
818
+ // scripts/lakebase/scm-release-claim.ts
819
+ var ScmReleaseError = class extends Error {
820
820
  constructor(message, code) {
821
821
  super(message);
822
822
  this.code = code;
823
- this.name = "ScmAbandonError";
823
+ this.name = "ScmReleaseError";
824
824
  }
825
825
  code;
826
826
  };
827
- async function abandonFeatureBranch(args) {
827
+ async function prepareClaimRelease(args, verb) {
828
828
  const current = readWorkflowState(args.projectDir);
829
829
  if (!current) {
830
- throw new ScmAbandonError(
830
+ throw new ScmReleaseError(
831
831
  `No SCM workflow state found at ${args.projectDir}/.lakebase/workflow-state.json.`,
832
832
  "no-state-file"
833
833
  );
834
834
  }
835
835
  if (current.state !== "feature-claimed") {
836
- throw new ScmAbandonError(
837
- `abandon refuses state "${current.state}". Only feature-claimed is abandonable; later states must complete or be reverted via gh.`,
836
+ throw new ScmReleaseError(
837
+ `${verb} refuses state "${current.state}". Only feature-claimed is ${verb}able; later states must complete or be reverted via gh.`,
838
838
  "bad-precondition"
839
839
  );
840
840
  }
841
841
  if (!current.feature_id || !current.branch || !current.parent_branch || !current.lakebase_branch_uid) {
842
- throw new ScmAbandonError(
843
- "feature-claimed row is missing required invariants. Cannot abandon safely; consider re-adopting state first.",
842
+ throw new ScmReleaseError(
843
+ `feature-claimed row is missing required invariants. Cannot ${verb} safely; consider re-adopting state first.`,
844
844
  "missing-claim-fields"
845
845
  );
846
846
  }
847
847
  if (!args.force) {
848
848
  const dirty = await isDirty({ cwd: args.projectDir });
849
849
  if (dirty) {
850
- throw new ScmAbandonError(
851
- "Working tree has uncommitted changes; refusing to abandon (the branch delete would lose them). Commit / stash / discard first, or pass --force.",
850
+ throw new ScmReleaseError(
851
+ `Working tree has uncommitted changes; refusing to ${verb} (switching HEAD off the feature branch would strand them). Commit / stash / discard first, or pass --force.`,
852
852
  "dirty-working-tree"
853
853
  );
854
854
  }
855
855
  }
856
- const instance = args.instance ?? current.project_id;
857
856
  const switchTo = args.switchTo ?? current.parent_branch;
858
857
  const warnings = [];
859
858
  const headBranch = await getCurrentBranch({ cwd: args.projectDir });
@@ -865,16 +864,13 @@ async function abandonFeatureBranch(args) {
865
864
  });
866
865
  } catch (err) {
867
866
  warnings.push(
868
- `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch delete may be skipped.`
867
+ `git checkout ${switchTo} failed: ${err instanceof Error ? err.message : String(err)}. Local branch state may be left on the feature branch.`
869
868
  );
870
869
  }
871
870
  }
872
- const del = await deletePairedBranch({
873
- instance,
874
- branch: current.branch,
875
- cwd: args.projectDir
876
- });
877
- warnings.push(...del.warnings);
871
+ return { current, switchTo, warnings };
872
+ }
873
+ function resetToScaffoldComplete(projectDir, current) {
878
874
  const reset = {
879
875
  $schema: current.$schema,
880
876
  version: 1,
@@ -882,7 +878,23 @@ async function abandonFeatureBranch(args) {
882
878
  tier_topology: current.tier_topology,
883
879
  project_id: current.project_id
884
880
  };
885
- writeWorkflowState(args.projectDir, reset);
881
+ writeWorkflowState(projectDir, reset);
882
+ return reset;
883
+ }
884
+
885
+ // scripts/lakebase/scm-abandon-feature.ts
886
+ async function abandonFeatureBranch(args) {
887
+ const { current, warnings } = await prepareClaimRelease(
888
+ { projectDir: args.projectDir, force: args.force, switchTo: args.switchTo },
889
+ "abandon"
890
+ );
891
+ const del = await deletePairedBranch({
892
+ instance: args.instance ?? current.project_id,
893
+ branch: current.branch,
894
+ cwd: args.projectDir
895
+ });
896
+ warnings.push(...del.warnings);
897
+ const reset = resetToScaffoldComplete(args.projectDir, current);
886
898
  return {
887
899
  state: reset,
888
900
  lakebaseDeleted: del.lakebaseDeleted,
@@ -969,7 +981,7 @@ function renderHuman(report) {
969
981
  return lines.join("\n");
970
982
  }
971
983
  function exitCodeForError(err) {
972
- if (err instanceof ScmAbandonError) {
984
+ if (err instanceof ScmReleaseError) {
973
985
  if (err.code === "no-state-file") return 1;
974
986
  return 2;
975
987
  }
@@ -1002,7 +1014,7 @@ async function runScmAbandonFeatureCli(argv) {
1002
1014
  return 0;
1003
1015
  } catch (e) {
1004
1016
  const err = e;
1005
- const code = err instanceof ScmAbandonError ? err.code : "substrate-failure";
1017
+ const code = err instanceof ScmReleaseError ? err.code : "substrate-failure";
1006
1018
  const report = {
1007
1019
  ok: false,
1008
1020
  error: { code, message: err.message }
@@ -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.6".length > 0) {
79787
- cached = "0.3.6";
79786
+ if ("0.3.7".length > 0) {
79787
+ cached = "0.3.7";
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.6".length > 0) {
868
- cached = "0.3.6";
867
+ if ("0.3.7".length > 0) {
868
+ cached = "0.3.7";
869
869
  return cached;
870
870
  }
871
871
  cached = "unknown";