CI ran .gitea/ci/commit_message_lint.py, an independent reimplementation that parsed the type/emoji mapping out of docs/common/commit_message.md. Its scope pattern accepted fix(-a), fix(a-), fix(a--b) and fix(_), and it had no subject length check, so the gate that actually blocks merges enforced weaker rules than the Validation this skill reports. The CI entry is now a wrapper that locates the skill validator and delegates to it with no arguments; commit_policy.json becomes the only rule source and explanatory docs stop being a machine policy input. The validator also learns the workflow_run event, whose payload carries neither a PR title nor a before/after range. An upstream pull_request now validates <integration-branch>..head_sha instead of HEAD alone, taking the branch name from COMMIT_LINT_MAIN_BRANCH, and degrades to the upstream head commit with a WARN rather than guessing a base. Alongside: --help now documents the no-argument CI mode it had always supported silently, CI wiring detail moves to references/ci-wiring.md, and the description gains negative boundaries. test/test_commit_message_policy.py asserts policy/spec-table equality and uses ast to assert the CI entry imports no regex and reads no file, so a second implementation cannot reappear unnoticed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
2.0 KiB
JSON
23 lines
2.0 KiB
JSON
[
|
||
{
|
||
"id": "single-intent-with-unstaged-noise",
|
||
"prompt": "我已经暂存了一组修复 commit message 校验器的改动,工作树里还有一份无关的未暂存文档改动。请检查当前 staged diff,给我一个符合仓库规范的提交信息,但先不要提交。",
|
||
"expected": "只根据完整 cached diff 判断单一意图,明确区分未暂存噪音;解析有效 policy,用 argv 调用 bundled validator 校验候选;按 Detected/Spec/Proposed/Validation/Notes 输出,并且不修改 index、不提交。"
|
||
},
|
||
{
|
||
"id": "mixed-intents-and-shared-file-hunks",
|
||
"prompt": "当前暂存区既有一个行为修复,也有无关的文档整理,其中同一个文件里也混进了两个不同目的的 hunk。这些改动适合一个提交吗?请给出提交信息建议。",
|
||
"expected": "识别多个逻辑意图并按文件与 hunk 边界提出有序拆分;每组独立说明 Intent/Spec、生成并实际校验候选;在用户确认不拆分前不提供掩盖多意图的合并 Proposed,也不自行改动暂存区。"
|
||
},
|
||
{
|
||
"id": "no-staged-diff",
|
||
"prompt": "帮我根据当前改动写一个规范的 commit message。现在只有未暂存改动,没有 staged diff。",
|
||
"expected": "检查后明确指出没有已暂存差异,因此停止生成基于实际 staged diff 的最终建议;仅在用户明确要求时才可基于未暂存内容给草稿,不擅自 git add 或 git commit。"
|
||
},
|
||
{
|
||
"id": "looks-valid-but-policy-rejects",
|
||
"prompt": "暂存区只有一处改动。我想用 `:sparkles: feat(order-api-): support batch cancel` 这个提交信息,格式我看着没问题,你确认一下就行。",
|
||
"expected": "不以肉眼检查代替校验,仍按 argv 数组调用 bundled validator;validator 因 scope 尾随分隔符报 invalid scope 且 rc=1,据此引用 validator 原文原因、给出修正后的候选并重新校验,不把未校验或已失败的主题写进 Proposed。"
|
||
}
|
||
]
|