fix: improve ingest runtime readiness (#124)

* fix: improve ingest runtime readiness

* fix(cli): mock runtime in slow setup tests

* test(cli): isolate setup runtime status
This commit is contained in:
Andrey Avtomonov 2026-05-17 10:27:29 +02:00 committed by GitHub
parent f49672ba5b
commit c89af7733a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 1055 additions and 75 deletions

View file

@ -25,13 +25,14 @@ describe('KTX setup config helpers', () => {
await markKtxSetupStateStepComplete(tempDir, 'project');
await markKtxSetupStateStepComplete(tempDir, 'project');
await markKtxSetupStateStepComplete(tempDir, 'llm');
await markKtxSetupStateStepComplete(tempDir, 'runtime');
await markKtxSetupStateStepComplete(tempDir, 'context');
expect(await readKtxSetupState(tempDir)).toEqual({
completed_steps: ['project', 'llm', 'context'],
completed_steps: ['project', 'llm', 'runtime', 'context'],
});
await expect(readFile(join(tempDir, '.ktx', 'setup', 'state.json'), 'utf-8')).resolves.toBe(
`${JSON.stringify({ completed_steps: ['project', 'llm', 'context'] }, null, 2)}\n`,
`${JSON.stringify({ completed_steps: ['project', 'llm', 'runtime', 'context'] }, null, 2)}\n`,
);
});

View file

@ -2,7 +2,16 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import type { KtxProjectConfig } from './config.js';
export const KTX_SETUP_STEPS = ['project', 'llm', 'embeddings', 'databases', 'sources', 'context', 'agents'] as const;
export const KTX_SETUP_STEPS = [
'project',
'llm',
'embeddings',
'databases',
'sources',
'runtime',
'context',
'agents',
] as const;
export type KtxSetupStep = (typeof KTX_SETUP_STEPS)[number];