Skip to content

chore(governance): define contribution areas + auto-merge for prose#487

Open
plind-junior wants to merge 2 commits into
testfrom
chore/contributor-governance
Open

chore(governance): define contribution areas + auto-merge for prose#487
plind-junior wants to merge 2 commits into
testfrom
chore/contributor-governance

Conversation

@plind-junior

@plind-junior plind-junior commented Jul 15, 2026

Copy link
Copy Markdown
Member

onboarding open-source contributors safely means drawing a line between the parts they can move fast on and the core they must not touch unreviewed.

  • .github/CODEOWNERS: the hard backstop. the load-bearing paths (review gate, receipts, audit log, storage, schema, kb.* surface, packaging, ci) require a code-owner review; nothing else does. no default owner, so contributor- friendly areas stay fast.
  • .github/workflows/auto-merge.yml: prose-only prs (docs, top-level markdown, issue templates) get github auto-merge enabled and merge themselves on green ci. it only reads the changed-file list — never checks out or runs pr code — so pull_request_target's token is never exposed to untrusted input. examples/, tests/, adapters/, and all code fall through to human review.
  • GOVERNANCE.md: the human-readable area map (core / contributor-friendly / auto-merge-safe) tied to the existing decision bars, plus the one-time owner setup (branch protection + allow-auto-merge).
  • CONTRIBUTING.md: replace "there is no auto-merge" with the three lanes.

classifier verified against 18 representative paths; workflow yaml validated. the owner still must enable branch protection + allow-auto-merge in repo settings for either mechanism to bite.

What changed

Why

What might break

VEP

Tests

  • make check passes locally (lint + mypy + pytest)
  • New / changed behaviour has a test
  • CHANGELOG.md updated under ## [Unreleased]

Summary by CodeRabbit

  • New Features

    • Added automated handling for eligible prose-only pull requests, including automatic squash merging when checks pass.
    • Added ownership rules for reviews of core code, protocol, packaging, governance, and release-related areas.
  • Documentation

    • Updated contribution guidance with PR review, testing, merge, and ownership expectations.
    • Documented contribution areas and the process for determining when changes require human review.

onboarding open-source contributors safely means drawing a line between the
parts they can move fast on and the core they must not touch unreviewed.

- .github/CODEOWNERS: the hard backstop. the load-bearing paths (review gate,
  receipts, audit log, storage, schema, kb.* surface, packaging, ci) require a
  code-owner review; nothing else does. no default owner, so contributor-
  friendly areas stay fast.
- .github/workflows/auto-merge.yml: prose-only prs (docs, top-level markdown,
  issue templates) get github auto-merge enabled and merge themselves on green
  ci. it only reads the changed-file list — never checks out or runs pr code —
  so pull_request_target's token is never exposed to untrusted input. examples/,
  tests/, adapters/, and all code fall through to human review.
- GOVERNANCE.md: the human-readable area map (core / contributor-friendly /
  auto-merge-safe) tied to the existing decision bars, plus the one-time owner
  setup (branch protection + allow-auto-merge).
- CONTRIBUTING.md: replace "there is no auto-merge" with the three lanes.

classifier verified against 18 representative paths; workflow yaml validated.
the owner still must enable branch protection + allow-auto-merge in repo
settings for either mechanism to bite.
@plind-junior plind-junior changed the base branch from main to test July 15, 2026 10:57
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds core-path ownership rules, a prose-only auto-merge workflow, and documentation describing automated checks, contribution areas, review requirements, and merge routing.

Changes

Contribution routing

Layer / File(s) Summary
Ownership and merge policy
.github/CODEOWNERS, GOVERNANCE.md
Defines required review ownership for core paths and documents contributor-friendly, core, and prose-only contribution areas plus merge mechanisms.
Prose-only auto-merge
.github/workflows/auto-merge.yml
Classifies pull request files without executing PR code and enables squash auto-merge for safe, non-draft prose-only changes.
Contributor PR guidance
CONTRIBUTING.md
Documents automated review and CI gates, PR routing categories, and local validation expectations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant PullRequest
  participant GitHubActions
  participant BranchProtection
  Contributor->>PullRequest: Open or update pull request
  PullRequest->>GitHubActions: Trigger workflow
  GitHubActions->>GitHubActions: Classify changed files and check draft status
  GitHubActions->>BranchProtection: Request squash auto-merge for safe prose-only changes
  BranchProtection-->>PullRequest: Apply required checks and review rules
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: governance boundaries plus prose-only auto-merge.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/contributor-governance

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.

@github-actions github-actions Bot added docs documentation, specs, examples, and repo guidance ci github actions and automation size: S 50-199 changed non-doc lines labels Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/auto-merge.yml (1)

43-54: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix the CODEOWNERS path in the case statement.

The CODEOWNERS file is located at .github/CODEOWNERS. The current CODEOWNERS pattern only matches a top-level file. Although changes to .github/CODEOWNERS still correctly fail the check by falling through to the *) return 1 ;; catch-all, updating this to match the actual file path clarifies the explicit intent.

💡 Proposed refactor
           is_safe() {
             case "$1" in
               # governance / security / contract docs are owner-reviewed
-              SECURITY.md|GOVERNANCE.md|CONTRIBUTING.md|CODEOWNERS) return 1 ;;
+              SECURITY.md|GOVERNANCE.md|CONTRIBUTING.md|.github/CODEOWNERS) return 1 ;;
               spec/*) return 1 ;;            # the protocol contract, not prose
               docs/*) return 0 ;;            # curated prose docs
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/auto-merge.yml around lines 43 - 54, Update the is_safe
case pattern to explicitly match .github/CODEOWNERS instead of the top-level
CODEOWNERS name, preserving its return 1 behavior and leaving all other path
rules unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 17-18: Update the prose-only auto-merge path description in
CONTRIBUTING.md to remove examples/**, leaving docs/**, top-level markdown, and
issue templates listed as eligible paths. Keep the wording consistent with the
exclusions defined in GOVERNANCE.md and auto-merge.yml.

---

Nitpick comments:
In @.github/workflows/auto-merge.yml:
- Around line 43-54: Update the is_safe case pattern to explicitly match
.github/CODEOWNERS instead of the top-level CODEOWNERS name, preserving its
return 1 behavior and leaving all other path rules unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2477e285-c5e8-4ca7-9938-6f8db6c36b21

📥 Commits

Reviewing files that changed from the base of the PR and between c455ab7 and f6882b1.

📒 Files selected for processing (4)
  • .github/CODEOWNERS
  • .github/workflows/auto-merge.yml
  • CONTRIBUTING.md
  • GOVERNANCE.md

Comment thread CONTRIBUTING.md
Comment on lines +17 to +18
- **prose-only** (`docs/**`, `examples/**`, top-level markdown, issue
templates) merges itself once CI is green — no maintainer needed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove examples/** from the auto-merge list.

GOVERNANCE.md and the auto-merge.yml workflow explicitly exclude examples/** from auto-merge because examples can carry runnable code. Listing it here as a prose-only auto-merge path creates a contradiction that might confuse contributors when their PRs do not merge automatically.

🐛 Proposed fix
- - **prose-only** (`docs/**`, `examples/**`, top-level markdown, issue
+ - **prose-only** (`docs/**`, top-level markdown, issue
    templates) merges itself once CI is green — no maintainer needed.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **prose-only** (`docs/**`, `examples/**`, top-level markdown, issue
templates) merges itself once CI is green — no maintainer needed.
- **prose-only** (`docs/**`, top-level markdown, issue
templates) merges itself once CI is green — no maintainer needed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 17 - 18, Update the prose-only auto-merge path
description in CONTRIBUTING.md to remove examples/**, leaving docs/**, top-level
markdown, and issue templates listed as eligible paths. Keep the wording
consistent with the exclusions defined in GOVERNANCE.md and auto-merge.yml.

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

Labels

ci github actions and automation docs documentation, specs, examples, and repo guidance size: S 50-199 changed non-doc lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant