Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

docs(policy): limit outside pull requests to fix and perf

vastsa7a3a6bfa0c21
diff --git a/AGENTS.md b/AGENTS.md
index 8901560b8..b06c4e48f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,6 +1,6 @@
# AGENTS.md
-Policy-Sync: 2026-09-21.2
+Policy-Sync: 2026-09-26.1
Mandatory rules for AI coding agents working in PI-Desktop.
@@ -745,6 +745,17 @@ and leave it open. Do not implement first and investigate later.
## 15. GitHub Pull Request Intake
+**Temporary PR type scope (effective 2026-09-26).** Outside contributions
+are limited to `perf` and `fix` pull requests. A pull request from a
+contributor without write access whose change type is `feat`, `refactor`,
+`docs`, `test`, `chore`, `build`, or `ci` is not a landing candidate:
+comment the policy in the pull request's language, then close it without
+merging, and do not reimplement it as a replacement while the restriction
+is in force. Maintainers — accounts with write access, plus the branches
+and automated agent work they direct — keep every change type. The
+restriction is lifted by removing this paragraph and R6.1 in
+`docs/spec/06-delivery/03-ai-development-workflow.md`.
+
For a linked pull request, fetch it first. Do not replace the
contributor's work until the review below is complete.
diff --git a/CLAUDE.md b/CLAUDE.md
index 78ac22147..f4d13738e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,6 +1,6 @@
# CLAUDE.md
-Policy-Sync: 2026-09-21.2
+Policy-Sync: 2026-09-26.1
Instructions for Claude Code CLI and Claude Cowork on PI-Desktop.
@@ -319,6 +319,7 @@ Do not push, open a PR, or merge unless the user explicitly asks.
**Issue:** fetch, read body/comments/labels, verify against code. Bugs: reproduce or give concrete evidence; classify as confirmed regression / existing defect / already fixed / expected behavior / environment-specific / insufficient evidence. Do not implement first and investigate later.
**PR:** fetch first. Do not land on direction alone — the change must fix the reported root cause with the smallest coherent change (not a leftover workaround, docs-only restatement, or extra files instead of a fix). Preserve authorship when that bar is met; do not force-push or rewrite for nits. Request changes and do not merge when the root cause remains. Landing blockers include build/typecheck/test/E2E failure, merge conflict, data corruption risk, security violation, secret leakage, sandbox bypass, incompatible protocol change, an incomplete fix, and an oversized diff without a stated reason.
+**Temporary PR type scope:** outside contributions are limited to `perf` and `fix` pull requests. A `feat`, `refactor`, `docs`, `test`, `chore`, `build`, or `ci` PR from a contributor without write access is closed without merging and is not reimplemented as a replacement. Maintainers — accounts with write access, plus the branches and automated agent work they direct — keep every change type. Recorded as R6.1 in `docs/spec/06-delivery/03-ai-development-workflow.md`; lifted by removing both.
Security reports are private via `SECURITY.md` — never open a public issue for vulnerabilities or credential exposure.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 48a366eb9..76185f475 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -131,6 +131,44 @@ request is opened. A run on a stale request branch is useful for debugging but
does not replace that gate. Record any unavailable required suite as `NOT RUN`
with its reason, alternative validation, and remaining risk.
+## Pull Request Acceptance Scope (temporary)
+
+Effective 2026-09-26, until this section is removed, outside contributions are
+limited to pull requests whose change type is `perf` or `fix`:
+
+```text
+fix(host-core): preserve session ownership during restart
+perf(composer): stop re-rendering the transcript on every keystroke
+```
+
+An outside pull request of any other type is not accepted for now. A `feat`,
+`refactor`, `docs`, `test`, `chore`, `build`, or `ci` pull request is closed
+without review and without merge, and is not reimplemented as a replacement
+while this window is in force.
+Relabelling other work as `fix` or `perf` does not qualify it.
+
+The restriction governs outside contributions only. Maintainers — accounts with
+write access to this repository, plus the branches and automated agent work they
+direct — keep every change type. A `feat`, `refactor`, `docs`, `test`, `chore`,
+`build`, or `ci` pull request for planned maintainer work remains a valid
+delivery path under `AGENTS.md` R1–R7.
+
+- Feature ideas: open an issue with the feature request form instead of a pull
+ request. Features are planned and delivered by the maintainers here; an
+ unsolicited `feat` pull request is not a delivery path during this window.
+- Bug fixes and performance regressions: `fix` and `perf` pull requests stay
+ welcome and are reviewed under the root-cause and minimality bar of R6 in
+ [`docs/spec/06-delivery/03-ai-development-workflow.md`](docs/spec/06-delivery/03-ai-development-workflow.md).
+- Mixed changes: land the `fix` part first and describe the rest in an issue.
+ Do not hide other work inside a `fix` or `perf` pull request.
+- Documentation, tests, refactors, dependency updates, and tooling are handled
+ by the maintainers while this window is in force.
+
+The restriction is temporary and recorded as R6.1 in
+[`docs/spec/06-delivery/03-ai-development-workflow.md`](docs/spec/06-delivery/03-ai-development-workflow.md).
+It is lifted by removing this section and that subsection, not by arguing scope
+inside a pull request.
+
## Commit and Pull Request
Use one logical commit where practical and follow Conventional Commits:
@@ -147,13 +185,18 @@ Before committing, review the complete diff. Never commit:
- Local databases, logs, configuration, or machine-specific paths.
- `node_modules/`, build artifacts, release packages, or unrelated changes.
+Outside contributions are limited to `fix` and `perf` pull requests while the
+temporary Pull Request Acceptance Scope above is in force; maintainer-planned
+work keeps every change type.
+
Refresh against latest `origin/main` (`pnpm check:pr-base`) and run the
required E2E suite from the request worktree first; then open a pull request
against `main` with:
- a concise summary and rationale;
- affected specs, ADRs, and E2E scenarios;
-- validation commands and actual results;
+- An outside pull request of any other change type — `feat`, `refactor`,
+ `docs`, `test`,
- compatibility, migration, security, and remaining-risk notes when relevant.
Do not force-push contributor branches, bypass required checks, or merge a
diff --git a/docs/spec/06-delivery/03-ai-development-workflow.md b/docs/spec/06-delivery/03-ai-development-workflow.md
index 10d0b7a9a..60067c71a 100644
--- a/docs/spec/06-delivery/03-ai-development-workflow.md
+++ b/docs/spec/06-delivery/03-ai-development-workflow.md
@@ -185,6 +185,30 @@ an unambiguous pull request number for this repository.
- When both an issue and a pull request are linked, R6 applies to the pull
request and R5 still applies to the issue after the merged outcome.
+#### R6.1 — Temporary pull-request type restriction
+
+> **While this subsection is in force, outside contributions are limited to
+> `perf` and `fix` pull requests; maintainer-planned work keeps every type.**
+
+- Effective 2026-09-26 until a maintainer removes this subsection.
+- The restriction governs outside contributions. Maintainers — accounts with
+ write access to this repository, plus the branches and automated agent work
+ they direct — keep every change type, including `feat`.
+- An outside pull request of any other change type — `feat`, `refactor`,
+ `docs`, `test`, `chore`, `build`, or `ci` — is not a landing candidate.
+ Comment with this policy in the pull request's language, then close it
+ without merging, and do not reimplement it as a replacement while the
+ restriction is in force. The type is read from the pull request's title and
+ commits; relabelling other work as `fix` or `perf` does not qualify it.
+- Feature intent goes to a feature request issue, not to a pull request.
+- `fix` and `perf` pull requests still carry the full R6 bar: the real root
+ cause, the smallest coherent change, and no harm blockers.
+- Closing a pull request whose type is out of scope does not violate R6's "do
+ not discard contributor work" clause; that clause protects an in-scope
+ root-cause fix.
+- Removing this subsection lifts the restriction. It is not a permanent
+ narrowing of the contribution scope.
+
### R7 — Code-bearing changes require relevant E2E after main integration
> **Every code-bearing change must pass relevant E2E on a candidate that
@@ -633,4 +657,7 @@ This workflow spec itself is accepted when:
on in the issue language and closed when conclusive.
- [ ] Linked GitHub pull requests land only when they fix the reported root
cause with a minimal diff; contributor work is not discarded for nits.
+- [ ] Outside contributions are limited to `perf` and `fix` pull requests while
+ the temporary type restriction in R6.1 is in force.
+
- [ ] All indexes updated (NAV, delivery README, spec README, docs README, BOARD).
diff --git a/docs/zh-CN/spec/06-delivery/03-ai-development-workflow.md b/docs/zh-CN/spec/06-delivery/03-ai-development-workflow.md
index a58da7840..2c564a977 100644
--- a/docs/zh-CN/spec/06-delivery/03-ai-development-workflow.md
+++ b/docs/zh-CN/spec/06-delivery/03-ai-development-workflow.md
@@ -94,6 +94,18 @@
- 不得评论或合入无关 pull request。已合入的 pull request 不再重新打开;剩余缺口转为普通后续工作。
- 当同时链接了 issue 和 pull request 时,R6 适用于该 pull request;R5 在合入结果之后仍适用于该 issue。
+#### R6.1 — 临时 pull request 类型限制
+
+> **本节生效期间,外部贡献只接受 `perf` 与 `fix` 类型的 pull request;维护者按计划推进的工作不受限制。**
+
+- 自 2026-09-26 起生效,直到维护者删除本节为止。
+- 本限制只针对外部贡献。维护者——拥有本仓库写权限的账号,以及其指挥的分支与自动化 agent 工作——不受限制;计划内工作的 `feat`、`refactor`、`docs`、`test`、`chore`、`build`、`ci` 仍是合法交付路径。
+- 外部 pull request 的其他变更类型——`feat`、`refactor`、`docs`、`test`、`chore`、`build`、`ci`——不是合入候选。用该 pull request 的原文语言说明此政策后关闭,不合入;本限制生效期间也不得把它重写为替代实现。类型以标题与提交为准;把其他工作改标为 `fix` 或 `perf` 不算符合要求。
+- 功能需求请提交 feature request issue,不要用 pull request 承载。
+- `fix` 与 `perf` 类型的 pull request 仍须满足完整的 R6 门槛:真正的根因、最小一致改动、无危害阻塞。
+- 因类型不在范围内而关闭 pull request,不违反 R6「不得丢弃贡献者的工作」条款;该条款保护的是范围内且根治问题的修复。
+- 删除本节即解除限制。这不是对贡献范围的永久收窄。
+
### R7 — 原则成立的代码 pull request 必须通过相关 E2E
> **代码 pull request 未成功通过相关 E2E 验证时不得合入。**
@@ -442,4 +454,6 @@ D164 与 D260。 GitHub 发行说明并不能替代。
- [ ] `AGENTS.md` 指向此文档、`04-e2e-test-plan.md` 和 `05-change-checklist.md`。
- [ ] 链接的 GitHub issue 必须在实现前核实,然后以其原文语言评论,并在结论明确时关闭。
- [ ] 链接的 GitHub pull request 只有根治问题且改动最小才可合入;不得因细枝末节丢掉贡献者的工作。
+- [ ] 在 R6.1 的临时类型限制生效期间,外部贡献只接受 `perf` 与 `fix` 类型的 pull request。
+
- [ ] 更新所有索引(NAV、交付自述文件、规格自述文件、文档自述文件、董事会)。