more robust: assertion holds, because session.finished_theories provides Snapshot from Document.State.end_theory;
--- a/src/Pure/Build/build_job.scala Mon Jun 23 13:55:09 2025 +0200
+++ b/src/Pure/Build/build_job.scala Mon Jun 23 14:10:59 2025 +0200
@@ -300,6 +300,7 @@
def export_text(name: String, text: String, compress: Boolean = true): Unit =
export_(name, List(XML.Text(text)), compress = compress)
+ assert(snapshot.snippet_commands.length == 1)
for (command <- snapshot.snippet_commands) {
export_text(Export.DOCUMENT_ID, command.id.toString, compress = false)
}