diff --git a/AGENTS-CN.md b/AGENTS-CN.md index 46e85bfa99..c25f803074 100644 --- a/AGENTS-CN.md +++ b/AGENTS-CN.md @@ -64,6 +64,21 @@ Web UI、mobile、CLI、Desktop、Installer、打包及 focused test 命令由 ## 全局规则 +### 修复 bug 前先检查已有修复 + +OpenBitFun 目前约每周发布一个版本,用户反馈的可能是已发布版本中的问题,而 `main` 上 +已经修复,或已有未合并 PR 正在处理。**修改 bug 相关代码前,必须同时检查:** + +- **最新 `main`:** 在不影响本地工作的前提下刷新上游 `main` 引用,阅读相关实现、测试 + 和提交历史。结合已知的反馈版本与复现条件,根据代码和实际行为判断,不能只看提交标题。 +- **未合并 PR(包括草稿):** 按问题现象和受影响模块检索,阅读相关 diff,确认是否覆盖 + 同一根因及场景,不能仅凭标题相似就认定已经有人处理。 + +若 `main` 已修复,应给出对应提交或代码依据,并说明是否已发布,避免重复实现。 +若已有 PR 覆盖,应引用该 PR,复用或协调已有工作,只针对确认尚未覆盖的部分补充修改。 +开始新修复前先说明检查结论;若无法访问上游代码或 PR,应明确说明未核实的范围,不能 +据此断言问题尚无人解决。 + ### 流程产物 - 不要新增或更新 `docs/superpowers/**` 下的文件。临时计划、设计和实现过程文档仅保留在本地; diff --git a/AGENTS.md b/AGENTS.md index ea4b66a8e7..b390920776 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,6 +81,27 @@ commands, use the nearest local guide. The full script registry remains in ## Global rules +### Check for existing bug fixes before editing + +OpenBitFun currently releases roughly once a week, so a user report may describe +a released version whose bug is already fixed on `main` or being addressed in an +open PR. **Before changing code for a bug, check both:** + +- **Latest `main`:** refresh the upstream `main` ref without disturbing local + work, then inspect the relevant implementation, tests, and commit history. + Check the reported version and reproduction conditions when available; base + the conclusion on code and behavior, not commit titles alone. +- **Open PRs, including drafts:** search by symptoms and affected modules, then + inspect relevant diffs to establish whether they cover the same root cause + and scenario. A similar title alone does not establish coverage. + +If `main` already contains the fix, report the supporting commit/code and whether +it is released; do not implement it again. If an open PR covers it, link that PR +and build on or coordinate with the existing work; limit new changes to verified +gaps. Record the check result before starting a new fix. If upstream code or PRs +cannot be checked, state that limitation explicitly instead of claiming that no +fix exists. + ### Process artifacts - Do not add or update files under `docs/superpowers/**`. Keep temporary