i4h-workflow-validate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Validate a Workflow

验证工作流

Purpose

目的

Run the selected workflow run mode through the unified launcher, inspect the completed recording, and report simulator success.
通过统一启动器运行选定的工作流运行模式,检查已完成的记录,并报告模拟器运行成功情况。

Instructions

操作步骤

  1. Resolve the base checkout and a live workflow run mode.
  2. Run the unified launcher in the foreground.
  3. Require the final episode success summary.
  4. Inspect visible behavior and every rollout artifact.
  1. 解析基础检出版本和实时工作流运行模式。
  2. 在前台运行统一启动器。
  3. 获取最终的任务成功摘要。
  4. 检查可见行为和所有部署产物。

Resolve live support

解析实时支持

bash
export I4H_WORKFLOWS_REPO_URL="${I4H_WORKFLOWS_REPO_URL:-https://github.com/isaac-for-healthcare/i4h-workflows}"
I4H_REPO_DIR_NAME="${I4H_WORKFLOWS_REPO_URL%/}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME##*/}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME##*:}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME%.git}"
[ -n "$I4H_REPO_DIR_NAME" ] || { echo "Cannot derive a checkout name from I4H_WORKFLOWS_REPO_URL" >&2; exit 2; }
ROOT="${I4H_WORKFLOWS:-$(git rev-parse --show-toplevel 2>/dev/null)}"
if [ ! -d "$ROOT/workflows/i4h_workflows" ]; then
  ROOT="${I4H_WORKFLOWS:-$HOME/$I4H_REPO_DIR_NAME}"
  [ -d "$ROOT/workflows/i4h_workflows" ] || git clone "$I4H_WORKFLOWS_REPO_URL" "$ROOT"
fi
export I4H_WORKFLOWS="$ROOT"
cd "$ROOT"
./run.sh list
Treat the resolver above as part of the skill contract: a hosted copy may run outside the base repository, so never assume the current checkout contains
workflows/i4h_workflows
.
I4H_WORKFLOWS_REPO_URL
selects the clone source. When
I4H_WORKFLOWS
is unset, derive the fallback directory from that URL; set
I4H_WORKFLOWS
only to reuse or choose a specific destination. Never replace an existing checkout.
Treat
./run.sh list
output as the complete authoritative workflow-by-mode table; it is dependency-light and faster than scanning workflow modules. Do not duplicate that mutable table in this skill. Map the user's natural name to a listed workflow id, then choose only a mode shown on that same line:
User intentRequired live modeLauncher argument
Ordinary learned-policy evaluation
policy
--policy
Requested or only available local controller
rule-based
--rule-based
Explicit named alternative such as N1.7matching listed mode such as
policy_n17
--mode <name>
Inspect
./run.sh show <workflow> --mode <mode>
, the workflow module, Scene manifest, and selected Task manifest when model, prompt, checkpoint, goal, or step-cap behavior matters.
Use precise readiness language:
  • Structurally valid:
    show
    , per-mode lint, and
    lint --all
    pass.
  • Launchable: the selected simulator mode starts and every required backend/checkpoint preloads.
  • Rollout-validated: the requested episodes complete and the recorded success evidence passes inspection.
Do not report “validated” without stating which level was actually reached.
bash
export I4H_WORKFLOWS_REPO_URL="${I4H_WORKFLOWS_REPO_URL:-https://github.com/isaac-for-healthcare/i4h-workflows}"
I4H_REPO_DIR_NAME="${I4H_WORKFLOWS_REPO_URL%/}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME##*/}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME##*:}"
I4H_REPO_DIR_NAME="${I4H_REPO_DIR_NAME%.git}"
[ -n "$I4H_REPO_DIR_NAME" ] || { echo "Cannot derive a checkout name from I4H_WORKFLOWS_REPO_URL" >&2; exit 2; }
ROOT="${I4H_WORKFLOWS:-$(git rev-parse --show-toplevel 2>/dev/null)}"
if [ ! -d "$ROOT/workflows/i4h_workflows" ]; then
  ROOT="${I4H_WORKFLOWS:-$HOME/$I4H_REPO_DIR_NAME}"
  [ -d "$ROOT/workflows/i4h_workflows" ] || git clone "$I4H_WORKFLOWS_REPO_URL" "$ROOT"
fi
export I4H_WORKFLOWS="$ROOT"
cd "$ROOT"
./run.sh list
将上述解析器视为技能契约的一部分:托管副本可能在基础仓库外运行,因此切勿假设当前检出版本包含
workflows/i4h_workflows
。
I4H_WORKFLOWS_REPO_URL
用于选择克隆源。当
I4H_WORKFLOWS
未设置时,从该URL推导回退目录;仅当需要重用或选择特定目标目录时才设置
I4H_WORKFLOWS
。切勿替换现有检出版本。
将
./run.sh list
的输出视为完整的权威工作流-模式对照表;该命令依赖少,比扫描工作流模块更快。请勿在此技能中复制此可变对照表。将用户的自然名称映射到列出的工作流ID,然后仅选择同一行显示的模式:
用户意图所需实时模式启动器参数
常规学习策略评估
policy
--policy
指定或仅有的本地控制器
rule-based
--rule-based
明确的命名替代方案(如N1.7)匹配列出的模式(如
policy_n17
)
--mode <name>
当模型、提示词、检查点、目标或步骤限制行为至关重要时,检查
./run.sh show <workflow> --mode <mode>
、工作流模块、场景清单和选定的任务清单。
使用精确的就绪状态术语:
  • 结构有效:
    show
    命令、按模式的lint检查和
    lint --all
    检查均通过。
  • 可启动:选定的模拟器模式启动,且所有必需的后端/检查点预加载完成。
  • 部署验证通过:请求的任务完成,且记录的成功证据通过检查。
未说明实际达到的验证级别时,请勿报告“已验证”。

Foreground execution rule

前台执行规则

Keep
run.sh
as this agent's foreground tool call. Do not use a subagent, monitor task, shell backgrounding,
nohup
,
tmux
, or a detached process. Poll a yielded session until exit and inspect the final episode summary before responding. When the selected Task is remote, the policy backend subprocess internally owned by
run.sh
is expected; a simulator-compatible exported RSL-RL Task runs in-process.
Run visibly by default. If the user explicitly requests headless execution, or a documented environment constraint makes it necessary, say so before launch and include
--headless
; never switch to headless silently.
Policy:
bash
./run.sh <workflow> --policy \
  --episodes <N> --attempts 3 \
  --record verify.hdf5
Rule-based:
bash
./run.sh <workflow> --rule-based \
  --episodes <N> --attempts 3 \
  --record verify.hdf5
The launcher creates a unique canonical run directory and anchors the relative
verify.hdf5
inside it. Resolve
RUN_DIR
from the
==> run dir ...
line or machine-readable
run.json
; do not recreate the launcher's timestamp. Use
--run-dir "$RUN_DIR"
only when a caller-selected location must be shared with another stage; the launcher creates it. Absolute recording paths remain supported.
For another declared mode, use
--mode <name>
. For a supplied/new checkpoint, resolve its exact path, confirm it belongs to the selected policy Task, and pass
--checkpoint /absolute/path
; an exported RSL-RL Task expects its TorchScript
policy.pt
, while a remote Task expects the owning backend's loadable checkpoint format. For “300 timesteps,” pass
--episode-steps 300
.
Never raise the Scene manifest's cap.
--episode-steps
may only lower it. Remote inference waits do not consume simulation steps. Use a unique
--namespace
when another run of the same workflow is active.
将
run.sh
作为此Agent的前台工具调用。请勿使用子Agent、监控任务、Shell后台运行、
nohup
、
tmux
或分离进程。轮询生成的会话直至退出,并在回复前检查最终任务摘要。当选定的任务为远程任务时,
run.sh
内部管理的策略后端子进程是预期的;与模拟器兼容的导出RSL-RL任务在进程内运行。
默认以可见模式运行。如果用户明确请求无头执行,或文档化的环境限制要求无头执行,则在启动前说明并添加
--headless
参数;切勿静默切换到无头模式。
策略模式:
bash
./run.sh <workflow> --policy \
  --episodes <N> --attempts 3 \
  --record verify.hdf5
基于规则的模式:
bash
./run.sh <workflow> --rule-based \
  --episodes <N> --attempts 3 \
  --record verify.hdf5
启动器会创建唯一的规范运行目录,并将相对路径的
verify.hdf5
锚定在其中。从
==> run dir ...
行或机器可读的
run.json
中解析
RUN_DIR
;请勿重新生成启动器的时间戳。仅当调用方选定的位置必须与其他阶段共享时,才使用
--run-dir "$RUN_DIR"
;启动器会创建该目录。绝对记录路径仍受支持。
对于其他声明的模式,使用
--mode <name>
参数。对于提供的/新的检查点,解析其确切路径,确认它属于选定的策略任务,并传递
--checkpoint /absolute/path
参数;导出的RSL-RL任务需要其TorchScript格式的
policy.pt
,而远程任务需要所属后端的可加载检查点格式。对于“300时间步长”,传递
--episode-steps 300
参数。
切勿提高场景清单的限制。
--episode-steps
仅可降低该限制。远程推理等待不会消耗模拟步骤。当同一工作流的另一个运行实例处于活动状态时,使用唯一的
--namespace
参数。

Verify

验证

Require exit status 0 and final
N/N episodes succeeded
. A failed attempt followed by a successful retry counts as a successful requested episode; report attempts and retries.
bash
RUN_DIR="<absolute run_dir from run.json or launcher output>"
uv run --project tools/dataset i4h-dataset inspect "$RUN_DIR/verify.hdf5" --segments
Inspect episode metadata, action/state widths, camera frames, node segments, and success flags. For visible runs, observe Scene/camera behavior and final task outcome. On failure, use the first actionable backend, contract, graph, or simulator error; never switch modes or increase the cap silently. Run
./stop.sh all
after crashes that leave processes.
For a success rule that excludes collision, inspect the owning contact-sensor configuration and require a forced-contact negative test at least once after authoring or changing that rule. A sensor that initializes but has never produced a non-zero filtered force does not establish collision rejection.
要求退出状态为0,且最终显示
N/N episodes succeeded
。失败尝试后跟随成功重试的情况,算作成功完成请求的任务;需报告尝试次数和重试次数。
bash
RUN_DIR="<absolute run_dir from run.json or launcher output>"
uv run --project tools/dataset i4h-dataset inspect "$RUN_DIR/verify.hdf5" --segments
检查任务元数据、动作/状态宽度、相机帧、节点段和成功标志。对于可见模式运行,观察场景/相机行为和最终任务结果。失败时,优先处理第一个可解决的后端、合约、图或模拟器错误;切勿静默切换模式或提高限制。在导致进程残留的崩溃后运行
./stop.sh all
命令。
对于排除碰撞的成功规则,检查所属接触传感器的配置,并要求在编写或更改该规则后至少执行一次强制接触阴性测试。初始化后从未产生非零过滤力的传感器,无法确立碰撞排除机制。

Troubleshooting

故障排除

Use the first actionable backend, graph, contract, or simulator error. Retry within the same mode and cap only after correcting it.
优先处理第一个可解决的后端、图、合约或模拟器错误。仅在修正错误后,才可在相同模式和限制内重试。

Prerequisites

先决条件

Require synced simulator assets and any backend/checkpoint declared by the selected run mode.
要求同步模拟器资产,以及选定运行模式声明的所有后端/检查点。

Limitations

限制

Only modes from
run.sh list
are supported, and a runtime step override may lower but never raise the validated Scene cap.
仅支持
run.sh list
列出的模式,且运行时步骤覆盖仅可降低(不可提高)已验证的场景限制。

Examples

示例

  • Evaluate scissor pick and place for 2 episodes.
    → run policy mode for two successful episodes, record, inspect, and report attempts plus visible outcome.
  • Run surgical_reach_psm in rule-based mode for 1 episode.
    → use only the declared local-controller mode.
  • Evaluate scissor pick and place for 2 episodes.
    → 运行策略模式完成2次成功任务,记录结果、检查并报告尝试次数、重试次数及可见结果。
  • Run surgical_reach_psm in rule-based mode for 1 episode.
    → 仅使用声明的本地控制器模式运行。

Completion gate

完成标准

Report workflow, mode, model/checkpoint source, requested successes, attempts/retries, completion steps, visible outcome, HDF5 path and inspection, final exit status, and first unresolved failure if any.
报告工作流、模式、模型/检查点来源、请求的成功次数、尝试/重试次数、完成步骤、可见结果、HDF5路径及检查情况、最终退出状态,以及任何未解决的首个失败问题。