6.2. Query Inversion
In the text Perspectives across context boundaries we’ve described how computed roles and properties can extend across the border of a context. Such queries reach out of context and bring roles and values in the perspective of a user agent. As a user agent can have actions executed automatically on a state change, we need a mechanism to act on such state changes that would cause new query results. Automatic actions depend on state conditions. In short: a state change outside a context may trigger an action defined for a local user role.
The question is: how do we implement this mechanism? The situation is further complicated because at any moment, just a fraction of the contexts in which automatic actions may be triggered are in the computer memory. By far the greatest number will reside only on disk. In the context of this text we’ll call this the sleeping context problem