Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Required code-owner review — enforced by branch protection
# ("Require review from Code Owners"), not by this file alone.
#
# Scopes mirror the `tiers.manual` paths in .github/MAINTAINERS.yml: those
# are the Tier-B paths tools/merge_gate.py refuses to auto-merge; everything
# else is Tier A and may be merged by the gate once its quorum is met.
#
# Bootstrap note: mcpplibs org teams do not exist yet, so every scope points
# at the current repository owner. As committers join (roles in
# MAINTAINERS.yml), replace these user references with teams
# (@mcppplibs/index-owners, per-module teams) — four lines, no logic change.

# Tier B — official infrastructure: manual merge only
/.github/workflows/ @Sunrisepeak
/.github/CODEOWNERS @Sunrisepeak
/.github/MAINTAINERS.yml @Sunrisepeak
/index.toml @Sunrisepeak
/mcpp.toml @Sunrisepeak
/docs/repository-and-schema.md @Sunrisepeak
/docs/governance.md @Sunrisepeak

# Tier A — third-party packages and tests: auto-merge eligible after review
/pkgs/ @Sunrisepeak
/tests/ @Sunrisepeak
77 changes: 77 additions & 0 deletions .github/MAINTAINERS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Maintainers and repository roles — the single source of truth.
#
# The README "Maintenance & Contribution" table is rendered from `roles`
# by tools/render_maintainers.py; the maintainers workflow fails PRs whose
# committed render is stale and opens a bot PR from main.
#
# `roles` maps our governance identities onto GitHub repository roles —
# the `github` field is what GitHub itself enforces (settings > collabs):
#
# 仓库负责人 admin full access; Tier B merged by hand
# 核心维护者 maintain repo management without sensitive actions
# 维护者 (Committer) write push, approve, /merge — the Tier A gate
# 活跃贡献者 triage, moderate issues/PRs without code access
#
# `tiers` is what tools/merge_gate.py reads: a PR touching any `manual` path
# is refused for automated merge — official infrastructure is merged by a
# human, in the GitHub UI, on purpose.
#
# Claim a seat: open a PR that adds your login under the role's
# `maintainers:` (with a one-line intro); promotion needs an approval from an
# existing member of that role or the repository owner. Role appointments and
# `tiers` changes are decided by the repository owner.

roles:
- id: owner
identity:
en: Repository owner
zh: 仓库负责人
github: admin
intro:
en: "Holds the contract — spec, CI and version-floor decisions; merges official paths by hand"
zh: 契约持有者:规范、CI 与版本下限的最终决策;官方路径人工合并
maintainers:
- login: Sunrisepeak
intro:
en: "Initiator of the mcpp / d2learn ecosystem"
zh: "mcpp / d2learn 生态发起人"

- id: core
identity:
en: Core maintainer
zh: 核心维护者
github: maintain
intro:
en: "Day-to-day repo management and CI/release coordination — no sensitive or destructive actions"
zh: 仓库日常管理与 CI/发版协调,无敏感与破坏性操作
maintainers: []

- id: committer
identity:
en: Committer
zh: 维护者(Committer)
github: write
intro:
en: "Module owners — package review, approvals and /merge (Tier A)"
zh: 模块负责人:包准入 review、approve 与 `/merge`(Tier A)
maintainers: []

- id: active
identity:
en: Active contributor
zh: 活跃贡献者
github: [triage, moderate]
intro:
en: "Issue/PR triage and moderation — no code access"
zh: issue/PR 分流与议题规范化,无代码权限
maintainers: []

tiers:
manual:
- ".github/workflows/**"
- ".github/CODEOWNERS"
- ".github/MAINTAINERS.yml"
- "index.toml"
- "mcpp.toml"
- "docs/repository-and-schema.md"
- "docs/governance.md"
71 changes: 71 additions & 0 deletions .github/workflows/maintainers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: maintainers

# Renders the "Maintenance & Contribution" maintainer tables in both READMEs
# from .github/MAINTAINERS.yml.
#
# - pull_request: fail the PR if the committed render is stale.
# - push to main / manual: render and open a bot PR with the refreshed
# tables. Like every bot artifact, that PR never merges itself — it is a
# Tier B path (see MAINTAINERS.yml) and lands via human merge only.

on:
pull_request:
paths:
- ".github/MAINTAINERS.yml"
- "README.md"
- "README.zh-CN.md"
- "tools/render_maintainers.py"
push:
branches: [main]
paths:
- ".github/MAINTAINERS.yml"
workflow_dispatch:

permissions:
contents: write # bot PR branch
pull-requests: write # create the PR

jobs:
check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install pyyaml
- run: python tools/render_maintainers.py --check

render:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install pyyaml
- run: python tools/render_maintainers.py

- name: Open update PR if the render changed
env:
GH_TOKEN: ${{ github.token }}
run: |
if git diff --quiet; then
echo "render already up to date"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
BR=maintainers/update
git checkout -B "$BR"
git add README.md README.zh-CN.md
git commit -m "docs: render maintainer tables from MAINTAINERS.yml"
git push -f origin "$BR"
OPEN=$(gh pr list --head "$BR" --state open --json number --jq 'length')
if [ "$OPEN" = "0" ]; then
gh pr create --head "$BR" \
--title "docs: render maintainer tables from MAINTAINERS.yml" \
--body $'Auto-generated from .github/MAINTAINERS.yml by the maintainers workflow.\n\n<!-- auto-generated -->\n\n**Tier B(merge: manual):bot 不会合入,请人工 review 后在 GitHub 上主动合并。**'
fi
46 changes: 46 additions & 0 deletions .github/workflows/merge-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: merge-gate

# The `/merge` PR comment command: tiered, bot-assisted merging.
#
# Tier A (packages + tests): once one maintainer approval plus green CI are
# in, `/merge` has the gate squash-merge the PR. Tier B (workflows,
# index.toml, mcpp.toml, schema/governance docs — the `tiers.manual` paths in
# MAINTAINERS.yml): the gate refuses; official infrastructure is always
# merged by a human. The tier table lives in .github/MAINTAINERS.yml, the
# logic in tools/merge_gate.py.

on:
issue_comment:
types: [created]

permissions:
contents: write # merge via the API
issues: write # reply on the PR
pull-requests: write # read reviews, merge

concurrency:
group: merge-gate-${{ github.event.issue.number }}
cancel-in-progress: false

jobs:
gate:
if: >-
github.event.issue.pull_request != null &&
github.event.comment.user.type != 'Bot' &&
contains(github.event.comment.body, '/merge')
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
MERGE_PR_NUMBER: ${{ github.event.issue.number }}
MERGE_COMMENT_LOGIN: ${{ github.event.comment.user.login }}
MERGE_COMMENT_ID: ${{ github.event.comment.id }}
# Approvals from users with write access, excluding the PR author.
MIN_APPROVALS: '1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install pyyaml
- name: Evaluate /merge
run: python tools/merge_gate.py
58 changes: 58 additions & 0 deletions .github/workflows/thanks-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: thanks-contributors

# Weekly contributors wall for both READMEs.
#
# Sunrisepeak/thanks-contributors is pinned to the reviewed commit and runs in
# PR mode (auto_commit: false): it collects the wall, injects it into
# README.md between the thanks-contributors-flag markers, commits everything
# to the thanks-contributors/update branch and opens/updates its PR. Nothing
# ever lands on main directly. tools/render_contributors.py then mirrors the
# same table into README.zh-CN.md as one more commit on the same branch.

on:
schedule:
- cron: "0 3 * * 1" # Mondays 03:00 UTC (upstream updater runs 02:17, validate Sundays 06:00)
workflow_dispatch:

permissions:
contents: write # bot PR branch
pull-requests: write # create/update the PR

jobs:
wall:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Collect contributors and update README.md
uses: Sunrisepeak/thanks-contributors@1a1fa1ffaeb42a670a13469754687d424a4382b3
env:
GH_TOKEN: ${{ github.token }}
with:
targets: 'mcpplibs/mcpp-index'
auto_commit: 'false' # PR mode — never pushes main
pr_branch_name: 'thanks-contributors/update'
pr_title: 'chore: update contributors wall'
readme_path: 'README.md'
sort_pinned: 'Sunrisepeak'
exclude_logins: 'github-actions[bot]'

- name: Mirror wall into README.zh-CN.md
run: python tools/render_contributors.py

- name: Push the zh render to the same PR
env:
GH_TOKEN: ${{ github.token }}
run: |
if git diff --quiet -- README.zh-CN.md; then
echo "zh wall unchanged"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.zh-CN.md
git commit -m "docs: render zh contributors wall"
git push origin thanks-contributors/update
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Added

- **「维护与贡献」章节与分级合入门禁(AI 时代开源自治的探索)。** 维护者表按身份与 GitHub 权限模型组织——仓库负责人 `admin` / 核心维护者 `maintain` / 维护者 Committer `write` / 活跃贡献者 `triage, moderate`——一格内多名维护者、`·` 分隔、可点击,由 `.github/MAINTAINERS.yml` 单一来源渲染(`tools/render_maintainers.py`,PR CI 用 `--check` 校验新鲜度,main 上由 `maintainers.yml` 开 bot PR 回填);贡献者头像墙由 [thanks-contributors](https://github.com/Sunrisepeak/thanks-contributors)(固定到 reviewed commit `1a1fa1f`)每周以 PR 模式注入双 README(`thanks-contributors.yml` + `tools/render_contributors.py`)。合入分级:三方包与测试(`pkgs/**`、`tests/**`)1 个 approve + CI 全绿即可 auto-merge 或评论 `/merge` 由 `merge-gate.yml`/`tools/merge_gate.py` 合入;官方路径(workflows、`index.toml`、`mcpp.toml`、schema 与治理文档,即 `MAINTAINERS.yml` 的 `tiers.manual`)门禁拒绝任何 bot 合入,必须人工在 GitHub 上主动合并。`.github/CODEOWNERS` 把同样的路径映射到 GitHub code-owner review。角色、quorum、stall 升级与 branch protection 检查单见 [docs/governance.md](docs/governance.md)([中文](docs/zh/governance.md))。
- **compat.harfbuzz 14.3.0 的两个开关:`no-unused-api` 与 `no-aat-vertical`(修订 3)。** 与 `no-freetype` 同一种写法:mcpp 给本包的单元定义 `MCPP_FEATURE_NO_UNUSED_API`、`MCPP_FEATURE_NO_AAT_VERTICAL`,生成的 `config.h` 据此定义 HarfBuzz 自己的 `HB_NO_*`。`no-unused-api` 去掉只画字的程序不会调用的 API(缓冲区的序列化、校验与消息,MATH 与 meta 表,整形器不用的布局 API,字形名,样式查询),整形与绘制不变;`no-aat-vertical` 再去掉 Apple 的 AAT 整形(morx、kerx、trak)与竖排,给字体带 OpenType 布局、只横排的程序。默认都关,构建与以前相同。实测(emsdk 6.0.9,`-Oz`,只链接一个整形器调用的 57 个 `hb_*` 函数的程序):wasm 556,891 → 531,727 B(gzip 218,946 → 208,442),两个都开 461,992 B(gzip 187,747)。
- **mcpplibs.cmdline 0.0.6.** 命令补全内建:`app.completion()` 一次调用开启,程序以自己的命令树回答(`__complete`),bash、zsh、
fish、PowerShell 的适配脚本只向程序询问;选项与参数可陈述可选值、文件或目录提示与候选回调,命令可隐藏。测试成员移到 0.0.6,
Expand Down Expand Up @@ -200,6 +201,7 @@

### Changed

- **README 的 `Contributing` 章节改为 `Maintenance & Contribution`(中文「维护与贡献」)**,拆出维护者表(MAINTAINERS.yml 渲染)、贡献者头像墙与分级合入策略三块;原贡献指南内容与链接不变,移入 `Contribute`/`贡献` 小节。
- **工作区不再陈述索引,每个成员陈述自己测试所经的索引。** 根 `mcpp.toml` 的 `[indices] compat = { path = "." }` 由位置读取
(2026.10.10.1 弃用,2027.1 移除);149 个成员改为各自写 `compat = { path = "<到检出的相对路径>" }`,与已以其他名字指向检出的
79 个成员同形;57 个 mwrap 成员与 5 个 mtest 示例为避开根的重定向而写的空 `[indices]` 删去。改用 `[workspace.indices]` 不可行:
Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,37 @@ mcpp build
Use `mcpp self config --mirror CN` to select the CN mirror.
The minimum supported mcpp version is recorded in [index.toml](index.toml).

## Contributing
## Maintenance & Contribution

### Maintainers

<!-- maintainers-flag-start -->
| Role | Permissions | About | Maintainers |
|---|---|---|---|
| Repository owner | `admin` | Holds the contract — spec, CI and version-floor decisions; merges official paths by hand | [Sunrisepeak](https://github.com/Sunrisepeak "Initiator of the mcpp / d2learn ecosystem") |
| Core maintainer | `maintain` | Day-to-day repo management and CI/release coordination — no sensitive or destructive actions | *(open for adoption)* |
| Committer | `write` | Module owners — package review, approvals and /merge (Tier A) | *(open for adoption)* |
| Active contributor | `triage`, `moderate` | Issue/PR triage and moderation — no code access | *(open for adoption)* |
<!-- maintainers-flag-end -->

### Contributors

<!-- thanks-contributors-flag-start -->
<!-- thanks-contributors-flag-end -->

### Merge tiers

- Packages and tests (`pkgs/**`, `tests/**`) — one maintainer approval plus
green CI is enough: enable auto-merge on the PR, or comment `/merge` and the
gate bot squash-merges it.
- Official infrastructure (workflows, `index.toml`, `mcpp.toml`, schema and
governance docs) — the gate bot refuses to merge these; an owner reviews and
merges by hand.

Roles, permissions and the claiming process live in the
[governance guide](docs/governance.md).

### Contribute

Follow the [package contribution guide](docs/README.md) or the
[agent skill](.agents/skills/add-mcpp-index-package/SKILL.md).
Expand All @@ -31,6 +61,7 @@ for review while preserving existing versions.
- [CN mirrors](docs/cn-mirror.md)
- [Repository, schema and CI](docs/repository-and-schema.md)
- [openkal compatibility](docs/openkal-compat.md)
- [Governance](docs/governance.md)

## License

Expand Down
30 changes: 29 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,34 @@ mcpp build
使用 `mcpp self config --mirror CN` 切换国内镜像。
最低 mcpp 版本见 [index.toml](index.toml)。

## 贡献
## 维护与贡献

### 维护者

<!-- maintainers-flag-start -->
| 身份 | 权限 | 简介 | 维护者 |
|---|---|---|---|
| 仓库负责人 | `admin` | 契约持有者:规范、CI 与版本下限的最终决策;官方路径人工合并 | [Sunrisepeak](https://github.com/Sunrisepeak "mcpp / d2learn 生态发起人") |
| 核心维护者 | `maintain` | 仓库日常管理与 CI/发版协调,无敏感与破坏性操作 | *(待认领)* |
| 维护者(Committer) | `write` | 模块负责人:包准入 review、approve 与 `/merge`(Tier A) | *(待认领)* |
| 活跃贡献者 | `triage`, `moderate` | issue/PR 分流与议题规范化,无代码权限 | *(待认领)* |
<!-- maintainers-flag-end -->

### 贡献者

<!-- thanks-contributors-flag-start -->
<!-- thanks-contributors-flag-end -->

### 合入策略(分级)

- 三方包与测试(`pkgs/**`、`tests/**`)—— 1 个维护者 approve + CI 全绿即可:
在 PR 上开启 auto-merge,或评论 `/merge` 由门禁 bot squash 合入。
- 官方基础设施(workflows、`index.toml`、`mcpp.toml`、schema 与治理文档)——
门禁 bot 拒绝合入;由 owner 人工 review 后主动合并。

角色、权限与认领流程见[治理文档](docs/zh/governance.md)。

### 贡献

参考[包贡献指南](docs/zh/README.md)或
[agent skill](.agents/skills/add-mcpp-index-package/SKILL.md)。
Expand All @@ -31,6 +58,7 @@ mcpp build
- [国内镜像](docs/zh/cn-mirror.md)
- [仓库、schema 与 CI](docs/zh/repository-and-schema.md)
- [openkal 兼容性](docs/zh/openkal-compat.md)
- [治理](docs/zh/governance.md)

## License

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ behind each step.
| [cn-mirror.md](cn-mirror.md) | The GitCode `mcpp-res` CN mirror loop (`gtc` tooling, closed-loop verification, caveats), including the fallback when you lack write access to `mcpp-res` (plain-string upstream url) |
| [repository-and-schema.md](repository-and-schema.md) | Repository layout, descriptor schema cheat-sheet, `validate.yml` CI behavior, reproducing lint locally, case index |
| [openkal-compat.md](openkal-compat.md) | What the `openkal` label means, how it is measured, and how a package that fails in an openkal graph is adapted |
| [governance.md](governance.md) | Maintainers and responsibility domains, the tiered merge policy (auto-merge vs human-only paths), branch-protection checklist |

> The package field specification (the `mcpp = { … }` extension) is settled by `mcpp xpkg parse` — the very parser CI
> uses; for semantics and constraints see [`docs/spec/`](https://github.com/mcpp-community/mcpp/tree/main/docs/spec)
Expand Down
Loading
Loading