Skip to content

Python Protocol Map

Last reviewed: 2026-06-30

Cross-check source: C:/Anuva/dev/anuva-python-server/docs/state/UnityProtocolMap.md last reviewed 2026-07-05.

Topology

Port Unity setting Python role Unity role Status
5560 commandPort REQ connect REP bind Matches Python docs
5561 statusPort PULL bind PUSH connect Matches Python docs
5562 heartbeatPort PULL bind PUSH connect Matches Python docs

Commands

Message Direction Unity payload handling Python docs payload Status
render.start Python -> Unity outputPath, jobType, configPath, configUrl; command ack unity.commandAck. configPath, configUrl, outputPath, jobType, render. Partial: Unity ignores render.
render.cancel Python -> Unity reason; cancels active render and emits render.failed. reason. Implemented
unity.shutdown Python -> Unity reason; exits play mode/app. reason. Implemented
unity.ping Python -> Unity Sends unity.ready with pong. {}. Implemented

Events

Message Direction Unity payload Python consumer/effect
unity.ready Unity -> Python unityInstanceId, appVersion, protocolVersion, capabilities, optional pong Python marks Unity ready.
unity.heartbeat Unity -> Python state, fps, currentJobId Python records heartbeat/rendering state.
render.accepted Unity -> Python unityJobId Python marks job in progress.
render.progress Unity -> Python progress, phase, message Python normalizes progress and forwards status.
render.completed Unity -> Python outputPath, durationSec, frameCount, fileSizeBytes Python validates/uploads/completes.
render.failed Unity -> Python errorCode, errorMessage, optional details Python fails active job.
unity.commandAck Unity -> Python as command reply accepted, optional error Python decodes generic command reply.

Unity Source Files

File Role
Assets/Anuva/Scripts/AnuvaPythonServerCommunication.cs Real protocol endpoint for renderer.
Assets/Anuva/Scripts/PresentationController.cs Handles render start/cancel/shutdown and sends render status events.
Assets/Anuva/Scripts/AnuvaUnityVideoGeneratorSimulator.cs Fake Unity endpoint.
Assets/Anuva/Scenes/Anuva_Simulator_Scene.unity Scene containing simulator.

Known Divergence From Python Server Docs

Divergence Impact
Python sends/describes optional render payload object on render.start; Unity does not read it. Capture/render settings from Python may be ignored unless encoded in config or output path.
Python docs describe production worker launch/readiness; Unity scene instances inspected have Python communication disabled. Server-driven rendering may require scene configuration before end-to-end use.
Python has protocol unit/integration tests; Unity repo has no automated protocol tests. Compliance currently relies on simulator/manual or Python-side tests.