Runtime vs HAL: Two Execution Paths
PhyAgentOS provides two execution paths. The HAL path is simpler and action-oriented. The Runtime path is more structured, session-oriented, and adds priority scheduling, preflight checks, and perception pipelines.
| Feature | HAL Path | Runtime Path |
|---|---|---|
| Queue format | ACTION.md (single actions) | SESSIONS.md (session queue) |
| Executor | hal_watchdog.py | WatchdogSupervisor + run_runtime_watchdog.py |
| Scheduling | FIFO only | Priority-based (high / normal / low) |
| Preflight checks | Minimal | Strict: sensor calibration, schema validation |
| Perception pipeline | Not integrated | Built-in plugin pipeline |
| Artifact output | Inline in ACTION.md | episode.json + LOG.md |
| Use case | Simple action execution | Structured rollout with observability |
SESSIONS.md In Detail
SESSIONS.md uses YAML frontmatter-style sessions. Each session includes priority, timeout, retry, and routing fields.
## session_001
priority: high
queue_timeout: 300
execute_timeout: 600
policy_timeout: 30
max_retries: 3
attempted: 1
policy_endpoint: builtin
adapter: simulation
status: queued
instruction: "navigate to the table and pick up the red cube"| Field | Description |
|---|---|
priority | high → normal → low. Higher priority sessions execute first. Same priority uses file order. |
queue_timeout | Max seconds a session can wait in queue before being marked timeout. |
execute_timeout | Max seconds for the entire session execution (across all steps and retries). |
policy_timeout | Max seconds for a single policy inference call. |
max_retries | Maximum retry attempts. Counter tracked in attempted field. |
policy_endpoint | Where the policy runs: builtin, remote, or custom adapter name. |
adapter | Target adapter for execution (maps to a TargetAdapter instance). |
status | Current state: queued, running, completed, failed, timeout, rejected. |
Initialize Runtime Workspace
The runtime workspace must be initialized before the watchdog can begin processing sessions. Use the init script to scaffold all required files.
python scripts/init_runtime_workspace.py --workspace /tmp/testFiles generated:
| File | Purpose |
|---|---|
TARGETS.md | Registry of available execution targets (simulators, real robots) with their capabilities and perception configs. |
SKILLS.md | Declared skills per target, including sensor requirements and policy endpoints. |
SESSIONS.md | The session queue. Initially empty, populated by the Agent or manually. |
LOG.md | Execution log with per-session results (status, steps, return values). |
configs/runtime/sensors/*.yaml | Sensor configuration files defining available sensors and their channels. |
configs/runtime/perception/*.yaml | Perception pipeline configuration: preprocessors, models, postprocessors. |
Run Runtime Watchdog
The runtime watchdog polls SESSIONS.md, dispatches sessions to the WatchdogSupervisor, and records results.
Single pass (--once)
python run_runtime_watchdog.py \
--workspace /tmp/test \
--onceContinuous polling
python run_runtime_watchdog.py \
--workspace /tmp/test \
--environment-workspace /tmp/envExpected outputs after each session:
- SESSIONS.md status updated to
completed,failed, ortimeout - LOG.md appended with session_id, target_id, status, num_steps, and return_value
- artifacts/runtime/<session_id>/episode.json created with full execution trace
--environment-workspace to write ENVIRONMENT.md v2 to a separate directory. This keeps environment observations decoupled from the runtime session state.
Perception Plugin Pipeline
Setting perception.enabled: true in TARGETS.md triggers strict preflight validation of sensor and perception YAML configs before any session executes.
Preflight Checks
Validates sensor availability, calibration file paths, and observation schemas. Fails fast if any requirement is unmet.
Plugin Pipeline
Runs after preflight passes. Chains sensor readers, preprocessors, model inference, and postprocessors.
Pipeline output: ENVIRONMENT.md v2 in the environment workspace with structured observations.
| Common Failure | Cause | Fix |
|---|---|---|
missing sensor_config_ref | SKILLS.md references a sensor not defined in configs/runtime/sensors/ | Add the missing sensor YAML or fix the reference |
missing observation channel | Sensor config declares channels the driver doesn't expose | Align sensor config channels with driver output |
dtype/shape mismatch | Perception model expects different tensor shape than sensor produces | Add a preprocessor to reshape/downscale sensor output |
Execution Results
Each completed session produces structured artifacts for debugging, evaluation, and replay.
LOG.md Format
| session_id | target_id | status | num_steps | return_value |
|------------|-----------|---------|-----------|--------------|
| sess_001 | sim_01 | completed | 12 | 0.87 |
| sess_002 | sim_01 | failed | 3 | 0.12 |episode.json Structure
{
"session_id": "sess_001",
"target_id": "sim_01",
"status": "completed",
"steps": [
{
"step": 0,
"observation": {...},
"action": {...},
"reward": 0.5,
"next_observation": {...}
}
],
"return_value": 0.87,
"metadata": {
"start_time": "...",
"end_time": "...",
"retries": 0
}
}Artifacts directory layout:
artifacts/runtime/
├── sess_001/
│ └── episode.json
├── sess_002/
│ └── episode.json
└── latest -> sess_002/Enabling Perception Step-by-Step
Perception is disabled by default. Enable it through TARGETS.md and ensure all required configs are in place.
-
Set TARGETS.md perception.enabled to true
## sim_01 type: simulation perception: enabled: true sensor_config_ref: sim_rgbd perception_config_ref: sim_basic -
Add sensor requirements to SKILLS.md
Each skill must declare which sensors it needs. Example:
pick_uprequiresrgbanddepthchannels. -
Ensure sensor/perception YAML configs exist
ls configs/runtime/sensors/sim_rgbd.yaml ls configs/runtime/perception/sim_basic.yaml -
Run watchdog with --environment-workspace
python run_runtime_watchdog.py \ --workspace /tmp/test \ --environment-workspace /tmp/env -
Verify ENVIRONMENT.md appears
cat /tmp/env/ENVIRONMENT.mdIf empty or missing, check preflight output for errors.
perception.enabled: true but run the watchdog with --once --dry-run to validate the config pipeline without executing any sessions.