Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ADR-26045: AI-Native Development — Code as Primary Documentation


title: AI-Native Development — Code as Primary Documentation authors:


ADR-26045: AI-Native Development — Code as Primary Documentation

Date

2026-04-01

Status

Accepted

Supersedes ADR-26011.

Context

The ecosystem uses AI agents as primary development tools. These agents are stateless (ADR-26030), context-budget constrained (ADR-26038), and read code as fluently as prose. A comprehensive analysis (A-26020: AI-Native Development — Code as Primary Documentation) establishes that:

  1. Agents cannot verify prose accuracy. A docstring that contradicts code is caught at import time. A separate doc file that contradicts code passes all CI checks silently.

  2. Every token of documentation competes with code for attention budget. Effective context is only 50-65% of advertised window size (NVIDIA RULER, cited in ADR-26038). Redundant prose that paraphrases code is a context window tax.

  3. Code structure is already the primary documentation layer. Contract docstrings + test suites provide CI-verified, co-located, refactoring-safe documentation. Prose docs are the only layer that drifts silently (A-26014: Script Suite Doc Redundancy, Table 1).

Currently, the contract docstring convention exists only as an agent instruction in AGENTS.md — not as a governed architectural decision. This means it cannot be referenced by other ADRs, does not extend to non-Python code, and has no enforcement mechanism beyond agent compliance.

Decision

Every source file in the ecosystem — regardless of language — must open with a contract docstring in that language’s native documentation format.

The contract docstring answers: “What does a future agent need to read first to work safely in this file?” It must contain:

For test files, additionally:

The contract docstring format is language-native:

LanguageMechanism
PythonModule/class/function docstrings
JavaScript/TypeScriptJSDoc / /** */ blocks
BashHeader comment block
YAML/JSON configsDescription fields in schema
SQLCOMMENT ON statements

Scope

This convention applies to all code written in the ecosystem. Migration is incremental: new files must comply immediately, existing files comply when next modified.

What This ADR Does NOT Cover

Consequences

Positive

Negative

Alternatives

References

Participants

  1. Vadim Rudakov

  2. Claude Opus 4.6 (analysis synthesis, ADR drafting)