@kaelio/ktx 0.5.0 → 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/assets/python/{kaelio_ktx-0.5.0-py3-none-any.whl → kaelio_ktx-0.6.0-py3-none-any.whl} +0 -0
- package/assets/python/manifest.json +4 -4
- package/dist/.tsbuildinfo +1 -1
- package/dist/clack.d.ts +8 -0
- package/dist/clack.js +14 -0
- package/dist/connection.js +2 -9
- package/dist/connectors/bigquery/connector.d.ts +6 -1
- package/dist/connectors/bigquery/connector.js +38 -9
- package/dist/connectors/bigquery/dialect.d.ts +11 -9
- package/dist/connectors/bigquery/dialect.js +25 -45
- package/dist/connectors/clickhouse/connector.d.ts +5 -0
- package/dist/connectors/clickhouse/connector.js +36 -3
- package/dist/connectors/clickhouse/dialect.d.ts +11 -12
- package/dist/connectors/clickhouse/dialect.js +25 -100
- package/dist/connectors/mysql/connector.d.ts +7 -1
- package/dist/connectors/mysql/connector.js +67 -9
- package/dist/connectors/mysql/dialect.d.ts +11 -9
- package/dist/connectors/mysql/dialect.js +25 -43
- package/dist/connectors/postgres/connector.d.ts +6 -0
- package/dist/connectors/postgres/connector.js +67 -12
- package/dist/connectors/postgres/dialect.d.ts +11 -9
- package/dist/connectors/postgres/dialect.js +26 -35
- package/dist/connectors/snowflake/connector.d.ts +8 -3
- package/dist/connectors/snowflake/connector.js +39 -20
- package/dist/connectors/snowflake/dialect.d.ts +11 -9
- package/dist/connectors/snowflake/dialect.js +25 -24
- package/dist/connectors/sqlite/connector.d.ts +3 -1
- package/dist/connectors/sqlite/connector.js +23 -3
- package/dist/connectors/sqlite/dialect.d.ts +11 -9
- package/dist/connectors/sqlite/dialect.js +25 -29
- package/dist/connectors/sqlserver/connector.d.ts +6 -0
- package/dist/connectors/sqlserver/connector.js +56 -9
- package/dist/connectors/sqlserver/dialect.d.ts +11 -10
- package/dist/connectors/sqlserver/dialect.js +24 -40
- package/dist/context/connections/connection-type.d.ts +1 -1
- package/dist/context/connections/dialect-helpers.d.ts +9 -0
- package/dist/context/connections/dialect-helpers.js +67 -0
- package/dist/context/connections/dialects.d.ts +23 -5
- package/dist/context/connections/dialects.js +18 -56
- package/dist/context/connections/drivers.d.ts +23 -0
- package/dist/context/connections/drivers.js +171 -0
- package/dist/context/connections/local-query-executor.js +25 -7
- package/dist/context/connections/local-warehouse-descriptor.js +0 -2
- package/dist/context/connections/postgres-query-executor.js +1 -1
- package/dist/context/connections/sqlite-query-executor.js +1 -1
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.js +1 -1
- package/dist/context/ingest/adapters/historic-sql/connection-dialect.js +11 -7
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.d.ts +1 -1
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.js +8 -5
- package/dist/context/ingest/adapters/historic-sql/evidence.d.ts +4 -4
- package/dist/context/ingest/adapters/historic-sql/evidence.js +2 -2
- package/dist/context/ingest/adapters/historic-sql/projection.js +5 -2
- package/dist/context/ingest/adapters/live-database/daemon-introspection.js +1 -1
- package/dist/context/ingest/adapters/live-database/stage.d.ts +2 -0
- package/dist/context/ingest/adapters/live-database/stage.js +9 -0
- package/dist/context/ingest/adapters/looker/mapping.d.ts +0 -3
- package/dist/context/ingest/adapters/looker/mapping.js +0 -3
- package/dist/context/ingest/adapters/looker/types.d.ts +1 -1
- package/dist/context/ingest/historic-sql-probes/bigquery-runner.d.ts +34 -0
- package/dist/context/ingest/historic-sql-probes/bigquery-runner.js +99 -0
- package/dist/context/ingest/historic-sql-probes/postgres-runner.d.ts +26 -0
- package/dist/context/ingest/historic-sql-probes/postgres-runner.js +76 -0
- package/dist/context/ingest/historic-sql-probes/snowflake-runner.d.ts +29 -0
- package/dist/context/ingest/historic-sql-probes/snowflake-runner.js +62 -0
- package/dist/context/ingest/historic-sql-probes.d.ts +46 -0
- package/dist/context/ingest/historic-sql-probes.js +62 -0
- package/dist/context/ingest/local-adapters.js +0 -1
- package/dist/context/ingest/local-ingest.js +1 -1
- package/dist/context/mcp/context-tools.js +11 -48
- package/dist/context/mcp/local-project-ports.js +0 -3
- package/dist/context/project/config.d.ts +0 -8
- package/dist/context/project/driver-schemas.d.ts +0 -4
- package/dist/context/project/driver-schemas.js +0 -2
- package/dist/context/scan/constraint-discovery.d.ts +19 -0
- package/dist/context/scan/constraint-discovery.js +23 -0
- package/dist/context/scan/enabled-tables.d.ts +4 -5
- package/dist/context/scan/enabled-tables.js +4 -18
- package/dist/context/scan/entity-details.js +14 -44
- package/dist/context/scan/local-enrichment.js +13 -1
- package/dist/context/scan/local-scan.js +5 -4
- package/dist/context/scan/local-structural-artifacts.js +51 -0
- package/dist/context/scan/relationship-benchmarks.js +9 -6
- package/dist/context/scan/relationship-composite-candidates.d.ts +3 -2
- package/dist/context/scan/relationship-composite-candidates.js +21 -33
- package/dist/context/scan/relationship-discovery.d.ts +3 -2
- package/dist/context/scan/relationship-discovery.js +4 -4
- package/dist/context/scan/relationship-profiling.d.ts +2 -3
- package/dist/context/scan/relationship-profiling.js +25 -94
- package/dist/context/scan/relationship-validation.d.ts +3 -2
- package/dist/context/scan/relationship-validation.js +12 -22
- package/dist/context/scan/table-ref.d.ts +1 -2
- package/dist/context/scan/table-ref.js +3 -4
- package/dist/context/scan/types.d.ts +6 -2
- package/dist/context/scan/warehouse-catalog.js +31 -48
- package/dist/context/sl/local-query.js +0 -3
- package/dist/context/sl/local-sl.js +0 -13
- package/dist/context/sl/semantic-layer.service.js +1 -4
- package/dist/context/tools/context-candidate-write.tool.d.ts +2 -2
- package/dist/context-build-view.js +1 -1
- package/dist/database-tree-picker.js +14 -7
- package/dist/error-message.d.ts +1 -0
- package/dist/error-message.js +29 -0
- package/dist/ingest-depth.js +0 -1
- package/dist/ingest.js +2 -2
- package/dist/llm/embedding-health.js +2 -2
- package/dist/local-scan-connectors.js +13 -56
- package/dist/managed-local-embeddings.js +2 -1
- package/dist/managed-python-daemon.d.ts +5 -0
- package/dist/managed-python-daemon.js +29 -9
- package/dist/managed-python-http.js +2 -1
- package/dist/public-ingest.js +1 -6
- package/dist/runtime-requirements.js +2 -2
- package/dist/setup-agents.d.ts +1 -1
- package/dist/setup-agents.js +16 -74
- package/dist/setup-context.js +2 -1
- package/dist/setup-databases.d.ts +3 -13
- package/dist/setup-databases.js +141 -313
- package/dist/setup-embeddings.js +10 -2
- package/dist/setup-runtime.js +2 -1
- package/dist/setup-sources.js +2 -1
- package/dist/setup.js +10 -4
- package/dist/skills/historic_sql_patterns/SKILL.md +1 -3
- package/dist/skills/historic_sql_table_digest/SKILL.md +0 -1
- package/dist/skills/sl/SKILL.md +2 -2
- package/dist/sql.js +0 -4
- package/dist/status-project.d.ts +3 -18
- package/dist/status-project.js +42 -216
- package/dist/telemetry/events.d.ts +1 -1
- package/dist/telemetry/index.js +8 -3
- package/dist/tree-picker-state.d.ts +2 -2
- package/dist/tree-picker-state.js +29 -13
- package/dist/tree-picker-tui.d.ts +3 -1
- package/dist/tree-picker-tui.js +20 -32
- package/package.json +6 -6
- package/dist/admin-reindex.test.d.ts +0 -1
- package/dist/admin-reindex.test.js +0 -119
- package/dist/admin.test.d.ts +0 -1
- package/dist/admin.test.js +0 -201
- package/dist/cli-program-telemetry.test.d.ts +0 -1
- package/dist/cli-program-telemetry.test.js +0 -89
- package/dist/cli-program.test.d.ts +0 -1
- package/dist/cli-program.test.js +0 -71
- package/dist/command-tree.test.d.ts +0 -1
- package/dist/command-tree.test.js +0 -126
- package/dist/commands/mcp-commands.test.d.ts +0 -1
- package/dist/commands/mcp-commands.test.js +0 -111
- package/dist/commands/sql-commands.test.d.ts +0 -1
- package/dist/commands/sql-commands.test.js +0 -68
- package/dist/connection.test.d.ts +0 -1
- package/dist/connection.test.js +0 -426
- package/dist/connectors/bigquery/connector.test.d.ts +0 -1
- package/dist/connectors/bigquery/connector.test.js +0 -363
- package/dist/connectors/bigquery/dialect.test.d.ts +0 -1
- package/dist/connectors/bigquery/dialect.test.js +0 -36
- package/dist/connectors/clickhouse/connector.test.d.ts +0 -1
- package/dist/connectors/clickhouse/connector.test.js +0 -342
- package/dist/connectors/clickhouse/dialect.test.d.ts +0 -1
- package/dist/connectors/clickhouse/dialect.test.js +0 -36
- package/dist/connectors/mysql/connector.test.d.ts +0 -1
- package/dist/connectors/mysql/connector.test.js +0 -365
- package/dist/connectors/mysql/dialect.test.d.ts +0 -1
- package/dist/connectors/mysql/dialect.test.js +0 -36
- package/dist/connectors/postgres/connector.test.d.ts +0 -1
- package/dist/connectors/postgres/connector.test.js +0 -391
- package/dist/connectors/postgres/dialect.test.d.ts +0 -1
- package/dist/connectors/postgres/dialect.test.js +0 -37
- package/dist/connectors/postgres/historic-sql-query-client.test.d.ts +0 -1
- package/dist/connectors/postgres/historic-sql-query-client.test.js +0 -45
- package/dist/connectors/snowflake/connector.test.d.ts +0 -1
- package/dist/connectors/snowflake/connector.test.js +0 -462
- package/dist/connectors/snowflake/dialect.test.d.ts +0 -1
- package/dist/connectors/snowflake/dialect.test.js +0 -34
- package/dist/connectors/snowflake/identifiers.test.d.ts +0 -1
- package/dist/connectors/snowflake/identifiers.test.js +0 -12
- package/dist/connectors/snowflake/sdk-logger.test.d.ts +0 -1
- package/dist/connectors/snowflake/sdk-logger.test.js +0 -47
- package/dist/connectors/sqlite/connector.test.d.ts +0 -1
- package/dist/connectors/sqlite/connector.test.js +0 -207
- package/dist/connectors/sqlite/dialect.test.d.ts +0 -1
- package/dist/connectors/sqlite/dialect.test.js +0 -23
- package/dist/connectors/sqlserver/connector.test.d.ts +0 -1
- package/dist/connectors/sqlserver/connector.test.js +0 -313
- package/dist/connectors/sqlserver/dialect.test.d.ts +0 -1
- package/dist/connectors/sqlserver/dialect.test.js +0 -36
- package/dist/context/connections/bigquery-identifiers.test.d.ts +0 -1
- package/dist/context/connections/bigquery-identifiers.test.js +0 -13
- package/dist/context/connections/dialects.test.d.ts +0 -1
- package/dist/context/connections/dialects.test.js +0 -24
- package/dist/context/connections/local-query-executor.test.d.ts +0 -1
- package/dist/context/connections/local-query-executor.test.js +0 -48
- package/dist/context/connections/local-warehouse-descriptor.test.d.ts +0 -1
- package/dist/context/connections/local-warehouse-descriptor.test.js +0 -53
- package/dist/context/connections/notion-config.test.d.ts +0 -1
- package/dist/context/connections/notion-config.test.js +0 -121
- package/dist/context/connections/postgres-query-executor.test.d.ts +0 -1
- package/dist/context/connections/postgres-query-executor.test.js +0 -91
- package/dist/context/connections/read-only-sql.test.d.ts +0 -1
- package/dist/context/connections/read-only-sql.test.js +0 -20
- package/dist/context/connections/sqlite-query-executor.test.d.ts +0 -1
- package/dist/context/connections/sqlite-query-executor.test.js +0 -113
- package/dist/context/core/config-reference.test.d.ts +0 -1
- package/dist/context/core/config-reference.test.js +0 -27
- package/dist/context/core/git.service.assert-worktree-clean.test.d.ts +0 -1
- package/dist/context/core/git.service.assert-worktree-clean.test.js +0 -62
- package/dist/context/core/git.service.delete-directories.test.d.ts +0 -1
- package/dist/context/core/git.service.delete-directories.test.js +0 -61
- package/dist/context/core/git.service.patch.test.d.ts +0 -1
- package/dist/context/core/git.service.patch.test.js +0 -40
- package/dist/context/core/git.service.reset-hard.test.d.ts +0 -1
- package/dist/context/core/git.service.reset-hard.test.js +0 -47
- package/dist/context/core/git.service.test.d.ts +0 -1
- package/dist/context/core/git.service.test.js +0 -357
- package/dist/context/core/session-worktree.service.test.d.ts +0 -1
- package/dist/context/core/session-worktree.service.test.js +0 -97
- package/dist/context/daemon/semantic-layer-compute.test.d.ts +0 -1
- package/dist/context/daemon/semantic-layer-compute.test.js +0 -305
- package/dist/context/index-sync/reindex.test.d.ts +0 -1
- package/dist/context/index-sync/reindex.test.js +0 -139
- package/dist/context/ingest/action-identity.test.d.ts +0 -1
- package/dist/context/ingest/action-identity.test.js +0 -19
- package/dist/context/ingest/adapters/dbt/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/chunk.test.js +0 -30
- package/dist/context/ingest/adapters/dbt/dbt.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/dbt.adapter.test.js +0 -43
- package/dist/context/ingest/adapters/dbt/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/fetch.test.js +0 -30
- package/dist/context/ingest/adapters/dbt/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt/parse.test.js +0 -7
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.test.d.ts +0 -1
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.test.js +0 -195
- package/dist/context/ingest/adapters/historic-sql/bigquery-query-history-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/bigquery-query-history-reader.test.js +0 -121
- package/dist/context/ingest/adapters/historic-sql/buckets.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/buckets.test.js +0 -49
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.test.js +0 -160
- package/dist/context/ingest/adapters/historic-sql/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/detect.test.js +0 -48
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.test.js +0 -67
- package/dist/context/ingest/adapters/historic-sql/evidence.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/evidence.test.js +0 -43
- package/dist/context/ingest/adapters/historic-sql/historic-sql.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/historic-sql.adapter.test.js +0 -98
- package/dist/context/ingest/adapters/historic-sql/local-ingest-acceptance.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/local-ingest-acceptance.test.js +0 -235
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.test.js +0 -68
- package/dist/context/ingest/adapters/historic-sql/postgres-pgss-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/postgres-pgss-reader.test.js +0 -205
- package/dist/context/ingest/adapters/historic-sql/projection.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/projection.test.js +0 -392
- package/dist/context/ingest/adapters/historic-sql/redaction.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/redaction.test.js +0 -22
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.test.js +0 -62
- package/dist/context/ingest/adapters/historic-sql/snowflake-query-history-reader.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/snowflake-query-history-reader.test.js +0 -117
- package/dist/context/ingest/adapters/historic-sql/stage-unified.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/stage-unified.test.js +0 -405
- package/dist/context/ingest/adapters/historic-sql/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/historic-sql/types.test.js +0 -87
- package/dist/context/ingest/adapters/live-database/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/chunk.test.js +0 -95
- package/dist/context/ingest/adapters/live-database/daemon-introspection.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/daemon-introspection.test.js +0 -241
- package/dist/context/ingest/adapters/live-database/live-database.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/live-database.adapter.test.js +0 -105
- package/dist/context/ingest/adapters/live-database/manifest.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/manifest.test.js +0 -291
- package/dist/context/ingest/adapters/live-database/stage.test.d.ts +0 -1
- package/dist/context/ingest/adapters/live-database/stage.test.js +0 -133
- package/dist/context/ingest/adapters/looker/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/chunk.test.js +0 -142
- package/dist/context/ingest/adapters/looker/client-boundary.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/client-boundary.test.js +0 -12
- package/dist/context/ingest/adapters/looker/client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/client.test.js +0 -407
- package/dist/context/ingest/adapters/looker/daemon-table-identifier-parser.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/daemon-table-identifier-parser.test.js +0 -40
- package/dist/context/ingest/adapters/looker/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/detect.test.js +0 -39
- package/dist/context/ingest/adapters/looker/evidence-documents.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/evidence-documents.test.js +0 -178
- package/dist/context/ingest/adapters/looker/factory.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/factory.test.js +0 -55
- package/dist/context/ingest/adapters/looker/fetch-report.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/fetch-report.test.js +0 -71
- package/dist/context/ingest/adapters/looker/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/fetch.test.js +0 -592
- package/dist/context/ingest/adapters/looker/local-runtime-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/local-runtime-store.test.js +0 -106
- package/dist/context/ingest/adapters/looker/looker.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/looker.adapter.test.js +0 -99
- package/dist/context/ingest/adapters/looker/mapping.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/mapping.test.js +0 -334
- package/dist/context/ingest/adapters/looker/reconcile.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/reconcile.test.js +0 -12
- package/dist/context/ingest/adapters/looker/scope.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/scope.test.js +0 -84
- package/dist/context/ingest/adapters/looker/target-connections.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/target-connections.test.js +0 -71
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.js +0 -211
- package/dist/context/ingest/adapters/looker/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/looker/types.test.js +0 -261
- package/dist/context/ingest/adapters/lookml/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/chunk.test.js +0 -213
- package/dist/context/ingest/adapters/lookml/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/detect.test.js +0 -37
- package/dist/context/ingest/adapters/lookml/fetch-report.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/fetch-report.test.js +0 -82
- package/dist/context/ingest/adapters/lookml/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/fetch.test.js +0 -121
- package/dist/context/ingest/adapters/lookml/graph.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/graph.test.js +0 -105
- package/dist/context/ingest/adapters/lookml/lookml.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/lookml.adapter.test.js +0 -49
- package/dist/context/ingest/adapters/lookml/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/parse.test.js +0 -118
- package/dist/context/ingest/adapters/lookml/pull-config.test.d.ts +0 -1
- package/dist/context/ingest/adapters/lookml/pull-config.test.js +0 -128
- package/dist/context/ingest/adapters/metabase/card-references.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/card-references.test.js +0 -36
- package/dist/context/ingest/adapters/metabase/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/chunk.test.js +0 -299
- package/dist/context/ingest/adapters/metabase/client-boundary.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client-boundary.test.js +0 -38
- package/dist/context/ingest/adapters/metabase/client-port.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client-port.test.js +0 -86
- package/dist/context/ingest/adapters/metabase/client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/client.test.js +0 -377
- package/dist/context/ingest/adapters/metabase/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/detect.test.js +0 -42
- package/dist/context/ingest/adapters/metabase/fanout-planner.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fanout-planner.test.js +0 -44
- package/dist/context/ingest/adapters/metabase/fetch-scope.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fetch-scope.test.js +0 -124
- package/dist/context/ingest/adapters/metabase/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/fetch.test.js +0 -557
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.test.js +0 -56
- package/dist/context/ingest/adapters/metabase/local-source-state-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/local-source-state-store.test.js +0 -99
- package/dist/context/ingest/adapters/metabase/mapping.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/mapping.test.js +0 -215
- package/dist/context/ingest/adapters/metabase/metabase.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/metabase.adapter.test.js +0 -129
- package/dist/context/ingest/adapters/metabase/serialize-card.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/serialize-card.test.js +0 -205
- package/dist/context/ingest/adapters/metabase/types.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metabase/types.test.js +0 -75
- package/dist/context/ingest/adapters/metricflow/chunk.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/chunk.test.js +0 -114
- package/dist/context/ingest/adapters/metricflow/deep-parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/deep-parse.test.js +0 -1139
- package/dist/context/ingest/adapters/metricflow/detect.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/detect.test.js +0 -43
- package/dist/context/ingest/adapters/metricflow/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/fetch.test.js +0 -97
- package/dist/context/ingest/adapters/metricflow/graph.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/graph.test.js +0 -245
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.test.js +0 -318
- package/dist/context/ingest/adapters/metricflow/metricflow.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/metricflow.adapter.test.js +0 -212
- package/dist/context/ingest/adapters/metricflow/parse.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/parse.test.js +0 -171
- package/dist/context/ingest/adapters/metricflow/pull-config.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/pull-config.test.js +0 -57
- package/dist/context/ingest/adapters/metricflow/semantic-models.test.d.ts +0 -1
- package/dist/context/ingest/adapters/metricflow/semantic-models.test.js +0 -204
- package/dist/context/ingest/adapters/notion/cluster.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/cluster.test.js +0 -123
- package/dist/context/ingest/adapters/notion/fetch.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/fetch.test.js +0 -358
- package/dist/context/ingest/adapters/notion/local-state-store.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/local-state-store.test.js +0 -29
- package/dist/context/ingest/adapters/notion/normalize.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/normalize.test.js +0 -64
- package/dist/context/ingest/adapters/notion/notion-client.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/notion-client.test.js +0 -49
- package/dist/context/ingest/adapters/notion/notion.adapter.test.d.ts +0 -1
- package/dist/context/ingest/adapters/notion/notion.adapter.test.js +0 -315
- package/dist/context/ingest/artifact-gates.test.d.ts +0 -1
- package/dist/context/ingest/artifact-gates.test.js +0 -167
- package/dist/context/ingest/canonical-pins.test.d.ts +0 -1
- package/dist/context/ingest/canonical-pins.test.js +0 -66
- package/dist/context/ingest/clustering/kmeans.test.d.ts +0 -1
- package/dist/context/ingest/clustering/kmeans.test.js +0 -61
- package/dist/context/ingest/context-candidates/candidate-dedup.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/candidate-dedup.service.test.js +0 -216
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.test.js +0 -161
- package/dist/context/ingest/context-candidates/curator-pagination.service.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/curator-pagination.service.test.js +0 -168
- package/dist/context/ingest/context-candidates/embedding-text.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/embedding-text.test.js +0 -10
- package/dist/context/ingest/context-candidates/store.test.d.ts +0 -1
- package/dist/context/ingest/context-candidates/store.test.js +0 -67
- package/dist/context/ingest/context-evidence/context-evidence-index.service.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/context-evidence-index.service.test.js +0 -374
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.test.js +0 -416
- package/dist/context/ingest/context-evidence/store.test.d.ts +0 -1
- package/dist/context/ingest/context-evidence/store.test.js +0 -55
- package/dist/context/ingest/dbt-shared/project-vars.test.d.ts +0 -1
- package/dist/context/ingest/dbt-shared/project-vars.test.js +0 -90
- package/dist/context/ingest/dbt-shared/schema-files.test.d.ts +0 -1
- package/dist/context/ingest/dbt-shared/schema-files.test.js +0 -35
- package/dist/context/ingest/diff-set.service.test.d.ts +0 -1
- package/dist/context/ingest/diff-set.service.test.js +0 -132
- package/dist/context/ingest/final-gate-repair.test.d.ts +0 -1
- package/dist/context/ingest/final-gate-repair.test.js +0 -109
- package/dist/context/ingest/finalization-scope.test.d.ts +0 -1
- package/dist/context/ingest/finalization-scope.test.js +0 -114
- package/dist/context/ingest/ingest-bundle.runner.isolated-diff.test.d.ts +0 -1
- package/dist/context/ingest/ingest-bundle.runner.isolated-diff.test.js +0 -1928
- package/dist/context/ingest/ingest-bundle.runner.test.d.ts +0 -1
- package/dist/context/ingest/ingest-bundle.runner.test.js +0 -1899
- package/dist/context/ingest/ingest-prompts.test.d.ts +0 -1
- package/dist/context/ingest/ingest-prompts.test.js +0 -32
- package/dist/context/ingest/ingest-runtime-assets.test.d.ts +0 -1
- package/dist/context/ingest/ingest-runtime-assets.test.js +0 -89
- package/dist/context/ingest/ingest-trace.test.d.ts +0 -1
- package/dist/context/ingest/ingest-trace.test.js +0 -76
- package/dist/context/ingest/isolated-diff/git-patch.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/git-patch.test.js +0 -76
- package/dist/context/ingest/isolated-diff/patch-integrator.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/patch-integrator.test.js +0 -369
- package/dist/context/ingest/isolated-diff/textual-conflict-resolver.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/textual-conflict-resolver.test.js +0 -101
- package/dist/context/ingest/isolated-diff/work-unit-executor.test.d.ts +0 -1
- package/dist/context/ingest/isolated-diff/work-unit-executor.test.js +0 -137
- package/dist/context/ingest/local-adapters.test.d.ts +0 -1
- package/dist/context/ingest/local-adapters.test.js +0 -612
- package/dist/context/ingest/local-bundle-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-bundle-ingest.test.js +0 -794
- package/dist/context/ingest/local-bundle-runtime.test.d.ts +0 -1
- package/dist/context/ingest/local-bundle-runtime.test.js +0 -240
- package/dist/context/ingest/local-embedding-provider.integration.test.d.ts +0 -1
- package/dist/context/ingest/local-embedding-provider.integration.test.js +0 -139
- package/dist/context/ingest/local-mapping-reconcile.test.d.ts +0 -1
- package/dist/context/ingest/local-mapping-reconcile.test.js +0 -61
- package/dist/context/ingest/local-metabase-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-metabase-ingest.test.js +0 -227
- package/dist/context/ingest/local-stage-ingest.test.d.ts +0 -1
- package/dist/context/ingest/local-stage-ingest.test.js +0 -581
- package/dist/context/ingest/memory-flow/acceptance-fixtures.d.ts +0 -6
- package/dist/context/ingest/memory-flow/acceptance-fixtures.js +0 -155
- package/dist/context/ingest/memory-flow/acceptance.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/acceptance.test.js +0 -43
- package/dist/context/ingest/memory-flow/events.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/events.test.js +0 -319
- package/dist/context/ingest/memory-flow/interaction.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/interaction.test.js +0 -264
- package/dist/context/ingest/memory-flow/interactive-render.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/interactive-render.test.js +0 -160
- package/dist/context/ingest/memory-flow/live-buffer.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/live-buffer.test.js +0 -77
- package/dist/context/ingest/memory-flow/render.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/render.test.js +0 -105
- package/dist/context/ingest/memory-flow/schema.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/schema.test.js +0 -147
- package/dist/context/ingest/memory-flow/summary.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/summary.test.js +0 -130
- package/dist/context/ingest/memory-flow/view-model.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/view-model.test.js +0 -397
- package/dist/context/ingest/memory-flow/visuals.test.d.ts +0 -1
- package/dist/context/ingest/memory-flow/visuals.test.js +0 -49
- package/dist/context/ingest/page-triage/page-triage.service.test.d.ts +0 -1
- package/dist/context/ingest/page-triage/page-triage.service.test.js +0 -311
- package/dist/context/ingest/raw-sources-paths.test.d.ts +0 -1
- package/dist/context/ingest/raw-sources-paths.test.js +0 -18
- package/dist/context/ingest/repo-fetch.test.d.ts +0 -1
- package/dist/context/ingest/repo-fetch.test.js +0 -168
- package/dist/context/ingest/report-snapshot.test.d.ts +0 -1
- package/dist/context/ingest/report-snapshot.test.js +0 -329
- package/dist/context/ingest/semantic-layer-target-policy.test.d.ts +0 -1
- package/dist/context/ingest/semantic-layer-target-policy.test.js +0 -25
- package/dist/context/ingest/source-adapter-registry.test.d.ts +0 -1
- package/dist/context/ingest/source-adapter-registry.test.js +0 -35
- package/dist/context/ingest/sqlite-bundle-ingest-store.test.d.ts +0 -1
- package/dist/context/ingest/sqlite-bundle-ingest-store.test.js +0 -517
- package/dist/context/ingest/sqlite-local-ingest-store.test.d.ts +0 -1
- package/dist/context/ingest/sqlite-local-ingest-store.test.js +0 -143
- package/dist/context/ingest/stages/build-reconcile-context.context-candidates.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-reconcile-context.context-candidates.test.js +0 -102
- package/dist/context/ingest/stages/build-reconcile-context.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-reconcile-context.test.js +0 -141
- package/dist/context/ingest/stages/build-wu-context.test.d.ts +0 -1
- package/dist/context/ingest/stages/build-wu-context.test.js +0 -196
- package/dist/context/ingest/stages/stage-1-stage-raw-files.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-1-stage-raw-files.test.js +0 -54
- package/dist/context/ingest/stages/stage-3-work-units.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-3-work-units.test.js +0 -175
- package/dist/context/ingest/stages/stage-4-reconciliation.test.d.ts +0 -1
- package/dist/context/ingest/stages/stage-4-reconciliation.test.js +0 -144
- package/dist/context/ingest/stages/validate-wu-sources.test.d.ts +0 -1
- package/dist/context/ingest/stages/validate-wu-sources.test.js +0 -27
- package/dist/context/ingest/tools/emit-reconciliation-records.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/emit-reconciliation-records.tool.test.js +0 -237
- package/dist/context/ingest/tools/eviction-list.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/eviction-list.tool.test.js +0 -44
- package/dist/context/ingest/tools/read-raw-file.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/read-raw-file.tool.test.js +0 -45
- package/dist/context/ingest/tools/read-raw-span.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/read-raw-span.tool.test.js +0 -34
- package/dist/context/ingest/tools/stage-diff.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/stage-diff.tool.test.js +0 -112
- package/dist/context/ingest/tools/stage-list.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/stage-list.tool.test.js +0 -58
- package/dist/context/ingest/tools/tool-transcript-summary.test.d.ts +0 -1
- package/dist/context/ingest/tools/tool-transcript-summary.test.js +0 -141
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.test.js +0 -107
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.test.js +0 -146
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.test.d.ts +0 -1
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.test.js +0 -50
- package/dist/context/ingest/wiki-body-refs.test.d.ts +0 -1
- package/dist/context/ingest/wiki-body-refs.test.js +0 -138
- package/dist/context/ingest/wiki-sl-ref-repair.test.d.ts +0 -1
- package/dist/context/ingest/wiki-sl-ref-repair.test.js +0 -81
- package/dist/context/llm/ai-sdk-runtime.test.d.ts +0 -1
- package/dist/context/llm/ai-sdk-runtime.test.js +0 -308
- package/dist/context/llm/claude-code-env.test.d.ts +0 -1
- package/dist/context/llm/claude-code-env.test.js +0 -17
- package/dist/context/llm/claude-code-models.test.d.ts +0 -1
- package/dist/context/llm/claude-code-models.test.js +0 -15
- package/dist/context/llm/claude-code-runtime.test.d.ts +0 -1
- package/dist/context/llm/claude-code-runtime.test.js +0 -434
- package/dist/context/llm/debug-request-recorder.test.d.ts +0 -1
- package/dist/context/llm/debug-request-recorder.test.js +0 -112
- package/dist/context/llm/embedding-port.test.d.ts +0 -1
- package/dist/context/llm/embedding-port.test.js +0 -34
- package/dist/context/llm/local-config.test.d.ts +0 -1
- package/dist/context/llm/local-config.test.js +0 -164
- package/dist/context/llm/runtime-local-config.test.d.ts +0 -1
- package/dist/context/llm/runtime-local-config.test.js +0 -17
- package/dist/context/llm/runtime-tools.test.d.ts +0 -1
- package/dist/context/llm/runtime-tools.test.js +0 -36
- package/dist/context/mcp/local-project-ports.test.d.ts +0 -1
- package/dist/context/mcp/local-project-ports.test.js +0 -689
- package/dist/context/mcp/server.test.d.ts +0 -1
- package/dist/context/mcp/server.test.js +0 -902
- package/dist/context/memory/local-memory.test.d.ts +0 -1
- package/dist/context/memory/local-memory.test.js +0 -173
- package/dist/context/memory/memory-agent.service.ingest.test.d.ts +0 -1
- package/dist/context/memory/memory-agent.service.ingest.test.js +0 -355
- package/dist/context/memory/memory-agent.service.test.d.ts +0 -1
- package/dist/context/memory/memory-agent.service.test.js +0 -413
- package/dist/context/memory/memory-runs.test.d.ts +0 -1
- package/dist/context/memory/memory-runs.test.js +0 -158
- package/dist/context/memory/memory-runtime-assets.test.d.ts +0 -1
- package/dist/context/memory/memory-runtime-assets.test.js +0 -162
- package/dist/context/project/config.test.d.ts +0 -1
- package/dist/context/project/config.test.js +0 -467
- package/dist/context/project/driver-schemas.test.d.ts +0 -1
- package/dist/context/project/driver-schemas.test.js +0 -125
- package/dist/context/project/local-git-file-store.test.d.ts +0 -1
- package/dist/context/project/local-git-file-store.test.js +0 -71
- package/dist/context/project/mappings-yaml-schema.test.d.ts +0 -1
- package/dist/context/project/mappings-yaml-schema.test.js +0 -79
- package/dist/context/project/project.test.d.ts +0 -1
- package/dist/context/project/project.test.js +0 -55
- package/dist/context/project/setup-config.test.d.ts +0 -1
- package/dist/context/project/setup-config.test.js +0 -38
- package/dist/context/prompts/prompt.service.test.d.ts +0 -1
- package/dist/context/prompts/prompt.service.test.js +0 -43
- package/dist/context/scan/credentials.test.d.ts +0 -1
- package/dist/context/scan/credentials.test.js +0 -162
- package/dist/context/scan/data-dictionary.test.d.ts +0 -1
- package/dist/context/scan/data-dictionary.test.js +0 -92
- package/dist/context/scan/description-generation.test.d.ts +0 -1
- package/dist/context/scan/description-generation.test.js +0 -693
- package/dist/context/scan/embedding-text.test.d.ts +0 -1
- package/dist/context/scan/embedding-text.test.js +0 -36
- package/dist/context/scan/enrichment-state.test.d.ts +0 -1
- package/dist/context/scan/enrichment-state.test.js +0 -147
- package/dist/context/scan/enrichment-summary.test.d.ts +0 -1
- package/dist/context/scan/enrichment-summary.test.js +0 -34
- package/dist/context/scan/enrichment-types.test.d.ts +0 -1
- package/dist/context/scan/enrichment-types.test.js +0 -141
- package/dist/context/scan/entity-details.test.d.ts +0 -1
- package/dist/context/scan/entity-details.test.js +0 -234
- package/dist/context/scan/local-enrichment-artifacts.test.d.ts +0 -1
- package/dist/context/scan/local-enrichment-artifacts.test.js +0 -771
- package/dist/context/scan/local-enrichment.test.d.ts +0 -1
- package/dist/context/scan/local-enrichment.test.js +0 -765
- package/dist/context/scan/local-scan.test.d.ts +0 -1
- package/dist/context/scan/local-scan.test.js +0 -1663
- package/dist/context/scan/local-structural-artifacts.test.d.ts +0 -1
- package/dist/context/scan/local-structural-artifacts.test.js +0 -144
- package/dist/context/scan/relationship-benchmark-report.test.d.ts +0 -1
- package/dist/context/scan/relationship-benchmark-report.test.js +0 -389
- package/dist/context/scan/relationship-benchmarks.test.d.ts +0 -1
- package/dist/context/scan/relationship-benchmarks.test.js +0 -1072
- package/dist/context/scan/relationship-budget.test.d.ts +0 -1
- package/dist/context/scan/relationship-budget.test.js +0 -71
- package/dist/context/scan/relationship-candidates.test.d.ts +0 -1
- package/dist/context/scan/relationship-candidates.test.js +0 -747
- package/dist/context/scan/relationship-composite-candidates.test.d.ts +0 -1
- package/dist/context/scan/relationship-composite-candidates.test.js +0 -69
- package/dist/context/scan/relationship-diagnostics.test.d.ts +0 -1
- package/dist/context/scan/relationship-diagnostics.test.js +0 -333
- package/dist/context/scan/relationship-discovery.test.d.ts +0 -1
- package/dist/context/scan/relationship-discovery.test.js +0 -618
- package/dist/context/scan/relationship-formal-metadata.test.d.ts +0 -1
- package/dist/context/scan/relationship-formal-metadata.test.js +0 -125
- package/dist/context/scan/relationship-graph-resolver.test.d.ts +0 -1
- package/dist/context/scan/relationship-graph-resolver.test.js +0 -604
- package/dist/context/scan/relationship-llm-proposal.test.d.ts +0 -1
- package/dist/context/scan/relationship-llm-proposal.test.js +0 -197
- package/dist/context/scan/relationship-locality.test.d.ts +0 -1
- package/dist/context/scan/relationship-locality.test.js +0 -128
- package/dist/context/scan/relationship-name-similarity.test.d.ts +0 -1
- package/dist/context/scan/relationship-name-similarity.test.js +0 -68
- package/dist/context/scan/relationship-profiling.test.d.ts +0 -1
- package/dist/context/scan/relationship-profiling.test.js +0 -392
- package/dist/context/scan/relationship-scoring.test.d.ts +0 -1
- package/dist/context/scan/relationship-scoring.test.js +0 -86
- package/dist/context/scan/relationship-validation.test.d.ts +0 -1
- package/dist/context/scan/relationship-validation.test.js +0 -455
- package/dist/context/scan/table-ref.test.d.ts +0 -1
- package/dist/context/scan/table-ref.test.js +0 -53
- package/dist/context/scan/type-normalization.test.d.ts +0 -1
- package/dist/context/scan/type-normalization.test.js +0 -21
- package/dist/context/scan/types.test.d.ts +0 -1
- package/dist/context/scan/types.test.js +0 -206
- package/dist/context/scan/warehouse-catalog.test.d.ts +0 -1
- package/dist/context/scan/warehouse-catalog.test.js +0 -158
- package/dist/context/search/backend-conformance.test-utils.d.ts +0 -39
- package/dist/context/search/backend-conformance.test-utils.js +0 -88
- package/dist/context/search/backend-conformance.test-utils.test.d.ts +0 -1
- package/dist/context/search/backend-conformance.test-utils.test.js +0 -408
- package/dist/context/search/discover.test.d.ts +0 -1
- package/dist/context/search/discover.test.js +0 -197
- package/dist/context/search/hybrid-search-core.test.d.ts +0 -1
- package/dist/context/search/hybrid-search-core.test.js +0 -113
- package/dist/context/search/pglite-owner-process.test.d.ts +0 -1
- package/dist/context/search/pglite-owner-process.test.js +0 -273
- package/dist/context/search/pglite-runtime-boundary.test.d.ts +0 -1
- package/dist/context/search/pglite-runtime-boundary.test.js +0 -40
- package/dist/context/search/pglite-spike.test.d.ts +0 -1
- package/dist/context/search/pglite-spike.test.js +0 -249
- package/dist/context/search/query.test.d.ts +0 -1
- package/dist/context/search/query.test.js +0 -23
- package/dist/context/search/rrf.test.d.ts +0 -1
- package/dist/context/search/rrf.test.js +0 -47
- package/dist/context/skills/skills-registry.service.test.d.ts +0 -1
- package/dist/context/skills/skills-registry.service.test.js +0 -161
- package/dist/context/sl/dictionary-search.test.d.ts +0 -1
- package/dist/context/sl/dictionary-search.test.js +0 -204
- package/dist/context/sl/local-query.test.d.ts +0 -1
- package/dist/context/sl/local-query.test.js +0 -283
- package/dist/context/sl/local-sl.test.d.ts +0 -1
- package/dist/context/sl/local-sl.test.js +0 -334
- package/dist/context/sl/pglite-sl-search-prototype.test.d.ts +0 -1
- package/dist/context/sl/pglite-sl-search-prototype.test.js +0 -240
- package/dist/context/sl/schemas.contract.test.d.ts +0 -1
- package/dist/context/sl/schemas.contract.test.js +0 -62
- package/dist/context/sl/semantic-layer.service.test.d.ts +0 -1
- package/dist/context/sl/semantic-layer.service.test.js +0 -1107
- package/dist/context/sl/sl-dictionary-profile.test.d.ts +0 -1
- package/dist/context/sl/sl-dictionary-profile.test.js +0 -88
- package/dist/context/sl/sl-search.service.test.d.ts +0 -1
- package/dist/context/sl/sl-search.service.test.js +0 -256
- package/dist/context/sl/sqlite-sl-sources-index.test.d.ts +0 -1
- package/dist/context/sl/sqlite-sl-sources-index.test.js +0 -175
- package/dist/context/sl/tools/connection-id-schema.test.d.ts +0 -1
- package/dist/context/sl/tools/connection-id-schema.test.js +0 -14
- package/dist/context/sl/tools/sl-discover.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-discover.tool.test.js +0 -72
- package/dist/context/sl/tools/sl-edit-source.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-edit-source.tool.test.js +0 -184
- package/dist/context/sl/tools/sl-read-source.tool.session.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-read-source.tool.session.test.js +0 -55
- package/dist/context/sl/tools/sl-rollback.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-rollback.tool.test.js +0 -57
- package/dist/context/sl/tools/sl-validate.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-validate.tool.test.js +0 -54
- package/dist/context/sl/tools/sl-warehouse-validation.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-warehouse-validation.test.js +0 -136
- package/dist/context/sl/tools/sl-write-source.tool.test.d.ts +0 -1
- package/dist/context/sl/tools/sl-write-source.tool.test.js +0 -307
- package/dist/context/sql-analysis/http-sql-analysis-port.test.d.ts +0 -1
- package/dist/context/sql-analysis/http-sql-analysis-port.test.js +0 -147
- package/dist/context/test/make-local-git-repo.d.ts +0 -10
- package/dist/context/test/make-local-git-repo.js +0 -34
- package/dist/context/tools/context-evidence-tools.test.d.ts +0 -1
- package/dist/context/tools/context-evidence-tools.test.js +0 -486
- package/dist/context/tools/touched-sl-sources.test.d.ts +0 -1
- package/dist/context/tools/touched-sl-sources.test.js +0 -31
- package/dist/context/wiki/knowledge-wiki.service.test.d.ts +0 -1
- package/dist/context/wiki/knowledge-wiki.service.test.js +0 -205
- package/dist/context/wiki/local-knowledge.test.d.ts +0 -1
- package/dist/context/wiki/local-knowledge.test.js +0 -270
- package/dist/context/wiki/sqlite-knowledge-index.test.d.ts +0 -1
- package/dist/context/wiki/sqlite-knowledge-index.test.js +0 -129
- package/dist/context/wiki/tools/wiki-list-tags.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-list-tags.tool.test.js +0 -35
- package/dist/context/wiki/tools/wiki-read.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-read.tool.test.js +0 -66
- package/dist/context/wiki/tools/wiki-remove.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-remove.tool.test.js +0 -95
- package/dist/context/wiki/tools/wiki-search.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-search.tool.test.js +0 -35
- package/dist/context/wiki/tools/wiki-write.tool.test.d.ts +0 -1
- package/dist/context/wiki/tools/wiki-write.tool.test.js +0 -264
- package/dist/context/wiki/wiki-ref-validation.test.d.ts +0 -1
- package/dist/context/wiki/wiki-ref-validation.test.js +0 -64
- package/dist/context-build-view.test.d.ts +0 -1
- package/dist/context-build-view.test.js +0 -942
- package/dist/database-tree-picker.test.d.ts +0 -1
- package/dist/database-tree-picker.test.js +0 -188
- package/dist/demo-assets.test.d.ts +0 -1
- package/dist/demo-assets.test.js +0 -121
- package/dist/demo-metrics.test.d.ts +0 -1
- package/dist/demo-metrics.test.js +0 -108
- package/dist/doctor.test.d.ts +0 -1
- package/dist/doctor.test.js +0 -596
- package/dist/embedding-resolution.test.d.ts +0 -1
- package/dist/embedding-resolution.test.js +0 -132
- package/dist/example-smoke.test.d.ts +0 -1
- package/dist/example-smoke.test.js +0 -83
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -1300
- package/dist/ingest-query-executor.test.d.ts +0 -1
- package/dist/ingest-query-executor.test.js +0 -71
- package/dist/ingest-report-file.test.d.ts +0 -1
- package/dist/ingest-report-file.test.js +0 -63
- package/dist/ingest-viz.test.d.ts +0 -1
- package/dist/ingest-viz.test.js +0 -691
- package/dist/ingest.test-utils.d.ts +0 -126
- package/dist/ingest.test-utils.js +0 -629
- package/dist/ingest.test.d.ts +0 -1
- package/dist/ingest.test.js +0 -1568
- package/dist/io/logger.test.d.ts +0 -1
- package/dist/io/logger.test.js +0 -55
- package/dist/io/mode.test.d.ts +0 -1
- package/dist/io/mode.test.js +0 -48
- package/dist/io/print-list.test.d.ts +0 -1
- package/dist/io/print-list.test.js +0 -277
- package/dist/knowledge.test.d.ts +0 -1
- package/dist/knowledge.test.js +0 -198
- package/dist/llm/embedding-health.test.d.ts +0 -1
- package/dist/llm/embedding-health.test.js +0 -72
- package/dist/llm/embedding-provider.test.d.ts +0 -1
- package/dist/llm/embedding-provider.test.js +0 -84
- package/dist/llm/message-builder.test.d.ts +0 -1
- package/dist/llm/message-builder.test.js +0 -127
- package/dist/llm/model-health.test.d.ts +0 -1
- package/dist/llm/model-health.test.js +0 -55
- package/dist/llm/model-provider.test.d.ts +0 -1
- package/dist/llm/model-provider.test.js +0 -246
- package/dist/llm/repair.test.d.ts +0 -1
- package/dist/llm/repair.test.js +0 -78
- package/dist/local-adapters.test.d.ts +0 -1
- package/dist/local-adapters.test.js +0 -166
- package/dist/local-scan-connectors.test.d.ts +0 -1
- package/dist/local-scan-connectors.test.js +0 -92
- package/dist/managed-local-embeddings.test.d.ts +0 -1
- package/dist/managed-local-embeddings.test.js +0 -229
- package/dist/managed-mcp-daemon.test.d.ts +0 -1
- package/dist/managed-mcp-daemon.test.js +0 -187
- package/dist/managed-python-command.test.d.ts +0 -1
- package/dist/managed-python-command.test.js +0 -262
- package/dist/managed-python-daemon.test.d.ts +0 -1
- package/dist/managed-python-daemon.test.js +0 -360
- package/dist/managed-python-http.test.d.ts +0 -1
- package/dist/managed-python-http.test.js +0 -177
- package/dist/managed-python-runtime.test.d.ts +0 -1
- package/dist/managed-python-runtime.test.js +0 -426
- package/dist/mcp-http-server.test.d.ts +0 -1
- package/dist/mcp-http-server.test.js +0 -209
- package/dist/mcp-server-factory.test.d.ts +0 -1
- package/dist/mcp-server-factory.test.js +0 -142
- package/dist/memory-flow-interactive.test.d.ts +0 -1
- package/dist/memory-flow-interactive.test.js +0 -109
- package/dist/memory-flow-tui.test.d.ts +0 -1
- package/dist/memory-flow-tui.test.js +0 -247
- package/dist/next-steps.test.d.ts +0 -1
- package/dist/next-steps.test.js +0 -77
- package/dist/notion-page-picker.test.d.ts +0 -1
- package/dist/notion-page-picker.test.js +0 -244
- package/dist/print-command-tree.test.d.ts +0 -1
- package/dist/print-command-tree.test.js +0 -37
- package/dist/project-dir.test.d.ts +0 -1
- package/dist/project-dir.test.js +0 -124
- package/dist/project-resolver.test.d.ts +0 -1
- package/dist/project-resolver.test.js +0 -49
- package/dist/prompt-navigation.test.d.ts +0 -1
- package/dist/prompt-navigation.test.js +0 -33
- package/dist/proxy-env.test.d.ts +0 -1
- package/dist/proxy-env.test.js +0 -17
- package/dist/public-ingest-copy.test.d.ts +0 -1
- package/dist/public-ingest-copy.test.js +0 -24
- package/dist/public-ingest.test.d.ts +0 -1
- package/dist/public-ingest.test.js +0 -891
- package/dist/runtime-requirements.test.d.ts +0 -1
- package/dist/runtime-requirements.test.js +0 -73
- package/dist/runtime.test.d.ts +0 -1
- package/dist/runtime.test.js +0 -381
- package/dist/scan.test.d.ts +0 -1
- package/dist/scan.test.js +0 -1123
- package/dist/setup-agents.test.d.ts +0 -1
- package/dist/setup-agents.test.js +0 -1028
- package/dist/setup-context.test.d.ts +0 -1
- package/dist/setup-context.test.js +0 -491
- package/dist/setup-databases.test.d.ts +0 -1
- package/dist/setup-databases.test.js +0 -2101
- package/dist/setup-demo-tour.test.d.ts +0 -1
- package/dist/setup-demo-tour.test.js +0 -221
- package/dist/setup-embeddings.test.d.ts +0 -1
- package/dist/setup-embeddings.test.js +0 -436
- package/dist/setup-interrupt.test.d.ts +0 -1
- package/dist/setup-interrupt.test.js +0 -77
- package/dist/setup-models.test.d.ts +0 -1
- package/dist/setup-models.test.js +0 -885
- package/dist/setup-project.test.d.ts +0 -1
- package/dist/setup-project.test.js +0 -209
- package/dist/setup-prompts.test.d.ts +0 -1
- package/dist/setup-prompts.test.js +0 -208
- package/dist/setup-ready-menu.test.d.ts +0 -1
- package/dist/setup-ready-menu.test.js +0 -44
- package/dist/setup-runtime.test.d.ts +0 -1
- package/dist/setup-runtime.test.js +0 -111
- package/dist/setup-secrets.test.d.ts +0 -1
- package/dist/setup-secrets.test.js +0 -30
- package/dist/setup-sources-notion.test.d.ts +0 -1
- package/dist/setup-sources-notion.test.js +0 -109
- package/dist/setup-sources.test.d.ts +0 -1
- package/dist/setup-sources.test.js +0 -1303
- package/dist/setup.test.d.ts +0 -1
- package/dist/setup.test.js +0 -1825
- package/dist/sl.test.d.ts +0 -1
- package/dist/sl.test.js +0 -567
- package/dist/source-mapping.test.d.ts +0 -1
- package/dist/source-mapping.test.js +0 -65
- package/dist/sql.test.d.ts +0 -1
- package/dist/sql.test.js +0 -253
- package/dist/standalone-smoke.test.d.ts +0 -1
- package/dist/standalone-smoke.test.js +0 -250
- package/dist/status-project.test.d.ts +0 -1
- package/dist/status-project.test.js +0 -502
- package/dist/telemetry/command-hook.test.d.ts +0 -1
- package/dist/telemetry/command-hook.test.js +0 -31
- package/dist/telemetry/demo-detect.test.d.ts +0 -1
- package/dist/telemetry/demo-detect.test.js +0 -22
- package/dist/telemetry/emitter.test.d.ts +0 -1
- package/dist/telemetry/emitter.test.js +0 -103
- package/dist/telemetry/events.snapshot.test.d.ts +0 -1
- package/dist/telemetry/events.snapshot.test.js +0 -135
- package/dist/telemetry/events.test.d.ts +0 -1
- package/dist/telemetry/events.test.js +0 -136
- package/dist/telemetry/identity.test.d.ts +0 -1
- package/dist/telemetry/identity.test.js +0 -148
- package/dist/telemetry/project-snapshot.test.d.ts +0 -1
- package/dist/telemetry/project-snapshot.test.js +0 -71
- package/dist/telemetry/schema-writer.test.d.ts +0 -1
- package/dist/telemetry/schema-writer.test.js +0 -23
- package/dist/telemetry/scrubber.test.d.ts +0 -1
- package/dist/telemetry/scrubber.test.js +0 -21
- package/dist/text-ingest.test.d.ts +0 -1
- package/dist/text-ingest.test.js +0 -247
- package/dist/tree-picker-state.test.d.ts +0 -1
- package/dist/tree-picker-state.test.js +0 -303
- package/dist/tree-picker-tui.test.d.ts +0 -1
- package/dist/tree-picker-tui.test.js +0 -248
- package/dist/viz-fallback.test.d.ts +0 -1
- package/dist/viz-fallback.test.js +0 -77
package/dist/scan.test.js
DELETED
|
@@ -1,1123 +0,0 @@
|
|
|
1
|
-
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { tmpdir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { initKtxProject } from './context/project/project.js';
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
-
import { createCliScanProgress, runKtxScan } from './scan.js';
|
|
7
|
-
const sqlServerExtractSchema = vi.hoisted(() => vi.fn(async (connectionId) => ({
|
|
8
|
-
connectionId,
|
|
9
|
-
extractedAt: '2026-04-29T16:00:00.000Z',
|
|
10
|
-
metadata: { database: 'analytics' },
|
|
11
|
-
tables: [
|
|
12
|
-
{
|
|
13
|
-
catalog: 'analytics',
|
|
14
|
-
db: 'dbo',
|
|
15
|
-
name: 'orders',
|
|
16
|
-
columns: [{ name: 'id', type: 'int', nullable: false, primaryKey: true }],
|
|
17
|
-
foreignKeys: [],
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
})));
|
|
21
|
-
const createSqlServerLiveDatabaseIntrospection = vi.hoisted(() => vi.fn(() => ({ extractSchema: sqlServerExtractSchema })));
|
|
22
|
-
const isKtxSqlServerConnectionConfig = vi.hoisted(() => vi.fn((connection) => connection?.driver === 'sqlserver'));
|
|
23
|
-
const KtxSqlServerScanConnector = vi.hoisted(() => class {
|
|
24
|
-
id;
|
|
25
|
-
driver = 'sqlserver';
|
|
26
|
-
constructor(options) {
|
|
27
|
-
this.id = `sqlserver:${options.connectionId}`;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const bigQueryExtractSchema = vi.hoisted(() => vi.fn(async (connectionId) => ({
|
|
31
|
-
connectionId,
|
|
32
|
-
extractedAt: '2026-04-29T17:00:00.000Z',
|
|
33
|
-
metadata: { project_id: 'project-1', datasets: ['analytics'] },
|
|
34
|
-
tables: [
|
|
35
|
-
{
|
|
36
|
-
catalog: 'project-1',
|
|
37
|
-
db: 'analytics',
|
|
38
|
-
name: 'orders',
|
|
39
|
-
columns: [{ name: 'id', type: 'INT64', nullable: false, primaryKey: true }],
|
|
40
|
-
foreignKeys: [],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
})));
|
|
44
|
-
const createBigQueryLiveDatabaseIntrospection = vi.hoisted(() => vi.fn(() => ({ extractSchema: bigQueryExtractSchema })));
|
|
45
|
-
const isKtxBigQueryConnectionConfig = vi.hoisted(() => vi.fn((connection) => connection?.driver === 'bigquery'));
|
|
46
|
-
const KtxBigQueryScanConnector = vi.hoisted(() => class {
|
|
47
|
-
id;
|
|
48
|
-
driver = 'bigquery';
|
|
49
|
-
constructor(options) {
|
|
50
|
-
this.id = `bigquery:${options.connectionId}`;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const snowflakeExtractSchema = vi.hoisted(() => vi.fn(async (connectionId) => ({
|
|
54
|
-
connectionId,
|
|
55
|
-
extractedAt: '2026-04-29T18:00:00.000Z',
|
|
56
|
-
metadata: { database: 'ANALYTICS', schemas: ['PUBLIC'] },
|
|
57
|
-
tables: [
|
|
58
|
-
{
|
|
59
|
-
catalog: 'ANALYTICS',
|
|
60
|
-
db: 'PUBLIC',
|
|
61
|
-
name: 'ORDERS',
|
|
62
|
-
columns: [{ name: 'ID', type: 'NUMBER', nullable: false, primaryKey: true }],
|
|
63
|
-
foreignKeys: [],
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
})));
|
|
67
|
-
const createSnowflakeLiveDatabaseIntrospection = vi.hoisted(() => vi.fn(() => ({ extractSchema: snowflakeExtractSchema })));
|
|
68
|
-
const isKtxSnowflakeConnectionConfig = vi.hoisted(() => vi.fn((connection) => connection?.driver === 'snowflake'));
|
|
69
|
-
const snowflakeConnectorInstances = vi.hoisted(() => []);
|
|
70
|
-
const KtxSnowflakeScanConnector = vi.hoisted(() => class {
|
|
71
|
-
id;
|
|
72
|
-
driver = 'snowflake';
|
|
73
|
-
cleanup = vi.fn(async () => undefined);
|
|
74
|
-
constructor(options) {
|
|
75
|
-
this.id = `snowflake:${options.connectionId}`;
|
|
76
|
-
snowflakeConnectorInstances.push(this);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const postgresExtractSchema = vi.hoisted(() => vi.fn(async (connectionId) => ({
|
|
80
|
-
connectionId,
|
|
81
|
-
extractedAt: '2026-04-29T12:00:00.000Z',
|
|
82
|
-
metadata: { database: 'analytics' },
|
|
83
|
-
tables: [],
|
|
84
|
-
})));
|
|
85
|
-
const createPostgresLiveDatabaseIntrospection = vi.hoisted(() => vi.fn(() => ({ extractSchema: postgresExtractSchema })));
|
|
86
|
-
const isKtxPostgresConnectionConfig = vi.hoisted(() => vi.fn((connection) => ['postgres', 'postgresql'].includes(String(connection?.driver ?? '').toLowerCase())));
|
|
87
|
-
const KtxPostgresScanConnector = vi.hoisted(() => class {
|
|
88
|
-
id;
|
|
89
|
-
driver = 'postgres';
|
|
90
|
-
constructor(options) {
|
|
91
|
-
this.id = `postgres:${options.connectionId}`;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
vi.mock('./connectors/sqlserver/connector.js', () => ({
|
|
95
|
-
isKtxSqlServerConnectionConfig,
|
|
96
|
-
KtxSqlServerScanConnector,
|
|
97
|
-
}));
|
|
98
|
-
vi.mock('./connectors/sqlserver/live-database-introspection.js', () => ({
|
|
99
|
-
createSqlServerLiveDatabaseIntrospection,
|
|
100
|
-
}));
|
|
101
|
-
vi.mock('./connectors/bigquery/connector.js', () => ({
|
|
102
|
-
isKtxBigQueryConnectionConfig,
|
|
103
|
-
KtxBigQueryScanConnector,
|
|
104
|
-
}));
|
|
105
|
-
vi.mock('./connectors/bigquery/live-database-introspection.js', () => ({
|
|
106
|
-
createBigQueryLiveDatabaseIntrospection,
|
|
107
|
-
}));
|
|
108
|
-
vi.mock('./connectors/snowflake/connector.js', () => ({
|
|
109
|
-
isKtxSnowflakeConnectionConfig,
|
|
110
|
-
KtxSnowflakeScanConnector,
|
|
111
|
-
}));
|
|
112
|
-
vi.mock('./connectors/snowflake/live-database-introspection.js', () => ({
|
|
113
|
-
createSnowflakeLiveDatabaseIntrospection,
|
|
114
|
-
}));
|
|
115
|
-
vi.mock('./connectors/postgres/connector.js', () => ({
|
|
116
|
-
isKtxPostgresConnectionConfig,
|
|
117
|
-
KtxPostgresScanConnector,
|
|
118
|
-
}));
|
|
119
|
-
vi.mock('./connectors/postgres/live-database-introspection.js', () => ({
|
|
120
|
-
createPostgresLiveDatabaseIntrospection,
|
|
121
|
-
}));
|
|
122
|
-
function makeIo(options = {}) {
|
|
123
|
-
let stdout = '';
|
|
124
|
-
let stderr = '';
|
|
125
|
-
return {
|
|
126
|
-
io: {
|
|
127
|
-
stdout: {
|
|
128
|
-
isTTY: options.isTTY,
|
|
129
|
-
write: (chunk) => {
|
|
130
|
-
stdout += chunk;
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
stderr: {
|
|
134
|
-
write: (chunk) => {
|
|
135
|
-
stderr += chunk;
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
stdout: () => stdout,
|
|
140
|
-
stderr: () => stderr,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
function fakeLiveDatabaseAdapter(createIntrospection) {
|
|
144
|
-
return {
|
|
145
|
-
source: 'live-database',
|
|
146
|
-
skillNames: [],
|
|
147
|
-
async detect() {
|
|
148
|
-
return true;
|
|
149
|
-
},
|
|
150
|
-
async fetch(_pullConfig, stagedDir, ctx) {
|
|
151
|
-
await mkdir(stagedDir, { recursive: true });
|
|
152
|
-
const schema = await createIntrospection({ connections: {} }).extractSchema(ctx.connectionId);
|
|
153
|
-
await writeFile(join(stagedDir, 'connection.json'), JSON.stringify({ connectionId: ctx.connectionId, schema }, null, 2), 'utf-8');
|
|
154
|
-
},
|
|
155
|
-
async chunk() {
|
|
156
|
-
return { workUnits: [] };
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
const report = {
|
|
161
|
-
connectionId: 'warehouse',
|
|
162
|
-
driver: 'postgres',
|
|
163
|
-
syncId: 'sync-1',
|
|
164
|
-
runId: 'scan-run-1',
|
|
165
|
-
trigger: 'cli',
|
|
166
|
-
mode: 'structural',
|
|
167
|
-
dryRun: false,
|
|
168
|
-
artifactPaths: {
|
|
169
|
-
rawSourcesDir: 'raw-sources/warehouse/live-database/sync-1',
|
|
170
|
-
reportPath: 'raw-sources/warehouse/live-database/sync-1/scan-report.json',
|
|
171
|
-
manifestShards: [],
|
|
172
|
-
enrichmentArtifacts: [],
|
|
173
|
-
},
|
|
174
|
-
diffSummary: {
|
|
175
|
-
tablesAdded: 1,
|
|
176
|
-
tablesModified: 0,
|
|
177
|
-
tablesDeleted: 0,
|
|
178
|
-
tablesUnchanged: 0,
|
|
179
|
-
columnsAdded: 0,
|
|
180
|
-
columnsModified: 0,
|
|
181
|
-
columnsDeleted: 0,
|
|
182
|
-
},
|
|
183
|
-
manifestShardsWritten: 0,
|
|
184
|
-
structuralSyncStats: {
|
|
185
|
-
tablesCreated: 0,
|
|
186
|
-
tablesUpdated: 0,
|
|
187
|
-
tablesDeleted: 0,
|
|
188
|
-
columnsCreated: 0,
|
|
189
|
-
columnsUpdated: 0,
|
|
190
|
-
columnsDeleted: 0,
|
|
191
|
-
},
|
|
192
|
-
enrichment: {
|
|
193
|
-
dataDictionary: 'skipped',
|
|
194
|
-
tableDescriptions: 'skipped',
|
|
195
|
-
columnDescriptions: 'skipped',
|
|
196
|
-
embeddings: 'skipped',
|
|
197
|
-
deterministicRelationships: 'skipped',
|
|
198
|
-
llmRelationshipValidation: 'skipped',
|
|
199
|
-
statisticalValidation: 'skipped',
|
|
200
|
-
},
|
|
201
|
-
capabilityGaps: [],
|
|
202
|
-
warnings: [],
|
|
203
|
-
relationships: { accepted: 0, review: 0, rejected: 0, skipped: 0 },
|
|
204
|
-
enrichmentState: {
|
|
205
|
-
resumedStages: [],
|
|
206
|
-
completedStages: [],
|
|
207
|
-
failedStages: [],
|
|
208
|
-
},
|
|
209
|
-
createdAt: '2026-04-29T09:00:00.000Z',
|
|
210
|
-
};
|
|
211
|
-
const reportWithAttention = {
|
|
212
|
-
...report,
|
|
213
|
-
mode: 'relationships',
|
|
214
|
-
diffSummary: {
|
|
215
|
-
tablesAdded: 3,
|
|
216
|
-
tablesModified: 2,
|
|
217
|
-
tablesDeleted: 0,
|
|
218
|
-
tablesUnchanged: 13,
|
|
219
|
-
columnsAdded: 18,
|
|
220
|
-
columnsModified: 5,
|
|
221
|
-
columnsDeleted: 0,
|
|
222
|
-
},
|
|
223
|
-
capabilityGaps: ['columnStats'],
|
|
224
|
-
warnings: [
|
|
225
|
-
{
|
|
226
|
-
code: 'connector_capability_missing',
|
|
227
|
-
message: 'KTX scan connector is missing optional capability: columnStats',
|
|
228
|
-
recoverable: true,
|
|
229
|
-
metadata: { capability: 'columnStats' },
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
code: 'relationship_validation_failed',
|
|
233
|
-
message: 'Could not validate relationship orders.customer_id -> customers.id',
|
|
234
|
-
table: 'orders',
|
|
235
|
-
column: 'customer_id',
|
|
236
|
-
recoverable: true,
|
|
237
|
-
},
|
|
238
|
-
],
|
|
239
|
-
relationships: { accepted: 7, review: 3, rejected: 2, skipped: 4 },
|
|
240
|
-
enrichmentState: {
|
|
241
|
-
resumedStages: ['relationships'],
|
|
242
|
-
completedStages: ['descriptions', 'relationships'],
|
|
243
|
-
failedStages: [],
|
|
244
|
-
},
|
|
245
|
-
artifactPaths: {
|
|
246
|
-
...report.artifactPaths,
|
|
247
|
-
manifestShards: ['raw-sources/warehouse/live-database/sync-1/_schema/shard-000.json'],
|
|
248
|
-
enrichmentArtifacts: ['raw-sources/warehouse/live-database/sync-1/_enrichment/relationships.json'],
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
describe('runKtxScan', () => {
|
|
252
|
-
let tempDir;
|
|
253
|
-
const noLocalIngestAdapters = () => [];
|
|
254
|
-
beforeEach(async () => {
|
|
255
|
-
tempDir = await mkdtemp(join(tmpdir(), 'ktx-cli-scan-'));
|
|
256
|
-
});
|
|
257
|
-
afterEach(async () => {
|
|
258
|
-
vi.unstubAllEnvs();
|
|
259
|
-
await rm(tempDir, { recursive: true, force: true });
|
|
260
|
-
});
|
|
261
|
-
it('runs structural scans and prints a dev-friendly plain summary', async () => {
|
|
262
|
-
await initKtxProject({ projectDir: tempDir });
|
|
263
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
264
|
-
runId: 'scan-run-1',
|
|
265
|
-
status: 'done',
|
|
266
|
-
done: true,
|
|
267
|
-
connectionId: 'warehouse',
|
|
268
|
-
mode: 'structural',
|
|
269
|
-
dryRun: false,
|
|
270
|
-
syncId: 'sync-1',
|
|
271
|
-
report,
|
|
272
|
-
}));
|
|
273
|
-
const io = makeIo();
|
|
274
|
-
await expect(runKtxScan({
|
|
275
|
-
command: 'run',
|
|
276
|
-
projectDir: tempDir,
|
|
277
|
-
connectionId: 'warehouse',
|
|
278
|
-
mode: 'structural',
|
|
279
|
-
detectRelationships: false,
|
|
280
|
-
dryRun: false,
|
|
281
|
-
databaseIntrospectionUrl: 'http://127.0.0.1:8765',
|
|
282
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
283
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({
|
|
284
|
-
connectionId: 'warehouse',
|
|
285
|
-
mode: 'structural',
|
|
286
|
-
databaseIntrospectionUrl: 'http://127.0.0.1:8765',
|
|
287
|
-
connector: undefined,
|
|
288
|
-
}));
|
|
289
|
-
expect(io.stdout()).toContain('KTX scan completed\n');
|
|
290
|
-
expect(io.stdout()).toContain('Run: scan-run-1');
|
|
291
|
-
expect(io.stdout()).toContain('Mode: structural');
|
|
292
|
-
expect(io.stdout()).toContain('What changed\n');
|
|
293
|
-
expect(io.stdout()).toContain('New tables: 1\n');
|
|
294
|
-
expect(io.stdout()).toContain('Changed tables: 0\n');
|
|
295
|
-
expect(io.stdout()).toContain('Removed tables: 0\n');
|
|
296
|
-
expect(io.stdout()).toContain('Unchanged tables: 0\n');
|
|
297
|
-
expect(io.stdout()).toContain('Needs attention\n None\n');
|
|
298
|
-
expect(io.stdout()).toContain('Artifacts\n');
|
|
299
|
-
expect(io.stdout()).toContain('Report: raw-sources/warehouse/live-database/sync-1/scan-report.json');
|
|
300
|
-
expect(io.stdout()).toContain('Next:\n');
|
|
301
|
-
expect(io.stdout()).toContain('ktx status --project-dir ');
|
|
302
|
-
expect(io.stdout()).not.toContain('ktx admin scan status');
|
|
303
|
-
expect(io.stdout()).not.toContain('ktx admin scan report');
|
|
304
|
-
expect(io.stdout()).not.toContain('\u001b[');
|
|
305
|
-
expect(io.stdout()).not.toContain('✓');
|
|
306
|
-
expect(io.stdout()).not.toContain('+1');
|
|
307
|
-
expect(io.stdout()).not.toContain('/~');
|
|
308
|
-
});
|
|
309
|
-
it('emits debug telemetry for completed scans without project paths', async () => {
|
|
310
|
-
vi.stubEnv('KTX_TELEMETRY_DEBUG', '1');
|
|
311
|
-
vi.stubEnv('CI', '');
|
|
312
|
-
await initKtxProject({ projectDir: tempDir });
|
|
313
|
-
const runLocalScan = vi.fn(async () => ({
|
|
314
|
-
runId: 'scan-run-1',
|
|
315
|
-
status: 'done',
|
|
316
|
-
done: true,
|
|
317
|
-
connectionId: 'warehouse',
|
|
318
|
-
mode: 'structural',
|
|
319
|
-
dryRun: false,
|
|
320
|
-
syncId: 'sync-1',
|
|
321
|
-
report,
|
|
322
|
-
}));
|
|
323
|
-
const io = makeIo({ isTTY: true });
|
|
324
|
-
const code = await runKtxScan({
|
|
325
|
-
command: 'run',
|
|
326
|
-
projectDir: tempDir,
|
|
327
|
-
connectionId: 'warehouse',
|
|
328
|
-
mode: 'structural',
|
|
329
|
-
detectRelationships: false,
|
|
330
|
-
dryRun: false,
|
|
331
|
-
databaseIntrospectionUrl: 'http://127.0.0.1:8765',
|
|
332
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters });
|
|
333
|
-
expect(code).toBe(0);
|
|
334
|
-
expect(io.stderr()).toContain('"event":"scan_completed"');
|
|
335
|
-
expect(io.stderr()).toContain('"tableCount"');
|
|
336
|
-
expect(io.stderr()).not.toContain(tempDir);
|
|
337
|
-
});
|
|
338
|
-
it('passes KTX daemon options to local ingest adapters when no explicit daemon URL is set', async () => {
|
|
339
|
-
await initKtxProject({ projectDir: tempDir });
|
|
340
|
-
const createLocalIngestAdapters = vi.fn(() => []);
|
|
341
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
342
|
-
runId: 'scan-run-1',
|
|
343
|
-
status: 'done',
|
|
344
|
-
done: true,
|
|
345
|
-
connectionId: 'warehouse',
|
|
346
|
-
mode: 'structural',
|
|
347
|
-
dryRun: false,
|
|
348
|
-
syncId: 'sync-1',
|
|
349
|
-
report,
|
|
350
|
-
}));
|
|
351
|
-
const io = makeIo();
|
|
352
|
-
const runtimeIo = makeIo({ isTTY: true });
|
|
353
|
-
await expect(runKtxScan({
|
|
354
|
-
command: 'run',
|
|
355
|
-
projectDir: tempDir,
|
|
356
|
-
connectionId: 'warehouse',
|
|
357
|
-
mode: 'structural',
|
|
358
|
-
detectRelationships: false,
|
|
359
|
-
dryRun: false,
|
|
360
|
-
cliVersion: '0.2.0',
|
|
361
|
-
runtimeInstallPolicy: 'auto',
|
|
362
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters, runtimeIo: runtimeIo.io })).resolves.toBe(0);
|
|
363
|
-
expect(createLocalIngestAdapters).toHaveBeenCalledWith(expect.objectContaining({ projectDir: tempDir }), {
|
|
364
|
-
managedDaemon: {
|
|
365
|
-
cliVersion: '0.2.0',
|
|
366
|
-
projectDir: tempDir,
|
|
367
|
-
installPolicy: 'auto',
|
|
368
|
-
io: runtimeIo.io,
|
|
369
|
-
},
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
it('uses runtime IO when resolving managed embedding runtime', async () => {
|
|
373
|
-
await initKtxProject({ projectDir: tempDir });
|
|
374
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
375
|
-
runId: 'scan-run-1',
|
|
376
|
-
status: 'done',
|
|
377
|
-
done: true,
|
|
378
|
-
connectionId: 'warehouse',
|
|
379
|
-
mode: 'structural',
|
|
380
|
-
dryRun: false,
|
|
381
|
-
syncId: 'sync-1',
|
|
382
|
-
report,
|
|
383
|
-
}));
|
|
384
|
-
const resolveEmbeddingProvider = vi.fn(async () => ({ kind: 'disabled' }));
|
|
385
|
-
const io = makeIo();
|
|
386
|
-
const runtimeIo = makeIo({ isTTY: true });
|
|
387
|
-
await expect(runKtxScan({
|
|
388
|
-
command: 'run',
|
|
389
|
-
projectDir: tempDir,
|
|
390
|
-
connectionId: 'warehouse',
|
|
391
|
-
mode: 'structural',
|
|
392
|
-
detectRelationships: false,
|
|
393
|
-
dryRun: false,
|
|
394
|
-
cliVersion: '0.2.0',
|
|
395
|
-
runtimeInstallPolicy: 'auto',
|
|
396
|
-
}, io.io, {
|
|
397
|
-
runLocalScan,
|
|
398
|
-
createLocalIngestAdapters: noLocalIngestAdapters,
|
|
399
|
-
runtimeIo: runtimeIo.io,
|
|
400
|
-
resolveEmbeddingProvider,
|
|
401
|
-
})).resolves.toBe(0);
|
|
402
|
-
expect(resolveEmbeddingProvider).toHaveBeenCalledWith(expect.anything(), expect.objectContaining({
|
|
403
|
-
installPolicy: 'auto',
|
|
404
|
-
io: runtimeIo.io,
|
|
405
|
-
}));
|
|
406
|
-
});
|
|
407
|
-
it('explains warnings, capability gaps, and relationships in human scan summaries', async () => {
|
|
408
|
-
await initKtxProject({ projectDir: tempDir });
|
|
409
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
410
|
-
runId: 'scan-run-1',
|
|
411
|
-
status: 'done',
|
|
412
|
-
done: true,
|
|
413
|
-
connectionId: 'warehouse',
|
|
414
|
-
mode: 'relationships',
|
|
415
|
-
dryRun: false,
|
|
416
|
-
syncId: 'sync-1',
|
|
417
|
-
report: reportWithAttention,
|
|
418
|
-
}));
|
|
419
|
-
const io = makeIo();
|
|
420
|
-
await expect(runKtxScan({
|
|
421
|
-
command: 'run',
|
|
422
|
-
projectDir: tempDir,
|
|
423
|
-
connectionId: 'warehouse',
|
|
424
|
-
mode: 'structural',
|
|
425
|
-
detectRelationships: false,
|
|
426
|
-
dryRun: false,
|
|
427
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
428
|
-
expect(io.stdout()).toContain('Semantic layer comparison found 5 changes across 18 tables');
|
|
429
|
-
expect(io.stdout()).toContain('New columns: 18');
|
|
430
|
-
expect(io.stdout()).toContain('Changed columns: 5');
|
|
431
|
-
expect(io.stdout()).toContain('Relationships\n');
|
|
432
|
-
expect(io.stdout()).toContain('Accepted: 7');
|
|
433
|
-
expect(io.stdout()).toContain('Review: 3');
|
|
434
|
-
expect(io.stdout()).toContain('Rejected: 2');
|
|
435
|
-
expect(io.stdout()).toContain('Skipped: 4');
|
|
436
|
-
expect(io.stdout()).toContain('Needs attention\n');
|
|
437
|
-
expect(io.stdout()).toContain('2 warnings');
|
|
438
|
-
expect(io.stdout()).toContain('1 capability gap');
|
|
439
|
-
expect(io.stdout()).toContain('columnStats is unavailable; relationship confidence may be lower.');
|
|
440
|
-
expect(io.stdout()).toContain('relationship_validation_failed: orders.customer_id: Could not validate relationship orders.customer_id -> customers.id');
|
|
441
|
-
expect(io.stdout()).not.toContain('+3');
|
|
442
|
-
expect(io.stdout()).not.toContain('~2');
|
|
443
|
-
expect(io.stdout()).not.toContain('=13');
|
|
444
|
-
});
|
|
445
|
-
it('prints review-only relationship summaries and validation capability warnings', async () => {
|
|
446
|
-
await initKtxProject({ projectDir: tempDir });
|
|
447
|
-
const reviewOnlyReport = {
|
|
448
|
-
...reportWithAttention,
|
|
449
|
-
capabilityGaps: [],
|
|
450
|
-
warnings: [
|
|
451
|
-
{
|
|
452
|
-
code: 'connector_capability_missing',
|
|
453
|
-
message: 'KTX scan connector cannot run read-only SQL relationship validation',
|
|
454
|
-
recoverable: true,
|
|
455
|
-
metadata: { capability: 'readOnlySql' },
|
|
456
|
-
},
|
|
457
|
-
],
|
|
458
|
-
relationships: { accepted: 0, review: 12, rejected: 44, skipped: 0 },
|
|
459
|
-
};
|
|
460
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
461
|
-
runId: 'scan-run-review',
|
|
462
|
-
status: 'done',
|
|
463
|
-
done: true,
|
|
464
|
-
connectionId: 'warehouse',
|
|
465
|
-
mode: 'relationships',
|
|
466
|
-
dryRun: false,
|
|
467
|
-
syncId: 'sync-review',
|
|
468
|
-
report: reviewOnlyReport,
|
|
469
|
-
}));
|
|
470
|
-
const io = makeIo();
|
|
471
|
-
await expect(runKtxScan({
|
|
472
|
-
command: 'run',
|
|
473
|
-
projectDir: tempDir,
|
|
474
|
-
connectionId: 'warehouse',
|
|
475
|
-
mode: 'structural',
|
|
476
|
-
detectRelationships: false,
|
|
477
|
-
dryRun: false,
|
|
478
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
479
|
-
expect(io.stdout()).toContain('Relationships');
|
|
480
|
-
expect(io.stdout()).toContain('Accepted: 0');
|
|
481
|
-
expect(io.stdout()).toContain('Review: 12');
|
|
482
|
-
expect(io.stdout()).toContain('Rejected: 44');
|
|
483
|
-
expect(io.stdout()).toContain('connector_capability_missing: KTX scan connector cannot run read-only SQL relationship validation');
|
|
484
|
-
});
|
|
485
|
-
it('passes a scan progress port and prints TTY progress messages', async () => {
|
|
486
|
-
await initKtxProject({ projectDir: tempDir });
|
|
487
|
-
const runLocalScan = vi.fn(async (input) => {
|
|
488
|
-
await input.progress?.update(0.15, 'Inspecting database schema');
|
|
489
|
-
await input.progress?.update(0.55, 'Semantic layer comparison found 5 changes across 18 tables');
|
|
490
|
-
return {
|
|
491
|
-
runId: 'scan-run-1',
|
|
492
|
-
status: 'done',
|
|
493
|
-
done: true,
|
|
494
|
-
connectionId: 'warehouse',
|
|
495
|
-
mode: 'relationships',
|
|
496
|
-
dryRun: false,
|
|
497
|
-
syncId: 'sync-1',
|
|
498
|
-
report: reportWithAttention,
|
|
499
|
-
};
|
|
500
|
-
});
|
|
501
|
-
const io = makeIo({ isTTY: true });
|
|
502
|
-
const previousCi = process.env.CI;
|
|
503
|
-
delete process.env.CI;
|
|
504
|
-
try {
|
|
505
|
-
const exitCode = await runKtxScan({
|
|
506
|
-
command: 'run',
|
|
507
|
-
projectDir: tempDir,
|
|
508
|
-
connectionId: 'warehouse',
|
|
509
|
-
mode: 'structural',
|
|
510
|
-
detectRelationships: false,
|
|
511
|
-
dryRun: false,
|
|
512
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters });
|
|
513
|
-
expect({ exitCode, stderr: io.stderr() }).toEqual({ exitCode: 0, stderr: '' });
|
|
514
|
-
}
|
|
515
|
-
finally {
|
|
516
|
-
if (previousCi === undefined) {
|
|
517
|
-
delete process.env.CI;
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
process.env.CI = previousCi;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
expect(runLocalScan.mock.calls[0]?.[0].progress).toBeDefined();
|
|
524
|
-
expect(io.stdout()).toContain('[15%] Inspecting database schema');
|
|
525
|
-
expect(io.stdout()).toContain('[55%] Semantic layer comparison found 5 changes across 18 tables');
|
|
526
|
-
});
|
|
527
|
-
it('uses injected structured progress without requiring TTY progress output', async () => {
|
|
528
|
-
await initKtxProject({ projectDir: tempDir });
|
|
529
|
-
const progressEvents = [];
|
|
530
|
-
const structuredProgress = {
|
|
531
|
-
async update(progress, message, options) {
|
|
532
|
-
progressEvents.push({
|
|
533
|
-
progress,
|
|
534
|
-
...(message !== undefined ? { message } : {}),
|
|
535
|
-
...(options?.transient !== undefined ? { transient: options.transient } : {}),
|
|
536
|
-
});
|
|
537
|
-
},
|
|
538
|
-
startPhase() {
|
|
539
|
-
return structuredProgress;
|
|
540
|
-
},
|
|
541
|
-
};
|
|
542
|
-
const runLocalScan = vi.fn(async (input) => {
|
|
543
|
-
await input.progress?.update(0.42, 'Generating descriptions 4/10 tables', { transient: true });
|
|
544
|
-
return {
|
|
545
|
-
runId: 'scan-run-1',
|
|
546
|
-
status: 'done',
|
|
547
|
-
done: true,
|
|
548
|
-
connectionId: 'warehouse',
|
|
549
|
-
mode: 'structural',
|
|
550
|
-
dryRun: false,
|
|
551
|
-
syncId: 'sync-1',
|
|
552
|
-
report,
|
|
553
|
-
};
|
|
554
|
-
});
|
|
555
|
-
const io = makeIo();
|
|
556
|
-
await expect(runKtxScan({
|
|
557
|
-
command: 'run',
|
|
558
|
-
projectDir: tempDir,
|
|
559
|
-
connectionId: 'warehouse',
|
|
560
|
-
mode: 'structural',
|
|
561
|
-
detectRelationships: false,
|
|
562
|
-
dryRun: false,
|
|
563
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters, progress: structuredProgress })).resolves.toBe(0);
|
|
564
|
-
expect(progressEvents).toContainEqual({
|
|
565
|
-
progress: 0.42,
|
|
566
|
-
message: 'Generating descriptions 4/10 tables',
|
|
567
|
-
transient: true,
|
|
568
|
-
});
|
|
569
|
-
expect(io.stdout()).not.toContain('[42%] Generating descriptions 4/10 tables');
|
|
570
|
-
});
|
|
571
|
-
it('updates transient TTY progress messages in place', async () => {
|
|
572
|
-
const io = makeIo({ isTTY: true });
|
|
573
|
-
const previousCi = process.env.CI;
|
|
574
|
-
delete process.env.CI;
|
|
575
|
-
try {
|
|
576
|
-
const progress = createCliScanProgress(io.io);
|
|
577
|
-
await progress.update(0.84, 'Generating descriptions 1/35 tables', { transient: true });
|
|
578
|
-
await progress.update(0.85, 'Generating descriptions 2/35 tables', { transient: true });
|
|
579
|
-
await progress.update(0.9, 'Building embeddings 1/4 batches');
|
|
580
|
-
}
|
|
581
|
-
finally {
|
|
582
|
-
if (previousCi === undefined) {
|
|
583
|
-
delete process.env.CI;
|
|
584
|
-
}
|
|
585
|
-
else {
|
|
586
|
-
process.env.CI = previousCi;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
expect(io.stdout()).toContain('\r[84%] Generating descriptions 1/35 tables');
|
|
590
|
-
expect(io.stdout()).toContain('\r[85%] Generating descriptions 2/35 tables');
|
|
591
|
-
expect(io.stdout()).toContain('\n[90%] Building embeddings 1/4 batches\n');
|
|
592
|
-
});
|
|
593
|
-
it('scales nested progress phases by the parent phase weight', async () => {
|
|
594
|
-
const io = makeIo({ isTTY: true });
|
|
595
|
-
const previousCi = process.env.CI;
|
|
596
|
-
delete process.env.CI;
|
|
597
|
-
try {
|
|
598
|
-
const progress = createCliScanProgress(io.io);
|
|
599
|
-
await progress.update(0.82, 'Enriching schema metadata');
|
|
600
|
-
const enrichmentProgress = progress.startPhase(0.18);
|
|
601
|
-
await enrichmentProgress.update(0.05, 'Loaded schema snapshot with 56 tables');
|
|
602
|
-
const descriptionProgress = enrichmentProgress.startPhase(0.45);
|
|
603
|
-
await descriptionProgress.update(37 / 56, 'Generating descriptions 37/56 tables', { transient: true });
|
|
604
|
-
await descriptionProgress.update(1, 'Generated descriptions for 56 tables');
|
|
605
|
-
}
|
|
606
|
-
finally {
|
|
607
|
-
if (previousCi === undefined) {
|
|
608
|
-
delete process.env.CI;
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
process.env.CI = previousCi;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
expect(io.stdout()).toContain('\r[88%] Generating descriptions 37/56 tables');
|
|
615
|
-
expect(io.stdout()).toContain('\n[91%] Generated descriptions for 56 tables\n');
|
|
616
|
-
expect(io.stdout()).not.toContain('[100%] Generating descriptions 37/56 tables');
|
|
617
|
-
});
|
|
618
|
-
it('flushes transient TTY progress messages before printing scan failures', async () => {
|
|
619
|
-
await initKtxProject({ projectDir: tempDir });
|
|
620
|
-
const runLocalScan = vi.fn(async (input) => {
|
|
621
|
-
await input.progress?.update(0.42, 'Generating descriptions 3/35 tables', { transient: true });
|
|
622
|
-
throw new Error('scan failed');
|
|
623
|
-
});
|
|
624
|
-
const io = makeIo({ isTTY: true });
|
|
625
|
-
const previousCi = process.env.CI;
|
|
626
|
-
delete process.env.CI;
|
|
627
|
-
try {
|
|
628
|
-
await expect(runKtxScan({
|
|
629
|
-
command: 'run',
|
|
630
|
-
projectDir: tempDir,
|
|
631
|
-
connectionId: 'warehouse',
|
|
632
|
-
mode: 'structural',
|
|
633
|
-
detectRelationships: false,
|
|
634
|
-
dryRun: false,
|
|
635
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: () => [] })).resolves.toBe(1);
|
|
636
|
-
}
|
|
637
|
-
finally {
|
|
638
|
-
if (previousCi === undefined) {
|
|
639
|
-
delete process.env.CI;
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
process.env.CI = previousCi;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
expect(io.stdout()).toContain('\r[42%] Generating descriptions 3/35 tables\u001b[K\n');
|
|
646
|
-
expect(io.stderr()).toBe('scan failed\n');
|
|
647
|
-
});
|
|
648
|
-
it('does not print live progress messages for non-TTY output', async () => {
|
|
649
|
-
await initKtxProject({ projectDir: tempDir });
|
|
650
|
-
const runLocalScan = vi.fn(async (input) => {
|
|
651
|
-
await input.progress?.update(0.15, 'Inspecting database schema');
|
|
652
|
-
return {
|
|
653
|
-
runId: 'scan-run-1',
|
|
654
|
-
status: 'done',
|
|
655
|
-
done: true,
|
|
656
|
-
connectionId: 'warehouse',
|
|
657
|
-
mode: 'structural',
|
|
658
|
-
dryRun: false,
|
|
659
|
-
syncId: 'sync-1',
|
|
660
|
-
report,
|
|
661
|
-
};
|
|
662
|
-
});
|
|
663
|
-
const io = makeIo();
|
|
664
|
-
await expect(runKtxScan({
|
|
665
|
-
command: 'run',
|
|
666
|
-
projectDir: tempDir,
|
|
667
|
-
connectionId: 'warehouse',
|
|
668
|
-
mode: 'structural',
|
|
669
|
-
detectRelationships: false,
|
|
670
|
-
dryRun: false,
|
|
671
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
672
|
-
expect(io.stdout()).not.toContain('[15%]');
|
|
673
|
-
expect(io.stdout()).not.toContain('Inspecting database schema');
|
|
674
|
-
});
|
|
675
|
-
it('uses terminal-aware visual styling only for TTY output', async () => {
|
|
676
|
-
await initKtxProject({ projectDir: tempDir });
|
|
677
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
678
|
-
runId: 'scan-run-1',
|
|
679
|
-
status: 'done',
|
|
680
|
-
done: true,
|
|
681
|
-
connectionId: 'warehouse',
|
|
682
|
-
mode: 'structural',
|
|
683
|
-
dryRun: false,
|
|
684
|
-
syncId: 'sync-1',
|
|
685
|
-
report,
|
|
686
|
-
}));
|
|
687
|
-
const io = makeIo({ isTTY: true });
|
|
688
|
-
const previousNoColor = process.env.NO_COLOR;
|
|
689
|
-
const previousCi = process.env.CI;
|
|
690
|
-
const previousTerm = process.env.TERM;
|
|
691
|
-
delete process.env.NO_COLOR;
|
|
692
|
-
delete process.env.CI;
|
|
693
|
-
process.env.TERM = 'xterm-256color';
|
|
694
|
-
try {
|
|
695
|
-
await expect(runKtxScan({
|
|
696
|
-
command: 'run',
|
|
697
|
-
projectDir: tempDir,
|
|
698
|
-
connectionId: 'warehouse',
|
|
699
|
-
mode: 'structural',
|
|
700
|
-
detectRelationships: false,
|
|
701
|
-
dryRun: false,
|
|
702
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
703
|
-
}
|
|
704
|
-
finally {
|
|
705
|
-
if (previousNoColor === undefined) {
|
|
706
|
-
delete process.env.NO_COLOR;
|
|
707
|
-
}
|
|
708
|
-
else {
|
|
709
|
-
process.env.NO_COLOR = previousNoColor;
|
|
710
|
-
}
|
|
711
|
-
if (previousCi === undefined) {
|
|
712
|
-
delete process.env.CI;
|
|
713
|
-
}
|
|
714
|
-
else {
|
|
715
|
-
process.env.CI = previousCi;
|
|
716
|
-
}
|
|
717
|
-
if (previousTerm === undefined) {
|
|
718
|
-
delete process.env.TERM;
|
|
719
|
-
}
|
|
720
|
-
else {
|
|
721
|
-
process.env.TERM = previousTerm;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
expect(io.stdout()).toContain('✓');
|
|
725
|
-
expect(io.stdout()).toContain('KTX scan completed');
|
|
726
|
-
expect(io.stdout()).toContain('\u001b[');
|
|
727
|
-
});
|
|
728
|
-
it('honors NO_COLOR for TTY scan summaries', async () => {
|
|
729
|
-
await initKtxProject({ projectDir: tempDir });
|
|
730
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
731
|
-
runId: 'scan-run-1',
|
|
732
|
-
status: 'done',
|
|
733
|
-
done: true,
|
|
734
|
-
connectionId: 'warehouse',
|
|
735
|
-
mode: 'structural',
|
|
736
|
-
dryRun: false,
|
|
737
|
-
syncId: 'sync-1',
|
|
738
|
-
report,
|
|
739
|
-
}));
|
|
740
|
-
const io = makeIo({ isTTY: true });
|
|
741
|
-
const previousNoColor = process.env.NO_COLOR;
|
|
742
|
-
process.env.NO_COLOR = '1';
|
|
743
|
-
try {
|
|
744
|
-
await expect(runKtxScan({
|
|
745
|
-
command: 'run',
|
|
746
|
-
projectDir: tempDir,
|
|
747
|
-
connectionId: 'warehouse',
|
|
748
|
-
mode: 'structural',
|
|
749
|
-
detectRelationships: false,
|
|
750
|
-
dryRun: false,
|
|
751
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
752
|
-
}
|
|
753
|
-
finally {
|
|
754
|
-
if (previousNoColor === undefined) {
|
|
755
|
-
delete process.env.NO_COLOR;
|
|
756
|
-
}
|
|
757
|
-
else {
|
|
758
|
-
process.env.NO_COLOR = previousNoColor;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
expect(io.stdout()).toContain('KTX scan completed');
|
|
762
|
-
expect(io.stdout()).not.toContain('\u001b[');
|
|
763
|
-
});
|
|
764
|
-
it('passes native CLI adapters into local scan runs for mysql configs', async () => {
|
|
765
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-'));
|
|
766
|
-
await initKtxProject({ projectDir: tempProject });
|
|
767
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
768
|
-
'connections:',
|
|
769
|
-
' warehouse:',
|
|
770
|
-
' driver: mysql',
|
|
771
|
-
' url: env:MYSQL_URL',
|
|
772
|
-
'',
|
|
773
|
-
].join('\n'), 'utf-8');
|
|
774
|
-
const io = makeIo();
|
|
775
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
776
|
-
runId: 'scan-run-1',
|
|
777
|
-
status: 'done',
|
|
778
|
-
done: true,
|
|
779
|
-
connectionId: 'warehouse',
|
|
780
|
-
mode: 'structural',
|
|
781
|
-
dryRun: false,
|
|
782
|
-
syncId: 'sync-1',
|
|
783
|
-
report,
|
|
784
|
-
}));
|
|
785
|
-
await expect(runKtxScan({
|
|
786
|
-
command: 'run',
|
|
787
|
-
projectDir: tempProject,
|
|
788
|
-
connectionId: 'warehouse',
|
|
789
|
-
mode: 'structural',
|
|
790
|
-
detectRelationships: false,
|
|
791
|
-
dryRun: false,
|
|
792
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
793
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
794
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
795
|
-
});
|
|
796
|
-
it('creates a native connector for standalone relationship scans', async () => {
|
|
797
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-relationships-'));
|
|
798
|
-
await initKtxProject({ projectDir: tempProject });
|
|
799
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
800
|
-
'connections:',
|
|
801
|
-
' warehouse:',
|
|
802
|
-
' driver: sqlite',
|
|
803
|
-
' path: warehouse.db',
|
|
804
|
-
'',
|
|
805
|
-
].join('\n'), 'utf-8');
|
|
806
|
-
const io = makeIo();
|
|
807
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
808
|
-
runId: 'scan-run-1',
|
|
809
|
-
status: 'done',
|
|
810
|
-
done: true,
|
|
811
|
-
connectionId: 'warehouse',
|
|
812
|
-
mode: 'relationships',
|
|
813
|
-
dryRun: false,
|
|
814
|
-
syncId: 'sync-1',
|
|
815
|
-
report: { ...report, mode: 'relationships' },
|
|
816
|
-
}));
|
|
817
|
-
await expect(runKtxScan({
|
|
818
|
-
command: 'run',
|
|
819
|
-
projectDir: tempProject,
|
|
820
|
-
connectionId: 'warehouse',
|
|
821
|
-
mode: 'relationships',
|
|
822
|
-
detectRelationships: true,
|
|
823
|
-
dryRun: false,
|
|
824
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
825
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({
|
|
826
|
-
mode: 'relationships',
|
|
827
|
-
detectRelationships: true,
|
|
828
|
-
connector: expect.objectContaining({ driver: 'sqlite' }),
|
|
829
|
-
}));
|
|
830
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
831
|
-
});
|
|
832
|
-
it('cleans up a constructed scan connector after an enriched scan succeeds', async () => {
|
|
833
|
-
await initKtxProject({ projectDir: tempDir });
|
|
834
|
-
await writeFile(join(tempDir, 'ktx.yaml'), [
|
|
835
|
-
'connections:',
|
|
836
|
-
' warehouse:',
|
|
837
|
-
' driver: snowflake',
|
|
838
|
-
' account: acct',
|
|
839
|
-
' warehouse: WH',
|
|
840
|
-
' database: ANALYTICS',
|
|
841
|
-
' schema_name: PUBLIC',
|
|
842
|
-
' username: reader',
|
|
843
|
-
' password: env:SNOWFLAKE_PASSWORD',
|
|
844
|
-
'',
|
|
845
|
-
].join('\n'), 'utf-8');
|
|
846
|
-
snowflakeConnectorInstances.length = 0;
|
|
847
|
-
const runLocalScan = vi.fn(async () => ({
|
|
848
|
-
runId: 'scan-run-cleanup',
|
|
849
|
-
status: 'done',
|
|
850
|
-
done: true,
|
|
851
|
-
connectionId: 'warehouse',
|
|
852
|
-
mode: 'enriched',
|
|
853
|
-
dryRun: false,
|
|
854
|
-
syncId: 'sync-1',
|
|
855
|
-
report: { ...report, mode: 'enriched' },
|
|
856
|
-
}));
|
|
857
|
-
await expect(runKtxScan({
|
|
858
|
-
command: 'run',
|
|
859
|
-
projectDir: tempDir,
|
|
860
|
-
connectionId: 'warehouse',
|
|
861
|
-
mode: 'enriched',
|
|
862
|
-
detectRelationships: false,
|
|
863
|
-
dryRun: false,
|
|
864
|
-
}, makeIo().io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
865
|
-
expect(snowflakeConnectorInstances[0]?.cleanup).toHaveBeenCalledTimes(1);
|
|
866
|
-
});
|
|
867
|
-
it('cleans up a constructed scan connector after runLocalScan throws', async () => {
|
|
868
|
-
await initKtxProject({ projectDir: tempDir });
|
|
869
|
-
await writeFile(join(tempDir, 'ktx.yaml'), [
|
|
870
|
-
'connections:',
|
|
871
|
-
' warehouse:',
|
|
872
|
-
' driver: snowflake',
|
|
873
|
-
' account: acct',
|
|
874
|
-
' warehouse: WH',
|
|
875
|
-
' database: ANALYTICS',
|
|
876
|
-
' schema_name: PUBLIC',
|
|
877
|
-
' username: reader',
|
|
878
|
-
' password: env:SNOWFLAKE_PASSWORD',
|
|
879
|
-
'',
|
|
880
|
-
].join('\n'), 'utf-8');
|
|
881
|
-
snowflakeConnectorInstances.length = 0;
|
|
882
|
-
const runLocalScan = vi.fn(async () => {
|
|
883
|
-
throw new Error('scan failed');
|
|
884
|
-
});
|
|
885
|
-
await expect(runKtxScan({
|
|
886
|
-
command: 'run',
|
|
887
|
-
projectDir: tempDir,
|
|
888
|
-
connectionId: 'warehouse',
|
|
889
|
-
mode: 'relationships',
|
|
890
|
-
detectRelationships: true,
|
|
891
|
-
dryRun: false,
|
|
892
|
-
}, makeIo().io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(1);
|
|
893
|
-
expect(snowflakeConnectorInstances[0]?.cleanup).toHaveBeenCalledTimes(1);
|
|
894
|
-
});
|
|
895
|
-
it('routes standalone postgres scans through the native connector before daemon fallback', async () => {
|
|
896
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-postgres-'));
|
|
897
|
-
await initKtxProject({ projectDir: tempProject });
|
|
898
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
899
|
-
'connections:',
|
|
900
|
-
' warehouse:',
|
|
901
|
-
' driver: postgres',
|
|
902
|
-
' host: db.example.test',
|
|
903
|
-
' database: analytics',
|
|
904
|
-
' username: reader',
|
|
905
|
-
' password: env:POSTGRES_PASSWORD',
|
|
906
|
-
'',
|
|
907
|
-
].join('\n'), 'utf-8');
|
|
908
|
-
const io = makeIo();
|
|
909
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
910
|
-
runId: 'scan-run-1',
|
|
911
|
-
status: 'done',
|
|
912
|
-
done: true,
|
|
913
|
-
connectionId: 'warehouse',
|
|
914
|
-
mode: 'structural',
|
|
915
|
-
dryRun: false,
|
|
916
|
-
syncId: 'sync-1',
|
|
917
|
-
report,
|
|
918
|
-
}));
|
|
919
|
-
await expect(runKtxScan({
|
|
920
|
-
command: 'run',
|
|
921
|
-
projectDir: tempProject,
|
|
922
|
-
connectionId: 'warehouse',
|
|
923
|
-
mode: 'structural',
|
|
924
|
-
detectRelationships: false,
|
|
925
|
-
dryRun: false,
|
|
926
|
-
}, io.io, {
|
|
927
|
-
runLocalScan,
|
|
928
|
-
createLocalIngestAdapters: () => [fakeLiveDatabaseAdapter(createPostgresLiveDatabaseIntrospection)],
|
|
929
|
-
})).resolves.toBe(0);
|
|
930
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
931
|
-
const scanOptions = runLocalScan.mock.calls[0]?.[0];
|
|
932
|
-
const liveDatabase = scanOptions?.adapters?.find((adapter) => adapter.source === 'live-database');
|
|
933
|
-
if (!liveDatabase?.fetch) {
|
|
934
|
-
throw new Error('Expected scan adapters to include a fetch-capable live-database adapter');
|
|
935
|
-
}
|
|
936
|
-
const stagedDir = join(tempProject, 'postgres-staged');
|
|
937
|
-
await liveDatabase.fetch(undefined, stagedDir, { connectionId: 'warehouse', sourceKey: 'live-database' });
|
|
938
|
-
expect(createPostgresLiveDatabaseIntrospection).toHaveBeenCalledWith({ connections: expect.any(Object) });
|
|
939
|
-
expect(postgresExtractSchema).toHaveBeenCalledWith('warehouse');
|
|
940
|
-
await expect(readFile(join(stagedDir, 'connection.json'), 'utf-8')).resolves.toContain('"connectionId": "warehouse"');
|
|
941
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
942
|
-
});
|
|
943
|
-
it('passes native CLI adapters into local scan runs for clickhouse configs', async () => {
|
|
944
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-clickhouse-'));
|
|
945
|
-
await initKtxProject({ projectDir: tempProject });
|
|
946
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
947
|
-
'connections:',
|
|
948
|
-
' warehouse:',
|
|
949
|
-
' driver: clickhouse',
|
|
950
|
-
' host: env:CLICKHOUSE_HOST',
|
|
951
|
-
' database: analytics',
|
|
952
|
-
' username: reader',
|
|
953
|
-
' password: env:CLICKHOUSE_PASSWORD',
|
|
954
|
-
'',
|
|
955
|
-
].join('\n'), 'utf-8');
|
|
956
|
-
const io = makeIo();
|
|
957
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
958
|
-
runId: 'scan-run-1',
|
|
959
|
-
status: 'done',
|
|
960
|
-
done: true,
|
|
961
|
-
connectionId: 'warehouse',
|
|
962
|
-
mode: 'structural',
|
|
963
|
-
dryRun: false,
|
|
964
|
-
syncId: 'sync-1',
|
|
965
|
-
report: { ...report, driver: 'clickhouse' },
|
|
966
|
-
}));
|
|
967
|
-
await expect(runKtxScan({
|
|
968
|
-
command: 'run',
|
|
969
|
-
projectDir: tempProject,
|
|
970
|
-
connectionId: 'warehouse',
|
|
971
|
-
mode: 'structural',
|
|
972
|
-
detectRelationships: false,
|
|
973
|
-
dryRun: false,
|
|
974
|
-
}, io.io, { runLocalScan, createLocalIngestAdapters: noLocalIngestAdapters })).resolves.toBe(0);
|
|
975
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
976
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
977
|
-
});
|
|
978
|
-
it('passes native CLI adapters into local scan runs for sqlserver configs', async () => {
|
|
979
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-sqlserver-'));
|
|
980
|
-
await initKtxProject({ projectDir: tempProject });
|
|
981
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
982
|
-
'connections:',
|
|
983
|
-
' warehouse:',
|
|
984
|
-
' driver: sqlserver',
|
|
985
|
-
' host: env:SQLSERVER_HOST',
|
|
986
|
-
' database: analytics',
|
|
987
|
-
' username: reader',
|
|
988
|
-
' schema: dbo',
|
|
989
|
-
'',
|
|
990
|
-
].join('\n'), 'utf-8');
|
|
991
|
-
const io = makeIo();
|
|
992
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
993
|
-
runId: 'scan-run-1',
|
|
994
|
-
status: 'done',
|
|
995
|
-
done: true,
|
|
996
|
-
connectionId: 'warehouse',
|
|
997
|
-
mode: 'structural',
|
|
998
|
-
dryRun: false,
|
|
999
|
-
syncId: 'sync-1',
|
|
1000
|
-
report: { ...report, driver: 'sqlserver' },
|
|
1001
|
-
}));
|
|
1002
|
-
await expect(runKtxScan({
|
|
1003
|
-
command: 'run',
|
|
1004
|
-
projectDir: tempProject,
|
|
1005
|
-
connectionId: 'warehouse',
|
|
1006
|
-
mode: 'structural',
|
|
1007
|
-
detectRelationships: false,
|
|
1008
|
-
dryRun: false,
|
|
1009
|
-
}, io.io, {
|
|
1010
|
-
runLocalScan,
|
|
1011
|
-
createLocalIngestAdapters: () => [fakeLiveDatabaseAdapter(createSqlServerLiveDatabaseIntrospection)],
|
|
1012
|
-
})).resolves.toBe(0);
|
|
1013
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
1014
|
-
const scanOptions = runLocalScan.mock.calls[0]?.[0];
|
|
1015
|
-
const liveDatabase = scanOptions?.adapters?.find((adapter) => adapter.source === 'live-database');
|
|
1016
|
-
if (!liveDatabase?.fetch) {
|
|
1017
|
-
throw new Error('Expected scan adapters to include a fetch-capable live-database adapter');
|
|
1018
|
-
}
|
|
1019
|
-
const stagedDir = join(tempProject, 'sqlserver-staged');
|
|
1020
|
-
await liveDatabase.fetch(undefined, stagedDir, { connectionId: 'warehouse', sourceKey: 'live-database' });
|
|
1021
|
-
expect(createSqlServerLiveDatabaseIntrospection).toHaveBeenCalledWith({ connections: expect.any(Object) });
|
|
1022
|
-
expect(sqlServerExtractSchema).toHaveBeenCalledWith('warehouse');
|
|
1023
|
-
await expect(readFile(join(stagedDir, 'connection.json'), 'utf-8')).resolves.toContain('"connectionId": "warehouse"');
|
|
1024
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
1025
|
-
});
|
|
1026
|
-
it('passes native CLI adapters into local scan runs for bigquery configs', async () => {
|
|
1027
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-bigquery-'));
|
|
1028
|
-
await initKtxProject({ projectDir: tempProject });
|
|
1029
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
1030
|
-
'connections:',
|
|
1031
|
-
' warehouse:',
|
|
1032
|
-
' driver: bigquery',
|
|
1033
|
-
' dataset_id: analytics',
|
|
1034
|
-
' credentials_json: env:BIGQUERY_CREDENTIALS_JSON',
|
|
1035
|
-
' location: US',
|
|
1036
|
-
'',
|
|
1037
|
-
].join('\n'), 'utf-8');
|
|
1038
|
-
const io = makeIo();
|
|
1039
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
1040
|
-
runId: 'scan-run-1',
|
|
1041
|
-
status: 'done',
|
|
1042
|
-
done: true,
|
|
1043
|
-
connectionId: 'warehouse',
|
|
1044
|
-
mode: 'structural',
|
|
1045
|
-
dryRun: false,
|
|
1046
|
-
syncId: 'sync-1',
|
|
1047
|
-
report: { ...report, driver: 'bigquery' },
|
|
1048
|
-
}));
|
|
1049
|
-
await expect(runKtxScan({
|
|
1050
|
-
command: 'run',
|
|
1051
|
-
projectDir: tempProject,
|
|
1052
|
-
connectionId: 'warehouse',
|
|
1053
|
-
mode: 'structural',
|
|
1054
|
-
detectRelationships: false,
|
|
1055
|
-
dryRun: false,
|
|
1056
|
-
}, io.io, {
|
|
1057
|
-
runLocalScan,
|
|
1058
|
-
createLocalIngestAdapters: () => [fakeLiveDatabaseAdapter(createBigQueryLiveDatabaseIntrospection)],
|
|
1059
|
-
})).resolves.toBe(0);
|
|
1060
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
1061
|
-
const scanOptions = runLocalScan.mock.calls[0]?.[0];
|
|
1062
|
-
const liveDatabase = scanOptions?.adapters?.find((adapter) => adapter.source === 'live-database');
|
|
1063
|
-
if (!liveDatabase?.fetch) {
|
|
1064
|
-
throw new Error('Expected scan adapters to include a fetch-capable live-database adapter');
|
|
1065
|
-
}
|
|
1066
|
-
const stagedDir = join(tempProject, 'bigquery-staged');
|
|
1067
|
-
await liveDatabase.fetch(undefined, stagedDir, { connectionId: 'warehouse', sourceKey: 'live-database' });
|
|
1068
|
-
expect(createBigQueryLiveDatabaseIntrospection).toHaveBeenCalledWith({ connections: expect.any(Object) });
|
|
1069
|
-
expect(bigQueryExtractSchema).toHaveBeenCalledWith('warehouse');
|
|
1070
|
-
await expect(readFile(join(stagedDir, 'connection.json'), 'utf-8')).resolves.toContain('"connectionId": "warehouse"');
|
|
1071
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
1072
|
-
});
|
|
1073
|
-
it('passes native CLI adapters into local scan runs for snowflake configs', async () => {
|
|
1074
|
-
const tempProject = await mkdtemp(join(tmpdir(), 'ktx-scan-cli-native-snowflake-'));
|
|
1075
|
-
await initKtxProject({ projectDir: tempProject });
|
|
1076
|
-
await writeFile(join(tempProject, 'ktx.yaml'), [
|
|
1077
|
-
'connections:',
|
|
1078
|
-
' warehouse:',
|
|
1079
|
-
' driver: snowflake',
|
|
1080
|
-
' authMethod: password',
|
|
1081
|
-
' account: env:SNOWFLAKE_ACCOUNT',
|
|
1082
|
-
' warehouse: WH',
|
|
1083
|
-
' database: ANALYTICS',
|
|
1084
|
-
' schema_name: PUBLIC',
|
|
1085
|
-
' username: reader',
|
|
1086
|
-
'',
|
|
1087
|
-
].join('\n'), 'utf-8');
|
|
1088
|
-
const io = makeIo();
|
|
1089
|
-
const runLocalScan = vi.fn(async (_input) => ({
|
|
1090
|
-
runId: 'scan-run-1',
|
|
1091
|
-
status: 'done',
|
|
1092
|
-
done: true,
|
|
1093
|
-
connectionId: 'warehouse',
|
|
1094
|
-
mode: 'structural',
|
|
1095
|
-
dryRun: false,
|
|
1096
|
-
syncId: 'sync-1',
|
|
1097
|
-
report: { ...report, driver: 'snowflake' },
|
|
1098
|
-
}));
|
|
1099
|
-
await expect(runKtxScan({
|
|
1100
|
-
command: 'run',
|
|
1101
|
-
projectDir: tempProject,
|
|
1102
|
-
connectionId: 'warehouse',
|
|
1103
|
-
mode: 'structural',
|
|
1104
|
-
detectRelationships: false,
|
|
1105
|
-
dryRun: false,
|
|
1106
|
-
}, io.io, {
|
|
1107
|
-
runLocalScan,
|
|
1108
|
-
createLocalIngestAdapters: () => [fakeLiveDatabaseAdapter(createSnowflakeLiveDatabaseIntrospection)],
|
|
1109
|
-
})).resolves.toBe(0);
|
|
1110
|
-
expect(runLocalScan).toHaveBeenCalledWith(expect.objectContaining({ adapters: expect.any(Array) }));
|
|
1111
|
-
const scanOptions = runLocalScan.mock.calls[0]?.[0];
|
|
1112
|
-
const liveDatabase = scanOptions?.adapters?.find((adapter) => adapter.source === 'live-database');
|
|
1113
|
-
if (!liveDatabase?.fetch) {
|
|
1114
|
-
throw new Error('Expected scan adapters to include a fetch-capable live-database adapter');
|
|
1115
|
-
}
|
|
1116
|
-
const stagedDir = join(tempProject, 'snowflake-staged');
|
|
1117
|
-
await liveDatabase.fetch(undefined, stagedDir, { connectionId: 'warehouse', sourceKey: 'live-database' });
|
|
1118
|
-
expect(createSnowflakeLiveDatabaseIntrospection).toHaveBeenCalledWith({ connections: expect.any(Object) });
|
|
1119
|
-
expect(snowflakeExtractSchema).toHaveBeenCalledWith('warehouse');
|
|
1120
|
-
await expect(readFile(join(stagedDir, 'connection.json'), 'utf-8')).resolves.toContain('"connectionId": "warehouse"');
|
|
1121
|
-
await rm(tempProject, { recursive: true, force: true });
|
|
1122
|
-
});
|
|
1123
|
-
});
|