Obsolescence-resistant TypeScript agent
sourcegraph-cody (graph-indexed retrieval of the current API surface) → cursor (IDE generation) → tsc + eslint (post-generation).
Description
TypeScript / JavaScript composition designed to counter the `obsolescence` FailureMode. Training corpora skew toward older, more-copied API patterns (Wang 2024); the recipe pushes the agent to current surface area via retrieval grounding and fails closed on deprecated calls at compile time. Stage 1: sourcegraph-cody indexes the repository's node_modules and declared dependencies. Its SCIP index surfaces only symbols that exist at the project's pinned versions, displacing training-data priors. Stage 2: cursor performs interactive generation with cody's retrieval context in-prompt. Stage 3: `tsc` + eslint run as the post-check. Deprecated APIs flagged with `@deprecated` JSDoc or eslint deprecation rules fail the build.
Stack
Ordered composition. Each stage consumes the output of the one before it.
Targets failure modes
- Obsolescence — Using deprecated APIs, retired packages, or outdated library versions — often because the model's training data pre-dates current releases.
Notes
semgrep substitutes for "tsc + eslint" at the node level; both do post-generation rule-based checks and semgrep has deprecation rulesets for mainstream JS/TS frameworks. tsc/eslint are project-level and not KG nodes.