unit-executor
从`UNITS.csv`中精确执行一个可运行单元(第一个TODO,其依赖项为DONE),然后更新单元状态和工件。**触发器**:单元执行器,运行一个单元,下一个单元,逐步管道,逐条执行,UNITS.csv。**使用时**:需要严格“一次只做一个单元”(可审计、可),并遵守检查点/HUMAN支持逻辑。**跳过if**:要一行运行自动(用) `research-pipeline-runner`)或工作空间不存在。**网络**:无。**护栏**:只执行一个单元;满足仓库且输出存在才可标记“DONE”;遇到HUMAN检查点必须停止。
📖 中文导读:从`UNITS.csv`中精确执行一个可运行单元(第一个TODO,其依赖项为DONE),然后更新单元状态和工件。**触发器**:单元执行器,运行一个单元,下一个单元,逐步管道,逐条执行,UNITS.csv。**使用时**:需要严格“一次只做一个单元”(可审计、可),并遵守检查点/HUMAN支持逻辑。**跳过if**:要一行运行自动(用) `research-pipeline-runner`)或工作空间不存在。**网络**:无。**护栏**:只执行一个单元;满足仓库且输出存在才可标记“DONE”;遇到HUMAN检查点必须停止。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: unit-executor
description: |
Execute exactly one runnable unit from UNITS.csv (first TODO whose dependencies are DONE), then update unit status and artifacts.
Trigger: unit executor, run one unit, next unit, step-by-step pipeline, 逐条执行, UNITS.csv.
Use when: 需要严格“一次只做一个 unit”(可审计、可中断),并遵守 checkpoints/HUMAN 阻塞逻辑。
Skip if: 要端到端自动跑(用 research-pipeline-runner)或 workspace 不存在。
Network: none.
Guardrail: 只执行一个 unit;满足验收且输出存在才可标 DONE;遇到 HUMAN checkpoint 必须停下。
Skill: unit-executor
Goal
- Execute one unit end-to-end and leave the workspace in a consistent state.
Inputs
UNITS.csv- Unit inputs listed in the row (files)
Outputs
- Unit outputs listed in the row (files)
- Updated
UNITS.csvstatus (TODO → DOING → DONE/BLOCKED) - Optional:
STATUS.mdupdated
Procedure (MUST FOLLOW)
- Load
UNITS.csvand find the first unit with:status=TODO- all
depends_onunits areDONE
- Set its status to
DOINGand persistUNITS.csv. - Run the referenced skill (by following that skill’s
SKILL.md). - Check the unit’s
acceptanceagainst produced artifacts. - If acceptance passes, set status to
DONE; otherwise set toBLOCKEDwith a short note inSTATUS.md. - Stop after one unit (do not start the next unit automatically).
Acceptance criteria (MUST CHECK)
- Exactly one unit changes from
TODOtoDONE/BLOCKED(viaDOING). - Output files exist (or acceptance explicitly allows otherwise).
Side effects
- Allowed: edit workspace artifacts (
UNITS.csv,STATUS.md, unit outputs). - Not allowed: modify
.codex/skills/content.
Script
Quick Start
python .codex/skills/unit-executor/scripts/run.py --helppython .codex/skills/unit-executor/scripts/run.py --workspace <workspace_dir>
All Options
--strict: enable quality gate (blocks on scaffolds; writesoutput/QUALITY_GATE.md)
Examples
- Run exactly one unit (strict):
python .codex/skills/unit-executor/scripts/run.py --workspace <ws> --strict
- Equivalent repo wrapper:
python scripts/pipeline.py run-one --workspace <ws> --strict
Notes
- Returns 0 on
DONE/IDLE, 2 onBLOCKED/ERROR(useful for automation).
Troubleshooting
Issue: no runnable unit is found
Fix:
- Check
UNITS.csvfor unmet dependencies, missing outputs, orowner=HUMANunits waiting on approvals inDECISIONS.md.
Issue: a unit is marked DONE but outputs are missing
Fix:
- Fix the status to
TODO/BLOCKEDand re-run; only markDONEwhen acceptance criteria and outputs are satisfied.