@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
|
@@ -1,942 +0,0 @@
|
|
|
1
|
-
import { buildDefaultKtxProjectConfig } from './context/project/config.js';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import { extractProgressMessage, createRepainter, initViewState, parseIngestSummary, parseScanSummary, renderContextBuildView, runContextBuild, viewStateFromSourceProgress, } from './context-build-view.js';
|
|
4
|
-
function makeIo(options = {}) {
|
|
5
|
-
let stdout = '';
|
|
6
|
-
let stderr = '';
|
|
7
|
-
return {
|
|
8
|
-
io: {
|
|
9
|
-
stdout: {
|
|
10
|
-
isTTY: options.isTTY,
|
|
11
|
-
columns: options.columns,
|
|
12
|
-
write: (chunk) => {
|
|
13
|
-
stdout += chunk;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
stderr: {
|
|
17
|
-
write: (chunk) => {
|
|
18
|
-
stderr += chunk;
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
stdout: () => stdout,
|
|
23
|
-
stderr: () => stderr,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function projectWithConnections(connections) {
|
|
27
|
-
return {
|
|
28
|
-
projectDir: '/tmp/project',
|
|
29
|
-
config: {
|
|
30
|
-
...buildDefaultKtxProjectConfig(),
|
|
31
|
-
connections,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function successResult(connectionId, driver, operation) {
|
|
36
|
-
return {
|
|
37
|
-
connectionId,
|
|
38
|
-
driver,
|
|
39
|
-
steps: [
|
|
40
|
-
{ operation: 'database-schema', status: operation === 'database-ingest' ? 'done' : 'skipped' },
|
|
41
|
-
{ operation: 'query-history', status: 'skipped' },
|
|
42
|
-
{ operation: 'source-ingest', status: operation === 'source-ingest' ? 'done' : 'skipped' },
|
|
43
|
-
{ operation: 'memory-update', status: operation === 'source-ingest' ? 'done' : 'skipped' },
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function failedResult(connectionId, driver, operation) {
|
|
48
|
-
return {
|
|
49
|
-
connectionId,
|
|
50
|
-
driver,
|
|
51
|
-
steps: [
|
|
52
|
-
{
|
|
53
|
-
operation: 'database-schema',
|
|
54
|
-
status: operation === 'database-ingest' ? 'failed' : 'skipped',
|
|
55
|
-
detail: `${connectionId} failed at database-schema.`,
|
|
56
|
-
},
|
|
57
|
-
{ operation: 'query-history', status: 'skipped' },
|
|
58
|
-
{ operation: 'source-ingest', status: operation === 'source-ingest' ? 'failed' : 'skipped' },
|
|
59
|
-
{ operation: 'memory-update', status: 'not-run' },
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
describe('extractProgressMessage', () => {
|
|
64
|
-
it('extracts percentage and message from scan progress', () => {
|
|
65
|
-
expect(extractProgressMessage('\r[45%] Scanning tables...[K')).toBe('[45%] Scanning tables...');
|
|
66
|
-
});
|
|
67
|
-
it('extracts from permanent progress lines', () => {
|
|
68
|
-
expect(extractProgressMessage('[100%] Done\n')).toBe('[100%] Done');
|
|
69
|
-
});
|
|
70
|
-
it('returns null for non-progress output', () => {
|
|
71
|
-
expect(extractProgressMessage('KTX scan completed\n')).toBeNull();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
describe('parseScanSummary', () => {
|
|
75
|
-
it('extracts table count from scan output', () => {
|
|
76
|
-
expect(parseScanSummary('Semantic layer comparison found 5 changes across 42 tables')).toBe('42 tables');
|
|
77
|
-
});
|
|
78
|
-
it('handles singular form', () => {
|
|
79
|
-
expect(parseScanSummary('found 1 change across 1 table')).toBe('1 tables');
|
|
80
|
-
});
|
|
81
|
-
it('returns null when no match', () => {
|
|
82
|
-
expect(parseScanSummary('No changes detected')).toBeNull();
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
describe('parseIngestSummary', () => {
|
|
86
|
-
it('extracts task count and saved memory', () => {
|
|
87
|
-
expect(parseIngestSummary('Tasks: 5\nSaved memory: 3 wiki, 2 SL')).toBe('3 wiki, 2 SL');
|
|
88
|
-
});
|
|
89
|
-
it('extracts task count alone when no saved memory', () => {
|
|
90
|
-
expect(parseIngestSummary('Tasks: 5\nStatus: done')).toBe('5 tasks');
|
|
91
|
-
});
|
|
92
|
-
it('extracts saved memory alone when no task count', () => {
|
|
93
|
-
expect(parseIngestSummary('Saved memory: 3 wiki, 2 SL')).toBe('3 wiki, 2 SL');
|
|
94
|
-
});
|
|
95
|
-
it('returns null when no match', () => {
|
|
96
|
-
expect(parseIngestSummary('Status: done')).toBeNull();
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
describe('initViewState', () => {
|
|
100
|
-
it('partitions targets into primary and context sources', () => {
|
|
101
|
-
const state = initViewState([
|
|
102
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
103
|
-
{ connectionId: 'dbt-main', driver: 'dbt', operation: 'source-ingest', adapter: 'dbt', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
104
|
-
]);
|
|
105
|
-
expect(state.primarySources).toHaveLength(1);
|
|
106
|
-
expect(state.primarySources[0].target.connectionId).toBe('warehouse');
|
|
107
|
-
expect(state.contextSources).toHaveLength(1);
|
|
108
|
-
expect(state.contextSources[0].target.connectionId).toBe('dbt-main');
|
|
109
|
-
expect(state.frame).toBe(0);
|
|
110
|
-
});
|
|
111
|
-
it('initializes global timing fields', () => {
|
|
112
|
-
const state = initViewState([
|
|
113
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
114
|
-
]);
|
|
115
|
-
expect(state.startedAt).toBeNull();
|
|
116
|
-
expect(state.totalElapsedMs).toBe(0);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
describe('renderContextBuildView', () => {
|
|
120
|
-
it('renders all-queued state with ○ icon and progress counter', () => {
|
|
121
|
-
const state = initViewState([
|
|
122
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
123
|
-
{ connectionId: 'dbt-main', driver: 'dbt', operation: 'source-ingest', adapter: 'dbt', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
124
|
-
]);
|
|
125
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
126
|
-
expect(output).toContain('Building KTX context');
|
|
127
|
-
expect(output).toContain('(0/2)');
|
|
128
|
-
expect(output).toContain('○');
|
|
129
|
-
expect(output).toContain('Databases:');
|
|
130
|
-
expect(output).toContain('warehouse');
|
|
131
|
-
expect(output).toContain('queued');
|
|
132
|
-
expect(output).toContain('Context sources:');
|
|
133
|
-
expect(output).toContain('dbt-main');
|
|
134
|
-
});
|
|
135
|
-
it('supports text ingest labels while preserving the shared compact progress view', () => {
|
|
136
|
-
const state = initViewState([
|
|
137
|
-
{ connectionId: 'text-1', driver: 'text', operation: 'source-ingest', debugCommand: '', steps: ['memory-update'] },
|
|
138
|
-
{ connectionId: 'schema.md', driver: 'text', operation: 'source-ingest', debugCommand: '', steps: ['memory-update'] },
|
|
139
|
-
]);
|
|
140
|
-
state.contextSources[0].status = 'running';
|
|
141
|
-
state.contextSources[0].detailLine = 'capturing...';
|
|
142
|
-
const output = renderContextBuildView(state, {
|
|
143
|
-
styled: false,
|
|
144
|
-
title: 'Ingesting text memory',
|
|
145
|
-
contextGroupLabel: 'Texts',
|
|
146
|
-
sourceIngestRunningText: 'capturing...',
|
|
147
|
-
completedItemName: { singular: 'text', plural: 'texts' },
|
|
148
|
-
});
|
|
149
|
-
expect(output).toContain('Ingesting text memory');
|
|
150
|
-
expect(output).toContain('Texts:');
|
|
151
|
-
expect(output).toContain('text-1');
|
|
152
|
-
expect(output).toContain('schema.md');
|
|
153
|
-
expect(output).toContain('capturing...');
|
|
154
|
-
expect(output).not.toContain('Context sources:');
|
|
155
|
-
});
|
|
156
|
-
it('renders header with total elapsed time when set', () => {
|
|
157
|
-
const state = initViewState([
|
|
158
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
159
|
-
]);
|
|
160
|
-
state.totalElapsedMs = 65000;
|
|
161
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
162
|
-
expect(output).toContain('(0/1 · 1m05s)');
|
|
163
|
-
});
|
|
164
|
-
it('renders project directory when provided', () => {
|
|
165
|
-
const state = initViewState([
|
|
166
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
167
|
-
]);
|
|
168
|
-
const output = renderContextBuildView(state, { styled: false, projectDir: '/tmp/project' });
|
|
169
|
-
expect(output).toContain('Project: /tmp/project');
|
|
170
|
-
});
|
|
171
|
-
it('renders public warnings in the foreground view', () => {
|
|
172
|
-
const state = initViewState([
|
|
173
|
-
{
|
|
174
|
-
connectionId: 'docs',
|
|
175
|
-
driver: 'notion',
|
|
176
|
-
operation: 'source-ingest',
|
|
177
|
-
adapter: 'notion',
|
|
178
|
-
debugCommand: 'ktx ingest docs --debug',
|
|
179
|
-
steps: ['source-ingest', 'memory-update'],
|
|
180
|
-
},
|
|
181
|
-
]);
|
|
182
|
-
const rendered = renderContextBuildView(state, {
|
|
183
|
-
styled: false,
|
|
184
|
-
warnings: ['--deep affects database ingest only; ignoring it for docs.'],
|
|
185
|
-
});
|
|
186
|
-
expect(rendered).toContain('Warnings:');
|
|
187
|
-
expect(rendered).toContain('--deep affects database ingest only; ignoring it for docs.');
|
|
188
|
-
});
|
|
189
|
-
it('renders public notices in the foreground view before warnings', () => {
|
|
190
|
-
const state = initViewState([
|
|
191
|
-
{
|
|
192
|
-
connectionId: 'warehouse',
|
|
193
|
-
driver: 'postgres',
|
|
194
|
-
operation: 'database-ingest',
|
|
195
|
-
debugCommand: 'ktx ingest warehouse --debug',
|
|
196
|
-
steps: ['database-schema', 'query-history'],
|
|
197
|
-
databaseDepth: 'deep',
|
|
198
|
-
detectRelationships: true,
|
|
199
|
-
queryHistory: { enabled: true, dialect: 'postgres' },
|
|
200
|
-
},
|
|
201
|
-
]);
|
|
202
|
-
const rendered = renderContextBuildView(state, {
|
|
203
|
-
styled: false,
|
|
204
|
-
notices: ['Schema ingest runs before query history for warehouse.'],
|
|
205
|
-
warnings: ['--query-history requires deep ingest; running warehouse with --deep.'],
|
|
206
|
-
});
|
|
207
|
-
expect(rendered.indexOf('Notices:')).toBeLessThan(rendered.indexOf('Warnings:'));
|
|
208
|
-
expect(rendered).toContain('Schema ingest runs before query history for warehouse.');
|
|
209
|
-
expect(rendered).toContain('--query-history requires deep ingest; running warehouse with --deep.');
|
|
210
|
-
});
|
|
211
|
-
it('renders dynamic separator matching header width', () => {
|
|
212
|
-
const state = initViewState([
|
|
213
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
214
|
-
]);
|
|
215
|
-
state.totalElapsedMs = 120000;
|
|
216
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
217
|
-
const lines = output.split('\n');
|
|
218
|
-
const headerLine = lines.find((l) => l.includes('Building KTX context'));
|
|
219
|
-
const separatorLine = lines.find((l) => /^─+$/.test(l));
|
|
220
|
-
expect(separatorLine.length).toBeGreaterThanOrEqual(headerLine.length);
|
|
221
|
-
});
|
|
222
|
-
it('renders completed state with summary', () => {
|
|
223
|
-
const state = initViewState([
|
|
224
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
225
|
-
]);
|
|
226
|
-
state.primarySources[0].status = 'done';
|
|
227
|
-
state.primarySources[0].elapsedMs = 72000;
|
|
228
|
-
state.primarySources[0].summaryText = '42 tables';
|
|
229
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
230
|
-
expect(output).toContain('42 tables');
|
|
231
|
-
expect(output).toContain('1m12s');
|
|
232
|
-
expect(output).toContain('(1/1)');
|
|
233
|
-
});
|
|
234
|
-
it('renders running target with elapsed time', () => {
|
|
235
|
-
const state = initViewState([
|
|
236
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
237
|
-
]);
|
|
238
|
-
state.primarySources[0].status = 'running';
|
|
239
|
-
state.primarySources[0].elapsedMs = 30000;
|
|
240
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
241
|
-
expect(output).toContain('reading schema');
|
|
242
|
-
expect(output).toContain('(30s)');
|
|
243
|
-
});
|
|
244
|
-
it('renders running target with progress bar when percentage is available', () => {
|
|
245
|
-
const state = initViewState([
|
|
246
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
247
|
-
]);
|
|
248
|
-
state.primarySources[0].status = 'running';
|
|
249
|
-
state.primarySources[0].detailLine = '[50%] Scanning tables...';
|
|
250
|
-
state.primarySources[0].elapsedMs = 15000;
|
|
251
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
252
|
-
expect(output).toContain('██████░░░░░░');
|
|
253
|
-
expect(output).toContain('50%');
|
|
254
|
-
expect(output).toContain('Scanning tables...');
|
|
255
|
-
expect(output).toContain('(15s)');
|
|
256
|
-
});
|
|
257
|
-
it('shows how long a running target has gone without a progress update', () => {
|
|
258
|
-
const state = initViewState([
|
|
259
|
-
{ connectionId: 'notion-main', driver: 'notion', operation: 'source-ingest', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
260
|
-
]);
|
|
261
|
-
state.contextSources[0].status = 'running';
|
|
262
|
-
state.contextSources[0].startedAt = 1_000;
|
|
263
|
-
state.contextSources[0].elapsedMs = 113_000;
|
|
264
|
-
state.contextSources[0].progressUpdatedAtMs = 46_000;
|
|
265
|
-
state.contextSources[0].detailLine = '[45%] No tasks to process; finalizing ingest';
|
|
266
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
267
|
-
expect(output).toContain('No tasks to process; finalizing ingest');
|
|
268
|
-
expect(output).toContain('last update 1m08s ago');
|
|
269
|
-
expect(output).toContain('(1m53s)');
|
|
270
|
-
});
|
|
271
|
-
it('does not show progress age while updates are recent', () => {
|
|
272
|
-
const state = initViewState([
|
|
273
|
-
{ connectionId: 'notion-main', driver: 'notion', operation: 'source-ingest', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
274
|
-
]);
|
|
275
|
-
state.contextSources[0].status = 'running';
|
|
276
|
-
state.contextSources[0].startedAt = 1_000;
|
|
277
|
-
state.contextSources[0].elapsedMs = 40_000;
|
|
278
|
-
state.contextSources[0].progressUpdatedAtMs = 25_000;
|
|
279
|
-
state.contextSources[0].detailLine = '[45%] Planning tasks';
|
|
280
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
281
|
-
expect(output).not.toContain('last update');
|
|
282
|
-
});
|
|
283
|
-
it('renders completion summary when all targets are done', () => {
|
|
284
|
-
const state = initViewState([
|
|
285
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
286
|
-
{ connectionId: 'dbt-main', driver: 'dbt', operation: 'source-ingest', adapter: 'dbt', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
287
|
-
]);
|
|
288
|
-
state.primarySources[0].status = 'done';
|
|
289
|
-
state.primarySources[0].elapsedMs = 72000;
|
|
290
|
-
state.contextSources[0].status = 'done';
|
|
291
|
-
state.contextSources[0].elapsedMs = 34000;
|
|
292
|
-
state.totalElapsedMs = 106000;
|
|
293
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
294
|
-
expect(output).toContain('Done in 1m46s · 2 sources processed');
|
|
295
|
-
});
|
|
296
|
-
it('renders singular source label in completion summary', () => {
|
|
297
|
-
const state = initViewState([
|
|
298
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
299
|
-
]);
|
|
300
|
-
state.primarySources[0].status = 'done';
|
|
301
|
-
state.primarySources[0].elapsedMs = 5000;
|
|
302
|
-
state.totalElapsedMs = 5000;
|
|
303
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
304
|
-
expect(output).toContain('Done in 5s · 1 source processed');
|
|
305
|
-
});
|
|
306
|
-
it('does not render completion summary while targets are still active', () => {
|
|
307
|
-
const state = initViewState([
|
|
308
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
309
|
-
{ connectionId: 'dbt-main', driver: 'dbt', operation: 'source-ingest', adapter: 'dbt', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
310
|
-
]);
|
|
311
|
-
state.primarySources[0].status = 'done';
|
|
312
|
-
state.contextSources[0].status = 'running';
|
|
313
|
-
state.totalElapsedMs = 30000;
|
|
314
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
315
|
-
expect(output).not.toContain('Done in');
|
|
316
|
-
});
|
|
317
|
-
it('renders failed state', () => {
|
|
318
|
-
const state = initViewState([
|
|
319
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
320
|
-
]);
|
|
321
|
-
state.primarySources[0].status = 'failed';
|
|
322
|
-
state.primarySources[0].failureText = 'KTX lost its connection to PostgreSQL while reading schema for warehouse.';
|
|
323
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
324
|
-
expect(output).toContain('✗');
|
|
325
|
-
expect(output).toContain('KTX lost its connection to PostgreSQL while reading schema for warehouse.');
|
|
326
|
-
});
|
|
327
|
-
it('omits empty groups', () => {
|
|
328
|
-
const state = initViewState([
|
|
329
|
-
{ connectionId: 'dbt-main', driver: 'dbt', operation: 'source-ingest', adapter: 'dbt', debugCommand: '', steps: ['source-ingest', 'memory-update'] },
|
|
330
|
-
]);
|
|
331
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
332
|
-
expect(output).not.toContain('Databases:');
|
|
333
|
-
expect(output).toContain('Context sources:');
|
|
334
|
-
});
|
|
335
|
-
it('renders foreground-only progress hints without detach or resume commands', () => {
|
|
336
|
-
const state = initViewState([
|
|
337
|
-
{
|
|
338
|
-
connectionId: 'warehouse',
|
|
339
|
-
driver: 'postgres',
|
|
340
|
-
operation: 'database-ingest',
|
|
341
|
-
debugCommand: 'ktx ingest warehouse --debug',
|
|
342
|
-
steps: ['database-schema'],
|
|
343
|
-
},
|
|
344
|
-
]);
|
|
345
|
-
state.primarySources[0].status = 'running';
|
|
346
|
-
const rendered = renderContextBuildView(state, { styled: false, showHint: true, projectDir: '/tmp/project' });
|
|
347
|
-
expect(rendered).toContain('Ctrl+C to stop');
|
|
348
|
-
expect(rendered).not.toContain('d to detach');
|
|
349
|
-
expect(rendered).not.toContain('resume');
|
|
350
|
-
});
|
|
351
|
-
it('omits detach hint when all targets are done', () => {
|
|
352
|
-
const state = initViewState([
|
|
353
|
-
{ connectionId: 'warehouse', driver: 'postgres', operation: 'database-ingest', debugCommand: '', steps: ['database-schema'] },
|
|
354
|
-
]);
|
|
355
|
-
state.primarySources[0].status = 'done';
|
|
356
|
-
state.totalElapsedMs = 5000;
|
|
357
|
-
const output = renderContextBuildView(state, { styled: false, showHint: true });
|
|
358
|
-
expect(output).not.toContain('Ctrl+C to stop');
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
describe('renderContextBuildView phase rows', () => {
|
|
362
|
-
function dbTarget(connectionId, queryHistoryEnabled = false) {
|
|
363
|
-
return {
|
|
364
|
-
connectionId,
|
|
365
|
-
driver: 'postgres',
|
|
366
|
-
operation: 'database-ingest',
|
|
367
|
-
debugCommand: '',
|
|
368
|
-
steps: queryHistoryEnabled
|
|
369
|
-
? ['database-schema', 'query-history']
|
|
370
|
-
: ['database-schema'],
|
|
371
|
-
...(queryHistoryEnabled ? { queryHistory: { enabled: true, dialect: 'postgres' } } : {}),
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
function sourceTarget(connectionId) {
|
|
375
|
-
return {
|
|
376
|
-
connectionId,
|
|
377
|
-
driver: 'dbt',
|
|
378
|
-
operation: 'source-ingest',
|
|
379
|
-
adapter: 'dbt',
|
|
380
|
-
debugCommand: '',
|
|
381
|
-
steps: ['source-ingest', 'memory-update'],
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
function setPhase(state, connectionId, phaseKey, patch) {
|
|
385
|
-
const target = [...state.primarySources, ...state.contextSources].find((t) => t.target.connectionId === connectionId);
|
|
386
|
-
const phase = target?.phases.find((p) => p.key === phaseKey);
|
|
387
|
-
if (!phase)
|
|
388
|
-
throw new Error(`No phase ${phaseKey} on ${connectionId}`);
|
|
389
|
-
Object.assign(phase, patch);
|
|
390
|
-
}
|
|
391
|
-
it('renders two phase rows for a database-ingest target with query history', () => {
|
|
392
|
-
const state = initViewState([dbTarget('warehouse', true)]);
|
|
393
|
-
state.primarySources[0].status = 'running';
|
|
394
|
-
setPhase(state, 'warehouse', 'database-schema', {
|
|
395
|
-
status: 'done',
|
|
396
|
-
percent: 100,
|
|
397
|
-
summary: '172 tables',
|
|
398
|
-
elapsedMs: 52_000,
|
|
399
|
-
});
|
|
400
|
-
setPhase(state, 'warehouse', 'query-history', {
|
|
401
|
-
status: 'running',
|
|
402
|
-
percent: 7,
|
|
403
|
-
detail: '12/172 · arr-movements',
|
|
404
|
-
elapsedMs: 36_000,
|
|
405
|
-
});
|
|
406
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
407
|
-
expect(output).toContain('Schema');
|
|
408
|
-
expect(output).toContain('100%');
|
|
409
|
-
expect(output).toContain('172 tables');
|
|
410
|
-
expect(output).toContain('(52s)');
|
|
411
|
-
expect(output).toContain('Query history');
|
|
412
|
-
expect(output).toContain('7%');
|
|
413
|
-
expect(output).toContain('12/172 · arr-movements');
|
|
414
|
-
expect(output).toContain('(36s)');
|
|
415
|
-
});
|
|
416
|
-
it('renders a single Schema phase row when query history is disabled', () => {
|
|
417
|
-
const state = initViewState([dbTarget('warehouse', false)]);
|
|
418
|
-
state.primarySources[0].status = 'running';
|
|
419
|
-
setPhase(state, 'warehouse', 'database-schema', {
|
|
420
|
-
status: 'running',
|
|
421
|
-
percent: 42,
|
|
422
|
-
detail: 'Profiling 73/172 tables',
|
|
423
|
-
});
|
|
424
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
425
|
-
expect(output).toContain('Schema');
|
|
426
|
-
expect(output).toContain('42%');
|
|
427
|
-
expect(output).toContain('Profiling 73/172 tables');
|
|
428
|
-
expect(output).not.toContain('Query history');
|
|
429
|
-
});
|
|
430
|
-
it('renders Source ingest phase row for a source-ingest target', () => {
|
|
431
|
-
const state = initViewState([sourceTarget('dbt-main')]);
|
|
432
|
-
state.contextSources[0].status = 'running';
|
|
433
|
-
setPhase(state, 'dbt-main', 'source-ingest', {
|
|
434
|
-
status: 'running',
|
|
435
|
-
percent: 25,
|
|
436
|
-
detail: 'Reading models',
|
|
437
|
-
});
|
|
438
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
439
|
-
expect(output).toContain('Source ingest');
|
|
440
|
-
expect(output).toContain('25%');
|
|
441
|
-
expect(output).toContain('Reading models');
|
|
442
|
-
expect(output).not.toContain('Schema ');
|
|
443
|
-
});
|
|
444
|
-
it('renders skipped Query history when schema phase fails', () => {
|
|
445
|
-
const state = initViewState([dbTarget('warehouse', true)]);
|
|
446
|
-
state.primarySources[0].status = 'running';
|
|
447
|
-
setPhase(state, 'warehouse', 'database-schema', { status: 'failed', percent: 30 });
|
|
448
|
-
setPhase(state, 'warehouse', 'query-history', { status: 'skipped' });
|
|
449
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
450
|
-
expect(output).toContain('Schema');
|
|
451
|
-
expect(output).toContain('failed');
|
|
452
|
-
expect(output).toContain('Query history');
|
|
453
|
-
expect(output).toContain('skipped');
|
|
454
|
-
});
|
|
455
|
-
it('renders queued Query history with an em-dash and empty bar', () => {
|
|
456
|
-
const state = initViewState([dbTarget('warehouse', true)]);
|
|
457
|
-
state.primarySources[0].status = 'running';
|
|
458
|
-
setPhase(state, 'warehouse', 'database-schema', {
|
|
459
|
-
status: 'running',
|
|
460
|
-
percent: 12,
|
|
461
|
-
detail: 'Introspecting',
|
|
462
|
-
});
|
|
463
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
464
|
-
expect(output).toContain('Query history');
|
|
465
|
-
expect(output).toContain('queued');
|
|
466
|
-
expect(output).toContain('—');
|
|
467
|
-
});
|
|
468
|
-
it('falls back to single-line legacy detail when no phase has started yet', () => {
|
|
469
|
-
const state = initViewState([dbTarget('warehouse', false)]);
|
|
470
|
-
state.primarySources[0].status = 'running';
|
|
471
|
-
state.primarySources[0].detailLine = '[5%] Preparing database ingest';
|
|
472
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
473
|
-
expect(output).toContain('Preparing database ingest');
|
|
474
|
-
expect(output).toContain('5%');
|
|
475
|
-
expect(output).not.toContain('○ Schema');
|
|
476
|
-
});
|
|
477
|
-
});
|
|
478
|
-
describe('createRepainter', () => {
|
|
479
|
-
it('moves up visual rows, not just newline count, when content wraps', () => {
|
|
480
|
-
const io = makeIo({ isTTY: true, columns: 5 });
|
|
481
|
-
const repainter = createRepainter(io.io);
|
|
482
|
-
repainter.paint('abcdefghijk\n');
|
|
483
|
-
repainter.paint('updated\n');
|
|
484
|
-
repainter.paint('done\n');
|
|
485
|
-
const cursorMoves = [...io.stdout().matchAll(/\u001b\[(\d+)A\r/g)].map((match) => Number(match[1]));
|
|
486
|
-
expect(cursorMoves).toEqual([3, 2]);
|
|
487
|
-
});
|
|
488
|
-
it('returns to the start of a single-line frame without moving up when content has no newline', () => {
|
|
489
|
-
const io = makeIo({ isTTY: true, columns: 80 });
|
|
490
|
-
const repainter = createRepainter(io.io);
|
|
491
|
-
repainter.paint('hello');
|
|
492
|
-
repainter.paint('bye');
|
|
493
|
-
expect(io.stdout()).toContain('bye');
|
|
494
|
-
expect(io.stdout()).not.toMatch(/\[\d+A/);
|
|
495
|
-
});
|
|
496
|
-
it('does not undershoot cursor-up when a line is exactly the terminal width', () => {
|
|
497
|
-
const io = makeIo({ isTTY: true, columns: 10 });
|
|
498
|
-
const repainter = createRepainter(io.io);
|
|
499
|
-
repainter.paint('0123456789\nsecond\n');
|
|
500
|
-
repainter.paint('0123456789\nsecond\n');
|
|
501
|
-
const cursorMoves = [...io.stdout().matchAll(/\[(\d+)A/g)].map((m) => Number(m[1]));
|
|
502
|
-
expect(cursorMoves).toEqual([2]);
|
|
503
|
-
});
|
|
504
|
-
});
|
|
505
|
-
describe('runContextBuild', () => {
|
|
506
|
-
it('executes scan targets before source-ingest targets', async () => {
|
|
507
|
-
const io = makeIo();
|
|
508
|
-
const project = projectWithConnections({
|
|
509
|
-
dbt_main: { driver: 'dbt' },
|
|
510
|
-
warehouse: { driver: 'postgres' },
|
|
511
|
-
});
|
|
512
|
-
const callOrder = [];
|
|
513
|
-
const executeTarget = vi.fn(async (target) => {
|
|
514
|
-
callOrder.push(target.connectionId);
|
|
515
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
516
|
-
});
|
|
517
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
518
|
-
expect(result).toEqual({ exitCode: 0 });
|
|
519
|
-
expect(callOrder).toEqual(['warehouse', 'dbt_main']);
|
|
520
|
-
});
|
|
521
|
-
it('runs only the requested connection when foreground build receives a target', async () => {
|
|
522
|
-
const io = makeIo();
|
|
523
|
-
const project = projectWithConnections({
|
|
524
|
-
warehouse: { driver: 'postgres' },
|
|
525
|
-
docs: { driver: 'notion' },
|
|
526
|
-
});
|
|
527
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
528
|
-
await expect(runContextBuild(project, {
|
|
529
|
-
projectDir: '/tmp/project',
|
|
530
|
-
inputMode: 'disabled',
|
|
531
|
-
targetConnectionId: 'warehouse',
|
|
532
|
-
all: false,
|
|
533
|
-
depth: 'fast',
|
|
534
|
-
queryHistory: 'default',
|
|
535
|
-
}, io.io, { executeTarget, now: () => 1000 })).resolves.toMatchObject({ exitCode: 0 });
|
|
536
|
-
expect(executeTarget).toHaveBeenCalledTimes(1);
|
|
537
|
-
expect(executeTarget.mock.calls[0]?.[0]).toMatchObject({
|
|
538
|
-
connectionId: 'warehouse',
|
|
539
|
-
operation: 'database-ingest',
|
|
540
|
-
databaseDepth: 'fast',
|
|
541
|
-
});
|
|
542
|
-
expect(io.stdout()).toContain('Databases:');
|
|
543
|
-
expect(io.stdout()).toContain('warehouse');
|
|
544
|
-
expect(io.stdout()).not.toContain('docs');
|
|
545
|
-
});
|
|
546
|
-
it('returns exit code 1 when any target fails', async () => {
|
|
547
|
-
const io = makeIo();
|
|
548
|
-
const project = projectWithConnections({
|
|
549
|
-
warehouse: { driver: 'postgres' },
|
|
550
|
-
});
|
|
551
|
-
const executeTarget = vi.fn(async (target) => failedResult(target.connectionId, target.driver, target.operation));
|
|
552
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
553
|
-
expect(result).toEqual({ exitCode: 1 });
|
|
554
|
-
});
|
|
555
|
-
it('renders a friendly network failure when target output contains a network error code', async () => {
|
|
556
|
-
const io = makeIo();
|
|
557
|
-
const project = projectWithConnections({
|
|
558
|
-
warehouse: { driver: 'postgres' },
|
|
559
|
-
});
|
|
560
|
-
const executeTarget = vi.fn(async (target, _args, targetIo) => {
|
|
561
|
-
targetIo.stderr.write('Error: read EADDRNOTAVAIL\n');
|
|
562
|
-
return failedResult(target.connectionId, target.driver, target.operation);
|
|
563
|
-
});
|
|
564
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
565
|
-
expect(result).toEqual({ exitCode: 1 });
|
|
566
|
-
expect(io.stdout()).toContain('KTX lost its connection to PostgreSQL while reading schema for warehouse.');
|
|
567
|
-
expect(io.stdout()).toContain('network address unavailable (EADDRNOTAVAIL)');
|
|
568
|
-
expect(io.stdout()).toContain('Retry: ktx setup --project-dir /tmp/project');
|
|
569
|
-
expect(io.stdout()).not.toContain('BoundPool');
|
|
570
|
-
});
|
|
571
|
-
it('renders localhost SQL analysis refusal as a runtime failure during query history', async () => {
|
|
572
|
-
const io = makeIo();
|
|
573
|
-
const project = projectWithConnections({
|
|
574
|
-
warehouse: { driver: 'postgres', context: { depth: 'deep', queryHistory: { enabled: true } } },
|
|
575
|
-
});
|
|
576
|
-
const executeTarget = vi.fn(async (target, _args, targetIo) => {
|
|
577
|
-
targetIo.stderr.write('connect ECONNREFUSED 127.0.0.1:8765\n');
|
|
578
|
-
return {
|
|
579
|
-
connectionId: target.connectionId,
|
|
580
|
-
driver: target.driver,
|
|
581
|
-
steps: [
|
|
582
|
-
{ operation: 'database-schema', status: 'done' },
|
|
583
|
-
{ operation: 'query-history', status: 'failed', detail: 'warehouse failed at query-history.' },
|
|
584
|
-
{ operation: 'source-ingest', status: 'skipped' },
|
|
585
|
-
{ operation: 'memory-update', status: 'skipped' },
|
|
586
|
-
],
|
|
587
|
-
};
|
|
588
|
-
});
|
|
589
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
590
|
-
expect(result).toEqual({ exitCode: 1 });
|
|
591
|
-
expect(io.stdout()).toContain('KTX could not reach the local SQL analysis runtime while processing query history for warehouse.');
|
|
592
|
-
expect(io.stdout()).toContain('connection refused (ECONNREFUSED)');
|
|
593
|
-
expect(io.stdout()).toContain('Retry: ktx setup --project-dir /tmp/project');
|
|
594
|
-
expect(io.stdout()).not.toContain('KTX lost its connection to PostgreSQL');
|
|
595
|
-
});
|
|
596
|
-
it('uses captured query-history stderr instead of generic failed-at detail', async () => {
|
|
597
|
-
const io = makeIo();
|
|
598
|
-
const project = projectWithConnections({
|
|
599
|
-
warehouse: { driver: 'postgres', context: { depth: 'deep', queryHistory: { enabled: true } } },
|
|
600
|
-
});
|
|
601
|
-
const executeTarget = vi.fn(async (target, _args, targetIo) => {
|
|
602
|
-
targetIo.stdout.write('KTX scan completed\n');
|
|
603
|
-
targetIo.stdout.write('Mode: enriched\n');
|
|
604
|
-
targetIo.stderr.write('Missing bundled Python runtime manifest: /tmp/assets/python/manifest.json\n');
|
|
605
|
-
targetIo.stderr.write('In a source checkout, build the local runtime assets with: pnpm run artifacts:build\n');
|
|
606
|
-
targetIo.stderr.write('Then retry the runtime-backed KTX command.\n');
|
|
607
|
-
return {
|
|
608
|
-
connectionId: target.connectionId,
|
|
609
|
-
driver: target.driver,
|
|
610
|
-
steps: [
|
|
611
|
-
{ operation: 'database-schema', status: 'done' },
|
|
612
|
-
{
|
|
613
|
-
operation: 'query-history',
|
|
614
|
-
status: 'failed',
|
|
615
|
-
detail: 'warehouse failed at query-history. Retry: ktx ingest warehouse --project-dir /tmp/project --deep --query-history',
|
|
616
|
-
},
|
|
617
|
-
{ operation: 'source-ingest', status: 'skipped' },
|
|
618
|
-
{ operation: 'memory-update', status: 'skipped' },
|
|
619
|
-
],
|
|
620
|
-
};
|
|
621
|
-
});
|
|
622
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled', entrypoint: 'ingest' }, io.io, { executeTarget, now: () => 1000 });
|
|
623
|
-
expect(result).toEqual({ exitCode: 1 });
|
|
624
|
-
expect(io.stdout()).toContain('Missing bundled Python runtime manifest: /tmp/assets/python/manifest.json.');
|
|
625
|
-
expect(io.stdout()).toContain('Retry: ktx ingest warehouse --project-dir /tmp/project --deep --query-history');
|
|
626
|
-
expect(io.stdout()).not.toContain('Then retry the runtime-backed KTX command');
|
|
627
|
-
expect(io.stdout()).not.toContain('warehouse failed at query-history');
|
|
628
|
-
expect(io.stdout().match(/Retry: /g)).toHaveLength(1);
|
|
629
|
-
});
|
|
630
|
-
it('renders a friendly network failure when target execution throws', async () => {
|
|
631
|
-
const io = makeIo();
|
|
632
|
-
const project = projectWithConnections({
|
|
633
|
-
warehouse: { driver: 'postgres' },
|
|
634
|
-
});
|
|
635
|
-
const error = Object.assign(new Error('read ECONNRESET'), { code: 'ECONNRESET' });
|
|
636
|
-
const executeTarget = vi.fn(async () => {
|
|
637
|
-
throw error;
|
|
638
|
-
});
|
|
639
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
640
|
-
expect(result).toEqual({ exitCode: 1 });
|
|
641
|
-
expect(io.stdout()).toContain('KTX lost its connection to PostgreSQL while reading schema for warehouse.');
|
|
642
|
-
expect(io.stdout()).toContain('connection reset (ECONNRESET)');
|
|
643
|
-
});
|
|
644
|
-
it('uses direct ingest retry guidance for public ingest failures', async () => {
|
|
645
|
-
const io = makeIo();
|
|
646
|
-
const project = projectWithConnections({
|
|
647
|
-
warehouse: { driver: 'postgres' },
|
|
648
|
-
});
|
|
649
|
-
const executeTarget = vi.fn(async (target) => failedResult(target.connectionId, target.driver, target.operation));
|
|
650
|
-
await runContextBuild(project, {
|
|
651
|
-
projectDir: '/tmp/project',
|
|
652
|
-
inputMode: 'disabled',
|
|
653
|
-
targetConnectionId: 'warehouse',
|
|
654
|
-
all: false,
|
|
655
|
-
entrypoint: 'ingest',
|
|
656
|
-
}, io.io, { executeTarget, now: () => 1000 });
|
|
657
|
-
expect(io.stdout()).toContain('Retry: ktx ingest warehouse --project-dir /tmp/project');
|
|
658
|
-
expect(io.stdout()).not.toContain('Retry: ktx setup');
|
|
659
|
-
});
|
|
660
|
-
it('renders query-history progress without the historic-sql adapter key', async () => {
|
|
661
|
-
const io = makeIo();
|
|
662
|
-
const project = projectWithConnections({
|
|
663
|
-
warehouse: { driver: 'postgres', context: { queryHistory: { enabled: true } } },
|
|
664
|
-
});
|
|
665
|
-
const executeTarget = vi.fn(async (target, _args, _targetIo, deps) => {
|
|
666
|
-
deps.ingestProgress?.({ percent: 5, message: 'Fetching source files for warehouse/historic-sql' });
|
|
667
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
668
|
-
});
|
|
669
|
-
await runContextBuild(project, {
|
|
670
|
-
projectDir: '/tmp/project',
|
|
671
|
-
inputMode: 'disabled',
|
|
672
|
-
targetConnectionId: 'warehouse',
|
|
673
|
-
all: false,
|
|
674
|
-
entrypoint: 'ingest',
|
|
675
|
-
}, io.io, { executeTarget, now: () => 1000, sourceProgressThrottleMs: 0 });
|
|
676
|
-
expect(io.stdout()).toContain('Fetching query history for warehouse');
|
|
677
|
-
expect(io.stdout()).not.toContain('historic-sql');
|
|
678
|
-
});
|
|
679
|
-
it('renders database ingest progress without scan wording', async () => {
|
|
680
|
-
const io = makeIo();
|
|
681
|
-
const project = projectWithConnections({ warehouse: { driver: 'postgres' } });
|
|
682
|
-
const executeTarget = vi.fn(async (target, _args, _targetIo, deps) => {
|
|
683
|
-
await deps.scanProgress?.update(0.05, 'Preparing scan');
|
|
684
|
-
await deps.scanProgress?.update(0.15, 'Inspecting database schema');
|
|
685
|
-
await deps.scanProgress?.update(0.7, 'Writing schema artifacts');
|
|
686
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
687
|
-
});
|
|
688
|
-
await expect(runContextBuild(project, {
|
|
689
|
-
projectDir: '/tmp/project',
|
|
690
|
-
inputMode: 'disabled',
|
|
691
|
-
targetConnectionId: 'warehouse',
|
|
692
|
-
all: false,
|
|
693
|
-
}, io.io, { executeTarget, now: () => 1000, sourceProgressThrottleMs: 0 })).resolves.toMatchObject({ exitCode: 0 });
|
|
694
|
-
expect(io.stdout()).toContain('Preparing database ingest');
|
|
695
|
-
expect(io.stdout()).toContain('Reading database schema');
|
|
696
|
-
expect(io.stdout()).toContain('Writing schema context');
|
|
697
|
-
expect(io.stdout()).not.toContain('Preparing scan');
|
|
698
|
-
expect(io.stdout()).not.toMatch(/\bscan\b/i);
|
|
699
|
-
});
|
|
700
|
-
it('passes schema-first notices from the plan into foreground output', async () => {
|
|
701
|
-
const io = makeIo();
|
|
702
|
-
const project = {
|
|
703
|
-
...projectWithConnections({
|
|
704
|
-
warehouse: { driver: 'postgres', context: { depth: 'deep' } },
|
|
705
|
-
}),
|
|
706
|
-
config: {
|
|
707
|
-
...projectWithConnections({ warehouse: { driver: 'postgres' } }).config,
|
|
708
|
-
connections: {
|
|
709
|
-
warehouse: { driver: 'postgres', context: { depth: 'deep' } },
|
|
710
|
-
},
|
|
711
|
-
llm: {
|
|
712
|
-
provider: { backend: 'gateway', gateway: { api_key: 'env:KTX_GATEWAY_API_KEY' } }, // pragma: allowlist secret
|
|
713
|
-
models: { default: 'gpt-test' },
|
|
714
|
-
},
|
|
715
|
-
scan: {
|
|
716
|
-
...projectWithConnections({ warehouse: { driver: 'postgres' } }).config.scan,
|
|
717
|
-
enrichment: {
|
|
718
|
-
mode: 'llm',
|
|
719
|
-
embeddings: {
|
|
720
|
-
backend: 'openai',
|
|
721
|
-
model: 'text-embedding-3-small',
|
|
722
|
-
dimensions: 1536,
|
|
723
|
-
},
|
|
724
|
-
},
|
|
725
|
-
},
|
|
726
|
-
},
|
|
727
|
-
};
|
|
728
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
729
|
-
await expect(runContextBuild(project, {
|
|
730
|
-
projectDir: '/tmp/project',
|
|
731
|
-
inputMode: 'disabled',
|
|
732
|
-
targetConnectionId: 'warehouse',
|
|
733
|
-
all: false,
|
|
734
|
-
queryHistory: 'enabled',
|
|
735
|
-
}, io.io, { executeTarget, now: () => 1000 })).resolves.toMatchObject({ exitCode: 0 });
|
|
736
|
-
expect(io.stdout()).toContain('Schema ingest runs before query history for warehouse.');
|
|
737
|
-
});
|
|
738
|
-
it('renders final view for non-TTY output', async () => {
|
|
739
|
-
const io = makeIo();
|
|
740
|
-
const project = projectWithConnections({
|
|
741
|
-
warehouse: { driver: 'postgres' },
|
|
742
|
-
dbt_main: { driver: 'dbt' },
|
|
743
|
-
});
|
|
744
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
745
|
-
await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
746
|
-
const output = io.stdout();
|
|
747
|
-
expect(output).toContain('Building KTX context');
|
|
748
|
-
expect(output).toContain('Project: /tmp/project');
|
|
749
|
-
expect(output).toContain('Databases:');
|
|
750
|
-
expect(output).toContain('warehouse');
|
|
751
|
-
expect(output).toContain('Context sources:');
|
|
752
|
-
expect(output).toContain('dbt_main');
|
|
753
|
-
});
|
|
754
|
-
it('passes scan mode and detect relationships through to target execution', async () => {
|
|
755
|
-
const io = makeIo();
|
|
756
|
-
const project = projectWithConnections({ warehouse: { driver: 'postgres' } });
|
|
757
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
758
|
-
await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled', scanMode: 'enriched', detectRelationships: true }, io.io, { executeTarget, now: () => 1000 });
|
|
759
|
-
expect(executeTarget).toHaveBeenCalledWith(expect.objectContaining({ connectionId: 'warehouse', operation: 'database-ingest' }), expect.objectContaining({ scanMode: 'enriched', detectRelationships: true }), expect.anything(), expect.objectContaining({
|
|
760
|
-
scanProgress: expect.anything(),
|
|
761
|
-
ingestProgress: expect.any(Function),
|
|
762
|
-
}));
|
|
763
|
-
});
|
|
764
|
-
it('threads the original runtime IO into captured target execution', async () => {
|
|
765
|
-
const io = makeIo({ isTTY: true });
|
|
766
|
-
const project = projectWithConnections({
|
|
767
|
-
warehouse: { driver: 'postgres', context: { queryHistory: { enabled: true } } },
|
|
768
|
-
});
|
|
769
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
770
|
-
await runContextBuild(project, {
|
|
771
|
-
projectDir: '/tmp/project',
|
|
772
|
-
inputMode: 'auto',
|
|
773
|
-
cliVersion: '0.2.0',
|
|
774
|
-
runtimeInstallPolicy: 'auto',
|
|
775
|
-
}, io.io, { executeTarget, now: () => 1000 });
|
|
776
|
-
expect(executeTarget).toHaveBeenCalledWith(expect.objectContaining({ connectionId: 'warehouse' }), expect.objectContaining({ runtimeInstallPolicy: 'auto' }), expect.objectContaining({
|
|
777
|
-
stdout: expect.objectContaining({ isTTY: false }),
|
|
778
|
-
}), expect.objectContaining({
|
|
779
|
-
runtimeIo: io.io,
|
|
780
|
-
}));
|
|
781
|
-
});
|
|
782
|
-
it('calls onSourceProgress when sources start and finish', async () => {
|
|
783
|
-
const io = makeIo();
|
|
784
|
-
const project = projectWithConnections({
|
|
785
|
-
warehouse: { driver: 'postgres' },
|
|
786
|
-
dbt_main: { driver: 'dbt' },
|
|
787
|
-
});
|
|
788
|
-
const progressUpdates = [];
|
|
789
|
-
const executeTarget = vi.fn(async (target) => successResult(target.connectionId, target.driver, target.operation));
|
|
790
|
-
await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, {
|
|
791
|
-
executeTarget,
|
|
792
|
-
now: () => 1000,
|
|
793
|
-
onSourceProgress: (sources) => {
|
|
794
|
-
progressUpdates.push(sources.map((s) => ({ connectionId: s.connectionId, status: s.status })));
|
|
795
|
-
},
|
|
796
|
-
});
|
|
797
|
-
expect(progressUpdates).toHaveLength(4);
|
|
798
|
-
expect(progressUpdates[0]).toEqual([
|
|
799
|
-
{ connectionId: 'warehouse', status: 'running' },
|
|
800
|
-
{ connectionId: 'dbt_main', status: 'queued' },
|
|
801
|
-
]);
|
|
802
|
-
expect(progressUpdates[1]).toEqual([
|
|
803
|
-
{ connectionId: 'warehouse', status: 'done' },
|
|
804
|
-
{ connectionId: 'dbt_main', status: 'queued' },
|
|
805
|
-
]);
|
|
806
|
-
expect(progressUpdates[2]).toEqual([
|
|
807
|
-
{ connectionId: 'warehouse', status: 'done' },
|
|
808
|
-
{ connectionId: 'dbt_main', status: 'running' },
|
|
809
|
-
]);
|
|
810
|
-
expect(progressUpdates[3]).toEqual([
|
|
811
|
-
{ connectionId: 'warehouse', status: 'done' },
|
|
812
|
-
{ connectionId: 'dbt_main', status: 'done' },
|
|
813
|
-
]);
|
|
814
|
-
});
|
|
815
|
-
it('publishes structured target progress without expanding the compact source rows', async () => {
|
|
816
|
-
const io = makeIo({ isTTY: true });
|
|
817
|
-
const project = projectWithConnections({
|
|
818
|
-
warehouse: { driver: 'postgres' },
|
|
819
|
-
});
|
|
820
|
-
const progressUpdates = [];
|
|
821
|
-
const executeTarget = vi.fn(async (target, _args, _targetIo, deps) => {
|
|
822
|
-
await deps.scanProgress?.update(0.37, 'Generating descriptions 3/8 tables', { transient: true });
|
|
823
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
824
|
-
});
|
|
825
|
-
await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, {
|
|
826
|
-
executeTarget,
|
|
827
|
-
now: () => 1000,
|
|
828
|
-
onSourceProgress: (sources) => {
|
|
829
|
-
progressUpdates.push(sources.map((s) => ({
|
|
830
|
-
connectionId: s.connectionId,
|
|
831
|
-
...(s.percent !== undefined ? { percent: s.percent } : {}),
|
|
832
|
-
...(s.message !== undefined ? { message: s.message } : {}),
|
|
833
|
-
})));
|
|
834
|
-
},
|
|
835
|
-
sourceProgressThrottleMs: 0,
|
|
836
|
-
});
|
|
837
|
-
expect(progressUpdates).toContainEqual([
|
|
838
|
-
{ connectionId: 'warehouse', percent: 37, message: 'Generating descriptions 3/8 tables' },
|
|
839
|
-
]);
|
|
840
|
-
expect(io.stdout()).toContain('Generating descriptions 3/8 tables');
|
|
841
|
-
});
|
|
842
|
-
it('returns report IDs and artifact paths parsed from target output', async () => {
|
|
843
|
-
const io = makeIo();
|
|
844
|
-
const project = projectWithConnections({
|
|
845
|
-
warehouse: { driver: 'postgres' },
|
|
846
|
-
dbt_main: { driver: 'dbt' },
|
|
847
|
-
});
|
|
848
|
-
const executeTarget = vi.fn(async (target, _args, targetIo) => {
|
|
849
|
-
if (target.operation === 'database-ingest') {
|
|
850
|
-
targetIo.stdout.write('Report: raw-sources/warehouse/live-database/sync-1/scan-report.json\n');
|
|
851
|
-
targetIo.stdout.write('Raw sources: raw-sources/warehouse/live-database/sync-1\n');
|
|
852
|
-
}
|
|
853
|
-
else {
|
|
854
|
-
targetIo.stdout.write('Report: report-dbt-1\n');
|
|
855
|
-
targetIo.stdout.write('Saved memory: 2 wiki, 3 SL\n');
|
|
856
|
-
}
|
|
857
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
858
|
-
});
|
|
859
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
860
|
-
expect(result).toMatchObject({
|
|
861
|
-
exitCode: 0,
|
|
862
|
-
reportIds: ['report-dbt-1'],
|
|
863
|
-
artifactPaths: [
|
|
864
|
-
'raw-sources/warehouse/live-database/sync-1/scan-report.json',
|
|
865
|
-
'raw-sources/warehouse/live-database/sync-1',
|
|
866
|
-
],
|
|
867
|
-
});
|
|
868
|
-
});
|
|
869
|
-
it('returns report IDs parsed from failed source-ingest target output', async () => {
|
|
870
|
-
const io = makeIo();
|
|
871
|
-
const project = projectWithConnections({
|
|
872
|
-
warehouse: { driver: 'postgres' },
|
|
873
|
-
dbt_main: { driver: 'dbt' },
|
|
874
|
-
});
|
|
875
|
-
const executeTarget = vi.fn(async (target, _args, targetIo) => {
|
|
876
|
-
if (target.operation === 'database-ingest') {
|
|
877
|
-
return successResult(target.connectionId, target.driver, target.operation);
|
|
878
|
-
}
|
|
879
|
-
targetIo.stdout.write('Report: report-dbt-failed\n');
|
|
880
|
-
targetIo.stdout.write('Tasks: 3\n');
|
|
881
|
-
return failedResult(target.connectionId, target.driver, target.operation);
|
|
882
|
-
});
|
|
883
|
-
const result = await runContextBuild(project, { projectDir: '/tmp/project', inputMode: 'disabled' }, io.io, { executeTarget, now: () => 1000 });
|
|
884
|
-
expect(result).toMatchObject({
|
|
885
|
-
exitCode: 1,
|
|
886
|
-
reportIds: ['report-dbt-failed'],
|
|
887
|
-
});
|
|
888
|
-
});
|
|
889
|
-
});
|
|
890
|
-
describe('viewStateFromSourceProgress', () => {
|
|
891
|
-
it('partitions sources into primary and context groups', () => {
|
|
892
|
-
const state = viewStateFromSourceProgress([
|
|
893
|
-
{ connectionId: 'warehouse', operation: 'database-ingest', status: 'running', startedAtMs: 900 },
|
|
894
|
-
{ connectionId: 'dbt-main', operation: 'source-ingest', status: 'queued' },
|
|
895
|
-
], 1000, 500);
|
|
896
|
-
expect(state.primarySources).toHaveLength(1);
|
|
897
|
-
expect(state.primarySources[0].target.connectionId).toBe('warehouse');
|
|
898
|
-
expect(state.primarySources[0].status).toBe('running');
|
|
899
|
-
expect(state.primarySources[0].elapsedMs).toBe(100);
|
|
900
|
-
expect(state.contextSources).toHaveLength(1);
|
|
901
|
-
expect(state.contextSources[0].target.connectionId).toBe('dbt-main');
|
|
902
|
-
expect(state.contextSources[0].status).toBe('queued');
|
|
903
|
-
expect(state.totalElapsedMs).toBe(500);
|
|
904
|
-
});
|
|
905
|
-
it('uses stored elapsedMs for completed sources', () => {
|
|
906
|
-
const state = viewStateFromSourceProgress([{ connectionId: 'warehouse', operation: 'database-ingest', status: 'done', elapsedMs: 72000, summaryText: '42 tables' }], 99999);
|
|
907
|
-
expect(state.primarySources[0].elapsedMs).toBe(72000);
|
|
908
|
-
expect(state.primarySources[0].summaryText).toBe('42 tables');
|
|
909
|
-
});
|
|
910
|
-
it('renders the same view format as the foreground build', () => {
|
|
911
|
-
const state = viewStateFromSourceProgress([
|
|
912
|
-
{ connectionId: 'warehouse', operation: 'database-ingest', status: 'done', elapsedMs: 72000, summaryText: '42 tables' },
|
|
913
|
-
{ connectionId: 'dbt-main', operation: 'source-ingest', status: 'running', startedAtMs: 900 },
|
|
914
|
-
], 1000, 500);
|
|
915
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
916
|
-
expect(output).toContain('Building KTX context');
|
|
917
|
-
expect(output).toContain('Databases:');
|
|
918
|
-
expect(output).toContain('warehouse');
|
|
919
|
-
expect(output).toContain('42 tables');
|
|
920
|
-
expect(output).toContain('Context sources:');
|
|
921
|
-
expect(output).toContain('dbt-main');
|
|
922
|
-
expect(output).toContain('ingesting...');
|
|
923
|
-
});
|
|
924
|
-
it('renders persisted percent and message as compact source-row progress', () => {
|
|
925
|
-
const state = viewStateFromSourceProgress([
|
|
926
|
-
{
|
|
927
|
-
connectionId: 'warehouse',
|
|
928
|
-
operation: 'database-ingest',
|
|
929
|
-
status: 'running',
|
|
930
|
-
startedAtMs: 900,
|
|
931
|
-
percent: 63,
|
|
932
|
-
message: 'Building embeddings 2/4 batches',
|
|
933
|
-
updatedAtMs: 950,
|
|
934
|
-
},
|
|
935
|
-
], 1000);
|
|
936
|
-
const output = renderContextBuildView(state, { styled: false });
|
|
937
|
-
expect(output).toContain('warehouse');
|
|
938
|
-
expect(output).toContain('63%');
|
|
939
|
-
expect(output).toContain('Building embeddings 2/4 batches');
|
|
940
|
-
expect(output.match(/warehouse/g)).toHaveLength(1);
|
|
941
|
-
});
|
|
942
|
-
});
|