|
| 1 | +# RFC 002: Pull Request Contribution Guidelines |
| 2 | + |
| 3 | +| Field | Value | |
| 4 | +|-------|-------| |
| 5 | +| **RFC** | 002 | |
| 6 | +| **Title** | Pull Request Contribution Guidelines | |
| 7 | +| **Author** | @pahud | |
| 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 | +Example: PR #300 (outbound attachments) proposed a regex-from-response approach without documenting how OpenClaw uses tool-based `sendAttachment` actions or how Hermes Agent handles media at the gateway adapter layer. Reviewers had to do this research during review. |
| 27 | + |
| 28 | +## Design |
| 29 | + |
| 30 | +### Required PR Sections |
| 31 | + |
| 32 | +Every PR must include these sections in its description: |
| 33 | + |
| 34 | +| # | Section | Purpose | |
| 35 | +|---|---------|---------| |
| 36 | +| 1 | **What problem does this solve?** | Pain point or requirement in plain language. Link the related issue. | |
| 37 | +| 2 | **Prior Art & Industry Research** | How OpenClaw and Hermes Agent handle the same problem. Links to code/docs. | |
| 38 | +| 3 | **Proposed Solution** | Technical approach, architecture decisions, key implementation details. | |
| 39 | +| 4 | **Why This Approach** | Why this over the alternatives from research. Tradeoffs and limitations. | |
| 40 | +| 5 | **Alternatives Considered** | Approaches evaluated but not chosen, and why. | |
| 41 | +| 6 | **Test Plan** | `cargo check`, `cargo test`, manual testing, new tests added. | |
| 42 | + |
| 43 | +### Mandatory Prior Art Research |
| 44 | + |
| 45 | +Contributors must research at minimum these two projects: |
| 46 | + |
| 47 | +| Project | Why it's mandatory | |
| 48 | +|---|---| |
| 49 | +| [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. | |
| 50 | +| [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. | |
| 51 | + |
| 52 | +For each project, document: |
| 53 | +- How they solve the same problem (with links to source code or docs) |
| 54 | +- Key architectural decisions they made |
| 55 | +- What we can learn from their approach |
| 56 | + |
| 57 | +If neither project addresses the problem, state that explicitly with evidence. |
| 58 | + |
| 59 | +### Research Flow |
| 60 | + |
| 61 | +``` |
| 62 | +Contributor researches prior art |
| 63 | + │ |
| 64 | + ▼ |
| 65 | +Finds better pattern ──► Adopts it (we benefit) |
| 66 | + │ |
| 67 | + ▼ |
| 68 | +Finds different pattern ──► Documents why we diverge |
| 69 | + │ (reviewers understand the tradeoff) |
| 70 | + ▼ |
| 71 | +Finds nothing relevant ──► States so explicitly |
| 72 | + (saves reviewers from searching) |
| 73 | +``` |
| 74 | + |
| 75 | +## Implementation |
| 76 | + |
| 77 | +| Phase | Deliverable | Description | |
| 78 | +|-------|-------------|-------------| |
| 79 | +| **1** | `.github/pull_request_template.md` | Auto-populated PR form with all required sections | |
| 80 | +| **2** | `CONTRIBUTING.md` | Contributor guide explaining the guidelines and linking to this RFC | |
| 81 | +| **3** | Review process update | Reviewers check for prior art section completeness | |
| 82 | + |
| 83 | +### PR Template |
| 84 | + |
| 85 | +```markdown |
| 86 | +## What problem does this solve? |
| 87 | + |
| 88 | +<!-- Describe the pain point in plain language. Link the related issue. --> |
| 89 | + |
| 90 | +Closes # |
| 91 | + |
| 92 | +## Prior Art & Industry Research |
| 93 | + |
| 94 | +<!-- Research how at least OpenClaw and Hermes Agent handle this problem. --> |
| 95 | + |
| 96 | +**OpenClaw:** |
| 97 | +<!-- How does OpenClaw solve this? Link to relevant code/docs. --> |
| 98 | + |
| 99 | +**Hermes Agent:** |
| 100 | +<!-- How does Hermes Agent solve this? Link to relevant code/docs. --> |
| 101 | + |
| 102 | +**Other references (optional):** |
| 103 | + |
| 104 | +## Proposed Solution |
| 105 | + |
| 106 | +<!-- Technical approach, architecture decisions, key implementation details. --> |
| 107 | + |
| 108 | +## Why This Approach |
| 109 | + |
| 110 | +<!-- Why this over the alternatives from your research? Tradeoffs? Limitations? --> |
| 111 | + |
| 112 | +## Alternatives Considered |
| 113 | + |
| 114 | +<!-- Approaches evaluated but not chosen, and why. --> |
| 115 | + |
| 116 | +## Test Plan |
| 117 | + |
| 118 | +- [ ] `cargo check` passes |
| 119 | +- [ ] `cargo test` passes |
| 120 | +- [ ] Manual testing (describe below) |
| 121 | +``` |
| 122 | + |
| 123 | +## Open Questions |
| 124 | + |
| 125 | +1. Should we enforce the prior art section via CI (e.g., a bot that checks for the section headers)? |
| 126 | +2. Should we maintain a living doc of "how OpenClaw/Hermes do X" to reduce per-PR research burden? |
| 127 | +3. Are there other mandatory reference projects beyond OpenClaw and Hermes? |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## References |
| 132 | + |
| 133 | +- [OpenClaw Channel & Messaging Deep Dive](https://avasdream.com/blog/openclaw-channels-messaging-deep-dive) |
| 134 | +- [Hermes Agent Messaging Gateway](https://hermes-agent.nousresearch.com/docs/user-guide/messaging/) |
| 135 | +- PR #300 — example of a PR that would benefit from this guideline |
| 136 | +- RFC 001 — [Session Management](./001-session-management.md) |
0 commit comments