Replies: 1 comment
-
|
下面给出一套受 Gene Ontology(GO)启发的 Git commit message 编写规范。目标不是简单仿照“feat/fix”,而是把 GO 的本体(ontology)思想——标准化术语、三大“范畴”、层级与可计算性、证据与跨项目可比性——系统移植到工程协作与变更记录中,使提交记录能被机器推理、统计富集、跨仓对齐,同时保持对一线开发者易写、易读。 0. 设计目标(为什么要这样做)
1. Commit Ontology(CO)元模型借鉴 GO 的三大分支(BP/MF/CC),定义代码世界的三元注释:
1.1 限定词(Qualifiers)表达与术语的关系(类比 GO 的 regulates/negatively_regulates/part_of):
1.2 证据代码(Evidence Codes,类比 GO/ECO)说明“为什么现在要改”,支持机器审计与质量度量:
每条证据可带 1.3 影响与环境(Impact / Taxon)
2. 消息格式(语法 + 约束)2.1 头行(≤ 72 字符)
示例 2.2 正文(What / Why / How 分段)
2.3 结构化注释块(机器可读,YAML)置于正文末尾,以 CO:
bp:
- id: CO:BP:0007
term: bp:checkout.payment
mf:
- id: CO:MF:0112
term: mf:txn.isolation
cc:
- id: CO:CC:2031
term: cc:svc.orders.db
qualifiers: [fixes, hardens]
evidence:
- code: IR
source: INC-421
confidence: 0.9
- code: FT
with: test_double_charge_spec
impact:
- area: payments
metric: double_charge_rate
before: 0.32
after: 0.00
unit: "%"
confidence: 0.9
env:
platform: server
region: us
stage: prod
links:
issues: [4231]
prs: [8821]
docs: ["runbook/charge-retry.md"]
3. 受控词汇(初始树)
3.1 BP(业务/流程)
3.2 MF(微功能)
3.3 CC(代码组分)
4. 写作与门禁(Lint)规则
5. “GO 风格”的分析与产出借 GO 的“富集分析/知识图谱”工作流,把提交变成可推理数据:
6. 与现行规范的关系(兼容 Conventional Commits)
7. 模板与示例7.1 Git 提交模板(
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions