Skip to main content
SAICA-KG

Recipes

Obsolescence-resistant TypeScript agent

sourcegraph-cody (graph-indexed retrieval of the current API surface) → cursor (IDE generation) → tsc + eslint (post-generation).

case studiedtypescript

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.

  1. Stage 1
    Semgrep

    Fast, rule-based static analysis with a pattern syntax that mirrors source code.

  2. Stage 2
    Context Hub

    Up-to-date, curated API docs for coding agents.

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.

View raw YAML on GitHub →