The problem
@opensaas/stack-rag exports two different types under the same name:
packages/rag/src/config/types.ts:5 — ChunkingStrategy = 'none' | 'recursive' | 'sentence' | 'sliding-window', exported from the package root.
packages/rag/src/runtime/chunking.ts:6 — ChunkingStrategy = 'recursive' | 'sentence' | 'sliding-window' | 'token-aware', exported from @opensaas/stack-rag/runtime.
Each carries a strategy?: ChunkingStrategy option on its own config type, so 'none' is accepted by the plugin config and rejected by chunkText, while 'token-aware' is the reverse. A user who reads one and passes it to the other gets a compile error for a value the package itself documents.
Provenance
Found during the review of PR #1324, whose shadowing check compares a documented redeclaration against the package's export of the same name. A block documenting the runtime union was reported as contradicting the package because the checker resolved the root one first. The checker is being fixed to key by specifier; the underlying inconsistency is a package defect and is filed here.
What to do
Decide whether the two are one type or two. If one, export a single union and make both consumers accept it (mapping 'none' and 'token-aware' explicitly where a consumer cannot honour one). If two, rename one so the name no longer promises they agree, and say on each which side accepts which value.
Any change here needs a minor changeset on @opensaas/stack-rag and the RAG docs' chunking sections re-checked by the doc-block checker once #1324 lands.
Context
🤖 Generated with Claude Code
The problem
@opensaas/stack-ragexports two different types under the same name:packages/rag/src/config/types.ts:5—ChunkingStrategy = 'none' | 'recursive' | 'sentence' | 'sliding-window', exported from the package root.packages/rag/src/runtime/chunking.ts:6—ChunkingStrategy = 'recursive' | 'sentence' | 'sliding-window' | 'token-aware', exported from@opensaas/stack-rag/runtime.Each carries a
strategy?: ChunkingStrategyoption on its own config type, so'none'is accepted by the plugin config and rejected bychunkText, while'token-aware'is the reverse. A user who reads one and passes it to the other gets a compile error for a value the package itself documents.Provenance
Found during the review of PR #1324, whose shadowing check compares a documented redeclaration against the package's export of the same name. A block documenting the runtime union was reported as contradicting the package because the checker resolved the root one first. The checker is being fixed to key by specifier; the underlying inconsistency is a package defect and is filed here.
What to do
Decide whether the two are one type or two. If one, export a single union and make both consumers accept it (mapping
'none'and'token-aware'explicitly where a consumer cannot honour one). If two, rename one so the name no longer promises they agree, and say on each which side accepts which value.Any change here needs a
minorchangeset on@opensaas/stack-ragand the RAG docs' chunking sections re-checked by the doc-block checker once #1324 lands.Context
🤖 Generated with Claude Code