ktx/packages/context/src/ingest
Andrey Avtomonov 49f1e2720e
fix(llm): wire prompt caching through all Anthropic call sites (#90)
* fix(llm): wire prompt caching through all Anthropic call sites

- page-triage classifier + light-extraction now put the static skill
  prompt in `system:` so the per-document caches hit instead of
  re-sending boilerplate in the user message every call.
- Description generation builders return `{ system, user }` with
  instruction text + word limit moved into the cacheable system.
- Relationship-LLM proposal framing moved to `system:`.
- `KtxMessageBuilder.wrapSimple` skips the history breakpoint for
  single-message calls (cache write that could never be reused).
- Gateway backend now sets `anthropic-beta: extended-cache-ttl-2025-04-11`
  so 1h TTLs don't silently downgrade to 5m on Gateway routes.

* fix(llm): keep wrapSimple history breakpoint so multi-step agent loops cache

Reverts the wrapSimple `messages.length > 1` guard from the prior commit.
agent-runner uses wrapSimple with a single user message, but generateText
runs a multi-step tool loop inside it — the cache marker on the first user
message is reused by every subsequent step, so it isn't waste.
The release validator (scripts/validate-llm-debug-jsonl.mjs) also requires
a `message-part` marker target in captured debug JSONL.
2026-05-14 15:36:27 +02:00
..
adapters feat: merge ingest and scan 2026-05-14 01:43:06 +02:00
clustering Initial open-source release 2026-05-10 23:12:26 +02:00
context-candidates rename klo to ktx 2026-05-10 23:51:24 +02:00
context-evidence rename klo to ktx 2026-05-10 23:51:24 +02:00
dbt-shared Initial open-source release 2026-05-10 23:12:26 +02:00
memory-flow feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
page-triage fix(llm): wire prompt caching through all Anthropic call sites (#90) 2026-05-14 15:36:27 +02:00
stages fix: align KTX agent tools and repair handling (#73) 2026-05-14 00:57:51 +02:00
tools fix: align KTX agent tools and repair handling (#73) 2026-05-14 00:57:51 +02:00
action-identity.test.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
action-identity.ts Initial open-source release 2026-05-10 23:12:26 +02:00
canonical-pins.test.ts Initial open-source release 2026-05-10 23:12:26 +02:00
canonical-pins.ts Initial open-source release 2026-05-10 23:12:26 +02:00
diff-set.service.test.ts Initial open-source release 2026-05-10 23:12:26 +02:00
diff-set.service.ts Initial open-source release 2026-05-10 23:12:26 +02:00
git-env.ts chore(deps): refresh workspace dependencies (#43) 2026-05-13 01:15:35 +02:00
index.ts fix: clean up ktx yaml config parameters (#75) 2026-05-14 01:27:31 +02:00
ingest-bundle.runner.test.ts fix: align KTX agent tools and repair handling (#73) 2026-05-14 00:57:51 +02:00
ingest-bundle.runner.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
ingest-prompts.test.ts feat(context): add warehouse verification tools (#46) 2026-05-13 13:43:23 +02:00
ingest-runtime-assets.test.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
local-adapters.test.ts feat: merge ingest and scan 2026-05-14 01:43:06 +02:00
local-adapters.ts feat: merge ingest and scan 2026-05-14 01:43:06 +02:00
local-bundle-ingest.test.ts feat(context): add warehouse verification tools (#46) 2026-05-13 13:43:23 +02:00
local-bundle-runtime.test.ts feat: merge ingest and scan 2026-05-14 01:43:06 +02:00
local-bundle-runtime.ts feat: merge ingest and scan 2026-05-14 01:43:06 +02:00
local-embedding-provider.integration.test.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
local-ingest.ts fix: store Metabase mappings in ktx.yaml (#61) 2026-05-13 13:55:21 +02:00
local-mapping-reconcile.test.ts fix: store Metabase mappings in ktx.yaml (#61) 2026-05-13 13:55:21 +02:00
local-mapping-reconcile.ts fix: store Metabase mappings in ktx.yaml (#61) 2026-05-13 13:55:21 +02:00
local-metabase-ingest.test.ts fix: store Metabase mappings in ktx.yaml (#61) 2026-05-13 13:55:21 +02:00
local-stage-ingest.test.ts fix: stop requiring readonly connection config (#71) 2026-05-13 19:37:25 +02:00
local-stage-ingest.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
metabase-mapping.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
parsed-target-table.ts Initial open-source release 2026-05-10 23:12:26 +02:00
ports.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
raw-sources-paths.test.ts Initial open-source release 2026-05-10 23:12:26 +02:00
raw-sources-paths.ts Initial open-source release 2026-05-10 23:12:26 +02:00
repo-fetch.test.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
repo-fetch.ts Initial open-source release 2026-05-10 23:12:26 +02:00
report-snapshot.test.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
report-snapshot.ts refactor: remove legacy compatibility paths (#64) 2026-05-13 15:55:00 +02:00
reports.ts refactor: remove legacy compatibility paths (#64) 2026-05-13 15:55:00 +02:00
source-adapter-registry.test.ts Initial open-source release 2026-05-10 23:12:26 +02:00
source-adapter-registry.ts Initial open-source release 2026-05-10 23:12:26 +02:00
sqlite-bundle-ingest-store.test.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00
sqlite-bundle-ingest-store.ts Improve schema setup and Notion ingest UX (#14) 2026-05-12 22:56:58 +02:00
sqlite-local-ingest-store.test.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
sqlite-local-ingest-store.ts Initial open-source release 2026-05-10 23:12:26 +02:00
types.ts rename klo to ktx 2026-05-10 23:51:24 +02:00
wiki-sl-ref-repair.test.ts refactor: remove legacy compatibility paths (#64) 2026-05-13 15:55:00 +02:00
wiki-sl-ref-repair.ts feat: rename project wiki directory (#66) 2026-05-13 16:05:58 +02:00