I donāt think I want to store that state with items because you can have multiple views on the same document (File > New Window). Expand/focus state are owned by view not items.
So far Iāve just been saving expanded items state using the macOS ārestorable stateā system, so thatās why state is restored, but you donāt see anything in file format. I can imagine also storing this view state in <head>
metadata. I think that would work well for most cases, but it gets messy if you are sharing a file with someone on dropbox (which some TaskPaper users do).
I think better way to expose expanded state is through eventual scripting API.