refactor: enforce ktx naming and AGENTS.md compliance sweep (#289)

Align the tree with AGENTS.md/CLAUDE.md conventions:

- Rewrite user-facing strings, docs, and tests to lowercase `ktx`
  (no bare uppercase `KTX` tokens remain outside literal identifiers).
- Drop the legacy `historicSql` migration path and its now-unused
  helpers, per the no-backward-compat rule.
- Remove `as unknown as` / `any` casts: narrow `BaseTool` generics to
  `z.ZodObject`, add a typed `createLookerClient`, and delete the dead
  `getParametersSchema`/`toAnthropicFormat` pre-AI-SDK helpers.
- Use `InvalidArgumentError` for Commander parse failures.
- Finish the adapter→connector prose conversion in the `ktx.yaml` docs
  while keeping the literal `adapters` config key.
This commit is contained in:
Andrey Avtomonov 2026-06-11 13:49:45 +02:00 committed by GitHub
parent 005c5fc860
commit 00cdf2de90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
237 changed files with 844 additions and 974 deletions

View file

@ -293,7 +293,7 @@ const reportWithAttention: KtxScanReport = {
warnings: [
{
code: 'connector_capability_missing',
message: 'KTX scan connector is missing optional capability: columnStats',
message: 'ktx scan connector is missing optional capability: columnStats',
recoverable: true,
metadata: { capability: 'columnStats' },
},
@ -372,7 +372,7 @@ describe('runKtxScan', () => {
connector: undefined,
}),
);
expect(io.stdout()).toContain('KTX scan completed\n');
expect(io.stdout()).toContain('ktx scan completed\n');
expect(io.stdout()).toContain('Run: scan-run-1');
expect(io.stdout()).toContain('Mode: structural');
expect(io.stdout()).toContain('What changed\n');
@ -494,7 +494,7 @@ describe('runKtxScan', () => {
);
});
it('passes KTX daemon options to local ingest adapters when no explicit daemon URL is set', async () => {
it('passes ktx daemon options to local ingest adapters when no explicit daemon URL is set', async () => {
await initKtxProject({ projectDir: tempDir });
const createLocalIngestAdapters = vi.fn(() => []);
const runLocalScan = vi.fn(
@ -649,7 +649,7 @@ describe('runKtxScan', () => {
warnings: [
{
code: 'connector_capability_missing',
message: 'KTX scan connector cannot run read-only SQL relationship validation',
message: 'ktx scan connector cannot run read-only SQL relationship validation',
recoverable: true,
metadata: { capability: 'readOnlySql' },
},
@ -690,7 +690,7 @@ describe('runKtxScan', () => {
expect(io.stdout()).toContain('Review: 12');
expect(io.stdout()).toContain('Rejected: 44');
expect(io.stdout()).toContain(
'connector_capability_missing: KTX scan connector cannot run read-only SQL relationship validation',
'connector_capability_missing: ktx scan connector cannot run read-only SQL relationship validation',
);
});
@ -972,7 +972,7 @@ describe('runKtxScan', () => {
}
expect(io.stdout()).toContain('✓');
expect(io.stdout()).toContain('KTX scan completed');
expect(io.stdout()).toContain('ktx scan completed');
expect(io.stdout()).toContain('\u001b[');
});
@ -1017,7 +1017,7 @@ describe('runKtxScan', () => {
}
}
expect(io.stdout()).toContain('KTX scan completed');
expect(io.stdout()).toContain('ktx scan completed');
expect(io.stdout()).not.toContain('\u001b[');
});