Pantograph keeps workflow policy in backend services, concrete runtime execution in the runtime host, and desktop commands as transport/composition adapters. See ARCHITECTURE.md for ownership boundaries.
Python-backed nodes execute in child processes; Pantograph does not embed one global Python interpreter. The worker entry points are:
crates/inference/torch/worker.pycrates/inference/audio/worker.py
Interpreter selection uses, in order:
PANTOGRAPH_PYTHON_ENV_MAP_JSON, anenv_idto executable JSON object;PANTOGRAPH_PYTHON_ENV_MAP_FILE, containing the same mapping;PANTOGRAPH_PYTHON_EXECUTABLE;PYO3_PYTHON;python3orpythononPATH; and- the project
.venvexecutable when available.
Example:
export PANTOGRAPH_PYTHON_ENV_MAP_JSON='{"venv:pytorch":"/opt/pantograph/pytorch/bin/python"}'The selected interpreter and dependency environment are runtime inputs. A missing mapping, dependency, model fact, or worker capability must remain an explicit unavailable/unsupported outcome; do not fall back to a different model or execution path.
The current process adapter does not yet provide complete task/reader/monitor ownership and typed shutdown evidence. Operational automation must account for that known limitation until the architecture remediation is accepted.
The desktop host exposes three diagnostic commands:
get_runtime_registry_snapshotreturns backend-owned runtime-registry state;get_runtime_debug_snapshotaggregates registry, health, recovery, scheduler, and workflow diagnostics; andreclaim_runtime_registry_runtimerequests targeted backend-owned reclaim and returns the resulting state.
These commands are projections. Runtime identity, state transitions, reclaim eligibility, and reconciliation remain owned by the runtime registry and embedded runtime, not by Tauri or the frontend.
Recovery follows this ownership flow:
desktop health/manual trigger
-> recovery coordinator
-> embedded-runtime restart plan
-> producer stop/restore
-> runtime-registry reconciliation
-> projected diagnostics
Before forcing recovery:
- capture the runtime and debug snapshots;
- record the stable runtime identity and reported lifecycle state;
- prefer targeted reclaim over broad restart;
- verify the post-operation registry snapshot; and
- preserve incomplete or failed shutdown/reclaim outcomes in the incident record.
Do not edit registry state directly, infer ownership from a process ID, or treat log output as authoritative runtime state.
The current Diffusers worker has a critical remote-code trust bypass, and the generated-component path can fail open. Do not use untrusted model packages or generated UI source until the security remediation closes those paths.