|
| 1 | +# RFC 002: Pull Request Contribution Guidelines |
| 2 | + |
| 3 | +| Field | Value | |
| 4 | +|-------|-------| |
| 5 | +| **RFC** | 002 | |
| 6 | +| **Title** | Pull Request Contribution Guidelines | |
| 7 | +| **Author** | @chaodu-agent | |
| 8 | +| **Status** | Draft | |
| 9 | +| **Created** | 2026-04-13 | |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Summary |
| 14 | + |
| 15 | +Establish a standard PR template requiring contributors to research prior art (at minimum OpenClaw and Hermes Agent) before proposing solutions, and to document the problem, approach, tradeoffs, and alternatives in every PR description. |
| 16 | + |
| 17 | +## Motivation |
| 18 | + |
| 19 | +OpenAB is growing and accepting external contributions. Without a clear PR standard, we see PRs that: |
| 20 | + |
| 21 | +- Jump straight to implementation without explaining the problem |
| 22 | +- Don't research how existing projects solve the same problem |
| 23 | +- Don't justify why a particular approach was chosen over alternatives |
| 24 | +- Make review harder because reviewers must do the research themselves |
| 25 | + |
| 26 | +**Good example:** Issue #224 / PR #225 (voice message STT) included a thorough prior art investigation — comparing OpenClaw's `audio-transcription-runner.ts` preflight pipeline with Hermes Agent's `transcription_tools.py` local-first approach, producing a clear comparison table, and explaining why openab chose a simpler OpenAI-compatible endpoint design. This is the standard we want every PR to meet. |
| 27 | + |
| 28 | +**What we want to avoid:** PRs that jump straight to implementation without documenting how existing projects solve the same problem — forcing reviewers to do the research themselves during review. |
| 29 | + |
| 30 | +## Design |
| 31 | + |
| 32 | +### Required PR Sections |
| 33 | + |
| 34 | +Every PR must include these sections in its description: |
| 35 | + |
| 36 | +| # | Section | Purpose | |
| 37 | +|---|---------|---------| |
| 38 | +| 1 | **What problem does this solve?** | Pain point or requirement in plain language. Link the related issue. | |
| 39 | +| 2 | **At a Glance** | ASCII diagram showing the high-level flow, architecture, or where the change fits in the system. | |
| 40 | +| 3 | **Prior Art & Industry Research** | How OpenClaw and Hermes Agent handle the same problem. Links to code/docs. | |
| 41 | +| 4 | **Proposed Solution** | Technical approach, architecture decisions, key implementation details. | |
| 42 | +| 5 | **Why This Approach** | Why this over the alternatives from research. Tradeoffs and limitations. | |
| 43 | +| 6 | **Alternatives Considered** | Approaches evaluated but not chosen, and why. | |
| 44 | +| 7 | **Validation** | How do you prove it works? Unit tests, integration tests, manual testing steps, screenshots, logs. | |
| 45 | + |
| 46 | +### Mandatory Prior Art Research |
| 47 | + |
| 48 | +Contributors must research at minimum these two projects: |
| 49 | + |
| 50 | +| Project | Why it's mandatory | |
| 51 | +|---|---| |
| 52 | +| [OpenClaw](https://github.com/openclaw/openclaw) | Largest open-source AI agent gateway. Plugin architecture across 7+ messaging platforms. Mature patterns for media, security, session management. | |
| 53 | +| [Hermes Agent](https://github.com/NousResearch/hermes-agent) | Nous Research's self-hosted agent. Gateway architecture across 17+ platforms. Strong prior art on messaging, tool integration, and service management. | |
| 54 | + |
| 55 | +For each project, document: |
| 56 | +- How they solve the same problem (with links to source code or docs) |
| 57 | +- Key architectural decisions they made |
| 58 | +- What we can learn from their approach |
| 59 | + |
| 60 | +If neither project addresses the problem, state that explicitly with evidence. |
| 61 | + |
| 62 | +### Research Flow |
| 63 | + |
| 64 | +``` |
| 65 | +Contributor researches prior art |
| 66 | + │ |
| 67 | + ▼ |
| 68 | +┌───────────────────────┐ ┌──────────────────────────────────┐ |
| 69 | +│ Finds better pattern │────►│ Adopts it (we benefit) │ |
| 70 | +└───────────┬───────────┘ └──────────────────────────────────┘ |
| 71 | + │ |
| 72 | + ▼ |
| 73 | +┌───────────────────────────┐ ┌──────────────────────────────────┐ |
| 74 | +│ Finds different pattern │►│ Documents why we diverge │ |
| 75 | +└───────────┬───────────────┘ │ (reviewers understand tradeoff) │ |
| 76 | + │ └──────────────────────────────────┘ |
| 77 | + ▼ |
| 78 | +┌───────────────────────────┐ ┌──────────────────────────────────┐ |
| 79 | +│ Finds nothing relevant │►│ States so explicitly │ |
| 80 | +└───────────────────────────┘ │ (saves reviewers from searching) │ |
| 81 | + └──────────────────────────────────┘ |
| 82 | +``` |
| 83 | + |
| 84 | +## Implementation |
| 85 | + |
| 86 | +| Phase | Deliverable | Description | |
| 87 | +|-------|-------------|-------------| |
| 88 | +| **1** | `.github/pull_request_template.md` | Auto-populated PR form with all required sections | |
| 89 | +| **2** | `CONTRIBUTING.md` | Contributor guide explaining the guidelines and linking to this RFC | |
| 90 | +| **3** | Review process update | Reviewers check for prior art section completeness | |
| 91 | + |
| 92 | +### PR Template |
| 93 | + |
| 94 | +```markdown |
| 95 | +## What problem does this solve? |
| 96 | + |
| 97 | +<!-- Describe the pain point in plain language. Link the related issue. --> |
| 98 | + |
| 99 | +Closes # |
| 100 | + |
| 101 | +## At a Glance |
| 102 | + |
| 103 | +<!-- ASCII diagram showing the high-level flow or where this change fits in the system. Example: |
| 104 | +
|
| 105 | +┌──────────────┐ ┌───────┐ ┌───────────┐ |
| 106 | +│ Discord User │────►│ openab│────►│ ACP Agent │ |
| 107 | +└──────────────┘ └───┬───┘ └───────────┘ |
| 108 | + │ |
| 109 | + ▼ |
| 110 | + ┌──────────────┐ |
| 111 | + │ your change │ |
| 112 | + └──────────────┘ |
| 113 | +--> |
| 114 | + |
| 115 | +``` |
| 116 | +(your diagram here) |
| 117 | +``` |
| 118 | +
|
| 119 | +## Prior Art & Industry Research |
| 120 | +
|
| 121 | +<!-- Research how at least OpenClaw and Hermes Agent handle this problem. --> |
| 122 | +
|
| 123 | +**OpenClaw:** |
| 124 | +<!-- How does OpenClaw solve this? Link to relevant code/docs. --> |
| 125 | +
|
| 126 | +**Hermes Agent:** |
| 127 | +<!-- How does Hermes Agent solve this? Link to relevant code/docs. --> |
| 128 | +
|
| 129 | +**Other references (optional):** |
| 130 | +
|
| 131 | +## Proposed Solution |
| 132 | +
|
| 133 | +<!-- Technical approach, architecture decisions, key implementation details. --> |
| 134 | +
|
| 135 | +## Why This Approach |
| 136 | +
|
| 137 | +<!-- Why this over the alternatives from your research? Tradeoffs? Limitations? --> |
| 138 | +
|
| 139 | +## Alternatives Considered |
| 140 | +
|
| 141 | +<!-- Approaches evaluated but not chosen, and why. --> |
| 142 | +
|
| 143 | +## Validation |
| 144 | +
|
| 145 | +<!-- How do you prove this works? Show, don't just tell. --> |
| 146 | +
|
| 147 | +- [ ] `cargo check` passes |
| 148 | +- [ ] `cargo test` passes (including new tests) |
| 149 | +- [ ] Manual testing — describe the steps you took and what you observed |
| 150 | +- [ ] Screenshots, logs, or terminal output demonstrating the feature working end-to-end |
| 151 | +``` |
| 152 | + |
| 153 | +## Open Questions |
| 154 | + |
| 155 | +1. Should we enforce the prior art section via CI (e.g., a bot that checks for the section headers)? |
| 156 | +2. Should we maintain a living doc of "how OpenClaw/Hermes do X" to reduce per-PR research burden? |
| 157 | +3. Are there other mandatory reference projects beyond OpenClaw and Hermes? |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +## References |
| 162 | + |
| 163 | +- Issue #224 / PR #225 — exemplary prior art research (STT: OpenClaw vs Hermes Agent comparison) |
| 164 | +- PR #300 — example of a PR that would benefit from this guideline |
| 165 | +- [OpenClaw Channel & Messaging Deep Dive](https://avasdream.com/blog/openclaw-channels-messaging-deep-dive) |
| 166 | +- [Hermes Agent Messaging Gateway](https://hermes-agent.nousresearch.com/docs/user-guide/messaging/) |
| 167 | +- RFC 001 — [Session Management](./001-session-management.md) |
0 commit comments