@kaelio/ktx 0.4.1 → 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.6.0-py3-none-any.whl +0 -0
- package/assets/python/manifest.json +4 -4
- package/dist/.tsbuildinfo +1 -0
- package/dist/admin-reindex.d.ts +4 -1
- package/dist/admin-reindex.js +6 -3
- package/dist/admin.js +2 -1
- package/dist/clack.d.ts +8 -3
- package/dist/clack.js +15 -1
- package/dist/claude-code-prompt-caching.d.ts +1 -1
- package/dist/cli-program.d.ts +5 -1
- package/dist/cli-program.js +74 -8
- package/dist/cli-runtime.d.ts +0 -1
- package/dist/cli-runtime.js +2 -2
- package/dist/command-schemas.d.ts +2 -2
- package/dist/commands/status-commands.js +10 -1
- package/dist/connection.d.ts +5 -2
- package/dist/connection.js +77 -14
- package/dist/connectors/bigquery/connector.d.ts +151 -0
- package/dist/connectors/bigquery/connector.js +420 -0
- package/dist/connectors/bigquery/dialect.d.ts +31 -0
- package/dist/connectors/bigquery/dialect.js +158 -0
- package/dist/connectors/bigquery/live-database-introspection.d.ts +10 -0
- package/dist/connectors/bigquery/live-database-introspection.js +24 -0
- package/dist/connectors/clickhouse/connector.d.ts +121 -0
- package/dist/connectors/clickhouse/connector.js +438 -0
- package/dist/connectors/clickhouse/dialect.d.ts +32 -0
- package/dist/connectors/clickhouse/dialect.js +161 -0
- package/dist/connectors/clickhouse/live-database-introspection.d.ts +11 -0
- package/dist/connectors/clickhouse/live-database-introspection.js +25 -0
- package/dist/connectors/mysql/connector.d.ts +125 -0
- package/dist/connectors/mysql/connector.js +494 -0
- package/dist/connectors/mysql/dialect.d.ts +31 -0
- package/dist/connectors/mysql/dialect.js +153 -0
- package/dist/connectors/mysql/live-database-introspection.d.ts +11 -0
- package/dist/connectors/mysql/live-database-introspection.js +25 -0
- package/dist/connectors/postgres/connector.d.ts +147 -0
- package/dist/connectors/postgres/connector.js +566 -0
- package/dist/connectors/postgres/dialect.d.ts +31 -0
- package/dist/connectors/postgres/dialect.js +173 -0
- package/dist/connectors/postgres/historic-sql-query-client.d.ts +14 -0
- package/dist/connectors/postgres/live-database-introspection.d.ts +11 -0
- package/dist/connectors/postgres/live-database-introspection.js +25 -0
- package/dist/connectors/snowflake/connector.d.ts +143 -0
- package/dist/connectors/snowflake/connector.js +573 -0
- package/dist/connectors/snowflake/dialect.d.ts +31 -0
- package/dist/connectors/snowflake/dialect.js +157 -0
- package/dist/connectors/snowflake/historic-sql-query-client.d.ts +13 -0
- package/dist/connectors/snowflake/historic-sql-query-client.js +20 -0
- package/dist/connectors/snowflake/identifiers.d.ts +2 -0
- package/dist/connectors/snowflake/identifiers.js +10 -0
- package/dist/connectors/snowflake/live-database-introspection.d.ts +12 -0
- package/dist/connectors/snowflake/live-database-introspection.js +26 -0
- package/dist/connectors/snowflake/sdk-logger.d.ts +10 -0
- package/dist/connectors/snowflake/sdk-logger.js +29 -0
- package/dist/connectors/sqlite/connector.d.ts +63 -0
- package/dist/connectors/sqlite/connector.js +280 -0
- package/dist/connectors/sqlite/dialect.d.ts +31 -0
- package/dist/connectors/sqlite/dialect.js +142 -0
- package/dist/connectors/sqlite/live-database-introspection.d.ts +8 -0
- package/dist/connectors/sqlite/live-database-introspection.js +24 -0
- package/dist/connectors/sqlserver/connector.d.ts +145 -0
- package/dist/connectors/sqlserver/connector.js +581 -0
- package/dist/connectors/sqlserver/dialect.d.ts +31 -0
- package/dist/connectors/sqlserver/dialect.js +153 -0
- package/dist/connectors/sqlserver/live-database-introspection.d.ts +11 -0
- package/dist/connectors/sqlserver/live-database-introspection.js +25 -0
- package/dist/context/connections/bigquery-identifiers.d.ts +2 -0
- package/dist/context/connections/bigquery-identifiers.js +15 -0
- package/dist/context/connections/connection-type.d.ts +25 -0
- 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 +28 -0
- package/dist/context/connections/dialects.js +33 -0
- 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 +39 -0
- package/dist/context/connections/local-warehouse-descriptor.js +70 -0
- package/dist/context/connections/notion-config.d.ts +44 -0
- package/dist/context/connections/notion-config.js +134 -0
- package/dist/context/connections/postgres-query-executor.js +53 -0
- package/dist/context/connections/query-executor.d.ts +19 -0
- package/dist/context/connections/sqlite-query-executor.d.ts +4 -0
- package/dist/context/connections/sqlite-query-executor.js +74 -0
- package/dist/context/core/config-reference.d.ts +3 -0
- package/dist/context/core/config-reference.js +30 -0
- package/dist/context/core/config.d.ts +26 -0
- package/dist/context/core/redaction.d.ts +5 -0
- package/dist/context/core/redaction.js +40 -0
- package/dist/context/core/session-worktree.service.d.ts +31 -0
- package/dist/context/daemon/semantic-layer-compute.d.ts +84 -0
- package/dist/context/daemon/semantic-layer-compute.js +194 -0
- package/dist/context/index-sync/reindex.d.ts +3 -0
- package/dist/context/index-sync/reindex.js +144 -0
- package/dist/context/index-sync/types.d.ts +29 -0
- package/dist/context/ingest/action-identity.d.ts +3 -0
- package/dist/context/ingest/adapters/dbt/parse.d.ts +7 -0
- package/dist/context/ingest/adapters/dbt/parse.js +24 -0
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.d.ts +65 -0
- package/dist/context/ingest/adapters/dbt-descriptions/parse-schema.js +426 -0
- package/dist/context/ingest/adapters/historic-sql/bigquery-query-history-reader.js +187 -0
- package/dist/context/ingest/adapters/historic-sql/chunk-unified.js +86 -0
- package/dist/context/ingest/adapters/historic-sql/connection-dialect.d.ts +8 -0
- package/dist/context/ingest/adapters/historic-sql/connection-dialect.js +34 -0
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.d.ts +41 -0
- package/dist/context/ingest/adapters/historic-sql/evidence-tool.js +91 -0
- package/dist/context/ingest/adapters/historic-sql/evidence.d.ts +77 -0
- package/dist/context/ingest/adapters/historic-sql/evidence.js +34 -0
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.d.ts +21 -0
- package/dist/context/ingest/adapters/historic-sql/pattern-inputs.js +68 -0
- package/dist/context/ingest/adapters/historic-sql/projection.d.ts +24 -0
- package/dist/context/ingest/adapters/historic-sql/projection.js +323 -0
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.d.ts +37 -0
- package/dist/context/ingest/adapters/historic-sql/skill-schemas.js +25 -0
- package/dist/context/ingest/adapters/historic-sql/stage-unified.d.ts +13 -0
- package/dist/context/ingest/adapters/historic-sql/types.d.ts +183 -0
- package/dist/context/ingest/adapters/live-database/daemon-introspection.d.ts +21 -0
- package/dist/context/ingest/adapters/live-database/daemon-introspection.js +198 -0
- package/dist/context/ingest/adapters/live-database/live-database.adapter.js +25 -0
- package/dist/context/ingest/adapters/live-database/manifest.d.ts +66 -0
- package/dist/context/ingest/adapters/live-database/stage.d.ts +15 -0
- package/dist/context/ingest/adapters/live-database/stage.js +115 -0
- package/dist/context/ingest/adapters/live-database/types.d.ts +12 -0
- package/dist/context/ingest/adapters/looker/factory.d.ts +23 -0
- package/dist/context/ingest/adapters/looker/factory.js +23 -0
- package/dist/context/ingest/adapters/looker/fetch.d.ts +31 -0
- package/dist/context/ingest/adapters/looker/local-looker.adapter.d.ts +9 -0
- package/dist/context/ingest/adapters/looker/local-looker.adapter.js +35 -0
- package/dist/context/ingest/adapters/looker/local-runtime-store.d.ts +50 -0
- package/dist/context/ingest/adapters/looker/mapping.d.ts +129 -0
- package/dist/context/ingest/adapters/looker/mapping.js +307 -0
- package/dist/context/ingest/adapters/looker/reconcile.d.ts +1 -0
- package/dist/context/ingest/adapters/looker/reconcile.js +8 -0
- package/dist/context/ingest/adapters/looker/scope.d.ts +7 -0
- package/dist/context/ingest/adapters/looker/scope.js +57 -0
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.d.ts +107 -0
- package/dist/context/ingest/adapters/looker/tools/looker-query-to-sl.tool.js +237 -0
- package/dist/context/ingest/adapters/looker/types.d.ts +439 -0
- package/dist/context/ingest/adapters/looker/types.js +199 -0
- package/dist/context/ingest/adapters/lookml/fetch-report.d.ts +17 -0
- package/dist/context/ingest/adapters/lookml/fetch-report.js +100 -0
- package/dist/context/ingest/adapters/lookml/pull-config.d.ts +38 -0
- package/dist/context/ingest/adapters/lookml/pull-config.js +26 -0
- package/dist/context/ingest/adapters/metabase/client-port.d.ts +167 -0
- package/dist/context/ingest/adapters/metabase/client.d.ts +116 -0
- package/dist/context/ingest/adapters/metabase/client.js +673 -0
- package/dist/context/ingest/adapters/metabase/fanout-planner.d.ts +18 -0
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.d.ts +14 -0
- package/dist/context/ingest/adapters/metabase/local-metabase.adapter.js +41 -0
- package/dist/context/ingest/adapters/metabase/local-source-state-store.d.ts +43 -0
- package/dist/context/ingest/adapters/metabase/local-source-state-store.js +176 -0
- package/dist/context/ingest/adapters/metabase/mapping.d.ts +102 -0
- package/dist/context/ingest/adapters/metabase/mapping.js +225 -0
- package/dist/context/ingest/adapters/metabase/serialize-card.d.ts +56 -0
- package/dist/context/ingest/adapters/metabase/serialize-card.js +68 -0
- package/dist/context/ingest/adapters/metabase/source-state-port.d.ts +24 -0
- package/dist/context/ingest/adapters/metabase/types.d.ts +143 -0
- package/dist/context/ingest/adapters/metabase/types.js +107 -0
- package/dist/context/ingest/adapters/metricflow/deep-parse.d.ts +78 -0
- package/dist/context/ingest/adapters/metricflow/deep-parse.js +461 -0
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.d.ts +30 -0
- package/dist/context/ingest/adapters/metricflow/import-semantic-models.js +136 -0
- package/dist/context/ingest/adapters/metricflow/parse.d.ts +43 -0
- package/dist/context/ingest/adapters/metricflow/pull-config.d.ts +38 -0
- package/dist/context/ingest/adapters/metricflow/pull-config.js +24 -0
- package/dist/context/ingest/adapters/metricflow/semantic-models.d.ts +37 -0
- package/dist/context/ingest/adapters/metricflow/semantic-models.js +283 -0
- package/dist/context/ingest/adapters/notion/chunk.d.ts +5 -0
- package/dist/context/ingest/adapters/notion/chunk.js +138 -0
- package/dist/context/ingest/adapters/notion/cluster.d.ts +11 -0
- package/dist/context/ingest/adapters/notion/cluster.js +83 -0
- package/dist/context/ingest/adapters/notion/normalize.d.ts +11 -0
- package/dist/context/ingest/adapters/notion/normalize.js +166 -0
- package/dist/context/ingest/adapters/notion/notion-client.d.ts +75 -0
- package/dist/context/ingest/adapters/notion/notion-client.js +108 -0
- package/dist/context/ingest/artifact-gates.d.ts +26 -0
- package/dist/context/ingest/context-candidates/candidate-dedup.service.d.ts +27 -0
- package/dist/context/ingest/context-candidates/candidate-dedup.service.js +234 -0
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.d.ts +31 -0
- package/dist/context/ingest/context-candidates/context-candidate-carryforward.service.js +131 -0
- package/dist/context/ingest/context-candidates/curator-pagination.service.d.ts +64 -0
- package/dist/context/ingest/context-candidates/curator-pagination.service.js +240 -0
- package/dist/context/ingest/context-candidates/types.d.ts +93 -0
- package/dist/context/ingest/context-evidence/context-evidence-index.service.d.ts +53 -0
- package/dist/context/ingest/context-evidence/context-evidence-index.service.js +303 -0
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.d.ts +90 -0
- package/dist/context/ingest/context-evidence/sqlite-context-evidence-store.js +1025 -0
- package/dist/context/ingest/dbt-shared/project-vars.d.ts +14 -0
- package/dist/context/ingest/dbt-shared/project-vars.js +88 -0
- package/dist/context/ingest/dbt-shared/schema-files.d.ts +4 -0
- package/dist/context/ingest/dbt-shared/schema-files.js +63 -0
- package/dist/context/ingest/final-gate-repair.d.ts +29 -0
- package/dist/context/ingest/finalization-scope.d.ts +22 -0
- 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/ingest-bundle.runner.js +2247 -0
- package/dist/context/ingest/ingest-trace.d.ts +25 -0
- package/dist/context/ingest/ingest-trace.js +74 -0
- package/dist/context/ingest/isolated-diff/git-patch.d.ts +17 -0
- package/dist/context/ingest/isolated-diff/git-patch.js +79 -0
- package/dist/context/ingest/isolated-diff/patch-integrator.d.ts +59 -0
- package/dist/context/ingest/isolated-diff/textual-conflict-resolver.d.ts +23 -0
- package/dist/context/ingest/local-adapters.d.ts +35 -0
- package/dist/context/ingest/local-adapters.js +241 -0
- package/dist/context/ingest/local-bundle-runtime.d.ts +35 -0
- package/dist/context/ingest/local-bundle-runtime.js +636 -0
- package/dist/context/ingest/local-ingest.d.ts +82 -0
- package/dist/context/ingest/local-ingest.js +297 -0
- package/dist/context/ingest/local-mapping-reconcile.d.ts +2 -0
- package/dist/context/ingest/local-mapping-reconcile.js +27 -0
- package/dist/context/ingest/local-stage-ingest.d.ts +56 -0
- package/dist/context/ingest/local-stage-ingest.js +290 -0
- package/dist/context/ingest/memory-flow/events.d.ts +10 -0
- package/dist/context/ingest/memory-flow/events.js +197 -0
- package/dist/context/ingest/memory-flow/interaction.d.ts +11 -0
- package/dist/context/ingest/memory-flow/interaction.js +317 -0
- package/dist/context/ingest/memory-flow/schema.d.ts +18 -0
- package/dist/context/ingest/memory-flow/schema.js +174 -0
- package/dist/context/ingest/memory-flow/visuals.d.ts +25 -0
- package/dist/context/ingest/memory-flow/visuals.js +46 -0
- package/dist/context/ingest/page-triage/page-triage.service.d.ts +84 -0
- package/dist/context/ingest/page-triage/page-triage.service.js +318 -0
- package/dist/context/ingest/ports.d.ts +328 -0
- package/dist/context/ingest/raw-sources-paths.d.ts +6 -0
- package/dist/context/ingest/raw-sources-paths.js +18 -0
- package/dist/context/ingest/repo-fetch.d.ts +41 -0
- package/dist/context/ingest/repo-fetch.js +138 -0
- package/dist/context/ingest/report-snapshot.d.ts +2 -0
- package/dist/context/ingest/report-snapshot.js +212 -0
- package/dist/context/ingest/reports.d.ts +120 -0
- package/dist/context/ingest/reports.js +30 -0
- package/dist/context/ingest/semantic-layer-target-policy.d.ts +14 -0
- package/dist/context/ingest/semantic-layer-target-policy.js +28 -0
- package/dist/context/ingest/stages/build-reconcile-context.d.ts +61 -0
- package/dist/context/ingest/stages/build-wu-context.d.ts +27 -0
- package/dist/context/ingest/stages/build-wu-context.js +87 -0
- package/dist/context/ingest/stages/stage-3-work-units.d.ts +49 -0
- package/dist/context/ingest/stages/stage-3-work-units.js +108 -0
- package/dist/context/ingest/stages/stage-4-reconciliation.d.ts +28 -0
- package/dist/context/ingest/stages/stage-index.types.d.ts +51 -0
- package/dist/context/ingest/stages/validate-wu-sources.d.ts +10 -0
- package/dist/context/ingest/tools/tool-call-logger.d.ts +33 -0
- package/dist/context/ingest/tools/verification-ledger.tool.d.ts +14 -0
- package/dist/context/ingest/tools/warehouse-verification/create-warehouse-verification-tools.d.ts +9 -0
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.d.ts +36 -0
- package/dist/context/ingest/tools/warehouse-verification/discover-data.tool.js +94 -0
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.d.ts +43 -0
- package/dist/context/ingest/tools/warehouse-verification/entity-details.tool.js +137 -0
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.d.ts +31 -0
- package/dist/context/ingest/tools/warehouse-verification/sql-execution.tool.js +84 -0
- package/dist/context/ingest/types.d.ts +203 -0
- package/dist/context/ingest/wiki-body-refs.d.ts +26 -0
- package/dist/context/ingest/wiki-body-refs.js +112 -0
- package/dist/context/ingest/wiki-sl-ref-repair.d.ts +19 -0
- package/dist/context/llm/ai-sdk-runtime.d.ts +24 -0
- package/dist/context/llm/ai-sdk-runtime.js +133 -0
- package/dist/context/llm/claude-code-env.d.ts +3 -0
- package/dist/context/llm/claude-code-env.js +22 -0
- package/dist/context/llm/claude-code-runtime.d.ts +37 -0
- package/dist/context/llm/claude-code-runtime.js +281 -0
- package/dist/context/llm/debug-request-recorder.d.ts +45 -0
- package/dist/context/llm/debug-request-recorder.js +80 -0
- package/dist/context/llm/embedding-port.d.ts +17 -0
- package/dist/context/llm/local-config.d.ts +24 -0
- package/dist/context/llm/local-config.js +136 -0
- package/dist/context/llm/runtime-port.d.ts +60 -0
- package/dist/context/llm/runtime-tools.d.ts +9 -0
- package/dist/context/llm/runtime-tools.js +65 -0
- package/dist/context/mcp/context-tools.d.ts +12 -0
- package/dist/context/mcp/context-tools.js +565 -0
- package/dist/context/mcp/local-project-ports.d.ts +16 -0
- package/dist/context/mcp/local-project-ports.js +199 -0
- package/dist/context/mcp/server.d.ts +8 -0
- package/dist/context/mcp/server.js +29 -0
- package/dist/context/mcp/types.d.ts +169 -0
- package/dist/context/memory/capture-signals.d.ts +9 -0
- package/dist/context/memory/capture-signals.js +104 -0
- package/dist/context/memory/local-memory.d.ts +24 -0
- package/dist/context/memory/local-memory.js +418 -0
- package/dist/context/memory/memory-agent.service.d.ts +60 -0
- package/dist/context/memory/memory-agent.service.js +540 -0
- package/dist/context/memory/memory-runs.d.ts +55 -0
- package/dist/context/memory/types.d.ts +145 -0
- package/dist/context/project/config.d.ts +470 -0
- package/dist/context/project/config.js +325 -0
- package/dist/context/project/driver-schemas.d.ts +101 -0
- package/dist/context/project/driver-schemas.js +182 -0
- package/dist/context/project/local-git-file-store.d.ts +24 -0
- package/dist/context/project/mappings-yaml-schema.d.ts +61 -0
- package/dist/context/project/mappings-yaml-schema.js +111 -0
- package/dist/context/project/project.d.ts +30 -0
- package/dist/context/project/project.js +94 -0
- package/dist/context/project/setup-config.d.ts +13 -0
- package/dist/context/project/setup-config.js +80 -0
- package/dist/context/prompts/prompt.service.d.ts +28 -0
- package/dist/context/prompts/prompt.service.js +84 -0
- package/dist/context/scan/constraint-discovery.d.ts +19 -0
- package/dist/context/scan/constraint-discovery.js +23 -0
- package/dist/context/scan/credentials.d.ts +10 -0
- package/dist/context/scan/credentials.js +41 -0
- package/dist/context/scan/data-dictionary.d.ts +26 -0
- package/dist/context/scan/data-dictionary.js +67 -0
- package/dist/context/scan/description-generation.d.ts +148 -0
- package/dist/context/scan/description-generation.js +760 -0
- package/dist/context/scan/embedding-text.d.ts +22 -0
- package/dist/context/scan/enabled-tables.d.ts +15 -0
- package/dist/context/scan/enabled-tables.js +48 -0
- package/dist/context/scan/enrichment-state.d.ts +47 -0
- package/dist/context/scan/enrichment-state.js +44 -0
- package/dist/context/scan/enrichment-types.d.ts +103 -0
- package/dist/context/scan/entity-details.d.ts +58 -0
- package/dist/context/scan/entity-details.js +186 -0
- package/dist/context/scan/local-enrichment-artifacts.d.ts +32 -0
- package/dist/context/scan/local-enrichment-artifacts.js +275 -0
- package/dist/context/scan/local-enrichment.d.ts +46 -0
- package/dist/context/scan/local-enrichment.js +479 -0
- package/dist/context/scan/local-scan.d.ts +62 -0
- package/dist/context/scan/local-scan.js +450 -0
- package/dist/context/scan/local-structural-artifacts.d.ts +10 -0
- package/dist/context/scan/local-structural-artifacts.js +137 -0
- package/dist/context/scan/relationship-benchmarks.d.ts +148 -0
- package/dist/context/scan/relationship-benchmarks.js +649 -0
- package/dist/context/scan/relationship-budget.d.ts +21 -0
- package/dist/context/scan/relationship-budget.js +35 -0
- package/dist/context/scan/relationship-candidates.d.ts +50 -0
- package/dist/context/scan/relationship-candidates.js +557 -0
- package/dist/context/scan/relationship-composite-candidates.d.ts +68 -0
- package/dist/context/scan/relationship-composite-candidates.js +410 -0
- package/dist/context/scan/relationship-diagnostics.d.ts +96 -0
- package/dist/context/scan/relationship-diagnostics.js +225 -0
- package/dist/context/scan/relationship-discovery.d.ts +28 -0
- package/dist/context/scan/relationship-discovery.js +248 -0
- package/dist/context/scan/relationship-graph-resolver.d.ts +49 -0
- package/dist/context/scan/relationship-llm-proposal.d.ts +26 -0
- package/dist/context/scan/relationship-llm-proposal.js +191 -0
- package/dist/context/scan/relationship-name-similarity.d.ts +15 -0
- package/dist/context/scan/relationship-name-similarity.js +124 -0
- package/dist/context/scan/relationship-profiling.d.ts +56 -0
- package/dist/context/scan/relationship-profiling.js +265 -0
- package/dist/context/scan/relationship-scoring.d.ts +34 -0
- package/dist/context/scan/relationship-scoring.js +98 -0
- package/dist/context/scan/relationship-validation.d.ts +47 -0
- package/dist/context/scan/relationship-validation.js +230 -0
- package/dist/context/scan/table-ref.d.ts +25 -0
- package/dist/context/scan/table-ref.js +35 -0
- package/dist/context/scan/type-normalization.d.ts +10 -0
- package/dist/context/scan/type-normalization.js +24 -0
- package/dist/context/scan/types.d.ts +332 -0
- package/dist/context/scan/warehouse-catalog.d.ts +69 -0
- package/dist/context/scan/warehouse-catalog.js +294 -0
- package/dist/context/search/discover.d.ts +31 -0
- package/dist/context/search/discover.js +341 -0
- package/dist/context/search/pglite-owner-process.d.ts +20 -0
- package/dist/context/search/pglite-owner-process.js +82 -0
- package/dist/context/search/types.d.ts +73 -0
- package/dist/context/skills/skills-registry.service.d.ts +35 -0
- package/dist/context/skills/skills-registry.service.js +215 -0
- package/dist/context/sl/dictionary-search.d.ts +43 -0
- package/dist/context/sl/local-query.d.ts +19 -0
- package/dist/context/sl/local-query.js +115 -0
- package/dist/context/sl/local-sl.d.ts +62 -0
- package/dist/context/sl/local-sl.js +472 -0
- package/dist/context/sl/pglite-sl-search-prototype.d.ts +16 -0
- package/dist/context/sl/pglite-sl-search-prototype.js +433 -0
- package/dist/context/sl/semantic-layer.service.d.ts +220 -0
- package/dist/context/sl/semantic-layer.service.js +1351 -0
- package/dist/context/sl/sl-dictionary-profile.d.ts +9 -0
- package/dist/context/sl/sl-dictionary-profile.js +80 -0
- package/dist/context/sl/sl-search.service.d.ts +19 -0
- package/dist/context/sl/sl-search.service.js +158 -0
- package/dist/context/sl/sl-validator.port.d.ts +8 -0
- package/dist/context/sl/tools/base-semantic-layer.tool.d.ts +46 -0
- package/dist/context/sl/tools/base-semantic-layer.tool.js +91 -0
- package/dist/context/sl/tools/sl-discover.tool.d.ts +52 -0
- package/dist/context/sl/tools/sl-edit-source.tool.d.ts +33 -0
- package/dist/context/sl/tools/sl-edit-source.tool.js +179 -0
- package/dist/context/sl/tools/sl-read-source.tool.d.ts +23 -0
- package/dist/context/sl/tools/sl-rollback.tool.d.ts +25 -0
- package/dist/context/sl/tools/sl-rollback.tool.js +64 -0
- package/dist/context/sl/tools/sl-validate.tool.d.ts +24 -0
- package/dist/context/sl/tools/sl-validate.tool.js +101 -0
- package/dist/context/sl/tools/sl-warehouse-validation.d.ts +32 -0
- package/dist/context/sl/tools/sl-warehouse-validation.js +246 -0
- package/dist/context/sl/tools/sl-write-source.tool.d.ts +422 -0
- package/dist/context/sl/tools/sl-write-source.tool.js +321 -0
- package/dist/context/sl/types.d.ts +141 -0
- package/dist/context/sql-analysis/ports.d.ts +34 -0
- package/dist/context/tools/base-tool.d.ts +85 -0
- package/dist/context/tools/base-tool.js +94 -0
- package/dist/context/tools/context-candidate-mark.tool.d.ts +41 -0
- package/dist/context/tools/context-candidate-write.tool.d.ts +64 -0
- package/dist/context/tools/context-candidate-write.tool.js +140 -0
- package/dist/context/tools/context-evidence-search.tool.d.ts +57 -0
- package/dist/context/tools/context-evidence-search.tool.js +97 -0
- package/dist/context/tools/context-evidence-tool-store.d.ts +113 -0
- package/dist/context/tools/tool-session.d.ts +55 -0
- package/dist/context/tools/touched-sl-sources.d.ts +13 -0
- package/dist/context/tools/touched-sl-sources.js +48 -0
- package/dist/context/wiki/keys.d.ts +10 -0
- package/dist/context/wiki/keys.js +26 -0
- package/dist/context/wiki/knowledge-wiki.service.d.ts +79 -0
- package/dist/context/wiki/knowledge-wiki.service.js +370 -0
- package/dist/context/wiki/local-knowledge.d.ts +58 -0
- package/dist/context/wiki/local-knowledge.js +290 -0
- package/dist/context/wiki/ports.d.ts +68 -0
- package/dist/context/wiki/tools/wiki-list-tags.tool.d.ts +16 -0
- package/dist/context/wiki/tools/wiki-list-tags.tool.js +34 -0
- package/dist/context/wiki/tools/wiki-read.tool.d.ts +28 -0
- package/dist/context/wiki/tools/wiki-read.tool.js +59 -0
- package/dist/context/wiki/tools/wiki-remove.tool.d.ts +28 -0
- package/dist/context/wiki/tools/wiki-remove.tool.js +86 -0
- package/dist/context/wiki/tools/wiki-search.tool.d.ts +50 -0
- package/dist/context/wiki/tools/wiki-search.tool.js +54 -0
- package/dist/context/wiki/tools/wiki-write.tool.d.ts +80 -0
- package/dist/context/wiki/tools/wiki-write.tool.js +211 -0
- package/dist/context/wiki/types.d.ts +45 -0
- package/dist/context/wiki/wiki-ref-validation.d.ts +17 -0
- package/dist/context-build-view.d.ts +4 -0
- package/dist/context-build-view.js +8 -3
- package/dist/database-tree-picker.d.ts +36 -3
- package/dist/database-tree-picker.js +92 -10
- package/dist/demo-assets.d.ts +7 -0
- package/dist/demo-assets.js +18 -0
- package/dist/demo-metrics.d.ts +5 -1
- package/dist/demo-metrics.js +4 -0
- package/dist/doctor.d.ts +2 -1
- package/dist/doctor.js +13 -3
- package/dist/embedding-resolution.d.ts +3 -2
- package/dist/embedding-resolution.js +2 -2
- package/dist/error-message.d.ts +1 -0
- package/dist/error-message.js +29 -0
- package/dist/ingest-depth.d.ts +1 -1
- package/dist/ingest-depth.js +0 -1
- package/dist/ingest-query-executor.d.ts +2 -2
- package/dist/ingest-report-file.d.ts +1 -1
- package/dist/ingest-report-file.js +1 -1
- package/dist/ingest.d.ts +5 -3
- package/dist/ingest.js +15 -7
- package/dist/io/logger.d.ts +1 -0
- package/dist/io/logger.js +1 -0
- package/dist/knowledge.d.ts +2 -2
- package/dist/knowledge.js +29 -3
- package/dist/llm/embedding-health.js +36 -0
- package/dist/llm/model-health.d.ts +19 -0
- package/dist/llm/model-provider.d.ts +21 -0
- package/dist/llm/model-provider.js +150 -0
- package/dist/llm/types.d.ts +106 -0
- package/dist/local-adapters.d.ts +4 -3
- package/dist/local-adapters.js +43 -59
- package/dist/local-scan-connectors.d.ts +2 -2
- package/dist/local-scan-connectors.js +16 -42
- package/dist/managed-local-embeddings.d.ts +1 -1
- package/dist/managed-local-embeddings.js +2 -1
- package/dist/managed-mcp-daemon.d.ts +1 -0
- package/dist/managed-python-command.d.ts +5 -2
- package/dist/managed-python-command.js +7 -1
- package/dist/managed-python-daemon.d.ts +11 -2
- package/dist/managed-python-daemon.js +29 -9
- package/dist/managed-python-http.d.ts +8 -4
- package/dist/managed-python-http.js +7 -4
- package/dist/managed-python-runtime.d.ts +6 -2
- package/dist/managed-python-runtime.js +3 -0
- package/dist/mcp-http-server.d.ts +5 -2
- package/dist/mcp-http-server.js +5 -2
- package/dist/mcp-server-factory.d.ts +1 -1
- package/dist/mcp-server-factory.js +15 -7
- package/dist/mcp-stdio-server.d.ts +2 -2
- package/dist/mcp-stdio-server.js +4 -3
- package/dist/memory-flow-hud.d.ts +1 -1
- package/dist/memory-flow-interactive.d.ts +2 -1
- package/dist/memory-flow-interactive.js +4 -1
- package/dist/memory-flow-tui.d.ts +5 -2
- package/dist/memory-flow-tui.js +4 -1
- package/dist/next-steps.d.ts +2 -1
- package/dist/next-steps.js +3 -1
- package/dist/notion-page-picker.d.ts +7 -2
- package/dist/notion-page-picker.js +6 -2
- package/dist/print-command-tree.js +2 -8
- package/dist/prompt-navigation.d.ts +1 -0
- package/dist/prompt-navigation.js +1 -0
- package/dist/public-ingest.d.ts +2 -2
- package/dist/public-ingest.js +83 -21
- package/dist/runtime-requirements.d.ts +2 -1
- package/dist/runtime-requirements.js +9 -2
- package/dist/scan.d.ts +5 -1
- package/dist/scan.js +48 -5
- package/dist/setup-agents.d.ts +8 -4
- package/dist/setup-agents.js +25 -77
- package/dist/setup-context.d.ts +8 -4
- package/dist/setup-context.js +17 -9
- package/dist/setup-database-context-depth.d.ts +2 -1
- package/dist/setup-database-context-depth.js +2 -1
- package/dist/setup-databases.d.ts +13 -14
- package/dist/setup-databases.js +344 -322
- package/dist/setup-demo-tour.d.ts +8 -3
- package/dist/setup-demo-tour.js +10 -4
- package/dist/setup-embeddings.d.ts +3 -1
- package/dist/setup-embeddings.js +15 -5
- package/dist/setup-interrupt.d.ts +1 -0
- package/dist/setup-models.d.ts +12 -9
- package/dist/setup-models.js +16 -9
- package/dist/setup-project.d.ts +5 -3
- package/dist/setup-project.js +3 -1
- package/dist/setup-prompts.d.ts +16 -0
- package/dist/setup-prompts.js +39 -1
- package/dist/setup-ready-menu.d.ts +2 -1
- package/dist/setup-runtime.d.ts +1 -1
- package/dist/setup-runtime.js +4 -2
- package/dist/setup-sources.d.ts +9 -3
- package/dist/setup-sources.js +33 -8
- package/dist/setup.d.ts +1 -1
- package/dist/setup.js +66 -7
- package/dist/skills/historic_sql_patterns/SKILL.md +89 -0
- package/dist/skills/historic_sql_table_digest/SKILL.md +88 -0
- package/dist/skills/sl/SKILL.md +247 -0
- package/dist/sl.d.ts +8 -12
- package/dist/sl.js +75 -4
- package/dist/source-mapping.d.ts +3 -2
- package/dist/source-mapping.js +13 -3
- package/dist/sql.d.ts +4 -3
- package/dist/sql.js +60 -12
- package/dist/status-project.d.ts +47 -12
- package/dist/status-project.js +357 -140
- package/dist/telemetry/command-hook.d.ts +28 -0
- package/dist/telemetry/command-hook.js +27 -0
- package/dist/telemetry/demo-detect.d.ts +2 -0
- package/dist/telemetry/demo-detect.js +9 -0
- package/dist/telemetry/emitter.d.ts +20 -0
- package/dist/telemetry/emitter.js +74 -0
- package/dist/telemetry/events.d.ts +466 -0
- package/dist/telemetry/events.js +347 -0
- package/dist/telemetry/identity.d.ts +33 -0
- package/dist/telemetry/identity.js +105 -0
- package/dist/telemetry/index.d.ts +27 -0
- package/dist/telemetry/index.js +98 -0
- package/dist/telemetry/project-snapshot.d.ts +15 -0
- package/dist/telemetry/project-snapshot.js +55 -0
- package/dist/telemetry/schema-writer.d.ts +15 -0
- package/dist/telemetry/schema-writer.js +45 -0
- package/dist/telemetry/scrubber.d.ts +1 -0
- package/dist/telemetry/scrubber.js +22 -0
- package/dist/text-ingest.d.ts +4 -2
- package/dist/text-ingest.js +2 -2
- package/dist/tree-picker-state.d.ts +8 -2
- package/dist/tree-picker-state.js +35 -13
- package/dist/tree-picker-tui.d.ts +11 -1
- package/dist/tree-picker-tui.js +26 -32
- package/dist/viz-fallback.d.ts +1 -0
- package/dist/viz-fallback.js +1 -0
- package/package.json +39 -16
- package/assets/python/kaelio_ktx-0.4.1-py3-none-any.whl +0 -0
- package/dist/admin-reindex.test.js +0 -119
- package/dist/admin.test.js +0 -201
- package/dist/cli-program.test.js +0 -49
- package/dist/cli-project.d.ts +0 -12
- package/dist/cli-project.js +0 -8
- package/dist/cli-project.test.js +0 -22
- package/dist/command-tree.test.js +0 -126
- package/dist/commands/mcp-commands.test.js +0 -111
- package/dist/commands/sql-commands.test.js +0 -68
- package/dist/connection.test.js +0 -405
- package/dist/context-build-view.test.js +0 -945
- package/dist/database-tree-picker.test.js +0 -135
- package/dist/demo-assets.test.js +0 -95
- package/dist/demo-metrics.test.js +0 -108
- package/dist/doctor.test.js +0 -603
- package/dist/embedding-resolution.test.js +0 -132
- package/dist/example-smoke.test.js +0 -83
- package/dist/index.test.js +0 -1302
- package/dist/ingest-query-executor.test.js +0 -71
- package/dist/ingest-report-file.test.js +0 -63
- package/dist/ingest-viz.test.js +0 -691
- package/dist/ingest.test-utils.d.ts +0 -119
- package/dist/ingest.test-utils.js +0 -625
- package/dist/ingest.test.js +0 -1534
- package/dist/io/logger.test.js +0 -55
- package/dist/io/mode.test.js +0 -48
- package/dist/io/print-list.test.js +0 -277
- package/dist/knowledge.test.js +0 -184
- package/dist/local-adapters.test.d.ts +0 -1
- package/dist/local-adapters.test.js +0 -162
- 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/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 -815
- package/dist/runtime-requirements.test.d.ts +0 -1
- package/dist/runtime-requirements.test.js +0 -62
- 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 -984
- 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 -490
- package/dist/setup-databases.test.d.ts +0 -1
- package/dist/setup-databases.test.js +0 -1883
- 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 -434
- 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 -880
- package/dist/setup-project.test.d.ts +0 -1
- package/dist/setup-project.test.js +0 -229
- package/dist/setup-prompts.test.d.ts +0 -1
- package/dist/setup-prompts.test.js +0 -170
- 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 -110
- 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 -107
- package/dist/setup-sources.test.d.ts +0 -1
- package/dist/setup-sources.test.js +0 -1277
- package/dist/setup.test.d.ts +0 -1
- package/dist/setup.test.js +0 -1794
- package/dist/sl.test.d.ts +0 -1
- package/dist/sl.test.js +0 -534
- 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 -226
- package/dist/standalone-smoke.test.d.ts +0 -1
- package/dist/standalone-smoke.test.js +0 -250
- package/dist/text-ingest.test.d.ts +0 -1
- package/dist/text-ingest.test.js +0 -247
- package/dist/tree-picker-state.test.d.ts +0 -1
- package/dist/tree-picker-state.test.js +0 -303
- package/dist/tree-picker-tui.test.d.ts +0 -1
- package/dist/tree-picker-tui.test.js +0 -248
- package/dist/viz-fallback.test.d.ts +0 -1
- package/dist/viz-fallback.test.js +0 -77
- package/node_modules/@ktx/connector-bigquery/dist/connector.d.ts +0 -141
- package/node_modules/@ktx/connector-bigquery/dist/connector.js +0 -371
- package/node_modules/@ktx/connector-bigquery/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-bigquery/dist/connector.test.js +0 -247
- package/node_modules/@ktx/connector-bigquery/dist/dialect.d.ts +0 -29
- package/node_modules/@ktx/connector-bigquery/dist/dialect.js +0 -178
- package/node_modules/@ktx/connector-bigquery/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-bigquery/dist/dialect.test.js +0 -36
- package/node_modules/@ktx/connector-bigquery/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-bigquery/dist/index.js +0 -3
- package/node_modules/@ktx/connector-bigquery/dist/live-database-introspection.d.ts +0 -10
- package/node_modules/@ktx/connector-bigquery/dist/live-database-introspection.js +0 -20
- package/node_modules/@ktx/connector-bigquery/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-bigquery/dist/package-exports.test.js +0 -10
- package/node_modules/@ktx/connector-bigquery/package.json +0 -20
- package/node_modules/@ktx/connector-clickhouse/dist/connector.d.ts +0 -113
- package/node_modules/@ktx/connector-clickhouse/dist/connector.js +0 -345
- package/node_modules/@ktx/connector-clickhouse/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-clickhouse/dist/connector.test.js +0 -228
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.d.ts +0 -33
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.js +0 -236
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-clickhouse/dist/dialect.test.js +0 -36
- package/node_modules/@ktx/connector-clickhouse/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-clickhouse/dist/index.js +0 -3
- package/node_modules/@ktx/connector-clickhouse/dist/live-database-introspection.d.ts +0 -11
- package/node_modules/@ktx/connector-clickhouse/dist/live-database-introspection.js +0 -21
- package/node_modules/@ktx/connector-clickhouse/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-clickhouse/dist/package-exports.test.js +0 -10
- package/node_modules/@ktx/connector-clickhouse/package.json +0 -20
- package/node_modules/@ktx/connector-mysql/dist/connector.d.ts +0 -116
- package/node_modules/@ktx/connector-mysql/dist/connector.js +0 -385
- package/node_modules/@ktx/connector-mysql/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-mysql/dist/connector.test.js +0 -218
- package/node_modules/@ktx/connector-mysql/dist/dialect.d.ts +0 -29
- package/node_modules/@ktx/connector-mysql/dist/dialect.js +0 -171
- package/node_modules/@ktx/connector-mysql/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-mysql/dist/dialect.test.js +0 -36
- package/node_modules/@ktx/connector-mysql/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-mysql/dist/index.js +0 -3
- package/node_modules/@ktx/connector-mysql/dist/live-database-introspection.d.ts +0 -11
- package/node_modules/@ktx/connector-mysql/dist/live-database-introspection.js +0 -21
- package/node_modules/@ktx/connector-mysql/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-mysql/dist/package-exports.test.js +0 -11
- package/node_modules/@ktx/connector-mysql/package.json +0 -20
- package/node_modules/@ktx/connector-postgres/dist/connector.d.ts +0 -140
- package/node_modules/@ktx/connector-postgres/dist/connector.js +0 -497
- package/node_modules/@ktx/connector-postgres/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-postgres/dist/connector.test.js +0 -336
- package/node_modules/@ktx/connector-postgres/dist/dialect.d.ts +0 -29
- package/node_modules/@ktx/connector-postgres/dist/dialect.js +0 -182
- package/node_modules/@ktx/connector-postgres/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-postgres/dist/dialect.test.js +0 -37
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.d.ts +0 -14
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.test.d.ts +0 -1
- package/node_modules/@ktx/connector-postgres/dist/historic-sql-query-client.test.js +0 -45
- package/node_modules/@ktx/connector-postgres/dist/index.d.ts +0 -4
- package/node_modules/@ktx/connector-postgres/dist/index.js +0 -4
- package/node_modules/@ktx/connector-postgres/dist/live-database-introspection.d.ts +0 -11
- package/node_modules/@ktx/connector-postgres/dist/live-database-introspection.js +0 -21
- package/node_modules/@ktx/connector-postgres/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-postgres/dist/package-exports.test.js +0 -12
- package/node_modules/@ktx/connector-postgres/package.json +0 -20
- package/node_modules/@ktx/connector-snowflake/dist/connector.d.ts +0 -129
- package/node_modules/@ktx/connector-snowflake/dist/connector.js +0 -517
- package/node_modules/@ktx/connector-snowflake/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-snowflake/dist/connector.test.js +0 -210
- package/node_modules/@ktx/connector-snowflake/dist/dialect.d.ts +0 -29
- package/node_modules/@ktx/connector-snowflake/dist/dialect.js +0 -156
- package/node_modules/@ktx/connector-snowflake/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-snowflake/dist/dialect.test.js +0 -34
- package/node_modules/@ktx/connector-snowflake/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-snowflake/dist/index.js +0 -3
- package/node_modules/@ktx/connector-snowflake/dist/live-database-introspection.d.ts +0 -11
- package/node_modules/@ktx/connector-snowflake/dist/live-database-introspection.js +0 -21
- package/node_modules/@ktx/connector-snowflake/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-snowflake/dist/package-exports.test.js +0 -10
- package/node_modules/@ktx/connector-snowflake/package.json +0 -20
- package/node_modules/@ktx/connector-sqlite/dist/connector.d.ts +0 -59
- package/node_modules/@ktx/connector-sqlite/dist/connector.js +0 -251
- package/node_modules/@ktx/connector-sqlite/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlite/dist/connector.test.js +0 -196
- package/node_modules/@ktx/connector-sqlite/dist/dialect.d.ts +0 -29
- package/node_modules/@ktx/connector-sqlite/dist/dialect.js +0 -146
- package/node_modules/@ktx/connector-sqlite/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlite/dist/dialect.test.js +0 -23
- package/node_modules/@ktx/connector-sqlite/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-sqlite/dist/index.js +0 -3
- package/node_modules/@ktx/connector-sqlite/dist/live-database-introspection.d.ts +0 -8
- package/node_modules/@ktx/connector-sqlite/dist/live-database-introspection.js +0 -20
- package/node_modules/@ktx/connector-sqlite/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlite/dist/package-exports.test.js +0 -11
- package/node_modules/@ktx/connector-sqlite/package.json +0 -20
- package/node_modules/@ktx/connector-sqlserver/dist/connector.d.ts +0 -137
- package/node_modules/@ktx/connector-sqlserver/dist/connector.js +0 -503
- package/node_modules/@ktx/connector-sqlserver/dist/connector.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlserver/dist/connector.test.js +0 -269
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.d.ts +0 -30
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.js +0 -169
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlserver/dist/dialect.test.js +0 -36
- package/node_modules/@ktx/connector-sqlserver/dist/index.d.ts +0 -3
- package/node_modules/@ktx/connector-sqlserver/dist/index.js +0 -3
- package/node_modules/@ktx/connector-sqlserver/dist/live-database-introspection.d.ts +0 -11
- package/node_modules/@ktx/connector-sqlserver/dist/live-database-introspection.js +0 -21
- package/node_modules/@ktx/connector-sqlserver/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/connector-sqlserver/dist/package-exports.test.js +0 -10
- package/node_modules/@ktx/connector-sqlserver/package.json +0 -20
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.d.ts +0 -18
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.js +0 -10
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/agent/agent-runner.service.test.js +0 -308
- package/node_modules/@ktx/context/dist/agent/index.d.ts +0 -2
- package/node_modules/@ktx/context/dist/agent/index.js +0 -1
- package/node_modules/@ktx/context/dist/connections/connection-type.d.ts +0 -25
- package/node_modules/@ktx/context/dist/connections/dialects.d.ts +0 -9
- package/node_modules/@ktx/context/dist/connections/dialects.js +0 -71
- package/node_modules/@ktx/context/dist/connections/dialects.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/dialects.test.js +0 -24
- package/node_modules/@ktx/context/dist/connections/index.d.ts +0 -11
- package/node_modules/@ktx/context/dist/connections/index.js +0 -9
- package/node_modules/@ktx/context/dist/connections/local-query-executor.js +0 -21
- package/node_modules/@ktx/context/dist/connections/local-query-executor.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/local-query-executor.test.js +0 -48
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.js +0 -72
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/local-warehouse-descriptor.test.js +0 -53
- package/node_modules/@ktx/context/dist/connections/notion-config.d.ts +0 -41
- package/node_modules/@ktx/context/dist/connections/notion-config.js +0 -132
- package/node_modules/@ktx/context/dist/connections/notion-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/notion-config.test.js +0 -121
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.js +0 -53
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/postgres-query-executor.test.js +0 -91
- package/node_modules/@ktx/context/dist/connections/query-executor.d.ts +0 -19
- package/node_modules/@ktx/context/dist/connections/read-only-sql.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/read-only-sql.test.js +0 -20
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.d.ts +0 -3
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.js +0 -73
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/connections/sqlite-query-executor.test.js +0 -113
- package/node_modules/@ktx/context/dist/core/config-reference.d.ts +0 -2
- package/node_modules/@ktx/context/dist/core/config-reference.js +0 -29
- package/node_modules/@ktx/context/dist/core/config-reference.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/config-reference.test.js +0 -27
- package/node_modules/@ktx/context/dist/core/config.d.ts +0 -25
- package/node_modules/@ktx/context/dist/core/embedding.js +0 -1
- package/node_modules/@ktx/context/dist/core/file-store.js +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.assert-worktree-clean.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.assert-worktree-clean.test.js +0 -62
- package/node_modules/@ktx/context/dist/core/git.service.delete-directories.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.delete-directories.test.js +0 -61
- package/node_modules/@ktx/context/dist/core/git.service.patch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.patch.test.js +0 -40
- package/node_modules/@ktx/context/dist/core/git.service.reset-hard.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.reset-hard.test.js +0 -47
- package/node_modules/@ktx/context/dist/core/git.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/git.service.test.js +0 -357
- package/node_modules/@ktx/context/dist/core/index.d.ts +0 -10
- package/node_modules/@ktx/context/dist/core/index.js +0 -5
- package/node_modules/@ktx/context/dist/core/redaction.d.ts +0 -4
- package/node_modules/@ktx/context/dist/core/redaction.js +0 -39
- package/node_modules/@ktx/context/dist/core/session-worktree.service.d.ts +0 -38
- package/node_modules/@ktx/context/dist/core/session-worktree.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/core/session-worktree.service.test.js +0 -97
- package/node_modules/@ktx/context/dist/daemon/index.d.ts +0 -1
- package/node_modules/@ktx/context/dist/daemon/index.js +0 -1
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.d.ts +0 -80
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.js +0 -191
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/daemon/semantic-layer-compute.test.js +0 -301
- package/node_modules/@ktx/context/dist/index-sync/index.d.ts +0 -2
- package/node_modules/@ktx/context/dist/index-sync/index.js +0 -1
- package/node_modules/@ktx/context/dist/index-sync/reindex.d.ts +0 -20
- package/node_modules/@ktx/context/dist/index-sync/reindex.js +0 -141
- package/node_modules/@ktx/context/dist/index-sync/reindex.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/index-sync/reindex.test.js +0 -139
- package/node_modules/@ktx/context/dist/index-sync/types.d.ts +0 -29
- package/node_modules/@ktx/context/dist/index.d.ts +0 -22
- package/node_modules/@ktx/context/dist/index.js +0 -19
- package/node_modules/@ktx/context/dist/index.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/index.test.js +0 -10
- package/node_modules/@ktx/context/dist/ingest/action-identity.d.ts +0 -3
- package/node_modules/@ktx/context/dist/ingest/action-identity.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/action-identity.test.js +0 -19
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/chunk.test.js +0 -30
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/dbt.adapter.test.js +0 -43
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/fetch.test.js +0 -30
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.d.ts +0 -6
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.js +0 -23
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt/parse.test.js +0 -7
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.d.ts +0 -27
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.js +0 -80
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/match-tables.test.js +0 -59
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.d.ts +0 -3
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.js +0 -28
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/merge-semantic-model-tables.test.js +0 -55
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.d.ts +0 -65
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.js +0 -432
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/parse-schema.test.js +0 -195
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.d.ts +0 -13
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.js +0 -46
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-description-updates.test.js +0 -88
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.js +0 -57
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-metadata-updates.test.js +0 -68
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.d.ts +0 -12
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.js +0 -34
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-descriptions/to-relationship-updates.test.js +0 -56
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-extraction-golden-parity.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/dbt-extraction-golden-parity.test.js +0 -392
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.js +0 -199
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/bigquery-query-history-reader.test.js +0 -121
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/buckets.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/buckets.test.js +0 -49
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk-unified.js +0 -86
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk-unified.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/chunk-unified.test.js +0 -160
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/detect.test.js +0 -48
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence-tool.d.ts +0 -41
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence-tool.js +0 -88
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence-tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence-tool.test.js +0 -67
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence.d.ts +0 -77
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence.js +0 -32
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/evidence.test.js +0 -43
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/historic-sql.adapter.test.js +0 -98
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/local-ingest-acceptance.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/local-ingest-acceptance.test.js +0 -235
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/pattern-inputs.d.ts +0 -21
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/pattern-inputs.js +0 -66
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/pattern-inputs.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/pattern-inputs.test.js +0 -68
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-reader.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/postgres-pgss-reader.test.js +0 -205
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.d.ts +0 -24
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.js +0 -320
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/projection.test.js +0 -392
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/redaction.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/redaction.test.js +0 -22
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/skill-schemas.d.ts +0 -37
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/skill-schemas.js +0 -24
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/skill-schemas.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/skill-schemas.test.js +0 -62
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/snowflake-query-history-reader.test.js +0 -117
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-unified.d.ts +0 -13
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-unified.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/stage-unified.test.js +0 -405
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/types.d.ts +0 -184
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/types.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/historic-sql/types.test.js +0 -87
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/chunk.test.js +0 -95
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.d.ts +0 -20
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.js +0 -190
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/daemon-introspection.test.js +0 -236
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.d.ts +0 -29
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.js +0 -28
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/extracted-schema.test.js +0 -129
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.js +0 -24
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/live-database.adapter.test.js +0 -55
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.d.ts +0 -65
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/manifest.test.js +0 -291
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.d.ts +0 -12
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.js +0 -105
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/stage.test.js +0 -133
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.d.ts +0 -89
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.js +0 -335
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/structural-sync.test.js +0 -416
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/types.d.ts +0 -8
- package/node_modules/@ktx/context/dist/ingest/adapters/live-database/types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/chunk.test.js +0 -142
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client-boundary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client-boundary.test.js +0 -12
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/client.test.js +0 -407
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/daemon-table-identifier-parser.test.js +0 -40
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/detect.test.js +0 -39
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/evidence-documents.test.js +0 -178
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.d.ts +0 -21
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.js +0 -22
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/factory.test.js +0 -55
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch-report.test.js +0 -71
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.d.ts +0 -31
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/fetch.test.js +0 -592
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-looker.adapter.d.ts +0 -11
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-looker.adapter.js +0 -45
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.d.ts +0 -50
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/local-runtime-store.test.js +0 -106
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/looker.adapter.test.js +0 -99
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.d.ts +0 -126
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.js +0 -303
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/mapping.test.js +0 -334
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.d.ts +0 -2
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.js +0 -20
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/reconcile.test.js +0 -22
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.d.ts +0 -6
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.js +0 -55
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/scope.test.js +0 -84
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/target-connections.test.js +0 -71
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.d.ts +0 -107
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.js +0 -236
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/tools/looker-query-to-sl.tool.test.js +0 -211
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.d.ts +0 -438
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.js +0 -198
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/looker/types.test.js +0 -260
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/chunk.test.js +0 -213
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/detect.test.js +0 -37
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.d.ts +0 -15
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.js +0 -98
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch-report.test.js +0 -82
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/fetch.test.js +0 -121
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/graph.test.js +0 -105
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/lookml.adapter.test.js +0 -49
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/parse.test.js +0 -118
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.d.ts +0 -37
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.js +0 -26
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/lookml/pull-config.test.js +0 -128
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/card-references.test.js +0 -36
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/chunk.test.js +0 -299
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-boundary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-boundary.test.js +0 -38
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.d.ts +0 -167
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client-port.test.js +0 -86
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.d.ts +0 -114
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.js +0 -671
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/client.test.js +0 -377
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/detect.test.js +0 -42
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.d.ts +0 -17
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fanout-planner.test.js +0 -44
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch-scope.test.js +0 -124
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/fetch.test.js +0 -557
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.d.ts +0 -13
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.js +0 -41
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-metabase.adapter.test.js +0 -56
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.d.ts +0 -43
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.js +0 -176
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/local-source-state-store.test.js +0 -99
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.d.ts +0 -92
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.js +0 -220
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/mapping.test.js +0 -215
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/metabase.adapter.test.js +0 -129
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.d.ts +0 -53
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.js +0 -67
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/serialize-card.test.js +0 -205
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/source-state-port.d.ts +0 -23
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/source-state-port.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.d.ts +0 -142
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.js +0 -106
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metabase/types.test.js +0 -75
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/chunk.test.js +0 -114
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.d.ts +0 -77
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.js +0 -460
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/deep-parse.test.js +0 -1139
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/detect.test.js +0 -43
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/fetch.test.js +0 -97
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/graph.test.js +0 -245
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.d.ts +0 -29
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.js +0 -136
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/import-semantic-models.test.js +0 -318
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/metricflow.adapter.test.js +0 -212
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.d.ts +0 -42
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/parse.test.js +0 -171
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.d.ts +0 -37
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.js +0 -24
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/pull-config.test.js +0 -57
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.d.ts +0 -39
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.js +0 -278
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/metricflow/semantic-models.test.js +0 -204
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/chunk.d.ts +0 -4
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/chunk.js +0 -137
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.d.ts +0 -10
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.js +0 -82
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/cluster.test.js +0 -123
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/fetch.test.js +0 -358
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/local-state-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/local-state-store.test.js +0 -29
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.d.ts +0 -10
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.js +0 -165
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/normalize.test.js +0 -64
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.d.ts +0 -74
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.js +0 -107
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion-client.test.js +0 -49
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/adapters/notion/notion.adapter.test.js +0 -315
- package/node_modules/@ktx/context/dist/ingest/artifact-gates.d.ts +0 -25
- package/node_modules/@ktx/context/dist/ingest/artifact-gates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/artifact-gates.test.js +0 -167
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/canonical-pins.test.js +0 -66
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/clustering/kmeans.test.js +0 -61
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.d.ts +0 -27
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.js +0 -234
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/candidate-dedup.service.test.js +0 -216
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.d.ts +0 -31
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.js +0 -131
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/context-candidate-carryforward.service.test.js +0 -161
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.d.ts +0 -64
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.js +0 -240
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/curator-pagination.service.test.js +0 -168
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/embedding-text.test.js +0 -10
- package/node_modules/@ktx/context/dist/ingest/context-candidates/index.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/context-candidates/index.js +0 -4
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-candidates/store.test.js +0 -67
- package/node_modules/@ktx/context/dist/ingest/context-candidates/types.d.ts +0 -103
- package/node_modules/@ktx/context/dist/ingest/context-candidates/types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.d.ts +0 -53
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.js +0 -303
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-evidence/context-evidence-index.service.test.js +0 -374
- package/node_modules/@ktx/context/dist/ingest/context-evidence/index.d.ts +0 -5
- package/node_modules/@ktx/context/dist/ingest/context-evidence/index.js +0 -2
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.d.ts +0 -89
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.js +0 -1025
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-evidence/sqlite-context-evidence-store.test.js +0 -416
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/context-evidence/store.test.js +0 -55
- package/node_modules/@ktx/context/dist/ingest/context-evidence/types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.d.ts +0 -12
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.js +0 -86
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/project-vars.test.js +0 -90
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.d.ts +0 -3
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.js +0 -62
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/dbt-shared/schema-files.test.js +0 -35
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/diff-set.service.test.js +0 -132
- package/node_modules/@ktx/context/dist/ingest/final-gate-repair.d.ts +0 -29
- package/node_modules/@ktx/context/dist/ingest/final-gate-repair.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/final-gate-repair.test.js +0 -109
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.d.ts +0 -22
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/finalization-scope.test.js +0 -114
- package/node_modules/@ktx/context/dist/ingest/index.d.ts +0 -154
- package/node_modules/@ktx/context/dist/ingest/index.js +0 -99
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.isolated-diff.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.isolated-diff.test.js +0 -1927
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.js +0 -2247
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/ingest-bundle.runner.test.js +0 -1899
- package/node_modules/@ktx/context/dist/ingest/ingest-prompts.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/ingest-prompts.test.js +0 -32
- package/node_modules/@ktx/context/dist/ingest/ingest-runtime-assets.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/ingest-runtime-assets.test.js +0 -89
- package/node_modules/@ktx/context/dist/ingest/ingest-trace.d.ts +0 -50
- package/node_modules/@ktx/context/dist/ingest/ingest-trace.js +0 -88
- package/node_modules/@ktx/context/dist/ingest/ingest-trace.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/ingest-trace.test.js +0 -76
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/git-patch.d.ts +0 -16
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/git-patch.js +0 -78
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/git-patch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/git-patch.test.js +0 -76
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/patch-integrator.d.ts +0 -58
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/patch-integrator.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/patch-integrator.test.js +0 -369
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/textual-conflict-resolver.d.ts +0 -23
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/textual-conflict-resolver.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/textual-conflict-resolver.test.js +0 -101
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/work-unit-executor.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/isolated-diff/work-unit-executor.test.js +0 -137
- package/node_modules/@ktx/context/dist/ingest/local-adapters.d.ts +0 -35
- package/node_modules/@ktx/context/dist/ingest/local-adapters.js +0 -247
- package/node_modules/@ktx/context/dist/ingest/local-adapters.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-adapters.test.js +0 -625
- package/node_modules/@ktx/context/dist/ingest/local-bundle-ingest.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-bundle-ingest.test.js +0 -794
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.d.ts +0 -34
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.js +0 -601
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-bundle-runtime.test.js +0 -225
- package/node_modules/@ktx/context/dist/ingest/local-embedding-provider.integration.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-embedding-provider.integration.test.js +0 -139
- package/node_modules/@ktx/context/dist/ingest/local-ingest.d.ts +0 -87
- package/node_modules/@ktx/context/dist/ingest/local-ingest.js +0 -297
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.d.ts +0 -2
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.js +0 -26
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-mapping-reconcile.test.js +0 -61
- package/node_modules/@ktx/context/dist/ingest/local-metabase-ingest.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-metabase-ingest.test.js +0 -227
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.d.ts +0 -53
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.js +0 -290
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/local-stage-ingest.test.js +0 -581
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance-fixtures.d.ts +0 -6
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance-fixtures.js +0 -155
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/acceptance.test.js +0 -43
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.js +0 -196
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/events.test.js +0 -319
- package/node_modules/@ktx/context/dist/ingest/memory-flow/index.d.ts +0 -6
- package/node_modules/@ktx/context/dist/ingest/memory-flow/index.js +0 -4
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.js +0 -315
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interaction.test.js +0 -264
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/interactive-render.test.js +0 -160
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/live-buffer.test.js +0 -77
- package/node_modules/@ktx/context/dist/ingest/memory-flow/package-export.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/package-export.test.js +0 -9
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/render.test.js +0 -105
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.d.ts +0 -208
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.js +0 -172
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/schema.test.js +0 -147
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/summary.test.js +0 -130
- package/node_modules/@ktx/context/dist/ingest/memory-flow/types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/view-model.test.js +0 -397
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.d.ts +0 -20
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.js +0 -44
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/memory-flow/visuals.test.js +0 -49
- package/node_modules/@ktx/context/dist/ingest/metabase-mapping.d.ts +0 -2
- package/node_modules/@ktx/context/dist/ingest/metabase-mapping.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/page-triage/index.d.ts +0 -2
- package/node_modules/@ktx/context/dist/ingest/page-triage/index.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.d.ts +0 -84
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.js +0 -318
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/page-triage/page-triage.service.test.js +0 -311
- package/node_modules/@ktx/context/dist/ingest/ports.d.ts +0 -323
- package/node_modules/@ktx/context/dist/ingest/ports.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.d.ts +0 -4
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.js +0 -16
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/raw-sources-paths.test.js +0 -18
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.d.ts +0 -34
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.js +0 -132
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/repo-fetch.test.js +0 -168
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.d.ts +0 -298
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.js +0 -212
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/report-snapshot.test.js +0 -329
- package/node_modules/@ktx/context/dist/ingest/reports.d.ts +0 -120
- package/node_modules/@ktx/context/dist/ingest/reports.js +0 -37
- package/node_modules/@ktx/context/dist/ingest/semantic-layer-target-policy.d.ts +0 -11
- package/node_modules/@ktx/context/dist/ingest/semantic-layer-target-policy.js +0 -26
- package/node_modules/@ktx/context/dist/ingest/semantic-layer-target-policy.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/semantic-layer-target-policy.test.js +0 -25
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/source-adapter-registry.test.js +0 -35
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/sqlite-bundle-ingest-store.test.js +0 -517
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/sqlite-local-ingest-store.test.js +0 -143
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.context-candidates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.context-candidates.test.js +0 -102
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.d.ts +0 -61
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/build-reconcile-context.test.js +0 -141
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.d.ts +0 -27
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.js +0 -87
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/build-wu-context.test.js +0 -196
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/stage-1-stage-raw-files.test.js +0 -54
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.d.ts +0 -48
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.js +0 -108
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/stage-3-work-units.test.js +0 -175
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.d.ts +0 -28
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/stage-4-reconciliation.test.js +0 -144
- package/node_modules/@ktx/context/dist/ingest/stages/stage-index.types.d.ts +0 -50
- package/node_modules/@ktx/context/dist/ingest/stages/stage-index.types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/stages/validate-wu-sources.test.js +0 -27
- package/node_modules/@ktx/context/dist/ingest/tools/emit-reconciliation-records.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/emit-reconciliation-records.tool.test.js +0 -237
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/eviction-list.tool.test.js +0 -44
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-file.tool.test.js +0 -45
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/read-raw-span.tool.test.js +0 -34
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/stage-diff.tool.test.js +0 -112
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/stage-list.tool.test.js +0 -58
- package/node_modules/@ktx/context/dist/ingest/tools/tool-call-logger.d.ts +0 -33
- package/node_modules/@ktx/context/dist/ingest/tools/tool-transcript-summary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/tool-transcript-summary.test.js +0 -141
- package/node_modules/@ktx/context/dist/ingest/tools/verification-ledger.tool.d.ts +0 -14
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/discover-data.tool.d.ts +0 -36
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/discover-data.tool.js +0 -94
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/discover-data.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/discover-data.tool.test.js +0 -107
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/entity-details.tool.d.ts +0 -43
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/entity-details.tool.js +0 -137
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/entity-details.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/entity-details.tool.test.js +0 -146
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/index.d.ts +0 -9
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/sql-execution.tool.d.ts +0 -31
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/sql-execution.tool.js +0 -84
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/sql-execution.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/sql-execution.tool.test.js +0 -50
- package/node_modules/@ktx/context/dist/ingest/types.d.ts +0 -201
- package/node_modules/@ktx/context/dist/ingest/types.js +0 -1
- package/node_modules/@ktx/context/dist/ingest/wiki-body-refs.d.ts +0 -24
- package/node_modules/@ktx/context/dist/ingest/wiki-body-refs.js +0 -111
- package/node_modules/@ktx/context/dist/ingest/wiki-body-refs.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/wiki-body-refs.test.js +0 -138
- package/node_modules/@ktx/context/dist/ingest/wiki-sl-ref-repair.d.ts +0 -19
- package/node_modules/@ktx/context/dist/ingest/wiki-sl-ref-repair.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/ingest/wiki-sl-ref-repair.test.js +0 -81
- package/node_modules/@ktx/context/dist/llm/ai-sdk-runtime.d.ts +0 -23
- package/node_modules/@ktx/context/dist/llm/ai-sdk-runtime.js +0 -133
- package/node_modules/@ktx/context/dist/llm/claude-code-env.d.ts +0 -2
- package/node_modules/@ktx/context/dist/llm/claude-code-env.js +0 -21
- package/node_modules/@ktx/context/dist/llm/claude-code-env.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/claude-code-env.test.js +0 -17
- package/node_modules/@ktx/context/dist/llm/claude-code-models.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/claude-code-models.test.js +0 -15
- package/node_modules/@ktx/context/dist/llm/claude-code-runtime.d.ts +0 -36
- package/node_modules/@ktx/context/dist/llm/claude-code-runtime.js +0 -269
- package/node_modules/@ktx/context/dist/llm/claude-code-runtime.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/claude-code-runtime.test.js +0 -428
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.d.ts +0 -44
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.js +0 -79
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/debug-request-recorder.test.js +0 -112
- package/node_modules/@ktx/context/dist/llm/embedding-port.d.ts +0 -17
- package/node_modules/@ktx/context/dist/llm/embedding-port.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/embedding-port.test.js +0 -34
- package/node_modules/@ktx/context/dist/llm/generation.d.ts +0 -8
- package/node_modules/@ktx/context/dist/llm/generation.js +0 -6
- package/node_modules/@ktx/context/dist/llm/index.d.ts +0 -13
- package/node_modules/@ktx/context/dist/llm/index.js +0 -10
- package/node_modules/@ktx/context/dist/llm/local-config.d.ts +0 -20
- package/node_modules/@ktx/context/dist/llm/local-config.js +0 -133
- package/node_modules/@ktx/context/dist/llm/local-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/local-config.test.js +0 -164
- package/node_modules/@ktx/context/dist/llm/runtime-local-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/runtime-local-config.test.js +0 -17
- package/node_modules/@ktx/context/dist/llm/runtime-port.d.ts +0 -59
- package/node_modules/@ktx/context/dist/llm/runtime-tools.d.ts +0 -10
- package/node_modules/@ktx/context/dist/llm/runtime-tools.js +0 -68
- package/node_modules/@ktx/context/dist/llm/runtime-tools.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/llm/runtime-tools.test.js +0 -36
- package/node_modules/@ktx/context/dist/mcp/context-tools.d.ts +0 -9
- package/node_modules/@ktx/context/dist/mcp/context-tools.js +0 -553
- package/node_modules/@ktx/context/dist/mcp/index.d.ts +0 -5
- package/node_modules/@ktx/context/dist/mcp/index.js +0 -3
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.d.ts +0 -16
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.js +0 -201
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/mcp/local-project-ports.test.js +0 -689
- package/node_modules/@ktx/context/dist/mcp/server.d.ts +0 -7
- package/node_modules/@ktx/context/dist/mcp/server.js +0 -24
- package/node_modules/@ktx/context/dist/mcp/server.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/mcp/server.test.js +0 -858
- package/node_modules/@ktx/context/dist/mcp/types.d.ts +0 -158
- package/node_modules/@ktx/context/dist/mcp/types.js +0 -1
- package/node_modules/@ktx/context/dist/memory/capture-signals.d.ts +0 -8
- package/node_modules/@ktx/context/dist/memory/capture-signals.js +0 -103
- package/node_modules/@ktx/context/dist/memory/index.d.ts +0 -6
- package/node_modules/@ktx/context/dist/memory/index.js +0 -5
- package/node_modules/@ktx/context/dist/memory/local-memory.d.ts +0 -22
- package/node_modules/@ktx/context/dist/memory/local-memory.js +0 -391
- package/node_modules/@ktx/context/dist/memory/local-memory.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/memory/local-memory.test.js +0 -159
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.d.ts +0 -59
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.ingest.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.ingest.test.js +0 -355
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.js +0 -539
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/memory/memory-agent.service.test.js +0 -413
- package/node_modules/@ktx/context/dist/memory/memory-runs.d.ts +0 -54
- package/node_modules/@ktx/context/dist/memory/memory-runs.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/memory/memory-runs.test.js +0 -158
- package/node_modules/@ktx/context/dist/memory/memory-runtime-assets.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/memory/memory-runtime-assets.test.js +0 -162
- package/node_modules/@ktx/context/dist/memory/types.d.ts +0 -133
- package/node_modules/@ktx/context/dist/memory/types.js +0 -1
- package/node_modules/@ktx/context/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/package-exports.test.js +0 -248
- package/node_modules/@ktx/context/dist/project/config.d.ts +0 -579
- package/node_modules/@ktx/context/dist/project/config.js +0 -331
- package/node_modules/@ktx/context/dist/project/config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/config.test.js +0 -464
- package/node_modules/@ktx/context/dist/project/driver-schemas.d.ts +0 -106
- package/node_modules/@ktx/context/dist/project/driver-schemas.js +0 -184
- package/node_modules/@ktx/context/dist/project/driver-schemas.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/driver-schemas.test.js +0 -125
- package/node_modules/@ktx/context/dist/project/index.d.ts +0 -12
- package/node_modules/@ktx/context/dist/project/index.js +0 -6
- package/node_modules/@ktx/context/dist/project/local-git-file-store.d.ts +0 -23
- package/node_modules/@ktx/context/dist/project/local-git-file-store.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/local-git-file-store.test.js +0 -71
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.d.ts +0 -58
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.js +0 -109
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/mappings-yaml-schema.test.js +0 -79
- package/node_modules/@ktx/context/dist/project/project.d.ts +0 -29
- package/node_modules/@ktx/context/dist/project/project.js +0 -93
- package/node_modules/@ktx/context/dist/project/project.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/project.test.js +0 -55
- package/node_modules/@ktx/context/dist/project/setup-config.d.ts +0 -12
- package/node_modules/@ktx/context/dist/project/setup-config.js +0 -79
- package/node_modules/@ktx/context/dist/project/setup-config.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/project/setup-config.test.js +0 -38
- package/node_modules/@ktx/context/dist/prompts/index.d.ts +0 -2
- package/node_modules/@ktx/context/dist/prompts/index.js +0 -1
- package/node_modules/@ktx/context/dist/prompts/prompt.service.d.ts +0 -28
- package/node_modules/@ktx/context/dist/prompts/prompt.service.js +0 -84
- package/node_modules/@ktx/context/dist/prompts/prompt.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/prompts/prompt.service.test.js +0 -43
- package/node_modules/@ktx/context/dist/scan/credentials.d.ts +0 -8
- package/node_modules/@ktx/context/dist/scan/credentials.js +0 -38
- package/node_modules/@ktx/context/dist/scan/credentials.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/credentials.test.js +0 -161
- package/node_modules/@ktx/context/dist/scan/data-dictionary.d.ts +0 -22
- package/node_modules/@ktx/context/dist/scan/data-dictionary.js +0 -66
- package/node_modules/@ktx/context/dist/scan/data-dictionary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/data-dictionary.test.js +0 -92
- package/node_modules/@ktx/context/dist/scan/description-generation.d.ts +0 -122
- package/node_modules/@ktx/context/dist/scan/description-generation.js +0 -556
- package/node_modules/@ktx/context/dist/scan/description-generation.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/description-generation.test.js +0 -587
- package/node_modules/@ktx/context/dist/scan/embedding-text.d.ts +0 -21
- package/node_modules/@ktx/context/dist/scan/embedding-text.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/embedding-text.test.js +0 -36
- package/node_modules/@ktx/context/dist/scan/enabled-tables.d.ts +0 -3
- package/node_modules/@ktx/context/dist/scan/enabled-tables.js +0 -15
- package/node_modules/@ktx/context/dist/scan/enrichment-state.d.ts +0 -48
- package/node_modules/@ktx/context/dist/scan/enrichment-state.js +0 -44
- package/node_modules/@ktx/context/dist/scan/enrichment-state.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/enrichment-state.test.js +0 -147
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/enrichment-summary.test.js +0 -34
- package/node_modules/@ktx/context/dist/scan/enrichment-types.d.ts +0 -104
- package/node_modules/@ktx/context/dist/scan/enrichment-types.js +0 -1
- package/node_modules/@ktx/context/dist/scan/enrichment-types.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/enrichment-types.test.js +0 -141
- package/node_modules/@ktx/context/dist/scan/entity-details.d.ts +0 -57
- package/node_modules/@ktx/context/dist/scan/entity-details.js +0 -216
- package/node_modules/@ktx/context/dist/scan/entity-details.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/entity-details.test.js +0 -234
- package/node_modules/@ktx/context/dist/scan/index.d.ts +0 -72
- package/node_modules/@ktx/context/dist/scan/index.js +0 -37
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.d.ts +0 -32
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.js +0 -274
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/local-enrichment-artifacts.test.js +0 -767
- package/node_modules/@ktx/context/dist/scan/local-enrichment.d.ts +0 -45
- package/node_modules/@ktx/context/dist/scan/local-enrichment.js +0 -478
- package/node_modules/@ktx/context/dist/scan/local-enrichment.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/local-enrichment.test.js +0 -773
- package/node_modules/@ktx/context/dist/scan/local-scan.d.ts +0 -68
- package/node_modules/@ktx/context/dist/scan/local-scan.js +0 -415
- package/node_modules/@ktx/context/dist/scan/local-scan.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/local-scan.test.js +0 -1398
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.d.ts +0 -10
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.js +0 -86
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/local-structural-artifacts.test.js +0 -144
- package/node_modules/@ktx/context/dist/scan/orchestrator.d.ts +0 -44
- package/node_modules/@ktx/context/dist/scan/orchestrator.js +0 -186
- package/node_modules/@ktx/context/dist/scan/orchestrator.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/orchestrator.test.js +0 -335
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.d.ts +0 -20
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.js +0 -45
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-artifacts.test.js +0 -268
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-benchmark-report.test.js +0 -389
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.d.ts +0 -148
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.js +0 -646
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-benchmarks.test.js +0 -1072
- package/node_modules/@ktx/context/dist/scan/relationship-budget.d.ts +0 -19
- package/node_modules/@ktx/context/dist/scan/relationship-budget.js +0 -34
- package/node_modules/@ktx/context/dist/scan/relationship-budget.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-budget.test.js +0 -71
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.d.ts +0 -49
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.js +0 -556
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-candidates.test.js +0 -747
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.d.ts +0 -66
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.js +0 -422
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-composite-candidates.test.js +0 -69
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.d.ts +0 -94
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.js +0 -224
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-diagnostics.test.js +0 -333
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.d.ts +0 -27
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.js +0 -247
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-discovery.test.js +0 -618
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.d.ts +0 -70
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.js +0 -170
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-calibration.test.js +0 -175
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.d.ts +0 -54
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.js +0 -96
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-feedback-export.test.js +0 -241
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-formal-metadata.test.js +0 -125
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.d.ts +0 -48
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-graph-resolver.test.js +0 -604
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.d.ts +0 -25
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.js +0 -193
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-llm-proposal.test.js +0 -197
- package/node_modules/@ktx/context/dist/scan/relationship-locality.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-locality.test.js +0 -128
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.d.ts +0 -13
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.js +0 -123
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-name-similarity.test.js +0 -68
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.d.ts +0 -55
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.js +0 -321
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-profiling.test.js +0 -313
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.d.ts +0 -34
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.js +0 -152
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-review-apply.test.js +0 -321
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.d.ts +0 -46
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.js +0 -92
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-review-decisions.test.js +0 -312
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.d.ts +0 -29
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.js +0 -95
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-scoring.test.js +0 -86
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.d.ts +0 -60
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.js +0 -190
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-threshold-advice.test.js +0 -205
- package/node_modules/@ktx/context/dist/scan/relationship-validation.d.ts +0 -44
- package/node_modules/@ktx/context/dist/scan/relationship-validation.js +0 -240
- package/node_modules/@ktx/context/dist/scan/relationship-validation.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/relationship-validation.test.js +0 -450
- package/node_modules/@ktx/context/dist/scan/type-normalization.d.ts +0 -8
- package/node_modules/@ktx/context/dist/scan/type-normalization.js +0 -23
- package/node_modules/@ktx/context/dist/scan/type-normalization.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/type-normalization.test.js +0 -21
- package/node_modules/@ktx/context/dist/scan/types.d.ts +0 -309
- package/node_modules/@ktx/context/dist/scan/types.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/types.test.js +0 -206
- package/node_modules/@ktx/context/dist/scan/warehouse-catalog.d.ts +0 -69
- package/node_modules/@ktx/context/dist/scan/warehouse-catalog.js +0 -311
- package/node_modules/@ktx/context/dist/scan/warehouse-catalog.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/scan/warehouse-catalog.test.js +0 -158
- package/node_modules/@ktx/context/dist/search/backend-conformance.d.ts +0 -39
- package/node_modules/@ktx/context/dist/search/backend-conformance.js +0 -88
- package/node_modules/@ktx/context/dist/search/backend-conformance.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/backend-conformance.test.js +0 -408
- package/node_modules/@ktx/context/dist/search/discover.d.ts +0 -30
- package/node_modules/@ktx/context/dist/search/discover.js +0 -340
- package/node_modules/@ktx/context/dist/search/discover.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/discover.test.js +0 -197
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/hybrid-search-core.test.js +0 -113
- package/node_modules/@ktx/context/dist/search/index.d.ts +0 -8
- package/node_modules/@ktx/context/dist/search/index.js +0 -5
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.d.ts +0 -27
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.js +0 -89
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/pglite-owner-process.test.js +0 -286
- package/node_modules/@ktx/context/dist/search/pglite-runtime-boundary.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/pglite-runtime-boundary.test.js +0 -48
- package/node_modules/@ktx/context/dist/search/pglite-spike.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/pglite-spike.test.js +0 -249
- package/node_modules/@ktx/context/dist/search/query.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/query.test.js +0 -23
- package/node_modules/@ktx/context/dist/search/rrf.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/search/rrf.test.js +0 -47
- package/node_modules/@ktx/context/dist/search/types.d.ts +0 -73
- package/node_modules/@ktx/context/dist/search/types.js +0 -1
- package/node_modules/@ktx/context/dist/skills/index.d.ts +0 -2
- package/node_modules/@ktx/context/dist/skills/index.js +0 -1
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.d.ts +0 -35
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.js +0 -215
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/skills/skills-registry.service.test.js +0 -161
- package/node_modules/@ktx/context/dist/sl/dictionary-search.d.ts +0 -42
- package/node_modules/@ktx/context/dist/sl/dictionary-search.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/dictionary-search.test.js +0 -204
- package/node_modules/@ktx/context/dist/sl/index.d.ts +0 -15
- package/node_modules/@ktx/context/dist/sl/index.js +0 -10
- package/node_modules/@ktx/context/dist/sl/local-query.d.ts +0 -19
- package/node_modules/@ktx/context/dist/sl/local-query.js +0 -118
- package/node_modules/@ktx/context/dist/sl/local-query.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/local-query.test.js +0 -283
- package/node_modules/@ktx/context/dist/sl/local-sl.d.ts +0 -60
- package/node_modules/@ktx/context/dist/sl/local-sl.js +0 -484
- package/node_modules/@ktx/context/dist/sl/local-sl.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/local-sl.test.js +0 -334
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.d.ts +0 -16
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.js +0 -433
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/pglite-sl-search-prototype.test.js +0 -240
- package/node_modules/@ktx/context/dist/sl/ports.js +0 -1
- package/node_modules/@ktx/context/dist/sl/schemas.contract.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/schemas.contract.test.js +0 -62
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.d.ts +0 -214
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.js +0 -1334
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/semantic-layer.service.test.js +0 -1084
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.d.ts +0 -9
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.js +0 -80
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/sl-dictionary-profile.test.js +0 -88
- package/node_modules/@ktx/context/dist/sl/sl-search.service.d.ts +0 -18
- package/node_modules/@ktx/context/dist/sl/sl-search.service.js +0 -158
- package/node_modules/@ktx/context/dist/sl/sl-search.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/sl-search.service.test.js +0 -256
- package/node_modules/@ktx/context/dist/sl/sl-validator.port.d.ts +0 -7
- package/node_modules/@ktx/context/dist/sl/sl-validator.port.js +0 -1
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/sqlite-sl-sources-index.test.js +0 -175
- package/node_modules/@ktx/context/dist/sl/tools/base-semantic-layer.tool.d.ts +0 -45
- package/node_modules/@ktx/context/dist/sl/tools/base-semantic-layer.tool.js +0 -91
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/connection-id-schema.test.js +0 -14
- package/node_modules/@ktx/context/dist/sl/tools/index.d.ts +0 -11
- package/node_modules/@ktx/context/dist/sl/tools/index.js +0 -8
- package/node_modules/@ktx/context/dist/sl/tools/sl-discover.tool.d.ts +0 -52
- package/node_modules/@ktx/context/dist/sl/tools/sl-discover.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-discover.tool.test.js +0 -72
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.d.ts +0 -33
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.js +0 -177
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-edit-source.tool.test.js +0 -184
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.d.ts +0 -23
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.session.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-read-source.tool.session.test.js +0 -55
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.d.ts +0 -25
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.js +0 -63
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-rollback.tool.test.js +0 -57
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.d.ts +0 -23
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.js +0 -100
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-validate.tool.test.js +0 -54
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.d.ts +0 -29
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.js +0 -245
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-warehouse-validation.test.js +0 -136
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.d.ts +0 -422
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.js +0 -319
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sl/tools/sl-write-source.tool.test.js +0 -307
- package/node_modules/@ktx/context/dist/sl/types.d.ts +0 -147
- package/node_modules/@ktx/context/dist/sl/types.js +0 -1
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/sql-analysis/http-sql-analysis-port.test.js +0 -147
- package/node_modules/@ktx/context/dist/sql-analysis/index.d.ts +0 -3
- package/node_modules/@ktx/context/dist/sql-analysis/index.js +0 -1
- package/node_modules/@ktx/context/dist/sql-analysis/ports.d.ts +0 -33
- package/node_modules/@ktx/context/dist/sql-analysis/ports.js +0 -1
- package/node_modules/@ktx/context/dist/test/make-local-git-repo.d.ts +0 -10
- package/node_modules/@ktx/context/dist/test/make-local-git-repo.js +0 -34
- package/node_modules/@ktx/context/dist/tools/base-tool.d.ts +0 -85
- package/node_modules/@ktx/context/dist/tools/base-tool.js +0 -94
- package/node_modules/@ktx/context/dist/tools/context-candidate-mark.tool.d.ts +0 -41
- package/node_modules/@ktx/context/dist/tools/context-candidate-write.tool.d.ts +0 -64
- package/node_modules/@ktx/context/dist/tools/context-candidate-write.tool.js +0 -140
- package/node_modules/@ktx/context/dist/tools/context-evidence-search.tool.d.ts +0 -57
- package/node_modules/@ktx/context/dist/tools/context-evidence-search.tool.js +0 -92
- package/node_modules/@ktx/context/dist/tools/context-evidence-tool-store.d.ts +0 -112
- package/node_modules/@ktx/context/dist/tools/context-evidence-tool-store.js +0 -1
- package/node_modules/@ktx/context/dist/tools/context-evidence-tools.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/tools/context-evidence-tools.test.js +0 -486
- package/node_modules/@ktx/context/dist/tools/index.d.ts +0 -19
- package/node_modules/@ktx/context/dist/tools/index.js +0 -12
- package/node_modules/@ktx/context/dist/tools/tool-session.d.ts +0 -54
- package/node_modules/@ktx/context/dist/tools/tool-session.js +0 -1
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.d.ts +0 -12
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.js +0 -47
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/tools/touched-sl-sources.test.js +0 -31
- package/node_modules/@ktx/context/dist/wiki/index.d.ts +0 -9
- package/node_modules/@ktx/context/dist/wiki/index.js +0 -6
- package/node_modules/@ktx/context/dist/wiki/keys.d.ts +0 -11
- package/node_modules/@ktx/context/dist/wiki/keys.js +0 -26
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.d.ts +0 -77
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.js +0 -357
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/knowledge-wiki.service.test.js +0 -190
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.d.ts +0 -55
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.js +0 -289
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/local-knowledge.test.js +0 -270
- package/node_modules/@ktx/context/dist/wiki/ports.d.ts +0 -70
- package/node_modules/@ktx/context/dist/wiki/ports.js +0 -1
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/sqlite-knowledge-index.test.js +0 -129
- package/node_modules/@ktx/context/dist/wiki/tools/index.d.ts +0 -5
- package/node_modules/@ktx/context/dist/wiki/tools/index.js +0 -5
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.d.ts +0 -16
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.js +0 -34
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-list-tags.tool.test.js +0 -35
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.d.ts +0 -28
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.js +0 -59
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-read.tool.test.js +0 -66
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.d.ts +0 -28
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.js +0 -85
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-remove.tool.test.js +0 -95
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.d.ts +0 -49
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.js +0 -51
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-search.tool.test.js +0 -35
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.d.ts +0 -80
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.js +0 -210
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/tools/wiki-write.tool.test.js +0 -264
- package/node_modules/@ktx/context/dist/wiki/types.d.ts +0 -50
- package/node_modules/@ktx/context/dist/wiki/types.js +0 -1
- package/node_modules/@ktx/context/dist/wiki/wiki-ref-validation.d.ts +0 -17
- package/node_modules/@ktx/context/dist/wiki/wiki-ref-validation.test.d.ts +0 -1
- package/node_modules/@ktx/context/dist/wiki/wiki-ref-validation.test.js +0 -64
- package/node_modules/@ktx/context/package.json +0 -122
- package/node_modules/@ktx/context/skills/historic_sql_patterns/SKILL.md +0 -91
- package/node_modules/@ktx/context/skills/historic_sql_table_digest/SKILL.md +0 -89
- package/node_modules/@ktx/context/skills/sl/SKILL.md +0 -247
- package/node_modules/@ktx/llm/dist/embedding-health.js +0 -36
- package/node_modules/@ktx/llm/dist/embedding-health.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/embedding-health.test.js +0 -72
- package/node_modules/@ktx/llm/dist/embedding-provider.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/embedding-provider.test.js +0 -84
- package/node_modules/@ktx/llm/dist/index.d.ts +0 -11
- package/node_modules/@ktx/llm/dist/index.js +0 -6
- package/node_modules/@ktx/llm/dist/message-builder.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/message-builder.test.js +0 -127
- package/node_modules/@ktx/llm/dist/model-health.d.ts +0 -18
- package/node_modules/@ktx/llm/dist/model-health.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/model-health.test.js +0 -55
- package/node_modules/@ktx/llm/dist/model-provider.d.ts +0 -22
- package/node_modules/@ktx/llm/dist/model-provider.js +0 -150
- package/node_modules/@ktx/llm/dist/model-provider.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/model-provider.test.js +0 -246
- package/node_modules/@ktx/llm/dist/package-exports.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/package-exports.test.js +0 -17
- package/node_modules/@ktx/llm/dist/repair.test.d.ts +0 -1
- package/node_modules/@ktx/llm/dist/repair.test.js +0 -78
- package/node_modules/@ktx/llm/dist/types.d.ts +0 -105
- package/node_modules/@ktx/llm/package.json +0 -20
- /package/{node_modules/@ktx/connector-postgres/dist → dist/connectors/postgres}/historic-sql-query-client.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/connection-type.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/local-query-executor.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/local-warehouse-descriptor.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/postgres-query-executor.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/query-executor.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/read-only-sql.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/connections/read-only-sql.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/config.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/embedding.d.ts +0 -0
- /package/dist/{admin-reindex.test.d.ts → context/core/embedding.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/file-store.d.ts +0 -0
- /package/dist/{admin.test.d.ts → context/core/file-store.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/git-env.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/git-env.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/git.service.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/git.service.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/core/session-worktree.service.js +0 -0
- /package/dist/{cli-program.test.d.ts → context/index-sync/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/action-identity.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/dbt.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/dbt.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/fetch.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/dbt/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/fake/fake.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/fake/fake.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/bigquery-query-history-reader.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/buckets.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/buckets.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/chunk-unified.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/errors.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/errors.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/historic-sql.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/historic-sql.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/postgres-pgss-reader.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/postgres-pgss-reader.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/redaction.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/redaction.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/snowflake-query-history-reader.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/snowflake-query-history-reader.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/stage-unified.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/historic-sql/types.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/live-database/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/live-database/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/live-database/live-database.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/live-database/manifest.js +0 -0
- /package/dist/{cli-project.test.d.ts → context/ingest/adapters/live-database/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/client.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/client.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/daemon-table-identifier-parser.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/daemon-table-identifier-parser.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/evidence-documents.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/evidence-documents.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/fetch-report.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/fetch-report.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/local-runtime-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/looker.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/looker.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/target-connections.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/looker/target-connections.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/fetch.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/graph.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/graph.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/lookml.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/lookml.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/parse.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/lookml/parse.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/card-references.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/card-references.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/client-port.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/fanout-planner.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/fetch-scope.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/fetch-scope.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/fetch.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/metabase.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metabase/metabase.adapter.js +0 -0
- /package/dist/{command-tree.test.d.ts → context/ingest/adapters/metabase/source-state-port.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/chunk.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/chunk.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/fetch.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/graph.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/graph.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/metricflow.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/metricflow.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/parse.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/projection-config.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/metricflow/projection-config.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/detect.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/detect.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/fetch.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/fetch.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/local-state-store.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/local-state-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/notion.adapter.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/notion.adapter.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/pull-config.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/pull-config.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/types.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/adapters/notion/types.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/artifact-gates.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/canonical-pins.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/canonical-pins.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/clustering/kmeans.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/clustering/kmeans.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/context-candidates/embedding-text.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/context-candidates/embedding-text.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/context-candidates/store.d.ts +0 -0
- /package/dist/{commands/mcp-commands.test.d.ts → context/ingest/context-candidates/store.js} +0 -0
- /package/dist/{commands/sql-commands.test.d.ts → context/ingest/context-candidates/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/context-evidence/store.d.ts +0 -0
- /package/dist/{connection.test.d.ts → context/ingest/context-evidence/store.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/context-evidence/types.d.ts +0 -0
- /package/dist/{context-build-view.test.d.ts → context/ingest/context-evidence/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/diff-set.service.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/diff-set.service.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/final-gate-repair.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/finalization-scope.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/git-env.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/git-env.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/ingest-bundle.runner.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/isolated-diff/patch-integrator.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/isolated-diff/textual-conflict-resolver.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/isolated-diff/work-unit-executor.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/isolated-diff/work-unit-executor.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/interactive-render.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/interactive-render.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/known-errors.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/known-errors.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/live-buffer.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/live-buffer.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/render.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/render.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/summary.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/summary.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/types.d.ts +0 -0
- /package/dist/{database-tree-picker.test.d.ts → context/ingest/memory-flow/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/view-model.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/memory-flow/view-model.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/parsed-target-table.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/parsed-target-table.js +0 -0
- /package/dist/{demo-assets.test.d.ts → context/ingest/ports.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/source-adapter-registry.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/source-adapter-registry.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/sqlite-bundle-ingest-store.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/sqlite-bundle-ingest-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/sqlite-local-ingest-store.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/sqlite-local-ingest-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/stages/build-reconcile-context.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/stages/stage-1-stage-raw-files.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/stages/stage-1-stage-raw-files.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/stages/stage-4-reconciliation.js +0 -0
- /package/dist/{demo-metrics.test.d.ts → context/ingest/stages/stage-index.types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/stages/validate-wu-sources.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-artifact-resolution.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-artifact-resolution.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-conflict-resolution.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-conflict-resolution.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-eviction-decision.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-eviction-decision.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-unmapped-fallback.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/emit-unmapped-fallback.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/eviction-list.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/eviction-list.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/read-raw-file.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/read-raw-file.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/read-raw-span.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/read-raw-span.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/stage-diff.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/stage-diff.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/stage-list.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/stage-list.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/tool-call-logger.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/tool-transcript-summary.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/tool-transcript-summary.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/tools/verification-ledger.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist/ingest/tools/warehouse-verification/index.js → dist/context/ingest/tools/warehouse-verification/create-warehouse-verification-tools.js} +0 -0
- /package/{node_modules/@ktx/context/dist/index-sync → dist/context/ingest}/types.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/ingest/wiki-sl-ref-repair.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/llm/claude-code-models.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/llm/claude-code-models.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/llm/embedding-port.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/llm/runtime-port.js +0 -0
- /package/dist/{doctor.test.d.ts → context/mcp/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/memory/local-memory-runs.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/memory/local-memory-runs.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/memory/memory-runs.js +0 -0
- /package/dist/{embedding-resolution.test.d.ts → context/memory/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/project/local-git-file-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/project/local-state-db.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/project/local-state-db.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/embedding-text.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/enrichment-summary.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/enrichment-summary.js +0 -0
- /package/dist/{example-smoke.test.d.ts → context/scan/enrichment-types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-benchmark-report.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-benchmark-report.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-formal-metadata.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-formal-metadata.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-graph-resolver.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-locality.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/relationship-locality.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/sqlite-local-enrichment-state-store.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/sqlite-local-enrichment-state-store.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/scan/types.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/hybrid-search-core.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/hybrid-search-core.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/query.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/query.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/rrf.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/search/rrf.js +0 -0
- /package/dist/{index.test.d.ts → context/search/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/description-normalization.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/description-normalization.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/descriptions.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/descriptions.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/dictionary-search.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/ports.d.ts +0 -0
- /package/dist/{ingest-query-executor.test.d.ts → context/sl/ports.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/schemas.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/schemas.js +0 -0
- /package/dist/{ingest-report-file.test.d.ts → context/sl/sl-validator.port.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/sqlite-sl-sources-index.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/sqlite-sl-sources-index.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/tools/connection-id-schema.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/tools/connection-id-schema.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/tools/sl-discover.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sl/tools/sl-read-source.tool.js +0 -0
- /package/dist/{ingest-viz.test.d.ts → context/sl/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sql-analysis/http-sql-analysis-port.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/sql-analysis/http-sql-analysis-port.js +0 -0
- /package/dist/{ingest.test.d.ts → context/sql-analysis/ports.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/action-raw-paths.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/action-raw-paths.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/action-target-connection.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/action-target-connection.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/authors.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/authors.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-candidate-mark.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-ids.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-ids.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-neighbors.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-neighbors.tool.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-read.tool.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-evidence-read.tool.js +0 -0
- /package/dist/{io/logger.test.d.ts → context/tools/context-evidence-tool-store.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-ingest-metadata.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/context-ingest-metadata.js +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/sql-edit-replacer.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/tools/sql-edit-replacer.js +0 -0
- /package/dist/{io/mode.test.d.ts → context/tools/tool-session.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/wiki/knowledge-search-text.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/wiki/knowledge-search-text.js +0 -0
- /package/dist/{io/print-list.test.d.ts → context/wiki/ports.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/wiki/sqlite-knowledge-index.d.ts +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/wiki/sqlite-knowledge-index.js +0 -0
- /package/dist/{knowledge.test.d.ts → context/wiki/types.js} +0 -0
- /package/{node_modules/@ktx/context/dist → dist/context}/wiki/wiki-ref-validation.js +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/embedding-health.d.ts +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/embedding-provider.d.ts +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/embedding-provider.js +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/message-builder.d.ts +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/message-builder.js +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/model-health.js +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/repair.d.ts +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/repair.js +0 -0
- /package/{node_modules/@ktx/llm/dist → dist/llm}/types.js +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/memory_agent_backfill.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/memory_agent_bundle_ingest_reconcile.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/memory_agent_bundle_ingest_work_unit.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/memory_agent_external_ingest.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/memory_agent_research.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/skills/light_extraction.md +0 -0
- /package/{node_modules/@ktx/context → dist}/prompts/skills/page_triage_classifier.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/_shared/identifier-verification.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/dbt_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/ingest_triage/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/live_database_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/looker_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/lookml_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/metabase_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/metricflow_ingest/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/notion_synthesize/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/sl_capture/SKILL.md +0 -0
- /package/{node_modules/@ktx/context → dist}/skills/wiki_capture/SKILL.md +0 -0
|
@@ -1,2247 +0,0 @@
|
|
|
1
|
-
import { cp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import pLimit from 'p-limit';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { noopLogger } from '../core/index.js';
|
|
6
|
-
import { createRuntimeToolDescriptorFromAiTool } from '../llm/index.js';
|
|
7
|
-
import { createTouchedSlSources } from '../tools/index.js';
|
|
8
|
-
import { findDanglingWikiRefsForActions } from '../wiki/wiki-ref-validation.js';
|
|
9
|
-
import { actionTargetConnectionId } from './action-identity.js';
|
|
10
|
-
import { NOTION_DEFAULT_MAX_KNOWLEDGE_CREATES_PER_RUN } from './adapters/notion/types.js';
|
|
11
|
-
import { validateFinalIngestArtifacts, validateProvenanceRawPaths } from './artifact-gates.js';
|
|
12
|
-
import { selectRelevantCanonicalPins } from './canonical-pins.js';
|
|
13
|
-
import { finalGateRepairPaths, repairFinalGateFailure } from './final-gate-repair.js';
|
|
14
|
-
import { compareFinalizationDeclarations, deriveFinalizationTouchedSources, deriveFinalizationWikiPageKeys, } from './finalization-scope.js';
|
|
15
|
-
import { FileIngestTraceWriter, ingestTracePathForJob, traceTimed } from './ingest-trace.js';
|
|
16
|
-
import { integrateWorkUnitPatch } from './isolated-diff/patch-integrator.js';
|
|
17
|
-
import { resolveTextualConflict } from './isolated-diff/textual-conflict-resolver.js';
|
|
18
|
-
import { runIsolatedWorkUnit } from './isolated-diff/work-unit-executor.js';
|
|
19
|
-
import { sanitizeMemoryFlowError } from './memory-flow/live-buffer.js';
|
|
20
|
-
import { buildSyncId, rawSourcesDirForSync } from './raw-sources-paths.js';
|
|
21
|
-
import { buildStageIndexFromReportBody, } from './reports.js';
|
|
22
|
-
import { buildReconcileSystemPrompt, buildReconcileToolSet, buildReconcileUserPrompt, } from './stages/build-reconcile-context.js';
|
|
23
|
-
import { buildWuSystemPrompt, buildWuToolSet, buildWuUserPrompt } from './stages/build-wu-context.js';
|
|
24
|
-
import { stageRawFilesStage1 } from './stages/stage-1-stage-raw-files.js';
|
|
25
|
-
import { executeWorkUnit } from './stages/stage-3-work-units.js';
|
|
26
|
-
import { runReconciliationStage4 } from './stages/stage-4-reconciliation.js';
|
|
27
|
-
import { validateWuTouchedSources } from './stages/validate-wu-sources.js';
|
|
28
|
-
import { assertSemanticLayerTargetPathsAllowed } from './semantic-layer-target-policy.js';
|
|
29
|
-
import { createEmitArtifactResolutionTool } from './tools/emit-artifact-resolution.tool.js';
|
|
30
|
-
import { createEmitConflictResolutionTool } from './tools/emit-conflict-resolution.tool.js';
|
|
31
|
-
import { createEmitEvictionDecisionTool } from './tools/emit-eviction-decision.tool.js';
|
|
32
|
-
import { createEmitUnmappedFallbackTool } from './tools/emit-unmapped-fallback.tool.js';
|
|
33
|
-
import { createEvictionListTool } from './tools/eviction-list.tool.js';
|
|
34
|
-
import { createReadRawSpanTool } from './tools/read-raw-span.tool.js';
|
|
35
|
-
import { createStageDiffTool } from './tools/stage-diff.tool.js';
|
|
36
|
-
import { createStageListTool } from './tools/stage-list.tool.js';
|
|
37
|
-
import { wrapToolsWithLogger } from './tools/tool-call-logger.js';
|
|
38
|
-
import { createMutableToolTranscriptSummary, recordToolTranscriptEntry, } from './tools/tool-transcript-summary.js';
|
|
39
|
-
import { repairWikiSlRefs } from './wiki-sl-ref-repair.js';
|
|
40
|
-
async function copyTransientIngestEvidence(sourceWorkdir, targetWorkdir) {
|
|
41
|
-
const source = join(sourceWorkdir, '.ktx/ingest-evidence');
|
|
42
|
-
const target = join(targetWorkdir, '.ktx/ingest-evidence');
|
|
43
|
-
await cp(source, target, { recursive: true, force: true }).catch((error) => {
|
|
44
|
-
if (error.code !== 'ENOENT') {
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function workUnitToMemoryFlowPlannedWorkUnit(workUnit) {
|
|
50
|
-
return {
|
|
51
|
-
unitKey: workUnit.unitKey,
|
|
52
|
-
rawFiles: workUnit.rawFiles,
|
|
53
|
-
peerFileCount: workUnit.peerFileIndex.length,
|
|
54
|
-
dependencyCount: workUnit.dependencyPaths.length,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function stageIndexWorkUnitToMemoryFlowPlannedWorkUnit(workUnit) {
|
|
58
|
-
return {
|
|
59
|
-
unitKey: workUnit.unitKey,
|
|
60
|
-
rawFiles: workUnit.rawFiles,
|
|
61
|
-
peerFileCount: 0,
|
|
62
|
-
dependencyCount: 0,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function countMemoryFlowActions(actions, target) {
|
|
66
|
-
return actions.filter((action) => action.target === target).length;
|
|
67
|
-
}
|
|
68
|
-
function reportIdFromCreateResult(result) {
|
|
69
|
-
if (!result || typeof result !== 'object' || !('id' in result)) {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
const id = result.id;
|
|
73
|
-
return typeof id === 'string' && id.length > 0 ? id : undefined;
|
|
74
|
-
}
|
|
75
|
-
function normalizeTableReference(value) {
|
|
76
|
-
return value
|
|
77
|
-
.trim()
|
|
78
|
-
.replace(/["`]/g, '')
|
|
79
|
-
.replace(/[\[\]]/g, '')
|
|
80
|
-
.toLowerCase();
|
|
81
|
-
}
|
|
82
|
-
function finalReferenceSegment(value) {
|
|
83
|
-
const parts = value.split('.').filter((part) => part.length > 0);
|
|
84
|
-
return parts.at(-1) ?? value;
|
|
85
|
-
}
|
|
86
|
-
function semanticSourceMatchesTableRef(source, tableRef) {
|
|
87
|
-
const normalizedRef = normalizeTableReference(tableRef);
|
|
88
|
-
if (!normalizedRef) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
const refIsQualified = normalizedRef.includes('.');
|
|
92
|
-
const normalizedSourceName = normalizeTableReference(source.name);
|
|
93
|
-
if (normalizedSourceName === normalizedRef) {
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
const table = typeof source.table === 'string' ? normalizeTableReference(source.table) : '';
|
|
97
|
-
if (table && (table === normalizedRef || table.endsWith(`.${normalizedRef}`))) {
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
if (!refIsQualified && table && finalReferenceSegment(table) === normalizedRef) {
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
function rawPathsForAction(action, fallbackRawPaths) {
|
|
106
|
-
return action.rawPaths && action.rawPaths.length > 0 ? [...new Set(action.rawPaths)] : fallbackRawPaths;
|
|
107
|
-
}
|
|
108
|
-
export class IngestBundleRunner {
|
|
109
|
-
deps;
|
|
110
|
-
logger;
|
|
111
|
-
chainByConnection = new Map();
|
|
112
|
-
constructor(deps) {
|
|
113
|
-
this.deps = deps;
|
|
114
|
-
this.logger = deps.logger ?? noopLogger;
|
|
115
|
-
}
|
|
116
|
-
async run(job, ctx) {
|
|
117
|
-
const key = job.connectionId;
|
|
118
|
-
const previous = this.chainByConnection.get(key);
|
|
119
|
-
if (previous) {
|
|
120
|
-
this.logger.log(`[ingest-bundle] queued behind previous job for connection=${key}`);
|
|
121
|
-
}
|
|
122
|
-
const run = (previous ?? Promise.resolve()).catch(() => undefined).then(() => this.runInner(job, ctx));
|
|
123
|
-
const chainSlot = run.finally(() => {
|
|
124
|
-
if (this.chainByConnection.get(key) === chainSlot) {
|
|
125
|
-
this.chainByConnection.delete(key);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
// Keep the chain alive but silence unhandled rejection — callers await `run` directly.
|
|
129
|
-
chainSlot.catch(() => undefined);
|
|
130
|
-
this.chainByConnection.set(key, chainSlot);
|
|
131
|
-
try {
|
|
132
|
-
const result = await run;
|
|
133
|
-
ctx?.memoryFlow?.finish('done');
|
|
134
|
-
return { ...result, jobId: job.jobId };
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
ctx?.memoryFlow?.finish('error', [sanitizeMemoryFlowError(error)]);
|
|
138
|
-
throw error;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
stageRawFilesStage1 = stageRawFilesStage1;
|
|
142
|
-
async syncKnowledgeSlRefsFromActions(connectionId, actions) {
|
|
143
|
-
if (!this.deps.knowledgeSlRefs) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const slTargetsBySourceName = new Map();
|
|
147
|
-
const wikiActionsByKey = new Map();
|
|
148
|
-
for (const action of actions) {
|
|
149
|
-
if (action.target === 'sl') {
|
|
150
|
-
const bucket = slTargetsBySourceName.get(action.key) ?? new Set();
|
|
151
|
-
bucket.add(actionTargetConnectionId(action, connectionId));
|
|
152
|
-
slTargetsBySourceName.set(action.key, bucket);
|
|
153
|
-
}
|
|
154
|
-
if (action.target === 'wiki') {
|
|
155
|
-
wikiActionsByKey.set(action.key, action);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
for (const action of wikiActionsByKey.values()) {
|
|
159
|
-
if (action.type === 'removed') {
|
|
160
|
-
await this.deps.knowledgeSlRefs.syncFromWiki({
|
|
161
|
-
wikiPageKey: action.key,
|
|
162
|
-
wikiScope: 'GLOBAL',
|
|
163
|
-
wikiScopeId: null,
|
|
164
|
-
refs: [],
|
|
165
|
-
});
|
|
166
|
-
continue;
|
|
167
|
-
}
|
|
168
|
-
const page = await this.deps.wikiService.readPage('GLOBAL', null, action.key);
|
|
169
|
-
const bareSources = [
|
|
170
|
-
...new Set((page?.frontmatter.sl_refs ?? [])
|
|
171
|
-
.map((ref) => ref.split('.')[0])
|
|
172
|
-
.filter((sourceName) => sourceName.length > 0)),
|
|
173
|
-
];
|
|
174
|
-
const refs = bareSources.flatMap((sourceName) => {
|
|
175
|
-
const targets = slTargetsBySourceName.get(sourceName);
|
|
176
|
-
if (!targets || targets.size === 0) {
|
|
177
|
-
return [{ connectionId, sourceName }];
|
|
178
|
-
}
|
|
179
|
-
return [...targets].sort().map((targetConnectionId) => ({ connectionId: targetConnectionId, sourceName }));
|
|
180
|
-
});
|
|
181
|
-
await this.deps.knowledgeSlRefs.syncFromWiki({
|
|
182
|
-
wikiPageKey: action.key,
|
|
183
|
-
wikiScope: 'GLOBAL',
|
|
184
|
-
wikiScopeId: null,
|
|
185
|
-
refs,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
async materializeOverrideSnapshot(report, ctx) {
|
|
190
|
-
const rawRoot = rawSourcesDirForSync(ctx.connectionId, ctx.sourceKey, report.body.syncId);
|
|
191
|
-
const files = await this.deps.gitService.listFilesAtHead(rawRoot);
|
|
192
|
-
if (files.length === 0) {
|
|
193
|
-
throw new Error(`override ingest: no raw-source files found for prior sync ${report.body.syncId}`);
|
|
194
|
-
}
|
|
195
|
-
const stagedDir = this.deps.storage.resolvePullDir(ctx.jobId);
|
|
196
|
-
await rm(stagedDir, { recursive: true, force: true });
|
|
197
|
-
await mkdir(stagedDir, { recursive: true });
|
|
198
|
-
for (const file of files) {
|
|
199
|
-
const relativePath = file.startsWith(`${rawRoot}/`) ? file.slice(rawRoot.length + 1) : file;
|
|
200
|
-
const absoluteTarget = join(stagedDir, relativePath);
|
|
201
|
-
await mkdir(dirname(absoluteTarget), { recursive: true });
|
|
202
|
-
await writeFile(absoluteTarget, await this.deps.gitService.getFileAtCommit(file, 'HEAD'), 'utf-8');
|
|
203
|
-
}
|
|
204
|
-
return stagedDir;
|
|
205
|
-
}
|
|
206
|
-
async loadOverrideReport(job) {
|
|
207
|
-
if (job.bundleRef.kind !== 'override') {
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
const report = await this.deps.reports.findByJobId(job.bundleRef.priorJobId);
|
|
211
|
-
if (!report) {
|
|
212
|
-
throw new Error(`override ingest: prior report ${job.bundleRef.priorJobId} not found`);
|
|
213
|
-
}
|
|
214
|
-
if (report.connectionId !== job.connectionId || report.sourceKey !== job.sourceKey) {
|
|
215
|
-
throw new Error(`override ingest: prior report ${job.bundleRef.priorJobId} belongs to ${report.connectionId}/${report.sourceKey}, not ${job.connectionId}/${job.sourceKey}`);
|
|
216
|
-
}
|
|
217
|
-
return report;
|
|
218
|
-
}
|
|
219
|
-
async resolveStagedDir(ref, ctx) {
|
|
220
|
-
if (ref.kind === 'upload') {
|
|
221
|
-
return this.deps.storage.resolveUploadDir(ref.uploadId);
|
|
222
|
-
}
|
|
223
|
-
if (ref.kind === 'override') {
|
|
224
|
-
throw new Error('override bundle refs must be materialized from the prior report snapshot');
|
|
225
|
-
}
|
|
226
|
-
const stagedDir = this.deps.storage.resolvePullDir(ctx.jobId);
|
|
227
|
-
await mkdir(stagedDir, { recursive: true });
|
|
228
|
-
const adapter = this.deps.registry.get(ctx.sourceKey);
|
|
229
|
-
if (!adapter.fetch) {
|
|
230
|
-
throw new Error(`source adapter '${ctx.sourceKey}' does not support scheduled_pull (no fetch() method)`);
|
|
231
|
-
}
|
|
232
|
-
await adapter.fetch(ref.config, stagedDir, {
|
|
233
|
-
connectionId: ctx.connectionId,
|
|
234
|
-
sourceKey: ctx.sourceKey,
|
|
235
|
-
...(ctx.memoryFlow ? { memoryFlow: ctx.memoryFlow } : {}),
|
|
236
|
-
});
|
|
237
|
-
return stagedDir;
|
|
238
|
-
}
|
|
239
|
-
buildCommitMessage(job, syncId, diffSummary, failedWUs) {
|
|
240
|
-
const diff = `+${diffSummary.added}/~${diffSummary.modified}/-${diffSummary.deleted}/=${diffSummary.unchanged}`;
|
|
241
|
-
const failed = failedWUs.length > 0 ? `; failed WUs: ${failedWUs.join(', ')}` : '';
|
|
242
|
-
return `ingest(${job.sourceKey}): ${job.jobId} syncId=${syncId} diff=${diff}${failed}`;
|
|
243
|
-
}
|
|
244
|
-
async buildWikiIndex() {
|
|
245
|
-
const pages = await this.deps.knowledgeIndex?.listPagesForUser('system');
|
|
246
|
-
if (!pages || pages.length === 0) {
|
|
247
|
-
return '(empty)';
|
|
248
|
-
}
|
|
249
|
-
return `## Wiki Pages\n${pages.map((page) => `- ${page.page_key}: ${page.summary}`).join('\n')}`;
|
|
250
|
-
}
|
|
251
|
-
async buildSlIndex(connectionIds) {
|
|
252
|
-
const blocks = await Promise.all(connectionIds.map(async (connectionId) => {
|
|
253
|
-
try {
|
|
254
|
-
const { sources } = await this.deps.semanticLayerService.loadAllSources(connectionId);
|
|
255
|
-
const names = sources.map((source) => source.name).sort((left, right) => left.localeCompare(right));
|
|
256
|
-
const body = names.length > 0 ? names.join('\n') : '(no sources yet)';
|
|
257
|
-
return `## ${connectionId}\n${body}`;
|
|
258
|
-
}
|
|
259
|
-
catch {
|
|
260
|
-
try {
|
|
261
|
-
const files = await this.deps.semanticLayerService.listFilesForConnection(connectionId);
|
|
262
|
-
const names = files
|
|
263
|
-
.filter((f) => !f.startsWith('_schema/'))
|
|
264
|
-
.map((f) => f.replace(/\.yaml$/, ''))
|
|
265
|
-
.sort((left, right) => left.localeCompare(right));
|
|
266
|
-
const body = names.length > 0 ? names.join('\n') : '(no sources yet)';
|
|
267
|
-
return `## ${connectionId}\n${body}`;
|
|
268
|
-
}
|
|
269
|
-
catch {
|
|
270
|
-
return `## ${connectionId}\n(empty)`;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}));
|
|
274
|
-
return blocks.join('\n\n');
|
|
275
|
-
}
|
|
276
|
-
async tableRefExistsInSemanticLayer(semanticLayerService, connectionIds, tableRef) {
|
|
277
|
-
for (const connectionId of connectionIds) {
|
|
278
|
-
try {
|
|
279
|
-
const { sources } = await semanticLayerService.loadAllSources(connectionId);
|
|
280
|
-
if (sources.some((source) => semanticSourceMatchesTableRef(source, tableRef))) {
|
|
281
|
-
return true;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
catch {
|
|
285
|
-
// Fallback diagnostics should not fail an ingest stage if an index lookup is temporarily unavailable.
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
async loadSourcesByConnection(workdir, connectionIds) {
|
|
291
|
-
const service = this.deps.semanticLayerService.forWorktree(workdir);
|
|
292
|
-
const result = new Map();
|
|
293
|
-
for (const connectionId of connectionIds) {
|
|
294
|
-
const { sources } = await service.loadAllSources(connectionId);
|
|
295
|
-
result.set(connectionId, sources);
|
|
296
|
-
}
|
|
297
|
-
return result;
|
|
298
|
-
}
|
|
299
|
-
resolveContextCuratorBudget(bundleRef, stageIndex) {
|
|
300
|
-
const rawConfig = bundleRef.kind === 'scheduled_pull' && bundleRef.config && typeof bundleRef.config === 'object'
|
|
301
|
-
? bundleRef.config
|
|
302
|
-
: {};
|
|
303
|
-
const configuredCreates = typeof rawConfig.maxKnowledgeCreatesPerRun === 'number'
|
|
304
|
-
? rawConfig.maxKnowledgeCreatesPerRun
|
|
305
|
-
: NOTION_DEFAULT_MAX_KNOWLEDGE_CREATES_PER_RUN;
|
|
306
|
-
const configuredUpdates = typeof rawConfig.maxKnowledgeUpdatesPerRun === 'number' ? rawConfig.maxKnowledgeUpdatesPerRun : 20;
|
|
307
|
-
const wikiActions = stageIndex.workUnits.flatMap((wu) => wu.actions).filter((action) => action.target === 'wiki');
|
|
308
|
-
const usedCreates = wikiActions.filter((action) => action.type === 'created').length;
|
|
309
|
-
const usedUpdates = wikiActions.filter((action) => action.type === 'updated').length;
|
|
310
|
-
return {
|
|
311
|
-
creates: Math.max(0, configuredCreates - usedCreates),
|
|
312
|
-
updates: Math.max(0, configuredUpdates - usedUpdates),
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
filterWorkUnitsForTriage(workUnits, triageResult) {
|
|
316
|
-
if (!triageResult?.enabled) {
|
|
317
|
-
return workUnits;
|
|
318
|
-
}
|
|
319
|
-
return workUnits.filter((wu) => wu.rawFiles.some((rawPath) => triageResult.fullRawPaths.has(rawPath)));
|
|
320
|
-
}
|
|
321
|
-
createTrace(job) {
|
|
322
|
-
const storage = this.deps.storage;
|
|
323
|
-
return new FileIngestTraceWriter({
|
|
324
|
-
tracePath: storage.resolveTracePath?.(job.jobId) ?? ingestTracePathForJob(this.deps.storage.homeDir, job.jobId),
|
|
325
|
-
jobId: job.jobId,
|
|
326
|
-
connectionId: job.connectionId,
|
|
327
|
-
sourceKey: job.sourceKey,
|
|
328
|
-
level: this.deps.settings.ingestTraceLevel ?? 'debug',
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
errorMessage(error) {
|
|
332
|
-
return error instanceof Error ? error.message : String(error);
|
|
333
|
-
}
|
|
334
|
-
buildProvenancePlan(input) {
|
|
335
|
-
const rows = [];
|
|
336
|
-
const diagnostics = [];
|
|
337
|
-
const actionToType = (action) => {
|
|
338
|
-
if (action.target === 'wiki') {
|
|
339
|
-
return 'wiki_written';
|
|
340
|
-
}
|
|
341
|
-
return action.type === 'created' ? 'source_created' : 'measure_added';
|
|
342
|
-
};
|
|
343
|
-
const producedPaths = new Set();
|
|
344
|
-
const pushRow = (row, origin) => {
|
|
345
|
-
rows.push(row);
|
|
346
|
-
diagnostics.push({ row, origin });
|
|
347
|
-
producedPaths.add(row.rawPath);
|
|
348
|
-
};
|
|
349
|
-
const pushActionProvenance = (rawPath, action, origin) => {
|
|
350
|
-
const hash = input.currentHashes.get(rawPath) ?? '';
|
|
351
|
-
pushRow({
|
|
352
|
-
connectionId: input.job.connectionId,
|
|
353
|
-
sourceKey: input.job.sourceKey,
|
|
354
|
-
syncId: input.syncId,
|
|
355
|
-
rawPath,
|
|
356
|
-
rawContentHash: hash,
|
|
357
|
-
artifactKind: action.target,
|
|
358
|
-
artifactKey: action.key,
|
|
359
|
-
targetConnectionId: action.target === 'sl' ? actionTargetConnectionId(action, input.job.connectionId) : null,
|
|
360
|
-
artifactContentHash: null,
|
|
361
|
-
actionType: actionToType(action),
|
|
362
|
-
}, origin);
|
|
363
|
-
};
|
|
364
|
-
input.stageIndex.workUnits.forEach((wu, unitIndex) => {
|
|
365
|
-
wu.actions.forEach((action, actionIndex) => {
|
|
366
|
-
for (const rawPath of rawPathsForAction(action, wu.rawFiles)) {
|
|
367
|
-
pushActionProvenance(rawPath, action, {
|
|
368
|
-
source: 'work_unit_action',
|
|
369
|
-
unitKey: wu.unitKey,
|
|
370
|
-
unitIndex,
|
|
371
|
-
unitRawFiles: wu.rawFiles,
|
|
372
|
-
actionIndex,
|
|
373
|
-
action,
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
input.reconcileActions.forEach((action, actionIndex) => {
|
|
379
|
-
for (const rawPath of action.rawPaths ?? []) {
|
|
380
|
-
pushActionProvenance(rawPath, action, {
|
|
381
|
-
source: 'reconciliation_action',
|
|
382
|
-
actionIndex,
|
|
383
|
-
action,
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
input.finalizationActions.forEach((action, actionIndex) => {
|
|
388
|
-
for (const rawPath of action.rawPaths ?? []) {
|
|
389
|
-
pushActionProvenance(rawPath, action, {
|
|
390
|
-
source: 'finalization_action',
|
|
391
|
-
actionIndex,
|
|
392
|
-
action,
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
(input.stageIndex.artifactResolutions ?? []).forEach((resolution, resolutionIndex) => {
|
|
397
|
-
const hash = input.currentHashes.get(resolution.rawPath) ?? '';
|
|
398
|
-
pushRow({
|
|
399
|
-
connectionId: input.job.connectionId,
|
|
400
|
-
sourceKey: input.job.sourceKey,
|
|
401
|
-
syncId: input.syncId,
|
|
402
|
-
rawPath: resolution.rawPath,
|
|
403
|
-
rawContentHash: hash,
|
|
404
|
-
artifactKind: resolution.artifactKind,
|
|
405
|
-
artifactKey: resolution.artifactKey,
|
|
406
|
-
targetConnectionId: null,
|
|
407
|
-
artifactContentHash: null,
|
|
408
|
-
actionType: resolution.actionType,
|
|
409
|
-
}, {
|
|
410
|
-
source: 'artifact_resolution',
|
|
411
|
-
resolutionIndex,
|
|
412
|
-
resolution,
|
|
413
|
-
});
|
|
414
|
-
});
|
|
415
|
-
for (const [rawPath, hash] of input.currentHashes) {
|
|
416
|
-
if (producedPaths.has(rawPath)) {
|
|
417
|
-
continue;
|
|
418
|
-
}
|
|
419
|
-
pushRow({
|
|
420
|
-
connectionId: input.job.connectionId,
|
|
421
|
-
sourceKey: input.job.sourceKey,
|
|
422
|
-
syncId: input.syncId,
|
|
423
|
-
rawPath,
|
|
424
|
-
rawContentHash: hash,
|
|
425
|
-
artifactKind: null,
|
|
426
|
-
artifactKey: null,
|
|
427
|
-
targetConnectionId: null,
|
|
428
|
-
artifactContentHash: null,
|
|
429
|
-
actionType: 'skipped',
|
|
430
|
-
}, { source: 'raw_snapshot_fallback', rawPath });
|
|
431
|
-
}
|
|
432
|
-
return { rows, diagnostics };
|
|
433
|
-
}
|
|
434
|
-
partitionFinalizationActionsForProvenance(input) {
|
|
435
|
-
const defensible = new Set([
|
|
436
|
-
...input.currentRawPaths,
|
|
437
|
-
...input.currentEvictionRawPaths,
|
|
438
|
-
...input.overrideEvictionRawPaths,
|
|
439
|
-
]);
|
|
440
|
-
const actions = [];
|
|
441
|
-
const exclusions = [];
|
|
442
|
-
for (const action of input.actions) {
|
|
443
|
-
const rawPaths = action.rawPaths ?? [];
|
|
444
|
-
if (rawPaths.length === 0) {
|
|
445
|
-
exclusions.push({ action, reason: 'missing_raw_paths' });
|
|
446
|
-
continue;
|
|
447
|
-
}
|
|
448
|
-
const invalidRawPaths = rawPaths.filter((rawPath) => !defensible.has(rawPath)).sort();
|
|
449
|
-
if (invalidRawPaths.length > 0) {
|
|
450
|
-
exclusions.push({ action, reason: 'raw_path_not_defensible', invalidRawPaths });
|
|
451
|
-
continue;
|
|
452
|
-
}
|
|
453
|
-
actions.push(action);
|
|
454
|
-
}
|
|
455
|
-
return { actions, exclusions };
|
|
456
|
-
}
|
|
457
|
-
toReportProvenanceRows(rows) {
|
|
458
|
-
return rows.map(({ rawPath, artifactKind, artifactKey, actionType, targetConnectionId }) => ({
|
|
459
|
-
rawPath,
|
|
460
|
-
artifactKind,
|
|
461
|
-
artifactKey,
|
|
462
|
-
targetConnectionId: targetConnectionId ?? null,
|
|
463
|
-
actionType,
|
|
464
|
-
}));
|
|
465
|
-
}
|
|
466
|
-
toReportWorkUnits(stageIndex) {
|
|
467
|
-
return stageIndex.workUnits.map((wu) => ({
|
|
468
|
-
unitKey: wu.unitKey,
|
|
469
|
-
rawFiles: wu.rawFiles,
|
|
470
|
-
status: wu.status,
|
|
471
|
-
reason: wu.reason,
|
|
472
|
-
actions: wu.actions,
|
|
473
|
-
touchedSlSources: wu.touchedSlSources,
|
|
474
|
-
slDisallowed: wu.slDisallowed,
|
|
475
|
-
slDisallowedReason: wu.slDisallowedReason,
|
|
476
|
-
}));
|
|
477
|
-
}
|
|
478
|
-
provenanceValidationTraceData(input) {
|
|
479
|
-
const invalidRows = input.plan.diagnostics.filter(({ row }) => !input.currentRawPaths.has(row.rawPath) && !input.deletedRawPaths.has(row.rawPath));
|
|
480
|
-
return {
|
|
481
|
-
rowCount: input.plan.rows.length,
|
|
482
|
-
currentRawPathCount: input.currentRawPaths.size,
|
|
483
|
-
deletedRawPathCount: input.deletedRawPaths.size,
|
|
484
|
-
currentRawPaths: [...input.currentRawPaths].sort(),
|
|
485
|
-
deletedRawPaths: [...input.deletedRawPaths].sort(),
|
|
486
|
-
invalidRawPaths: [...new Set(invalidRows.map(({ row }) => row.rawPath))].sort(),
|
|
487
|
-
invalidRows,
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
wikiPageKeysFromPaths(paths) {
|
|
491
|
-
return [
|
|
492
|
-
...new Set(paths
|
|
493
|
-
.filter((path) => path.startsWith('wiki/global/') && path.endsWith('.md'))
|
|
494
|
-
.map((path) => path.slice('wiki/global/'.length, -'.md'.length))),
|
|
495
|
-
].sort();
|
|
496
|
-
}
|
|
497
|
-
touchedSlSourcesFromPaths(paths) {
|
|
498
|
-
return paths
|
|
499
|
-
.filter((path) => path.startsWith('semantic-layer/') && path.endsWith('.yaml') && !path.includes('/_schema/'))
|
|
500
|
-
.map((path) => {
|
|
501
|
-
const [, connectionId, fileName] = path.split('/');
|
|
502
|
-
return { connectionId: connectionId ?? '', sourceName: (fileName ?? '').replace(/\.yaml$/, '') };
|
|
503
|
-
})
|
|
504
|
-
.filter((source) => source.connectionId.length > 0 && source.sourceName.length > 0);
|
|
505
|
-
}
|
|
506
|
-
touchedSlSourcesFromActions(actions, fallbackConnectionId) {
|
|
507
|
-
return actions
|
|
508
|
-
.filter((action) => action.target === 'sl')
|
|
509
|
-
.map((action) => ({
|
|
510
|
-
connectionId: actionTargetConnectionId(action, fallbackConnectionId),
|
|
511
|
-
sourceName: action.key,
|
|
512
|
-
}));
|
|
513
|
-
}
|
|
514
|
-
wikiPageKeysFromActions(actions) {
|
|
515
|
-
return actions.filter((action) => action.target === 'wiki').map((action) => action.key);
|
|
516
|
-
}
|
|
517
|
-
uniqueWikiPageKeys(keys) {
|
|
518
|
-
return [...new Set(keys.filter((key) => typeof key === 'string' && key.length > 0))].sort();
|
|
519
|
-
}
|
|
520
|
-
uniqueTouchedSlSources(sources) {
|
|
521
|
-
const seen = new Set();
|
|
522
|
-
const unique = [];
|
|
523
|
-
for (const source of sources) {
|
|
524
|
-
const key = `${source.connectionId}:${source.sourceName}`;
|
|
525
|
-
if (seen.has(key)) {
|
|
526
|
-
continue;
|
|
527
|
-
}
|
|
528
|
-
seen.add(key);
|
|
529
|
-
unique.push(source);
|
|
530
|
-
}
|
|
531
|
-
return unique.sort((left, right) => {
|
|
532
|
-
const byConnection = left.connectionId.localeCompare(right.connectionId);
|
|
533
|
-
return byConnection === 0 ? left.sourceName.localeCompare(right.sourceName) : byConnection;
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
|
-
removedWikiPageKeysFromActions(actions) {
|
|
537
|
-
return this.uniqueWikiPageKeys(actions.filter((action) => action.target === 'wiki' && action.type === 'removed').map((action) => action.key));
|
|
538
|
-
}
|
|
539
|
-
finalGateActionOrigins(input) {
|
|
540
|
-
const actionContext = (action, fallbackRawPaths) => ({
|
|
541
|
-
target: action.target,
|
|
542
|
-
type: action.type,
|
|
543
|
-
key: action.key,
|
|
544
|
-
detail: action.detail,
|
|
545
|
-
rawPaths: rawPathsForAction(action, fallbackRawPaths),
|
|
546
|
-
...(action.target === 'sl' ? { targetConnectionId: actionTargetConnectionId(action, input.fallbackConnectionId) } : {}),
|
|
547
|
-
});
|
|
548
|
-
return [
|
|
549
|
-
...input.stageIndex.workUnits.flatMap((workUnit, unitIndex) => workUnit.actions.map((action, actionIndex) => ({
|
|
550
|
-
source: 'work_unit_action',
|
|
551
|
-
unitKey: workUnit.unitKey,
|
|
552
|
-
unitIndex,
|
|
553
|
-
unitRawFiles: workUnit.rawFiles,
|
|
554
|
-
actionIndex,
|
|
555
|
-
action: actionContext(action, workUnit.rawFiles),
|
|
556
|
-
}))),
|
|
557
|
-
...input.reconcileActions.map((action, actionIndex) => ({
|
|
558
|
-
source: 'reconciliation_action',
|
|
559
|
-
actionIndex,
|
|
560
|
-
action: actionContext(action, []),
|
|
561
|
-
})),
|
|
562
|
-
];
|
|
563
|
-
}
|
|
564
|
-
async wikiPageKeysForFinalGates(input) {
|
|
565
|
-
const changedWikiPageKeys = this.uniqueWikiPageKeys(input.changedWikiPageKeys);
|
|
566
|
-
const removedWikiPageKeys = this.removedWikiPageKeysFromActions(input.actions);
|
|
567
|
-
const reasons = [];
|
|
568
|
-
if (input.touchedSlSources.length > 0) {
|
|
569
|
-
reasons.push('semantic_layer_changed');
|
|
570
|
-
}
|
|
571
|
-
if (removedWikiPageKeys.length > 0) {
|
|
572
|
-
reasons.push('wiki_page_removed');
|
|
573
|
-
}
|
|
574
|
-
let pageKeys = changedWikiPageKeys;
|
|
575
|
-
if (reasons.length > 0) {
|
|
576
|
-
pageKeys = this.uniqueWikiPageKeys([
|
|
577
|
-
...changedWikiPageKeys,
|
|
578
|
-
...(await input.wikiService.listPageKeys('GLOBAL', null)),
|
|
579
|
-
]);
|
|
580
|
-
}
|
|
581
|
-
return {
|
|
582
|
-
pageKeys,
|
|
583
|
-
trace: {
|
|
584
|
-
global: reasons.length > 0,
|
|
585
|
-
reasons,
|
|
586
|
-
changedWikiPageKeys,
|
|
587
|
-
removedWikiPageKeys,
|
|
588
|
-
pageKeysValidated: pageKeys,
|
|
589
|
-
},
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
async runWorkUnitInWorktree(input) {
|
|
593
|
-
const session = {
|
|
594
|
-
userId: 'system',
|
|
595
|
-
chatId: input.wu.unitKey,
|
|
596
|
-
userMessage: `ingest(${input.job.sourceKey}) WU=${input.wu.unitKey}`,
|
|
597
|
-
connectionId: input.job.connectionId,
|
|
598
|
-
userScopedEnabled: false,
|
|
599
|
-
forceGlobalScope: true,
|
|
600
|
-
touchedSlSources: createTouchedSlSources(),
|
|
601
|
-
preHead: input.worktree.baseSha,
|
|
602
|
-
};
|
|
603
|
-
const sessionActions = [];
|
|
604
|
-
const toolSession = {
|
|
605
|
-
connectionId: input.job.connectionId,
|
|
606
|
-
isWorktreeScoped: true,
|
|
607
|
-
preHead: input.worktree.baseSha,
|
|
608
|
-
touchedSlSources: session.touchedSlSources,
|
|
609
|
-
actions: sessionActions,
|
|
610
|
-
allowedRawPaths: new Set(input.wu.rawFiles),
|
|
611
|
-
allowedConnectionNames: new Set(input.slConnectionIds),
|
|
612
|
-
semanticLayerService: input.scopedSemanticLayerService,
|
|
613
|
-
wikiService: input.scopedWikiService,
|
|
614
|
-
configService: input.worktree.config,
|
|
615
|
-
gitService: input.worktree.git,
|
|
616
|
-
ingest: input.ingestToolMetadata,
|
|
617
|
-
};
|
|
618
|
-
const slValidationDeps = {
|
|
619
|
-
semanticLayerService: input.scopedSemanticLayerService,
|
|
620
|
-
connections: this.deps.connections,
|
|
621
|
-
configService: input.worktree.config,
|
|
622
|
-
gitService: input.worktree.git,
|
|
623
|
-
slSourcesRepository: this.deps.slSourcesRepository,
|
|
624
|
-
probeRowCount: this.deps.settings.probeRowCount,
|
|
625
|
-
};
|
|
626
|
-
const wuToolset = this.deps.toolsetFactory.createIngestWuToolset(toolSession, {
|
|
627
|
-
includeContextEvidenceTools: input.includeContextEvidenceTools,
|
|
628
|
-
});
|
|
629
|
-
const wuToolContext = {
|
|
630
|
-
sourceId: 'ingest',
|
|
631
|
-
messageId: `${input.job.jobId}-wu-${input.wu.unitKey}`,
|
|
632
|
-
userId: 'system',
|
|
633
|
-
connectionId: input.job.connectionId,
|
|
634
|
-
ingest: input.ingestToolMetadata,
|
|
635
|
-
session: toolSession,
|
|
636
|
-
};
|
|
637
|
-
const skillsLoadedPerWu = [];
|
|
638
|
-
const loadSkillTool = {
|
|
639
|
-
load_skill: {
|
|
640
|
-
name: 'load_skill',
|
|
641
|
-
description: 'Load a skill to get specialized instructions. Call this when a skill listed in the system prompt matches the current task.',
|
|
642
|
-
inputSchema: z.object({ name: z.string() }),
|
|
643
|
-
execute: async ({ name }) => {
|
|
644
|
-
const skill = await this.deps.skillsRegistry.getSkill(name, 'memory_agent');
|
|
645
|
-
if (!skill) {
|
|
646
|
-
const available = (await this.deps.skillsRegistry.listSkills('memory_agent')).map((s) => s.name).join(', ') || '(none)';
|
|
647
|
-
return { markdown: `Skill "${name}" not available. Available: ${available}` };
|
|
648
|
-
}
|
|
649
|
-
const body = await readFile(join(skill.path, 'SKILL.md'), 'utf-8');
|
|
650
|
-
if (!skillsLoadedPerWu.includes(skill.name)) {
|
|
651
|
-
skillsLoadedPerWu.push(skill.name);
|
|
652
|
-
}
|
|
653
|
-
const structured = {
|
|
654
|
-
name: skill.name,
|
|
655
|
-
skillDirectory: skill.path,
|
|
656
|
-
content: this.deps.skillsRegistry.stripFrontmatter(body),
|
|
657
|
-
};
|
|
658
|
-
return {
|
|
659
|
-
markdown: `# ${structured.name}\n\n${structured.content}`,
|
|
660
|
-
structured,
|
|
661
|
-
};
|
|
662
|
-
},
|
|
663
|
-
},
|
|
664
|
-
};
|
|
665
|
-
const wuEmitUnmappedFallbackTool = {
|
|
666
|
-
emit_unmapped_fallback: createRuntimeToolDescriptorFromAiTool('emit_unmapped_fallback', createEmitUnmappedFallbackTool({
|
|
667
|
-
stageIndex: input.stageIndex,
|
|
668
|
-
allowedPaths: new Set(input.wu.rawFiles),
|
|
669
|
-
tableRefExists: input.currentTableExists,
|
|
670
|
-
})),
|
|
671
|
-
};
|
|
672
|
-
const systemPrompt = buildWuSystemPrompt({
|
|
673
|
-
baseFraming: input.baseFraming,
|
|
674
|
-
skillsPrompt: input.skillsPrompt,
|
|
675
|
-
syncId: input.syncId,
|
|
676
|
-
sourceKey: input.job.sourceKey,
|
|
677
|
-
canonicalPins: input.canonicalPins,
|
|
678
|
-
});
|
|
679
|
-
input.memoryFlow?.emit({
|
|
680
|
-
type: 'work_unit_started',
|
|
681
|
-
unitKey: input.wu.unitKey,
|
|
682
|
-
skills: input.wuSkillNames,
|
|
683
|
-
stepBudget: input.workUnitSettings.stepBudget,
|
|
684
|
-
});
|
|
685
|
-
return executeWorkUnit({
|
|
686
|
-
sessionWorktreeGit: input.worktree.git,
|
|
687
|
-
agentRunner: this.deps.agentRunner,
|
|
688
|
-
validateTouchedSources: (touched) => validateWuTouchedSources({ ...slValidationDeps, slValidator: this.deps.slValidator }, touched),
|
|
689
|
-
validateWikiRefs: (actions) => findDanglingWikiRefsForActions({
|
|
690
|
-
wikiService: input.scopedWikiService,
|
|
691
|
-
scope: 'GLOBAL',
|
|
692
|
-
scopeId: null,
|
|
693
|
-
actions,
|
|
694
|
-
}),
|
|
695
|
-
resetHardTo: (targetSha) => input.worktree.git.resetHardTo(targetSha),
|
|
696
|
-
buildSystemPrompt: () => systemPrompt,
|
|
697
|
-
buildUserPrompt: (wuInner) => buildWuUserPrompt({
|
|
698
|
-
wu: wuInner,
|
|
699
|
-
wikiIndex: input.wikiIndex,
|
|
700
|
-
slIndex: input.slIndex,
|
|
701
|
-
priorProvenance: input.priorProvenance,
|
|
702
|
-
}),
|
|
703
|
-
buildToolSet: (wuInner) => wrapToolsWithLogger(buildWuToolSet({
|
|
704
|
-
sourceKey: input.job.sourceKey,
|
|
705
|
-
stagedDir: input.stagedDir,
|
|
706
|
-
wu: wuInner,
|
|
707
|
-
loadSkillTool,
|
|
708
|
-
emitUnmappedFallbackTool: wuEmitUnmappedFallbackTool,
|
|
709
|
-
toolsetTools: wuToolset.toRuntimeTools(wuToolContext),
|
|
710
|
-
}), join(input.transcriptDir, `${wuInner.unitKey}.jsonl`), wuInner.unitKey, { onEntry: input.recordTranscriptEntry(join(input.transcriptDir, `${wuInner.unitKey}.jsonl`)) }),
|
|
711
|
-
captureSession: session,
|
|
712
|
-
sessionActions,
|
|
713
|
-
modelRole: 'candidateExtraction',
|
|
714
|
-
stepBudget: input.workUnitSettings.stepBudget,
|
|
715
|
-
sourceKey: input.job.sourceKey,
|
|
716
|
-
connectionId: input.job.connectionId,
|
|
717
|
-
jobId: input.job.jobId,
|
|
718
|
-
toolFailureCount: (unitKey) => input.transcriptSummaries.get(unitKey)?.fatalErrorCount ?? 0,
|
|
719
|
-
onStepFinish: input.onStepFinish,
|
|
720
|
-
}, input.wu);
|
|
721
|
-
}
|
|
722
|
-
async runInner(job, ctx) {
|
|
723
|
-
const syncId = buildSyncId(new Date(), job.jobId);
|
|
724
|
-
const trace = this.createTrace(job);
|
|
725
|
-
const transcriptSummaries = new Map();
|
|
726
|
-
let activeTrace = trace;
|
|
727
|
-
let activePhase = 'run';
|
|
728
|
-
let runRow = null;
|
|
729
|
-
let latestDiffSummary = { added: 0, modified: 0, deleted: 0, unchanged: 0 };
|
|
730
|
-
let latestWorkUnits = [];
|
|
731
|
-
let latestFailedWorkUnits = [];
|
|
732
|
-
let latestReconciliationSkipped = true;
|
|
733
|
-
let latestReportWorkUnits = [];
|
|
734
|
-
let latestReconciliationActions = [];
|
|
735
|
-
let latestConflictsResolved = [];
|
|
736
|
-
let latestEvictionsApplied = [];
|
|
737
|
-
let latestUnmappedFallbacks = [];
|
|
738
|
-
let latestArtifactResolutions = [];
|
|
739
|
-
let latestEvictionInputs = [];
|
|
740
|
-
let latestUnresolvedCards = [];
|
|
741
|
-
let latestReportProvenanceRows = [];
|
|
742
|
-
let latestFinalizationOutcome;
|
|
743
|
-
let activeFailureDetails;
|
|
744
|
-
let latestIsolatedDiffSummary;
|
|
745
|
-
await trace.event('info', 'run', 'ingest_started', {
|
|
746
|
-
trigger: job.trigger,
|
|
747
|
-
bundleRefKind: job.bundleRef.kind,
|
|
748
|
-
});
|
|
749
|
-
try {
|
|
750
|
-
const memoryFlow = ctx?.memoryFlow;
|
|
751
|
-
const emitStageProgress = (stage, percent, message, options = {}) => {
|
|
752
|
-
memoryFlow?.emit({
|
|
753
|
-
type: 'stage_progress',
|
|
754
|
-
stage,
|
|
755
|
-
percent,
|
|
756
|
-
message,
|
|
757
|
-
...(options.transient !== undefined ? { transient: options.transient } : {}),
|
|
758
|
-
});
|
|
759
|
-
};
|
|
760
|
-
const baseSha = await this.deps.lockingService.withLock('config:repo', () => this.deps.gitService.revParseHead());
|
|
761
|
-
if (!baseSha) {
|
|
762
|
-
throw new Error('ingest-bundle: config repo has no HEAD');
|
|
763
|
-
}
|
|
764
|
-
const transcriptDir = this.deps.storage.resolveTranscriptDir(job.jobId);
|
|
765
|
-
const recordTranscriptEntry = (path) => (entry) => {
|
|
766
|
-
const current = transcriptSummaries.get(entry.wuKey) ?? createMutableToolTranscriptSummary(entry.wuKey, path);
|
|
767
|
-
recordToolTranscriptEntry(current, entry);
|
|
768
|
-
transcriptSummaries.set(entry.wuKey, current);
|
|
769
|
-
};
|
|
770
|
-
const overrideReport = await this.loadOverrideReport(job);
|
|
771
|
-
const stage1 = ctx?.startPhase(0.08);
|
|
772
|
-
await stage1?.updateProgress(0.0, 'Fetching source files');
|
|
773
|
-
const adapter = this.deps.registry.get(job.sourceKey);
|
|
774
|
-
activePhase = 'fetch';
|
|
775
|
-
const stagedDir = await traceTimed(trace, 'fetch', 'resolve_staged_dir', {
|
|
776
|
-
bundleRefKind: job.bundleRef.kind,
|
|
777
|
-
sourceKey: job.sourceKey,
|
|
778
|
-
}, () => overrideReport
|
|
779
|
-
? this.materializeOverrideSnapshot(overrideReport, {
|
|
780
|
-
connectionId: job.connectionId,
|
|
781
|
-
sourceKey: job.sourceKey,
|
|
782
|
-
jobId: job.jobId,
|
|
783
|
-
})
|
|
784
|
-
: this.resolveStagedDir(job.bundleRef, {
|
|
785
|
-
connectionId: job.connectionId,
|
|
786
|
-
sourceKey: job.sourceKey,
|
|
787
|
-
jobId: job.jobId,
|
|
788
|
-
...(memoryFlow ? { memoryFlow } : {}),
|
|
789
|
-
}));
|
|
790
|
-
const fetchReport = adapter.readFetchReport ? await adapter.readFetchReport(stagedDir) : null;
|
|
791
|
-
const scopeDescriptor = adapter.describeScope ? await adapter.describeScope(stagedDir) : null;
|
|
792
|
-
const sessionWorktree = await this.deps.lockingService.withLock('config:repo', () => this.deps.sessionWorktreeService.create(job.jobId, baseSha));
|
|
793
|
-
let cleanupOutcome = 'crash';
|
|
794
|
-
try {
|
|
795
|
-
activePhase = 'stage_raw_files';
|
|
796
|
-
const { currentHashes, rawDirInWorktree } = await traceTimed(trace, 'stage_raw_files', 'stage_raw_files', {
|
|
797
|
-
stagedDir,
|
|
798
|
-
worktreePath: sessionWorktree.workdir,
|
|
799
|
-
connectionId: job.connectionId,
|
|
800
|
-
sourceKey: job.sourceKey,
|
|
801
|
-
syncId,
|
|
802
|
-
}, () => this.stageRawFilesStage1({
|
|
803
|
-
stagedDir,
|
|
804
|
-
worktreeRoot: sessionWorktree.workdir,
|
|
805
|
-
connectionId: job.connectionId,
|
|
806
|
-
sourceKey: job.sourceKey,
|
|
807
|
-
syncId,
|
|
808
|
-
}));
|
|
809
|
-
memoryFlow?.update({
|
|
810
|
-
connectionId: job.connectionId,
|
|
811
|
-
adapter: job.sourceKey,
|
|
812
|
-
sourceDir: stagedDir,
|
|
813
|
-
syncId,
|
|
814
|
-
});
|
|
815
|
-
memoryFlow?.emit({
|
|
816
|
-
type: 'source_acquired',
|
|
817
|
-
adapter: job.sourceKey,
|
|
818
|
-
trigger: job.trigger,
|
|
819
|
-
fileCount: currentHashes.size,
|
|
820
|
-
});
|
|
821
|
-
memoryFlow?.emit({ type: 'scope_detected', fingerprint: scopeDescriptor?.fingerprint ?? null });
|
|
822
|
-
memoryFlow?.emit({ type: 'raw_snapshot_written', syncId, rawFileCount: currentHashes.size });
|
|
823
|
-
await sessionWorktree.git.commitFiles([rawDirInWorktree], `ingest(${job.sourceKey}): stage raw files syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email);
|
|
824
|
-
await stage1?.updateProgress(0.5, 'Checking what changed');
|
|
825
|
-
activePhase = 'diff';
|
|
826
|
-
const diffSet = await traceTimed(trace, 'diff', 'compute_diff_set', {
|
|
827
|
-
connectionId: job.connectionId,
|
|
828
|
-
sourceKey: job.sourceKey,
|
|
829
|
-
currentHashCount: currentHashes.size,
|
|
830
|
-
scopeFingerprint: scopeDescriptor?.fingerprint ?? null,
|
|
831
|
-
}, () => this.deps.diffSetService.compute(job.connectionId, job.sourceKey, currentHashes, scopeDescriptor ? scopeDescriptor.isPathInScope.bind(scopeDescriptor) : undefined));
|
|
832
|
-
const diffSummary = {
|
|
833
|
-
added: diffSet.added.length,
|
|
834
|
-
modified: diffSet.modified.length,
|
|
835
|
-
deleted: diffSet.deleted.length,
|
|
836
|
-
unchanged: diffSet.unchanged.length,
|
|
837
|
-
};
|
|
838
|
-
latestDiffSummary = diffSummary;
|
|
839
|
-
memoryFlow?.emit({ type: 'diff_computed', ...diffSummary });
|
|
840
|
-
runRow = await this.deps.runs.create({
|
|
841
|
-
jobId: job.jobId,
|
|
842
|
-
connectionId: job.connectionId,
|
|
843
|
-
sourceKey: job.sourceKey,
|
|
844
|
-
syncId,
|
|
845
|
-
trigger: job.trigger,
|
|
846
|
-
scopeFingerprint: scopeDescriptor?.fingerprint ?? null,
|
|
847
|
-
});
|
|
848
|
-
memoryFlow?.update({ runId: runRow.id });
|
|
849
|
-
const ingestToolMetadata = {
|
|
850
|
-
runId: runRow.id,
|
|
851
|
-
jobId: job.jobId,
|
|
852
|
-
syncId,
|
|
853
|
-
sourceKey: job.sourceKey,
|
|
854
|
-
};
|
|
855
|
-
const runTrace = trace.withContext({ runId: runRow.id, syncId });
|
|
856
|
-
activeTrace = runTrace;
|
|
857
|
-
const createdRunRow = runRow;
|
|
858
|
-
await runTrace.event('debug', 'snapshot', 'input_snapshot', {
|
|
859
|
-
baseSha,
|
|
860
|
-
stagedDir,
|
|
861
|
-
rawFileCount: currentHashes.size,
|
|
862
|
-
rawDirInWorktree,
|
|
863
|
-
diffSummary,
|
|
864
|
-
scopeFingerprint: scopeDescriptor?.fingerprint ?? null,
|
|
865
|
-
});
|
|
866
|
-
await stage1?.updateProgress(1.0, `${diffSet.added.length} new, ${diffSet.modified.length} changed, ${diffSet.deleted.length} removed`);
|
|
867
|
-
activePhase = 'detect';
|
|
868
|
-
const detected = await traceTimed(runTrace, 'detect', 'adapter_detect', { stagedDir, sourceKey: job.sourceKey }, () => adapter.detect(stagedDir));
|
|
869
|
-
await runTrace.event('debug', 'detect', 'adapter_detected', { detected });
|
|
870
|
-
if (!detected) {
|
|
871
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
872
|
-
throw new Error(`source adapter '${job.sourceKey}' did not recognize staged dir`);
|
|
873
|
-
}
|
|
874
|
-
let contextReport = null;
|
|
875
|
-
if (adapter.evidenceIndexing === 'documents' && this.deps.contextEvidenceIndex) {
|
|
876
|
-
contextReport = await this.deps.contextEvidenceIndex.indexStagedDir({
|
|
877
|
-
stagedDir,
|
|
878
|
-
runId: runRow.id,
|
|
879
|
-
connectionId: job.connectionId,
|
|
880
|
-
sourceKey: job.sourceKey,
|
|
881
|
-
syncId,
|
|
882
|
-
diffSet,
|
|
883
|
-
currentHashes,
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
const stage2 = ctx?.startPhase(0.04);
|
|
887
|
-
await stage2?.updateProgress(0.0, 'Planning updates');
|
|
888
|
-
activePhase = 'planning';
|
|
889
|
-
let workUnits = [];
|
|
890
|
-
let eviction;
|
|
891
|
-
let unresolvedCards;
|
|
892
|
-
let sourceContextReport;
|
|
893
|
-
let parseArtifacts;
|
|
894
|
-
let finalizationOutcome;
|
|
895
|
-
let wikiSlRefRepairResult = null;
|
|
896
|
-
let reconcileNotes = [];
|
|
897
|
-
let triageResult = null;
|
|
898
|
-
if (overrideReport) {
|
|
899
|
-
eviction =
|
|
900
|
-
overrideReport.body.evictionInputs.length > 0
|
|
901
|
-
? { deletedRawPaths: overrideReport.body.evictionInputs }
|
|
902
|
-
: undefined;
|
|
903
|
-
unresolvedCards = overrideReport.body.unresolvedCards;
|
|
904
|
-
await stage2?.updateProgress(1.0, `Loaded prior report ${overrideReport.jobId} for override reconciliation`);
|
|
905
|
-
}
|
|
906
|
-
else {
|
|
907
|
-
const chunk = await traceTimed(runTrace, 'planning', 'chunk_work_units', {
|
|
908
|
-
stagedDir,
|
|
909
|
-
added: diffSet.added.length,
|
|
910
|
-
modified: diffSet.modified.length,
|
|
911
|
-
deleted: diffSet.deleted.length,
|
|
912
|
-
}, () => adapter.chunk(stagedDir, diffSet));
|
|
913
|
-
workUnits = chunk.workUnits;
|
|
914
|
-
eviction = chunk.eviction;
|
|
915
|
-
unresolvedCards = chunk.unresolvedCards;
|
|
916
|
-
sourceContextReport = chunk.contextReport;
|
|
917
|
-
parseArtifacts = chunk.parseArtifacts;
|
|
918
|
-
reconcileNotes = chunk.reconcileNotes ?? [];
|
|
919
|
-
triageResult =
|
|
920
|
-
contextReport && adapter.triageSupported && this.deps.pageTriage
|
|
921
|
-
? await this.deps.pageTriage.triageRun({
|
|
922
|
-
stagedDir,
|
|
923
|
-
runId: runRow.id,
|
|
924
|
-
connectionId: job.connectionId,
|
|
925
|
-
sourceKey: job.sourceKey,
|
|
926
|
-
syncId,
|
|
927
|
-
jobId: job.jobId,
|
|
928
|
-
diffSet,
|
|
929
|
-
adapter,
|
|
930
|
-
})
|
|
931
|
-
: null;
|
|
932
|
-
workUnits = this.filterWorkUnitsForTriage(workUnits, triageResult);
|
|
933
|
-
if (adapter.clusterWorkUnits && workUnits.length > 0) {
|
|
934
|
-
workUnits = await adapter.clusterWorkUnits({
|
|
935
|
-
workUnits,
|
|
936
|
-
stagedDir,
|
|
937
|
-
embedding: this.deps.embedding,
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
await stage2?.updateProgress(1.0, `Planned ${workUnits.length} update${workUnits.length === 1 ? '' : 's'}`);
|
|
941
|
-
}
|
|
942
|
-
await runTrace.event('debug', 'planning', 'work_units_planned', {
|
|
943
|
-
workUnitCount: workUnits.length,
|
|
944
|
-
evictionCount: eviction?.deletedRawPaths.length ?? 0,
|
|
945
|
-
unresolvedCardCount: unresolvedCards?.length ?? 0,
|
|
946
|
-
triageEnabled: triageResult?.enabled ?? false,
|
|
947
|
-
});
|
|
948
|
-
const targetConnectionIds = new Set([job.connectionId]);
|
|
949
|
-
if (!overrideReport && adapter.listTargetConnectionIds) {
|
|
950
|
-
for (const connectionId of await adapter.listTargetConnectionIds(stagedDir)) {
|
|
951
|
-
targetConnectionIds.add(connectionId);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
if (overrideReport) {
|
|
955
|
-
for (const wu of overrideReport.body.workUnits) {
|
|
956
|
-
for (const action of wu.actions) {
|
|
957
|
-
if (action.target === 'sl' && action.targetConnectionId) {
|
|
958
|
-
targetConnectionIds.add(action.targetConnectionId);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
for (const touched of wu.touchedSlSources) {
|
|
962
|
-
targetConnectionIds.add(touched.connectionId);
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
const slConnectionIds = [...targetConnectionIds].sort();
|
|
967
|
-
await runTrace.event('debug', 'planning', 'target_connections_resolved', {
|
|
968
|
-
connectionIds: slConnectionIds,
|
|
969
|
-
});
|
|
970
|
-
// Build shared per-job context.
|
|
971
|
-
const [wikiIndex, slIndex] = await Promise.all([this.buildWikiIndex(), this.buildSlIndex(slConnectionIds)]);
|
|
972
|
-
const baseFraming = await this.deps.promptService.loadPrompt('memory_agent_bundle_ingest_work_unit');
|
|
973
|
-
const wuSkillNames = Array.from(new Set([...adapter.skillNames, 'ingest_triage', 'sl_capture', 'wiki_capture']));
|
|
974
|
-
const wuSkills = await this.deps.skillsRegistry.listSkills(wuSkillNames, 'memory_agent');
|
|
975
|
-
const skillsPrompt = this.deps.skillsRegistry.buildSkillsPrompt(wuSkills, 'memory_agent');
|
|
976
|
-
const canonicalPins = await this.deps.canonicalPins.listPins(slConnectionIds);
|
|
977
|
-
const workUnitOutcomes = [];
|
|
978
|
-
const failedWorkUnits = [];
|
|
979
|
-
const stageIndex = overrideReport
|
|
980
|
-
? buildStageIndexFromReportBody(job.jobId, overrideReport.connectionId, overrideReport.body)
|
|
981
|
-
: {
|
|
982
|
-
jobId: job.jobId,
|
|
983
|
-
connectionId: job.connectionId,
|
|
984
|
-
workUnits: [],
|
|
985
|
-
conflictsResolved: [],
|
|
986
|
-
evictionsApplied: [],
|
|
987
|
-
unmappedFallbacks: [],
|
|
988
|
-
artifactResolutions: [],
|
|
989
|
-
};
|
|
990
|
-
const memoryFlowPlannedWorkUnits = overrideReport
|
|
991
|
-
? stageIndex.workUnits.map(stageIndexWorkUnitToMemoryFlowPlannedWorkUnit)
|
|
992
|
-
: workUnits.map(workUnitToMemoryFlowPlannedWorkUnit);
|
|
993
|
-
memoryFlow?.update({ plannedWorkUnits: memoryFlowPlannedWorkUnits });
|
|
994
|
-
memoryFlow?.emit({
|
|
995
|
-
type: 'chunks_planned',
|
|
996
|
-
chunkCount: memoryFlowPlannedWorkUnits.length,
|
|
997
|
-
workUnitCount: memoryFlowPlannedWorkUnits.length,
|
|
998
|
-
evictionCount: eviction?.deletedRawPaths.length ?? 0,
|
|
999
|
-
});
|
|
1000
|
-
const isolatedDiffEnabled = !overrideReport;
|
|
1001
|
-
const isolatedDiffSummary = {
|
|
1002
|
-
enabled: isolatedDiffEnabled,
|
|
1003
|
-
integrationWorktreePath: isolatedDiffEnabled ? sessionWorktree.workdir : undefined,
|
|
1004
|
-
ingestionBaseSha: undefined,
|
|
1005
|
-
projectionSha: null,
|
|
1006
|
-
acceptedPatches: 0,
|
|
1007
|
-
textualConflicts: 0,
|
|
1008
|
-
semanticConflicts: 0,
|
|
1009
|
-
resolverAttempts: 0,
|
|
1010
|
-
resolverRepairs: 0,
|
|
1011
|
-
resolverFailures: 0,
|
|
1012
|
-
gateRepairAttempts: 0,
|
|
1013
|
-
gateRepairs: 0,
|
|
1014
|
-
gateRepairFailures: 0,
|
|
1015
|
-
};
|
|
1016
|
-
latestIsolatedDiffSummary = isolatedDiffSummary;
|
|
1017
|
-
const stage3 = ctx?.startPhase(0.6);
|
|
1018
|
-
await stage3?.updateProgress(0.0, `Processing ${workUnits.length} update${workUnits.length === 1 ? '' : 's'}`);
|
|
1019
|
-
activePhase = 'work_units';
|
|
1020
|
-
this.logger.log(`[ingest-bundle] job=${job.jobId} tool-call transcripts: ${transcriptDir}/`);
|
|
1021
|
-
let projectionTouchedSources = [];
|
|
1022
|
-
let projectionChangedWikiPageKeys = [];
|
|
1023
|
-
let projectionTouchedPaths = [];
|
|
1024
|
-
if (!overrideReport) {
|
|
1025
|
-
await runTrace.event('info', 'routing', 'isolated_diff_enabled', {
|
|
1026
|
-
sourceKey: job.sourceKey,
|
|
1027
|
-
workUnitCount: workUnits.length,
|
|
1028
|
-
integrationWorktreePath: sessionWorktree.workdir,
|
|
1029
|
-
});
|
|
1030
|
-
if (adapter.project) {
|
|
1031
|
-
const preProjectionSha = await sessionWorktree.git.revParseHead();
|
|
1032
|
-
const projection = await traceTimed(runTrace, 'projection', 'deterministic_projection', { sourceKey: job.sourceKey }, () => adapter.project({
|
|
1033
|
-
connectionId: job.connectionId,
|
|
1034
|
-
sourceKey: job.sourceKey,
|
|
1035
|
-
syncId,
|
|
1036
|
-
jobId: job.jobId,
|
|
1037
|
-
runId: createdRunRow.id,
|
|
1038
|
-
stagedDir,
|
|
1039
|
-
workdir: sessionWorktree.workdir,
|
|
1040
|
-
parseArtifacts,
|
|
1041
|
-
semanticLayerService: this.deps.semanticLayerService,
|
|
1042
|
-
}));
|
|
1043
|
-
if (projection.errors.length > 0) {
|
|
1044
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1045
|
-
throw new Error(`deterministic projection failed: ${projection.errors.join('; ')}`);
|
|
1046
|
-
}
|
|
1047
|
-
projectionTouchedSources = projection.touchedSources;
|
|
1048
|
-
projectionChangedWikiPageKeys = projection.changedWikiPageKeys;
|
|
1049
|
-
const projectionPaths = [
|
|
1050
|
-
...projection.touchedSources.map((source) => `semantic-layer/${source.connectionId}/${source.sourceName}.yaml`),
|
|
1051
|
-
...projection.changedWikiPageKeys.map((pageKey) => `wiki/global/${pageKey}.md`),
|
|
1052
|
-
];
|
|
1053
|
-
projectionTouchedPaths = projectionPaths;
|
|
1054
|
-
const projectionCommit = projectionPaths.length > 0
|
|
1055
|
-
? await sessionWorktree.git.commitFiles(projectionPaths, `ingest(${job.sourceKey}): deterministic projection syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email)
|
|
1056
|
-
: await sessionWorktree.git.commitStaged(`ingest(${job.sourceKey}): deterministic projection syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email);
|
|
1057
|
-
isolatedDiffSummary.projectionSha =
|
|
1058
|
-
projectionCommit.created || projectionCommit.commitHash !== preProjectionSha
|
|
1059
|
-
? projectionCommit.commitHash
|
|
1060
|
-
: null;
|
|
1061
|
-
await runTrace.event('debug', 'projection', 'deterministic_projection_committed', {
|
|
1062
|
-
projectionSha: isolatedDiffSummary.projectionSha,
|
|
1063
|
-
touchedSources: projectionTouchedSources,
|
|
1064
|
-
changedWikiPageKeys: projectionChangedWikiPageKeys,
|
|
1065
|
-
warnings: projection.warnings,
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
const ingestionBaseSha = await sessionWorktree.git.revParseHead();
|
|
1069
|
-
isolatedDiffSummary.ingestionBaseSha = ingestionBaseSha;
|
|
1070
|
-
const patchDir = join(this.deps.storage.homeDir, 'ingest-patches', job.jobId);
|
|
1071
|
-
const workUnitSettings = {
|
|
1072
|
-
maxConcurrency: this.deps.settings.workUnitMaxConcurrency ?? 1,
|
|
1073
|
-
stepBudget: this.deps.settings.workUnitStepBudget ?? 40,
|
|
1074
|
-
failureMode: this.deps.settings.workUnitFailureMode ?? 'continue',
|
|
1075
|
-
};
|
|
1076
|
-
const limitWorkUnit = pLimit(workUnitSettings.maxConcurrency);
|
|
1077
|
-
const workUnitOutcomesByIndex = [];
|
|
1078
|
-
let completedWorkUnits = 0;
|
|
1079
|
-
if (workUnits.length === 0) {
|
|
1080
|
-
await stage3?.updateProgress(1.0, '0 of 0 work units complete');
|
|
1081
|
-
}
|
|
1082
|
-
try {
|
|
1083
|
-
await Promise.all(workUnits.map((wu, index) => limitWorkUnit(async () => {
|
|
1084
|
-
const outcome = await runIsolatedWorkUnit({
|
|
1085
|
-
unitIndex: index,
|
|
1086
|
-
ingestionBaseSha,
|
|
1087
|
-
sessionWorktreeService: this.deps.sessionWorktreeService,
|
|
1088
|
-
patchDir,
|
|
1089
|
-
trace: runTrace,
|
|
1090
|
-
workUnit: wu,
|
|
1091
|
-
afterSuccess: (child) => copyTransientIngestEvidence(child.workdir, sessionWorktree.workdir),
|
|
1092
|
-
run: async (child) => {
|
|
1093
|
-
const scopedWikiService = this.deps.wikiService.forWorktree(child.workdir);
|
|
1094
|
-
const scopedSemanticLayerService = this.deps.semanticLayerService.forWorktree(child.workdir);
|
|
1095
|
-
return this.runWorkUnitInWorktree({
|
|
1096
|
-
job,
|
|
1097
|
-
syncId,
|
|
1098
|
-
wu,
|
|
1099
|
-
worktree: child,
|
|
1100
|
-
stagedDir,
|
|
1101
|
-
contextReport,
|
|
1102
|
-
ingestToolMetadata,
|
|
1103
|
-
slConnectionIds,
|
|
1104
|
-
wikiIndex,
|
|
1105
|
-
slIndex,
|
|
1106
|
-
priorProvenance: await this.deps.provenance.findLatestArtifactsForRawPaths(job.connectionId, job.sourceKey, wu.rawFiles),
|
|
1107
|
-
scopedWikiService,
|
|
1108
|
-
scopedSemanticLayerService,
|
|
1109
|
-
baseFraming,
|
|
1110
|
-
skillsPrompt,
|
|
1111
|
-
canonicalPins,
|
|
1112
|
-
workUnitSettings,
|
|
1113
|
-
transcriptDir,
|
|
1114
|
-
transcriptSummaries,
|
|
1115
|
-
recordTranscriptEntry,
|
|
1116
|
-
stageIndex,
|
|
1117
|
-
includeContextEvidenceTools: adapter.evidenceIndexing === 'documents' && !!contextReport,
|
|
1118
|
-
currentTableExists: (tableRef) => this.tableRefExistsInSemanticLayer(scopedSemanticLayerService, slConnectionIds, tableRef),
|
|
1119
|
-
memoryFlow,
|
|
1120
|
-
wuSkillNames,
|
|
1121
|
-
onStepFinish: ({ stepIndex, stepBudget }) => {
|
|
1122
|
-
memoryFlow?.emit({ type: 'work_unit_step', unitKey: wu.unitKey, stepIndex, stepBudget });
|
|
1123
|
-
},
|
|
1124
|
-
});
|
|
1125
|
-
},
|
|
1126
|
-
});
|
|
1127
|
-
workUnitOutcomesByIndex[index] = outcome;
|
|
1128
|
-
for (const action of outcome.actions) {
|
|
1129
|
-
memoryFlow?.emit({
|
|
1130
|
-
type: 'candidate_action',
|
|
1131
|
-
unitKey: outcome.unitKey,
|
|
1132
|
-
target: action.target,
|
|
1133
|
-
action: action.type,
|
|
1134
|
-
key: action.key,
|
|
1135
|
-
});
|
|
1136
|
-
}
|
|
1137
|
-
memoryFlow?.emit({
|
|
1138
|
-
type: 'work_unit_finished',
|
|
1139
|
-
unitKey: outcome.unitKey,
|
|
1140
|
-
status: outcome.status,
|
|
1141
|
-
...(outcome.reason ? { reason: outcome.reason } : {}),
|
|
1142
|
-
});
|
|
1143
|
-
completedWorkUnits += 1;
|
|
1144
|
-
await stage3?.updateProgress(completedWorkUnits / workUnits.length, `${completedWorkUnits} of ${workUnits.length} work units complete`);
|
|
1145
|
-
})));
|
|
1146
|
-
}
|
|
1147
|
-
catch (error) {
|
|
1148
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1149
|
-
throw error;
|
|
1150
|
-
}
|
|
1151
|
-
workUnitOutcomes.push(...workUnitOutcomesByIndex.filter((outcome) => Boolean(outcome)));
|
|
1152
|
-
failedWorkUnits.push(...workUnitOutcomes.filter((outcome) => outcome.status === 'failed').map((outcome) => outcome.unitKey));
|
|
1153
|
-
latestWorkUnits = workUnitOutcomes;
|
|
1154
|
-
latestFailedWorkUnits = failedWorkUnits;
|
|
1155
|
-
stageIndex.workUnits = workUnitOutcomes.map((o) => ({
|
|
1156
|
-
unitKey: o.unitKey,
|
|
1157
|
-
rawFiles: workUnits.find((w) => w.unitKey === o.unitKey)?.rawFiles ?? [],
|
|
1158
|
-
status: o.status,
|
|
1159
|
-
reason: o.reason,
|
|
1160
|
-
actions: o.actions,
|
|
1161
|
-
touchedSlSources: o.touchedSlSources,
|
|
1162
|
-
slDisallowed: o.slDisallowed,
|
|
1163
|
-
slDisallowedReason: o.slDisallowedReason,
|
|
1164
|
-
}));
|
|
1165
|
-
activePhase = 'integration';
|
|
1166
|
-
const integrablePatchCount = workUnitOutcomesByIndex.filter((outcome) => outcome?.status === 'success' && !!outcome.patchPath).length;
|
|
1167
|
-
let integratedPatchCount = 0;
|
|
1168
|
-
for (const [index, outcome] of workUnitOutcomesByIndex.entries()) {
|
|
1169
|
-
if (!outcome || outcome.status !== 'success' || !outcome.patchPath) {
|
|
1170
|
-
continue;
|
|
1171
|
-
}
|
|
1172
|
-
const wu = workUnits[index];
|
|
1173
|
-
if (!wu) {
|
|
1174
|
-
continue;
|
|
1175
|
-
}
|
|
1176
|
-
const integrationFailureDetails = {
|
|
1177
|
-
unitKey: outcome.unitKey,
|
|
1178
|
-
patchPath: outcome.patchPath,
|
|
1179
|
-
allowedTargetConnectionIds: slConnectionIds,
|
|
1180
|
-
};
|
|
1181
|
-
activeFailureDetails = integrationFailureDetails;
|
|
1182
|
-
emitStageProgress('integration', 80, `Integrating ${integratedPatchCount + 1}/${integrablePatchCount} patches: ${outcome.unitKey}`);
|
|
1183
|
-
const integration = await integrateWorkUnitPatch({
|
|
1184
|
-
unitKey: outcome.unitKey,
|
|
1185
|
-
patchPath: outcome.patchPath,
|
|
1186
|
-
integrationGit: sessionWorktree.git,
|
|
1187
|
-
trace: runTrace,
|
|
1188
|
-
author: this.deps.storage.systemGitAuthor,
|
|
1189
|
-
slDisallowed: wu.slDisallowed === true,
|
|
1190
|
-
allowedTargetConnectionIds: new Set(slConnectionIds),
|
|
1191
|
-
validateAppliedTree: async (touchedPaths) => {
|
|
1192
|
-
await validateFinalIngestArtifacts({
|
|
1193
|
-
connectionIds: slConnectionIds,
|
|
1194
|
-
changedWikiPageKeys: this.wikiPageKeysFromPaths(touchedPaths),
|
|
1195
|
-
touchedSlSources: this.touchedSlSourcesFromPaths(touchedPaths),
|
|
1196
|
-
wikiService: this.deps.wikiService.forWorktree(sessionWorktree.workdir),
|
|
1197
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1198
|
-
validateTouchedSources: (touched) => validateWuTouchedSources({
|
|
1199
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1200
|
-
connections: this.deps.connections,
|
|
1201
|
-
configService: sessionWorktree.config,
|
|
1202
|
-
gitService: sessionWorktree.git,
|
|
1203
|
-
slSourcesRepository: this.deps.slSourcesRepository,
|
|
1204
|
-
probeRowCount: this.deps.settings.probeRowCount,
|
|
1205
|
-
slValidator: this.deps.slValidator,
|
|
1206
|
-
}, touched),
|
|
1207
|
-
tableExists: (connectionId, tableRef) => this.tableRefExistsInSemanticLayer(this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir), [connectionId], tableRef),
|
|
1208
|
-
});
|
|
1209
|
-
},
|
|
1210
|
-
resolveTextualConflict: async (context) => {
|
|
1211
|
-
emitStageProgress('integration', 81, `Resolving text conflict for ${context.unitKey}`);
|
|
1212
|
-
const result = await resolveTextualConflict({
|
|
1213
|
-
agentRunner: this.deps.agentRunner,
|
|
1214
|
-
workdir: sessionWorktree.workdir,
|
|
1215
|
-
unitKey: context.unitKey,
|
|
1216
|
-
patchPath: context.patchPath,
|
|
1217
|
-
touchedPaths: context.touchedPaths,
|
|
1218
|
-
trace: runTrace,
|
|
1219
|
-
reason: context.reason,
|
|
1220
|
-
maxAttempts: 1,
|
|
1221
|
-
stepBudget: 12,
|
|
1222
|
-
});
|
|
1223
|
-
emitStageProgress('integration', 82, result.status === 'repaired'
|
|
1224
|
-
? `Resolved text conflict for ${context.unitKey}`
|
|
1225
|
-
: `Text conflict resolver failed for ${context.unitKey}`);
|
|
1226
|
-
return result;
|
|
1227
|
-
},
|
|
1228
|
-
repairGateFailure: async (context) => {
|
|
1229
|
-
emitStageProgress('integration', 82, `Repairing semantic gate for ${context.unitKey}`);
|
|
1230
|
-
const result = await repairFinalGateFailure({
|
|
1231
|
-
agentRunner: this.deps.agentRunner,
|
|
1232
|
-
workdir: sessionWorktree.workdir,
|
|
1233
|
-
gateError: context.reason,
|
|
1234
|
-
allowedPaths: context.touchedPaths,
|
|
1235
|
-
trace: runTrace,
|
|
1236
|
-
repairKind: 'patch_semantic_gate',
|
|
1237
|
-
maxAttempts: 1,
|
|
1238
|
-
stepBudget: 16,
|
|
1239
|
-
});
|
|
1240
|
-
emitStageProgress('integration', 83, result.status === 'repaired'
|
|
1241
|
-
? `Repaired semantic gate for ${context.unitKey}`
|
|
1242
|
-
: `Semantic gate repair failed for ${context.unitKey}`);
|
|
1243
|
-
return result;
|
|
1244
|
-
},
|
|
1245
|
-
});
|
|
1246
|
-
if (integration.textualResolution) {
|
|
1247
|
-
isolatedDiffSummary.resolverAttempts += integration.textualResolution.attempts;
|
|
1248
|
-
if (integration.textualResolution.status === 'repaired') {
|
|
1249
|
-
isolatedDiffSummary.textualConflicts += 1;
|
|
1250
|
-
isolatedDiffSummary.resolverRepairs += 1;
|
|
1251
|
-
}
|
|
1252
|
-
else {
|
|
1253
|
-
isolatedDiffSummary.resolverFailures += 1;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
if (integration.gateRepair) {
|
|
1257
|
-
isolatedDiffSummary.gateRepairAttempts += integration.gateRepair.attempts;
|
|
1258
|
-
if (integration.gateRepair.status === 'repaired') {
|
|
1259
|
-
isolatedDiffSummary.semanticConflicts += 1;
|
|
1260
|
-
isolatedDiffSummary.gateRepairs += 1;
|
|
1261
|
-
}
|
|
1262
|
-
else {
|
|
1263
|
-
isolatedDiffSummary.gateRepairFailures += 1;
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
if (integration.status === 'textual_conflict') {
|
|
1267
|
-
isolatedDiffSummary.textualConflicts += 1;
|
|
1268
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1269
|
-
cleanupOutcome = 'conflict';
|
|
1270
|
-
activeFailureDetails = {
|
|
1271
|
-
...integrationFailureDetails,
|
|
1272
|
-
touchedPaths: integration.touchedPaths,
|
|
1273
|
-
reason: integration.reason,
|
|
1274
|
-
};
|
|
1275
|
-
throw new Error(`isolated diff textual conflict in ${outcome.unitKey}: ${integration.reason}`);
|
|
1276
|
-
}
|
|
1277
|
-
if (integration.status === 'semantic_conflict') {
|
|
1278
|
-
isolatedDiffSummary.semanticConflicts += 1;
|
|
1279
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1280
|
-
cleanupOutcome = 'conflict';
|
|
1281
|
-
activeFailureDetails = {
|
|
1282
|
-
...integrationFailureDetails,
|
|
1283
|
-
touchedPaths: integration.touchedPaths,
|
|
1284
|
-
reason: integration.reason,
|
|
1285
|
-
};
|
|
1286
|
-
throw new Error(`isolated diff semantic conflict in ${outcome.unitKey}: ${integration.reason}`);
|
|
1287
|
-
}
|
|
1288
|
-
activeFailureDetails = undefined;
|
|
1289
|
-
if (integration.touchedPaths.length > 0) {
|
|
1290
|
-
isolatedDiffSummary.acceptedPatches += 1;
|
|
1291
|
-
integratedPatchCount += 1;
|
|
1292
|
-
}
|
|
1293
|
-
emitStageProgress('integration', 83, `Integrated ${integratedPatchCount}/${integrablePatchCount} patches`);
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
const carryForwardResult = contextReport && this.deps.contextCandidateCarryforward
|
|
1297
|
-
? await this.deps.contextCandidateCarryforward.carryForward({
|
|
1298
|
-
runId: runRow.id,
|
|
1299
|
-
connectionId: job.connectionId,
|
|
1300
|
-
sourceKey: job.sourceKey,
|
|
1301
|
-
})
|
|
1302
|
-
: null;
|
|
1303
|
-
const dedupResult = contextReport && this.deps.candidateDedup ? await this.deps.candidateDedup.deduplicateRun(runRow.id) : null;
|
|
1304
|
-
const preReconciliationSha = await sessionWorktree.git.revParseHead();
|
|
1305
|
-
activePhase = 'reconciliation';
|
|
1306
|
-
// Stage 4 — reconciliation. Shares scoped wiki/SL with a fresh CaptureSession
|
|
1307
|
-
// so reconciliation writes land in the same worktree Stage 3 used.
|
|
1308
|
-
const reconcileSession = {
|
|
1309
|
-
userId: 'system',
|
|
1310
|
-
chatId: `${job.jobId}-reconcile`,
|
|
1311
|
-
userMessage: `reconcile(${job.sourceKey})`,
|
|
1312
|
-
connectionId: job.connectionId,
|
|
1313
|
-
userScopedEnabled: false,
|
|
1314
|
-
forceGlobalScope: true,
|
|
1315
|
-
touchedSlSources: createTouchedSlSources(),
|
|
1316
|
-
preHead: await sessionWorktree.git.revParseHead(),
|
|
1317
|
-
};
|
|
1318
|
-
const reconcileActions = [];
|
|
1319
|
-
const rcScopedWiki = this.deps.wikiService.forWorktree(sessionWorktree.workdir);
|
|
1320
|
-
const rcScopedSl = this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir);
|
|
1321
|
-
const reconciliationAllowedRawPaths = new Set([
|
|
1322
|
-
...currentHashes.keys(),
|
|
1323
|
-
...(eviction?.deletedRawPaths ?? []),
|
|
1324
|
-
]);
|
|
1325
|
-
const rcToolSession = {
|
|
1326
|
-
connectionId: job.connectionId,
|
|
1327
|
-
isWorktreeScoped: true,
|
|
1328
|
-
preHead: reconcileSession.preHead,
|
|
1329
|
-
touchedSlSources: reconcileSession.touchedSlSources,
|
|
1330
|
-
actions: reconcileActions,
|
|
1331
|
-
allowedRawPaths: reconciliationAllowedRawPaths,
|
|
1332
|
-
allowedConnectionNames: new Set(slConnectionIds),
|
|
1333
|
-
semanticLayerService: rcScopedSl,
|
|
1334
|
-
wikiService: rcScopedWiki,
|
|
1335
|
-
configService: sessionWorktree.config,
|
|
1336
|
-
gitService: sessionWorktree.git,
|
|
1337
|
-
ingest: ingestToolMetadata,
|
|
1338
|
-
evictionDecisions: [],
|
|
1339
|
-
};
|
|
1340
|
-
const rcToolset = this.deps.toolsetFactory.createIngestWuToolset(rcToolSession, {
|
|
1341
|
-
includeContextEvidenceTools: adapter.evidenceIndexing === 'documents' && !!contextReport,
|
|
1342
|
-
});
|
|
1343
|
-
const rcToolContext = {
|
|
1344
|
-
sourceId: 'ingest',
|
|
1345
|
-
messageId: `${job.jobId}-reconcile`,
|
|
1346
|
-
userId: 'system',
|
|
1347
|
-
connectionId: job.connectionId,
|
|
1348
|
-
ingest: ingestToolMetadata,
|
|
1349
|
-
session: rcToolSession,
|
|
1350
|
-
};
|
|
1351
|
-
const rcLoadSkill = {
|
|
1352
|
-
load_skill: {
|
|
1353
|
-
name: 'load_skill',
|
|
1354
|
-
description: 'Load a skill.',
|
|
1355
|
-
inputSchema: z.object({ name: z.string() }),
|
|
1356
|
-
execute: async ({ name }) => {
|
|
1357
|
-
const skill = await this.deps.skillsRegistry.getSkill(name, 'memory_agent');
|
|
1358
|
-
if (!skill) {
|
|
1359
|
-
return { markdown: `Skill "${name}" not found` };
|
|
1360
|
-
}
|
|
1361
|
-
const body = await readFile(join(skill.path, 'SKILL.md'), 'utf-8');
|
|
1362
|
-
const structured = { name: skill.name, content: this.deps.skillsRegistry.stripFrontmatter(body) };
|
|
1363
|
-
return { markdown: `# ${structured.name}\n\n${structured.content}`, structured };
|
|
1364
|
-
},
|
|
1365
|
-
},
|
|
1366
|
-
};
|
|
1367
|
-
const allStagedPaths = new Set([...currentHashes.keys()]);
|
|
1368
|
-
const rcRawSpanTool = {
|
|
1369
|
-
read_raw_span: createRuntimeToolDescriptorFromAiTool('read_raw_span', createReadRawSpanTool({ stagedDir, allowedPaths: allStagedPaths })),
|
|
1370
|
-
};
|
|
1371
|
-
const rcStageListTool = {
|
|
1372
|
-
stage_list: createRuntimeToolDescriptorFromAiTool('stage_list', createStageListTool({ stageIndex })),
|
|
1373
|
-
};
|
|
1374
|
-
const rcStageDiffTool = {
|
|
1375
|
-
stage_diff: createRuntimeToolDescriptorFromAiTool('stage_diff', createStageDiffTool({ stageIndex })),
|
|
1376
|
-
};
|
|
1377
|
-
const rcEvictionListTool = {
|
|
1378
|
-
eviction_list: createRuntimeToolDescriptorFromAiTool('eviction_list', createEvictionListTool({
|
|
1379
|
-
provenance: this.deps.provenance,
|
|
1380
|
-
connectionId: job.connectionId,
|
|
1381
|
-
sourceKey: job.sourceKey,
|
|
1382
|
-
deletedRawPaths: eviction?.deletedRawPaths ?? [],
|
|
1383
|
-
})),
|
|
1384
|
-
};
|
|
1385
|
-
const rcEmitConflictResolutionTool = {
|
|
1386
|
-
emit_conflict_resolution: createRuntimeToolDescriptorFromAiTool('emit_conflict_resolution', createEmitConflictResolutionTool({ stageIndex })),
|
|
1387
|
-
};
|
|
1388
|
-
const rcEmitEvictionDecisionTool = {
|
|
1389
|
-
emit_eviction_decision: createRuntimeToolDescriptorFromAiTool('emit_eviction_decision', createEmitEvictionDecisionTool({
|
|
1390
|
-
stageIndex,
|
|
1391
|
-
deletedRawPaths: eviction?.deletedRawPaths ?? [],
|
|
1392
|
-
})),
|
|
1393
|
-
};
|
|
1394
|
-
const rcEmitArtifactResolutionTool = {
|
|
1395
|
-
emit_artifact_resolution: createRuntimeToolDescriptorFromAiTool('emit_artifact_resolution', createEmitArtifactResolutionTool({
|
|
1396
|
-
stageIndex,
|
|
1397
|
-
allowedPaths: allStagedPaths,
|
|
1398
|
-
})),
|
|
1399
|
-
};
|
|
1400
|
-
const rcEmitUnmappedFallbackTool = {
|
|
1401
|
-
emit_unmapped_fallback: createRuntimeToolDescriptorFromAiTool('emit_unmapped_fallback', createEmitUnmappedFallbackTool({
|
|
1402
|
-
stageIndex,
|
|
1403
|
-
allowedPaths: allStagedPaths,
|
|
1404
|
-
tableRefExists: (tableRef) => this.tableRefExistsInSemanticLayer(rcScopedSl, slConnectionIds, tableRef),
|
|
1405
|
-
})),
|
|
1406
|
-
};
|
|
1407
|
-
const reconcileBaseFraming = await this.deps.promptService.loadPrompt('memory_agent_bundle_ingest_reconcile');
|
|
1408
|
-
const reconcileSkills = await this.deps.skillsRegistry.listSkills(Array.from(new Set(['ingest_triage', 'sl_capture', 'wiki_capture', ...(adapter.reconcileSkillNames ?? [])])), 'memory_agent');
|
|
1409
|
-
const reconcileSkillsPrompt = this.deps.skillsRegistry.buildSkillsPrompt(reconcileSkills, 'memory_agent');
|
|
1410
|
-
const relevantCanonicalPins = selectRelevantCanonicalPins(stageIndex, canonicalPins);
|
|
1411
|
-
const stage4 = ctx?.startPhase(0.16);
|
|
1412
|
-
const hasCandidateReconcileWork = (dedupResult?.representatives.length ?? 0) > 0;
|
|
1413
|
-
const hasReconcileWork = stageIndex.workUnits.some((wu) => wu.actions.length > 0) ||
|
|
1414
|
-
(eviction?.deletedRawPaths.length ?? 0) > 0 ||
|
|
1415
|
-
hasCandidateReconcileWork;
|
|
1416
|
-
if (hasReconcileWork || overrideReport) {
|
|
1417
|
-
emitStageProgress('reconciliation', 84, 'Reconciling results');
|
|
1418
|
-
await stage4?.updateProgress(0.0, 'Reconciling results');
|
|
1419
|
-
}
|
|
1420
|
-
let curatorReport = null;
|
|
1421
|
-
let curatorWarnings = [];
|
|
1422
|
-
let reconcileOutcome;
|
|
1423
|
-
if (contextReport && this.deps.curatorPagination) {
|
|
1424
|
-
const curatorOutcome = await this.deps.curatorPagination.reconcile({
|
|
1425
|
-
runId: runRow.id,
|
|
1426
|
-
sourceKey: job.sourceKey,
|
|
1427
|
-
jobId: job.jobId,
|
|
1428
|
-
stageIndex,
|
|
1429
|
-
evictionUnit: eviction,
|
|
1430
|
-
representatives: dedupResult?.representatives ?? [],
|
|
1431
|
-
initialBudget: this.resolveContextCuratorBudget(job.bundleRef, stageIndex),
|
|
1432
|
-
modelRole: 'curator',
|
|
1433
|
-
buildSystemPrompt: () => buildReconcileSystemPrompt({
|
|
1434
|
-
baseFraming: reconcileBaseFraming,
|
|
1435
|
-
skillsPrompt: reconcileSkillsPrompt,
|
|
1436
|
-
syncId,
|
|
1437
|
-
sourceKey: job.sourceKey,
|
|
1438
|
-
canonicalPins: relevantCanonicalPins,
|
|
1439
|
-
}),
|
|
1440
|
-
buildUserPrompt: ({ summary, items, runState }) => buildReconcileUserPrompt(stageIndex, eviction, { summary, items }, reconcileNotes, runState),
|
|
1441
|
-
buildToolSet: (_passNumber) => wrapToolsWithLogger(buildReconcileToolSet({
|
|
1442
|
-
loadSkillTool: rcLoadSkill,
|
|
1443
|
-
stageListTool: rcStageListTool,
|
|
1444
|
-
stageDiffTool: rcStageDiffTool,
|
|
1445
|
-
evictionListTool: rcEvictionListTool,
|
|
1446
|
-
emitConflictResolutionTool: rcEmitConflictResolutionTool,
|
|
1447
|
-
emitEvictionDecisionTool: rcEmitEvictionDecisionTool,
|
|
1448
|
-
emitArtifactResolutionTool: rcEmitArtifactResolutionTool,
|
|
1449
|
-
emitUnmappedFallbackTool: rcEmitUnmappedFallbackTool,
|
|
1450
|
-
readRawSpanTool: rcRawSpanTool,
|
|
1451
|
-
toolsetTools: rcToolset.toRuntimeTools(rcToolContext),
|
|
1452
|
-
}), join(transcriptDir, 'reconcile.jsonl'), 'reconcile', { onEntry: recordTranscriptEntry(join(transcriptDir, 'reconcile.jsonl')) }),
|
|
1453
|
-
getReconciliationActions: () => reconcileActions,
|
|
1454
|
-
onStepFinish: stage4
|
|
1455
|
-
? ({ passNumber, stepIndex, stepBudget }) => {
|
|
1456
|
-
emitStageProgress('reconciliation', 85, `Reconciling results: pass ${passNumber} step ${stepIndex}/${stepBudget}`, { transient: true });
|
|
1457
|
-
void stage4.updateProgress(stepIndex / stepBudget, `Reconciling results · pass ${passNumber} step ${stepIndex}`);
|
|
1458
|
-
}
|
|
1459
|
-
: undefined,
|
|
1460
|
-
});
|
|
1461
|
-
curatorReport = curatorOutcome.report;
|
|
1462
|
-
curatorWarnings = curatorOutcome.warnings;
|
|
1463
|
-
reconcileOutcome = {
|
|
1464
|
-
skipped: curatorOutcome.skipped,
|
|
1465
|
-
stopReason: curatorOutcome.stopReason,
|
|
1466
|
-
error: curatorOutcome.error,
|
|
1467
|
-
};
|
|
1468
|
-
}
|
|
1469
|
-
else {
|
|
1470
|
-
reconcileOutcome = await runReconciliationStage4({
|
|
1471
|
-
stageIndex,
|
|
1472
|
-
evictionUnit: eviction,
|
|
1473
|
-
agentRunner: this.deps.agentRunner,
|
|
1474
|
-
buildSystemPrompt: () => buildReconcileSystemPrompt({
|
|
1475
|
-
baseFraming: reconcileBaseFraming,
|
|
1476
|
-
skillsPrompt: reconcileSkillsPrompt,
|
|
1477
|
-
syncId,
|
|
1478
|
-
sourceKey: job.sourceKey,
|
|
1479
|
-
canonicalPins: relevantCanonicalPins,
|
|
1480
|
-
}),
|
|
1481
|
-
buildUserPrompt: (idx, ev) => buildReconcileUserPrompt(idx, ev, undefined, reconcileNotes),
|
|
1482
|
-
buildToolSet: () => wrapToolsWithLogger(buildReconcileToolSet({
|
|
1483
|
-
loadSkillTool: rcLoadSkill,
|
|
1484
|
-
stageListTool: rcStageListTool,
|
|
1485
|
-
stageDiffTool: rcStageDiffTool,
|
|
1486
|
-
evictionListTool: rcEvictionListTool,
|
|
1487
|
-
emitConflictResolutionTool: rcEmitConflictResolutionTool,
|
|
1488
|
-
emitEvictionDecisionTool: rcEmitEvictionDecisionTool,
|
|
1489
|
-
emitArtifactResolutionTool: rcEmitArtifactResolutionTool,
|
|
1490
|
-
emitUnmappedFallbackTool: rcEmitUnmappedFallbackTool,
|
|
1491
|
-
readRawSpanTool: rcRawSpanTool,
|
|
1492
|
-
toolsetTools: rcToolset.toRuntimeTools(rcToolContext),
|
|
1493
|
-
}), join(transcriptDir, 'reconcile.jsonl'), 'reconcile', { onEntry: recordTranscriptEntry(join(transcriptDir, 'reconcile.jsonl')) }),
|
|
1494
|
-
modelRole: 'reconcile',
|
|
1495
|
-
stepBudget: 60,
|
|
1496
|
-
sourceKey: job.sourceKey,
|
|
1497
|
-
jobId: job.jobId,
|
|
1498
|
-
force: !!overrideReport,
|
|
1499
|
-
onStepFinish: stage4
|
|
1500
|
-
? ({ stepIndex, stepBudget }) => {
|
|
1501
|
-
emitStageProgress('reconciliation', 85, `Reconciling results: step ${stepIndex}/${stepBudget}`, {
|
|
1502
|
-
transient: true,
|
|
1503
|
-
});
|
|
1504
|
-
void stage4.updateProgress(stepIndex / stepBudget, `Reconciling results · step ${stepIndex}`);
|
|
1505
|
-
}
|
|
1506
|
-
: undefined,
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
latestReconciliationSkipped = reconcileOutcome.skipped;
|
|
1510
|
-
const danglingReconcileWikiRefs = await findDanglingWikiRefsForActions({
|
|
1511
|
-
wikiService: rcScopedWiki,
|
|
1512
|
-
scope: 'GLOBAL',
|
|
1513
|
-
scopeId: null,
|
|
1514
|
-
actions: reconcileActions,
|
|
1515
|
-
});
|
|
1516
|
-
if (danglingReconcileWikiRefs.length > 0) {
|
|
1517
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1518
|
-
throw new Error(`wiki references target missing page(s): ${danglingReconcileWikiRefs.join(', ')}`);
|
|
1519
|
-
}
|
|
1520
|
-
const candidateSummaryAfterReconcile = contextReport && this.deps.contextEvidenceCandidates
|
|
1521
|
-
? await this.deps.contextEvidenceCandidates.getCandidateSummary(runRow.id)
|
|
1522
|
-
: null;
|
|
1523
|
-
memoryFlow?.emit({
|
|
1524
|
-
type: 'reconciliation_finished',
|
|
1525
|
-
conflictCount: stageIndex.conflictsResolved.length,
|
|
1526
|
-
fallbackCount: stageIndex.unmappedFallbacks.length,
|
|
1527
|
-
});
|
|
1528
|
-
await runTrace.event('debug', 'reconciliation', 'reconciliation_finished', {
|
|
1529
|
-
skipped: reconcileOutcome.skipped,
|
|
1530
|
-
stopReason: reconcileOutcome.stopReason ?? null,
|
|
1531
|
-
actionCount: reconcileActions.length,
|
|
1532
|
-
conflictCount: stageIndex.conflictsResolved.length,
|
|
1533
|
-
fallbackCount: stageIndex.unmappedFallbacks.length,
|
|
1534
|
-
artifactResolutionCount: stageIndex.artifactResolutions?.length ?? 0,
|
|
1535
|
-
});
|
|
1536
|
-
await stage4?.updateProgress(1.0, reconcileOutcome.skipped ? 'No reconciliation needed' : 'Reconciled');
|
|
1537
|
-
const preFinalizationSha = await sessionWorktree.git.revParseHead();
|
|
1538
|
-
const preFinalizationSourcesByConnection = await this.loadSourcesByConnection(sessionWorktree.workdir, slConnectionIds);
|
|
1539
|
-
let finalizationActions = [];
|
|
1540
|
-
let finalizationTouchedPaths = [];
|
|
1541
|
-
let finalizationTouchedSources = [];
|
|
1542
|
-
let finalizationChangedWikiPageKeys = [];
|
|
1543
|
-
let finalizationSha = null;
|
|
1544
|
-
activePhase = 'finalization';
|
|
1545
|
-
if (adapter.finalize) {
|
|
1546
|
-
const stageFinalization = ctx?.startPhase(0.04);
|
|
1547
|
-
emitStageProgress('finalization', 87, 'Running deterministic finalization');
|
|
1548
|
-
await stageFinalization?.updateProgress(0.0, 'Running deterministic finalization');
|
|
1549
|
-
await runTrace.event('debug', 'finalization', 'finalization_started', { sourceKey: job.sourceKey });
|
|
1550
|
-
const result = await adapter.finalize({
|
|
1551
|
-
connectionId: job.connectionId,
|
|
1552
|
-
sourceKey: job.sourceKey,
|
|
1553
|
-
syncId,
|
|
1554
|
-
jobId: job.jobId,
|
|
1555
|
-
runId: createdRunRow.id,
|
|
1556
|
-
stagedDir,
|
|
1557
|
-
workdir: sessionWorktree.workdir,
|
|
1558
|
-
...(overrideReport ? {} : { parseArtifacts }),
|
|
1559
|
-
stageIndex,
|
|
1560
|
-
workUnitOutcomes,
|
|
1561
|
-
reconciliationActions: reconcileActions,
|
|
1562
|
-
...(overrideReport
|
|
1563
|
-
? {
|
|
1564
|
-
overrideReplay: {
|
|
1565
|
-
priorJobId: overrideReport.jobId,
|
|
1566
|
-
priorRunId: overrideReport.runId,
|
|
1567
|
-
priorSyncId: overrideReport.body.syncId,
|
|
1568
|
-
evictionRawPaths: overrideReport.body.evictionInputs,
|
|
1569
|
-
},
|
|
1570
|
-
}
|
|
1571
|
-
: {}),
|
|
1572
|
-
});
|
|
1573
|
-
if (result.errors.length > 0) {
|
|
1574
|
-
finalizationOutcome = {
|
|
1575
|
-
sourceKey: job.sourceKey,
|
|
1576
|
-
status: 'failed',
|
|
1577
|
-
commitSha: null,
|
|
1578
|
-
touchedPaths: [],
|
|
1579
|
-
declaredTouchedSources: result.touchedSources,
|
|
1580
|
-
derivedTouchedSources: [],
|
|
1581
|
-
declaredChangedWikiPageKeys: result.changedWikiPageKeys,
|
|
1582
|
-
derivedChangedWikiPageKeys: [],
|
|
1583
|
-
mismatches: [],
|
|
1584
|
-
result: result.result,
|
|
1585
|
-
errors: result.errors,
|
|
1586
|
-
warnings: result.warnings,
|
|
1587
|
-
actions: result.actions ?? [],
|
|
1588
|
-
provenanceExclusions: [],
|
|
1589
|
-
};
|
|
1590
|
-
latestFinalizationOutcome = finalizationOutcome;
|
|
1591
|
-
await runTrace.event('error', 'finalization', 'finalization_failed', {
|
|
1592
|
-
sourceKey: job.sourceKey,
|
|
1593
|
-
errors: result.errors,
|
|
1594
|
-
warnings: result.warnings,
|
|
1595
|
-
});
|
|
1596
|
-
throw new Error(`deterministic finalization failed: ${result.errors.join('; ')}`);
|
|
1597
|
-
}
|
|
1598
|
-
const changedBeforeFinalization = new Set([
|
|
1599
|
-
...projectionTouchedPaths,
|
|
1600
|
-
...workUnitOutcomes.flatMap((outcome) => outcome.patchTouchedPaths ?? []),
|
|
1601
|
-
...(preReconciliationSha && preFinalizationSha !== preReconciliationSha
|
|
1602
|
-
? (await sessionWorktree.git.diffNameStatus(preReconciliationSha, preFinalizationSha)).map((entry) => entry.path)
|
|
1603
|
-
: []),
|
|
1604
|
-
]);
|
|
1605
|
-
finalizationTouchedPaths = await sessionWorktree.git.changedPaths();
|
|
1606
|
-
const overlapping = finalizationTouchedPaths.filter((path) => changedBeforeFinalization.has(path));
|
|
1607
|
-
if (overlapping.length > 0) {
|
|
1608
|
-
await runTrace.event('error', 'finalization', 'finalization_failed', {
|
|
1609
|
-
sourceKey: job.sourceKey,
|
|
1610
|
-
reason: 'path_overlap',
|
|
1611
|
-
overlappingPaths: overlapping.sort(),
|
|
1612
|
-
});
|
|
1613
|
-
throw new Error(`finalization modified path(s) already changed earlier in this run: ${overlapping.sort().join(', ')}`);
|
|
1614
|
-
}
|
|
1615
|
-
const finalizationCommit = finalizationTouchedPaths.length > 0
|
|
1616
|
-
? await sessionWorktree.git.commitFiles(finalizationTouchedPaths, `ingest(${job.sourceKey}): deterministic finalization syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email)
|
|
1617
|
-
: await sessionWorktree.git.commitStaged(`ingest(${job.sourceKey}): deterministic finalization syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email);
|
|
1618
|
-
finalizationSha = finalizationCommit.created ? finalizationCommit.commitHash : null;
|
|
1619
|
-
const postFinalizationSha = await sessionWorktree.git.revParseHead();
|
|
1620
|
-
finalizationTouchedPaths =
|
|
1621
|
-
preFinalizationSha !== postFinalizationSha
|
|
1622
|
-
? (await sessionWorktree.git.diffNameStatus(preFinalizationSha, postFinalizationSha)).map((entry) => entry.path)
|
|
1623
|
-
: [];
|
|
1624
|
-
const changedConnectionIds = [
|
|
1625
|
-
...new Set([
|
|
1626
|
-
...slConnectionIds,
|
|
1627
|
-
...finalizationTouchedPaths
|
|
1628
|
-
.filter((path) => path.startsWith('semantic-layer/'))
|
|
1629
|
-
.map((path) => path.split('/')[1])
|
|
1630
|
-
.filter((connectionId) => Boolean(connectionId)),
|
|
1631
|
-
]),
|
|
1632
|
-
].sort();
|
|
1633
|
-
const postFinalizationSourcesByConnection = await this.loadSourcesByConnection(sessionWorktree.workdir, changedConnectionIds);
|
|
1634
|
-
const scope = await deriveFinalizationTouchedSources({
|
|
1635
|
-
changedPaths: finalizationTouchedPaths,
|
|
1636
|
-
beforeSourcesByConnection: preFinalizationSourcesByConnection,
|
|
1637
|
-
afterSourcesByConnection: postFinalizationSourcesByConnection,
|
|
1638
|
-
});
|
|
1639
|
-
if (scope.unresolvedPaths.length > 0) {
|
|
1640
|
-
await runTrace.event('error', 'finalization', 'finalization_failed', {
|
|
1641
|
-
sourceKey: job.sourceKey,
|
|
1642
|
-
reason: 'unresolved_semantic_layer_paths',
|
|
1643
|
-
unresolvedPaths: scope.unresolvedPaths,
|
|
1644
|
-
});
|
|
1645
|
-
throw new Error(`could not resolve finalization semantic-layer path(s): ${scope.unresolvedPaths.join(', ')}`);
|
|
1646
|
-
}
|
|
1647
|
-
finalizationTouchedSources = scope.touchedSources;
|
|
1648
|
-
finalizationChangedWikiPageKeys = deriveFinalizationWikiPageKeys(finalizationTouchedPaths);
|
|
1649
|
-
const mismatches = compareFinalizationDeclarations({
|
|
1650
|
-
declaredTouchedSources: result.touchedSources,
|
|
1651
|
-
derivedTouchedSources: finalizationTouchedSources,
|
|
1652
|
-
declaredChangedWikiPageKeys: result.changedWikiPageKeys,
|
|
1653
|
-
derivedChangedWikiPageKeys: finalizationChangedWikiPageKeys,
|
|
1654
|
-
});
|
|
1655
|
-
if (mismatches.length > 0) {
|
|
1656
|
-
finalizationOutcome = {
|
|
1657
|
-
sourceKey: job.sourceKey,
|
|
1658
|
-
status: 'failed',
|
|
1659
|
-
commitSha: finalizationSha,
|
|
1660
|
-
touchedPaths: finalizationTouchedPaths,
|
|
1661
|
-
declaredTouchedSources: result.touchedSources,
|
|
1662
|
-
derivedTouchedSources: finalizationTouchedSources,
|
|
1663
|
-
declaredChangedWikiPageKeys: result.changedWikiPageKeys,
|
|
1664
|
-
derivedChangedWikiPageKeys: finalizationChangedWikiPageKeys,
|
|
1665
|
-
mismatches,
|
|
1666
|
-
result: result.result,
|
|
1667
|
-
errors: ['finalization touched artifact declaration mismatch'],
|
|
1668
|
-
warnings: result.warnings,
|
|
1669
|
-
actions: result.actions ?? [],
|
|
1670
|
-
provenanceExclusions: [],
|
|
1671
|
-
};
|
|
1672
|
-
latestFinalizationOutcome = finalizationOutcome;
|
|
1673
|
-
await runTrace.event('error', 'finalization', 'finalization_failed', {
|
|
1674
|
-
sourceKey: job.sourceKey,
|
|
1675
|
-
reason: 'declaration_mismatch',
|
|
1676
|
-
mismatches,
|
|
1677
|
-
});
|
|
1678
|
-
throw new Error(`finalization touched artifact declaration mismatch: ${mismatches
|
|
1679
|
-
.map((mismatch) => `${mismatch.direction}:${mismatch.artifactKind}:${mismatch.key}`)
|
|
1680
|
-
.join(', ')}`);
|
|
1681
|
-
}
|
|
1682
|
-
finalizationActions = result.actions ?? [];
|
|
1683
|
-
finalizationOutcome = {
|
|
1684
|
-
sourceKey: job.sourceKey,
|
|
1685
|
-
status: 'success',
|
|
1686
|
-
commitSha: finalizationSha,
|
|
1687
|
-
touchedPaths: finalizationTouchedPaths,
|
|
1688
|
-
declaredTouchedSources: result.touchedSources,
|
|
1689
|
-
derivedTouchedSources: finalizationTouchedSources,
|
|
1690
|
-
declaredChangedWikiPageKeys: result.changedWikiPageKeys,
|
|
1691
|
-
derivedChangedWikiPageKeys: finalizationChangedWikiPageKeys,
|
|
1692
|
-
mismatches,
|
|
1693
|
-
result: result.result,
|
|
1694
|
-
errors: [],
|
|
1695
|
-
warnings: result.warnings,
|
|
1696
|
-
actions: finalizationActions,
|
|
1697
|
-
provenanceExclusions: [],
|
|
1698
|
-
};
|
|
1699
|
-
latestFinalizationOutcome = finalizationOutcome;
|
|
1700
|
-
emitStageProgress('finalization', 88, 'Deterministic finalization complete');
|
|
1701
|
-
await stageFinalization?.updateProgress(1.0, 'Deterministic finalization complete');
|
|
1702
|
-
await runTrace.event('debug', 'finalization', 'finalization_committed', {
|
|
1703
|
-
sourceKey: job.sourceKey,
|
|
1704
|
-
commitSha: finalizationSha,
|
|
1705
|
-
touchedPaths: finalizationTouchedPaths,
|
|
1706
|
-
touchedSources: finalizationTouchedSources,
|
|
1707
|
-
changedWikiPageKeys: finalizationChangedWikiPageKeys,
|
|
1708
|
-
warnings: result.warnings,
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
else {
|
|
1712
|
-
await runTrace.event('debug', 'finalization', 'finalization_skipped', { sourceKey: job.sourceKey });
|
|
1713
|
-
}
|
|
1714
|
-
const repairConnectionIds = [
|
|
1715
|
-
...new Set([
|
|
1716
|
-
...slConnectionIds,
|
|
1717
|
-
...finalizationTouchedSources.map((source) => source.connectionId),
|
|
1718
|
-
]),
|
|
1719
|
-
].sort();
|
|
1720
|
-
activePhase = 'wiki_sl_ref_repair';
|
|
1721
|
-
emitStageProgress('wiki_sl_ref_repair', 88, 'Repairing wiki semantic-layer references');
|
|
1722
|
-
wikiSlRefRepairResult = await traceTimed(runTrace, 'wiki_sl_ref_repair', 'wiki_sl_refs_repair', { connectionIds: repairConnectionIds }, () => repairWikiSlRefs({
|
|
1723
|
-
wikiService: this.deps.wikiService.forWorktree(sessionWorktree.workdir),
|
|
1724
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1725
|
-
configService: sessionWorktree.config,
|
|
1726
|
-
connectionIds: repairConnectionIds,
|
|
1727
|
-
}));
|
|
1728
|
-
await runTrace.event('debug', 'wiki_sl_ref_repair', 'wiki_sl_refs_repaired', {
|
|
1729
|
-
repairCount: wikiSlRefRepairResult.repairs.length,
|
|
1730
|
-
repairs: wikiSlRefRepairResult.repairs,
|
|
1731
|
-
warnings: wikiSlRefRepairResult.warnings,
|
|
1732
|
-
});
|
|
1733
|
-
emitStageProgress('wiki_sl_ref_repair', 88, 'Checked wiki semantic-layer references');
|
|
1734
|
-
const postReconciliationSha = await sessionWorktree.git.revParseHead();
|
|
1735
|
-
const postReconciliationPaths = preReconciliationSha && postReconciliationSha && preReconciliationSha !== postReconciliationSha
|
|
1736
|
-
? (await sessionWorktree.git.diffNameStatus(preReconciliationSha, postReconciliationSha)).map((entry) => entry.path)
|
|
1737
|
-
: [];
|
|
1738
|
-
const baseFinalChangedWikiPageKeys = this.uniqueWikiPageKeys([
|
|
1739
|
-
...(isolatedDiffEnabled ? projectionChangedWikiPageKeys : []),
|
|
1740
|
-
...workUnitOutcomes
|
|
1741
|
-
.flatMap((outcome) => outcome.patchTouchedPaths ?? [])
|
|
1742
|
-
.flatMap((path) => this.wikiPageKeysFromPaths([path])),
|
|
1743
|
-
...this.wikiPageKeysFromActions(reconcileActions),
|
|
1744
|
-
...finalizationChangedWikiPageKeys,
|
|
1745
|
-
...postReconciliationPaths.flatMap((path) => this.wikiPageKeysFromPaths([path])),
|
|
1746
|
-
...wikiSlRefRepairResult.repairs.filter((repair) => repair.scope === 'GLOBAL').map((repair) => repair.pageKey),
|
|
1747
|
-
]);
|
|
1748
|
-
const finalTouchedSlSources = this.uniqueTouchedSlSources([
|
|
1749
|
-
...(isolatedDiffEnabled ? projectionTouchedSources : []),
|
|
1750
|
-
...workUnitOutcomes.flatMap((outcome) => outcome.touchedSlSources),
|
|
1751
|
-
...this.touchedSlSourcesFromActions(reconcileActions, job.connectionId),
|
|
1752
|
-
...this.touchedSlSourcesFromPaths(postReconciliationPaths),
|
|
1753
|
-
...finalizationTouchedSources,
|
|
1754
|
-
]);
|
|
1755
|
-
const finalWikiGateScope = await this.wikiPageKeysForFinalGates({
|
|
1756
|
-
wikiService: this.deps.wikiService.forWorktree(sessionWorktree.workdir),
|
|
1757
|
-
changedWikiPageKeys: baseFinalChangedWikiPageKeys,
|
|
1758
|
-
touchedSlSources: finalTouchedSlSources,
|
|
1759
|
-
actions: [...stageIndex.workUnits.flatMap((wu) => wu.actions), ...reconcileActions],
|
|
1760
|
-
});
|
|
1761
|
-
const finalChangedWikiPageKeys = finalWikiGateScope.pageKeys;
|
|
1762
|
-
const finalTargetPolicyPaths = [
|
|
1763
|
-
...projectionTouchedPaths,
|
|
1764
|
-
...workUnitOutcomes.flatMap((outcome) => outcome.patchTouchedPaths ?? []),
|
|
1765
|
-
...postReconciliationPaths,
|
|
1766
|
-
...finalizationTouchedPaths,
|
|
1767
|
-
];
|
|
1768
|
-
const targetPolicyTraceData = {
|
|
1769
|
-
allowedTargetConnectionIds: slConnectionIds,
|
|
1770
|
-
touchedPaths: [...new Set(finalTargetPolicyPaths)].sort(),
|
|
1771
|
-
};
|
|
1772
|
-
activePhase = 'target_policy';
|
|
1773
|
-
activeFailureDetails = targetPolicyTraceData;
|
|
1774
|
-
emitStageProgress('final_gates', 88, 'Checking semantic-layer target policy');
|
|
1775
|
-
await traceTimed(runTrace, 'target_policy', 'semantic_layer_target_policy', targetPolicyTraceData, async () => {
|
|
1776
|
-
assertSemanticLayerTargetPathsAllowed({
|
|
1777
|
-
paths: finalTargetPolicyPaths,
|
|
1778
|
-
allowedConnectionIds: new Set(slConnectionIds),
|
|
1779
|
-
});
|
|
1780
|
-
});
|
|
1781
|
-
activeFailureDetails = undefined;
|
|
1782
|
-
const finalArtifactGateTraceData = {
|
|
1783
|
-
changedWikiPageKeys: finalChangedWikiPageKeys,
|
|
1784
|
-
wikiReferenceGateScope: finalWikiGateScope.trace,
|
|
1785
|
-
touchedSlSources: finalTouchedSlSources,
|
|
1786
|
-
projectionTouchedPaths,
|
|
1787
|
-
workUnitPatchTouchedPaths: workUnitOutcomes.flatMap((outcome) => outcome.patchTouchedPaths ?? []),
|
|
1788
|
-
actionOrigins: this.finalGateActionOrigins({
|
|
1789
|
-
stageIndex,
|
|
1790
|
-
reconcileActions,
|
|
1791
|
-
fallbackConnectionId: job.connectionId,
|
|
1792
|
-
}),
|
|
1793
|
-
preReconciliationSha,
|
|
1794
|
-
postReconciliationSha,
|
|
1795
|
-
postReconciliationPaths,
|
|
1796
|
-
reconciliationActionCount: reconcileActions.length,
|
|
1797
|
-
wikiSlRefRepairCount: wikiSlRefRepairResult.repairs.length,
|
|
1798
|
-
};
|
|
1799
|
-
activePhase = 'final_gates';
|
|
1800
|
-
activeFailureDetails = finalArtifactGateTraceData;
|
|
1801
|
-
emitStageProgress('final_gates', 89, 'Running final artifact gates');
|
|
1802
|
-
try {
|
|
1803
|
-
await traceTimed(runTrace, 'final_gates', 'final_artifact_gates', finalArtifactGateTraceData, async () => {
|
|
1804
|
-
await validateFinalIngestArtifacts({
|
|
1805
|
-
connectionIds: repairConnectionIds,
|
|
1806
|
-
changedWikiPageKeys: finalChangedWikiPageKeys,
|
|
1807
|
-
touchedSlSources: finalTouchedSlSources,
|
|
1808
|
-
wikiService: this.deps.wikiService.forWorktree(sessionWorktree.workdir),
|
|
1809
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1810
|
-
validateTouchedSources: (touched) => validateWuTouchedSources({
|
|
1811
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1812
|
-
connections: this.deps.connections,
|
|
1813
|
-
configService: sessionWorktree.config,
|
|
1814
|
-
gitService: sessionWorktree.git,
|
|
1815
|
-
slSourcesRepository: this.deps.slSourcesRepository,
|
|
1816
|
-
probeRowCount: this.deps.settings.probeRowCount,
|
|
1817
|
-
slValidator: this.deps.slValidator,
|
|
1818
|
-
}, touched),
|
|
1819
|
-
tableExists: (connectionId, tableRef) => this.tableRefExistsInSemanticLayer(this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir), [connectionId], tableRef),
|
|
1820
|
-
});
|
|
1821
|
-
});
|
|
1822
|
-
}
|
|
1823
|
-
catch (error) {
|
|
1824
|
-
const gateError = this.errorMessage(error);
|
|
1825
|
-
const repairPaths = finalGateRepairPaths({
|
|
1826
|
-
changedWikiPageKeys: finalChangedWikiPageKeys,
|
|
1827
|
-
touchedSlSources: finalTouchedSlSources,
|
|
1828
|
-
});
|
|
1829
|
-
emitStageProgress('final_gates', 89, 'Repairing final artifact gates');
|
|
1830
|
-
const gateRepair = await repairFinalGateFailure({
|
|
1831
|
-
agentRunner: this.deps.agentRunner,
|
|
1832
|
-
workdir: sessionWorktree.workdir,
|
|
1833
|
-
gateError,
|
|
1834
|
-
allowedPaths: repairPaths,
|
|
1835
|
-
trace: runTrace,
|
|
1836
|
-
repairKind: 'final_artifact_gate',
|
|
1837
|
-
maxAttempts: 1,
|
|
1838
|
-
stepBudget: 16,
|
|
1839
|
-
});
|
|
1840
|
-
isolatedDiffSummary.gateRepairAttempts += gateRepair.attempts;
|
|
1841
|
-
if (gateRepair.status === 'failed') {
|
|
1842
|
-
isolatedDiffSummary.gateRepairFailures += 1;
|
|
1843
|
-
activeFailureDetails = {
|
|
1844
|
-
...finalArtifactGateTraceData,
|
|
1845
|
-
gateRepair,
|
|
1846
|
-
gateError,
|
|
1847
|
-
};
|
|
1848
|
-
throw new Error(`${gateError}\ngate repair failed: ${gateRepair.reason}`);
|
|
1849
|
-
}
|
|
1850
|
-
isolatedDiffSummary.gateRepairs += 1;
|
|
1851
|
-
await traceTimed(runTrace, 'final_gates', 'final_artifact_gates_after_gate_repair', {
|
|
1852
|
-
...finalArtifactGateTraceData,
|
|
1853
|
-
repairedPaths: gateRepair.changedPaths,
|
|
1854
|
-
}, async () => {
|
|
1855
|
-
await validateFinalIngestArtifacts({
|
|
1856
|
-
connectionIds: repairConnectionIds,
|
|
1857
|
-
changedWikiPageKeys: finalChangedWikiPageKeys,
|
|
1858
|
-
touchedSlSources: finalTouchedSlSources,
|
|
1859
|
-
wikiService: this.deps.wikiService.forWorktree(sessionWorktree.workdir),
|
|
1860
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1861
|
-
validateTouchedSources: (touched) => validateWuTouchedSources({
|
|
1862
|
-
semanticLayerService: this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir),
|
|
1863
|
-
connections: this.deps.connections,
|
|
1864
|
-
configService: sessionWorktree.config,
|
|
1865
|
-
gitService: sessionWorktree.git,
|
|
1866
|
-
slSourcesRepository: this.deps.slSourcesRepository,
|
|
1867
|
-
probeRowCount: this.deps.settings.probeRowCount,
|
|
1868
|
-
slValidator: this.deps.slValidator,
|
|
1869
|
-
}, touched),
|
|
1870
|
-
tableExists: (connectionId, tableRef) => this.tableRefExistsInSemanticLayer(this.deps.semanticLayerService.forWorktree(sessionWorktree.workdir), [connectionId], tableRef),
|
|
1871
|
-
});
|
|
1872
|
-
});
|
|
1873
|
-
const repairCommit = await sessionWorktree.git.commitFiles(gateRepair.changedPaths, `ingest(${job.sourceKey}): repair final gates syncId=${syncId}`, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email);
|
|
1874
|
-
if (!repairCommit.created) {
|
|
1875
|
-
isolatedDiffSummary.gateRepairFailures += 1;
|
|
1876
|
-
throw new Error('final gate repair produced no committable changes');
|
|
1877
|
-
}
|
|
1878
|
-
await runTrace.event('debug', 'final_gates', 'final_gate_repair_committed', {
|
|
1879
|
-
commitSha: repairCommit.commitHash,
|
|
1880
|
-
repairedPaths: gateRepair.changedPaths,
|
|
1881
|
-
});
|
|
1882
|
-
}
|
|
1883
|
-
activeFailureDetails = undefined;
|
|
1884
|
-
activePhase = 'provenance_validation';
|
|
1885
|
-
emitStageProgress('provenance', 90, 'Validating provenance rows');
|
|
1886
|
-
latestReportWorkUnits = this.toReportWorkUnits(stageIndex);
|
|
1887
|
-
latestReconciliationActions = reconcileActions;
|
|
1888
|
-
latestConflictsResolved = stageIndex.conflictsResolved;
|
|
1889
|
-
latestEvictionsApplied = stageIndex.evictionsApplied;
|
|
1890
|
-
latestUnmappedFallbacks = stageIndex.unmappedFallbacks;
|
|
1891
|
-
latestArtifactResolutions = stageIndex.artifactResolutions ?? [];
|
|
1892
|
-
latestEvictionInputs = eviction?.deletedRawPaths ?? [];
|
|
1893
|
-
latestUnresolvedCards = unresolvedCards ?? [];
|
|
1894
|
-
const finalizationProvenance = this.partitionFinalizationActionsForProvenance({
|
|
1895
|
-
actions: finalizationActions,
|
|
1896
|
-
currentRawPaths: new Set(currentHashes.keys()),
|
|
1897
|
-
currentEvictionRawPaths: new Set(stageIndex.evictionsApplied.map((entry) => entry.rawPath)),
|
|
1898
|
-
overrideEvictionRawPaths: new Set(overrideReport?.body.evictionInputs ?? []),
|
|
1899
|
-
});
|
|
1900
|
-
if (finalizationOutcome) {
|
|
1901
|
-
finalizationOutcome.provenanceExclusions = finalizationProvenance.exclusions;
|
|
1902
|
-
latestFinalizationOutcome = finalizationOutcome;
|
|
1903
|
-
}
|
|
1904
|
-
const provenancePlan = this.buildProvenancePlan({
|
|
1905
|
-
job,
|
|
1906
|
-
syncId,
|
|
1907
|
-
currentHashes,
|
|
1908
|
-
stageIndex,
|
|
1909
|
-
reconcileActions,
|
|
1910
|
-
finalizationActions: finalizationProvenance.actions,
|
|
1911
|
-
});
|
|
1912
|
-
const provenanceRows = provenancePlan.rows;
|
|
1913
|
-
const currentRawPaths = new Set(currentHashes.keys());
|
|
1914
|
-
const deletedRawPaths = new Set(eviction?.deletedRawPaths ?? []);
|
|
1915
|
-
const provenanceValidationData = this.provenanceValidationTraceData({
|
|
1916
|
-
plan: provenancePlan,
|
|
1917
|
-
currentRawPaths,
|
|
1918
|
-
deletedRawPaths,
|
|
1919
|
-
});
|
|
1920
|
-
const reportProvenanceRows = this.toReportProvenanceRows(provenanceRows);
|
|
1921
|
-
latestReportProvenanceRows = reportProvenanceRows;
|
|
1922
|
-
activeFailureDetails = provenanceValidationData;
|
|
1923
|
-
await traceTimed(runTrace, 'provenance', 'provenance_rows_validation', provenanceValidationData, async () => {
|
|
1924
|
-
validateProvenanceRawPaths({
|
|
1925
|
-
rows: provenanceRows,
|
|
1926
|
-
currentRawPaths,
|
|
1927
|
-
deletedRawPaths,
|
|
1928
|
-
});
|
|
1929
|
-
});
|
|
1930
|
-
activeFailureDetails = undefined;
|
|
1931
|
-
// Stage 6 — squash commit
|
|
1932
|
-
activePhase = 'squash';
|
|
1933
|
-
const stage6 = ctx?.startPhase(0.04);
|
|
1934
|
-
emitStageProgress('save', 91, 'Saving changes');
|
|
1935
|
-
await stage6?.updateProgress(0.0, 'Saving changes');
|
|
1936
|
-
try {
|
|
1937
|
-
await sessionWorktree.git.assertWorktreeClean();
|
|
1938
|
-
}
|
|
1939
|
-
catch (error) {
|
|
1940
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1941
|
-
throw error;
|
|
1942
|
-
}
|
|
1943
|
-
const commitMessage = this.buildCommitMessage(job, syncId, diffSummary, failedWorkUnits);
|
|
1944
|
-
const squashResult = await this.deps.lockingService.withLock('config:repo', async () => {
|
|
1945
|
-
const preSquashSha = await this.deps.gitService.revParseHead();
|
|
1946
|
-
const merge = await this.deps.gitService.squashMergeIntoMain(sessionWorktree.branch, this.deps.storage.systemGitAuthor.name, this.deps.storage.systemGitAuthor.email, commitMessage);
|
|
1947
|
-
return { preSquashSha, merge };
|
|
1948
|
-
});
|
|
1949
|
-
const mergeResult = squashResult.merge;
|
|
1950
|
-
if (!mergeResult.ok) {
|
|
1951
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
1952
|
-
throw new Error(`squash merge conflict: ${mergeResult.conflictPaths.join(', ')}`);
|
|
1953
|
-
}
|
|
1954
|
-
const commitSha = mergeResult.touchedPaths.length === 0 ? null : mergeResult.squashSha;
|
|
1955
|
-
await runTrace.event('debug', 'squash', 'squash_finished', {
|
|
1956
|
-
commitSha,
|
|
1957
|
-
touchedPaths: mergeResult.touchedPaths,
|
|
1958
|
-
});
|
|
1959
|
-
const memoryFlowSavedActions = stageIndex.workUnits
|
|
1960
|
-
.flatMap((wu) => wu.actions)
|
|
1961
|
-
.concat(reconcileActions)
|
|
1962
|
-
.concat(finalizationActions);
|
|
1963
|
-
memoryFlow?.emit({
|
|
1964
|
-
type: 'saved',
|
|
1965
|
-
commitSha,
|
|
1966
|
-
wikiCount: countMemoryFlowActions(memoryFlowSavedActions, 'wiki'),
|
|
1967
|
-
slCount: countMemoryFlowActions(memoryFlowSavedActions, 'sl'),
|
|
1968
|
-
});
|
|
1969
|
-
await stage6?.updateProgress(1.0, commitSha ? `Saved changes (${commitSha.slice(0, 8)})` : 'No changes to save');
|
|
1970
|
-
// Sync the shared `knowledge` index from the squashed diff in a single
|
|
1971
|
-
// transaction. If this throws, the run fails and no partial index state
|
|
1972
|
-
// survives (thanks to the transactional upsert in applyDiffTransactional).
|
|
1973
|
-
if (commitSha) {
|
|
1974
|
-
// Multi-file squash → omit path so the handler diffs the whole commit
|
|
1975
|
-
// (a comma-joined pathspec would match nothing and the job would no-op).
|
|
1976
|
-
const pathFilter = mergeResult.touchedPaths.length === 1 ? mergeResult.touchedPaths[0] : '';
|
|
1977
|
-
await this.deps.commitMessages.enqueueForExternalCommit({ commitHash: commitSha }, commitMessage, pathFilter);
|
|
1978
|
-
await this.deps.wikiService.syncFromCommit(squashResult.preSquashSha, commitSha, runRow.id);
|
|
1979
|
-
await this.syncKnowledgeSlRefsFromActions(job.connectionId, memoryFlowSavedActions);
|
|
1980
|
-
const touchedConnections = [
|
|
1981
|
-
...new Set(memoryFlowSavedActions
|
|
1982
|
-
.filter((action) => action.target === 'sl')
|
|
1983
|
-
.map((action) => actionTargetConnectionId(action, job.connectionId))
|
|
1984
|
-
.concat(finalizationTouchedSources.map((source) => source.connectionId))),
|
|
1985
|
-
].sort();
|
|
1986
|
-
for (const connectionId of touchedConnections) {
|
|
1987
|
-
try {
|
|
1988
|
-
const { sources: allSources } = await this.deps.semanticLayerService.loadAllSources(connectionId);
|
|
1989
|
-
await this.deps.slSearchService.indexSources(connectionId, allSources);
|
|
1990
|
-
}
|
|
1991
|
-
catch (err) {
|
|
1992
|
-
this.logger.warn(`[ingest-bundle] post-squash SL reindex failed for connection=${connectionId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
}
|
|
1996
|
-
const stage5 = ctx?.startPhase(0.04);
|
|
1997
|
-
emitStageProgress('provenance', 95, 'Recording history');
|
|
1998
|
-
await stage5?.updateProgress(0.0, 'Recording history');
|
|
1999
|
-
activePhase = 'provenance';
|
|
2000
|
-
await this.deps.provenance.insertMany(provenanceRows);
|
|
2001
|
-
await runTrace.event('debug', 'provenance', 'provenance_rows_inserted', {
|
|
2002
|
-
rowCount: provenanceRows.length,
|
|
2003
|
-
});
|
|
2004
|
-
memoryFlow?.emit({ type: 'provenance_recorded', rowCount: provenanceRows.length });
|
|
2005
|
-
await stage5?.updateProgress(1.0, `Recorded ${provenanceRows.length} history entr${provenanceRows.length === 1 ? 'y' : 'ies'}`);
|
|
2006
|
-
const stage7 = ctx?.startPhase(0.04);
|
|
2007
|
-
emitStageProgress('report', 97, 'Wrapping up');
|
|
2008
|
-
await stage7?.updateProgress(0.0, 'Wrapping up');
|
|
2009
|
-
activePhase = 'report';
|
|
2010
|
-
const reportToolTranscripts = Array.from(transcriptSummaries.values()).map((summary) => ({
|
|
2011
|
-
unitKey: summary.unitKey,
|
|
2012
|
-
path: summary.path,
|
|
2013
|
-
toolCallCount: summary.toolCallCount,
|
|
2014
|
-
errorCount: summary.errorCount,
|
|
2015
|
-
toolNames: Array.from(summary.toolNames).sort(),
|
|
2016
|
-
}));
|
|
2017
|
-
const capturedMemoryFlow = memoryFlow?.snapshot();
|
|
2018
|
-
const reportMemoryFlow = capturedMemoryFlow
|
|
2019
|
-
? {
|
|
2020
|
-
...capturedMemoryFlow,
|
|
2021
|
-
metadata: {
|
|
2022
|
-
schemaVersion: 1,
|
|
2023
|
-
mode: 'full',
|
|
2024
|
-
origin: 'captured',
|
|
2025
|
-
timing: 'captured',
|
|
2026
|
-
capturedAt: new Date().toISOString(),
|
|
2027
|
-
sourceReportId: null,
|
|
2028
|
-
sourceReportPath: null,
|
|
2029
|
-
fallbackReason: null,
|
|
2030
|
-
},
|
|
2031
|
-
}
|
|
2032
|
-
: undefined;
|
|
2033
|
-
const reportBody = {
|
|
2034
|
-
status: 'completed',
|
|
2035
|
-
syncId,
|
|
2036
|
-
diffSummary,
|
|
2037
|
-
fetch: fetchReport ?? undefined,
|
|
2038
|
-
commitSha,
|
|
2039
|
-
tracePath: runTrace.tracePath,
|
|
2040
|
-
isolatedDiff: !overrideReport ? isolatedDiffSummary : undefined,
|
|
2041
|
-
workUnits: stageIndex.workUnits.map((wu) => ({
|
|
2042
|
-
unitKey: wu.unitKey,
|
|
2043
|
-
rawFiles: wu.rawFiles,
|
|
2044
|
-
status: wu.status,
|
|
2045
|
-
reason: wu.reason,
|
|
2046
|
-
actions: wu.actions,
|
|
2047
|
-
touchedSlSources: wu.touchedSlSources,
|
|
2048
|
-
slDisallowed: wu.slDisallowed,
|
|
2049
|
-
slDisallowedReason: wu.slDisallowedReason,
|
|
2050
|
-
})),
|
|
2051
|
-
failedWorkUnits,
|
|
2052
|
-
reconciliationSkipped: reconcileOutcome.skipped,
|
|
2053
|
-
conflictsResolved: stageIndex.conflictsResolved,
|
|
2054
|
-
evictionsApplied: stageIndex.evictionsApplied,
|
|
2055
|
-
unmappedFallbacks: stageIndex.unmappedFallbacks,
|
|
2056
|
-
artifactResolutions: stageIndex.artifactResolutions ?? [],
|
|
2057
|
-
evictionInputs: eviction?.deletedRawPaths ?? [],
|
|
2058
|
-
reconciliationActions: reconcileActions,
|
|
2059
|
-
evictionDecisions: rcToolSession.evictionDecisions ?? [],
|
|
2060
|
-
unresolvedCards: unresolvedCards ?? [],
|
|
2061
|
-
supersededBy: null,
|
|
2062
|
-
overrideOf: overrideReport?.jobId ?? null,
|
|
2063
|
-
provenanceRows: reportProvenanceRows,
|
|
2064
|
-
toolTranscripts: reportToolTranscripts,
|
|
2065
|
-
finalization: finalizationOutcome,
|
|
2066
|
-
wikiSlRefRepairs: wikiSlRefRepairResult.repairs,
|
|
2067
|
-
wikiSlRefRepairWarnings: wikiSlRefRepairResult.warnings,
|
|
2068
|
-
...(reportMemoryFlow ? { memoryFlow: reportMemoryFlow } : {}),
|
|
2069
|
-
context: contextReport
|
|
2070
|
-
? {
|
|
2071
|
-
documentsIndexed: contextReport.documentsIndexed,
|
|
2072
|
-
chunksIndexed: contextReport.chunksIndexed,
|
|
2073
|
-
documentsDeleted: contextReport.documentsDeleted,
|
|
2074
|
-
embeddingFailures: contextReport.embeddingFailures,
|
|
2075
|
-
candidatesCreated: candidateSummaryAfterReconcile?.total ?? 0,
|
|
2076
|
-
candidatesPromoted: candidateSummaryAfterReconcile?.promoted ?? 0,
|
|
2077
|
-
candidatesRejected: candidateSummaryAfterReconcile?.rejected ?? 0,
|
|
2078
|
-
triage: triageResult?.report,
|
|
2079
|
-
dedup: dedupResult?.enabled
|
|
2080
|
-
? {
|
|
2081
|
-
candidatesIn: dedupResult.candidatesIn,
|
|
2082
|
-
clustersOut: dedupResult.clustersOut,
|
|
2083
|
-
mergedCount: dedupResult.mergedCount,
|
|
2084
|
-
largestClusterSize: dedupResult.largestClusterSize,
|
|
2085
|
-
embeddingFailures: dedupResult.embeddingFailures,
|
|
2086
|
-
}
|
|
2087
|
-
: undefined,
|
|
2088
|
-
curator: curatorReport ?? undefined,
|
|
2089
|
-
knowledgeCreates: stageIndex.workUnits
|
|
2090
|
-
.flatMap((wu) => wu.actions)
|
|
2091
|
-
.concat(reconcileActions)
|
|
2092
|
-
.filter((action) => action.target === 'wiki' && action.type === 'created').length,
|
|
2093
|
-
knowledgeUpdates: stageIndex.workUnits
|
|
2094
|
-
.flatMap((wu) => wu.actions)
|
|
2095
|
-
.concat(reconcileActions)
|
|
2096
|
-
.filter((action) => action.target === 'wiki' && action.type === 'updated').length,
|
|
2097
|
-
capped: sourceContextReport?.capped ?? false,
|
|
2098
|
-
warnings: [
|
|
2099
|
-
...new Set([
|
|
2100
|
-
...contextReport.warnings,
|
|
2101
|
-
...(sourceContextReport?.warnings ?? []),
|
|
2102
|
-
...(triageResult?.warnings ?? []),
|
|
2103
|
-
...(carryForwardResult?.warnings ?? []),
|
|
2104
|
-
...(dedupResult?.warnings ?? []),
|
|
2105
|
-
...curatorWarnings,
|
|
2106
|
-
]),
|
|
2107
|
-
],
|
|
2108
|
-
}
|
|
2109
|
-
: undefined,
|
|
2110
|
-
};
|
|
2111
|
-
const createdReport = await this.deps.reports.create({
|
|
2112
|
-
runId: runRow.id,
|
|
2113
|
-
jobId: job.jobId,
|
|
2114
|
-
connectionId: job.connectionId,
|
|
2115
|
-
sourceKey: job.sourceKey,
|
|
2116
|
-
body: reportBody,
|
|
2117
|
-
});
|
|
2118
|
-
const reportId = reportIdFromCreateResult(createdReport);
|
|
2119
|
-
await runTrace.event('debug', 'report', 'success_report_created', {
|
|
2120
|
-
reportId,
|
|
2121
|
-
runId: runRow.id,
|
|
2122
|
-
tracePath: runTrace.tracePath,
|
|
2123
|
-
});
|
|
2124
|
-
memoryFlow?.update({
|
|
2125
|
-
...(reportId ? { reportId, reportPath: reportId } : {}),
|
|
2126
|
-
});
|
|
2127
|
-
memoryFlow?.emit({
|
|
2128
|
-
type: 'report_created',
|
|
2129
|
-
runId: runRow.id,
|
|
2130
|
-
...(reportId ? { reportPath: reportId } : {}),
|
|
2131
|
-
});
|
|
2132
|
-
if (overrideReport) {
|
|
2133
|
-
await this.deps.reports.markSuperseded(overrideReport.jobId, job.jobId);
|
|
2134
|
-
}
|
|
2135
|
-
if (contextReport && this.deps.contextEvidenceIndex) {
|
|
2136
|
-
await this.deps.contextEvidenceIndex.publishSync({
|
|
2137
|
-
connectionId: job.connectionId,
|
|
2138
|
-
sourceKey: job.sourceKey,
|
|
2139
|
-
syncId,
|
|
2140
|
-
diffSet,
|
|
2141
|
-
});
|
|
2142
|
-
}
|
|
2143
|
-
// Stage 7 — status
|
|
2144
|
-
await this.deps.runs.markCompleted(runRow.id, diffSummary, fetchReport?.status === 'partial' ? 'partial' : 'completed');
|
|
2145
|
-
if (job.bundleRef.kind === 'scheduled_pull') {
|
|
2146
|
-
await adapter.onPullSucceeded?.({
|
|
2147
|
-
connectionId: job.connectionId,
|
|
2148
|
-
sourceKey: job.sourceKey,
|
|
2149
|
-
syncId,
|
|
2150
|
-
trigger: job.trigger,
|
|
2151
|
-
completedAt: new Date(),
|
|
2152
|
-
stagedDir,
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
await stage7?.updateProgress(1.0, 'Done');
|
|
2156
|
-
await runTrace.event('info', 'run', 'ingest_finished', {
|
|
2157
|
-
status: 'completed',
|
|
2158
|
-
commitSha,
|
|
2159
|
-
failedWorkUnits,
|
|
2160
|
-
tracePath: runTrace.tracePath,
|
|
2161
|
-
});
|
|
2162
|
-
cleanupOutcome = 'success';
|
|
2163
|
-
return {
|
|
2164
|
-
runId: runRow.id,
|
|
2165
|
-
syncId,
|
|
2166
|
-
diffSummary,
|
|
2167
|
-
workUnitCount: workUnits.length,
|
|
2168
|
-
failedWorkUnits,
|
|
2169
|
-
artifactsWritten: provenanceRows.filter((r) => r.actionType !== 'skipped').length,
|
|
2170
|
-
commitSha,
|
|
2171
|
-
};
|
|
2172
|
-
}
|
|
2173
|
-
finally {
|
|
2174
|
-
await this.deps.sessionWorktreeService.cleanup(sessionWorktree, cleanupOutcome);
|
|
2175
|
-
}
|
|
2176
|
-
}
|
|
2177
|
-
catch (error) {
|
|
2178
|
-
await activeTrace.event('error', 'run', 'ingest_failed', {
|
|
2179
|
-
tracePath: activeTrace.tracePath,
|
|
2180
|
-
phase: activePhase,
|
|
2181
|
-
runId: runRow?.id ?? null,
|
|
2182
|
-
syncId,
|
|
2183
|
-
}, error);
|
|
2184
|
-
if (runRow) {
|
|
2185
|
-
await this.deps.runs.markFailed(runRow.id);
|
|
2186
|
-
await this.deps.reports.create({
|
|
2187
|
-
runId: runRow.id,
|
|
2188
|
-
jobId: job.jobId,
|
|
2189
|
-
connectionId: job.connectionId,
|
|
2190
|
-
sourceKey: job.sourceKey,
|
|
2191
|
-
body: {
|
|
2192
|
-
status: 'failed',
|
|
2193
|
-
syncId,
|
|
2194
|
-
diffSummary: latestDiffSummary,
|
|
2195
|
-
commitSha: null,
|
|
2196
|
-
tracePath: activeTrace.tracePath,
|
|
2197
|
-
isolatedDiff: latestIsolatedDiffSummary,
|
|
2198
|
-
failure: {
|
|
2199
|
-
phase: activePhase,
|
|
2200
|
-
message: this.errorMessage(error),
|
|
2201
|
-
...(activeFailureDetails ? { details: activeFailureDetails } : {}),
|
|
2202
|
-
},
|
|
2203
|
-
workUnits: latestReportWorkUnits.length > 0
|
|
2204
|
-
? latestReportWorkUnits
|
|
2205
|
-
: latestWorkUnits.map((wu) => ({
|
|
2206
|
-
unitKey: wu.unitKey,
|
|
2207
|
-
rawFiles: [],
|
|
2208
|
-
status: wu.status,
|
|
2209
|
-
reason: wu.reason,
|
|
2210
|
-
actions: wu.actions,
|
|
2211
|
-
touchedSlSources: wu.touchedSlSources,
|
|
2212
|
-
slDisallowed: wu.slDisallowed,
|
|
2213
|
-
slDisallowedReason: wu.slDisallowedReason,
|
|
2214
|
-
})),
|
|
2215
|
-
failedWorkUnits: latestFailedWorkUnits,
|
|
2216
|
-
reconciliationSkipped: latestReconciliationSkipped,
|
|
2217
|
-
conflictsResolved: latestConflictsResolved,
|
|
2218
|
-
evictionsApplied: latestEvictionsApplied,
|
|
2219
|
-
unmappedFallbacks: latestUnmappedFallbacks,
|
|
2220
|
-
artifactResolutions: latestArtifactResolutions,
|
|
2221
|
-
evictionInputs: latestEvictionInputs,
|
|
2222
|
-
reconciliationActions: latestReconciliationActions,
|
|
2223
|
-
finalization: latestFinalizationOutcome,
|
|
2224
|
-
evictionDecisions: [],
|
|
2225
|
-
unresolvedCards: latestUnresolvedCards,
|
|
2226
|
-
supersededBy: null,
|
|
2227
|
-
overrideOf: null,
|
|
2228
|
-
provenanceRows: latestReportProvenanceRows,
|
|
2229
|
-
toolTranscripts: Array.from(transcriptSummaries.values()).map((summary) => ({
|
|
2230
|
-
unitKey: summary.unitKey,
|
|
2231
|
-
path: summary.path,
|
|
2232
|
-
toolCallCount: summary.toolCallCount,
|
|
2233
|
-
errorCount: summary.errorCount,
|
|
2234
|
-
toolNames: Array.from(summary.toolNames).sort(),
|
|
2235
|
-
})),
|
|
2236
|
-
},
|
|
2237
|
-
});
|
|
2238
|
-
await activeTrace.event('info', 'report', 'failure_report_created', {
|
|
2239
|
-
runId: runRow.id,
|
|
2240
|
-
jobId: job.jobId,
|
|
2241
|
-
tracePath: activeTrace.tracePath,
|
|
2242
|
-
});
|
|
2243
|
-
}
|
|
2244
|
-
throw error;
|
|
2245
|
-
}
|
|
2246
|
-
}
|
|
2247
|
-
}
|