Document topologies and state abstractions