Skip to content

Commit 1fb0b16

Browse files
committed
docs(ai-migration): add Source of Truth section
Instruct agents to verify against installed node_modules rather than relying on pretraining knowledge, which skews to v13 and frequently hallucinates removed APIs.
1 parent ae767d7 commit 1fb0b16

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

β€Žai-docs/ai-migration.mdβ€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
Execution-only guide for a coding agent migrating a third-party app from `stream-chat-react` v13 to v14. Run the phases in order; stop and fix each phase's errors before moving to the next. For evidence or edge cases, fall back to `./breaking-changes.md`.
44

5+
## Source of Truth
6+
7+
Before writing any code, and whenever ambiguity hits, verify against the user's installed SDK source. Never rely on training knowledge β€” the v13 surface is still heavily represented in pretraining data and will mislead you.
8+
9+
Authoritative locations, in order of preference:
10+
11+
1. `node_modules/stream-chat-react/dist/index.d.ts` (and `dist/index.d.cts`) β€” public type surface. Fastest way to confirm a symbol exists, check a prop signature, or see an override-key name.
12+
2. `node_modules/stream-chat-react/package.json` β€” `exports` map and peer dependencies.
13+
3. `node_modules/stream-chat-react/dist/` β€” transpiled JS when runtime behavior matters more than types.
14+
4. `node_modules/stream-chat/dist/index.d.ts` β€” core client types (channel capabilities, event names, `ReactionSort`, etc.).
15+
5. `node_modules/stream-chat-react/dist/css/index.css` β€” default class names and CSS variables when auditing selectors.
16+
17+
Required workflow:
18+
19+
- Before claiming a symbol, prop, or override key exists: grep the installed `.d.ts` files.
20+
- Before writing a replacement snippet: read the current signature, don't reconstruct it from memory.
21+
- If a file or symbol referenced in this guide is missing from the installed package, stop and report β€” don't invent a fallback.
22+
523
## Prerequisites
624

725
1. Upgrade both packages to their latest versions together. The v14 peer-dep floor moved; leaving `stream-chat` on a v13-era version will fail peer resolution.

0 commit comments

Comments
Β (0)