CHAPTER 10 · Document and File Processing Pipelines · 5 / 8
Versioning generated and edited artifacts
Generated and edited documents flow back into the same versioning model as uploads (Chapter 9): a generated document is a new artifact with a first version (source: generated); an edit creates a new version (source: agent_edit) of an existing artifact. The pipeline for "agent edits a document" is its own mini-pipeline: load current bytes → apply the change → store new bytes → record a new version → record the individual changes → update the current pointer. Keep these steps transactional enough that you never end up with a version row pointing at bytes that weren't written, or a current pointer to a version that doesn't exist.