feat(simulation): integrate infrastructure jobs and semantic scene editing

Integrate infrastructure preparation and qualified map delivery with local scenes. Add semantic editing, object provenance, survey caching and operator scene tools.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:10:01 +03:00
parent 25dc0a1b44
commit f48411f8fe
116 changed files with 10690 additions and 263 deletions
@@ -0,0 +1,41 @@
"""Infrastructure observations survive control-plane loss; commands stay fenced."""
import http.client
from core_client import CoreRequestRejected
EXPIRED_SESSION = "Сессия Worker истекла; требуется переподключение."
def unavailable(exc):
return isinstance(exc, (OSError, http.client.HTTPException)) or (
isinstance(exc, CoreRequestRejected) and 500 <= exc.status <= 599
)
def registered_request(client, endpoint, body=None, *, hello=None, **kwargs):
"""Retry only an explicit pre-execution session rejection, with the same owner.
Callers use this for reads and idempotent observations/receipts, never dispatch.
A cancellation, changed owner or invalid result is not a transport outage.
"""
try:
return client.request(endpoint, body, **kwargs)
except CoreRequestRejected as exc:
if exc.status != 409 or exc.detail != EXPIRED_SESSION or hello is None:
raise
if hello["instance_id"] != client.instance:
raise ValueError("Infrastructure reconnect owner changed") from exc
client.request("/worker/register", hello)
return client.request(endpoint, body, **kwargs)
def report_progress(client, endpoint, phase, *, hello=None):
# A missed observation must never unwind run_container's cleanup guard.
# The next pulse sends the latest local progress, without a growing queue.
try:
return registered_request(client, endpoint, dict(action="progress", **phase), hello=hello)
except Exception as exc:
if not unavailable(exc):
raise
return None