mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-19 08:28:06 +02:00
Merge remote-tracking branch 'origin/main' into ktx-agent-command-history
# Conflicts: # packages/cli/src/agent-search-readiness.test.ts # packages/cli/src/agent-search-readiness.ts # packages/cli/src/agent.test.ts # packages/cli/src/project-dir.test.ts # packages/cli/src/setup-context.test.ts # packages/cli/src/standalone-smoke.test.ts # scripts/package-artifacts.mjs
This commit is contained in:
commit
a8bf0470ec
56 changed files with 411 additions and 3910 deletions
|
|
@ -789,12 +789,11 @@ try {
|
|||
requireOutput('ktx sl query sqlite execute', sqliteSlQuery, /"rows": \\[\\s*\\[\\s*3\\s*\\]\\s*\\]/);
|
||||
process.stdout.write('ktx sl query sqlite execute verified\\n');
|
||||
|
||||
const runtimeDoctor = await run('pnpm', ['exec', 'ktx', 'dev', 'runtime', 'doctor']);
|
||||
requireSuccess('ktx dev runtime doctor', runtimeDoctor);
|
||||
requireOutput('ktx dev runtime doctor', runtimeDoctor, /PASS uv/);
|
||||
requireOutput('ktx dev runtime doctor', runtimeDoctor, /PASS Bundled Python wheel/);
|
||||
requireOutput('ktx dev runtime doctor', runtimeDoctor, /PASS Managed Python runtime/);
|
||||
process.stdout.write('ktx dev runtime doctor verified\\n');
|
||||
const runtimeDoctor = await run('pnpm', ['exec', 'ktx', 'dev', 'runtime', 'status']);
|
||||
requireSuccess('ktx dev runtime status', runtimeDoctor);
|
||||
requireOutput('ktx dev runtime status', runtimeDoctor, /KTX Python runtime/);
|
||||
requireOutput('ktx dev runtime status', runtimeDoctor, /status: ready/);
|
||||
process.stdout.write('ktx dev runtime status verified\\n');
|
||||
|
||||
const runtimeStart = await run('pnpm', ['exec', 'ktx', 'dev', 'runtime', 'start']);
|
||||
requireSuccess('ktx dev runtime start', runtimeStart);
|
||||
|
|
@ -835,7 +834,7 @@ try {
|
|||
await assert.rejects(() => access(staleRuntimeDir));
|
||||
process.stdout.write('ktx dev runtime prune verified\\n');
|
||||
|
||||
const structuralScan = await run('pnpm', ['exec', 'ktx', 'dev', 'scan', 'warehouse',
|
||||
const structuralScan = await run('pnpm', ['exec', 'ktx', 'scan', 'warehouse',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
]);
|
||||
|
|
@ -844,34 +843,10 @@ try {
|
|||
requireOutput('ktx scan structural', structuralScan, /Mode: structural/);
|
||||
requireOutput('ktx scan structural', structuralScan, /Needs attention\\s+None/);
|
||||
const structuralScanRunId = getRunId(structuralScan.stdout);
|
||||
|
||||
const scanStatus = await run('pnpm', ['exec', 'ktx', 'dev', 'scan', 'status',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
structuralScanRunId,
|
||||
]);
|
||||
requireProjectStderr('ktx scan status', scanStatus, projectDir);
|
||||
requireOutput('ktx scan status', scanStatus, new RegExp('Run: ' + structuralScanRunId));
|
||||
requireOutput('ktx scan status', scanStatus, /Status: done/);
|
||||
requireOutput('ktx scan status', scanStatus, /Mode: structural/);
|
||||
|
||||
const scanReport = await run('pnpm', ['exec', 'ktx', 'dev', 'scan', 'report',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
'--json',
|
||||
structuralScanRunId,
|
||||
]);
|
||||
requireSuccess('ktx scan report', scanReport);
|
||||
const scanReportJson = JSON.parse(scanReport.stdout);
|
||||
assert.equal(scanReportJson.mode, 'structural');
|
||||
assert.equal(scanReportJson.connectionId, 'warehouse');
|
||||
assert.equal(scanReportJson.manifestShardsWritten, 1);
|
||||
assert.deepEqual(scanReportJson.artifactPaths.enrichmentArtifacts, []);
|
||||
assert.deepEqual(scanReportJson.artifactPaths.manifestShards, ['semantic-layer/warehouse/_schema/public.yaml']);
|
||||
await access(join(projectDir, 'semantic-layer', 'warehouse', '_schema', 'public.yaml'));
|
||||
process.stdout.write('ktx scan structural verified: ' + structuralScanRunId + '\\n');
|
||||
|
||||
const enrichedScan = await run('pnpm', ['exec', 'ktx', 'dev', 'scan', 'warehouse',
|
||||
const enrichedScan = await run('pnpm', ['exec', 'ktx', 'scan', 'warehouse',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
'--mode',
|
||||
|
|
@ -880,24 +855,14 @@ try {
|
|||
requireProjectStderr('ktx scan enriched', enrichedScan, projectDir);
|
||||
requireOutput('ktx scan enriched', enrichedScan, /Status: done/);
|
||||
requireOutput('ktx scan enriched', enrichedScan, /Mode: enriched/);
|
||||
requireOutput('ktx scan enriched', enrichedScan, /Enrichment artifacts:/);
|
||||
const enrichedScanRunId = getRunId(enrichedScan.stdout);
|
||||
const enrichedScanReport = await run('pnpm', ['exec', 'ktx', 'dev', 'scan', 'report',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
'--json',
|
||||
enrichedScanRunId,
|
||||
]);
|
||||
requireSuccess('ktx scan enriched report', enrichedScanReport);
|
||||
const enrichedScanReportJson = JSON.parse(enrichedScanReport.stdout);
|
||||
assert.equal(enrichedScanReportJson.mode, 'enriched');
|
||||
assert.ok(enrichedScanReportJson.artifactPaths.enrichmentArtifacts.length > 0);
|
||||
assert.deepEqual(enrichedScanReportJson.artifactPaths.manifestShards, ['semantic-layer/warehouse/_schema/public.yaml']);
|
||||
process.stdout.write('ktx scan enriched verified: ' + enrichedScanRunId + '\\n');
|
||||
|
||||
await mkdir(join(sourceDir, 'orders'), { recursive: true });
|
||||
await writeFile(join(sourceDir, 'orders', 'orders.json'), '{"name":"orders"}\\n', 'utf-8');
|
||||
|
||||
const ingestRun = await run('pnpm', ['exec', 'ktx', 'dev', 'ingest', 'run',
|
||||
const ingestRun = await run('pnpm', ['exec', 'ktx', 'ingest', 'run',
|
||||
'--project-dir',
|
||||
projectDir,
|
||||
'--connection-id',
|
||||
|
|
@ -907,14 +872,14 @@ try {
|
|||
'--source-dir',
|
||||
sourceDir,
|
||||
]);
|
||||
assert.equal(ingestRun.code, 1, 'ktx dev ingest run without an LLM provider must fail');
|
||||
assert.equal(ingestRun.code, 1, 'ktx ingest run without an LLM provider must fail');
|
||||
assert.match(
|
||||
ingestRun.stderr,
|
||||
/ktx dev ingest run requires llm\\.provider\\.backend: anthropic, vertex, or gateway, or an injected agentRunner/,
|
||||
/ktx ingest run requires llm\\.provider\\.backend: anthropic, vertex, or gateway, or an injected agentRunner/,
|
||||
);
|
||||
|
||||
await access(join(projectDir, '.ktx', 'db.sqlite'));
|
||||
process.stdout.write('ktx dev ingest provider guard verified\\n');
|
||||
process.stdout.write('ktx ingest provider guard verified\\n');
|
||||
} finally {
|
||||
if (daemonStarted) {
|
||||
await run('pnpm', ['exec', 'ktx', 'dev', 'runtime', 'stop']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue