@runa-ai/runa-cli 0.7.3 → 0.9.0
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-HQMSVN6N.js → build-P2A6345N.js} +2 -2
- package/dist/{check-PCSQPYDM.js → check-4TZHNOZU.js} +4 -4
- package/dist/{chunk-DRSUEMAK.js → chunk-B7C7CLW2.js} +2 -5
- package/dist/{chunk-B3POLMII.js → chunk-BQ336L5T.js} +1 -1
- package/dist/{chunk-6FAU4IGR.js → chunk-ELXXQIGW.js} +4 -1
- package/dist/{chunk-FWMGC5FP.js → chunk-EXR4J2JT.js} +289 -16
- package/dist/{chunk-AO554K3G.js → chunk-GKBE7EIE.js} +1 -1
- package/dist/{chunk-JMJP4A47.js → chunk-GT5DMS5R.js} +20 -2
- package/dist/{chunk-3JO6YP3T.js → chunk-IEKYTCYA.js} +1 -1
- package/dist/{chunk-WPMR7RQ4.js → chunk-IWVXI5O4.js} +2 -2
- package/dist/chunk-KUH3G522.js +72 -0
- package/dist/{chunk-VSH3IXDQ.js → chunk-MAFJAA2P.js} +1 -1
- package/dist/{chunk-CCKG5R4Y.js → chunk-MILCC3B6.js} +1 -1
- package/dist/{chunk-5NKWR4FF.js → chunk-OERS32LW.js} +1 -1
- package/dist/{chunk-2QX7T24B.js → chunk-QKGL6Q2S.js} +1 -1
- package/dist/{chunk-OBYZDT2E.js → chunk-URWDB7YL.js} +15 -78
- package/dist/{chunk-CKRLVEIO.js → chunk-WGRVAGSR.js} +16 -11
- package/dist/chunk-YRNQEJQW.js +9043 -0
- package/dist/chunk-ZWDWFMOX.js +1514 -0
- package/dist/{ci-Z4525QW6.js → ci-S5KSBECX.js} +1226 -1207
- package/dist/{cli-SVXOSMW6.js → cli-TJZCAMB2.js} +30 -30
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts +12 -17
- package/dist/commands/ci/commands/ci-prod-utils.d.ts +7 -0
- package/dist/commands/ci/commands/ci-resolvers.d.ts +1 -2
- package/dist/commands/ci/commands/layer4-discovery.d.ts +2 -0
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts +4 -3
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts +5 -1
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts +1 -1
- package/dist/commands/ci/machine/actors/test/capabilities.d.ts +2 -13
- package/dist/commands/ci/machine/actors/test/index.d.ts +1 -0
- package/dist/commands/ci/machine/actors/test/layer-content.d.ts +11 -0
- package/dist/commands/ci/machine/commands/ci-pr-internal-profile.d.ts +7 -0
- package/dist/commands/ci/machine/commands/ci-step-registry.d.ts +25 -0
- package/dist/commands/ci/machine/commands/step-telemetry.d.ts +1 -2
- package/dist/commands/ci/machine/contract.d.ts +9 -1
- package/dist/commands/ci/machine/guards.d.ts +19 -10
- package/dist/commands/ci/machine/helpers.d.ts +1 -1
- package/dist/commands/ci/machine/machine-execution-helpers.d.ts +5 -2
- package/dist/commands/ci/machine/machine.d.ts +34 -32
- package/dist/commands/ci/machine/selectors.d.ts +6 -0
- package/dist/commands/ci/machine/types.d.ts +3 -1
- package/dist/commands/ci/utils/ci-logging.d.ts +16 -0
- package/dist/commands/ci/utils/rls-verification.d.ts +3 -2
- package/dist/commands/db/apply/actors/pg-schema-diff-actors.d.ts +1 -0
- package/dist/commands/db/apply/actors/seed-actors.d.ts +1 -0
- package/dist/commands/db/apply/contract.d.ts +232 -0
- package/dist/commands/db/apply/helpers/fresh-db-handler.d.ts +3 -1
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +19 -8
- package/dist/commands/db/apply/helpers/index.d.ts +5 -2
- package/dist/commands/db/apply/helpers/no-change-plan.d.ts +2 -0
- package/dist/commands/db/apply/helpers/plan-ast-sql-helpers.d.ts +19 -0
- package/dist/commands/db/apply/helpers/plan-ast.d.ts +1 -2
- package/dist/commands/db/apply/helpers/plan-check-filter.d.ts +11 -14
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +34 -0
- package/dist/commands/db/apply/helpers/planner-artifact.d.ts +65 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +5 -0
- package/dist/commands/db/apply/machine.d.ts +100 -14
- package/dist/commands/db/commands/db-apply-error.d.ts +6 -1
- package/dist/commands/db/commands/db-apply.d.ts +5 -0
- package/dist/commands/db/commands/db-plan.d.ts +3 -0
- package/dist/commands/db/commands/db-preview-profile.d.ts +23 -0
- package/dist/commands/db/commands/db-preview.d.ts +3 -0
- package/dist/commands/db/sync/actors.d.ts +1 -0
- package/dist/commands/db/sync/contract.d.ts +16 -0
- package/dist/commands/db/sync/guardrail-orchestrator.d.ts +15 -0
- package/dist/commands/db/sync/guardrail-reporting.d.ts +12 -0
- package/dist/commands/db/sync/index.d.ts +4 -0
- package/dist/commands/db/sync/machine.d.ts +18 -13
- package/dist/commands/db/sync/schema-guardrail-config-test-support.d.ts +15 -0
- package/dist/commands/db/sync/schema-guardrail-config.d.ts +11 -0
- package/dist/commands/db/sync/schema-guardrail-ddl-order.d.ts +36 -0
- package/dist/commands/db/sync/schema-guardrail-graph-guidance.d.ts +15 -0
- package/dist/commands/db/sync/schema-guardrail-graph-metadata.d.ts +41 -0
- package/dist/commands/db/sync/schema-guardrail-graph-nodes.d.ts +61 -0
- package/dist/commands/db/sync/schema-guardrail-graph-sql-helpers.d.ts +31 -0
- package/dist/commands/db/sync/schema-guardrail-graph-types.d.ts +56 -0
- package/dist/commands/db/sync/schema-guardrail-graph.d.ts +20 -0
- package/dist/commands/db/sync/schema-guardrail-local-blockers.d.ts +7 -0
- package/dist/commands/db/sync/schema-guardrail-phases.d.ts +26 -0
- package/dist/commands/db/sync/schema-guardrail-production-check.d.ts +23 -0
- package/dist/commands/db/sync/schema-guardrail-rewrite.d.ts +46 -0
- package/dist/commands/db/sync/schema-guardrail-runtime.d.ts +5 -0
- package/dist/commands/db/sync/schema-guardrail-semantic-warnings.d.ts +9 -0
- package/dist/commands/db/sync/schema-guardrail-types.d.ts +243 -0
- package/dist/commands/db/sync/schema-guardrail.d.ts +10 -0
- package/dist/commands/db/utils/declarative-dependency-sql-utils.d.ts +1 -1
- package/dist/commands/db/utils/duplicate-function-ownership.d.ts +61 -0
- package/dist/commands/db/utils/plan-size-guard.d.ts +16 -0
- package/dist/commands/db/utils/policy-cross-schema-refs.d.ts +12 -0
- package/dist/commands/db/utils/preflight-checks/duplicate-function-ownership-checks.d.ts +4 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +6 -0
- package/dist/commands/test/commands/layer4-prereqs.d.ts +15 -0
- package/dist/{config-loader-GT3HAQ7U.js → config-loader-N5ODNMD5.js} +2 -2
- package/dist/db-D2OLJDYW.js +12757 -0
- package/dist/{dev-MLRKIP7F.js → dev-LGSMDFJN.js} +7 -6
- package/dist/{doctor-ROSWSMLH.js → doctor-GYX73IEW.js} +4 -4
- package/dist/{env-WNHJVLOT.js → env-KYR6Q7WO.js} +15 -10
- package/dist/{env-files-HRNUGZ5O.js → env-files-ONBC47I6.js} +3 -3
- package/dist/{hotfix-Z5EGVSMH.js → hotfix-RJIAPLAM.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{init-35JLDFHI.js → init-2O6ODG5Z.js} +2 -2
- package/dist/{inject-test-attrs-XN4I2AOR.js → inject-test-attrs-F5A346UV.js} +3 -3
- package/dist/{manifest-EGCAZ4TK.js → manifest-CI4BRWEB.js} +2 -2
- package/dist/{observability-CJA5UFIC.js → observability-WNSCJ5FV.js} +2 -2
- package/dist/pg-schema-diff-helpers-7377FS2D.js +7 -0
- package/dist/{sdk-XK6HQU7S.js → sdk-BTIVPEE5.js} +1 -1
- package/dist/{test-V4KQL574.js → test-QCPN6Z47.js} +74 -46
- package/dist/{upgrade-7L4JIE4K.js → upgrade-QZKEI3NJ.js} +2 -2
- package/dist/utils/db-url-utils.d.ts +4 -77
- package/dist/{vuln-check-D575VXIQ.js → vuln-check-5NUTETPW.js} +1 -1
- package/dist/{vuln-checker-QV6XODTJ.js → vuln-checker-UV342N66.js} +1 -1
- package/dist/{watch-AL4LCBRM.js → watch-RFVCEQLH.js} +3 -3
- package/dist/{workflow-UZIZ2JUS.js → workflow-UOG6ZZMH.js} +3 -3
- package/package.json +3 -3
- package/dist/chunk-4XHZQRRK.js +0 -215
- package/dist/db-S4V4ETDR.js +0 -17556
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SchemaGuardrailConfig } from './schema-guardrail-types.js';
|
|
2
|
+
type GuardrailConfigNormalizers = {
|
|
3
|
+
normalizeAllowlistSignature(value: string): string;
|
|
4
|
+
normalizeFileList(files: Iterable<string>): string[];
|
|
5
|
+
normalizeFunctionQualifiedName(value: string): string;
|
|
6
|
+
normalizePathForMatch(filePath: string): string;
|
|
7
|
+
normalizeSuppressionPair(value: string): string;
|
|
8
|
+
};
|
|
9
|
+
export declare function tryLoadSchemaGuardrailConfigFromText(params: {
|
|
10
|
+
targetDir: string;
|
|
11
|
+
defaults: SchemaGuardrailConfig;
|
|
12
|
+
normalizers: GuardrailConfigNormalizers;
|
|
13
|
+
}): SchemaGuardrailConfig | null;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=schema-guardrail-config-test-support.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SchemaGuardrailConfig } from './schema-guardrail-types.js';
|
|
2
|
+
export declare const DEFAULT_TABLE_HEADER_MAX_WIDTH = 160;
|
|
3
|
+
export declare const DEFAULT_SEMANTIC_WARNING_THRESHOLD = 0.55;
|
|
4
|
+
export declare const DEFAULT_SEMANTIC_WARNING_MAX_CANDIDATES = 3;
|
|
5
|
+
export declare const GENERIC_SIMILARITY_COLUMNS: Set<string>;
|
|
6
|
+
export declare function normalizePathForMatch(filePath: string): string;
|
|
7
|
+
export declare function normalizeFunctionQualifiedName(value: string): string;
|
|
8
|
+
export declare function normalizeAllowlistSignature(value: string): string;
|
|
9
|
+
export declare function normalizeSuppressionPair(value: string): string;
|
|
10
|
+
export declare function loadSchemaGuardrailConfig(targetDir: string): SchemaGuardrailConfig;
|
|
11
|
+
//# sourceMappingURL=schema-guardrail-config.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail - DDL Order Validation
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Detect policy→function dependency ordering issues that would
|
|
5
|
+
* cause "function does not exist" errors during production pg-schema-diff apply.
|
|
6
|
+
*
|
|
7
|
+
* Why this matters:
|
|
8
|
+
* - Local `runa db sync` runs against a fresh DB (all CREATE, no ALTER)
|
|
9
|
+
* - Production `runa db apply` generates ALTER POLICY for changed policies
|
|
10
|
+
* - pg-schema-diff may order ALTER POLICY (phase 50) before CREATE FUNCTION (phase 60)
|
|
11
|
+
* - This check catches the issue statically from SQL files, without needing a live DB
|
|
12
|
+
*
|
|
13
|
+
* Detection: For each CREATE POLICY/ALTER POLICY with a schema-qualified function call,
|
|
14
|
+
* verify the function is defined BEFORE the policy in file ordering (by file prefix number).
|
|
15
|
+
*/
|
|
16
|
+
export interface DdlOrderWarning {
|
|
17
|
+
policyFile: string;
|
|
18
|
+
policyLine: number;
|
|
19
|
+
functionRef: string;
|
|
20
|
+
functionFile: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Scan declarative SQL files for policy→function ordering risks.
|
|
25
|
+
*
|
|
26
|
+
* Returns warnings when a policy references a function that is defined
|
|
27
|
+
* in a later-ordered file (by numeric prefix), which means pg-schema-diff
|
|
28
|
+
* may generate ALTER POLICY before CREATE FUNCTION during incremental apply.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectDdlOrderRisks(declarativeDir: string): DdlOrderWarning[];
|
|
31
|
+
/**
|
|
32
|
+
* Run DDL order check and log warnings.
|
|
33
|
+
* Called from guardrail orchestrator during `runa db sync`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function runDdlOrderCheck(targetDir: string): DdlOrderWarning[];
|
|
36
|
+
//# sourceMappingURL=schema-guardrail-ddl-order.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - Boundary Guidance Warnings
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Generate guidance warnings for schema boundary violations,
|
|
5
|
+
* security definer issues, trigger ownership, and managed schema access
|
|
6
|
+
*/
|
|
7
|
+
import type { SchemaGuardrailReport, SchemaGraphFunctionClaim, SchemaGraphFileNode, SchemaGraphSchemaNode } from './schema-guardrail-types.js';
|
|
8
|
+
declare function buildBoundaryGuidanceWarnings(params: {
|
|
9
|
+
fileNodes: SchemaGraphFileNode[];
|
|
10
|
+
schemaNodes: SchemaGraphSchemaNode[];
|
|
11
|
+
functionClaims: SchemaGraphFunctionClaim[];
|
|
12
|
+
ownerFileByTable: Map<string, string>;
|
|
13
|
+
}): SchemaGuardrailReport['boundaryGuidanceWarnings'];
|
|
14
|
+
export { buildBoundaryGuidanceWarnings };
|
|
15
|
+
//# sourceMappingURL=schema-guardrail-graph-guidance.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - Metadata Analysis
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Function ownership hashing, allowlist checking, and
|
|
5
|
+
* defined function/boundary metadata extraction
|
|
6
|
+
*/
|
|
7
|
+
import { type DuplicateFunctionOwnershipFinding } from '../utils/duplicate-function-ownership.js';
|
|
8
|
+
import { type SqlFile } from '../utils/declarative-dependency-sql-utils.js';
|
|
9
|
+
import { type DefinedFunctionMetadata, type ManagedBoundaryMetadata } from './schema-guardrail-graph-types.js';
|
|
10
|
+
import type { SchemaGuardrailConfig } from './schema-guardrail-types.js';
|
|
11
|
+
declare function normalizeFunctionStatementForHash(statement: string): string;
|
|
12
|
+
declare function buildFunctionBodyHashMap(files: SqlFile[], layer: 'declarative' | 'idempotent'): Map<string, string>;
|
|
13
|
+
declare function isAllowlistedDuplicateFunction(params: {
|
|
14
|
+
finding: DuplicateFunctionOwnershipFinding;
|
|
15
|
+
allowlist: SchemaGuardrailConfig['allowedDuplicateFunctions'];
|
|
16
|
+
bodyHashes: Map<string, string>;
|
|
17
|
+
}): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Collect qualified object references from SQL function bodies
|
|
20
|
+
*/
|
|
21
|
+
declare function normalizeQualifiedObjectRef(schema: string, name: string, isFunctionCall: boolean): string;
|
|
22
|
+
declare function collectQualifiedObjectRefs(params: {
|
|
23
|
+
content: string;
|
|
24
|
+
allowedSchemas: ReadonlySet<string>;
|
|
25
|
+
includeFunctionCalls: boolean;
|
|
26
|
+
}): {
|
|
27
|
+
refs: string[];
|
|
28
|
+
schemas: string[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if function body has SET search_path locked
|
|
32
|
+
*/
|
|
33
|
+
declare function isSearchPathLocked(statement: string): boolean;
|
|
34
|
+
declare function buildDefinedFunctionMetadataByFile(params: {
|
|
35
|
+
files: SqlFile[];
|
|
36
|
+
layer: 'declarative' | 'idempotent';
|
|
37
|
+
managedSchemas: Set<string>;
|
|
38
|
+
}): Map<string, DefinedFunctionMetadata[]>;
|
|
39
|
+
declare function buildManagedBoundaryMetadataByFile(files: SqlFile[]): Map<string, ManagedBoundaryMetadata>;
|
|
40
|
+
export { normalizeFunctionStatementForHash, buildFunctionBodyHashMap, isAllowlistedDuplicateFunction, normalizeQualifiedObjectRef, collectQualifiedObjectRefs, isSearchPathLocked, buildDefinedFunctionMetadataByFile, buildManagedBoundaryMetadataByFile, };
|
|
41
|
+
//# sourceMappingURL=schema-guardrail-graph-metadata.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - Node Building
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Build graph nodes from declarative SQL files
|
|
5
|
+
* Includes: Trigger extraction, declarative file parsing,
|
|
6
|
+
* table/FK/dependency/file node construction
|
|
7
|
+
*/
|
|
8
|
+
import { type SqlFile } from '../utils/declarative-dependency-sql-utils.js';
|
|
9
|
+
import { type DeclarativeFileRecord, type DefinedFunctionMetadata, type ManagedBoundaryMetadata, type IdempotentTouchMetadata } from './schema-guardrail-graph-types.js';
|
|
10
|
+
import type { SchemaGuardrailConfig, SchemaGraphFileDependencyEdge, SchemaGraphFileNode, SchemaGraphFunctionClaim, SchemaGraphPolicyClaim, SchemaGraphPolicyRef, SchemaGraphTableNode, SchemaGraphTriggerRef, SchemaGuardrailReport } from './schema-guardrail-types.js';
|
|
11
|
+
declare function parseCreateTriggerStatement(statement: string): {
|
|
12
|
+
qualifiedTable: string;
|
|
13
|
+
trigger: SchemaGraphTriggerRef;
|
|
14
|
+
} | null;
|
|
15
|
+
declare function appendTriggerRef(triggerMap: Map<string, SchemaGraphTriggerRef[]>, qualifiedTable: string, trigger: SchemaGraphTriggerRef): void;
|
|
16
|
+
declare function extractCreateTriggers(content: string): Map<string, SchemaGraphTriggerRef[]>;
|
|
17
|
+
declare function buildDeclarativeFileRecord(file: SqlFile): Promise<DeclarativeFileRecord>;
|
|
18
|
+
declare function collectDeclarativeClaims(records: DeclarativeFileRecord[]): {
|
|
19
|
+
tableOwnerClaims: Map<string, Set<string>>;
|
|
20
|
+
schemaClaims: Map<string, Set<string>>;
|
|
21
|
+
createSchemaClaims: Map<string, Set<string>>;
|
|
22
|
+
tablePolicies: Map<string, SchemaGraphPolicyRef[]>;
|
|
23
|
+
policyClaims: SchemaGraphPolicyClaim[];
|
|
24
|
+
};
|
|
25
|
+
declare function createDuplicateTableOwners(tableOwnerClaims: Map<string, Set<string>>): SchemaGuardrailReport['duplicateTableOwners'];
|
|
26
|
+
declare function buildFunctionValidationArtifacts(params: {
|
|
27
|
+
targetDir: string;
|
|
28
|
+
config: SchemaGuardrailConfig;
|
|
29
|
+
declarativeFiles: SqlFile[];
|
|
30
|
+
idempotentFiles: SqlFile[];
|
|
31
|
+
}): {
|
|
32
|
+
duplicateFunctionOwners: SchemaGuardrailReport['duplicateFunctionOwners'];
|
|
33
|
+
functionClaims: SchemaGraphFunctionClaim[];
|
|
34
|
+
};
|
|
35
|
+
declare function buildOwnerFileByTable(tableOwnerClaims: Map<string, Set<string>>): Map<string, string>;
|
|
36
|
+
declare function buildPolicyOwnershipConflicts(params: {
|
|
37
|
+
policyClaims: SchemaGraphPolicyClaim[];
|
|
38
|
+
ownerFileByTable: Map<string, string>;
|
|
39
|
+
}): SchemaGuardrailReport['policyOwnershipConflicts'];
|
|
40
|
+
declare function buildTableNodesByName(params: {
|
|
41
|
+
records: DeclarativeFileRecord[];
|
|
42
|
+
tablePolicies: Map<string, SchemaGraphPolicyRef[]>;
|
|
43
|
+
}): Map<string, SchemaGraphTableNode>;
|
|
44
|
+
declare function attachInboundForeignKeys(tableNodesByName: Map<string, SchemaGraphTableNode>): void;
|
|
45
|
+
declare function buildFileDependencies(params: {
|
|
46
|
+
tableNodesByName: Map<string, SchemaGraphTableNode>;
|
|
47
|
+
ownerFileByTable: Map<string, string>;
|
|
48
|
+
}): SchemaGraphFileDependencyEdge[];
|
|
49
|
+
declare function normalizeTriggerFunctionToken(value: string | undefined): string | null;
|
|
50
|
+
declare function buildFileNodes(params: {
|
|
51
|
+
records: DeclarativeFileRecord[];
|
|
52
|
+
idempotentFiles: SqlFile[];
|
|
53
|
+
idempotentTouchMetadata: Map<string, IdempotentTouchMetadata>;
|
|
54
|
+
definedFunctionMetadataByFile: Map<string, DefinedFunctionMetadata[]>;
|
|
55
|
+
managedBoundaryMetadataByFile: Map<string, ManagedBoundaryMetadata>;
|
|
56
|
+
config: SchemaGuardrailConfig;
|
|
57
|
+
fileDependencies: SchemaGraphFileDependencyEdge[];
|
|
58
|
+
managedSchemas: Set<string>;
|
|
59
|
+
}): SchemaGraphFileNode[];
|
|
60
|
+
export { parseCreateTriggerStatement, appendTriggerRef, extractCreateTriggers, buildDeclarativeFileRecord, collectDeclarativeClaims, createDuplicateTableOwners, buildFunctionValidationArtifacts, buildOwnerFileByTable, buildPolicyOwnershipConflicts, buildTableNodesByName, attachInboundForeignKeys, buildFileDependencies, normalizeTriggerFunctionToken, buildFileNodes, };
|
|
61
|
+
//# sourceMappingURL=schema-guardrail-graph-nodes.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - SQL Helpers
|
|
3
|
+
*
|
|
4
|
+
* Purpose: SQL string sanitization, pattern matching, and metadata extraction
|
|
5
|
+
* for idempotent file analysis
|
|
6
|
+
*/
|
|
7
|
+
import { type SqlFile } from '../utils/declarative-dependency-sql-utils.js';
|
|
8
|
+
import type { IdempotentTouchMetadata } from './schema-guardrail-graph-types.js';
|
|
9
|
+
declare function normalizeSqlIdentifier(value: string): string;
|
|
10
|
+
declare function consumeSingleQuotedLiteral(params: {
|
|
11
|
+
content: string;
|
|
12
|
+
startIndex: number;
|
|
13
|
+
prefixLength: number;
|
|
14
|
+
}): {
|
|
15
|
+
blankedText: string;
|
|
16
|
+
nextIndex: number;
|
|
17
|
+
};
|
|
18
|
+
declare function blankSingleQuotedStrings(content: string): string;
|
|
19
|
+
declare function blankDynamicExecuteLiterals(content: string): string;
|
|
20
|
+
declare function sanitizeIdempotentTouchScanContent(content: string): string;
|
|
21
|
+
declare function splitFunctionTargetList(value: string): string[];
|
|
22
|
+
declare function normalizeFunctionTouchTarget(value: string): string | null;
|
|
23
|
+
declare function extractTouchedSchemas(content: string): string[];
|
|
24
|
+
declare function extractTouchedFunctions(content: string): string[];
|
|
25
|
+
declare function normalizeExtensionIdentifier(identifier: string): string;
|
|
26
|
+
declare function extractTouchedExtensions(content: string): string[];
|
|
27
|
+
declare function extractTouchedPolicies(content: string): string[];
|
|
28
|
+
declare function extractIdempotentTouchMetadata(file: SqlFile): IdempotentTouchMetadata;
|
|
29
|
+
export declare function buildIdempotentTouchMetadata(files: SqlFile[]): Map<string, IdempotentTouchMetadata>;
|
|
30
|
+
export { normalizeSqlIdentifier, consumeSingleQuotedLiteral, blankSingleQuotedStrings, blankDynamicExecuteLiterals, sanitizeIdempotentTouchScanContent, splitFunctionTargetList, normalizeFunctionTouchTarget, normalizeExtensionIdentifier, extractTouchedSchemas, extractTouchedFunctions, extractTouchedExtensions, extractTouchedPolicies, extractIdempotentTouchMetadata, };
|
|
31
|
+
//# sourceMappingURL=schema-guardrail-graph-sql-helpers.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - Types & Constants
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Shared types, constants, and tiny utility functions
|
|
5
|
+
* for the schema guardrail graph builder
|
|
6
|
+
*/
|
|
7
|
+
import type { SqlFile } from '../utils/declarative-dependency-sql-utils.js';
|
|
8
|
+
import type { SchemaGraphManifest, SchemaGraphOutboundForeignKey, SchemaGraphPolicyClaim, SchemaGraphTriggerRef } from './schema-guardrail-types.js';
|
|
9
|
+
export type PolicyCommand = 'all' | 'select' | 'insert' | 'update' | 'delete';
|
|
10
|
+
export type IdempotentTouchMetadata = {
|
|
11
|
+
touchedSchemas: string[];
|
|
12
|
+
touchedExtensions: string[];
|
|
13
|
+
touchedFunctions: string[];
|
|
14
|
+
touchedPolicies: string[];
|
|
15
|
+
};
|
|
16
|
+
export type DefinedFunctionMetadata = {
|
|
17
|
+
qualifiedName: string;
|
|
18
|
+
qualifiedSignature: string;
|
|
19
|
+
securityDefiner: boolean;
|
|
20
|
+
searchPathLocked: boolean;
|
|
21
|
+
crossSchemaRefs: string[];
|
|
22
|
+
};
|
|
23
|
+
export type ManagedBoundaryMetadata = {
|
|
24
|
+
schemas: string[];
|
|
25
|
+
refs: string[];
|
|
26
|
+
};
|
|
27
|
+
export type DeclarativeFileRecord = {
|
|
28
|
+
file: SqlFile;
|
|
29
|
+
declaredSchemas: string[];
|
|
30
|
+
createSchemaClaims: string[];
|
|
31
|
+
tables: Array<{
|
|
32
|
+
schema: string;
|
|
33
|
+
name: string;
|
|
34
|
+
qualifiedName: string;
|
|
35
|
+
lineNumber?: number;
|
|
36
|
+
columns: string[];
|
|
37
|
+
outboundForeignKeys: SchemaGraphOutboundForeignKey[];
|
|
38
|
+
}>;
|
|
39
|
+
policies: SchemaGraphPolicyClaim[];
|
|
40
|
+
triggersByTable: Map<string, SchemaGraphTriggerRef[]>;
|
|
41
|
+
};
|
|
42
|
+
export declare const GENERATOR_VERSION = "1.0.0";
|
|
43
|
+
export declare const SQL_IDENTIFIER_PATTERN: RegExp;
|
|
44
|
+
export declare const SQL_EXTENSION_IDENTIFIER_PATTERN: RegExp;
|
|
45
|
+
export declare const QUALIFIED_SQL_OBJECT_RE: RegExp;
|
|
46
|
+
export declare const SECURITY_DEFINER_RE: RegExp;
|
|
47
|
+
export declare const SEARCH_PATH_LOCK_RE: RegExp;
|
|
48
|
+
export declare const MANAGED_BOUNDARY_SCHEMAS: readonly ["auth", "storage", "extensions", "net", "supabase_functions"];
|
|
49
|
+
export declare const TRIGGER_GUIDANCE_SUPPRESSED_FUNCTIONS: Set<string>;
|
|
50
|
+
export declare const MAX_SCHEMA_GUIDANCE_TARGETS_PER_FILE = 3;
|
|
51
|
+
export declare function makeGraphVersion(graph: Omit<SchemaGraphManifest, 'graphVersion' | 'generatedAt'>): string;
|
|
52
|
+
export declare function currentIsoTimestamp(): string;
|
|
53
|
+
export declare function stableSorted<T>(values: Iterable<T>, map: (value: T) => string): T[];
|
|
54
|
+
export declare function normalizeFileList(files: Iterable<string>): string[];
|
|
55
|
+
export declare function normalizePolicyCommand(input: string): PolicyCommand;
|
|
56
|
+
//# sourceMappingURL=schema-guardrail-graph-types.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Schema Guardrail Graph - Orchestration
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Main entry points for schema guardrail graph building
|
|
5
|
+
* Exports: loadSqlSources, buildStaticGraph, StaticGraphBuildResult
|
|
6
|
+
*/
|
|
7
|
+
import type { LoadedSqlSources, SchemaGraphManifest, SchemaGuardrailConfig, SchemaGuardrailReport } from './schema-guardrail-types.js';
|
|
8
|
+
export declare function loadSqlSources(targetDir: string, config: SchemaGuardrailConfig): LoadedSqlSources;
|
|
9
|
+
export type StaticGraphBuildResult = {
|
|
10
|
+
graph: SchemaGraphManifest;
|
|
11
|
+
duplicateTableOwners: SchemaGuardrailReport['duplicateTableOwners'];
|
|
12
|
+
duplicateFunctionOwners: SchemaGuardrailReport['duplicateFunctionOwners'];
|
|
13
|
+
policyOwnershipConflicts: SchemaGuardrailReport['policyOwnershipConflicts'];
|
|
14
|
+
semanticDuplicateWarnings: SchemaGuardrailReport['semanticDuplicateWarnings'];
|
|
15
|
+
boundaryGuidanceWarnings: SchemaGuardrailReport['boundaryGuidanceWarnings'];
|
|
16
|
+
localBlindSpotBlockers: SchemaGuardrailReport['localBlindSpotBlockers'];
|
|
17
|
+
multiFileSchemas: SchemaGuardrailReport['multiFileSchemas'];
|
|
18
|
+
};
|
|
19
|
+
export declare function buildStaticGraph(targetDir: string, config: SchemaGuardrailConfig, sources: LoadedSqlSources): Promise<StaticGraphBuildResult>;
|
|
20
|
+
//# sourceMappingURL=schema-guardrail-graph.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LoadedSqlSources, LocalBlindSpotBlocker, SchemaGraphManifest } from './schema-guardrail-types.js';
|
|
2
|
+
export declare function buildLocalBlindSpotBlockers(params: {
|
|
3
|
+
graph: SchemaGraphManifest;
|
|
4
|
+
sources: LoadedSqlSources;
|
|
5
|
+
managedSchemas: Set<string>;
|
|
6
|
+
}): LocalBlindSpotBlocker[];
|
|
7
|
+
//# sourceMappingURL=schema-guardrail-local-blockers.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SchemaGuardrailReport } from './schema-guardrail-types.js';
|
|
2
|
+
type GuardrailPhaseResult = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
status: 'passed' | 'warning' | 'failed';
|
|
6
|
+
warningCount?: number;
|
|
7
|
+
warnings?: Array<{
|
|
8
|
+
code: string;
|
|
9
|
+
message: string;
|
|
10
|
+
phase: string;
|
|
11
|
+
details?: Record<string, unknown>;
|
|
12
|
+
}>;
|
|
13
|
+
error?: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
retryable: boolean;
|
|
17
|
+
phase: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function isStaleBlocking(params: {
|
|
21
|
+
targetDir: string;
|
|
22
|
+
strictOption?: boolean;
|
|
23
|
+
}): boolean;
|
|
24
|
+
export declare function createGuardrailOutcomePhases(report: SchemaGuardrailReport): GuardrailPhaseResult[];
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=schema-guardrail-phases.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Post-sync Production DDL Order Check
|
|
3
|
+
*
|
|
4
|
+
* Purpose: After local db sync succeeds, generate a pg-schema-diff plan
|
|
5
|
+
* against production (if credentials available) and validate DDL ordering.
|
|
6
|
+
*
|
|
7
|
+
* This catches ALTER POLICY before CREATE FUNCTION issues that only appear
|
|
8
|
+
* in incremental diffs against an existing production database, not during
|
|
9
|
+
* fresh-DB local syncs.
|
|
10
|
+
*
|
|
11
|
+
* Requires: GH_DATABASE_URL_ADMIN or DATABASE_URL_ADMIN (production)
|
|
12
|
+
* If not available: silently skipped (local-only development is fine)
|
|
13
|
+
*/
|
|
14
|
+
interface ProductionCheckParams {
|
|
15
|
+
targetDir: string;
|
|
16
|
+
logger: {
|
|
17
|
+
info(message: string): void;
|
|
18
|
+
warn(message: string): void;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare function runProductionDdlOrderCheck(params: ProductionCheckParams): Promise<void>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=schema-guardrail-production-check.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SchemaGraphManifest, SchemaManagedBlockKind, SchemaGuardrailConfig, SchemaGuardrailReport, SchemaGuardrailStaticResult } from './schema-guardrail-types.js';
|
|
2
|
+
type RenderedManagedBlock = {
|
|
3
|
+
kind: SchemaManagedBlockKind;
|
|
4
|
+
target: string;
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
7
|
+
export type HeaderRewritePlan = {
|
|
8
|
+
filePath: string;
|
|
9
|
+
originalSql: string;
|
|
10
|
+
expectedFileBlock?: RenderedManagedBlock;
|
|
11
|
+
expectedTableHeaders: RenderedManagedBlock[];
|
|
12
|
+
staleBlocks: Array<{
|
|
13
|
+
file: string;
|
|
14
|
+
kind: SchemaManagedBlockKind;
|
|
15
|
+
target: string;
|
|
16
|
+
}>;
|
|
17
|
+
existingManagedCount: number;
|
|
18
|
+
};
|
|
19
|
+
export declare function loadHeaderRewritePlans(params: {
|
|
20
|
+
targetDir: string;
|
|
21
|
+
graph: SchemaGraphManifest;
|
|
22
|
+
config: SchemaGuardrailConfig;
|
|
23
|
+
report: SchemaGuardrailReport;
|
|
24
|
+
}): {
|
|
25
|
+
staleBlocks: SchemaGuardrailReport['staleBlocks'];
|
|
26
|
+
rewritePlans: HeaderRewritePlan[];
|
|
27
|
+
failure?: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
staleBlocks?: undefined;
|
|
30
|
+
rewritePlans?: undefined;
|
|
31
|
+
failure: SchemaGuardrailStaticResult;
|
|
32
|
+
};
|
|
33
|
+
export declare function finalizeCheckModeReport(params: {
|
|
34
|
+
report: SchemaGuardrailReport;
|
|
35
|
+
graph: SchemaGraphManifest;
|
|
36
|
+
staleBlocks: SchemaGuardrailReport['staleBlocks'];
|
|
37
|
+
targetDir: string;
|
|
38
|
+
strictOption?: boolean;
|
|
39
|
+
}): SchemaGuardrailStaticResult;
|
|
40
|
+
export declare function rewriteManagedHeaders(params: {
|
|
41
|
+
targetDir: string;
|
|
42
|
+
rewritePlans: HeaderRewritePlan[];
|
|
43
|
+
report: SchemaGuardrailReport;
|
|
44
|
+
}): SchemaGuardrailStaticResult | null;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=schema-guardrail-rewrite.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TablesManifest } from '@runa-ai/runa/manifests';
|
|
2
|
+
import type { SchemaGuardrailReport, SchemaGuardrailRuntimeInput } from './schema-guardrail-types.js';
|
|
3
|
+
export declare function loadRuntimeTablesManifest(targetDir: string): TablesManifest | null;
|
|
4
|
+
export declare function runSchemaGuardrailRuntime(input: SchemaGuardrailRuntimeInput): SchemaGuardrailReport;
|
|
5
|
+
//# sourceMappingURL=schema-guardrail-runtime.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TablesManifest } from '@runa-ai/runa/manifests';
|
|
2
|
+
import type { SchemaGraphManifest, SchemaGuardrailConfig, SemanticDuplicateWarning } from './schema-guardrail-types.js';
|
|
3
|
+
export declare function createSemanticWarningDetails(warning: SemanticDuplicateWarning): Record<string, unknown>;
|
|
4
|
+
export declare function buildSemanticDuplicateWarnings(params: {
|
|
5
|
+
graph: SchemaGraphManifest;
|
|
6
|
+
runtimeTables: TablesManifest | null;
|
|
7
|
+
config: SchemaGuardrailConfig;
|
|
8
|
+
}): SemanticDuplicateWarning[];
|
|
9
|
+
//# sourceMappingURL=schema-guardrail-semantic-warnings.d.ts.map
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { SqlFile } from '../utils/declarative-dependency-sql-utils.js';
|
|
2
|
+
export type SchemaManagedBlockKind = 'file-header' | 'table-header';
|
|
3
|
+
export type SchemaGuardrailMode = 'check' | 'sync';
|
|
4
|
+
export type SchemaGraphFileLayer = 'declarative' | 'idempotent';
|
|
5
|
+
export type SchemaGraphFileAuthoringRole = 'declarative-owner' | 'operational';
|
|
6
|
+
export type BoundaryGuidanceWarningKind = 'schema' | 'function' | 'policy' | 'security_definer' | 'trigger_function' | 'managed_boundary';
|
|
7
|
+
export type LocalBlindSpotBlockerKind = 'cross-schema-rls' | 'dynamic-sql' | 'extension-placement';
|
|
8
|
+
export type SchemaGuardrailPhaseId = 'load_sources' | 'build_static_graph' | 'validate_ownership' | 'compare_generated_headers' | 'refresh_generated_headers' | 'handoff_db_sync' | 'runtime_reconcile' | 'publish_report';
|
|
9
|
+
export type SchemaGuardrailFailureCode = 'source_load_failed' | 'duplicate_table_owner' | 'duplicate_function_owner' | 'policy_ownership_conflict' | 'raw_cross_schema_rls_blocked' | 'dynamic_sql_blocked' | 'extension_placement_blocked' | 'stale_generated_header' | 'generated_header_validation_failed' | 'generated_header_rewrite_failed' | 'static_graph_build_failed' | 'critical_runtime_graph_contradiction' | 'sync_apply_failed';
|
|
10
|
+
export interface SchemaGraphFileNode {
|
|
11
|
+
path: string;
|
|
12
|
+
sourceLayer: SchemaGraphFileLayer;
|
|
13
|
+
authoringRole: SchemaGraphFileAuthoringRole;
|
|
14
|
+
domainName?: string;
|
|
15
|
+
declaredSchemas: string[];
|
|
16
|
+
ownedTables: string[];
|
|
17
|
+
forwardDependsOnFiles: string[];
|
|
18
|
+
definedFunctions: string[];
|
|
19
|
+
securityDefinerFunctions: string[];
|
|
20
|
+
securityDefinerContracts: string[];
|
|
21
|
+
triggerFunctions: string[];
|
|
22
|
+
functionCrossSchemaRefs: string[];
|
|
23
|
+
managedBoundarySchemas: string[];
|
|
24
|
+
managedBoundaryRefs: string[];
|
|
25
|
+
touchedSchemas: string[];
|
|
26
|
+
touchedExtensions: string[];
|
|
27
|
+
touchedFunctions: string[];
|
|
28
|
+
touchedPolicies: string[];
|
|
29
|
+
policyCrossSchemaRefs: string[];
|
|
30
|
+
preferredEditSurface?: string;
|
|
31
|
+
idempotentPurpose?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SchemaGraphSchemaNode {
|
|
34
|
+
name: string;
|
|
35
|
+
claimFiles: string[];
|
|
36
|
+
createSchemaFiles?: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface SchemaGraphOutboundForeignKey {
|
|
39
|
+
column: string;
|
|
40
|
+
referencesTable: string;
|
|
41
|
+
referencesColumn: string;
|
|
42
|
+
onDelete?: 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION';
|
|
43
|
+
onUpdate?: 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION';
|
|
44
|
+
}
|
|
45
|
+
export interface SchemaGraphInboundForeignKey {
|
|
46
|
+
fromTable: string;
|
|
47
|
+
fromColumn: string;
|
|
48
|
+
toColumn: string;
|
|
49
|
+
onDelete?: 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION';
|
|
50
|
+
onUpdate?: 'CASCADE' | 'SET NULL' | 'SET DEFAULT' | 'RESTRICT' | 'NO ACTION';
|
|
51
|
+
}
|
|
52
|
+
export interface SchemaGraphPolicyRef {
|
|
53
|
+
name: string;
|
|
54
|
+
command: 'all' | 'select' | 'insert' | 'update' | 'delete';
|
|
55
|
+
}
|
|
56
|
+
export interface SchemaGraphTriggerRef {
|
|
57
|
+
name: string;
|
|
58
|
+
timing: 'BEFORE' | 'AFTER' | 'INSTEAD OF';
|
|
59
|
+
event: string;
|
|
60
|
+
functionName?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SchemaGraphTableNode {
|
|
63
|
+
schema: string;
|
|
64
|
+
name: string;
|
|
65
|
+
qualifiedName: string;
|
|
66
|
+
ownerFile: string;
|
|
67
|
+
lineNumber?: number;
|
|
68
|
+
columns: string[];
|
|
69
|
+
outboundForeignKeys: SchemaGraphOutboundForeignKey[];
|
|
70
|
+
inboundForeignKeys: SchemaGraphInboundForeignKey[];
|
|
71
|
+
policies: SchemaGraphPolicyRef[];
|
|
72
|
+
triggers: SchemaGraphTriggerRef[];
|
|
73
|
+
}
|
|
74
|
+
export interface SchemaGraphFunctionClaim {
|
|
75
|
+
qualifiedName: string;
|
|
76
|
+
signature: string;
|
|
77
|
+
sourceLayer: 'declarative' | 'idempotent';
|
|
78
|
+
sourceFile: string;
|
|
79
|
+
lineNumber?: number;
|
|
80
|
+
bodyHash?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface SchemaGraphPolicyClaim {
|
|
83
|
+
name: string;
|
|
84
|
+
targetTable: string;
|
|
85
|
+
command: 'all' | 'select' | 'insert' | 'update' | 'delete';
|
|
86
|
+
sourceFile: string;
|
|
87
|
+
lineNumber?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface SchemaGraphFileDependencyEdge {
|
|
90
|
+
fromFile: string;
|
|
91
|
+
toFile: string;
|
|
92
|
+
viaTables: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface SchemaGraphManifest {
|
|
95
|
+
version: 1;
|
|
96
|
+
source: 'declarative-sql-ast';
|
|
97
|
+
generatedAt: string;
|
|
98
|
+
generatorVersion: string;
|
|
99
|
+
graphVersion: string;
|
|
100
|
+
files: SchemaGraphFileNode[];
|
|
101
|
+
schemas: SchemaGraphSchemaNode[];
|
|
102
|
+
tables: SchemaGraphTableNode[];
|
|
103
|
+
functionClaims: SchemaGraphFunctionClaim[];
|
|
104
|
+
policyClaims: SchemaGraphPolicyClaim[];
|
|
105
|
+
fileDependencies: SchemaGraphFileDependencyEdge[];
|
|
106
|
+
}
|
|
107
|
+
export interface RuntimeWarningIssue {
|
|
108
|
+
code: 'RUNTIME_EXTRA_TABLE';
|
|
109
|
+
target: string;
|
|
110
|
+
details: string;
|
|
111
|
+
}
|
|
112
|
+
export interface RuntimeContradictionIssue {
|
|
113
|
+
code: 'RUNTIME_TABLE_MISSING' | 'RUNTIME_FK_MISMATCH' | 'RUNTIME_POLICY_MISMATCH' | 'RUNTIME_TRIGGER_MISMATCH';
|
|
114
|
+
target: string;
|
|
115
|
+
details: string;
|
|
116
|
+
}
|
|
117
|
+
export interface SemanticDuplicateEvidence {
|
|
118
|
+
nameSimilarity: number;
|
|
119
|
+
sharedColumns: string[];
|
|
120
|
+
sharedFkNeighborhood: string[];
|
|
121
|
+
sameSchemaAffinity: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface SemanticDuplicateCandidate {
|
|
124
|
+
qualifiedName: string;
|
|
125
|
+
ownerFile: string;
|
|
126
|
+
score: number;
|
|
127
|
+
evidence: SemanticDuplicateEvidence;
|
|
128
|
+
}
|
|
129
|
+
export interface SemanticDuplicateWarning {
|
|
130
|
+
proposedTable: string;
|
|
131
|
+
ownerFile: string;
|
|
132
|
+
candidates: SemanticDuplicateCandidate[];
|
|
133
|
+
score: number;
|
|
134
|
+
evidence: SemanticDuplicateEvidence;
|
|
135
|
+
suggestedNextFile?: string;
|
|
136
|
+
suppressionKey: string;
|
|
137
|
+
}
|
|
138
|
+
export interface BoundaryGuidanceWarning {
|
|
139
|
+
sourceFile: string;
|
|
140
|
+
kind: BoundaryGuidanceWarningKind;
|
|
141
|
+
target: string;
|
|
142
|
+
suggestedDeclarativeFile?: string;
|
|
143
|
+
suggestedIdempotentFile?: string;
|
|
144
|
+
suggestedHelperFunction?: string;
|
|
145
|
+
reason: string;
|
|
146
|
+
}
|
|
147
|
+
export interface LocalBlindSpotBlocker {
|
|
148
|
+
kind: LocalBlindSpotBlockerKind;
|
|
149
|
+
sourceFile: string;
|
|
150
|
+
line?: number;
|
|
151
|
+
target: string;
|
|
152
|
+
details: string;
|
|
153
|
+
suggestedDeclarativeFile?: string;
|
|
154
|
+
suggestedHelper?: string;
|
|
155
|
+
requiredFile?: string;
|
|
156
|
+
}
|
|
157
|
+
export interface SchemaGuardrailReport {
|
|
158
|
+
mode: SchemaGuardrailMode;
|
|
159
|
+
exitMode: 'success' | 'success_with_warnings' | 'failed';
|
|
160
|
+
graphVersion?: string;
|
|
161
|
+
parser: {
|
|
162
|
+
engine: 'ast';
|
|
163
|
+
available: boolean;
|
|
164
|
+
};
|
|
165
|
+
multiFileSchemas: Array<{
|
|
166
|
+
schema: string;
|
|
167
|
+
files: string[];
|
|
168
|
+
}>;
|
|
169
|
+
duplicateTableOwners: Array<{
|
|
170
|
+
qualifiedName: string;
|
|
171
|
+
files: string[];
|
|
172
|
+
}>;
|
|
173
|
+
duplicateFunctionOwners: Array<{
|
|
174
|
+
qualifiedName: string;
|
|
175
|
+
signature: string | null;
|
|
176
|
+
declarativeFiles: string[];
|
|
177
|
+
idempotentFiles: string[];
|
|
178
|
+
}>;
|
|
179
|
+
policyOwnershipConflicts: Array<{
|
|
180
|
+
policyName: string;
|
|
181
|
+
targetTable: string;
|
|
182
|
+
files: string[];
|
|
183
|
+
tableOwnerFile: string;
|
|
184
|
+
}>;
|
|
185
|
+
semanticDuplicateWarnings: SemanticDuplicateWarning[];
|
|
186
|
+
boundaryGuidanceWarnings: BoundaryGuidanceWarning[];
|
|
187
|
+
localBlindSpotBlockers: LocalBlindSpotBlocker[];
|
|
188
|
+
staleBlocks: Array<{
|
|
189
|
+
file: string;
|
|
190
|
+
kind: SchemaManagedBlockKind;
|
|
191
|
+
target: string;
|
|
192
|
+
}>;
|
|
193
|
+
headersRewritten: string[];
|
|
194
|
+
rewritesRetainedOnDisk: boolean;
|
|
195
|
+
applyCommitted: boolean;
|
|
196
|
+
runtimeWarnings: RuntimeWarningIssue[];
|
|
197
|
+
runtimeContradictions: RuntimeContradictionIssue[];
|
|
198
|
+
failure?: {
|
|
199
|
+
phase: SchemaGuardrailPhaseId;
|
|
200
|
+
code: SchemaGuardrailFailureCode;
|
|
201
|
+
message: string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export interface SchemaGuardrailStaticInput {
|
|
205
|
+
targetDir: string;
|
|
206
|
+
mode: SchemaGuardrailMode;
|
|
207
|
+
strictOption?: boolean;
|
|
208
|
+
enableLocalBlindSpotBlockers?: boolean;
|
|
209
|
+
}
|
|
210
|
+
export interface SchemaGuardrailStaticResult {
|
|
211
|
+
graph: SchemaGraphManifest | null;
|
|
212
|
+
report: SchemaGuardrailReport;
|
|
213
|
+
}
|
|
214
|
+
export interface SchemaGuardrailRuntimeInput {
|
|
215
|
+
targetDir: string;
|
|
216
|
+
graph: SchemaGraphManifest;
|
|
217
|
+
report: SchemaGuardrailReport;
|
|
218
|
+
}
|
|
219
|
+
export type SchemaGuardrailConfig = {
|
|
220
|
+
declarativeSqlDir: string;
|
|
221
|
+
allowedDuplicateFunctions: Array<{
|
|
222
|
+
qualifiedName: string;
|
|
223
|
+
signature: string;
|
|
224
|
+
reason: string;
|
|
225
|
+
declarativeFile?: string;
|
|
226
|
+
idempotentFile?: string;
|
|
227
|
+
expectedBodyHash?: string;
|
|
228
|
+
}>;
|
|
229
|
+
generatedHeaderRewriteTargets: string[];
|
|
230
|
+
semanticWarnings: {
|
|
231
|
+
threshold: number;
|
|
232
|
+
maxCandidates: number;
|
|
233
|
+
ignorePairs: Set<string>;
|
|
234
|
+
};
|
|
235
|
+
tableHeaderMaxWidth: number;
|
|
236
|
+
excludeFromOrphanDetection: string[];
|
|
237
|
+
idempotentSqlDir: string;
|
|
238
|
+
};
|
|
239
|
+
export type LoadedSqlSources = {
|
|
240
|
+
declarativeFiles: SqlFile[];
|
|
241
|
+
idempotentFiles: SqlFile[];
|
|
242
|
+
};
|
|
243
|
+
//# sourceMappingURL=schema-guardrail-types.d.ts.map
|