Bulk AI docstring backfill safety
Your team wants to backfill docstrings across a large legacy Python service by running an AI over every function and committing whatever it writes. A staff engineer is uneasy about merging thousands of AI-written docstrings in bulk. When is AI-generated documentation the wrong tool, or at least the wrong process — and how would you make a bulk-docstring effort safe rather than block it outright?
Implement
triage_docstring_batch(func_names: list[str], docstrings: list[str], has_tests: list[bool]) → list[str]Examples
in
[["get_user","parse_iso_date"],["Get the user.","Parses an ISO 8601 date string into epoch seconds, raising on a malformed input."],[true,false]]out["drop-noinfo","hold-unverified"]in
[["flush_buffer","render_invoice"],["Writes pending rows to disk. Thread-safe.","Builds the printable invoice body from a billing period."],[true,false]]out["merge","merge"]in
[["_load_cache","checkout"],["Loads the cache.","Checkout."],[false,true]]out["skip-private","drop-noinfo"]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 18 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.