sol-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesol-loop
sol-loop
This is a workflow for making your code changes more correct before (or
sometimes after) filing a pull request. tl;dr - use OpenAI's GPT Sol to review
your code in a loop.
Make the most minimal possible changes to appease the Sol reviewers. Be careful
of scope creep and don't be scared to push back.
这是一套工作流,用于在提交 pull request 之前(有时也可在之后)提高代码变更的正确性。简而言之——使用 OpenAI 的 GPT Sol 循环审查你的代码。
为满足 Sol reviewers 的要求,应尽可能只做最小改动。谨慎避免 scope creep,也不要害怕提出异议。
Budget
预算
- Default: 3 rounds total. Round 1 is full. Later rounds check only changed code and open findings.
- Extend to 5 only for security, permissions, auth, data loss, or state/concurrency, while a blocker or should stays open with evidence. Or when the user asks.
- Stop early if a round returns only nits. Declined nits and comment, doc, or format-only fixes need no new round.
- One reviewer only. Sol must not start subagents or reviewers.
- Keep a ledger: id, severity, outcome, usage if returned. Never guess it.
- 默认共 3 轮。第 1 轮进行完整审查。后续轮次只检查发生变更的代码和 尚未解决的 findings。
- 仅当涉及 security、permissions、auth、data loss 或 state/concurrency, 且 blocker 或 should 在有证据的情况下仍未解决时,才延长至 5 轮;用户提出 要求时也可延长。
- 如果某一轮只返回 nits,则提前结束。已拒绝的 nits,以及仅涉及注释、文档 或格式的修复,无需开启新一轮。
- 只使用一个 reviewer。Sol 不得启动 subagents 或其他 reviewers。
- 维护一个 ledger:id、severity、outcome,以及系统返回时的 usage。绝不猜测 这些信息。
1. Scope
1. 范围
Run . Do not stash, discard, or include unrelated
changes. Limit review to the change paths if they separate cleanly.
Otherwise stop and ask.
git status --shortFind the base after :
git fetch origin- PR: . Check out the branch only if clean. Confirm
gh pr view <n> --json baseRefName,headRefOidis the PR head, or ahead only by this change. Base:HEAD.git merge-base HEAD origin/<baseRefName> - Local: . No remote: a base the user names, or
git merge-base HEAD origin/<default-branch>for uncommitted changes only.HEAD
The change is base to working tree in those paths, with untracked files.
Use one diff command all rounds. State intent and out-of-scope in 1-2
sentences. Run covering checks. Do not send code this change breaks. Note
missing or pre-failing checks in the brief.
执行 。不要 stash、discard 或纳入无关变更。如果变更路径
能够清晰分离,则将审查范围限制在这些路径内;否则停止并询问。
git status --short执行 后确定 base:
git fetch origin- PR:。仅在工作区 clean 时 checkout 该分支。确认
gh pr view <n> --json baseRefName,headRefOid是 PR head,或者仅领先当前变更。Base:HEAD。git merge-base HEAD origin/<baseRefName> - 本地:。无 remote 时,使用用户 指定的 base;对于仅有 uncommitted changes 的情况,才使用
git merge-base HEAD origin/<default-branch>。HEAD
本次变更是从 base 到这些路径中 working tree 的差异,并包含 untracked files。
所有轮次都使用同一条 diff 命令。用 1~2 句话说明 intent 和 out-of-scope。
运行能够覆盖本次变更的 checks。不要提交会导致 checks 因本次变更而失败的代码。
在 brief 中注明缺失或原本就失败的 checks。
2. Start Sol
2. 启动 Sol
In T3, call . Pick the latest Sol unless the user
named a version. Do not hardcode an ID. Record provider, model, and effort
only if exposed. Use every round (,
). Save . New per round.
is storage, not the next target. Do not use
, , or for review.
orchestrator_capabilitiesdelegate_taskrole: "review"mode: "async"taskIdclientRequestIdchildThreadIdt3_thread_sendcreate_threadst3_thread_launchIf T3 tools are not listed, try one direct capability call. Outside T3, use
a native Sol subagent and keep its ID. In Claude Code, use a custom subagent
only if it is set up to run Sol. If no route runs Sol, report the blocker. Do
not substitute a model.
Do not edit scoped files while review runs. Wait for the notice. Do not
poll or start a second reviewer. Timeout, error, or no reply is not
approval. On failure, cancel, verify stop, restart with the ledger.
Round 1 brief (T3 children get no history):
Review only. Do not edit, commit, push, comment on PRs, or start subagents.
Repo: <abs path> Base: <sha> Intent: <intent> Out of scope: <scope> Checks: <results>
See: git diff <base> [-- <paths>]; git status --short (read untracked).
Read surrounding code. Find bugs, broken callers, mismatch with intent.
Skip style unless it hides a bug. Hold to the smallest change. Flag code,
tests, or guards the intent does not need. Other paths, rare cases, small
perf, extra compat: nits.
blocker = intended case wrong. should = real bug callers will hit, in intent. nit = rest.
Reply:
VERDICT: APPROVE or CHANGES
S1 [blocker|should|nit] <file>:<line> <claim>. Fix: <suggestion> (stable ids)在 T3 中,调用 。除非用户指定了版本,否则选择最新的
Sol。不要硬编码 ID。仅在系统公开这些信息时记录 provider、model 和 effort。
每轮都使用 (,)。保存 。
每轮使用新的 。 用于存储,不是下一轮的目标。
审查时不要使用 、 或 。
orchestrator_capabilitiesdelegate_taskrole: "review"mode: "async"taskIdclientRequestIdchildThreadIdt3_thread_sendcreate_threadst3_thread_launch如果未列出 T3 tools,则尝试直接调用一次 capability。在 T3 之外,使用原生 Sol
subagent 并保留其 ID。在 Claude Code 中,只有 custom subagent 已配置为运行 Sol
时才能使用。如果没有任何途径可以运行 Sol,则报告 blocker。不得替换模型。
review 运行期间不要编辑 scoped files。等待通知。不要轮询,也不要启动第二个
reviewer。超时、报错或无回复均不代表 approval。失败时,取消任务、确认其停止,
然后携带 ledger 重启。
第 1 轮 brief(T3 children 没有历史记录):
Review only. Do not edit, commit, push, comment on PRs, or start subagents.
Repo: <abs path> Base: <sha> Intent: <intent> Out of scope: <scope> Checks: <results>
See: git diff <base> [-- <paths>]; git status --short (read untracked).
Read surrounding code. Find bugs, broken callers, mismatch with intent.
Skip style unless it hides a bug. Hold to the smallest change. Flag code,
tests, or guards the intent does not need. Other paths, rare cases, small
perf, extra compat: nits.
blocker = intended case wrong. should = real bug callers will hit, in intent. nit = rest.
Reply:
VERDICT: APPROVE or CHANGES
S1 [blocker|should|nit] <file>:<line> <claim>. Fix: <suggestion> (stable ids)3. Answer findings
3. 处理 findings
Check each finding and severity yourself. Another path, rare case, or
small cost is a nit, whatever label it came with.
- Agree: smallest fix. Prefer delete or narrow over new lock, cache, helper, or option. Fix the case that happened. Add one focused test that fails without the fix, if intent needs it.
- Disagree: say why, with evidence (file:line, test, output).
- Out of scope or nit: decline in one line. List as follow-up.
Update the ledger. Re-run checks and . If
review grew the diff, cut first. Do not agree just to end the loop.
git diff --shortstat <base>逐项自行核查每个 finding 及其 severity。无论 finding 最初带有什么标签,只要它
属于其他路径、罕见情况或很小的成本,都应视为 nit。
- 同意:采用最小修复。相比新增 lock、cache、helper 或 option,优先删除代码 或缩小范围。修复实际发生的情况。如果 intent 有需要,添加一个在没有该修复时 就会失败的聚焦测试。
- 不同意:说明理由,并提供证据(file:line、test、output)。
- 超出范围或属于 nit:用一行拒绝,并将其列为 follow-up。
更新 ledger。重新运行 checks 和 。如果审查导致 diff
增大,先削减改动。不要只是为了结束循环而同意 findings。
git diff --shortstat <base>4. Next round
4. 下一轮
Start one only if budget remains and a blocker or should is open, behavior code
changed, or approval does not cover the current behavior diff. Use a fresh
in T3, or follow up the saved native ID. Send the round 1 brief,
the ledger ( / / + evidence), the same base
diff, and the change since last round. Tell Sol: open ids and changed code only.
Mark each old id or .
delegate_taskfixed:disagree:declined:resolvedstill open: <reason>仅当预算尚有剩余,并且存在以下任一情况时,才启动下一轮:blocker 或 should
仍未解决;behavior code 发生变化;或 approval 未覆盖当前 behavior diff。在 T3
中使用新的 ,或者跟进已保存的原生 ID。发送第 1 轮 brief、ledger
( / / + 证据)、同一个 base diff,以及自上一轮以来的
变更。告诉 Sol:只处理仍开放的 id 和变更代码。将每个旧 id 标记为
或 。
delegate_taskfixed:disagree:declined:resolvedstill open: <reason>5. Stop and ship
5. 停止并交付
Agreed: APPROVE on the current behavior diff, no blocker or should open,
no concern of your own. Stuck: an item stays disputed after two replies,
or budget ends. Show both sides in 2-3 lines each. The user decides.
Budget end is not approval.
Do not push during the loop. Push after agreement only if the user asked
to push, ship, or update the PR. If you push to a PR, add above the model
blurb:
Reviewed with sol-loop: <N> rounds with <model>. Sol verdict: approvedAdd only if verified.
on <effort>Report: rounds, model, what Sol changed, diff size before/after, fixed and
declined findings with reasons, usage if exposed (else say not), pushed or not.
达成一致:对当前 behavior diff 给出 APPROVE,没有仍开放的 blocker 或 should,
并且你本人没有其他 concern。陷入僵局:某个 item 在两轮回复后仍有争议,或预算
耗尽。双方的每一方观点用 2~3 行展示。由用户决定。预算耗尽不代表 approval。
循环期间不要 push。只有达成一致且用户要求 push、ship 或 update PR 时,才执行
push。如果 push 到 PR,请在上述模型说明(model blurb)上方添加:
Reviewed with sol-loop: <N> rounds with <model>. Sol verdict: approved仅当已验证时,才添加 。
on <effort>报告:轮次、model、Sol 改了什么、变更前后的 diff 大小、已修复和已拒绝的 findings
及原因、usage(如果已公开,否则说明未公开)、是否 push。