You have parsed documents, evaluated an expression, opened storage, committed people, queried names and verified an update. Keep documents native between those operations; text and bytes belong at the input or output boundary.
Use Documents and Building to construct native documents with builders and typed reads. Use Definitions to save and manage named definitions. Build and evaluate macros through Expressions and macros.
For changing answers, follow the subscription operations in Queries and mutations: consume the initial event, retain the subscription, process subsequent events, and stop it before releasing its database. Follow Query bounds for historical queries. These are advanced topics rather than an unverified watch loop in this starter.
Use Explain and cost to inspect measured work. Check Types and units before converting durations or instants. The operation contracts state ownership, concurrency and failure rules for each language.