The rule for documentation is one line: pull the API surface out of the source mechanically, put the extraction in the context, and reject any draft containing an identifier that is not in it. Two short scripts make that a build failure rather than a good intention.

Extract first, write second, never the reverse

The order that fails is the natural one: describe what the function does, then check the details. It fails because checking is where the effort is and describing is where the enthusiasm is, and because a confident sentence about a parameter that does not exist reads exactly like a confident sentence about one that does.

The order that works inverts it. A script produces a machine-readable list of every module, class, function, signature and docstring. That list goes into the prompt as the only permitted source of names. A second script then checks the output against the same list, and the check is a set difference rather than a judgement.

Why documentation is the worst place for this failure