-
Notifications
You must be signed in to change notification settings - Fork 59
chore(governance): define contribution areas + auto-merge for prose #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
plind-junior
wants to merge
2
commits into
test
Choose a base branch
from
chore/contributor-governance
base: test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+214
−4
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Code owners for vouch — the human-readable map is GOVERNANCE.md. | ||
| # | ||
| # Only the load-bearing "core" paths are listed here. A PR that changes any of | ||
| # them requires review from a code owner before it can merge, once the branch | ||
| # protection rule "Require review from Code Owners" is enabled (see GOVERNANCE.md | ||
| # → "Turning this on"). Everything NOT listed is contributor-friendly: any | ||
| # maintainer can approve it, and the prose-only paths that | ||
| # .github/workflows/auto-merge.yml recognises merge automatically on green CI. | ||
| # | ||
| # There is deliberately NO default (`*`) owner: a catch-all would force owner | ||
| # review on every PR and defeat the point. Replace @plind-junior below with your | ||
| # maintainer team (e.g. @vouchdev/core) if you prefer team-based ownership. | ||
|
|
||
| # --- the review gate + claim lifecycle — writes must stay gated --- | ||
| /src/vouch/proposals.py @plind-junior | ||
| /src/vouch/lifecycle.py @plind-junior | ||
|
|
||
| # --- verification: the byte-offset receipt (the differentiator) --- | ||
| /src/vouch/receipts.py @plind-junior | ||
|
|
||
| # --- the append-only, authoritative history --- | ||
| /src/vouch/audit.py @plind-junior | ||
|
|
||
| # --- durable storage + the derived index --- | ||
| /src/vouch/storage.py @plind-junior | ||
| /src/vouch/index_db.py @plind-junior | ||
|
|
||
| # --- the object model / on-disk schema contract --- | ||
| /src/vouch/models.py @plind-junior | ||
| /src/vouch/migrations/ @plind-junior | ||
|
|
||
| # --- the kb.* method surface + transports — parity is load-bearing --- | ||
| /src/vouch/capabilities.py @plind-junior | ||
| /src/vouch/server.py @plind-junior | ||
| /src/vouch/jsonl_server.py @plind-junior | ||
|
|
||
| # --- the protocol contract --- | ||
| /SPEC.md @plind-junior | ||
| /spec/ @plind-junior | ||
|
|
||
| # --- packaging + the four-site version invariant --- | ||
| /pyproject.toml @plind-junior | ||
| /openclaw.plugin.json @plind-junior | ||
| /package.json @plind-junior | ||
| /src/vouch/__init__.py @plind-junior | ||
|
|
||
| # --- build / release / supply-chain — a workflow edit can exfiltrate secrets --- | ||
| /.github/workflows/ @plind-junior | ||
| /.github/dependabot.yml @plind-junior | ||
| /Dockerfile @plind-junior | ||
| /install.sh @plind-junior | ||
|
|
||
| # --- governance itself --- | ||
| /.github/CODEOWNERS @plind-junior | ||
| /GOVERNANCE.md @plind-junior | ||
| /CONTRIBUTING.md @plind-junior |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: auto-merge | ||
|
|
||
| # Auto-merge the safe, prose-only contributions (docs, examples, issue | ||
| # templates) once CI is green — no maintainer needed. Anything that touches | ||
| # code, tests, adapters, config, or the core paths in CODEOWNERS is left for a | ||
| # human. This is the repo mirror of vouch's own gate: a change that carries no | ||
| # risk is auto-approved; a change to the gate needs a person. | ||
| # | ||
| # SECURITY: pull_request_target runs with the base repo's token so it can enable | ||
| # auto-merge on pull requests from forks. This job only READS the changed-file | ||
| # list through the API — it never checks out or runs the PR's code — so | ||
| # untrusted code never touches the privileged token. Do not add a checkout of | ||
| # the PR head here. | ||
| # | ||
| # Enabling auto-merge does not bypass anything: GitHub still waits for the | ||
| # required status checks and any required reviews configured in branch | ||
| # protection before it actually merges. See GOVERNANCE.md → "Turning this on". | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| auto-merge: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.pull_request.draft == false | ||
| steps: | ||
| - name: classify changed files and enable auto-merge if prose-only | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PR: ${{ github.event.pull_request.number }} | ||
| REPO: ${{ github.repository }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # A path is auto-merge-safe only if it cannot change code execution, | ||
| # the gate, the schema, or the protocol. Keep in sync with | ||
| # GOVERNANCE.md → "Tier 2 — auto-merge safe". | ||
| is_safe() { | ||
| case "$1" in | ||
| # governance / security / contract docs are owner-reviewed | ||
| SECURITY.md|GOVERNANCE.md|CONTRIBUTING.md|CODEOWNERS) return 1 ;; | ||
| spec/*) return 1 ;; # the protocol contract, not prose | ||
| docs/*) return 0 ;; # curated prose docs | ||
| .github/ISSUE_TEMPLATE/*) return 0 ;; | ||
| */*.md) return 1 ;; # nested .md (examples/, adapters/, …) — review it | ||
| *.md) return 0 ;; # top-level prose (README, CHANGELOG, …) | ||
| *) return 1 ;; # everything else — code, examples, tests, config | ||
| esac | ||
| } | ||
|
|
||
| files=$(gh pr view "$PR" --repo "$REPO" --json files --jq '.files[].path') | ||
| if [ -z "$files" ]; then | ||
| echo "no changed files reported; nothing to do"; exit 0 | ||
| fi | ||
|
|
||
| all_safe=true | ||
| while IFS= read -r f; do | ||
| [ -z "$f" ] && continue | ||
| if is_safe "$f"; then | ||
| echo "safe : $f" | ||
| else | ||
| echo "review : $f" | ||
| all_safe=false | ||
| fi | ||
| done <<< "$files" | ||
|
|
||
| if [ "$all_safe" = true ]; then | ||
| echo "::notice::prose-only PR — enabling auto-merge (still waits for required CI)." | ||
| gh pr merge "$PR" --repo "$REPO" --auto --squash \ | ||
| || echo "::warning::could not enable auto-merge — enable 'Allow auto-merge' in repo Settings › General and add a required status check in branch protection." | ||
| else | ||
| echo "::notice::PR touches code/tests/adapters/core — leaving it for human review." | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.mdand theauto-merge.ymlworkflow explicitly excludeexamples/**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
📝 Committable suggestion
🤖 Prompt for AI Agents