scene_service.state.relations¶
Relation engine — pure-geometric predicates over the object registry. Runs at 1 Hz as its own asyncio task. Output is a list of (subject, predicate, target) triples cached on the engine and exposed via current() / served by the snapshot tools.
Classes
|
Periodic recomputation of pairwise relations + cached snapshot. |
|
- class scene_service.state.relations.RelationEngine(registry: ObjectRegistry, *, period_s: float = 1.0)[source]¶
Bases:
objectPeriodic recomputation of pairwise relations + cached snapshot.
Read path: engine.current() returns the latest cached list. Reads don’t touch the registry lock — they grab the engine’s local cache that the periodic tick refreshed atomically. So MCP query calls don’t have to wait for ingest.
- current() list[RelationTriple][source]¶