@runa-ai/runa-cli 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-V66FAQXB.js → build-HQMSVN6N.js} +3 -3
- package/dist/{check-LOMVIRHX.js → check-PCSQPYDM.js} +2 -2
- package/dist/{chunk-QM53IQHM.js → chunk-2QX7T24B.js} +1 -1
- package/dist/{chunk-XDCHRVE3.js → chunk-4XHZQRRK.js} +2 -2
- package/dist/{chunk-7B5C6U2K.js → chunk-A6A7JIRD.js} +35 -2
- package/dist/{chunk-Z4Z5DNW4.js → chunk-B3POLMII.js} +12 -0
- package/dist/chunk-CKRLVEIO.js +119 -0
- package/dist/{chunk-HD74F6W2.js → chunk-FWMGC5FP.js} +1 -0
- package/dist/{chunk-H2AHNI75.js → chunk-LCK2LGVR.js} +1 -1
- package/dist/{chunk-FHG3ILE4.js → chunk-OBYZDT2E.js} +38 -8
- package/dist/{chunk-AIP6MR42.js → chunk-PMXE5XOJ.js} +1 -1
- package/dist/{chunk-VM3IWOT5.js → chunk-QSEF4T3Y.js} +13 -5
- package/dist/{chunk-NPSRD26F.js → chunk-UHDAYPHH.js} +1 -1
- package/dist/{chunk-2APB25TT.js → chunk-VSH3IXDQ.js} +7 -3
- package/dist/{chunk-644FVGIQ.js → chunk-WPMR7RQ4.js} +9 -2
- package/dist/chunk-XVNDDHAF.js +65 -0
- package/dist/{risk-detector-plpgsql-HWKS4OLR.js → chunk-Y5ANTCKE.js} +3 -412
- package/dist/{chunk-SGJG3BKD.js → chunk-Z7A4BEWF.js} +1 -1
- package/dist/{ci-ZWRVWNFX.js → ci-Z4525QW6.js} +3095 -709
- package/dist/{cli-2JNBJUBB.js → cli-Q2XIQDRS.js} +72 -54
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +6 -4
- package/dist/commands/ci/commands/ci-prod-types.d.ts +3 -0
- package/dist/commands/ci/commands/ci-prod-workflow.d.ts +1 -1
- package/dist/commands/ci/commands/ci-resolvers.d.ts +1 -1
- package/dist/commands/ci/commands/ci-supabase-local.d.ts +4 -0
- package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts +1 -1
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts +15 -2
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts +32 -4
- package/dist/commands/ci/machine/actors/db/schema-canonical-diff.d.ts +30 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +1 -0
- package/dist/commands/ci/machine/actors/finalize/index.d.ts +0 -1
- package/dist/commands/ci/machine/actors/index.d.ts +1 -1
- package/dist/commands/ci/machine/actors/setup/local.d.ts +2 -0
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts +3 -0
- package/dist/commands/ci/machine/actors/setup/pr-local.d.ts +2 -0
- package/dist/commands/ci/machine/commands/machine-runner.d.ts +6 -0
- package/dist/commands/ci/machine/commands/step-telemetry.d.ts +16 -0
- package/dist/commands/ci/machine/contract.d.ts +40 -0
- package/dist/commands/ci/machine/formatters/github-comment-types.d.ts +7 -2
- package/dist/commands/ci/machine/formatters/github-comment.d.ts +2 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +2 -1
- package/dist/commands/ci/machine/formatters/sections/index.d.ts +1 -1
- package/dist/commands/ci/machine/formatters/sections/production-schema-status.d.ts +30 -0
- package/dist/commands/ci/machine/formatters/summary.d.ts +4 -4
- package/dist/commands/ci/machine/guards.d.ts +4 -0
- package/dist/commands/ci/machine/helpers.d.ts +33 -0
- package/dist/commands/ci/machine/machine-state-helpers.d.ts +1 -1
- package/dist/commands/ci/machine/machine.d.ts +71 -11
- package/dist/commands/ci/machine/types.d.ts +9 -0
- package/dist/commands/ci/utils/ci-diagnostics.d.ts +67 -0
- package/dist/commands/ci/utils/ci-summary.d.ts +118 -0
- package/dist/commands/ci/utils/db-url-utils.d.ts +4 -77
- package/dist/commands/ci/utils/github-api.d.ts +14 -0
- package/dist/commands/db/apply/contract.d.ts +73 -0
- package/dist/commands/db/apply/helpers/alter-statement-parsers.d.ts +95 -0
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +0 -61
- package/dist/commands/db/apply/helpers/function-plan-false-positive-filter.d.ts +36 -0
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +4 -4
- package/dist/commands/db/apply/helpers/index.d.ts +14 -5
- package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts +3 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +69 -6
- package/dist/commands/db/apply/helpers/plan-ast.d.ts +56 -0
- package/dist/commands/db/apply/helpers/plan-check-filter.d.ts +26 -0
- package/dist/commands/db/apply/helpers/plan-drop-protection.d.ts +43 -0
- package/dist/commands/db/apply/helpers/plan-ordering.d.ts +6 -0
- package/dist/commands/db/apply/helpers/plan-statement-parser.d.ts +39 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +8 -40
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +1 -10
- package/dist/commands/db/apply/helpers/temp-db-bootstrap.d.ts +18 -0
- package/dist/commands/db/apply/helpers/temp-db-dsn.d.ts +14 -0
- package/dist/commands/db/apply/machine.d.ts +56 -32
- package/dist/commands/db/commands/db-apply-error.d.ts +5 -0
- package/dist/commands/db/commands/db-apply.d.ts +2 -0
- package/dist/commands/db/commands/db-sync/directory-placement-check.d.ts +4 -0
- package/dist/commands/db/commands/db-sync/error-classifier.d.ts +1 -1
- package/dist/commands/db/commands/db-sync/plan-boundary-reconciliation.d.ts +3 -0
- package/dist/commands/db/commands/db-sync/precheck-helpers.d.ts +18 -0
- package/dist/commands/db/commands/db-sync/production-precheck.d.ts +15 -0
- package/dist/commands/db/commands/db-sync/risk-scan-collectors.d.ts +11 -0
- package/dist/commands/db/commands/db-sync.d.ts +11 -5
- package/dist/commands/db/sync/contract.d.ts +80 -0
- package/dist/commands/db/sync/machine.d.ts +60 -1
- package/dist/commands/db/types.d.ts +5 -0
- package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +2 -1
- package/dist/commands/db/utils/boundary-policy/types.d.ts +21 -0
- package/dist/commands/db/utils/boundary-policy-runtime.d.ts +12 -3
- package/dist/commands/db/utils/boundary-policy.d.ts +1 -1
- package/dist/commands/db/utils/db-target.d.ts +5 -3
- package/dist/commands/db/utils/declarative-dependency-collectors.d.ts +6 -0
- package/dist/commands/db/utils/declarative-dependency-contract.d.ts +78 -0
- package/dist/commands/db/utils/declarative-dependency-sql-utils.d.ts +49 -0
- package/dist/commands/db/utils/declarative-dependency-warning-governance.d.ts +24 -0
- package/dist/commands/db/utils/preflight-check.d.ts +1 -1
- package/dist/commands/db/utils/preflight-checks/declarative-dependency-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/idempotent-risk-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/schema-boundary-checks.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/schema-risk-policy.d.ts +4 -0
- package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +12 -0
- package/dist/commands/db/utils/psql.d.ts +23 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +42 -1
- package/dist/commands/env/commands/setup/types.d.ts +1 -0
- package/dist/commands/env/constants/local-supabase.d.ts +4 -1
- package/dist/commands/observability.d.ts +72 -0
- package/dist/commands/observability.helpers.d.ts +25 -0
- package/dist/commands/template-check/commands/template-check.d.ts +1 -0
- package/dist/commands/template-check/contract.d.ts +4 -3
- package/dist/commands/template-check/machine.d.ts +1 -1
- package/dist/commands/workflow/commands/deploy-production.d.ts +0 -1
- package/dist/constants/versions.d.ts +1 -1
- package/dist/{db-XULCILOU.js → db-BPQ2TEQM.js} +14618 -11273
- package/dist/{dev-5YXNPTCJ.js → dev-MLRKIP7F.js} +5 -5
- package/dist/{doctor-MZLOA53G.js → doctor-ROSWSMLH.js} +2 -2
- package/dist/{env-SS66PZ4B.js → env-WNHJVLOT.js} +37 -20
- package/dist/{env-HMMRSYCI.js → env-XPPACZM4.js} +2 -2
- package/dist/{env-files-2UIUYLLR.js → env-files-HRNUGZ5O.js} +1 -1
- package/dist/{error-handler-HEXBRNVV.js → error-handler-YRQWRDEF.js} +17 -0
- package/dist/{hotfix-YA3DGLOM.js → hotfix-Z5EGVSMH.js} +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-ZIL6LRFO.js → init-S2ATHLJ6.js} +1 -1
- package/dist/{inject-test-attrs-P44BVTQS.js → inject-test-attrs-XN4I2AOR.js} +2 -2
- package/dist/internal/machines/index.d.ts +1 -1
- package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
- package/dist/{manifest-TMFLESHW.js → manifest-EGCAZ4TK.js} +1 -1
- package/dist/observability-CJA5UFIC.js +721 -0
- package/dist/{risk-detector-4U6ZJ2G5.js → risk-detector-VO5HJR4R.js} +1 -1
- package/dist/{risk-detector-core-TK4OAI3N.js → risk-detector-core-7WZJZ5ZI.js} +61 -3
- package/dist/risk-detector-plpgsql-ULV7NLDB.js +638 -0
- package/dist/{template-check-3P4HZXVY.js → template-check-BDFMT6ZO.js} +23 -6
- package/dist/{upgrade-NUK3ZBCL.js → upgrade-BDUWBRT5.js} +1 -1
- package/dist/utils/db-url-utils.d.ts +81 -0
- package/dist/validators/risk-detector-plpgsql.d.ts +3 -1
- package/dist/{vuln-check-2W7N5TA2.js → vuln-check-66RXX3TO.js} +1 -1
- package/dist/{vuln-checker-IQJ56RUV.js → vuln-checker-FFOGOJPT.js} +1 -1
- package/dist/{watch-PNTKZYFB.js → watch-ITYW57SL.js} +1 -1
- package/dist/{workflow-H75N4BXX.js → workflow-UZIZ2JUS.js} +2 -3
- package/package.json +3 -3
- package/dist/chunk-IBVVGH6X.js +0 -33
- package/dist/chunk-KWX3JHCY.js +0 -85
- package/dist/commands/ci/machine/actors/finalize/summary.d.ts +0 -32
|
@@ -8,15 +8,11 @@
|
|
|
8
8
|
* - hazard-handler.ts: Hazard parsing, display, and production protection
|
|
9
9
|
* - pg-schema-diff-helpers.ts (this file): Binary verification, plan execution, error detection
|
|
10
10
|
*
|
|
11
|
-
* Re-exports are provided for backward compatibility.
|
|
12
|
-
*
|
|
13
11
|
* Security:
|
|
14
12
|
* - All psql calls use parsePostgresUrl + buildPsqlArgs to prevent SQL injection
|
|
15
13
|
* - Passwords are passed via PGPASSWORD env var, not command line
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
|
-
export { filterFalsePositiveHazards, getIdempotentProtectedObjects, getIdempotentProtectedTables, getIdempotentRoles, isIdempotentRoleHazard, resetIdempotentRolesCache, } from './idempotent-object-registry.js';
|
|
19
|
-
export { buildAllowedHazards, displayCheckModeResults, displayHazardsWithContext, handleHazardsWithContext, handleProductionAuthzProtection, handleProductionDataProtection, parseHazardsWithContext, } from './hazard-handler.js';
|
|
15
|
+
import { type ChildProcess } from 'node:child_process';
|
|
20
16
|
/**
|
|
21
17
|
* Verify pg-schema-diff binary is available.
|
|
22
18
|
*/
|
|
@@ -28,10 +24,14 @@ export interface VerifyPgSchemaDiffBinaryOptions {
|
|
|
28
24
|
* strictVersion=true blocks unsupported/undetectable versions.
|
|
29
25
|
*/
|
|
30
26
|
export declare function verifyPgSchemaDiffBinary(options?: VerifyPgSchemaDiffBinaryOptions): void;
|
|
27
|
+
export interface VerifyDatabaseConnectionOptions {
|
|
28
|
+
/** Override the maximum number of retries (default: 5). */
|
|
29
|
+
maxRetries?: number;
|
|
30
|
+
}
|
|
31
31
|
/**
|
|
32
32
|
* Verify database connection with retry for transient startup errors.
|
|
33
33
|
*/
|
|
34
|
-
export declare function verifyDatabaseConnection(dbUrl: string): Promise<void>;
|
|
34
|
+
export declare function verifyDatabaseConnection(dbUrl: string, options?: VerifyDatabaseConnectionOptions): Promise<void>;
|
|
35
35
|
export interface MissingExtensionDetection {
|
|
36
36
|
detected: boolean;
|
|
37
37
|
missingTypes: string[];
|
|
@@ -58,21 +58,84 @@ export declare function detectPartitionPrivilegeError(errorOutput: string): Part
|
|
|
58
58
|
* Format actionable hint for partition privilege errors.
|
|
59
59
|
*/
|
|
60
60
|
export declare function formatPartitionPrivilegeHint(detection: PartitionPrivilegeDetection): string;
|
|
61
|
+
export interface MissingQualifiedFunctionDetection {
|
|
62
|
+
detected: boolean;
|
|
63
|
+
qualifiedName?: string;
|
|
64
|
+
signature?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Detect schema-qualified "function does not exist" errors in pg-schema-diff output.
|
|
68
|
+
*/
|
|
69
|
+
export declare function detectMissingQualifiedFunction(errorOutput: string): MissingQualifiedFunctionDetection;
|
|
70
|
+
export declare function formatDeclarativeDependencyBoundaryHint(errorOutput: string, schemasDir: string, targetDir?: string): string;
|
|
61
71
|
/**
|
|
62
72
|
* Detect DROP TABLE statements in plan output.
|
|
63
73
|
*/
|
|
64
74
|
export declare function detectDropTableStatements(planOutput: string): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Free idle connection slots before pg-schema-diff plan execution.
|
|
77
|
+
*
|
|
78
|
+
* pg-schema-diff Go binary opens many internal connections during plan phase
|
|
79
|
+
* (schema comparison, check constraints, function dependencies).
|
|
80
|
+
* On Supabase (max_connections=60), built-in services (PostgREST, GoTrue,
|
|
81
|
+
* Realtime, Storage) hold ~8-15 idle connections, leaving insufficient
|
|
82
|
+
* slots for pg-schema-diff.
|
|
83
|
+
*
|
|
84
|
+
* This function terminates idle client backend connections to free slots.
|
|
85
|
+
* Non-fatal: failures are logged as warnings.
|
|
86
|
+
*/
|
|
87
|
+
export declare function freeConnectionSlotsForPgSchemaDiff(dbUrl: string, verbose: boolean): void;
|
|
88
|
+
/**
|
|
89
|
+
* Build SQL that only terminates stale idle client backends.
|
|
90
|
+
*
|
|
91
|
+
* pg-schema-diff itself may keep short-lived idle pooled connections during
|
|
92
|
+
* planning. Killing all idle backends risks terminating the planner's own pool
|
|
93
|
+
* and causes `57P01 terminating connection due to administrator command`.
|
|
94
|
+
*
|
|
95
|
+
* We target only connections that have remained idle for a while, which matches
|
|
96
|
+
* long-lived Supabase service sessions but avoids fresh planner-owned idles.
|
|
97
|
+
*/
|
|
98
|
+
export declare function buildIdleConnectionCleanupSql(): string;
|
|
99
|
+
/**
|
|
100
|
+
* Start a background psql process that continuously frees idle connections.
|
|
101
|
+
*
|
|
102
|
+
* Supabase built-in services (PostgREST, GoTrue, Realtime, Storage) reconnect
|
|
103
|
+
* within milliseconds after termination. A single one-shot cleanup is insufficient
|
|
104
|
+
* because pg-schema-diff plan takes ~20-30s and reaches peak connection usage
|
|
105
|
+
* during fetchDependsOnFunctions, long after the initial cleanup.
|
|
106
|
+
*
|
|
107
|
+
* This daemon runs a PL/pgSQL loop via `spawn` (non-blocking). Since `spawnSync`
|
|
108
|
+
* for pg-schema-diff blocks the Node.js thread, the daemon continues as an
|
|
109
|
+
* independent OS process.
|
|
110
|
+
*
|
|
111
|
+
* @returns ChildProcess handle; caller MUST call `.kill()` after pg-schema-diff completes.
|
|
112
|
+
*/
|
|
113
|
+
export declare function startConnectionCleanupDaemon(dbUrl: string, verbose: boolean): ChildProcess | null;
|
|
114
|
+
/**
|
|
115
|
+
* Stop the connection cleanup daemon.
|
|
116
|
+
*/
|
|
117
|
+
export declare function stopConnectionCleanupDaemon(child: ChildProcess | null, verbose: boolean): void;
|
|
65
118
|
export interface PgSchemaDiffPlanOptions {
|
|
66
119
|
/**
|
|
67
120
|
* Shadow DB DSN for extension type resolution.
|
|
68
121
|
* Passed as --temp-db-dsn to pg-schema-diff.
|
|
69
122
|
*/
|
|
70
123
|
tempDbDsn?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Project root for boundary-aware diagnostics when schemasDir is a temporary bundle.
|
|
126
|
+
*/
|
|
127
|
+
targetDir?: string;
|
|
71
128
|
}
|
|
72
129
|
/** Timeout for pg-schema-diff apply / SSOT cleanup (10 minutes) */
|
|
73
130
|
export declare const PG_SCHEMA_DIFF_APPLY_TIMEOUT_MS = 600000;
|
|
74
131
|
/**
|
|
75
132
|
* Execute pg-schema-diff plan and handle errors.
|
|
133
|
+
*
|
|
134
|
+
* Starts a background connection cleanup daemon for the duration of the plan
|
|
135
|
+
* to prevent connection slot exhaustion on Supabase (max_connections=60).
|
|
136
|
+
*
|
|
137
|
+
* Retries on transient connection failures (SQLSTATE 57P01, TCP reset, etc.)
|
|
138
|
+
* which can occur when Supabase terminates idle connections during plan generation.
|
|
76
139
|
*/
|
|
77
140
|
export declare function executePgSchemaDiffPlan(dbUrl: string, schemasDir: string, includeSchemas: string[], verbose: boolean, options?: PgSchemaDiffPlanOptions): {
|
|
78
141
|
planOutput: string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
2
|
+
export type PlanObjectKind = 'schema' | 'relation' | 'function' | 'function-privilege' | 'type' | 'other';
|
|
3
|
+
export interface AnalyzedPlanStatement {
|
|
4
|
+
statement: PlanStatement;
|
|
5
|
+
strippedSql: string;
|
|
6
|
+
objectKind: PlanObjectKind;
|
|
7
|
+
targetKey: string | null;
|
|
8
|
+
targetRelationKey: string | null;
|
|
9
|
+
targetFunctionKey: string | null;
|
|
10
|
+
phase: number;
|
|
11
|
+
createsRelation: boolean;
|
|
12
|
+
relationDependencies: string[];
|
|
13
|
+
functionDependencies: string[];
|
|
14
|
+
hasDynamicSql: boolean;
|
|
15
|
+
normalizedDefinition?: string;
|
|
16
|
+
normalizedConfig?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AnalyzedPlan {
|
|
19
|
+
plan: ValidatedPlan;
|
|
20
|
+
statements: AnalyzedPlanStatement[];
|
|
21
|
+
createdRelations: Set<string>;
|
|
22
|
+
}
|
|
23
|
+
interface CachedSqlDependencies {
|
|
24
|
+
relationDependencies: string[];
|
|
25
|
+
functionDependencies: string[];
|
|
26
|
+
}
|
|
27
|
+
interface CachedPlpgsqlBodyAnalysis extends CachedSqlDependencies {
|
|
28
|
+
hasDynamicSql: boolean;
|
|
29
|
+
normalizedBody: string;
|
|
30
|
+
}
|
|
31
|
+
interface CachedStatementAnalysis extends Omit<AnalyzedPlanStatement, 'statement'> {
|
|
32
|
+
}
|
|
33
|
+
export interface PlanAnalysisSession {
|
|
34
|
+
parseSql(sql: string): Promise<{
|
|
35
|
+
stmts: Array<{
|
|
36
|
+
stmt: Record<string, unknown>;
|
|
37
|
+
}>;
|
|
38
|
+
} | null>;
|
|
39
|
+
analyzeStatement(sql: string): Promise<CachedStatementAnalysis>;
|
|
40
|
+
extractSqlDependencies(sql: string): Promise<CachedSqlDependencies>;
|
|
41
|
+
analyzePlpgsqlBody(body: string): Promise<CachedPlpgsqlBodyAnalysis>;
|
|
42
|
+
}
|
|
43
|
+
export declare function createPlanAnalysisSession(): PlanAnalysisSession;
|
|
44
|
+
export declare function stripLeadingSetStatements(sql: string): string;
|
|
45
|
+
export declare function analyzePlanStatement(statement: PlanStatement, session?: PlanAnalysisSession): Promise<AnalyzedPlanStatement>;
|
|
46
|
+
export declare function analyzeValidatedPlan(plan: ValidatedPlan, session?: PlanAnalysisSession): Promise<AnalyzedPlan>;
|
|
47
|
+
export declare function stabilizeAnalyzedPlanOrder(analyzedPlan: AnalyzedPlan): {
|
|
48
|
+
plan: ValidatedPlan;
|
|
49
|
+
movedStatements: number;
|
|
50
|
+
};
|
|
51
|
+
export declare function normalizeFunctionDefinitionAst(analyzed: Pick<AnalyzedPlanStatement, 'normalizedDefinition' | 'normalizedConfig'>, dbProconfig?: string[]): {
|
|
52
|
+
normalizedDefinition: string;
|
|
53
|
+
normalizedConfig: string;
|
|
54
|
+
} | null;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=plan-ast.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IdempotentProtectedObjects } from './idempotent-object-registry.js';
|
|
2
|
+
import type { PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
3
|
+
export interface CheckModeFilterResult {
|
|
4
|
+
filteredPlan: ValidatedPlan;
|
|
5
|
+
removedDropStatements: PlanStatement[];
|
|
6
|
+
removedAuthzStatements: PlanStatement[];
|
|
7
|
+
}
|
|
8
|
+
declare function parseRolesFromAuthzStatement(sql: string): string[];
|
|
9
|
+
export declare function stripLeadingSessionStatements(sql: string): string;
|
|
10
|
+
type AuthzTarget = {
|
|
11
|
+
kind: 'function';
|
|
12
|
+
schema: string;
|
|
13
|
+
fullName: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'schema' | 'sequence' | 'table';
|
|
16
|
+
schema: string;
|
|
17
|
+
fullName: string;
|
|
18
|
+
} | null;
|
|
19
|
+
declare function parseAuthzTarget(sql: string): AuthzTarget;
|
|
20
|
+
export declare function isIdempotentManagedAuthzStatement(sql: string, schemasDir?: string): boolean;
|
|
21
|
+
export declare function filterCheckModePlanStatements(plan: ValidatedPlan, protectedTables: string[], protectedObjects: IdempotentProtectedObjects, schemasDir?: string): CheckModeFilterResult;
|
|
22
|
+
export declare function resetManagedAuthzCache(): void;
|
|
23
|
+
export declare const _parseRolesFromAuthzStatement: typeof parseRolesFromAuthzStatement;
|
|
24
|
+
export declare const _parseAuthzTarget: typeof parseAuthzTarget;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=plan-check-filter.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: pg-schema-diff Plan DROP Protection
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Filter DROP TABLE/INDEX/FUNCTION/TRIGGER/VIEW/TYPE/SEQUENCE statements
|
|
5
|
+
* targeting idempotent-managed objects from pg-schema-diff plans.
|
|
6
|
+
* Also blocks DROP SCHEMA for protected schemas (throws error).
|
|
7
|
+
*
|
|
8
|
+
* Extracted from plan-validator.ts for single responsibility.
|
|
9
|
+
*/
|
|
10
|
+
import type { IdempotentProtectedObjects } from './idempotent-object-registry.js';
|
|
11
|
+
import type { PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
12
|
+
export interface FilterResult {
|
|
13
|
+
filteredPlan: ValidatedPlan;
|
|
14
|
+
removedStatements: PlanStatement[];
|
|
15
|
+
}
|
|
16
|
+
declare function isDropStatementForProtected(sql: string, protectedTables: string[]): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a DROP FUNCTION/TRIGGER/VIEW/TYPE/SEQUENCE targets a protected object.
|
|
19
|
+
*
|
|
20
|
+
* For FUNCTION: matches schema.name (argument types stripped).
|
|
21
|
+
* For TRIGGER: matches schema.trigger_name via DROP TRIGGER name ON schema.table.
|
|
22
|
+
* For VIEW/TYPE/SEQUENCE: matches schema.name.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isDropStatementForProtectedObject(sql: string, protectedObjects: IdempotentProtectedObjects): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Extract unique schema names from protected table patterns.
|
|
27
|
+
* e.g., ['location_data.events', 'accounts.clients'] → ['location_data', 'accounts']
|
|
28
|
+
*/
|
|
29
|
+
declare function extractProtectedSchemas(protectedTables: string[]): string[];
|
|
30
|
+
declare function isDropSchemaForProtected(sql: string, protectedTables: string[]): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Filter out DROP TABLE/INDEX statements targeting idempotent-managed tables,
|
|
33
|
+
* and optionally DROP FUNCTION/TRIGGER/VIEW/TYPE/SEQUENCE for protected objects.
|
|
34
|
+
* BLOCKS (throws error) on DROP SCHEMA targeting protected schemas.
|
|
35
|
+
*
|
|
36
|
+
* @param protectedObjects - Optional extended protection for non-table objects.
|
|
37
|
+
* When omitted, only DROP TABLE/INDEX are filtered (backward compatible).
|
|
38
|
+
*/
|
|
39
|
+
export declare function filterIdempotentProtectedStatements(plan: ValidatedPlan, protectedTables: string[], protectedObjects?: IdempotentProtectedObjects): FilterResult;
|
|
40
|
+
export { isDropStatementForProtected as _isDropStatementForProtected };
|
|
41
|
+
export { extractProtectedSchemas as _extractProtectedSchemas };
|
|
42
|
+
export { isDropSchemaForProtected as _isDropSchemaForProtected };
|
|
43
|
+
//# sourceMappingURL=plan-drop-protection.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: pg-schema-diff Plan Statement Parser
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Parse pg-schema-diff plan output into structured statements.
|
|
5
|
+
* Handles two formats:
|
|
6
|
+
* 1. With `-- Statement Idx. N` markers → split into individual statements
|
|
7
|
+
* 2. Without markers → treat as single statement
|
|
8
|
+
*
|
|
9
|
+
* Extracted from plan-validator.ts for single responsibility.
|
|
10
|
+
* For Zod-validated output, use parsePlanOutput() in plan-validator.ts.
|
|
11
|
+
*/
|
|
12
|
+
interface ParsedHazard {
|
|
13
|
+
type: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
interface ParsedStatement {
|
|
17
|
+
index: number;
|
|
18
|
+
sql: string;
|
|
19
|
+
hazards: ParsedHazard[];
|
|
20
|
+
}
|
|
21
|
+
export interface ParsedPlanOutput {
|
|
22
|
+
statements: ParsedStatement[];
|
|
23
|
+
totalStatements: number;
|
|
24
|
+
rawSql: string;
|
|
25
|
+
parseConfidence?: 'high' | 'low';
|
|
26
|
+
}
|
|
27
|
+
export declare function stripBlockComments(line: string, inBlockComment: boolean): {
|
|
28
|
+
text: string;
|
|
29
|
+
inBlockComment: boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Parse pg-schema-diff plan output into structured statements.
|
|
33
|
+
*
|
|
34
|
+
* Returns a raw parsed result without Zod validation.
|
|
35
|
+
* For Zod-validated output, use parsePlanOutput() from plan-validator.ts.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parsePlanStatements(planOutput: string): ParsedPlanOutput;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=plan-statement-parser.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AI HINT: pg-schema-diff Plan Output Validator
|
|
3
3
|
*
|
|
4
|
-
* Purpose:
|
|
5
|
-
* validate with Zod before psql execution (safety gate).
|
|
4
|
+
* Purpose: Zod schemas for plan validation and DDL/hazard safety checks.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
6
|
+
* Architecture (split into 3 modules):
|
|
7
|
+
* - plan-statement-parser.ts: Parse raw plan output into structured statements
|
|
8
|
+
* - plan-drop-protection.ts: Filter DROP statements targeting protected objects
|
|
9
|
+
* - plan-validator.ts (this file): Zod schemas, DDL validation, hazard validation
|
|
8
10
|
*
|
|
9
11
|
* Safety layers:
|
|
10
12
|
* 1. handleHazardsWithContext() in actors.ts → blocks unapproved hazards (primary)
|
|
@@ -12,7 +14,6 @@
|
|
|
12
14
|
* 3. Zod structural validation → ensures plan is well-formed
|
|
13
15
|
*/
|
|
14
16
|
import { z } from 'zod';
|
|
15
|
-
import type { IdempotentProtectedObjects } from './pg-schema-diff-helpers.js';
|
|
16
17
|
export declare const PlanHazardSchema: z.ZodObject<{
|
|
17
18
|
type: z.ZodString;
|
|
18
19
|
message: z.ZodString;
|
|
@@ -45,7 +46,7 @@ export type PlanHazard = z.infer<typeof PlanHazardSchema>;
|
|
|
45
46
|
export type PlanStatement = z.infer<typeof PlanStatementSchema>;
|
|
46
47
|
export type ValidatedPlan = z.infer<typeof ValidatedPlanSchema>;
|
|
47
48
|
/**
|
|
48
|
-
* Parse pg-schema-diff plan output into structured statements.
|
|
49
|
+
* Parse pg-schema-diff plan output into structured, Zod-validated statements.
|
|
49
50
|
*
|
|
50
51
|
* Handles two formats:
|
|
51
52
|
* 1. With `-- Statement Idx. N` markers → split into individual statements
|
|
@@ -54,41 +55,6 @@ export type ValidatedPlan = z.infer<typeof ValidatedPlanSchema>;
|
|
|
54
55
|
* @throws ZodError if parsed result fails structural validation
|
|
55
56
|
*/
|
|
56
57
|
export declare function parsePlanOutput(planOutput: string): ValidatedPlan;
|
|
57
|
-
export interface FilterResult {
|
|
58
|
-
filteredPlan: ValidatedPlan;
|
|
59
|
-
removedStatements: PlanStatement[];
|
|
60
|
-
}
|
|
61
|
-
declare function isDropStatementForProtected(sql: string, protectedTables: string[]): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Check if a DROP FUNCTION/TRIGGER/VIEW/TYPE/SEQUENCE targets a protected object.
|
|
64
|
-
*
|
|
65
|
-
* For FUNCTION: matches schema.name (argument types stripped).
|
|
66
|
-
* For TRIGGER: matches schema.trigger_name via DROP TRIGGER name ON schema.table.
|
|
67
|
-
* For VIEW/TYPE/SEQUENCE: matches schema.name.
|
|
68
|
-
*/
|
|
69
|
-
export declare function isDropStatementForProtectedObject(sql: string, protectedObjects: IdempotentProtectedObjects): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Extract unique schema names from protected table patterns.
|
|
72
|
-
* e.g., ['location_data.events', 'accounts.clients'] → ['location_data', 'accounts']
|
|
73
|
-
*/
|
|
74
|
-
declare function extractProtectedSchemas(protectedTables: string[]): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Check if a SQL statement is a DROP SCHEMA targeting a protected schema.
|
|
77
|
-
* Returns the schema name if protected, null otherwise.
|
|
78
|
-
*/
|
|
79
|
-
declare function isDropSchemaForProtected(sql: string, protectedTables: string[]): string | null;
|
|
80
|
-
/**
|
|
81
|
-
* Filter out DROP TABLE/INDEX statements targeting idempotent-managed tables,
|
|
82
|
-
* and optionally DROP FUNCTION/TRIGGER/VIEW/TYPE/SEQUENCE for protected objects.
|
|
83
|
-
* BLOCKS (throws error) on DROP SCHEMA targeting protected schemas.
|
|
84
|
-
*
|
|
85
|
-
* @param protectedObjects - Optional extended protection for non-table objects.
|
|
86
|
-
* When omitted, only DROP TABLE/INDEX are filtered (backward compatible).
|
|
87
|
-
*/
|
|
88
|
-
export declare function filterIdempotentProtectedStatements(plan: ValidatedPlan, protectedTables: string[], protectedObjects?: IdempotentProtectedObjects): FilterResult;
|
|
89
|
-
export { isDropStatementForProtected as _isDropStatementForProtected };
|
|
90
|
-
export { extractProtectedSchemas as _extractProtectedSchemas };
|
|
91
|
-
export { isDropSchemaForProtected as _isDropSchemaForProtected };
|
|
92
58
|
/**
|
|
93
59
|
* Allowed DDL statement prefixes. Only these statement types are permitted
|
|
94
60
|
* in pg-schema-diff plan output. Checked against the normalized first keyword(s)
|
|
@@ -124,4 +90,6 @@ export declare function validateStatementTypes(plan: ValidatedPlan): void;
|
|
|
124
90
|
* @throws Error if unresolved hazards are found
|
|
125
91
|
*/
|
|
126
92
|
export declare function validatePlanForExecution(plan: ValidatedPlan, allowedHazardTypes: string[]): void;
|
|
93
|
+
export type { FilterResult } from './plan-drop-protection.js';
|
|
94
|
+
export { filterIdempotentProtectedStatements, isDropStatementForProtectedObject, _isDropStatementForProtected, _extractProtectedSchemas, _isDropSchemaForProtected, } from './plan-drop-protection.js';
|
|
127
95
|
//# sourceMappingURL=plan-validator.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Purpose: Retry pg-schema-diff operations on lock_timeout errors
|
|
5
5
|
* Pattern: Exponential backoff with jitter (configurable max delay)
|
|
6
6
|
*/
|
|
7
|
-
import type { IdempotentProtectedObjects } from './
|
|
7
|
+
import type { IdempotentProtectedObjects } from './idempotent-object-registry.js';
|
|
8
8
|
export declare const MAX_RETRIES = 5;
|
|
9
9
|
export declare const BASE_DELAY_MS = 1000;
|
|
10
10
|
export declare const DEFAULT_MAX_DELAY_MS = 30000;
|
|
@@ -53,15 +53,6 @@ export declare function calculateBackoffDelay(attempt: number, maxDelayMs?: numb
|
|
|
53
53
|
* because it can fire for advisory lock failures or other non-DDL lock types.
|
|
54
54
|
*/
|
|
55
55
|
export declare function isLockTimeoutError(errorOutput: string): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Wrap plan SQL for execution.
|
|
58
|
-
*
|
|
59
|
-
* PostgreSQL DDL is transactional (except CREATE INDEX CONCURRENTLY),
|
|
60
|
-
* so we wrap in BEGIN/COMMIT to prevent partial apply on failure.
|
|
61
|
-
*
|
|
62
|
-
* If the plan contains CREATE INDEX CONCURRENTLY, we skip the transaction
|
|
63
|
-
* wrapper because CONCURRENTLY cannot run inside a transaction block.
|
|
64
|
-
*/
|
|
65
56
|
export declare function wrapPlanSql(planSql: string): string;
|
|
66
57
|
/**
|
|
67
58
|
* Options for plan+psql execution with retry.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface DefaultAclRow {
|
|
2
|
+
grantor: string;
|
|
3
|
+
schemaName: string;
|
|
4
|
+
objType: string;
|
|
5
|
+
grantee: string;
|
|
6
|
+
privType: string;
|
|
7
|
+
isGrantable: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildTempDbBootstrapStatements(params: {
|
|
10
|
+
roleNames: string[];
|
|
11
|
+
defaultAclRows: DefaultAclRow[];
|
|
12
|
+
}): string[];
|
|
13
|
+
export declare function bootstrapTempDbFromSource(params: {
|
|
14
|
+
sourceDbUrl: string;
|
|
15
|
+
tempDbDsn: string;
|
|
16
|
+
}): void;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=temp-db-bootstrap.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the temp DB DSN passed to pg-schema-diff.
|
|
3
|
+
*
|
|
4
|
+
* Priority:
|
|
5
|
+
* 1. Explicit shadow DB DSN created by runa
|
|
6
|
+
* 2. External temp DB DSN from environment (for CI-local temp databases)
|
|
7
|
+
* 3. Local Supabase DB DSN fallback (for remote checks from a developer machine)
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolvePgSchemaDiffTempDbDsn(params: {
|
|
10
|
+
shadowDbDsn?: string;
|
|
11
|
+
envTempDbDsn?: string;
|
|
12
|
+
localTempDbDsn?: string;
|
|
13
|
+
}): string | undefined;
|
|
14
|
+
//# sourceMappingURL=temp-db-dsn.d.ts.map
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI HINT: db apply State Machine (Declarative Schema Management)
|
|
3
|
-
*
|
|
4
|
-
* Purpose: Orchestrate schema application to any DB (local, Branch DB, Production)
|
|
5
|
-
*
|
|
6
|
-
* User Journey (2-pass idempotent):
|
|
7
|
-
* 1. Apply idempotent schemas (1st pass: extensions, roles - may skip dependent tables)
|
|
8
|
-
* 2. Run pg-schema-diff (current DB → desired state)
|
|
9
|
-
* 3. Apply idempotent schemas (2nd pass: dependent tables now succeed)
|
|
10
|
-
* 4. Validate partitions (non-blocking drift detection)
|
|
11
|
-
* 5. Apply seeds
|
|
12
|
-
*
|
|
13
|
-
* Why 2-pass idempotent?
|
|
14
|
-
* - Some idempotent SQL depends on declarative tables (e.g., areas → floors)
|
|
15
|
-
* - 1st pass: extensions/roles succeed, dependent tables are skipped (no error)
|
|
16
|
-
* - 2nd pass: dependent tables succeed because declarative tables now exist
|
|
17
|
-
*
|
|
18
|
-
* Architecture:
|
|
19
|
-
* - No migration files needed
|
|
20
|
-
* - pg-schema-diff runs at runtime against actual DB state
|
|
21
|
-
* - Same logic for all environments
|
|
22
|
-
*
|
|
23
|
-
* E2E Test Mapping (CLI observable behavior):
|
|
24
|
-
* - idle → expect(log).toContain('Starting db apply')
|
|
25
|
-
* - applyingIdempotentPre → expect(log).toContain('Applied idempotent schema')
|
|
26
|
-
* - applyingPgSchemaDiff → expect(log).toContain('pg-schema-diff')
|
|
27
|
-
* - applyingIdempotentPost → expect(log).toContain('Applied idempotent schema')
|
|
28
|
-
* - validatingPartitions → expect(log).toContain('partition')
|
|
29
|
-
* - applyingSeeds → expect(log).toContain('Applying seeds')
|
|
30
|
-
* - done → expect(exitCode).toBe(0)
|
|
31
|
-
* - failed → expect(exitCode).toBe(1)
|
|
32
|
-
*/
|
|
33
1
|
import { type SnapshotFrom } from 'xstate';
|
|
34
2
|
import * as actors from './actors.js';
|
|
35
3
|
import type { DbApplyInput } from './contract.js';
|
|
@@ -167,6 +135,62 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
167
135
|
schemaChangesApplied: boolean;
|
|
168
136
|
hazards: string[];
|
|
169
137
|
seedsApplied: boolean;
|
|
138
|
+
outcome: {
|
|
139
|
+
command: string;
|
|
140
|
+
exitMode: "success" | "timeout" | "failed" | "cancelled" | "success_with_warnings";
|
|
141
|
+
startedAt: string;
|
|
142
|
+
endedAt: string;
|
|
143
|
+
durationMs: number;
|
|
144
|
+
phases: {
|
|
145
|
+
id: string;
|
|
146
|
+
label: string;
|
|
147
|
+
status: "timeout" | "warning" | "skipped" | "failed" | "pending" | "running" | "passed" | "cancelled";
|
|
148
|
+
startedAt?: string | undefined;
|
|
149
|
+
endedAt?: string | undefined;
|
|
150
|
+
durationMs?: number | undefined;
|
|
151
|
+
timeoutMs?: number | undefined;
|
|
152
|
+
warningCount?: number | undefined;
|
|
153
|
+
error?: {
|
|
154
|
+
code: string;
|
|
155
|
+
message: string;
|
|
156
|
+
retryable: boolean;
|
|
157
|
+
statusCode?: number | undefined;
|
|
158
|
+
retryAfterMs?: number | undefined;
|
|
159
|
+
phase?: string | undefined;
|
|
160
|
+
details?: Record<string, unknown> | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
warnings?: {
|
|
163
|
+
code: string;
|
|
164
|
+
message: string;
|
|
165
|
+
phase: string;
|
|
166
|
+
details?: Record<string, unknown> | undefined;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
metrics?: Record<string, number> | undefined;
|
|
169
|
+
}[];
|
|
170
|
+
warnings: {
|
|
171
|
+
code: string;
|
|
172
|
+
message: string;
|
|
173
|
+
phase: string;
|
|
174
|
+
details?: Record<string, unknown> | undefined;
|
|
175
|
+
}[];
|
|
176
|
+
errors: {
|
|
177
|
+
code: string;
|
|
178
|
+
message: string;
|
|
179
|
+
retryable: boolean;
|
|
180
|
+
statusCode?: number | undefined;
|
|
181
|
+
retryAfterMs?: number | undefined;
|
|
182
|
+
phase?: string | undefined;
|
|
183
|
+
details?: Record<string, unknown> | undefined;
|
|
184
|
+
}[];
|
|
185
|
+
summary: {
|
|
186
|
+
passed: number;
|
|
187
|
+
warnings: number;
|
|
188
|
+
failed: number;
|
|
189
|
+
skipped: number;
|
|
190
|
+
timedOut: number;
|
|
191
|
+
};
|
|
192
|
+
nextActions?: string[] | undefined;
|
|
193
|
+
};
|
|
170
194
|
idempotentSchemasSkipped?: number | undefined;
|
|
171
195
|
rolePasswordsSet?: number | undefined;
|
|
172
196
|
error?: string | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CLIError } from '@runa-ai/runa';
|
|
2
|
+
type DbApplyEnvironment = 'local' | 'preview' | 'production';
|
|
3
|
+
export declare function buildDbApplyCliError(errorMessage: string, environment: DbApplyEnvironment): CLIError;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=db-apply-error.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AllowlistAwareReport, ExtensionCheckReport } from './types.js';
|
|
2
|
+
export declare function collectDirectoryPlacementReport(): Promise<AllowlistAwareReport>;
|
|
3
|
+
export declare function collectExtensionPlacementReport(): ExtensionCheckReport;
|
|
4
|
+
//# sourceMappingURL=directory-placement-check.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Shared helpers for production precheck reporting
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Small utility functions and constants shared across precheck modules
|
|
5
|
+
* Used by: plan-boundary-reconciliation, directory-placement-check, risk-scan-collectors, production-precheck
|
|
6
|
+
*/
|
|
7
|
+
import type { DeclarativeRiskAllowlistRule, DirectoryPlacementAllowlistRule } from '../../utils/boundary-policy.js';
|
|
8
|
+
import type { ExtensionCheckReport } from './types.js';
|
|
9
|
+
export declare const SHOW_ALLOWLIST_REPORT: boolean;
|
|
10
|
+
export declare const DIRECTORY_PLACEMENT_WARNING_PREFIX = " [misplacement] ";
|
|
11
|
+
export declare function applyStrictModeToReport(report: ExtensionCheckReport, strict: boolean): ExtensionCheckReport;
|
|
12
|
+
export declare function formatAllowlistReason({ label, ruleId, reason, rule, }: {
|
|
13
|
+
label: string;
|
|
14
|
+
ruleId: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
rule?: DeclarativeRiskAllowlistRule | DirectoryPlacementAllowlistRule;
|
|
17
|
+
}): string;
|
|
18
|
+
//# sourceMappingURL=precheck-helpers.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Production apply precheck orchestration
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Run full production precheck pipeline: local risk checks + plan boundary reconciliation.
|
|
5
|
+
* Collects findings, applies strict mode, logs results, and throws on blockers.
|
|
6
|
+
*
|
|
7
|
+
* Used by: db-sync.ts (maybeRunProductionApplyPrecheck)
|
|
8
|
+
*/
|
|
9
|
+
import { type createCLILogger } from '@runa-ai/runa';
|
|
10
|
+
import type { DbApplyOutput } from '../../apply/contract.js';
|
|
11
|
+
import type { RunaDbEnv } from '../../utils/db-target.js';
|
|
12
|
+
import type { SyncOptions } from './types.js';
|
|
13
|
+
export declare function collectProductionApplyRiskReasons(output: DbApplyOutput): string[];
|
|
14
|
+
export declare function maybeRunProductionApplyPrecheck(logger: ReturnType<typeof createCLILogger>, runaEnv: RunaDbEnv, options: SyncOptions): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=production-precheck.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function collectDeclarativeRiskReport(): Promise<{
|
|
2
|
+
blockers: string[];
|
|
3
|
+
warnings: string[];
|
|
4
|
+
allowlist: string[];
|
|
5
|
+
}>;
|
|
6
|
+
export declare function collectIdempotentRiskReport(): Promise<{
|
|
7
|
+
blockers: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
allowlist: string[];
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=risk-scan-collectors.d.ts.map
|
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
* plan boundary reconciliation).
|
|
7
7
|
*
|
|
8
8
|
* Submodules (db-sync/):
|
|
9
|
-
* types.ts
|
|
10
|
-
* sql-parser.ts
|
|
11
|
-
* boundary-classifier.ts
|
|
12
|
-
* plan-hazard-analyzer.ts— pg-schema-diff plan hazard analysis
|
|
13
|
-
* risk-reporter.ts
|
|
9
|
+
* types.ts — Shared type definitions
|
|
10
|
+
* sql-parser.ts — SQL text parsing & embedded SQL extraction
|
|
11
|
+
* boundary-classifier.ts — DDL statement boundary classification
|
|
12
|
+
* plan-hazard-analyzer.ts — pg-schema-diff plan hazard analysis
|
|
13
|
+
* risk-reporter.ts — Risk formatting, deduplication, display
|
|
14
|
+
* error-classifier.ts — Error classification for sync failures
|
|
15
|
+
* precheck-helpers.ts — Shared constants and utilities for prechecks
|
|
16
|
+
* plan-boundary-reconciliation.ts — Plan boundary analysis and reconciliation
|
|
17
|
+
* directory-placement-check.ts — Directory placement scanning
|
|
18
|
+
* risk-scan-collectors.ts — Declarative/idempotent risk scanning
|
|
19
|
+
* production-precheck.ts — Production precheck orchestration
|
|
14
20
|
*/
|
|
15
21
|
import { Command } from 'commander';
|
|
16
22
|
export declare const checkCommand: Command;
|