docs(agents): 新增提交信息规范,固定句子结构与术语
提交信息此前只靠习惯,没有成文标准。 本提交写入 ASD-STE100 的句子结构规则:一句话一个意思,动词在前,一个主题一段。 标识符原样保留。术语按代码注释和测试名的写法固定。 文档只规定怎么判断,不维护词表。 词表必然不全,读者会把"不在表里"误读成"都可以改写"。
This commit is contained in:
12
AGENTS.md
12
AGENTS.md
@@ -243,3 +243,15 @@ Configure endpoints through env vars (`RABBITMQ_TEST_URL`, …), never hardcoded
|
||||
- Never weaken, skip, or delete an assertion to get a change through. If an invariant genuinely changes, change the test in the same commit and explain why in the message.
|
||||
- A new test that needs to reach into private fields, sleep for seconds, or start a container usually means the unit boundary is wrong — fix the design (inject the dependency) instead of adding scaffolding.
|
||||
- When a test starts failing "because the environment changed", check whether it was ever deterministic before editing it.
|
||||
|
||||
## Commit Messages
|
||||
|
||||
Commit messages are Chinese, `type(scope): subject`, and written to the structural rules of ASD-STE100 — target roughly 80 %, which means the text reads simply. This is not a certified STE document; it is a readability standard with two hard parts: short sentences, and terms kept exactly as the code spells them.
|
||||
|
||||
- **One idea per sentence.** Split on `——`, `;` and `:` into separate sentences instead of chaining clauses. Aim for ≤ 30 characters; a sentence with three comma-joined clauses is a rewrite.
|
||||
- **Verb first, active voice.** `只做声明` → `只声明`. No verb-less lines like `DLX 交换机 X + 唯一队列 Y parked.# 绑定`; write `包含 … 和 …` / `以 … 绑定到 …`.
|
||||
- **One paragraph per topic**, opened by its claim (`每个队列必须有独立的重试入口。…`). Use `因此` / `所以` to start the conclusion sentence instead of glueing it on.
|
||||
- **Identifiers stay verbatim**: exchange, queue and routing-key names, type and function names, test names. Never translate, reflow or abbreviate them.
|
||||
- **A term is a fixed phrase, not a word.** A phrase that already appears in code comments or test names is project vocabulary: keep it exactly, and do not borrow one of its words to mean something else. Everything that is not a term uses plain words — do not coin new metaphors, since a metaphor that cannot be `grep`ed is one the next reader has to decode.
|
||||
- When the change is verified by a command, close with a `验证:…` line naming it, e.g. `验证:go test -race -count=1 ./... 全绿`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user