开发总览
给想改这个平台的人:搭环境 → 懂结构 → 守规约 → 会测试 → 能加东西。 贡献者正本是仓库
docs/开发者指南.md(第一天→第一周)。
阅读顺序
text
1. setup 装 1.96/1.80 双通道 + 可选工具
2. project-structure 仓库地图(24 成员怎么分工)
3. conventions 硬门禁(unsafe/复杂度/错误码/假绿防线)
4. testing 离线 790 / live 33 / 覆盖 80% 的体系
5. new-service 九步接入一个新服务(或新域)
6. ci 十 job 门禁怎么读提交流(摘要)
bash
cargo fmt --all && cargo clippy --workspace --all-targets -- -D warnings
cargo clippy -p svc-gateway --features mq-nats --all-targets -- -D warnings # +其余 nats 面
cargo test --workspace # 790 绿
# 改了迁移/proto/chart → 对应 live/buf/helm 校验
git commit # 模板见 conventions质量门禁速记
| 门 | 值 |
|---|---|
| clippy cognitive complexity | ≤10(deny) |
| unsafe | forbid |
| 覆盖率 | ≥80% 行(CI fail-under) |
| 测试 | 全绿(当前基线 790/33) |
| proto | buf breaking 零破坏 |
| 供应链 | cargo-deny 过 |
| CI 预算 | <15min |