feedback-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Feedback Loop

反馈循环

Goal

目标

  • User has confirmed the commits, after as many feedback rounds as needed.
  • Any fixup commits created along the way are squashed into their originating commits.
  • 在完成所需的多轮反馈后,用户已确认提交内容。
  • 过程中创建的所有fixup提交都已合并到其对应的原始提交中。

Input

输入

  • target_branch
    : branch to compute the merge-base against, both for deriving the commit set to confirm and for autosquash.
  • target_branch
    : 用于计算合并基准的分支,既用于确定需要确认的提交集,也用于自动压缩操作。

Prerequisites

前提条件

  • fix-feedback
    skill available.
  • 已具备
    fix-feedback
    技能。

Steps

步骤

Step 1: Present for confirmation

步骤1:提交确认

Re-derive the current commit set from git before presenting - don't rely on a carried-over list, since the user may add, drop, or amend commits manually between rounds without saying so:
bash
git log --oneline $(git merge-base HEAD "<target_branch>")..HEAD
Summarize the result for the user (messages, changed files, diff as needed). Ask for proceed confirmation (yes) or feedback (free text). This confirmation is mandatory - if no interactive access to the user exists, stop here and wait rather than auto-proceeding.
在呈现给用户之前,重新从git中获取当前提交集——不要依赖之前的提交列表,因为用户可能在多轮反馈之间手动添加、删除或修改提交而未告知:
bash
git log --oneline $(git merge-base HEAD "<target_branch>")..HEAD
为用户总结结果(提交信息、变更文件、按需展示差异)。询问用户是否确认继续(输入yes)或提供反馈(自由文本)。此确认步骤为必填项——如果无法与用户进行交互,在此处暂停等待,而非自动继续。

Step 2: Route feedback

步骤2:处理反馈

If the user confirms, go to Step 3.
Otherwise, wrap the feedback as a single item and invoke:
Skill(skill: "fix-feedback", args: "fixup mode. {id: 'feedback-loop-<n>', body: '<feedback text>'}")
n
is this skill's iteration count (starts at 1, increments per round).
Read the output entry for
feedback-loop-<n>
:
  • implemented
    : no bookkeeping needed - Step 1's re-derivation picks the new fixup commit up on the next round.
  • declined
    /
    deferred
    /
    explained
    : no new commit - carry its
    description
    into the next Step 1 as context for the user.
Return to Step 1.
如果用户确认,进入步骤3。
否则,将反馈内容封装为单个条目并调用:
Skill(skill: "fix-feedback", args: "fixup mode. {id: 'feedback-loop-<n>', body: '<feedback text>'}")
n
为此技能的迭代次数(从1开始,每轮递增)。
读取
feedback-loop-<n>
的输出结果:
  • implemented
    : 无需额外记录——下一轮执行步骤1时,重新获取提交集会自动包含新的fixup提交。
  • declined
    /
    deferred
    /
    explained
    : 无新提交生成——将其
    description
    带入下一次步骤1,作为用户的上下文信息。
返回步骤1。

Step 3: Autosquash

步骤3:自动压缩

bash
GIT_SEQUENCE_EDITOR=true git rebase --autosquash -i $(git merge-base HEAD "<target_branch>")
bash
GIT_SEQUENCE_EDITOR=true git rebase --autosquash -i $(git merge-base HEAD "<target_branch>")

Output

输出

Markdown format:
  • Commits: final set, from
    target_branch
    's merge-base to
    HEAD
    after squash.
    • Hash
    • Message
Markdown格式:
  • 提交:压缩完成后,从
    target_branch
    的合并基准到
    HEAD
    的最终提交集。
    • 哈希值
    • 提交信息