# Check whether an AI documentation edit changes executable behavior

Canonical: https://githtml.com/guides/review-ai-docstring-edits-executable-effects
Published: 2026-11-23
Publisher: WaveTech LLC / gitHtml

Do not assume an AI patch is behavior-neutral because it is described as documentation-only. Review the actual diff for code changes and for comments or docstrings consumed by tests, generators, or tooling. Identify executable examples and directives, then run relevant local checks in a safe environment before making a narrow claim about the patch's effects.

## Identify which text is consumed by tooling

Ordinary prose comments may have no runtime effect, but some text participates in doctests, documentation generation, type checking, lint configuration, or code-generation conventions. Inventory the tooling relevant to the edited files. In Python, docstrings are available to introspection, and doctest can execute examples it discovers. Other ecosystems have their own annotation conventions. Do not generalize from one language to another. Read the entire diff, including imports, decorators, string delimiters, and surrounding code, rather than trusting the AI's summary of changed files. A small misplaced quote can alter parsing beyond the intended comment.

## Separate prose changes from behavioral inputs

Classify each edited region as explanatory prose, literal example, executable test, directive, or actual code. The scaffold below helps reviewers record why a region needs a particular check. Inspect generated examples before running them, especially if they touch files, network services, or environment variables. Verify that a rewritten docstring still describes the same arguments, return values, and exceptions. If the AI added a tool directive or suppression comment, require an explicit reason rather than accepting it as stylistic cleanup. Keep unrelated code fixes separate so the documentation review does not silently expand into an implementation change.

````text
Edited region:
Consumer: reader / generator / doctest / other tool
Literal or executable content:
Potential side effects:
Relevant local checks:
Observed result:
Scope beyond prose:
Remaining uncertainty:
````

## Report the verification at the right level

Run the relevant local syntax, documentation, and example checks in the approved test environment. Compare generated output when docstrings feed a public reference. A passing formatter does not establish that doctests still work, and passing doctests do not prove every application behavior is unchanged. State exactly which checks ran and what remains unverified. If the patch changes executable examples or metadata, describe that scope honestly instead of retaining a blanket documentation-only label. Preserve the reviewed diff and evidence so maintainers can understand the impact. The useful conclusion is a bounded assessment of the actual changes, not reassurance based on the file type or the model's intention. Inspect generated artifacts only as evidence, not as a replacement for reviewing the source diff. A hidden directive can affect a later build mode even when the default preview looks unchanged.

1. Read the full diff and inventory tooling that consumes comments or docstrings.
2. Classify edited text by whether it is prose, example, directive, or code.
3. Inspect executable examples and new suppressions before running checks.
4. Report exact local verification and avoid a broader behavior-neutral claim than the evidence supports.

## Sources and further reading

- [PEP 257: Docstring conventions](https://peps.python.org/pep-0257/)
- [Python doctest](https://docs.python.org/3/library/doctest.html)
- [Google Technical Writing: Using LLMs](https://developers.google.com/tech-writing/two/llms)

## Related guides

- [Check an AI plan’s file map before code changes begin](https://githtml.com/guides/review-ai-plan-file-change-map)
- [Turn an AI plan into acceptance criteria you can check](https://githtml.com/guides/acceptance-criteria-ai-plan-reading)
- [Read an AI implementation plan before approving the work](https://githtml.com/guides/review-ai-implementation-plan-before-approving)
- [Simplify AI-written documentation without changing the technical contract](https://githtml.com/guides/review-ai-audience-rewrite-accuracy)

Editorial approach: https://githtml.com/guides/about
