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

@ -111,7 +111,7 @@ describe('runKtxTextIngest', () => {
expect.objectContaining({
userId: 'local-cli',
chatId: 'cli-text-ingest-1700000000000-1',
userMessage: 'Ingest external text artifact "Revenue means gross receipts." into KTX memory.',
userMessage: 'Ingest external text artifact "Revenue means gross receipts." into ktx memory.',
assistantMessage: 'Revenue means gross receipts.',
sourceType: 'external_ingest',
}),
@ -120,7 +120,7 @@ describe('runKtxTextIngest', () => {
2,
expect.objectContaining({
chatId: 'cli-text-ingest-1700000000000-2',
userMessage: 'Ingest external text artifact "Orders are completed purchases." into KTX memory.',
userMessage: 'Ingest external text artifact "Orders are completed purchases." into ktx memory.',
assistantMessage: 'Orders are completed purchases.',
}),
);
@ -176,7 +176,7 @@ describe('runKtxTextIngest', () => {
expect.objectContaining({
connectionId: 'warehouse',
userId: 'agent',
userMessage: 'Ingest external text artifact "revenue.md" into KTX memory.',
userMessage: 'Ingest external text artifact "revenue.md" into ktx memory.',
assistantMessage: 'file:/tmp/docs/revenue.md',
}),
);
@ -184,7 +184,7 @@ describe('runKtxTextIngest', () => {
2,
expect.objectContaining({
connectionId: 'warehouse',
userMessage: 'Ingest external text artifact "stdin" into KTX memory.',
userMessage: 'Ingest external text artifact "stdin" into ktx memory.',
assistantMessage: 'stdin content',
}),
);
@ -228,19 +228,19 @@ describe('runKtxTextIngest', () => {
expect(ingest.ingest).toHaveBeenNthCalledWith(
1,
expect.objectContaining({
userMessage: 'Ingest external text artifact "remember to call me Andrey" into KTX memory.',
userMessage: 'Ingest external text artifact "remember to call me Andrey" into ktx memory.',
}),
);
expect(ingest.ingest).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
userMessage: 'Ingest external text artifact "first line second line" into KTX memory.',
userMessage: 'Ingest external text artifact "first line second line" into ktx memory.',
}),
);
expect(ingest.ingest).toHaveBeenNthCalledWith(
3,
expect.objectContaining({
userMessage: 'Ingest external text artifact "This inline note is intentionally long xxxxxxxx..." into KTX memory.',
userMessage: 'Ingest external text artifact "This inline note is intentionally long xxxxxxxx..." into ktx memory.',
}),
);
});