TL;DR
AI-assisted changes keep tests current because the agent has to make them pass, while the guide and its examples usually have no check and fall behind. List the behaviour, interfaces and run steps each change alters, and update the documentation in the same pull request. Make documented examples run against the code, stamp each guide with the commit it was checked against, and have the code's owners reread the guide before they restamp it.
Three descriptions of the same endpoint
Pick an endpoint your team changed in the last month and open three things: the test that covers it, the guide a client developer reads, and the example in that guide they would copy. All three describe the same behaviour. Usually only the test runs on every change, which is why an AI-assisted change keeps it current: an agent asked to get the suite green has to. Nothing makes it open the guide.
The problem predates coding agents. In 2022 a team running about twenty microservices, mostly JavaScript and PHP, asked on Software Engineering Stack Exchange how to keep its diagrams and roughly thirty configuration parameters documented, because code changes kept breaking the hand-made descriptions and keeping them current depended on the team's discipline. In July 2026 someone asked on Hacker News how teams keep documentation up to date now that so much code is generated by AI. Some replies proposed a rule, that a behaviour change arriving without its documentation is rejected; others proposed automation, where the tool that wrote the code also updates the docs. One person added that they were becoming less familiar with their own code, which made checking the documentation harder.
Both answers help. The rule decides when documentation changes, and automation can draft the change. Neither tells you whether the guide is still true. That needs a check that can fail.
Write down what the change made untrue
Before review, list every statement a reader could rely on that the diff alters. Ask the agent for this list along with the code, with the file and line behind each item, and treat it as a lead rather than a verdict: the author of a change is the one least likely to notice what it forgot.
- Behaviour a caller can observe: status codes, defaults, limits, ordering, error messages and rate limits.
- Interfaces: routes, parameters, request and response fields, events and queue messages, configuration keys, environment variables and command-line flags.
- Operational instructions: setup and run steps, migrations to apply, feature flags, runbooks, alerts and how to roll back.
- Examples: every snippet, sample payload and screenshot that shows one of the above.
Then search the documentation for each old value and identifier. It takes a minute and finds sentences that no tool flags, as in the demonstration below, where a search for the old behaviour found the paragraph nobody had changed.
Any item on that list makes the documentation update part of the same pull request. Google's documentation guide says it in one line: "Change your documentation in the same CL as the code change" (Documentation Best Practices). A refactor that changes none of the items needs no documentation change, and saying so in the pull request description tells the reviewer it was considered. If an update really has to wait, it waits as a tracked issue with an owner, and the affected page says it is out of date, so readers are not left to find out.
Run the examples the guide shows
To see which checks notice a behaviour change, a small demonstration was run for this article with Node.js 25.8.1 and Git 2.54. A JavaScript handler lists orders. In version 1, a limit above 100 is reduced to 100. Its guide says so in one sentence and shows one example in a code block marked js example, so a script can find and execute it:
listOrders({ limit: 500 })
// => {"status":200,"count":100}
One script runs every example block in the docs against the real handler and compares the fields. A second reads two lines of front matter in the guide, the file it covers and the commit it was last verified against, and fails if that file has changed since. The behaviour change, written by hand for the demonstration, made a limit above 100 return status 422 instead, and updated the code and its unit test together, as an agent asked to make the change would.
Step 2 is the usual state after a fast change: everything that runs in continuous integration is green and the guide is wrong. The example check found the wrong example and named its line. Step 3 teaches more. Once the example was corrected, every executable check passed while the sentence above it still promised that values above 100 were reduced to 100. Only the freshness check, which knows nothing about the content, kept the guide marked as unverified, and a search for "reduced to 100" found the sentence.

Stamp each guide with the revision it describes
The verified_against line answers a question a later maintainer, person or agent, cannot answer from the page: which version of the code this explanation was last checked against. With it, someone who finds a disagreement can run git diff from that commit and see what has changed since. A last-edited date only says that someone touched the file.
The stamp also routes the work to a person. GitHub requests review from code owners when a pull request modifies files they own, and branch protection can require their approval. Owning docs/ alone does not catch the risky pull request, which is the one that changes code and leaves the guide alone. A failing freshness check forces that pull request to touch the guide, the guide's owners are asked to review, and the new stamp becomes a claim by someone who reread the page against the change. Give each guide to the team that owns the code it covers. A documentation specialist can keep the writing clear but cannot vouch for the behaviour.
Restamping without rereading is the failure to watch, especially when an agent proposes the new stamp. Treat a stamp change like a change to a test's expectation: whoever approves it should be able to say what they checked. The article on stopping an AI coding agent weakening tests just to make them pass deals with the same temptation in test files.

Review the guide before the code
A reviewer who reads the code first absorbs the new behaviour, then reads the guide as confirmation. Read in the other order:
- Read the guide's diff as a client would, and ask whether it describes what the change was meant to do.
- Read the test names and assertions against that description. A test called "a limit above 100 is rejected with 422" beside a guide saying such values are reduced is a contradiction you can see without running anything.
- Read the code against both.
- If the pull request changes an item from the list and has no documentation diff, ask which page was checked and why it needed nothing.
The article on what an AI-assisted pull request should include so another developer can understand and review it covers the rest of that packet; the documentation diff and the stamp belong in it.
Paqad handles part of this inside its feature-development workflow. One of its mandatory stages, documentation_sync, runs after the checks and has the AI update the documentation the change made out of date. Paqad's documentation lists spotting which documents went stale as the AI's judgement, not a script's, so a missed page is still possible and an updated file is no proof the text is right. Separately, paqad-ai refresh --reconcile-module-map compares Paqad's module map with your source folders and module docs and exits with an error when they differ, without editing anything. Paqad's documentation sets out which command brings which of its files back in line after which kind of change.
Frequently Asked Questions
How do we keep documentation accurate when AI-assisted code changes so quickly?
Shrink the part that has to be kept accurate by hand. Reference material that already exists in code, such as a configuration table, a route list or an error catalogue, can be generated from the source during the build; that is the part of the Stack Exchange team's thirty-parameter problem automation can solve. Keep hand-written pages for intent, trade-offs and usage, and put the checks on those.
Which user-facing behaviour, interfaces and operational instructions changed with this feature?
Work from the diff, not from memory. Changed route definitions, public signatures, validation rules, configuration schemas, error strings, migration files and deployment scripts each point at something documented. Behaviour that changed without a diff in your repository, such as a new default in a dependency, will not appear this way; it needs the dependency's release notes.
What should trigger a documentation update rather than leaving it for later?
Anything a reader could observe or act on, in the same pull request. Later is acceptable only when it is visible: an issue with an owner and a target release, and a note on the affected page. An unmarked deferral is how a guide ends up describing a version nobody runs any more.
How can code, tests and documentation be reviewed together for contradictions?
Compare their vocabulary as well as their claims. When the test name, the error message and the guide use different words for the same limit, one of them usually describes older behaviour. A failing example or freshness check is also useful for a plainer reason: it makes the reviewer open the guide at all.
Who owns freshness, and how will the next maintainer know which revision the explanation describes?
The team that owns the covered code, named in the page's front matter and in the code owners file, so ownership moves when the code moves. The commit stamp names the revision that was checked. If published documentation serves several versions, build each version's pages from its release tag so the stamp and the version shown to readers agree.
