Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

swarm

并行扇出,收齐报告

Fan out N parallel cloud workers. They may cover separate slices, race the same brief, or mix both. The parent waits, aggregates, and returns one report.

扇出 N 个并行 cloud worker。可覆盖不同切片、竞同一 brief,或两者混合。parent 等待、汇总,交一份报告。

Start

开始

Open a todolist with one entry per phase before launching anything.

启动前打开 todolist,每个阶段一条。

  1. Frame

  2. Fan out

  3. Aggregate

  4. Report

  5. Frame(定框)

  6. Fan out(扇出)

  7. Aggregate(汇总)

  8. Report(报告)

Phase A: Frame

Phase A: 定框

  1. State the done predicate and the artifact or report the swarm must return.

  2. Choose the shape. Partition into slices, race N workers on identical briefs, or mix both. For a race or mixed shape, declare first pass, rank all, or best-of before spawning.

  3. Set N from the user or derive it from the shape. N is total workers, not the cloud concurrency limit.

  4. Pick the worker model from swarm workers in ~/.cursor/rules/pstack-models.mdc when present. Otherwise use grok-4.7-xhigh-fast. For a model race, name each arm’s model up front.

  5. Give each worker its own writable output when it writes. When workers verify or measure commits, each brief names the exact SHAs. A measurement brief also names the method (sample count, what one sample is, order). The worker records both in its result.

  6. 说清 done 谓词,以及 swarm 必须交回的产物或报告。

  7. 选形状。切成切片、N 个 worker 竞同一 brief,或混合。竞速或混合时,spawn 前声明 first pass、rank all 或 best-of。

  8. N 由用户给定或从形状推导。N 是总 worker 数,不是 cloud 并发上限。

  9. 有 ~/.cursor/rules/pstack-models.mdc 里的 swarm workers 就用;否则 grok-4.7-xhigh-fast。模型竞速时,事先点名每臂模型。

  10. worker 要写东西时,给各自可写输出。验证或测量 commit 时,每个 brief 点名精确 SHA。测量 brief 还要点名方法(样本数、一个样本是什么、顺序)。worker 在结果里两项都记。

Phase B: Fan out

Phase B: 扇出

Spawn all N workers in one message with subagent_type: generalPurpose, environment: "cloud", run_in_background: true, and the configured model. Use environment: "local" only when the worker needs access to something on the user’s computer.

在一条消息里 spawn 全部 N 个 worker:subagent_type: generalPurpose,environment: "cloud",run_in_background: true,以及配置的模型。只有 worker 需要碰用户电脑上的东西时才用 environment: "local"。

When a worker must start from a non-default pushed branch, pass cloud_base_branch.

worker 必须从非默认已 push 分支启动时,传 cloud_base_branch。

Every brief stands alone. Include the goal, scope, exact slice or race arm, how to verify, and what to report. Reports use PASS, ISSUES, or BLOCKED with evidence. A worker that can prove a defect reports ISSUES and lists every issue it can prove, not only the first.

每个 brief 独立成立。含目标、范围、确切切片或竞速臂、如何验证、报告什么。报告用 PASS、ISSUES 或 BLOCKED 加证据。能证明缺陷的 worker 报 ISSUES,列出它能证明的每条问题,不只第一条。

If a worker drops out, proceed with N-1 and note it.

有 worker 脱落,用 N-1 继续并记下。

Phase C: Aggregate

Phase C: 汇总

Read the terminal results. Drop a result that does not record the SHAs and method its brief names, and rerun that worker once. After a second miss, record a gap. A gap does not count as a pass. For coverage, every required slice needs a result. For a race, apply the selection rule declared up front. Use first pass, rank all, or best-of. Do not paste raw worker dumps.

读终端结果。未记录 brief 点名的 SHA 与方法的结果丢掉,并重跑该 worker 一次。第二次仍缺就记 gap。gap 不算过。覆盖型:每个必需切片都要有结果。竞速型:用事先声明的选择规则(first pass / rank all / best-of)。别粘贴 worker 原始倾倒。

Keep a compact result table, one-line evidenced issues, and explicit gaps or dropouts.

保留紧凑结果表、一行带证据的问题、以及明确的 gap 或脱落。

Phase D: Report

Phase D: 报告

Return one consolidated in-chat report with the table, issue one-liners, gaps or dropouts, and the race rule when used.

交一份聊天内综合报告:表、问题一行摘要、gap/脱落,以及用到的竞速规则。