feat(cli)!: remove fast mode; ktx ingest always builds enriched context (KLO-721)

Fast mode (the ktx ingest --fast/--deep database-ingest depth toggle) is removed.
ktx ingest now always builds the full enriched ("deep") context. There is no
structural fallback: a database connection without a configured model and
embeddings fails the enrichment-readiness preflight before any work runs, with
a 'Run ktx setup to configure a model and embeddings' hint.

- Remove --fast/--deep flags, the per-connection context.depth field, and the
  ktx setup depth prompt (delete setup-database-context-depth.ts).
- Rename ingest-depth.ts -> connection-drivers.ts; ingest always requests scan
  mode 'enriched'; readiness gate (enrichmentReadinessGaps) runs for every
  database target.
- Drop the database-context-depth telemetry step (Node + Python schema mirrors
  regenerated).
- Update CLI, setup, context-build view, docs, the public ktx skill, and the
  release-smoke / artifacts scripts (now assert the no-LLM guard failure).

ktx status --fast (a separate network-probe flag) is unchanged.

Follow-ups: KLO-726 (live progress for ktx ingest --all), KLO-727 (restore
credentialed successful-ingest release smoke coverage).
This commit is contained in:
Andrey Avtomonov 2026-05-29 17:27:32 +02:00
parent 8ebc4ce107
commit e7538fb807
34 changed files with 222 additions and 884 deletions

View file

@ -106,7 +106,6 @@ export function buildLiveDatabaseIngestArgs(projectDir, _databaseIntrospectionUr
connectionId,
'--project-dir',
projectDir,
'--fast',
'--no-input',
];
}
@ -152,20 +151,20 @@ function requireSuccess(label, result) {
}
}
function requireFailure(label, result) {
if (result.code === 0) {
throw new Error(
`${label} unexpectedly succeeded\nstdout:\n${result.stdout}\nstderr:\n${result.stderr}`,
);
}
}
function requireOutput(label, result, pattern) {
if (!pattern.test(result.stdout)) {
throw new Error(`${label} output did not match ${pattern}\nstdout:\n${result.stdout}`);
}
}
function getRunId(stdout) {
const match = stdout.match(/^Run: (.+)$/m);
if (!match) {
throw new Error(`ingest output did not include a run id\nstdout:\n${stdout}`);
}
return match[1];
}
async function requireDocker() {
const result = await run('docker', ['info'], { timeout: 20_000 });
if (result.code !== 0) {
@ -310,13 +309,17 @@ async function main() {
env: managedRuntimeEnv(cleanInstallDir),
timeout: 120_000,
});
requireSuccess('ktx ingest warehouse --fast', ingestRun);
requireOutput('ktx ingest warehouse --fast', ingestRun, /Ingest finished/);
requireOutput('ktx ingest warehouse --fast', ingestRun, /Database schema/);
// ktx ingest now always builds enriched context and requires a configured
// model and embeddings. This smoke project has neither, so the database
// target fails the enrichment-readiness preflight before any work runs.
// This still exercises the packaged binary, daemon startup, and the live
// database connection end to end.
requireFailure('ktx ingest warehouse', ingestRun);
requireOutput('ktx ingest warehouse', ingestRun, /Ingest finished with partial failures/);
requireOutput('ktx ingest warehouse', ingestRun, /enrichment is not configured/);
const runId = getRunId(ingestRun.stdout);
await assertPathExists(join(projectDir, '.ktx', 'db.sqlite'), 'SQLite local ingest state');
process.stdout.write(`Installed live-database artifact smoke passed: ${runId}\n`);
process.stdout.write('Installed live-database artifact smoke passed: enrichment-readiness guard verified\n');
} finally {
if (daemonStarted && cleanInstallDir) {
await stopDaemon(cleanInstallDir);