docs: 将 CONTRIBUTING.md 和 SECURITY.md 翻译为中文
Some checks failed
CI / build-check-test (push) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 20:49:18 +08:00
parent 07a918d4cd
commit 812bca79a3
2 changed files with 89 additions and 123 deletions

View File

@@ -1,102 +1,97 @@
# Contributing to pi # 贡献指南
This guide exists to save both sides time. 本指南旨在为双方节省时间。
## Philosophy ## 设计理念
First things first: **pi's core is minimal**. 首先明确一点:**SproutClaw 的核心保持精简**。
If your feature does not belong in the core, it should be an extension. PRs that bloat the core will likely be rejected. 如果你的功能不属于核心,它应该以扩展的形式实现。会让核心臃肿的 PR 大概率会被拒绝。
Pi's core exists to be minimal and to be extensible so that it can be influenced and manipulated by extensions. Even hook points for extensions however should be well considered and discussed to avoid adding unmaintainable bloat and complex interactions. SproutClaw 的核心存在的意义在于精简且可扩展,以便扩展能够影响和定制其行为。即便是扩展的 hook 点也需要经过充分考量和讨论,避免引入难以维护的冗余代码和复杂交互。
## The One Rule ## 唯一准则
**You must understand your code.** If you cannot explain what your changes do and how they interact with the rest of the system, your PR will be closed. **你必须理解自己提交的代码。** 如果你无法解释你的改动做了什么、以及它与系统其他部分如何交互,你的 PR 将被关闭。
Using AI to write code is fine. Submitting AI-generated slop without understanding it is not. 使用 AI 辅助编写代码没有问题,但在不理解代码的情况下直接提交 AI 生成的内容是不被接受的。
If you use an agent, run it from the `pi` root directory so it picks up `AGENTS.md` automatically. Your agent must follow the rules and guidelines in that file. 如果你使用 Agent请在 `sproutclaw` 根目录运行,这样它会自动读取 `AGENTS.md`。你的 Agent 必须遵循该文件中的规则和指南。
## Contribution Gate ## 贡献门槛
All issues and PRs from new contributors are auto-closed by default. 来自新贡献者的 issue 和 PR 默认会被自动关闭。
Issues submitted Friday through Sunday are not guaranteed to be reviewed. If something is urgent, ask on Discord: https://discord.com/invite/3cU7Bz4UPx 周五至周日提交的 issue 不保证会被审查。如有紧急问题,请在内部联系维护者。
Maintainers review auto-closed issues daily and reopen worthwhile ones. Issues that do not meet the quality bar below will not be reopened or receive a reply. 维护者会每日审查被自动关闭的 issue并重新开放值得处理的内容。不符合以下质量标准的 issue 将不会被重新开放或收到回复。
Approval happens through maintainer replies on issues: 审批通过由维护者在 issue 中回复:
- `lgtmi`: your future issues will not be auto-closed - `lgtmi`:你未来提交的 issue 将不再被自动关闭
- `lgtm`: your future issues and PRs will not be auto-closed - `lgtm`:你未来提交的 issue 和 PR 将不再被自动关闭
`lgtmi` does not grant rights to submit PRs. Only `lgtm` grants rights to submit PRs. `lgtmi` 不授予提交 PR 的权限,只有 `lgtm` 才授予该权限。
## Quality Bar For Issues ## Issue 质量标准
If you open an issue, you must use one of the two GitHub issue templates. 提交 issue 时,必须使用两个 GitHub issue 模板之一。
If you open an issue, keep it short, concrete, and worth reading. 提交的 issue 应简洁、具体、有阅读价值:
- Keep it concise. If it does not fit on one screen, it is too long. - 保持简短。如果超过一屏,就太长了。
- Write in your own voice (do not use an LLM to generate text, if you must, follow up with a clearly AI labeled comment). - 用自己的语言表达(不要用 LLM 生成文本;如果必须,请在后续评论中明确标注为 AI 生成)。
- State the bug or request clearly. - 清晰说明 bug 或需求。
- Explain why it matters. - 解释其重要性。
- If you want to implement the change yourself, say so. - 如果你希望自己来实现,请说明。
If the issue is real and written well, a maintainer may reopen it, reply `lgtmi`, or reply `lgtm`. 如果 issue 真实且表述良好,维护者可能会重新开放、回复 `lgtmi` 或回复 `lgtm`
## Blocking ## 封禁规则
If you ignore this document twice, or if you spam the tracker with agent-generated issues, your GitHub account will be permanently blocked. 如果你两次无视本文档,或通过 Agent 批量刷 issue你的账号将被永久封禁。
If you send a large volume of issues through automation, your GitHub account will be permanently blocked. No taksies backsies. 如果你通过自动化手段大量提交 issue你的账号将被永久封禁且不可申诉。
## Before Submitting a PR ## 提交 PR
Do not open a PR unless you have already been approved with `lgtm`. 未获得 `lgtm` 批准前,请勿提交 PR。
Before submitting a PR: 提交 PR 前,请先执行:
```bash ```bash
npm run check npm run check
./test.sh ./test.sh
``` ```
Both must pass. 两项均须通过。
Do not edit `CHANGELOG.md`. Changelog entries are added by maintainers. 不要修改 `CHANGELOG.md`,更新日志条目由维护者添加。
If you are adding a new provider to `packages/ai`, see `AGENTS.md` for required tests. 如果你要在 `packages/ai` 中添加新的 provider请参阅 `AGENTS.md` 中关于必要测试的说明。
## Questions? ## 有疑问?
Ask on [Discord](https://discord.com/invite/nKXTsAcmbT). 请联系项目维护者。
## FAQ ## 常见问题
### Why are new issues and PRs auto-closed? ### 为什么新 issue 和 PR 会被自动关闭?
pi receives more issues than the maintainers can responsibly review in real time. Many reports do not meet the quality bar in this guide or do not follow CONTRIBUTING.md. Some are slung at the repository mindlessly via an agent instead of being reviewed and shaped by the person submitting them. Auto-closing creates a buffer so maintainers can review the tracker on their own schedule and reopen the issues that meet the quality bar. SproutClaw 收到的 issue 数量超过维护者能够实时处理的上限。许多报告不符合本指南的质量标准,或者是通过 Agent 随意提交而未经本人审查和整理的。自动关闭机制让维护者可以按自己的节奏审查,并重新开放符合质量要求的 issue。
### Why are weekend issues lower priority? ### 为什么周末的 issue 优先级较低?
We triage the tracker during working hours. That means more issues can accumulate over the weekend. Anything submitted Friday through Sunday may be missed or given lower priority in the Monday review queue. If a problem is urgent, ask on Discord and include the short version, a repro, and the relevant logs. 维护者在工作时间处理 issue。周末可能积累更多未处理内容周五至周日提交的 issue 可能在周一审查时被遗漏或优先级降低。如有紧急问题,请直接联系维护者并附上简要描述、复现步骤和相关日志。
### Why do some issues get no reply? ### 为什么有些 issue 没有收到回复?
A reply is maintenance work too. Low-signal issues, unclear reports, duplicates, and issues that do not follow this guide may be closed without discussion. This keeps time available for reproducible bugs, thoughtful requests, and contributors who have done the work to make their report actionable. 回复本身也是一种维护成本。低质量 issue、表述不清的报告、重复 issue 以及不遵循本指南的 issue 可能被直接关闭而不作说明。这样可以将时间留给可复现的 bug、深思熟虑的需求以及真正用心整理报告的贡献者。
### Why not let AI triage everything? ### 为什么不用 AI 来做所有分类工作?
AI can help group duplicates, summarize reports, and spot missing information. It is not trusted to make final maintainer decisions. Polished AI-generated issues can still be wrong, misleading, or expensive to investigate. Human review remains the final gate. AI 可以帮助归纳重复内容、汇总报告、发现缺失信息,但不被信任来做最终的维护决策。经过润色的 AI 生成 issue 仍然可能是错误的、有误导性的,或需要大量时间排查。人工审查始终是最终把关环节。
### Is this hostile to contributors? ### 这对贡献者是否过于苛刻?
No. It is a guardrail against burnout and tracker spam. Short, concrete, reproducible issues are welcome. Thoughtful contributions are welcome. Automated slop, entitlement, and large volumes of low-effort reports are not. 不是。这是防止维护者精力耗尽和 issue 刷屏的保护机制。简洁、具体、可复现的 issue 是受欢迎的,有深度的贡献同样受欢迎。自动化生成的低质量内容、无理取闹以及大量低价值报告则不被接受。
## Where can I learn about plans?
Earendil uses RFCs to discuss larger changes. Not all of them are public, but
quite a few are. They can be found at [rfc.earendil.com](https://rfc.earendil.com/keyword/pi/).

View File

@@ -1,87 +1,58 @@
# Security Policy # 安全政策
This document should guide you about understanding the security concept behind 本文档旨在帮助你了解 SproutClaw 的安全设计理念及其边界范围。
Pi and also where the boundaries are.
In general Pi is a coding agent that runs locally within the security boundary ## 安全模型概述
of the user that is running it. It's the responsibiltiy of the user to monitor
its operations or to contain it within a container, virtual machine or other
Sandbox solution.
Pi treats the local user account and files writable by that account as inside SproutClaw 是一个在本地运行的 Coding Agent运行于使用者账号的安全边界之内。监控其操作或将其限制在容器、虚拟机或其他沙箱环境中是使用者自身的责任。
the same trust boundary as the Pi process itself. If an attacker can modify files
under the user's home directory, workspace, shell startup files, environment, or
Pi configuration, they can generally influence Pi or other local developer tools.
Reports that depend on such prior local write access are not security
vulnerabilities unless they demonstrate how Pi grants that write access or crosses
an operating-system privilege boundary.
Pi relies on users installing trustworthy extensions and loading trustworthy SproutClaw 将本地用户账号及该账号可写的文件视为与 SproutClaw 进程处于同一信任边界内。如果攻击者能够修改用户主目录、工作区、Shell 启动文件、环境变量或 SproutClaw 配置文件,通常即可影响 SproutClaw 或其他本地开发工具的行为。依赖此类本地写入权限的报告不属于安全漏洞,除非其能证明 SproutClaw 本身授予了该写入权限,或越过了操作系统的权限边界。
skills and only to use pi within trusted repositories. This is because files
like `AGENTS.md` or instructions in comments can be used to prompt inject the
coding agent trivially and this cannot be protected against.
## Reporting a Vulnerability SproutClaw 依赖使用者仅安装可信扩展、加载可信技能,并仅在可信仓库中使用。这是因为 `AGENTS.md` 等文件中的内容或代码注释可被用于对 Coding Agent 进行提示词注入,且此类攻击无法从根本上防御。
If you believe you found a security vulnerability in pi or another package in ## 报告漏洞
this repository, please report it privately by either:
- Emailing `security@earendil.com`, or 如果你认为在 SproutClaw 中发现了安全漏洞,请通过以下方式私下报告:
- Opening a private report through GitHub Security Advisories for this repository
Please include: - 直接联系项目维护者
- A description of the issue and its impact 报告时请包含:
- Steps to reproduce, proof of concept, or relevant logs
- Affected package, version, commit, or configuration
- Any known mitigations
Do not open a public issue for security-sensitive reports. We will review - 问题描述及其影响
reports and coordinate disclosure as appropriate. - 复现步骤、概念验证或相关日志
- 受影响的包、版本、提交哈希或配置信息
- 已知的缓解措施(如有)
## Scope 请勿为安全敏感问题创建公开 issue。
Security issues in the distributed packages, command-line tools, APIs, and ## 范围内In Scope
repository code are in scope as well as earendil operated infrastricture
on `pi.dev`.
## Out Of Scope 以下属于安全问题的受理范围:
- Local code execution or sandboxing behavior (the Pi coding agent intentionally does not have a sandbox) - 分发包、命令行工具、API 及仓库代码中的安全问题
- Behavior of pi extensions or skills installed by the user
- Risks from working in untrusted repositories
- Risks from installing untrusted extensions, skills, packages, or tools
- Isuses caused by non trustworthy MITM proxies
- Public internet exposure of a Pi installation
- Prompt injection attacks
- Exposed secrets that are third-party/user-controlled credentials
- Reports requiring the ability to create, modify, delete, or replace files,
directories, symlinks, environment variables, shell configuration, or other
user-controlled local state on the target machine. This includes `~/.pi`,
`~/.pi/agent/models.json`, workspace files, `AGENTS.md`, skills, extensions,
extension configuration, dotfiles, and files synchronized through NFS, roaming
profiles, or dotfile managers, unless the report shows how Pi itself grants
that access.
- Issues caused by intentionally weakened user configuration.
- Resource/DOS claims that require trusted local input/config against the pi coding agent.
- Reports about malicious model output.
- User-approved or user-initiated local actions presented as vulnerabilities.
## Notes for Reporters ## 范围外Out of Scope
The most useful reports show a current, reproducible security boundary bypass 以下内容不在安全问题受理范围之内:
with demonstrated impact. Reports that only show expected local-agent behavior,
prompt injection, or a malicious trusted extension/skill are not security
vulnerabilities under this model.
For example, a report showing that malicious contents written to a trusted Pi - 本地代码执行或沙箱行为SproutClaw Coding Agent 有意不提供沙箱)
configuration file cause Pi to execute commands, load attacker-controlled tools, - 用户自行安装的扩展或技能的行为
send credentials to an attacker-controlled endpoint, or otherwise change behavior - 在不可信仓库中工作所带来的风险
is out of scope. - 安装不可信扩展、技能、包或工具所带来的风险
- 由不可信中间人代理MITM Proxy导致的问题
- 将 SproutClaw 暴露在公网上的风险
- 提示词注入攻击
- 第三方或用户自行控制的凭据泄露
- 需要在目标机器上具备创建、修改、删除或替换文件、目录、符号链接、环境变量、Shell 配置或其他用户可控本地状态的能力才能复现的报告(包括 `~/.pi``~/.pi/agent/models.json`、工作区文件、`AGENTS.md`、技能、扩展、扩展配置、dotfiles 及通过 NFS/漫游配置/dotfile 管理器同步的文件),除非报告能证明 SproutClaw 本身授予了该访问权限
- 由用户有意弱化配置导致的问题
- 针对 SproutClaw Coding Agent 使用可信本地输入/配置的资源耗尽/DoS 声明
- 关于恶意模型输出的报告
- 用户批准或用户主动发起的本地操作被当作漏洞提交的报告
When possible, include the exact affected path, package version or commit SHA, ## 报告者须知
configuration, and a proof of concept against the latest release or latest
`main`. For dependency reports, include evidence that the shipped dependency is 最有价值的报告应展示当前可复现的安全边界绕过,并附有已证明的实际影响。仅展示预期本地 Agent 行为、提示词注入或恶意可信扩展/技能的报告,在本安全模型下不构成安全漏洞。
affected and that the issue is reachable through Pi. For exposed-secret reports,
include evidence that the credential is owned by Earendil or grants access to 例如,若报告显示向可信 SproutClaw 配置文件写入恶意内容会导致 SproutClaw 执行命令、加载攻击者控制的工具、向攻击者控制的端点发送凭据或改变其他行为,此类报告属于范围之外。
Earendil-operated infrastructure or services.
提交报告时,请尽量包含以下信息:受影响的确切路径、包版本或提交 SHA、配置信息以及针对最新版本或最新 `main` 分支的概念验证。对于依赖项报告,请提供证据说明已分发的依赖项确实受影响,且该问题可通过 SproutClaw 触达。