mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-22 08:38:08 +02:00
feat: add claude-code llm backend with runtime port (#115)
* docs: revise claude-code ingest backend spec * docs: keep claude-code spec focused on ingest * docs: expand claude-code spec to full llm parity * Refine claude-code backend spec after adversarial review iteration 1 * Refine claude-code backend spec after adversarial review iteration 2 * Refine claude-code backend spec after adversarial review iteration 3 * feat: recognize claude-code llm backend * feat: add ktx llm runtime port * feat: add claude-code llm runtime * feat: route non-agent llm calls through runtime * feat: run ingest agents through llm runtime * feat: support claude-code setup and status * test: verify claude-code backend runtime * docs: add claude-code backend v1 runtime plan * fix: close claude-code runtime isolation checks * fix: warn on claude-code prompt caching during setup * chore: verify claude-code v1 closure * docs: add claude-code backend v1 isolation closure plan * fix: update claude-code ingest setup guidance * docs: add claude-code backend v1 ingest guidance closure plan * docs: align claude-code isolation spec with sdk metadata * test: cover claude-code host discovery metadata * fix: tolerate claude-code host discovery metadata * docs: clarify claude-code host discovery metadata * docs: add claude-code auth-probe isolation fix plan * chore: prepare kaelio ktx rc1 release * chore: add semantic release workflow * fix: unblock ci checks * chore(release): 0.1.0-rc.1 * feat: add Claude Code model selection to setup * fix: keep git maintenance attached in local repos
This commit is contained in:
parent
e6d578c03f
commit
b565e44a22
109 changed files with 10218 additions and 1093 deletions
|
|
@ -5,6 +5,7 @@ import { tmpdir } from 'node:os';
|
|||
import { join } from 'node:path';
|
||||
import { describe, it } from 'node:test';
|
||||
|
||||
import { PUBLIC_NPM_PACKAGE_VERSION } from './build-public-npm-package.mjs';
|
||||
import {
|
||||
CLI_PYTHON_ASSET_MANIFEST,
|
||||
INTERNAL_NPM_WORKSPACE_PACKAGES,
|
||||
|
|
@ -32,6 +33,35 @@ async function writeJson(path, value) {
|
|||
}
|
||||
|
||||
async function writeReleaseMetadataInputs(root) {
|
||||
await writeJson(join(root, 'release-policy.json'), {
|
||||
schemaVersion: 1,
|
||||
publicNpmPackageVersion: PUBLIC_NPM_PACKAGE_VERSION,
|
||||
releaseMode: 'ci-artifact-only',
|
||||
npm: {
|
||||
publish: false,
|
||||
registry: null,
|
||||
access: 'public',
|
||||
tag: 'next',
|
||||
packages: ['@kaelio/ktx'],
|
||||
},
|
||||
python: {
|
||||
publish: false,
|
||||
repository: null,
|
||||
packages: ['kaelio-ktx'],
|
||||
},
|
||||
publishedPackageSmoke: {
|
||||
packageName: '@kaelio/ktx',
|
||||
version: PUBLIC_NPM_PACKAGE_VERSION,
|
||||
registry: null,
|
||||
},
|
||||
runtimeInstaller: {
|
||||
uvStrategy: 'path-prerequisite',
|
||||
bootstrapUv: false,
|
||||
missingUvBehavior: 'focused-error',
|
||||
},
|
||||
requiredBeforePublishing: ['Choose public release version.'],
|
||||
});
|
||||
|
||||
for (const packageInfo of INTERNAL_NPM_WORKSPACE_PACKAGES) {
|
||||
await mkdir(join(root, packageInfo.packageRoot), { recursive: true });
|
||||
await writeJson(join(root, packageInfo.packageRoot, 'package.json'), {
|
||||
|
|
@ -64,19 +94,19 @@ async function writeUploadableArtifactFixtures(layout) {
|
|||
|
||||
describe('packageArtifactLayout', () => {
|
||||
it('uses stable artifact paths under ktx/dist/artifacts', () => {
|
||||
const layout = packageArtifactLayout('/repo/ktx');
|
||||
const layout = packageArtifactLayout('/repo/ktx', PUBLIC_NPM_PACKAGE_VERSION);
|
||||
|
||||
assert.equal(layout.artifactDir, '/repo/ktx/dist/artifacts');
|
||||
assert.equal(layout.npmDir, '/repo/ktx/dist/artifacts/npm');
|
||||
assert.equal(layout.pythonDir, '/repo/ktx/dist/artifacts/python');
|
||||
assert.equal(layout.cliTarball, '/repo/ktx/dist/artifacts/npm/kaelio-ktx-0.1.0-rc.0.tgz');
|
||||
assert.equal(layout.cliTarball, '/repo/ktx/dist/artifacts/npm/kaelio-ktx-0.1.0-rc.1.tgz');
|
||||
assert.deepEqual(Object.keys(layout.npmTarballs), ['@kaelio/ktx']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildArtifactCommands', () => {
|
||||
it('builds TypeScript packages in parallel topology, then the runtime wheel, then packs npm artifacts', () => {
|
||||
const layout = packageArtifactLayout('/repo/ktx');
|
||||
const layout = packageArtifactLayout('/repo/ktx', PUBLIC_NPM_PACKAGE_VERSION);
|
||||
const commands = buildArtifactCommands(layout);
|
||||
|
||||
assert.deepEqual(
|
||||
|
|
@ -101,7 +131,7 @@ describe('packageReleaseMetadata', () => {
|
|||
ecosystem: 'npm',
|
||||
packageName: '@kaelio/ktx',
|
||||
packageRoot: 'packages/cli',
|
||||
packageVersion: '0.1.0-rc.0',
|
||||
packageVersion: '0.1.0-rc.1',
|
||||
private: false,
|
||||
releaseMode: 'ci-artifact-only',
|
||||
},
|
||||
|
|
@ -147,7 +177,7 @@ describe('findPythonArtifacts', () => {
|
|||
describe('artifact manifest', () => {
|
||||
it('writes release metadata, source revision, checksums, and byte counts for every uploadable artifact', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-artifacts-manifest-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await writeReleaseMetadataInputs(root);
|
||||
await writeUploadableArtifactFixtures(layout);
|
||||
|
|
@ -167,7 +197,7 @@ describe('artifact manifest', () => {
|
|||
ecosystem: 'npm',
|
||||
packageName: '@kaelio/ktx',
|
||||
packageRoot: 'packages/cli',
|
||||
packageVersion: '0.1.0-rc.0',
|
||||
packageVersion: '0.1.0-rc.1',
|
||||
private: false,
|
||||
releaseMode: 'ci-artifact-only',
|
||||
},
|
||||
|
|
@ -202,8 +232,8 @@ describe('artifact manifest', () => {
|
|||
artifactKind: 'tarball',
|
||||
ecosystem: 'npm',
|
||||
packageName: '@kaelio/ktx',
|
||||
packageVersion: '0.1.0-rc.0',
|
||||
path: 'npm/kaelio-ktx-0.1.0-rc.0.tgz',
|
||||
packageVersion: '0.1.0-rc.1',
|
||||
path: 'npm/kaelio-ktx-0.1.0-rc.1.tgz',
|
||||
},
|
||||
],
|
||||
);
|
||||
|
|
@ -228,7 +258,7 @@ describe('artifact manifest', () => {
|
|||
],
|
||||
);
|
||||
|
||||
const npmEntry = manifest.files.find((file) => file.path === 'npm/kaelio-ktx-0.1.0-rc.0.tgz');
|
||||
const npmEntry = manifest.files.find((file) => file.path === 'npm/kaelio-ktx-0.1.0-rc.1.tgz');
|
||||
assert.ok(npmEntry);
|
||||
assert.equal(npmEntry.bytes, Buffer.byteLength('@kaelio/ktx-tarball'));
|
||||
assert.equal(npmEntry.sha256, createHash('sha256').update('@kaelio/ktx-tarball').digest('hex'));
|
||||
|
|
@ -244,7 +274,7 @@ describe('artifact manifest', () => {
|
|||
describe('verifyArtifactManifest', () => {
|
||||
it('accepts a schema version 2 manifest that matches the artifact directory', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-artifacts-verify-manifest-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await writeReleaseMetadataInputs(root);
|
||||
await writeUploadableArtifactFixtures(layout);
|
||||
|
|
@ -266,7 +296,7 @@ describe('verifyArtifactManifest', () => {
|
|||
|
||||
it('rejects a manifest when a file checksum has drifted', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-artifacts-checksum-drift-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await writeReleaseMetadataInputs(root);
|
||||
await writeUploadableArtifactFixtures(layout);
|
||||
|
|
@ -286,7 +316,7 @@ describe('verifyArtifactManifest', () => {
|
|||
|
||||
it('rejects a manifest with an unsafe artifact path', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-artifacts-path-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await writeReleaseMetadataInputs(root);
|
||||
await writeUploadableArtifactFixtures(layout);
|
||||
|
|
@ -304,7 +334,7 @@ describe('verifyArtifactManifest', () => {
|
|||
|
||||
it('rejects a manifest from the wrong source revision when one is required', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-artifacts-revision-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await writeReleaseMetadataInputs(root);
|
||||
await writeUploadableArtifactFixtures(layout);
|
||||
|
|
@ -328,7 +358,7 @@ describe('verifyArtifactManifest', () => {
|
|||
describe('copyRuntimeWheelAssets', () => {
|
||||
it('copies the runtime wheel and checksum manifest into CLI assets', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'ktx-runtime-assets-test-'));
|
||||
const layout = packageArtifactLayout(root);
|
||||
const layout = packageArtifactLayout(root, PUBLIC_NPM_PACKAGE_VERSION);
|
||||
try {
|
||||
await mkdir(layout.pythonDir, { recursive: true });
|
||||
await writeFile(
|
||||
|
|
@ -399,7 +429,7 @@ describe('standalone Python artifact cleanup', () => {
|
|||
|
||||
describe('verification snippets', () => {
|
||||
it('pins the smoke project to the public package artifact', () => {
|
||||
const layout = packageArtifactLayout('/repo/ktx');
|
||||
const layout = packageArtifactLayout('/repo/ktx', PUBLIC_NPM_PACKAGE_VERSION);
|
||||
|
||||
const packageJson = npmSmokePackageJson(layout);
|
||||
assert.deepEqual(packageJson.dependencies, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue