Skip to content
Oak Dev-inter edited this page Apr 23, 2026 · 1 revision

v0.2.1 — Documentation Retrieval Protocol

Released: 2026-02 Theme: AI memory is not truth. Fetch docs. Match versions. Cache what you fetch.

TL;DR

AI produces confident wrong code on version-specific library syntax because it pattern-matches from training data. v0.2.1 formalizes a trust hierarchy for documentation, requires version detection before coding, and caches fetched snippets under .kasidit/knowledge/<stack>-<version>-<topic>.md for reuse.

Why

Observed pattern: ask AI to use Laravel 5.x feature; AI produces Laravel 10 syntax confidently. Same for Vue 2 vs 3, Django 3.x vs 4.x, React class vs hooks. AI memory is latest-biased and cannot reliably answer "what syntax does version X use?". Fix: stop trusting memory for version-specific code.

What's new

Trust hierarchy

Ranked high → low:

  1. Project source code (local, actual) — truth for this codebase
  2. Official docs at the exact version used in the project
  3. Official docs latest
  4. Framework/library source on GitHub (release tag matching project)
  5. Release notes / changelogs
  6. ❌ Stack Overflow, Medium, blogs — only to find keywords to search docs
  7. ❌ AI memory for version-specific syntax — assume wrong

Every decision about library usage cites its position in this hierarchy.

When to fetch docs (mandatory)

  • New library or framework in the project
  • Version number is specific and not latest (Laravel 5.x, Vue 2, PHP 7.4)
  • Error message references a function/class not yet verified this session
  • User asks about config, options, flags, env variables
  • Deprecation suspected

When to skip docs (trivial)

  • Pure language syntax (for, if, map)
  • Well-known universal APIs (HTTP status codes, Math.floor)
  • Already verified in this session

Version detection first

Before writing any code depending on a library version, detect it:

Stack Check
Composer composer.json + composer show <pkg>
npm package.json + npm ls <pkg>
Python requirements.txt / pyproject.toml + pip show <pkg>
Go go.mod
Cargo Cargo.toml + Cargo.lock
Ruby Gemfile.lock

Generated code must match the actual version in the project, not latest.

Fetch order

  1. In-project source first — grep vendor/ or node_modules/ before web
  2. Official docs site — one query, one fetch, record URL
  3. GitHub source at project's version tag
  4. Changelog / releases for "when did X change"

Knowledge caching

Save fetched snippets to .kasidit/knowledge/<stack>-<version>-<topic>.md:

  • URL fetched, date, version
  • The specific snippet/behavior confirmed
  • Not the whole page — only what was needed

Next session, before fetching again, check this cache first.

Official docs routes (high-frequency)

  • Laravel: laravel.com/docs/<version>
  • Vue: vuejs.org (v3) or v2.vuejs.org
  • React: react.dev or legacy.reactjs.org
  • Django: docs.djangoproject.com/en/<version>
  • Node: nodejs.org/docs/latest-v<major>.x/api/
  • PHP: php.net/manual/<lang>/function.<n>.php
  • Go: pkg.go.dev/<module>
  • Python: docs.python.org/<version>/library/<module>.html
  • MDN: developer.mozilla.org

What changed vs v0.2.0

  • Added: trust hierarchy
  • Added: version detection step before coding
  • Added: .kasidit/knowledge/ cache convention
  • Added: fetch-order discipline

Breaking changes

None. New rules apply to future missions.

Migration

No action. On the next mission touching a versioned library, the agent will detect version, fetch docs, and cache the result under .kasidit/knowledge/.

See also

Kasidit

Core

Version History

Concepts

Commands

Agents

Deprecated v0.10 (stubs → audit-specialist --focus=..., removed in v0.11)

Clone this wiki locally