@runa-ai/runa-cli 0.5.71 → 0.6.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-BXUJKYHC.js +1730 -0
- package/dist/cache-H63JKFYH.js +112 -0
- package/dist/check-6AB5NGWK.js +207 -0
- package/dist/chunk-22CS6EMA.js +31 -0
- package/dist/chunk-3FDQW524.js +544 -0
- package/dist/chunk-5NKWR4FF.js +254 -0
- package/dist/chunk-6AALH2ED.js +121 -0
- package/dist/chunk-6Y3LAUGL.js +35 -0
- package/dist/chunk-7QV7U6NI.js +62 -0
- package/dist/chunk-AAIE4F2U.js +140 -0
- package/dist/chunk-CCKG5R4Y.js +59 -0
- package/dist/chunk-CE3DEYFT.js +480 -0
- package/dist/chunk-DRSUEMAK.js +123 -0
- package/dist/chunk-GOGRLQNP.js +12 -0
- package/dist/chunk-HD74F6W2.js +460 -0
- package/dist/chunk-HKUWEGUX.js +36 -0
- package/dist/chunk-HPYJPB5Y.js +408 -0
- package/dist/chunk-IBVVGH6X.js +33 -0
- package/dist/chunk-II7VYQEM.js +179 -0
- package/dist/chunk-JMJP4A47.js +204 -0
- package/dist/chunk-JQXOVCOP.js +574 -0
- package/dist/chunk-JT5SUTWE.js +9 -0
- package/dist/chunk-KWX3JHCY.js +85 -0
- package/dist/chunk-M47WJJVS.js +71 -0
- package/dist/chunk-MNPMZERI.js +194 -0
- package/dist/chunk-MXRWBNIY.js +74 -0
- package/dist/chunk-NPSRD26F.js +149 -0
- package/dist/chunk-P7U52PBY.js +1149 -0
- package/dist/chunk-QDF7QXBL.js +67 -0
- package/dist/chunk-RRGQCUKT.js +48 -0
- package/dist/chunk-RZLYEO4U.js +219 -0
- package/dist/chunk-TYIAD6SB.js +74 -0
- package/dist/chunk-UU55OH7P.js +42 -0
- package/dist/chunk-UWWSAPDR.js +31 -0
- package/dist/chunk-VM3IWOT5.js +458 -0
- package/dist/chunk-VRXHCR5K.js +42 -0
- package/dist/chunk-XJBQINSA.js +351 -0
- package/dist/chunk-ZZOXM6Q4.js +8 -0
- package/dist/ci-V3PIG2GI.js +8322 -0
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/requested-command.d.ts +8 -0
- package/dist/cli-GFRZCJQR.js +661 -0
- package/dist/commands/build/actors/db-sync.d.ts +2 -0
- package/dist/commands/build/actors/static-checks.d.ts +7 -6
- package/dist/commands/build/contract.d.ts +30 -30
- package/dist/commands/build/machine-dry-run.d.ts +3 -0
- package/dist/commands/build/machine-e2e-meta.d.ts +120 -0
- package/dist/commands/build/machine.d.ts +22 -22
- package/dist/commands/build/types.d.ts +2 -4
- package/dist/commands/ci/machine/contract.d.ts +26 -26
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +1 -5
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts +5 -0
- package/dist/commands/ci/machine/formatters/sections/index.d.ts +2 -2
- package/dist/commands/ci/machine/machine-execution-helpers.d.ts +40 -0
- package/dist/commands/ci/machine/machine-state-helpers.d.ts +14 -0
- package/dist/commands/ci/machine/machine.d.ts +12 -12
- package/dist/commands/ci/machine/types.d.ts +0 -5
- package/dist/commands/ci/utils/ci-summary.d.ts +15 -15
- package/dist/commands/ci/utils/execa-helpers.d.ts +1 -0
- package/dist/commands/db/apply/actors/idempotent-actors.d.ts +34 -0
- package/dist/commands/db/apply/actors/lock-actors.d.ts +16 -0
- package/dist/commands/db/apply/actors/pg-schema-diff-actors.d.ts +31 -0
- package/dist/commands/db/apply/actors/seed-actors.d.ts +11 -0
- package/dist/commands/db/apply/actors/shared.d.ts +9 -0
- package/dist/commands/db/apply/actors.d.ts +16 -65
- package/dist/commands/db/apply/contract.d.ts +8 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +3 -4
- package/dist/commands/db/apply/helpers/data-integrity-verifier.d.ts +37 -0
- package/dist/commands/db/apply/helpers/fresh-db-handler.d.ts +34 -0
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +60 -0
- package/dist/commands/db/apply/helpers/idempotent-object-registry.d.ts +96 -0
- package/dist/commands/db/apply/helpers/idempotent-transaction.d.ts +20 -0
- package/dist/commands/db/apply/helpers/index.d.ts +7 -1
- package/dist/commands/db/apply/helpers/partition-validator.d.ts +2 -15
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +18 -162
- package/dist/commands/db/apply/helpers/pg-schema-diff-patterns.d.ts +55 -0
- package/dist/commands/db/apply/helpers/pg-schema-diff-version.d.ts +50 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +30 -10
- package/dist/commands/db/apply/helpers/rbac-password-manager.d.ts +34 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +16 -2
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts +1 -1
- package/dist/commands/db/apply/helpers/sql-utils.d.ts +26 -0
- package/dist/commands/db/apply/machine.d.ts +52 -1
- package/dist/commands/db/commands/db-apply.d.ts +18 -0
- package/dist/commands/db/commands/db-sync/boundary-classifier.d.ts +21 -0
- package/dist/commands/db/commands/db-sync/plan-hazard-analyzer.d.ts +13 -0
- package/dist/commands/db/commands/db-sync/risk-reporter.d.ts +19 -0
- package/dist/commands/db/commands/db-sync/sql-parser.d.ts +25 -0
- package/dist/commands/db/commands/db-sync/types.d.ts +47 -0
- package/dist/commands/db/commands/db-sync.d.ts +14 -0
- package/dist/commands/db/sync/contract.d.ts +6 -2
- package/dist/commands/db/sync/machine.d.ts +2 -1
- package/dist/commands/db/types.d.ts +2 -0
- package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +11 -0
- package/dist/commands/db/utils/boundary-policy/types.d.ts +105 -0
- package/dist/commands/db/utils/boundary-policy/validation.d.ts +20 -0
- package/dist/commands/db/utils/boundary-policy-runtime.d.ts +28 -0
- package/dist/commands/db/utils/boundary-policy.d.ts +5 -0
- package/dist/commands/db/utils/idempotent-risk-context.d.ts +29 -0
- package/dist/commands/db/utils/preflight-check.d.ts +14 -0
- package/dist/commands/db/utils/preflight-checks/domain-naming-checks.d.ts +106 -0
- package/dist/commands/db/utils/preflight-checks/orphan-checks.d.ts +36 -0
- package/dist/commands/db/utils/preflight-checks/schema-risk-checks.d.ts +22 -0
- package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +55 -0
- package/dist/commands/db/utils/risk-detector-loader.d.ts +8 -0
- package/dist/commands/db/utils/schema-precheck-budget.d.ts +17 -0
- package/dist/commands/db/utils/sql-boundary-parser.d.ts +12 -0
- package/dist/commands/db/utils/sql-file-collector.d.ts +8 -0
- package/dist/commands/db/utils/sql-filename-parser.d.ts +20 -0
- package/dist/commands/db/utils/sql-table-extractor-ast.d.ts +19 -0
- package/dist/commands/db/utils/sql-table-extractor-regex.d.ts +50 -0
- package/dist/commands/db/utils/sql-table-extractor-rls.d.ts +13 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +79 -1
- package/dist/commands/db/utils/table-registry-introspection.d.ts +68 -0
- package/dist/commands/db/utils/table-registry.d.ts +3 -38
- package/dist/commands/dev/actors/app-lifecycle.d.ts +18 -0
- package/dist/commands/dev/actors/index.d.ts +7 -2
- package/dist/commands/dev/actors/process-check.d.ts +12 -0
- package/dist/commands/dev/actors/shared.d.ts +15 -0
- package/dist/commands/dev/contract.d.ts +2 -2
- package/dist/commands/dev/machine.d.ts +7 -31
- package/dist/commands/env/commands/env-pull/auth.d.ts +13 -0
- package/dist/commands/env/commands/env-pull/dotenv-files.d.ts +14 -0
- package/dist/commands/env/commands/env-pull/security.d.ts +12 -0
- package/dist/commands/env/commands/env-pull/service.d.ts +8 -0
- package/dist/commands/env/commands/env-pull/shared.d.ts +79 -0
- package/dist/commands/env/commands/setup/types.d.ts +1 -1
- package/dist/commands/env/constants/local-supabase.d.ts +2 -0
- package/dist/commands/template-check/contract.d.ts +6 -6
- package/dist/commands/template-check/machine.d.ts +2 -2
- package/dist/commands/template-check/types.d.ts +0 -4
- package/dist/commands/template-check/utils/diff-analyzer.d.ts +0 -4
- package/dist/config/env.d.ts +4 -4
- package/dist/config-loader-GT3HAQ7U.js +7 -0
- package/dist/db-HR7CREX2.js +15913 -0
- package/dist/dev-A7RW6XQV.js +873 -0
- package/dist/env-B47Z4747.js +2624 -0
- package/dist/env-HMMRSYCI.js +7 -0
- package/dist/env-files-K2C7O7L5.js +8 -0
- package/dist/error-handler-4EYSDOSE.js +460 -0
- package/dist/hotfix-CULKKMGS.js +1477 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +48 -42912
- package/dist/init-ELK5QCWR.js +632 -0
- package/dist/inject-test-attrs-Y5UD5P7Q.js +36 -0
- package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
- package/dist/lib/sql-comment-utils.d.ts +25 -0
- package/dist/license-OB7GVJQ2.js +468 -0
- package/dist/link-C43JRZWY.js +60 -0
- package/dist/manifest-2NOQ2IMK.js +32 -0
- package/dist/prepare-32DOVHTE.js +250 -0
- package/dist/risk-detector-BXUY2WKS.js +6 -0
- package/dist/risk-detector-core-O7I7SPR7.js +166 -0
- package/dist/risk-detector-plpgsql-SGMVKYJP.js +1856 -0
- package/dist/sdk-XK6HQU7S.js +348 -0
- package/dist/services-7VK5KZTO.js +177 -0
- package/dist/session-SFW5QSXZ.js +142 -0
- package/dist/signal-handler-DO3OANW5.js +6 -0
- package/dist/status-IJ4ZWHMX.js +95 -0
- package/dist/telemetry-FN7V727Y.js +94 -0
- package/dist/template-check-PNG5NQ5H.js +1933 -0
- package/dist/test-QYXE5UVW.js +626 -0
- package/dist/test-gen-QPWOIEHU.js +89 -0
- package/dist/ui-RJAMCWUI.js +331 -0
- package/dist/upgrade-3SLWVNAC.js +625 -0
- package/dist/utils/config-loader.d.ts +0 -3
- package/dist/validate-SM4PXPS7.js +55 -0
- package/dist/validators/risk-detector-content-risks.d.ts +13 -0
- package/dist/validators/risk-detector-core.d.ts +25 -0
- package/dist/validators/risk-detector-patterns.d.ts +15 -0
- package/dist/validators/risk-detector-plpgsql-expression-resolver.d.ts +22 -0
- package/dist/validators/risk-detector-plpgsql-parser.d.ts +5 -0
- package/dist/validators/risk-detector-plpgsql-tokenizer.d.ts +18 -0
- package/dist/validators/risk-detector-plpgsql.d.ts +9 -0
- package/dist/validators/risk-detector-text-utils.d.ts +6 -0
- package/dist/validators/risk-detector-types.d.ts +16 -0
- package/dist/validators/risk-detector.d.ts +7 -26
- package/dist/vuln-check-TYQNEFS7.js +122 -0
- package/dist/vuln-checker-2QXGN5YT.js +2950 -0
- package/dist/watch-UCDVOQAH.js +911 -0
- package/dist/workflow-ZB5Q2PFY.js +898 -0
- package/package.json +4 -1
- package/dist/cli/contract-mode.d.ts.map +0 -1
- package/dist/cli/contract-output.d.ts.map +0 -1
- package/dist/cli/early-flags.d.ts.map +0 -1
- package/dist/cli/error-handler.d.ts.map +0 -1
- package/dist/cli/exec.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/json-output.d.ts.map +0 -1
- package/dist/cli/non-interactive.d.ts.map +0 -1
- package/dist/cli/output-format.d.ts.map +0 -1
- package/dist/cli/signal-handler.d.ts.map +0 -1
- package/dist/commands/build/actors/build.d.ts.map +0 -1
- package/dist/commands/build/actors/clean.d.ts.map +0 -1
- package/dist/commands/build/actors/db-sync.d.ts.map +0 -1
- package/dist/commands/build/actors/index.d.ts.map +0 -1
- package/dist/commands/build/actors/manifest.d.ts.map +0 -1
- package/dist/commands/build/actors/setup.d.ts.map +0 -1
- package/dist/commands/build/actors/static-checks.d.ts.map +0 -1
- package/dist/commands/build/actors/validate.d.ts.map +0 -1
- package/dist/commands/build/commands/build.d.ts.map +0 -1
- package/dist/commands/build/contract.d.ts.map +0 -1
- package/dist/commands/build/guards.d.ts.map +0 -1
- package/dist/commands/build/index.d.ts.map +0 -1
- package/dist/commands/build/machine.d.ts.map +0 -1
- package/dist/commands/build/types.d.ts.map +0 -1
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/check/commands/check.d.ts.map +0 -1
- package/dist/commands/check/index.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-checks.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-layer-content.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-pr-capabilities.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-apply.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-github.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-types.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-utils.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-workflow.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-resolvers.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-static.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-supabase-local.d.ts.map +0 -1
- package/dist/commands/ci/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-build.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-start.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/playwright-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/static-checks.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/apply-seeds.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pgtap-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pull-production.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/reset.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/setup-roles.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/github.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/capabilities.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/run-layers.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-pr.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/machine-runner.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/runtime-env.d.ts.map +0 -1
- package/dist/commands/ci/machine/contract.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment-types.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/progress-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/schema-matrix.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/guards.d.ts.map +0 -1
- package/dist/commands/ci/machine/helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/machine.d.ts.map +0 -1
- package/dist/commands/ci/machine/types.d.ts.map +0 -1
- package/dist/commands/ci/utils/ai-report.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-process.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-runtime.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-config.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-env-schema.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-logging.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-summary.d.ts.map +0 -1
- package/dist/commands/ci/utils/config-readers.d.ts.map +0 -1
- package/dist/commands/ci/utils/db-url-utils.d.ts.map +0 -1
- package/dist/commands/ci/utils/e2e-auth-setup.d.ts.map +0 -1
- package/dist/commands/ci/utils/env-security.d.ts.map +0 -1
- package/dist/commands/ci/utils/execa-helpers.d.ts.map +0 -1
- package/dist/commands/ci/utils/exit-code-computation.d.ts.map +0 -1
- package/dist/commands/ci/utils/github-api.d.ts.map +0 -1
- package/dist/commands/ci/utils/github.d.ts.map +0 -1
- package/dist/commands/ci/utils/index.d.ts.map +0 -1
- package/dist/commands/ci/utils/pgtap-installer.d.ts.map +0 -1
- package/dist/commands/ci/utils/rls-verification.d.ts.map +0 -1
- package/dist/commands/ci/utils/schema-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/seed-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/test-parallel.d.ts.map +0 -1
- package/dist/commands/ci/utils/timestamp-invariants.d.ts.map +0 -1
- package/dist/commands/ci/utils/workflow-idempotency.d.ts.map +0 -1
- package/dist/commands/db/apply/actors.d.ts.map +0 -1
- package/dist/commands/db/apply/contract.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/index.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-prefilter.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/plan-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/retry-logic.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts.map +0 -1
- package/dist/commands/db/apply/index.d.ts.map +0 -1
- package/dist/commands/db/apply/machine.d.ts.map +0 -1
- package/dist/commands/db/commands/db-apply.d.ts.map +0 -1
- package/dist/commands/db/commands/db-audit.d.ts.map +0 -1
- package/dist/commands/db/commands/db-backup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-cleanup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-role-passwords.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-urls.d.ts.map +0 -1
- package/dist/commands/db/commands/db-diagram.d.ts.map +0 -1
- package/dist/commands/db/commands/db-drizzle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-extension.d.ts.map +0 -1
- package/dist/commands/db/commands/db-generate-password.d.ts.map +0 -1
- package/dist/commands/db/commands/db-lifecycle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-rollback.d.ts.map +0 -1
- package/dist/commands/db/commands/db-schema.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-metadata.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-verify.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed.d.ts.map +0 -1
- package/dist/commands/db/commands/db-snapshot.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stack.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stats.d.ts.map +0 -1
- package/dist/commands/db/commands/db-sync.d.ts.map +0 -1
- package/dist/commands/db/commands/db-test.d.ts.map +0 -1
- package/dist/commands/db/constants.d.ts.map +0 -1
- package/dist/commands/db/extension-registry.d.ts.map +0 -1
- package/dist/commands/db/index.d.ts.map +0 -1
- package/dist/commands/db/preflight/actors.d.ts.map +0 -1
- package/dist/commands/db/preflight/contract.d.ts.map +0 -1
- package/dist/commands/db/preflight/index.d.ts.map +0 -1
- package/dist/commands/db/sync/actors.d.ts.map +0 -1
- package/dist/commands/db/sync/contract.d.ts.map +0 -1
- package/dist/commands/db/sync/index.d.ts.map +0 -1
- package/dist/commands/db/sync/machine.d.ts.map +0 -1
- package/dist/commands/db/types.d.ts.map +0 -1
- package/dist/commands/db/utils/db-target.d.ts.map +0 -1
- package/dist/commands/db/utils/db-url-builder.d.ts.map +0 -1
- package/dist/commands/db/utils/error-handlers.d.ts.map +0 -1
- package/dist/commands/db/utils/import-impact-analyzer.d.ts.map +0 -1
- package/dist/commands/db/utils/preflight-check.d.ts.map +0 -1
- package/dist/commands/db/utils/psql.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-sync.d.ts.map +0 -1
- package/dist/commands/db/utils/script-runner.d.ts.map +0 -1
- package/dist/commands/db/utils/seed-manager.d.ts.map +0 -1
- package/dist/commands/db/utils/semantic-mapper.d.ts.map +0 -1
- package/dist/commands/db/utils/sql-table-extractor.d.ts.map +0 -1
- package/dist/commands/db/utils/stack-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/table-registry.d.ts.map +0 -1
- package/dist/commands/db/utils/table-source-classifier.d.ts.map +0 -1
- package/dist/commands/dev/actors/index.d.ts.map +0 -1
- package/dist/commands/dev/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev/contract.d.ts.map +0 -1
- package/dist/commands/dev/guards.d.ts.map +0 -1
- package/dist/commands/dev/helpers/stale-process-detector.d.ts.map +0 -1
- package/dist/commands/dev/machine.d.ts.map +0 -1
- package/dist/commands/dev/types.d.ts.map +0 -1
- package/dist/commands/env/commands/env-check.d.ts.map +0 -1
- package/dist/commands/env/commands/env-encrypt.d.ts.map +0 -1
- package/dist/commands/env/commands/env-pull.d.ts.map +0 -1
- package/dist/commands/env/commands/env-setup.d.ts.map +0 -1
- package/dist/commands/env/commands/env-sync.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/action.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/auth.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/file-export.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/github-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/helpers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/index.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/parsers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/prompts.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/supabase-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/types.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/vercel-api.d.ts.map +0 -1
- package/dist/commands/env/constants/local-supabase.d.ts.map +0 -1
- package/dist/commands/env/index.d.ts.map +0 -1
- package/dist/commands/hotfix/actors.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-complete.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-create.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-deploy.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-status.d.ts.map +0 -1
- package/dist/commands/hotfix/contract.d.ts.map +0 -1
- package/dist/commands/hotfix/index.d.ts.map +0 -1
- package/dist/commands/hotfix/machine.d.ts.map +0 -1
- package/dist/commands/hotfix/metadata.d.ts.map +0 -1
- package/dist/commands/hotfix/utils/hotfix-machine-helper.d.ts.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/action.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/commands/inject-test-attrs.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/contract.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/detection-diagnostics.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/formatter.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/index.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/manifest-generator.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor-utils.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/types.d.ts.map +0 -1
- package/dist/commands/link.d.ts.map +0 -1
- package/dist/commands/manifest/index.d.ts.map +0 -1
- package/dist/commands/prepare/commands/prepare.d.ts.map +0 -1
- package/dist/commands/prepare/index.d.ts.map +0 -1
- package/dist/commands/sdk/commands/publish.d.ts.map +0 -1
- package/dist/commands/sdk/index.d.ts.map +0 -1
- package/dist/commands/services/index.d.ts.map +0 -1
- package/dist/commands/session/index.d.ts.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/commands/template-check/actors/compare.d.ts.map +0 -1
- package/dist/commands/template-check/actors/discover.d.ts.map +0 -1
- package/dist/commands/template-check/actors/index.d.ts.map +0 -1
- package/dist/commands/template-check/actors/report.d.ts.map +0 -1
- package/dist/commands/template-check/commands/template-check.d.ts.map +0 -1
- package/dist/commands/template-check/config.d.ts.map +0 -1
- package/dist/commands/template-check/contract.d.ts.map +0 -1
- package/dist/commands/template-check/index.d.ts.map +0 -1
- package/dist/commands/template-check/machine.d.ts.map +0 -1
- package/dist/commands/template-check/types.d.ts.map +0 -1
- package/dist/commands/template-check/utils/diff-analyzer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/normalizer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/path-mapping.d.ts.map +0 -1
- package/dist/commands/test/commands/test-db.d.ts.map +0 -1
- package/dist/commands/test/commands/test-e2e.d.ts.map +0 -1
- package/dist/commands/test/commands/test-fast.d.ts.map +0 -1
- package/dist/commands/test/commands/test-integration.d.ts.map +0 -1
- package/dist/commands/test/commands/test-layer.d.ts.map +0 -1
- package/dist/commands/test/commands/test-owasp-generate.d.ts.map +0 -1
- package/dist/commands/test/commands/test-service.d.ts.map +0 -1
- package/dist/commands/test/commands/test-static.d.ts.map +0 -1
- package/dist/commands/test/commands/test.d.ts.map +0 -1
- package/dist/commands/test/index.d.ts.map +0 -1
- package/dist/commands/test-gen.d.ts.map +0 -1
- package/dist/commands/ui.d.ts.map +0 -1
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/vuln-check.d.ts.map +0 -1
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/workflow/commands/deploy-production.d.ts.map +0 -1
- package/dist/commands/workflow/commands/final-status.d.ts.map +0 -1
- package/dist/commands/workflow/commands/log.d.ts.map +0 -1
- package/dist/commands/workflow/commands/notify.d.ts.map +0 -1
- package/dist/commands/workflow/commands/paths.d.ts.map +0 -1
- package/dist/commands/workflow/commands/sync.d.ts.map +0 -1
- package/dist/commands/workflow/commands/validate.d.ts.map +0 -1
- package/dist/commands/workflow/commands/verify-credentials.d.ts.map +0 -1
- package/dist/commands/workflow/index.d.ts.map +0 -1
- package/dist/commands/workflow/types.d.ts.map +0 -1
- package/dist/config/env-files.d.ts.map +0 -1
- package/dist/config/env.d.ts.map +0 -1
- package/dist/constants/versions.d.ts.map +0 -1
- package/dist/contracts/envelope.d.ts.map +0 -1
- package/dist/errors/catalog.d.ts.map +0 -1
- package/dist/errors/exit-codes.d.ts.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/incremental/affected-tests.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/machines/index.d.ts.map +0 -1
- package/dist/internal/machines/machine-runner.d.ts.map +0 -1
- package/dist/internal/machines/snapshot-helpers.d.ts.map +0 -1
- package/dist/internal/machines/types.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/dependency-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/rls-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/secret-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/typescript-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/config/loader.d.ts.map +0 -1
- package/dist/internal/vuln-checker/constants.d.ts.map +0 -1
- package/dist/internal/vuln-checker/ignore/matcher.d.ts.map +0 -1
- package/dist/internal/vuln-checker/index.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/console-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/json-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/markdown-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/sarif-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/security/path-validation.d.ts.map +0 -1
- package/dist/internal/vuln-checker/types.d.ts.map +0 -1
- package/dist/notifiers/desktop-notifier.d.ts.map +0 -1
- package/dist/ui/components/db-panel.d.ts.map +0 -1
- package/dist/ui/components/status-bar.d.ts.map +0 -1
- package/dist/ui/components/test-panel.d.ts.map +0 -1
- package/dist/ui/dashboard.d.ts.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/utils/config-loader.d.ts.map +0 -1
- package/dist/utils/config-updater.d.ts.map +0 -1
- package/dist/utils/diagnostics.d.ts.map +0 -1
- package/dist/utils/dotenvx.d.ts.map +0 -1
- package/dist/utils/env-local-bridge.d.ts.map +0 -1
- package/dist/utils/execution-plan.d.ts.map +0 -1
- package/dist/utils/github-output-security.d.ts.map +0 -1
- package/dist/utils/help-system.d.ts.map +0 -1
- package/dist/utils/license/admin-auth.d.ts.map +0 -1
- package/dist/utils/license/allowlist-checker.d.ts.map +0 -1
- package/dist/utils/license/ci-detector.d.ts.map +0 -1
- package/dist/utils/license/index.d.ts.map +0 -1
- package/dist/utils/license/owner-resolver.d.ts.map +0 -1
- package/dist/utils/license/types.d.ts.map +0 -1
- package/dist/utils/license/validate-owner.d.ts.map +0 -1
- package/dist/utils/path-security.d.ts.map +0 -1
- package/dist/utils/port-allocator.d.ts.map +0 -1
- package/dist/utils/secure-exec.d.ts.map +0 -1
- package/dist/utils/template-fetcher.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils/vercel-project.d.ts.map +0 -1
- package/dist/utils/workspace-detector.d.ts.map +0 -1
- package/dist/validators/risk-detector.d.ts.map +0 -1
- package/dist/validators/schema-validator.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/watchers/schema-watcher.d.ts.map +0 -1
- package/dist/watchers/test-watcher.d.ts.map +0 -1
|
@@ -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 {
|
|
7
|
+
import type { IdempotentProtectedObjects } from './pg-schema-diff-helpers.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;
|
|
@@ -41,7 +41,16 @@ export declare function sleep(ms: number): Promise<void>;
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function calculateBackoffDelay(attempt: number, maxDelayMs?: number): number;
|
|
43
43
|
/**
|
|
44
|
-
* Check if error is a lock_timeout error.
|
|
44
|
+
* Check if error is a lock_timeout error (retryable DDL lock contention).
|
|
45
|
+
*
|
|
46
|
+
* Matches PostgreSQL error patterns for DDL lock failures:
|
|
47
|
+
* - "lock_timeout" — GUC name appearing in error context
|
|
48
|
+
* - "canceling statement due to lock timeout" — explicit lock timeout message
|
|
49
|
+
* - "could not obtain lock on relation" — DDL lock acquisition failure
|
|
50
|
+
* - "deadlock detected" — deadlock between concurrent DDL
|
|
51
|
+
*
|
|
52
|
+
* NOTE: "could not obtain lock" (without "on relation") is intentionally NOT matched
|
|
53
|
+
* because it can fire for advisory lock failures or other non-DDL lock types.
|
|
45
54
|
*/
|
|
46
55
|
export declare function isLockTimeoutError(errorOutput: string): boolean;
|
|
47
56
|
/**
|
|
@@ -79,6 +88,11 @@ export interface PlanSqlRetryConfig extends RetryConfig {
|
|
|
79
88
|
* Extends table protection to functions, triggers, views, types, and sequences.
|
|
80
89
|
*/
|
|
81
90
|
protectedObjects?: IdempotentProtectedObjects;
|
|
91
|
+
/**
|
|
92
|
+
* Fail-closed when plan parser confidence is low.
|
|
93
|
+
* Recommended for production to avoid executing ambiguous SQL plans.
|
|
94
|
+
*/
|
|
95
|
+
failOnLowParseConfidence?: boolean;
|
|
82
96
|
}
|
|
83
97
|
/**
|
|
84
98
|
* Execute plan SQL via psql with retry logic.
|
|
@@ -79,5 +79,5 @@ export declare function createShadowDbWithExtensions(config: ShadowDbConfig): Pr
|
|
|
79
79
|
/**
|
|
80
80
|
* Check if shadow DB with extensions is needed based on config.
|
|
81
81
|
*/
|
|
82
|
-
export declare function needsShadowDb(extensions: string[] | undefined):
|
|
82
|
+
export declare function needsShadowDb(extensions: string[] | undefined): extensions is [string, ...string[]];
|
|
83
83
|
//# sourceMappingURL=shadow-db-manager.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Shared SQL Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Common SQL utilities used across db apply helpers.
|
|
5
|
+
* Eliminates duplication of identifier quoting and validation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validate that a name is a safe SQL identifier (no injection risk).
|
|
9
|
+
* Accepts: alphanumeric + underscore, must start with letter or underscore.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isValidIdentifier(name: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Quote an SQL identifier (double-quote escaping).
|
|
14
|
+
* Escapes embedded double-quotes by doubling them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function quoteIdent(name: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Build a fully qualified table name: "schema"."table"
|
|
19
|
+
*/
|
|
20
|
+
export declare function qualifiedTable(schema: string, table: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Mask database credentials and sensitive information in error messages.
|
|
23
|
+
* Prevents accidental exposure of passwords, hosts, and ports in logs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function maskDbCredentials(message: string): string;
|
|
26
|
+
//# sourceMappingURL=sql-utils.d.ts.map
|
|
@@ -36,6 +36,7 @@ import type { DbApplyInput } from './contract.js';
|
|
|
36
36
|
interface DbApplyContext {
|
|
37
37
|
input: DbApplyInput;
|
|
38
38
|
targetDir: string;
|
|
39
|
+
lockAcquired: boolean;
|
|
39
40
|
idempotentPreApplied: number;
|
|
40
41
|
idempotentPreSkipped: number;
|
|
41
42
|
idempotentPostApplied: number;
|
|
@@ -48,7 +49,14 @@ interface DbApplyContext {
|
|
|
48
49
|
partitionWarnings: string[];
|
|
49
50
|
error: string | null;
|
|
50
51
|
planSql: string | null;
|
|
52
|
+
filteredPlanSql: string | null;
|
|
51
53
|
ssotWarning: string | null;
|
|
54
|
+
idempotentFiles: string[];
|
|
55
|
+
idempotentRisks: {
|
|
56
|
+
high: number;
|
|
57
|
+
medium: number;
|
|
58
|
+
low: number;
|
|
59
|
+
} | null;
|
|
52
60
|
startTime: number;
|
|
53
61
|
idempotentPreStartTime: number | null;
|
|
54
62
|
idempotentPreEndTime: number | null;
|
|
@@ -71,6 +79,15 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
71
79
|
}, {
|
|
72
80
|
input: DbApplyInput;
|
|
73
81
|
targetDir: string;
|
|
82
|
+
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
|
|
83
|
+
acquired: boolean;
|
|
84
|
+
}, {
|
|
85
|
+
input: DbApplyInput;
|
|
86
|
+
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, {
|
|
87
|
+
input: DbApplyInput;
|
|
88
|
+
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<actors.IdempotentPreviewResult, {
|
|
89
|
+
input: DbApplyInput;
|
|
90
|
+
targetDir: string;
|
|
74
91
|
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<actors.ApplyResult, {
|
|
75
92
|
input: DbApplyInput;
|
|
76
93
|
targetDir: string;
|
|
@@ -93,6 +110,27 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
93
110
|
targetDir: string;
|
|
94
111
|
}, import("xstate").EventObject>;
|
|
95
112
|
id: string | undefined;
|
|
113
|
+
} | {
|
|
114
|
+
src: "acquireLock";
|
|
115
|
+
logic: import("xstate").PromiseActorLogic<{
|
|
116
|
+
acquired: boolean;
|
|
117
|
+
}, {
|
|
118
|
+
input: DbApplyInput;
|
|
119
|
+
}, import("xstate").EventObject>;
|
|
120
|
+
id: string | undefined;
|
|
121
|
+
} | {
|
|
122
|
+
src: "releaseLock";
|
|
123
|
+
logic: import("xstate").PromiseActorLogic<void, {
|
|
124
|
+
input: DbApplyInput;
|
|
125
|
+
}, import("xstate").EventObject>;
|
|
126
|
+
id: string | undefined;
|
|
127
|
+
} | {
|
|
128
|
+
src: "previewIdempotentSchemas";
|
|
129
|
+
logic: import("xstate").PromiseActorLogic<actors.IdempotentPreviewResult, {
|
|
130
|
+
input: DbApplyInput;
|
|
131
|
+
targetDir: string;
|
|
132
|
+
}, import("xstate").EventObject>;
|
|
133
|
+
id: string | undefined;
|
|
96
134
|
} | {
|
|
97
135
|
src: "applyIdempotentSchemas";
|
|
98
136
|
logic: import("xstate").PromiseActorLogic<actors.ApplyResult, {
|
|
@@ -117,7 +155,10 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
117
155
|
targetDir: string;
|
|
118
156
|
}, import("xstate").EventObject>;
|
|
119
157
|
id: string | undefined;
|
|
120
|
-
},
|
|
158
|
+
}, {
|
|
159
|
+
type: "releaseAdvisoryLockOnFailure";
|
|
160
|
+
params: unknown;
|
|
161
|
+
}, never, never, "done" | "failed" | "idle" | "acquiringLock" | "previewingIdempotent" | "applyingIdempotentPre" | "applyingPgSchemaDiff" | "applyingIdempotentPost" | "validatingPartitions" | "releasingLock" | "applyingSeeds", string, {
|
|
121
162
|
input: DbApplyInput;
|
|
122
163
|
targetDir: string;
|
|
123
164
|
}, {
|
|
@@ -130,10 +171,17 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
130
171
|
rolePasswordsSet?: number | undefined;
|
|
131
172
|
error?: string | undefined;
|
|
132
173
|
planSql?: string | undefined;
|
|
174
|
+
filteredPlanSql?: string | undefined;
|
|
133
175
|
checkOnly?: boolean | undefined;
|
|
134
176
|
dataViolations?: number | undefined;
|
|
135
177
|
ssotWarning?: string | undefined;
|
|
136
178
|
partitionWarnings?: string[] | undefined;
|
|
179
|
+
idempotentFiles?: string[] | undefined;
|
|
180
|
+
idempotentRisks?: {
|
|
181
|
+
high: number;
|
|
182
|
+
medium: number;
|
|
183
|
+
low: number;
|
|
184
|
+
} | undefined;
|
|
137
185
|
metrics?: {
|
|
138
186
|
totalMs: number;
|
|
139
187
|
idempotentMs?: number | undefined;
|
|
@@ -145,10 +193,13 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
145
193
|
id: "dbApply";
|
|
146
194
|
states: {
|
|
147
195
|
readonly idle: {};
|
|
196
|
+
readonly acquiringLock: {};
|
|
197
|
+
readonly previewingIdempotent: {};
|
|
148
198
|
readonly applyingIdempotentPre: {};
|
|
149
199
|
readonly applyingPgSchemaDiff: {};
|
|
150
200
|
readonly applyingIdempotentPost: {};
|
|
151
201
|
readonly validatingPartitions: {};
|
|
202
|
+
readonly releasingLock: {};
|
|
152
203
|
readonly applyingSeeds: {};
|
|
153
204
|
readonly done: {};
|
|
154
205
|
readonly failed: {};
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import { type DbApplyOutput } from '../apply/index.js';
|
|
3
|
+
export interface DbApplyOptions {
|
|
4
|
+
verbose?: boolean;
|
|
5
|
+
/** Commander pairs --seed/--no-seed into this single property */
|
|
6
|
+
seed?: boolean;
|
|
7
|
+
databaseUrl?: string;
|
|
8
|
+
autoApprove?: boolean;
|
|
9
|
+
allowDataLoss?: boolean;
|
|
10
|
+
confirmAuthzUpdate?: boolean;
|
|
11
|
+
check?: boolean;
|
|
12
|
+
skipDataCheck?: boolean;
|
|
13
|
+
maxLockWaitMs?: number;
|
|
14
|
+
freshDbCheckSql?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Run db apply workflow
|
|
18
|
+
*/
|
|
19
|
+
export declare function runDbApply(env: string, options: DbApplyOptions): Promise<DbApplyOutput>;
|
|
2
20
|
/**
|
|
3
21
|
* db:apply command - Apply schema changes using pg-schema-diff at runtime
|
|
4
22
|
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Boundary Classifier for db-sync precheck
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Classify DDL statements as belonging to declarative or idempotent
|
|
5
|
+
* directories, and detect misplacement risks. Works with the boundary policy
|
|
6
|
+
* to determine which DDL objects are expected in which directory.
|
|
7
|
+
*/
|
|
8
|
+
import type { getBoundaryPolicy } from '../../utils/boundary-policy-runtime.js';
|
|
9
|
+
import type { DirectoryRiskEntry } from './types.js';
|
|
10
|
+
import { GRANT_STATEMENT_RULE_TEXT, PLAN_BOUNDARY_CONTEXT_FILE } from './types.js';
|
|
11
|
+
export { PLAN_BOUNDARY_CONTEXT_FILE, GRANT_STATEMENT_RULE_TEXT };
|
|
12
|
+
export declare function isBoundaryRelevantDdlStatement(statement: string): boolean;
|
|
13
|
+
export declare function isPlanBoundaryAmbiguous(statement: string): boolean;
|
|
14
|
+
export declare function classifyUnknownObjectBoundary(file: string, object: string, fileType: 'declarative' | 'idempotent', policy: ReturnType<typeof getBoundaryPolicy>): DirectoryRiskEntry | null;
|
|
15
|
+
export declare function classifyPlanStatementBoundaryCandidates(statement: string, statementIndex: number, boundaryPolicy: ReturnType<typeof getBoundaryPolicy>, options?: {
|
|
16
|
+
skipDefault?: boolean;
|
|
17
|
+
}): DirectoryRiskEntry[];
|
|
18
|
+
export declare function classifyPlanStatementBoundaryRisk(statement: string, statementIndex: number, boundaryPolicy: ReturnType<typeof getBoundaryPolicy>): DirectoryRiskEntry | undefined;
|
|
19
|
+
export declare function classifyDeclarativeMisplacementRisk(file: string, content: string, boundaryPolicy: ReturnType<typeof getBoundaryPolicy>): DirectoryRiskEntry[];
|
|
20
|
+
export declare function classifyIdempotentMisplacementRisk(file: string, content: string, boundaryPolicy: ReturnType<typeof getBoundaryPolicy>): DirectoryRiskEntry[];
|
|
21
|
+
//# sourceMappingURL=boundary-classifier.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Plan Hazard Analyzer for db-sync precheck
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Analyze pg-schema-diff plan output for hazards (DELETES_DATA,
|
|
5
|
+
* AUTHZ_UPDATE, etc.) and classify their boundary risk level.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlanHazard, PlanStatement } from '../../apply/helpers/plan-validator.js';
|
|
8
|
+
import { type DirectoryRiskEntry, type DirectoryRiskLevel } from './types.js';
|
|
9
|
+
export declare function parseHazardType(hazard: string): string;
|
|
10
|
+
export declare function getPlanHazardBoundaryLevel(type: string): DirectoryRiskLevel;
|
|
11
|
+
export declare function buildPlanHazardBoundaryMessage(statement: string, statementIndex: number, hazard: PlanHazard): string;
|
|
12
|
+
export declare function classifyPlanStatementHazards(statement: PlanStatement): DirectoryRiskEntry[];
|
|
13
|
+
//# sourceMappingURL=plan-hazard-analyzer.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Risk Reporter for db-sync precheck
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Format, deduplicate, and display risk findings from declarative
|
|
5
|
+
* risk analysis, directory placement checks, and plan boundary reconciliation.
|
|
6
|
+
*/
|
|
7
|
+
import type { createCLILogger } from '@runa-ai/runa';
|
|
8
|
+
import type { CompactFinding, DeclarativeRiskItem, DirectoryRiskEntry, DirectoryRiskLevel } from './types.js';
|
|
9
|
+
export declare function getDirectoryRiskWeight(level: DirectoryRiskLevel): number;
|
|
10
|
+
export declare function compareDirectoryRiskPriority(left: DirectoryRiskEntry, right: DirectoryRiskEntry): number;
|
|
11
|
+
export declare function selectHighestPriorityRisk(entries: DirectoryRiskEntry[]): DirectoryRiskEntry | undefined;
|
|
12
|
+
export declare function buildDirectoryRiskKey(entry: DirectoryRiskEntry): string;
|
|
13
|
+
export declare function dedupeDirectoryRisksBySeverity(entries: DirectoryRiskEntry[]): DirectoryRiskEntry[];
|
|
14
|
+
export declare function printList(title: string, items: string[], logger: ReturnType<typeof createCLILogger>): void;
|
|
15
|
+
export declare function stripCommonPrefix(filePath: string): string;
|
|
16
|
+
export declare function formatDeclarativeRiskMessage(risk: DeclarativeRiskItem): string;
|
|
17
|
+
export declare function buildCompactFindingSummary(rawItems: string[]): CompactFinding[];
|
|
18
|
+
export declare function printCompactSummary(logger: ReturnType<typeof createCLILogger>, title: string, rawItems: string[], topLimit: number): void;
|
|
19
|
+
//# sourceMappingURL=risk-reporter.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: SQL Parser for db-sync precheck
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Low-level SQL text parsing utilities for embedded SQL extraction
|
|
5
|
+
* and directory placement analysis. These parsers handle dollar-quoted literals,
|
|
6
|
+
* single-quoted literals, and PL/pgSQL embedded SQL patterns.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isWordChar(char: string): boolean;
|
|
9
|
+
export declare function isWhitespaceChar(char: string): boolean;
|
|
10
|
+
export declare function parseWordAt(statement: string, start: number): {
|
|
11
|
+
value: string;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
} | null;
|
|
15
|
+
export declare function skipWhitespaceAndComments(statement: string, start: number): number;
|
|
16
|
+
export declare function getPreviousWord(statement: string, start: number): string;
|
|
17
|
+
export declare function parseDollarQuotedLiteral(statement: string, start: number): {
|
|
18
|
+
body: string;
|
|
19
|
+
next: number;
|
|
20
|
+
} | null;
|
|
21
|
+
export declare function extractEmbeddableSqlFragments(statement: string): string[];
|
|
22
|
+
export declare function normalizeSqlForPlacementCheck(content: string): string;
|
|
23
|
+
export declare function isPartitionOfCreateTable(statement: string): boolean;
|
|
24
|
+
export declare function dedupeAndSort(lines: string[]): string[];
|
|
25
|
+
//# sourceMappingURL=sql-parser.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SchemaRisk } from '../../../../validators/risk-detector.js';
|
|
2
|
+
export type DeclarativeRiskItem = SchemaRisk & {
|
|
3
|
+
file: string;
|
|
4
|
+
};
|
|
5
|
+
export type DirectoryRiskLevel = 'high' | 'medium' | 'low';
|
|
6
|
+
export declare const DIRECTORY_RISK_ORDER: readonly ["high", "medium", "low"];
|
|
7
|
+
export type DirectoryRiskEntry = {
|
|
8
|
+
file: string;
|
|
9
|
+
level: DirectoryRiskLevel;
|
|
10
|
+
message: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
};
|
|
13
|
+
export type DirectoryRiskRule = {
|
|
14
|
+
level: DirectoryRiskLevel;
|
|
15
|
+
pattern: RegExp | ((statement: string) => boolean);
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
export type ExtensionCheckReport = {
|
|
19
|
+
blockers: string[];
|
|
20
|
+
warnings: string[];
|
|
21
|
+
};
|
|
22
|
+
export type AllowlistAwareReport = ExtensionCheckReport & {
|
|
23
|
+
allowlist: string[];
|
|
24
|
+
stats?: {
|
|
25
|
+
parsedStatements: number;
|
|
26
|
+
planHazards: number;
|
|
27
|
+
classifiedHazardStatements: number;
|
|
28
|
+
classifiedRiskStatements: number;
|
|
29
|
+
allowlistSuppressed: number;
|
|
30
|
+
parseWarnings: number;
|
|
31
|
+
unclassifiedStatements: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type CompactFinding = {
|
|
35
|
+
message: string;
|
|
36
|
+
count: number;
|
|
37
|
+
samples: string[];
|
|
38
|
+
};
|
|
39
|
+
export type SyncOptions = {
|
|
40
|
+
json?: boolean;
|
|
41
|
+
showImportImpact?: boolean;
|
|
42
|
+
withProductionApplyCheck?: boolean;
|
|
43
|
+
strict?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare const PLAN_BOUNDARY_CONTEXT_FILE = "pg-schema-diff plan.sql";
|
|
46
|
+
export declare const GRANT_STATEMENT_RULE_TEXT = "Grant/REVOKE statements are usually idempotent/bootstrap ACL setup and should be treated as such";
|
|
47
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: db-sync command — Schema sync check + production apply precheck
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Compare TypeScript schema vs database, detect schema drift,
|
|
5
|
+
* and run production apply prechecks (declarative risk, directory placement,
|
|
6
|
+
* plan boundary reconciliation).
|
|
7
|
+
*
|
|
8
|
+
* Submodules (db-sync/):
|
|
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
|
+
*/
|
|
1
15
|
import { Command } from 'commander';
|
|
2
16
|
export declare const checkCommand: Command;
|
|
3
17
|
//# sourceMappingURL=db-sync.d.ts.map
|
|
@@ -36,6 +36,7 @@ export declare const DbSyncInputSchema: z.ZodObject<{
|
|
|
36
36
|
autoApprove: z.ZodDefault<z.ZodBoolean>;
|
|
37
37
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
38
38
|
skipCodegen: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
strictIntrospect: z.ZodDefault<z.ZodBoolean>;
|
|
39
40
|
targetDir: z.ZodOptional<z.ZodString>;
|
|
40
41
|
fromProduction: z.ZodDefault<z.ZodBoolean>;
|
|
41
42
|
autoSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -46,9 +47,9 @@ export type DbSyncInput = z.infer<typeof DbSyncInputSchema>;
|
|
|
46
47
|
* Step result type
|
|
47
48
|
*/
|
|
48
49
|
export declare const StepResultSchema: z.ZodEnum<{
|
|
49
|
-
passed: "passed";
|
|
50
|
-
failed: "failed";
|
|
51
50
|
skipped: "skipped";
|
|
51
|
+
failed: "failed";
|
|
52
|
+
passed: "passed";
|
|
52
53
|
}>;
|
|
53
54
|
export type StepResult = z.infer<typeof StepResultSchema>;
|
|
54
55
|
/**
|
|
@@ -104,8 +105,10 @@ export declare const StepContextSchema: z.ZodObject<{
|
|
|
104
105
|
}>;
|
|
105
106
|
check: z.ZodBoolean;
|
|
106
107
|
force: z.ZodBoolean;
|
|
108
|
+
autoApprove: z.ZodBoolean;
|
|
107
109
|
verbose: z.ZodBoolean;
|
|
108
110
|
skipCodegen: z.ZodBoolean;
|
|
111
|
+
strictIntrospect: z.ZodBoolean;
|
|
109
112
|
fromProduction: z.ZodBoolean;
|
|
110
113
|
autoSnapshot: z.ZodBoolean;
|
|
111
114
|
noSeed: z.ZodBoolean;
|
|
@@ -148,6 +151,7 @@ export declare const DbSyncMachineInputSchema: z.ZodObject<{
|
|
|
148
151
|
autoApprove: z.ZodOptional<z.ZodBoolean>;
|
|
149
152
|
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
150
153
|
skipCodegen: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
strictIntrospect: z.ZodOptional<z.ZodBoolean>;
|
|
151
155
|
targetDir: z.ZodOptional<z.ZodString>;
|
|
152
156
|
fromProduction: z.ZodOptional<z.ZodBoolean>;
|
|
153
157
|
autoSnapshot: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -104,13 +104,14 @@ export declare const dbSyncMachine: import("xstate").StateMachine<DbSyncContext,
|
|
|
104
104
|
src: "writeReport";
|
|
105
105
|
logic: import("xstate").PromiseActorLogic<actors.ReportOutput, actors.ReportInput, import("xstate").EventObject>;
|
|
106
106
|
id: string | undefined;
|
|
107
|
-
}, never, never, never, "
|
|
107
|
+
}, never, never, never, "done" | "failed" | "sync" | "setup" | "idle" | "snapshot" | "preflight" | "reconcile" | "report", string, {
|
|
108
108
|
env?: "local" | "preview" | "production" | undefined;
|
|
109
109
|
check?: boolean | undefined;
|
|
110
110
|
force?: boolean | undefined;
|
|
111
111
|
autoApprove?: boolean | undefined;
|
|
112
112
|
verbose?: boolean | undefined;
|
|
113
113
|
skipCodegen?: boolean | undefined;
|
|
114
|
+
strictIntrospect?: boolean | undefined;
|
|
114
115
|
targetDir?: string | undefined;
|
|
115
116
|
fromProduction?: boolean | undefined;
|
|
116
117
|
autoSnapshot?: boolean | undefined;
|
|
@@ -77,6 +77,8 @@ export interface DbCommandOptions {
|
|
|
77
77
|
verbose?: boolean;
|
|
78
78
|
/** CI optimization: skip TypeScript + Zod generation during db sync */
|
|
79
79
|
skipCodegen?: boolean;
|
|
80
|
+
/** Fail when generated schema still contains unresolved unknown(...) columns */
|
|
81
|
+
strictIntrospect?: boolean;
|
|
80
82
|
json?: boolean;
|
|
81
83
|
sql?: boolean;
|
|
82
84
|
format?: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Boundary policy rule compiler.
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Convert raw policy JSON arrays into typed allowlist rules
|
|
5
|
+
* and normalize a full policy object with fallback defaults.
|
|
6
|
+
*/
|
|
7
|
+
import type { BoundaryPolicy, BoundaryPolicyMeta, DeclarativeRiskAllowlistRule, DirectoryPlacementAllowlistRule, PolicyIssueFormatter } from './types.js';
|
|
8
|
+
export declare function toDeclarativeRiskRules(rawList: unknown, issueFormatter: PolicyIssueFormatter): DeclarativeRiskAllowlistRule[];
|
|
9
|
+
export declare function toDirectoryPlacementRules(rawList: unknown, issueFormatter: PolicyIssueFormatter): DirectoryPlacementAllowlistRule[];
|
|
10
|
+
export declare function normalizePolicySource(raw: unknown, source: BoundaryPolicyMeta['source'], sourcePath: string, issueFormatter: PolicyIssueFormatter): BoundaryPolicy;
|
|
11
|
+
//# sourceMappingURL=rule-compiler.d.ts.map
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Boundary policy type definitions and small utility functions.
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Shared types for boundary-policy validation, compilation, and loading.
|
|
5
|
+
*/
|
|
6
|
+
export type BoundaryPolicyRiskLevel = 'high' | 'medium' | 'low';
|
|
7
|
+
export type AllowlistMetadata = {
|
|
8
|
+
owner?: string;
|
|
9
|
+
ticket?: string;
|
|
10
|
+
expiresAt?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type DeclarativeRiskAllowlistRule = {
|
|
14
|
+
id: string;
|
|
15
|
+
filePattern: RegExp;
|
|
16
|
+
descriptionPattern: RegExp;
|
|
17
|
+
level?: BoundaryPolicyRiskLevel;
|
|
18
|
+
reason: string;
|
|
19
|
+
owner?: string;
|
|
20
|
+
ticket?: string;
|
|
21
|
+
expiresAt?: string;
|
|
22
|
+
active: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type DirectoryPlacementAllowlistRule = {
|
|
25
|
+
id: string;
|
|
26
|
+
filePattern: RegExp;
|
|
27
|
+
messagePattern: RegExp;
|
|
28
|
+
level?: BoundaryPolicyRiskLevel;
|
|
29
|
+
lineStart?: number;
|
|
30
|
+
lineEnd?: number;
|
|
31
|
+
reason: string;
|
|
32
|
+
owner?: string;
|
|
33
|
+
ticket?: string;
|
|
34
|
+
expiresAt?: string;
|
|
35
|
+
active: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type BoundaryPolicyRaw = {
|
|
38
|
+
version?: unknown;
|
|
39
|
+
description?: unknown;
|
|
40
|
+
strictByDefault?: unknown;
|
|
41
|
+
declarativePreferredObjects?: unknown;
|
|
42
|
+
idempotentPreferredObjects?: unknown;
|
|
43
|
+
declarativeRiskAllowlist?: unknown;
|
|
44
|
+
directoryPlacementAllowlist?: unknown;
|
|
45
|
+
};
|
|
46
|
+
export type RawRule = {
|
|
47
|
+
id?: unknown;
|
|
48
|
+
filePattern?: unknown;
|
|
49
|
+
descriptionPattern?: unknown;
|
|
50
|
+
messagePattern?: unknown;
|
|
51
|
+
level?: unknown;
|
|
52
|
+
reason?: unknown;
|
|
53
|
+
owner?: unknown;
|
|
54
|
+
ticket?: unknown;
|
|
55
|
+
expiresAt?: unknown;
|
|
56
|
+
active?: unknown;
|
|
57
|
+
line?: unknown;
|
|
58
|
+
lineStart?: unknown;
|
|
59
|
+
lineEnd?: unknown;
|
|
60
|
+
};
|
|
61
|
+
export type BoundaryPolicyMeta = {
|
|
62
|
+
source: 'default' | 'policy-file';
|
|
63
|
+
sourcePath: string;
|
|
64
|
+
fallbackUsed: boolean;
|
|
65
|
+
invalidPolicy: boolean;
|
|
66
|
+
issues: string[];
|
|
67
|
+
warningCount: number;
|
|
68
|
+
};
|
|
69
|
+
export type BoundaryPolicy = {
|
|
70
|
+
version: string;
|
|
71
|
+
description: string;
|
|
72
|
+
strictByDefault: boolean;
|
|
73
|
+
declarativePreferredObjects: Set<string>;
|
|
74
|
+
idempotentPreferredObjects: Set<string>;
|
|
75
|
+
declarativeRiskAllowlist: DeclarativeRiskAllowlistRule[];
|
|
76
|
+
directoryPlacementAllowlist: DirectoryPlacementAllowlistRule[];
|
|
77
|
+
__meta: BoundaryPolicyMeta;
|
|
78
|
+
};
|
|
79
|
+
export type PolicyValidationSeverity = 'warning' | 'error';
|
|
80
|
+
export type PolicyValidationIssue = {
|
|
81
|
+
field: string;
|
|
82
|
+
message: string;
|
|
83
|
+
severity: PolicyValidationSeverity;
|
|
84
|
+
};
|
|
85
|
+
export type PolicyIssueFormatter = (field: string, message: string, severity?: PolicyValidationSeverity) => void;
|
|
86
|
+
export declare const BOUNDARY_POLICY_FILENAME = ".boundary-policy.json";
|
|
87
|
+
export declare const DEFAULT_POLICY_VERSION = "1.0";
|
|
88
|
+
export declare const SAFE_REGEXP: RegExp;
|
|
89
|
+
export declare const POLICY_VERSION_PATTERN: RegExp;
|
|
90
|
+
export declare const OBJECT_NAME_PATTERN: RegExp;
|
|
91
|
+
export declare const DATE_ISO_PATTERN: RegExp;
|
|
92
|
+
export declare const FALLBACK_DECLARATIVE_OBJECTS: Set<string>;
|
|
93
|
+
export declare const FALLBACK_IDEMPOTENT_OBJECTS: Set<string>;
|
|
94
|
+
export declare const FALLBACK_DECLARATIVE_RISK_ALLOWLIST: DeclarativeRiskAllowlistRule[];
|
|
95
|
+
export declare const FALLBACK_DIRECTORY_PLACEMENT_ALLOWLIST: DirectoryPlacementAllowlistRule[];
|
|
96
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
97
|
+
export declare function isStringArray(value: unknown): value is string[];
|
|
98
|
+
export declare function isPastDate(value: string, today: string): boolean;
|
|
99
|
+
export declare function isAllowlistRuleUsable(rule: {
|
|
100
|
+
active: boolean;
|
|
101
|
+
expiresAt?: string;
|
|
102
|
+
}): boolean;
|
|
103
|
+
export declare function formatBoundaryPolicyIssue(filePath: string, issue: PolicyValidationIssue): string;
|
|
104
|
+
export declare function formatAllowlistMetadata(rule: AllowlistMetadata): string;
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Boundary policy validation and coercion functions.
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Validate raw policy JSON and coerce individual fields
|
|
5
|
+
* into strongly typed values with issue reporting.
|
|
6
|
+
*/
|
|
7
|
+
import type { BoundaryPolicyRiskLevel, PolicyIssueFormatter, PolicyValidationIssue, PolicyValidationSeverity } from './types.js';
|
|
8
|
+
export declare function validateBoundaryPolicy(raw: unknown): PolicyValidationIssue[];
|
|
9
|
+
export declare function coercePolicyStringList(value: unknown, field: string, issueFormatter: PolicyIssueFormatter): Set<string>;
|
|
10
|
+
export declare function coerceRiskLevel(level: unknown): BoundaryPolicyRiskLevel | undefined;
|
|
11
|
+
export declare function compileRegExp(pattern: string, issueFormatter: PolicyIssueFormatter): RegExp;
|
|
12
|
+
export declare function coerceRuleId(raw: unknown, index: number, field: string, issueFormatter: PolicyIssueFormatter): string | null;
|
|
13
|
+
export declare function coerceRulePattern(raw: unknown, index: number, field: string, issueFormatter: PolicyIssueFormatter): string | null;
|
|
14
|
+
export declare function coerceOptionalString(raw: unknown, index: number, field: string, issueFormatter: PolicyIssueFormatter): string | undefined;
|
|
15
|
+
export declare function coerceOptionalPositiveInteger(raw: unknown, index: number, field: string, issueFormatter: PolicyIssueFormatter): number | undefined;
|
|
16
|
+
export declare function coerceBoolean(raw: unknown, index: number, field: string, issueFormatter: PolicyIssueFormatter): boolean;
|
|
17
|
+
export declare function coerceExpiresAt(raw: unknown, ruleId: string, index: number, field: string, issueFormatter: PolicyIssueFormatter): string | undefined;
|
|
18
|
+
export declare function mapPolicyVersion(rawVersion: unknown): string;
|
|
19
|
+
export declare function appendValidationIssue(issues: PolicyValidationIssue[], field: string, message: string, severity: PolicyValidationSeverity, policyFile: string, output: string[]): void;
|
|
20
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { loadBoundaryPolicy, type DeclarativeRiskAllowlistRule, type DirectoryPlacementAllowlistRule } from './boundary-policy.js';
|
|
2
|
+
type Logger = {
|
|
3
|
+
warn: (message: string) => void;
|
|
4
|
+
info: (message: string) => void;
|
|
5
|
+
};
|
|
6
|
+
type BoundaryPolicy = ReturnType<typeof loadBoundaryPolicy>;
|
|
7
|
+
type DeclarativeRiskLike = {
|
|
8
|
+
level: 'high' | 'medium' | 'low';
|
|
9
|
+
file: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
type DirectoryRiskLike = {
|
|
13
|
+
level: 'high' | 'medium' | 'low';
|
|
14
|
+
file: string;
|
|
15
|
+
message: string;
|
|
16
|
+
line?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function getBoundaryPolicy(cwd?: string): BoundaryPolicy;
|
|
19
|
+
export declare function reportBoundaryPolicyState(logger: Logger, policy: BoundaryPolicy): void;
|
|
20
|
+
export declare function assertBoundaryPolicyUsable(logger: Logger, policy: BoundaryPolicy): void;
|
|
21
|
+
export declare function assertBoundaryPolicyQualityGate(logger: Logger, policy: BoundaryPolicy, strict: boolean): void;
|
|
22
|
+
export declare function findDeclarativeRiskAllowlistMatch(risk: DeclarativeRiskLike, policy: BoundaryPolicy): DeclarativeRiskAllowlistRule | undefined;
|
|
23
|
+
export declare function hasExplicitLineScope(rule: DirectoryPlacementAllowlistRule): boolean;
|
|
24
|
+
export declare function entryLineScopeMatches(issueLine: number | undefined, rule: DirectoryPlacementAllowlistRule): boolean;
|
|
25
|
+
export declare function findDirectoryPlacementAllowlistMatch(issue: DirectoryRiskLike, policy: BoundaryPolicy): DirectoryPlacementAllowlistRule | undefined;
|
|
26
|
+
export declare function resolveProductionApplyStrictMode(policy: BoundaryPolicy, strictOption: boolean | undefined): boolean;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=boundary-policy-runtime.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BoundaryPolicy } from './boundary-policy/types.js';
|
|
2
|
+
export type { BoundaryPolicy, BoundaryPolicyMeta, BoundaryPolicyRiskLevel, DeclarativeRiskAllowlistRule, DirectoryPlacementAllowlistRule, } from './boundary-policy/types.js';
|
|
3
|
+
export { formatAllowlistMetadata } from './boundary-policy/types.js';
|
|
4
|
+
export declare function loadBoundaryPolicy(projectRoot: string, policyPath?: string): BoundaryPolicy;
|
|
5
|
+
//# sourceMappingURL=boundary-policy.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: Idempotent Risk Context Correction
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Shared constants and logic for adjusting risk severity in idempotent/ context.
|
|
5
|
+
* In idempotent/ files, DROP ... IF EXISTS is a standard cleanup-then-recreate pattern,
|
|
6
|
+
* so these are downgraded from their original severity to 'low'.
|
|
7
|
+
*
|
|
8
|
+
* Used by: preflight-check.ts, db-sync.ts
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Reason codes whose severity is downgraded to 'low' in idempotent context.
|
|
12
|
+
* DROP ... IF EXISTS patterns are standard cleanup-then-recreate in idempotent files.
|
|
13
|
+
* REVOKE + GRANT is a standard RBAC reset pattern in idempotent RBAC files.
|
|
14
|
+
* DO blocks are the expected pattern for conditional logic in idempotent files.
|
|
15
|
+
*/
|
|
16
|
+
export declare const IDEMPOTENT_DOWNGRADE_REASON_CODES: Set<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Reason codes whose severity is capped at 'medium' in idempotent context.
|
|
19
|
+
* DROP POLICY in idempotent files is typically a cleanup-then-recreate pattern,
|
|
20
|
+
* but still warrants review since it removes access control rules.
|
|
21
|
+
*/
|
|
22
|
+
export declare const IDEMPOTENT_MEDIUM_REASON_CODES: Set<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Correct risk severity for idempotent context.
|
|
25
|
+
*
|
|
26
|
+
* @returns adjusted severity level
|
|
27
|
+
*/
|
|
28
|
+
export declare function correctIdempotentRiskLevel(originalLevel: string, reasonCode: string | undefined): 'high' | 'medium' | 'low';
|
|
29
|
+
//# sourceMappingURL=idempotent-risk-context.d.ts.map
|
|
@@ -7,12 +7,26 @@
|
|
|
7
7
|
* NOTE: This is DIFFERENT from `runa db preflight` command which checks DATA QUALITY
|
|
8
8
|
* - preflight-check.ts: Environment validation (Supabase status, env vars, orphan detection)
|
|
9
9
|
* - preflight/index.ts: Data quality validation (updated_at >= created_at constraint)
|
|
10
|
+
*
|
|
11
|
+
* Structure:
|
|
12
|
+
* - preflight-check.ts: Orchestrator, types, basic checks (this file)
|
|
13
|
+
* - preflight-checks/supabase-checks.ts: Supabase status & DB connection
|
|
14
|
+
* - preflight-checks/schema-risk-checks.ts: SQL schema risk scanning
|
|
15
|
+
* - preflight-checks/orphan-checks.ts: Orphaned objects & extension config
|
|
10
16
|
*/
|
|
11
17
|
export interface PreflightCheckResult {
|
|
12
18
|
passed: boolean;
|
|
13
19
|
warnings: string[];
|
|
14
20
|
errors: string[];
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Step counter for dynamic step numbering.
|
|
24
|
+
* This ensures correct sequential numbering regardless of which checks are executed.
|
|
25
|
+
*/
|
|
26
|
+
export declare class StepCounter {
|
|
27
|
+
private current;
|
|
28
|
+
next(): number;
|
|
29
|
+
}
|
|
16
30
|
/**
|
|
17
31
|
* Run all preflight checks
|
|
18
32
|
*/
|