chore: add community governance infrastructure

- CODEOWNERS: define code ownership for core paths (@cft0808)
- CODE_OF_CONDUCT.md: Contributor Covenant v2.1 (Chinese)
- SECURITY.md: vulnerability reporting policy
- CONTRIBUTING.md: add contributor ladder (Contributor→Triage→Committer→Maintainer)
- dependabot.yml: auto dependency updates (pip/npm/actions weekly)
- auto-label.yml + labeler.yml: PR auto-labeling by file path
- stale.yml: auto-close stale Issues (60d) and PRs (30d)
- Issue templates: add question.md, config.yml, needs-triage label
- Branch protection: require PR reviews, CI checks, code owner approval
This commit is contained in:
cft0808
2026-03-28 20:55:54 +08:00
parent e63f7a17f9
commit dc66e0666d
12 changed files with 398 additions and 4 deletions

38
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,38 @@
# 三省六部 · Edict — 代码所有权定义
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
#
# 当 PR 涉及以下路径时GitHub 会自动请求对应 owner 做 review。
# 配合分支保护规则中的 "Require review from Code Owners"
# 确保核心代码的变更必须经过维护者审批。
# ── 全局默认 ──────────────────────────────────────────
# 未匹配其他规则的文件,默认由维护者 review
* @cft0808
# ── 核心后端 ──────────────────────────────────────────
/dashboard/server.py @cft0808
/dashboard/court_discuss.py @cft0808
/agents/ @cft0808
/edict/backend/ @cft0808
# ── 数据与配置 ────────────────────────────────────────
/data/ @cft0808
requirements.txt @cft0808
# ── 脚本与自动化 ──────────────────────────────────────
/scripts/ @cft0808
install.sh @cft0808
start.sh @cft0808
# ── 部署基础设施 ──────────────────────────────────────
Dockerfile @cft0808
docker-compose.yml @cft0808
/docker/ @cft0808
# ── CI/CD 与仓库配置 ─────────────────────────────────
/.github/ @cft0808
# ── 以下路径欢迎社区贡献者自主 review ────────────────
# /docs/ 可由任何 Committer review
# /examples/ 可由任何 Committer review
# README*.md 可由任何 Committer review

View File

@@ -1,7 +1,7 @@
---
name: Bug Report
about: 报告一个 Bug
labels: bug
labels: bug, needs-triage
---
## 环境

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 💬 社区讨论
url: https://github.com/cft0808/edict/discussions
about: 功能讨论、使用心得和一般性问题请移步 Discussions
- name: 📖 文档
url: https://github.com/cft0808/edict/blob/main/docs/getting-started.md
about: 快速上手指南和常见问题

View File

@@ -1,7 +1,7 @@
---
name: Feature Request
about: 提交功能建议
labels: enhancement
labels: enhancement, needs-triage
---
## 功能描述

19
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@@ -0,0 +1,19 @@
---
name: Question
about: 提问 / 使用咨询
labels: question, needs-triage
---
## 问题描述
<!-- 尽量清楚地描述你的问题 -->
## 已尝试的方案
<!-- 你已经尝试过哪些方法? -->
## 相关环境
- OpenClaw 版本:
- 操作系统:
- Python 版本:

43
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
# Dependabot 自动依赖更新配置
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
version: 2
updates:
# Python (pip) 依赖
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "dependencies"
- "P2-nice-to-have"
commit-message:
prefix: "chore(deps):"
open-pull-requests-limit: 5
# npm 依赖
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "dependencies"
- "P2-nice-to-have"
commit-message:
prefix: "chore(deps):"
open-pull-requests-limit: 3
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "dependencies"
- "ci"
commit-message:
prefix: "ci(deps):"
open-pull-requests-limit: 5

44
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
# PR 路径 → 自动标签映射
# 配合 .github/workflows/auto-label.yml 使用
dashboard:
- changed-files:
- any-glob-to-any-file: 'dashboard/**'
agents:
- changed-files:
- any-glob-to-any-file: 'agents/**'
edict-backend:
- changed-files:
- any-glob-to-any-file: 'edict/backend/**'
edict-frontend:
- changed-files:
- any-glob-to-any-file: 'edict/frontend/**'
scripts:
- changed-files:
- any-glob-to-any-file: 'scripts/**'
docker:
- changed-files:
- any-glob-to-any-file:
- 'Dockerfile'
- 'docker-compose.yml'
- 'docker/**'
ci:
- changed-files:
- any-glob-to-any-file: '.github/**'
documentation:
- changed-files:
- any-glob-to-any-file:
- 'docs/**'
- '*.md'
- '!CHANGELOG.md'
tests:
- changed-files:
- any-glob-to-any-file: 'tests/**'

37
.github/workflows/auto-label.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: Auto Label PRs
on:
pull_request:
types: [opened, synchronize]
permissions:
pull-requests: write
contents: read
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: false
size-label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Label PR size
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: "size/XS"
xs_max_size: 10
s_label: "size/S"
s_max_size: 50
m_label: "size/M"
m_max_size: 200
l_label: "size/L"
l_max_size: 500
xl_label: "size/XL"
fail_if_xl: false

48
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Stale Issues & PRs
on:
schedule:
- cron: '0 2 * * 1' # 每周一 UTC 02:00
workflow_dispatch:
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Issue 配置
days-before-stale: 60
days-before-close: 30
stale-issue-label: "stale"
stale-issue-message: >
📜 此 Issue 已超过 60 天没有活动。
如果问题仍然存在,请回复更新状态;否则此 Issue 将在 30 天后自动关闭。
感谢你的贡献!
close-issue-message: >
🏛️ 此 Issue 因长期无活动已自动关闭。
如需重新讨论,欢迎随时重新打开或创建新 Issue。
exempt-issue-labels: "P0-critical,P1-important,good first issue,help wanted,pinned"
# PR 配置
days-before-pr-stale: 30
days-before-pr-close: 14
stale-pr-label: "stale"
stale-pr-message: >
📜 此 PR 已超过 30 天没有活动。
如果仍计划继续,请更新代码或回复说明进度;否则将在 14 天后自动关闭。
close-pr-message: >
🏛️ 此 PR 因长期无活动已自动关闭。
如果你想继续这项工作,欢迎重新打开。
exempt-pr-labels: "P0-critical,P1-important,work-in-progress"
# 通用配置
operations-per-run: 30
ascending: true
remove-stale-when-updated: true

68
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,68 @@
# 贡献者行为准则 · Contributor Covenant
## 我们的承诺
作为社区的成员、贡献者和维护者,我们承诺让每一个参与者都能获得无骚扰的体验,无论其年龄、体型、残障状况、种族特征、性别认同与表达、经验水平、教育程度、社会经济地位、国籍、外貌、种族、宗教信仰或性取向如何。
我们承诺以有助于营造开放、友善、多元、包容、健康社区的方式行事和互动。
## 我们的标准
### ✅ 有助于营造正向环境的行为
- 对他人表示同理心和善意
- 尊重不同的观点、立场和经验
- 提出并优雅地接受建设性反馈
- 为自己的错误承担责任,向受影响者道歉,并从中学习
- 关注对整个社区最有益的事情,而非仅关注个人利益
### ❌ 不可接受的行为
- 使用性暗示的语言或图像,以及任何形式的性关注或挑逗
- 挑衅、侮辱性或贬低性的评论,以及人身或政治攻击
- 公开或私下的骚扰
- 未经明确许可发布他人的私人信息(如地址或电子邮箱)
- 其他在专业环境中被合理认为不当的行为
## 执行责任
社区维护者有责任澄清和执行行为标准,并对任何他们认为不当、具有威胁性、冒犯性或有害的行为采取适当且公平的纠正措施。
社区维护者有权删除、编辑或拒绝与本行为准则不一致的评论、代码提交、Issue、PR 及其他贡献,并在适当时说明审核原因。
## 适用范围
本行为准则适用于所有社区空间,也适用于个人在公共场合代表社区时的行为。代表社区的行为包括使用官方的电子邮箱地址、通过官方社交媒体账号发帖,或在线上或线下活动中担任指定代表。
## 执行方式
### 1⃣ 纠正
**社区影响**:使用不恰当的语言或其他被认为不专业或不受欢迎的行为。
**处理方式**:维护者私下书面警告,说明违规行为的性质以及为何该行为是不当的。可能会要求公开道歉。
### 2⃣ 警告
**社区影响**:单次事件或一系列行为的违规。
**处理方式**:附带后果的警告。在一定时期内不得与相关人员互动,包括避免在社区空间和外部渠道(如社交媒体)中进行非请求互动。违反这些条款可能导致临时或永久封禁。
### 3⃣ 临时封禁
**社区影响**:严重违反社区标准,包括持续的不当行为。
**处理方式**:在一定时期内临时禁止与社区进行任何形式的互动或公开交流。在此期间,不得与相关人员进行任何公开或私下互动。违反这些条款可能导致永久封禁。
### 4⃣ 永久封禁
**社区影响**:展示出违反社区标准的模式,包括持续的不当行为、对个人的骚扰或对某类人群的攻击或贬低。
**处理方式**:永久禁止在社区内进行任何形式的公开互动。
## 归属
本行为准则改编自 [Contributor Covenant][homepage] 2.1 版,
可在 https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 获取。
[homepage]: https://www.contributor-covenant.org

View File

@@ -89,6 +89,29 @@ open http://127.0.0.1:7891
---
## 🏛️ 贡献者阶梯
我们采用渐进式权限模型,让社区成员能够逐步承担更多责任:
| 角色 | 条件 | 权限 |
|------|------|------|
| **🌱 Contributor** | 任何人 | Fork → PR → 等待 review |
| **🏷️ Triage** | 3+ merged PRs | 管理 Issue 标签、分配、关闭重复 Issue |
| **⚔️ Committer** | 5+ merged PRs + 活跃参与 review | Write 权限,可 merge 非核心路径的 PR |
| **👑 Maintainer** | 长期信任 + 架构理解 | 可 merge 核心路径,参与架构决策 |
### 晋升流程
1. 维护者会主动邀请活跃贡献者晋升
2. 也可以在 Issue 中自荐,说明你的贡献记录
3. 所有晋升决定公开透明
> **核心路径**(需 Maintainer review`dashboard/server.py`、`agents/`、`edict/backend/`、`scripts/`、`data/`
>
> **开放路径**Committer 可自主 merge`docs/`、`examples/`、`README*.md`、UI 样式调整
---
## 📝 Commit 规范
我们使用 [Conventional Commits](https://www.conventionalcommits.org/)
@@ -181,17 +204,26 @@ curl -s http://localhost:7891/api/live-status | python3 -m json.tool | head -20
## 🙏 行为准则
本项目采用 [Contributor Covenant](CODE_OF_CONDUCT.md) 行为准则。参与本项目即表示你同意遵守其条款。
简要原则:
- 保持友善和建设性
- 尊重不同的观点和经验
- 接受建设性的批评
- 专注于对社区最有利的事情
- 对其他社区成员表示同理心
**我们对骚扰行为零容忍。**
**我们对骚扰行为零容忍。** 详见 [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)。
---
## 📬 联系方式
## <EFBFBD> 安全漏洞
发现安全问题?请**不要**通过公开 Issue 报告。详见 [SECURITY.md](SECURITY.md)。
---
## <20>📬 联系方式
- GitHub Issues: [提交问题](https://github.com/cft0808/edict/issues)
- GitHub Discussions: [社区讨论](https://github.com/cft0808/edict/discussions)

57
SECURITY.md Normal file
View File

@@ -0,0 +1,57 @@
# 🔒 安全政策
## 支持的版本
| 版本 | 支持状态 |
|------|---------|
| main (latest) | ✅ 积极维护 |
| Docker `latest` | ✅ 积极维护 |
| 旧版本 | ❌ 不再维护 |
## 报告安全漏洞
**请勿通过公开的 GitHub Issue 报告安全漏洞。**
如果你发现了安全问题,请通过以下方式私密报告:
1. **首选方式**:使用 [GitHub Security Advisories](https://github.com/cft0808/edict/security/advisories/new) 创建私密安全报告
2. **备选方式**:发送邮件至维护者(请在 GitHub Profile 中获取联系方式)
### 报告应包含
- 漏洞类型XSS、注入、权限绕过等
- 受影响的文件路径和代码行
- 复现步骤
- 潜在影响评估
- 修复建议(如果有的话)
### 响应时间
| 阶段 | 时间 |
|------|------|
| 确认收到 | 48 小时内 |
| 初步评估 | 7 天内 |
| 修复发布 | 视严重程度,通常 30 天内 |
## 负责任披露
我们遵循负责任披露原则:
- 收到报告后会尽快确认并评估
- 修复完成前不会公开漏洞详情
- 修复发布后会在 Release Notes 中致谢报告者(除非报告者要求匿名)
- 我们不会对善意的安全研究者采取法律行动
## 安全最佳实践
如果你部署了三省六部系统,建议:
- 定期更新到最新版本
- 不要将 `data/` 目录暴露到公网
- 配置防火墙限制看板端口(默认 7891的访问
- 使用反向代理(如 Nginx时启用 HTTPS
- 为 LLM API Key 设置最小必要权限
## 致谢
我们感谢所有帮助提升三省六部系统安全性的安全研究者。