herdr-quorum

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Herdr Quorum

Herdr Quorum

Resolve the run

解析本次运行

Use the requested profile from
profiles/
; default to review. Load only that profile. Resolve the user's request to an exact scope; ask when ambiguous rather than infer a whole-repository task. For a commit range, resolve and freeze the endpoint hashes and check working-tree status in one call. Leave diff inventories and source investigation to the workers.
Require
HERDR_ENV=1
. Read the Herdr skill for terminal mechanics and safety; if unavailable in the skill catalog, load it with
herdr --skill
. Stop if Herdr or its instructions are unavailable. For quorum's documented operations, use the bundled contract directly; general Herdr discovery instructions do not add a preflight here.
Complete when the profile, scope, and Herdr execution context are known.
使用
profiles/
中指定的 profile;默认使用 review。仅加载该 profile。将用户请求收敛为明确的 scope;如有歧义,应先询问,而不是自行推断成整个仓库的任务。如果范围是 commit range,则在一次调用中解析并锁定两端 hashes,并检查 working-tree 状态。diff 清单和源码调查留给 worker。
要求
HERDR_ENV=1
。阅读 Herdr skill,了解终端操作机制和安全要求;如果 skill catalog 中找不到它,则使用
herdr --skill
加载。如果 Herdr 或其说明不可用,则停止。对于 quorum 文档中规定的操作,直接使用随附的 contract;通用的 Herdr 发现说明在这里不需要额外的 preflight。
当 profile、scope 和 Herdr 执行上下文都明确后,本阶段完成。

Prepare the brief

准备 brief

Prepare one common brief containing the profile's worker instructions, resolved scope, user constraints, and applicable project rules already in context. Keep the synthesis instructions with the lead. Workers load further project guidance as needed during their task; discovering optional rule directories is not a launch prerequisite. An absent optional directory ends that lookup.
Use the profile's
cli|model|reasoning
tuples as data. The launcher validates their structure, rejects duplicates and unmapped CLIs, and translates the bundled CLI mappings. Trust those mappings and requested identifiers. Execution is the compatibility check: no help calls, model listings, configuration searches, or documentation probes before launch. Keep compatibility diagnosis separate from a quorum run.
Complete when the exact scope and one common brief are ready. Proceed directly to launch; do not perform the workers' investigation first.
准备一份统一的 brief,其中包含 profile 的 worker instructions、已确定的 scope、用户约束,以及当前上下文中已知的适用项目规则。将 synthesis instructions 保留给 lead。Worker 可在执行任务时按需加载更多项目说明;发现可选规则目录并不是 launch 的前置条件。如果可选目录不存在,则结束该查找。
将 profile 中的
cli|model|reasoning
tuples 作为数据处理。launcher 会验证其结构,拒绝重复项和未映射的 CLI,并转换随附的 CLI mappings。信任这些 mappings 和指定的 identifiers。执行本身就是兼容性检查:launch 前不要调用 help、列出 models、搜索配置或探测文档。将兼容性诊断与 quorum 运行分开处理。
当准确的 scope 和统一 brief 准备好后,本阶段完成。直接进入 launch,不要先执行 worker 的调查工作。

Launch once

启动一次

Invoke the launcher with
python3
, its absolute skill-relative path, and one
--worker
per selected tuple. Send the common brief once on stdin using a quoted heredoc. For example, replacing the example tuple and brief with the selected profile and resolved task:
sh
python3 /absolute/skill/path/scripts/launch.py \
  --worker 'pi|provider/exact-model|high' <<'QUORUM_BRIEF'
<common brief>
QUORUM_BRIEF
Run from the project directory. Choose a heredoc delimiter absent from the brief and shell-quote each tuple as one argument. Pass
--direction right
or
--direction down
only when the user requested that first split direction. Allow 120 seconds for the launcher command; worker execution continues independently afterward.
The launcher creates sibling panes without moving focus, partitions only its own worker area, starts fresh interactive agents concurrently, and prompts each immediately when ready. It preserves native configuration and permissions. Each worker receives the common brief plus ten-minute pacing instructions: reserve the final minute for reporting and disclose unfinished scope. Workers remain blind to each other's conclusions and the lead's proposed answer.
Its JSON output prints a private temporary
run_dir
containing
brief.txt
,
run.json
, and
monitor.log
. A detached monitor owns concurrent
agent prompt --wait
calls, durable collection events, and each worker's deadline from submission. It inspects and interrupts only this run's working agents at their deadlines, recording uncertain or still-active outcomes. It continues while the lead reviews reports or a collection command is interrupted.
The launcher returns when every worker has reached a wait attempt or a recorded failure;
waiting
is not proof of prompt delivery or completion. Exit 0 means no failure was recorded at return, not that workers succeeded; exit 1 means recorded failures or a launch/monitor problem; exit 2 means invalid input or context. Inspect the manifest after any interruption, including a tool timeout. Never rerun the launcher automatically or regenerate its mechanics in shell.
Startup or dispatch failures are missing coverage: continue with survivors without retries, substitutions, or repairs. A layout failure stops launch with partial pane IDs preserved. Leave approval decisions to the user.
Complete when the launcher returns or its interrupted outcome has been inspected in the recorded run directory.
使用
python3
调用 launcher,并传入基于 skill 目录确定的绝对路径,为每个选中的 tuple 添加一个
--worker
。通过带引号的 heredoc,将统一 brief 一次性从 stdin 发送。例如,将示例 tuple 和 brief 替换为所选 profile 和已解析任务:
sh
python3 /absolute/skill/path/scripts/launch.py \
  --worker 'pi|provider/exact-model|high' <<'QUORUM_BRIEF'
<common brief>
QUORUM_BRIEF
在项目目录中运行。选择一个 brief 中不存在的 heredoc delimiter,并对每个 tuple 进行 shell quoting,使其作为单个参数传入。仅当用户明确要求初始 split direction 时,才传入
--direction right
或
--direction down
。为 launcher 命令预留 120 秒;在此之后,worker 会继续独立执行。
Launcher 会创建同级 panes,且不会切换焦点;它只划分自身的 worker 区域,并发启动全新的交互式 Agent,并在每个 Agent 就绪后立即发送 prompt。它保留原生配置和权限。每个 worker 都会收到统一 brief 和十分钟的节奏说明:最后一分钟用于汇报,并披露尚未完成的 scope。所有 worker 彼此看不到对方的结论,也看不到 lead 拟定的答案。
它的 JSON 输出会给出一个私有临时
run_dir
,其中包含
brief.txt
、
run.json
和
monitor.log
。分离运行的 monitor 负责并发的
agent prompt --wait
调用、持久化的 collection events,以及从提交时开始计算的每个 worker deadline。它会在 deadline 时检查并仅中断本次运行中仍在工作的 Agent,同时记录结果不确定或仍处于 active 状态的情况。在 lead 审阅报告或 collection 命令被中断期间,monitor 会继续运行。
Launcher 返回时,每个 worker 都已到达 wait attempt,或已有记录在案的 failure;
waiting
不能证明 prompt 已送达或任务已完成。Exit 0 表示返回时没有记录到 failure,不表示所有 worker 都成功;exit 1 表示记录到 failure,或出现 launch/monitor 问题;exit 2 表示输入或上下文无效。任何中断后都要 inspect manifest,包括工具超时。不要自动重跑 launcher,也不要在 shell 中重新实现其执行机制。
启动或 dispatch 失败意味着 coverage 缺失:继续处理仍存活的 worker,但不要重试、替换或修复。Layout failure 会停止 launch,同时保留部分 pane IDs。审批决策留给用户。
当 launcher 返回,或其中断结果已在记录的 run directory 中完成检查后,本阶段完成。

Collect progressively

渐进式收集

Use the collector rather than agent-state polling:
sh
python3 /absolute/skill/path/scripts/collect.py --run-dir '<run_dir>' --after 0
Allow 390 seconds for each collector command. It blocks until new events, monitor completion, or a five-minute checkpoint; already-recorded events return immediately. Read reports for newly settled workers promptly and source-check them while others continue. Keep those findings with the lead so remaining workers stay blind. Pass the returned
cursor
as
--after
on the next call, after processing the batch. An interrupted call can safely reuse its previous cursor; collection never consumes events.
A
checkpoint
permits one health inspection of this run's unresolved workers, then another blocking collection. A settled state, including
blocked
, is only a cue to inspect—not a usable report. Inspect failed, blocked, unknown, deadline, and interruption events through Herdr.
complete: true
means monitoring ended, not that every worker succeeded. Reconcile every worker in the returned snapshot, including any still active, before synthesis. If the monitor is unavailable, inspect
run.json
,
monitor.log
, and the recorded panes; handle survivors within their remaining budgets without relaunching.
To cancel the run, use the same collector with
--cancel
and allow 720 seconds. It inspects and interrupts this run's working agents without answering approval dialogs or closing panes. Cancellation overlapping a slow submission waits for activity within the worker's original budget. Review the recorded outcomes and report any agents still active; if monitoring has already finished, the collector sends no new input and directs cleanup back to Herdr. A collector/tool timeout alone leaves the monitor and workers running; reconnect with the same cursor. If the monitor is unavailable during cancellation, inspect and interrupt only this run's working agents directly through Herdr.
Read reports using Herdr's recent-unwrapped output. Follow its larger-read and temporary-Markdown fallback when a complete response cannot be recovered. Preserve usable reports even when accompanied by a lifecycle anomaly, and disclose that anomaly. Treat an observed failure to honor an explicit model or reasoning setting as a worker failure. Missing output is missing coverage, not agreement or a no-findings result.
Complete when every worker has a usable report or a failure reason.
使用 collector,而不是轮询 Agent 状态:
sh
python3 /absolute/skill/path/scripts/collect.py --run-dir '<run_dir>' --after 0
为每条 collector 命令预留 390 秒。它会阻塞,直到出现新事件、monitor 完成或到达五分钟 checkpoint;已经记录的事件会立即返回。及时读取刚进入已确定状态的 worker 报告,并在其他 worker 继续运行时对其进行 source check。将这些发现留给 lead,使剩余 worker 保持信息隔离。处理完一批后,将返回的
cursor
作为下一次调用的
--after
参数。被中断的调用可以安全地复用上一个 cursor;collection 不会消费事件。
Checkpoint 允许对本次运行中尚未解决的 worker 做一次健康检查,然后再次进行阻塞式 collection。已确定的状态(包括
blocked
)只是检查信号,并非可用报告。通过 Herdr 检查 failed、blocked、unknown、deadline 和 interruption events。
complete: true
表示监控已经结束,不表示每个 worker 都成功。综合之前,要核对返回 snapshot 中的每个 worker,包括仍处于 active 状态的 worker。如果 monitor 不可用,则 inspect
run.json
、
monitor.log
和记录的 panes;在各 worker 的剩余预算内处理存活者,不要 relaunch。
如需取消运行,使用同一个 collector 并加上
--cancel
,预留 720 秒。它会检查并中断本次运行中仍在工作的 Agent,但不会回答审批对话框,也不会关闭 panes。如果取消操作与较慢的提交发生重叠,则在 worker 的原有预算内等待其活动。审阅已记录的结果,并报告仍 active 的 Agent;如果 monitor 已结束,collector 不会发送新输入,而是将清理工作交回 Herdr。collector/工具超时本身不会让 monitor 和 worker 停止;使用相同 cursor 重新连接。如果取消期间 monitor 不可用,则直接通过 Herdr 检查并中断仅属于本次运行的工作 Agent。
使用 Herdr 的 recent-unwrapped output 读取报告。当无法恢复完整回复时,采用其 larger-read 和临时 Markdown fallback。即使伴随 lifecycle anomaly,也要保留可用报告,并披露该异常。若观察到 worker 未遵循明确指定的 model 或 reasoning 设置,则将其视为 worker failure。输出缺失意味着 coverage 缺失,不能视为意见一致或“无发现”结果。
当每个 worker 都有可用报告或 failure reason 时,本阶段完成。

Synthesize

综合

Apply the profile's synthesis instructions to the attributed reports. Label one usable report a single-worker result; if none are usable, return the failure summary without synthesis.
Append coverage for every worker: name, requested CLI/model/reasoning, pane ID when created, and result or failure reason. Distinguish requested settings from any observed mismatch. Leave worker panes open for inspection and follow-up.
Complete when the synthesis and coverage account for every selected worker.
按照 profile 中的 synthesis instructions 综合有来源标注的报告。如果只有一份可用报告,将结果标记为 single-worker result;如果没有任何可用报告,则不要进行综合,只返回 failure summary。
为每个 worker 追加 coverage:名称、请求的 CLI/model/reasoning、创建成功时的 pane ID,以及结果或 failure reason。区分请求的设置与实际观察到的 mismatch。保持 worker panes 打开,以便检查和后续跟进。
当综合结果和 coverage 涵盖所有选中的 worker 时,本阶段完成。

Maintain profiles and mappings

维护 profiles 和 mappings

Add
profiles/<name>.md
with a
Workers
YAML block and
Worker instructions
and
Synthesis instructions
sections. Keep task policy in the profile and execution mechanics in the launcher. Profiles are reference documents, not separately invokable skills.
Only when asked to diagnose compatibility or add a CLI, consult installed help or authoritative documentation and update the CLI contract, launcher, and tests together. Run
python3 -m unittest discover -s /absolute/skill/path/tests -v
; the tests use a fake Herdr and never start real agents.
新增
profiles/<name>.md
,其中包含 Workers YAML 块,以及 Worker instructions 和 Synthesis instructions 章节。将任务策略保留在 profile 中,将执行机制保留在 launcher 中。Profiles 是参考文档,不是可单独调用的 skills。
只有在用户要求诊断兼容性或添加 CLI 时,才查阅已安装的 help 或权威文档,并同步更新 CLI contract、launcher 和 tests。运行
python3 -m unittest discover -s /absolute/skill/path/tests -v
;tests 使用 fake Herdr,绝不会启动真实的 Agent。