Sub topic 9
Requesting changes and revising
This chapter assumes you have read the chapters on content states and approval gates. You should know that a content item moves through states such as draft, in_review, approved, and published. You should also be comfortable reading short Python programs.
Why the loop needs structure
Reviewers rarely approve a first draft as written. Most drafts go back for changes at least once. If that return trip is informal, such as a chat message saying "looks off, fix it", three problems follow:
- The writer does not know what to change.
- The reviewer cannot confirm later that the change was made.
- Nobody can tell how many rounds an item has been through.
A revision loop turns feedback into a defined state and a recorded note. The item leaves review, the writer or the AI model edits it, and the item goes back into review.
The states involved
The state machine from the earlier chapter already has the pieces. changes_requested is the state an item enters when a reviewer sends it back. From there the only allowed move is back to in_review.
Notice that changes_requested does not lead directly to approved. A revised text always passes through review again. Otherwise a reviewer could approve text they have never seen.
Writing feedback that can be acted on
A change request should carry a note. Good notes share four traits:
- They point to a specific place, such as a paragraph or sentence.
- They name the rubric criterion that failed, such as accuracy or tone.
- They say what a fix looks like.
- They separate required changes from optional suggestions.
Compare two notes on the same draft.
| Weak note | Useful note |
|---|---|
| "Doesn't sound right." | "Paragraph 2 breaks the tone rule: it addresses the reader as 'users'. Rewrite in second person." |
| "Check the numbers." | "Accuracy: the 40% figure in the intro is not in the cited source. Remove it or cite one that supports it." |
In the code from the state-machine chapter, the note goes into the request_changes call, and _move stores it in the log.
item.request_changes("ana", "Accuracy: the 40% figure in the intro has no source.")Revising: by a person or by the model
Feedback can go to a human editor, back to the AI model, or both. When it goes to the model, give it the original brief, the current text, and the reviewer's notes together. Without the brief, the model may fix one problem and break a constraint it no longer sees.
The revise method only works in draft or changes_requested. That restriction matters. Once an item is in review, nobody can change the text under the reviewer's feet. Each edit is logged with a digest of the new text, so you can see exactly which version a later approval refers to.
After revising, the writer calls submit again. The reviewer then checks two things: whether each requested change was made, and whether the edit introduced new problems.
Common errors
- Unlimited rounds. An item can bounce between review and revision forever. Set a limit, for example three rounds, after which the item goes to a person for a decision or is closed.
- Vague notes. These produce guesses, and guesses produce more rounds.
- Re-reviewing only the diff. Edits can change the meaning of text around them. Reviewers should read the whole piece, or at least the surrounding paragraphs.
- Approving old text. If the approval is tied to a hash of an earlier version, publishing fails. That is the intended behavior. Send the item back through review.
Exercise
A reviewer approves an item. Before publishing, the author fixes a typo in the text. Using the code from the state-machine chapter, what happens when publish is called, and why?
Show answer
publish raises ValueError ("text differs from the approved version"). Two things block it. approve stored a digest of the approved text, and the typo fix changes the digest, so it no longer matches. In fact revise already refuses to run in the approved state, so the edit itself would fail first. In both cases the item must go back through review.