From 929ed5f8d1e0b546615478511aa7a30dd07fbadd Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 20 Nov 2026 20:45:25 +0000 Subject: [PATCH 1/2] chore: prohibit agents from merging external contributions Agents may review, comment and approve fork CI runs when asked, then report; a maintainer merges external PRs by hand. --- .agents/skills/ship/SKILL.md | 3 ++ AGENTS.md | 5 ++ knowledge/log.md | 4 ++ .../operations/external-contributions.md | 48 +++++++++++++++++++ knowledge/operations/index.md | 1 + knowledge/operations/maintenance.md | 1 + 6 files changed, 62 insertions(+) create mode 100644 knowledge/operations/external-contributions.md diff --git a/.agents/skills/ship/SKILL.md b/.agents/skills/ship/SKILL.md index e910d55b8..7d95007d4 100644 --- a/.agents/skills/ship/SKILL.md +++ b/.agents/skills/ship/SKILL.md @@ -72,3 +72,6 @@ for targeted runs. Preserve the existing tests, audit policy, and hooks. 3. Wait in bounded intervals for CI, diagnose failures, and resolve review findings. Squash-merge after all required checks pass and CI is green. 4. Verify the PR actually merged and report its URL. +5. Never merge an external contribution (a PR from a non-maintainer or a fork): + report it ready and stop. See + [external contributions](../../../knowledge/operations/external-contributions.md). diff --git a/AGENTS.md b/AGENTS.md index b8086e513..04e653353 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,6 +63,11 @@ Use [Conventional Commits](https://www.conventionalcommits.org), with [PR template](.github/pull_request_template.md) and squash-merge. Honor requests for separate PRs. Keep session links out of commits and PR descriptions. +**Never merge external contributions.** Pull requests from non-maintainers or +forks are merged by a maintainer by hand, even with green CI and when asked to +review, watch, or ship them. Review, comment, and report instead. See +[external contributions](knowledge/operations/external-contributions.md). + ### Commit Attribution Attribute every commit, including the squash commit, to the real human diff --git a/knowledge/log.md b/knowledge/log.md index 0efc70117..f438eb73e 100644 --- a/knowledge/log.md +++ b/knowledge/log.md @@ -1,5 +1,9 @@ # Bashkit Knowledge Update Log +## 2026-11-20 + +* **Agents never merge external contributions**: after an agent squash-merged external PR #2959 on green CI, the maintainer prohibited automatic merging of pull requests from non-maintainers and forks. Agents may review, comment and approve fork CI runs when asked, then report; a maintainer merges by hand. See [External Contributions](operations/external-contributions.md). + ## 2026-11-19 * **`realpath` resolves symlinks**: `realpath` only cleaned `.`/`..` lexically, so with `/l -> /a/b`, `realpath /l/c` printed `/l/c` where bash prints `/a/b/c`; it also could not see a symlink in `--relative-to`. It now shares `readlink -f`'s bounded symlink walk (40-hop cap, path limits), on operands and the relative base; `--relative-to` now prints `..`-style paths and `--relative-base` gates it, as GNU does (both were a bare prefix strip). `-s` keeps the old lexical behavior, a loop reports `Too many levels of symbolic links`, and `-e` failures continue to the next operand with the operand as given, like GNU. Spec case `realpath_follows_intermediate_symlink` matches real bash. Found while writing the #2933 separator tests. See [Virtual Filesystem](foundations/vfs.md). diff --git a/knowledge/operations/external-contributions.md b/knowledge/operations/external-contributions.md new file mode 100644 index 000000000..90df5dbe9 --- /dev/null +++ b/knowledge/operations/external-contributions.md @@ -0,0 +1,48 @@ +--- +type: Playbook +title: External Contributions +description: Agents never merge pull requests from external contributors; a maintainer merges them by hand. +tags: + - bashkit + - operations + - review + - process +--- + +# External Contributions + +## Rule + +Coding agents must not merge an external contribution. An external +contribution is a pull request whose author is not a maintainer of +`everruns/bashkit`, including any pull request opened from a fork. Bot pull +requests (Dependabot, the drift workflows) are not external contributions. + +This holds even when CI is green, reviews are positive, and the agent was asked +to review, watch, or "ship" the pull request. A maintainer merges it by hand. + +## What agents may do + +- Review the pull request and report findings to the maintainer. +- Post review comments when the maintainer asks. +- Approve fork workflow runs when the maintainer asks, so CI runs. +- Report when CI is green and the pull request is ready, then stop. + +## What agents must not do + +- Merge, enable auto-merge, or add the pull request to a merge queue. +- Promise a merge on the maintainer's behalf in a comment. +- Push commits to the contributor's branch, unless the maintainer asks for a + specific change. + +## Why + +On 2026-11-20 an agent squash-merged external pull request #2959 after CI went +green, without the maintainer's explicit go-ahead to merge. Merging outside +code is a trust decision about the contributor and the change, not a CI +outcome, so it stays with a person. + +## See also + +- [Maintenance](maintenance.md), which runs merges of the agent's own pull requests +- [Threat Model](../security/threat-model.md) diff --git a/knowledge/operations/index.md b/knowledge/operations/index.md index 6eb7cc04c..1c1a40bcf 100644 --- a/knowledge/operations/index.md +++ b/knowledge/operations/index.md @@ -4,6 +4,7 @@ * [Known Limitations](limitations.md) - Intentional gaps, partial features, and Bash and POSIX compatibility stance. * [Documentation Architecture](documentation.md) - User documentation and Rustdoc guide organization, embedding, and maintenance. * [Maintenance](maintenance.md) - Pre-release dependency, security, compatibility, and artifact maintenance requirements. +* [External Contributions](external-contributions.md) - Agents never merge pull requests from external contributors; a maintainer merges them by hand. * [Release Process](release-process.md) - Versioning, validation, tagging, and publication to crates.io, PyPI, and npm. * [Performance Results](performance-results.md) - Benchmark harnesses, result locations, naming, and publication contract. * [Dependency Policy](dependencies.md) - Which third-party crates Bashkit keeps, which it trims, and which are deliberately not reimplemented in-house. diff --git a/knowledge/operations/maintenance.md b/knowledge/operations/maintenance.md index 0853f0a22..d6099888f 100644 --- a/knowledge/operations/maintenance.md +++ b/knowledge/operations/maintenance.md @@ -351,6 +351,7 @@ block the gate. Review CI on `main` (audit, test, lint) separately. ## References +- [External Contributions](external-contributions.md), agents never merge external pull requests - [Release Process](release-process.md), release workflow - [Known Limitations](limitations.md), negative spec (intentional gaps, partial features) - [Threat Model](../security/threat-model.md), threat model From f81a5d8120a0cc1e07ff75eb86116cc846a36857 Mon Sep 17 00:00:00 2001 From: Mykhailo Chalyi Date: Fri, 20 Nov 2026 20:46:36 +0000 Subject: [PATCH 2/2] chore: add agent rules for unaddressed comments and human comments Agents must not merge while any review comment is unaddressed and must not reply on their own to human-written comments. --- .agents/skills/ship/SKILL.md | 7 +- AGENTS.md | 13 +++- knowledge/log.md | 2 +- knowledge/operations/agent-pr-rules.md | 73 +++++++++++++++++++ .../operations/external-contributions.md | 48 ------------ knowledge/operations/index.md | 2 +- knowledge/operations/maintenance.md | 2 +- 7 files changed, 89 insertions(+), 58 deletions(-) create mode 100644 knowledge/operations/agent-pr-rules.md delete mode 100644 knowledge/operations/external-contributions.md diff --git a/.agents/skills/ship/SKILL.md b/.agents/skills/ship/SKILL.md index 7d95007d4..316943de8 100644 --- a/.agents/skills/ship/SKILL.md +++ b/.agents/skills/ship/SKILL.md @@ -72,6 +72,7 @@ for targeted runs. Preserve the existing tests, audit policy, and hooks. 3. Wait in bounded intervals for CI, diagnose failures, and resolve review findings. Squash-merge after all required checks pass and CI is green. 4. Verify the PR actually merged and report its URL. -5. Never merge an external contribution (a PR from a non-maintainer or a fork): - report it ready and stop. See - [external contributions](../../../knowledge/operations/external-contributions.md). +5. Follow the [agent PR rules](../../../knowledge/operations/agent-pr-rules.md): + never merge an external contribution (report it ready and stop), never + merge while any review comment is unaddressed, and never reply on your own + to a human-written comment. diff --git a/AGENTS.md b/AGENTS.md index 04e653353..e940d6bb5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,10 +63,15 @@ Use [Conventional Commits](https://www.conventionalcommits.org), with [PR template](.github/pull_request_template.md) and squash-merge. Honor requests for separate PRs. Keep session links out of commits and PR descriptions. -**Never merge external contributions.** Pull requests from non-maintainers or -forks are merged by a maintainer by hand, even with green CI and when asked to -review, watch, or ship them. Review, comment, and report instead. See -[external contributions](knowledge/operations/external-contributions.md). +[Agent PR rules](knowledge/operations/agent-pr-rules.md), binding even with +green CI and when asked to review, watch, or ship: + +- **Never merge external contributions.** A maintainer merges PRs from + non-maintainers or forks by hand. Review, comment when asked, and report. +- **Never merge with unaddressed review comments.** Every comment, from people + or bots, is fixed, answered on its thread, or deferred by a maintainer. +- **Never auto-reply to human-written comments.** Reply on your own only to + bots; bring a person's comment to the maintainer with a suggested answer. ### Commit Attribution diff --git a/knowledge/log.md b/knowledge/log.md index f438eb73e..3eaec06e5 100644 --- a/knowledge/log.md +++ b/knowledge/log.md @@ -2,7 +2,7 @@ ## 2026-11-20 -* **Agents never merge external contributions**: after an agent squash-merged external PR #2959 on green CI, the maintainer prohibited automatic merging of pull requests from non-maintainers and forks. Agents may review, comment and approve fork CI runs when asked, then report; a maintainer merges by hand. See [External Contributions](operations/external-contributions.md). +* **Agent pull request rules**: after an agent squash-merged external PR #2959 on green CI with a review-bot finding still open, the maintainer set three rules for agents: never merge external contributions (non-maintainers or forks; a maintainer merges by hand), never merge while any review comment is unaddressed, and never reply on their own to human-written comments (bring them to the maintainer instead). See [Agent Pull Request Rules](operations/agent-pr-rules.md). ## 2026-11-19 diff --git a/knowledge/operations/agent-pr-rules.md b/knowledge/operations/agent-pr-rules.md new file mode 100644 index 000000000..5d4ed9f2e --- /dev/null +++ b/knowledge/operations/agent-pr-rules.md @@ -0,0 +1,73 @@ +--- +type: Playbook +title: Agent Pull Request Rules +description: When coding agents may merge pull requests and reply to review comments. +tags: + - bashkit + - operations + - review + - process +--- + +# Agent Pull Request Rules + +These rules bind coding agents working on `everruns/bashkit`. They apply even +when CI is green, reviews are positive, and the agent was asked to review, +watch, or "ship" the pull request. Only an explicit instruction from a +maintainer for that specific pull request lifts them. + +## Never merge external contributions + +An external contribution is a pull request whose author is not a maintainer of +`everruns/bashkit`, including any pull request opened from a fork. Bot pull +requests (Dependabot, the drift workflows) are not external contributions. + +Agents may: + +- Review the pull request and report findings to the maintainer. +- Post review comments when the maintainer asks. +- Approve fork workflow runs when the maintainer asks, so CI runs. +- Report when CI is green and the pull request is ready, then stop. + +Agents must not: + +- Merge, enable auto-merge, or add the pull request to a merge queue. +- Promise a merge on the maintainer's behalf in a comment. +- Push commits to the contributor's branch, unless the maintainer asks for a + specific change. + +## Never merge with unaddressed review comments + +Before merging any pull request, every review comment, from people and bots, +must be addressed: + +- fixed in the pull request, or +- answered on its thread with why no change is needed, or +- explicitly deferred by a maintainer to a named follow-up. + +An unresolved thread counts as unaddressed until one of those is true. An +outdated thread counts as addressed only if the code it points at was removed +or changed in a way that settles it; check, do not assume. Nits and optional +findings count too: fix them or answer them. + +## Never auto-reply to human-written comments + +Agents reply on their own only to comments written by bots (review bots, +Copilot, CI bots). A comment written by a person, whether a maintainer, a +contributor, or anyone else, is brought to the maintainer with a suggested +answer. The agent posts a reply only when the maintainer asks, and in the words +the maintainer approves. + +## Why + +On 2026-11-20 an agent squash-merged external pull request #2959 after CI went +green, without an explicit go-ahead to merge, and with an open review-bot +finding (stale `wasm32-unknown-unknown` docs in `time_compat`) still +unaddressed. Merging outside code is a trust decision about the contributor +and the change, not a CI outcome, and replies to people speak for the +maintainer, so both stay with a person. + +## See also + +- [Maintenance](maintenance.md), which runs merges of the agent's own pull requests +- [Threat Model](../security/threat-model.md) diff --git a/knowledge/operations/external-contributions.md b/knowledge/operations/external-contributions.md deleted file mode 100644 index 90df5dbe9..000000000 --- a/knowledge/operations/external-contributions.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -type: Playbook -title: External Contributions -description: Agents never merge pull requests from external contributors; a maintainer merges them by hand. -tags: - - bashkit - - operations - - review - - process ---- - -# External Contributions - -## Rule - -Coding agents must not merge an external contribution. An external -contribution is a pull request whose author is not a maintainer of -`everruns/bashkit`, including any pull request opened from a fork. Bot pull -requests (Dependabot, the drift workflows) are not external contributions. - -This holds even when CI is green, reviews are positive, and the agent was asked -to review, watch, or "ship" the pull request. A maintainer merges it by hand. - -## What agents may do - -- Review the pull request and report findings to the maintainer. -- Post review comments when the maintainer asks. -- Approve fork workflow runs when the maintainer asks, so CI runs. -- Report when CI is green and the pull request is ready, then stop. - -## What agents must not do - -- Merge, enable auto-merge, or add the pull request to a merge queue. -- Promise a merge on the maintainer's behalf in a comment. -- Push commits to the contributor's branch, unless the maintainer asks for a - specific change. - -## Why - -On 2026-11-20 an agent squash-merged external pull request #2959 after CI went -green, without the maintainer's explicit go-ahead to merge. Merging outside -code is a trust decision about the contributor and the change, not a CI -outcome, so it stays with a person. - -## See also - -- [Maintenance](maintenance.md), which runs merges of the agent's own pull requests -- [Threat Model](../security/threat-model.md) diff --git a/knowledge/operations/index.md b/knowledge/operations/index.md index 1c1a40bcf..bed076b65 100644 --- a/knowledge/operations/index.md +++ b/knowledge/operations/index.md @@ -4,7 +4,7 @@ * [Known Limitations](limitations.md) - Intentional gaps, partial features, and Bash and POSIX compatibility stance. * [Documentation Architecture](documentation.md) - User documentation and Rustdoc guide organization, embedding, and maintenance. * [Maintenance](maintenance.md) - Pre-release dependency, security, compatibility, and artifact maintenance requirements. -* [External Contributions](external-contributions.md) - Agents never merge pull requests from external contributors; a maintainer merges them by hand. +* [Agent Pull Request Rules](agent-pr-rules.md) - When coding agents may merge pull requests and reply to review comments. * [Release Process](release-process.md) - Versioning, validation, tagging, and publication to crates.io, PyPI, and npm. * [Performance Results](performance-results.md) - Benchmark harnesses, result locations, naming, and publication contract. * [Dependency Policy](dependencies.md) - Which third-party crates Bashkit keeps, which it trims, and which are deliberately not reimplemented in-house. diff --git a/knowledge/operations/maintenance.md b/knowledge/operations/maintenance.md index d6099888f..17fbd8fc6 100644 --- a/knowledge/operations/maintenance.md +++ b/knowledge/operations/maintenance.md @@ -351,7 +351,7 @@ block the gate. Review CI on `main` (audit, test, lint) separately. ## References -- [External Contributions](external-contributions.md), agents never merge external pull requests +- [Agent Pull Request Rules](agent-pr-rules.md), when agents may merge and reply to comments - [Release Process](release-process.md), release workflow - [Known Limitations](limitations.md), negative spec (intentional gaps, partial features) - [Threat Model](../security/threat-model.md), threat model