Physical world model and semantic evidence
Status: proposed build-on-read projection; no world-state runtime or database is introduced. Ownership follows the architecture audit and observation model.
Existing foundation and limits
src/robot/services/physical_context.py::SemanticPhysicalContextService already
composes robot, environment, air quality, motion, presence, attention and observed
expression. It obtains snapshots rather than polling devices. Its shape is a
compact robot-local context, not a general spatial graph.
services/physical_assessment.py::PhysicalContextAssessmentService reads existing
history and current availability to qualify temporal evidence. It does not
classify trends or infer causes. core/environmental.py already owns bounded
environmental interpretation. core/presence.py and core/attention.py own
confirmed camera-based presence and target continuity. Reuse these specialized
interpreters instead of introducing another global behavior/meaning engine.
Proposed entities and authority
| Concept | Owner | Meaning |
|---|---|---|
| Space descriptor | Canonical validated configuration | Opaque space ID, optional operator label and explicit relationships; no automatically inferred topology |
| Source descriptor | Canonical validated configuration | Stable physical-source ID, supported quantities, optional space/placement, lineage/aliases and privacy policy |
| Provider session | Existing runtime-owned provider | Connection/capability metadata and active generation; no ownership of physical meaning |
| Current observation | Existing domain service extended by source | Latest admitted fact with provenance, freshness and quality |
| Retained evidence | Existing TemporalHistoryService extended by source |
Bounded measurement and semantic-transition history |
| Assessment | Existing assessment/domain policy extended | Read-only deterministic result with evidence references, rule version, limitations and outcome |
| World view | Application-service projection | Detached request-time composition of authorized descriptors, observations and assessments |
The term “world model” describes relationships and evidence projections, not a second source of truth. Indexes may refer to domain-owned observations but cannot silently maintain their own authoritative current values. Cross-domain snapshots are not currently atomic; the projection must disclose per-section times rather than promise a globally simultaneous observation. A future revision mechanism must be justified separately if atomic consistency becomes necessary.
flowchart TD
spaces[Configured spaces and source bindings] --> projection[Read-only world projection]
current[Canonical per-source domain snapshots] --> projection
history[Existing bounded temporal evidence] --> readiness[Evidence readiness and scoped rules]
current --> readiness
readiness --> projection
projection --> service[PhosApplicationService]
service --> policy[Identity and permission filtering]
policy --> context[Legacy robot-local context]
policy --> future[Future opt-in source and space evidence views]
Spatial meaning
Start with explicit configured space bindings, including an unknown/unassigned case. A configured room is operator-supplied context, not sensor-measured location. Source relocation increments its binding revision and breaks spatial continuity; old samples retain their old binding rather than being relabeled. The robot's own location must also remain unknown unless explicitly configured or supported by a separately approved localization capability.
Camera attention x/y and detector bounding boxes are image-relative. IMU axes are body/mount-relative acceleration and angular velocity. They cannot be merged into metric space coordinates without calibration and an approved transform. Local tracking IDs are ephemeral associations, never biometric identity. No SLAM, map UI, localization stack, or persistent person/object tracking is proposed. Sensor placement and field of view constrain every occupancy claim.
Temporal and multi-source assessment
First expose independently qualified facts. Fusion becomes useful only after source identity, timing, location and lineage are explicit. Do not infer independence because two transport messages use different providers: one sensor may publish through serial and MQTT, or two derived values may share a device.
A proposed rule evaluates:
- Permission-filtered inputs for the same explicitly bound space and compatible quantity/observation class.
- Freshness, validity, units, overlap and source-time uncertainty for its window.
- Source lineage, reliability limitations, location revision and history gaps.
- A bounded deterministic calculation with a named/versioned rule.
- An outcome with evidence references and explicit reasons for disagreement, insufficient data or unknown location/time.
Do not implement a generic confidence average. Confidence in a detector label,
transport authentication, measurement accuracy and evidence continuity are
different properties. Existing evidence valid does not establish truth or
safety. Any future confidence quantity requires a documented interpretation and
validation dataset; otherwise use categorical qualifications.
Examples below are target assessment behavior, not claims of existing fusion:
| Inputs | Appropriate target answer | Unsupported inference |
|---|---|---|
| Two independent fresh temperatures in one configured space disagree materially | Return both qualified readings and a conflict; apply a rule only with an approved tolerance | Silently averaging away disagreement |
| Camera sees a face and a mapped motion sensor reports activity in the same space/window | Report corroborating bounded presence evidence with both lineages and visibility limits | Exact people count, identity or whole-room occupancy certainty |
| Camera sees no face while a motion sensor reports activity | Preserve differing observation scopes; occupancy remains qualified or unknown | Declaring the motion sensor faulty or the room vacant |
| TVOC/eCO2 and humidity change | Return aligned facts and bounded arithmetic evidence | Identifying a pollutant source, health risk or causal event |
| Recent fresh readings follow a disconnected interval | Qualify the recent segment using the existing recovery evidence semantics | Claiming the entire requested interval was continuous |
No future assessment should automatically trigger speech or a visual signal just
because it exists. An explicit approved behavior policy may consume qualified
observations through Core events. Authorized agent actions continue through
AgentApplicationService and PhosApplicationService, then existing behavior,
LED/overlay/visual lease and Voice arbitration. External facts never become
commands, and world queries never change expression or start acquisition workers.
Compatibility, privacy and failure behavior
Keep the existing robot-local context projection and selection rules. Distributed values cannot overwrite its configured native source merely because they arrived later. Source/space views require an explicit contract and policy review before exposure; existing operation permissions do not express room-level access.
Filter evidence before assessment and serialization so a restricted room cannot leak through counts, aggregates, labels, references or change notifications. An agent's denied access is not a physical unknown and must not be turned into a misleading observation. Avoid exposing private topology through error details. Do not expand RAM retention to images, audio, transcripts or identity.
Partial failure yields partial views with per-section freshness/unknown reasons; loss of a provider does not erase unrelated evidence or become “normal”. Keep history-gap/eviction qualifications. Cache only if a later measured performance need justifies a bounded derived cache with revision and expiry; no independent world store is part of the initial design.
Acceptance and unresolved scope
Extend tests/test_physical_context.py, test_physical_assessment.py,
test_temporal_history.py, core/test_presence_attention.py, and service/agent
permission tests. Use fake sources, explicit space bindings and injected clocks.
Verify conflicts, aliases, relocation, stale/missing inputs, mixed-time snapshots,
unknown space, denied evidence, repeatable read-only results, and compatibility
selection. Performance acceptance must bound sources, rule work and response size
on Pi 3 before enabling distributed assessments.
The first fusion rule, tolerances, privacy granularity, source limits and configuration migration remain open. None is inferred from a device/entity name or selected by an LLM. Persistent storage and autonomous general automation remain outside scope.