Skip to content

docs(contributing): 多会话/自动化协作者规则 - #6

Merged
im47cn merged 1 commit into
mainfrom
docs/multi-session-rules
Sep 2, 2026
Merged

im47cn merged 1 commit into
mainfrom
docs/multi-session-rules

Conversation

@im47cn-bot

@im47cn-bot im47cn-bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

背景

interop n17 合并波次中,并行会话关闭四个 SDK PR 重开(go#23/python#30/ts#22/php#16)时静默丢失了两项已确认决议(ts Node floor 20、php floor 8.2),事后以补齐 commit + PR 评论留痕修复(e0e9a00 / 9115ce6,均验证后合入)。

变更

组织级 CONTRIBUTING 新增 Multi-session & automated collaborators 一节,五条规则:

  1. PR 接管必须留痕——关闭他人 PR 前在原 PR 留言指向新 PR
  2. 不得静默裁剪范围——验收条件:原 diff ⊆ 新 diff,已确认决议必须在接管中存活
  3. 不动他人检出分支——改动走隔离 git worktree;检出被占时直接推 ref
  4. 验证锚定引用而非工作区——共享检出下 git show <ref>:<path> 才是权威
  5. rebase 副本分叉→对齐而非重放——确认内容锚点后 reset 到 origin/main

均为本轮实证过的操作纪律(规则 2/5 直接来自本次事故的修复路径)。

Sourcery 总结

记录并发会话和自动化贡献者的安全协作实践。

增强功能:

  • 记录安全协调多会话和自动化协作的规则,包括 PR 交接、保持工作范围、隔离检出、基于引用的验证,以及重新对齐经过变基的分支。

文档:

  • 添加贡献指南章节,明确多会话和自动化协作者的操作流程。
Original summary in English

Summary by Sourcery

Document safe collaboration practices for concurrent sessions and automated contributors.

Enhancements:

  • Document rules for safely coordinating multi-session and automated collaboration, including PR handovers, preserving scope, isolating checkouts, ref-based verification, and realigning rebased branches.

Documentation:

  • Add a contributing guide section establishing procedures for multi-session and automated collaborators.

PR 接管留痕、原 diff ⊆ 新 diff 验收、不动他人检出分支(worktree 隔离)、
验证锚定 git 引用而非工作区、rebase 副本分叉时对齐而非重放。
源自 interop n17 波次中重开 PR 丢失 floor 决议的实证教训。
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f20c2b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @im47cn-bot, this account has used its review budget of 5,000,000 diff characters for the last 7 days.

You can request another review in 4 days and 3 hours by commenting @sourcery-ai review.

@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

审查者指南

添加双语 CONTRIBUTING 部分,为 PR 交接、范围保持、共享检出隔离、基于 ref 的验证以及变基分支恢复制定五项操作保障措施。

安全接管多会话 PR 的流程图

flowchart TD
    A[PR takeover requested] --> B[Comment on original PR with new PR link]
    B --> C[Preserve original diff and confirmed decisions]
    C --> D{Shared checkout occupied?}
    D -->|No| E[Use isolated git worktree]
    D -->|Yes| F[Push ref directly]
    E --> G[Verify with git show ref:path and origin/main]
    F --> G
    G --> H{Rebased copies already in origin/main?}
    H -->|Yes, content anchors match| I[Reset local branch to origin/main]
    H -->|No| J[Complete takeover PR]
Loading

文件级变更

变更 详细信息 文件
添加组织级指南,以便在共享仓库中安全协调多个会话和自动化协作者。
  • 关闭原始 PR 前,必须添加一条评论并链接替代 PR。
  • 接管 PR 的差异必须保留原始范围和已确认的决策。
  • 必须使用隔离的 worktree 或直接推送 ref,而不是修改其他会话的检出内容。
  • 在共享检出环境中,以 Git refs 作为验证依据。
  • 对于已变基的本地副本,必须将其重新对齐到 origin/main,而不是重新应用重复提交。
CONTRIBUTING.md

提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论生成 GitHub issue: 回复某条审查评论,请 Sourcery 根据该评论创建 issue。你也可以回复审查评论并使用 @sourcery-ai issue,根据该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中任意位置写入 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审查者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审查者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论,不想再看到它们,这一功能会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从新的审查开始,这一功能尤其有用——别忘了评论 @sourcery-ai review 来触发新的审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审查者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

Adds a bilingual CONTRIBUTING section that codifies five operational safeguards for PR handoffs, scope preservation, shared-checkout isolation, ref-based verification, and rebased-branch recovery.

Flow diagram for safe multi-session PR takeover

flowchart TD
    A[PR takeover requested] --> B[Comment on original PR with new PR link]
    B --> C[Preserve original diff and confirmed decisions]
    C --> D{Shared checkout occupied?}
    D -->|No| E[Use isolated git worktree]
    D -->|Yes| F[Push ref directly]
    E --> G[Verify with git show ref:path and origin/main]
    F --> G
    G --> H{Rebased copies already in origin/main?}
    H -->|Yes, content anchors match| I[Reset local branch to origin/main]
    H -->|No| J[Complete takeover PR]
Loading

File-Level Changes

Change Details Files
Add organization-level guidance for safely coordinating multiple sessions and automated collaborators across shared repositories.
  • Require a comment linking a replacement PR before closing the original PR.
  • Require takeover diffs to preserve the original scope and confirmed decisions.
  • Require isolated worktrees or direct ref pushes instead of altering another session’s checkout.
  • Make Git refs the verification authority in shared checkouts.
  • Require realigning rebased local copies to origin/main instead of replaying duplicate commits.
CONTRIBUTING.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 363cd9cb-42ec-45d6-91b6-5e145b405f79


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants