feat(examples): add pr-quality-gatekeeper end-to-end workflow(子题三:门禁闭环 + 全仓批扫) #219

Merged
wbtiger merged 1 commits from recorder/gitlink-cli:feat/example-workflow-pr-gatekeeper into master 2026-06-14 19:32:56 +08:00
Contributor

这个 PR 做什么

把已收录的 gitlink-gatekeeper Skill(#90)包成 examples/workflows/ 下可直接运行的端到端工作流,补全三层闭环:label 命令(#89)→ gatekeeper Skill(#90)→ 本工作流,三层共用同一套 gatekeeper.yaml 策略。

采集 → 路由 → 裁决 → 回写/善后:纯标准库脚本(Python ≥3.9,零第三方依赖)驱动 gitlink-cli,对真实 PR 算出确定性 0–100 评分卡与三态裁决;默认 dry-run,--apply 才回写(评论 + 裁决标签 + tracking issue),绝不自动合并。

包含

  • scripts/gatekeeper_workflow.py 单 PR 门禁闭环;scripts/gatekeeper_sweep.py 仓库级批量体检
  • ci-example/ Gitea Actions 接入(退出码 2 = REQUEST_CHANGES 即 CI 门禁)
  • docs/(architecture / quickstart / runbook / verification)+ tests/test_scoring.py(确定性回归护栏,全绿)
  • examples/demo-outputs/ 全部为真实平台运行产物

已在真实平台验证(详见 docs/verification.md)

  • dry-run:本仓库真实 PR → PASS 90/100,8 个变更文件路由正确
  • 注入真实审查发现(findings.example.json,标注真实行号、可逐条复核)→ 裁决翻转 REQUEST_CHANGES 55/100
  • --apply 在自有 fork 演练:评分卡评论(id 472741)+ tracking issue(id 143217)+ 裁决标签,均有 API 回执
  • 全仓批扫:本仓库全部 113 个 open PR,113/113 成功——PASS 105 / COMMENT 6 / REQUEST_CHANGES 2,均分 88.5,96% 未关联 issue(完整治理报告随附 examples/demo-outputs/)

与 #131(Java Gatekeeper)的关系

注意到 #131 也在做 PR 质量门禁(Java + 常驻 webhook 服务),方向很好;本例定位不同:作为已收录 skills/gitlink-gatekeeper 的配套参考实现——纯标准库零部署、评分确定性可逐位手算、与 Skill 共用一套策略文件、附全仓批扫模式。两者互补而非重复。

影响面

仅新增 examples/workflows/pr-quality-gatekeeper/(17 个文件),不改动任何 Go 代码与现有文件。骨架对齐已合并的 community-ops-automation / project-bootstrap-automation。

## 这个 PR 做什么 把已收录的 `gitlink-gatekeeper` Skill(#90)包成 **examples/workflows/ 下可直接运行的端到端工作流**,补全三层闭环:`label` 命令(#89)→ gatekeeper Skill(#90)→ **本工作流**,三层共用同一套 `gatekeeper.yaml` 策略。 **采集 → 路由 → 裁决 → 回写/善后**:纯标准库脚本(Python ≥3.9,零第三方依赖)驱动 `gitlink-cli`,对真实 PR 算出确定性 0–100 评分卡与三态裁决;默认 dry-run,`--apply` 才回写(评论 + 裁决标签 + tracking issue),绝不自动合并。 ## 包含 - `scripts/gatekeeper_workflow.py` 单 PR 门禁闭环;`scripts/gatekeeper_sweep.py` **仓库级批量体检** - `ci-example/` Gitea Actions 接入(退出码 2 = REQUEST_CHANGES 即 CI 门禁) - `docs/`(architecture / quickstart / runbook / verification)+ `tests/test_scoring.py`(确定性回归护栏,全绿) - `examples/demo-outputs/` 全部为**真实平台运行产物** ## 已在真实平台验证(详见 docs/verification.md) - dry-run:本仓库真实 PR → PASS 90/100,8 个变更文件路由正确 - 注入**真实审查发现**(findings.example.json,标注真实行号、可逐条复核)→ 裁决翻转 REQUEST_CHANGES 55/100 - `--apply` 在自有 fork 演练:评分卡评论(id 472741)+ tracking issue(id 143217)+ 裁决标签,均有 API 回执 - **全仓批扫:本仓库全部 113 个 open PR**,113/113 成功——PASS 105 / COMMENT 6 / REQUEST_CHANGES 2,均分 88.5,96% 未关联 issue(完整治理报告随附 examples/demo-outputs/) ## 与 #131(Java Gatekeeper)的关系 注意到 #131 也在做 PR 质量门禁(Java + 常驻 webhook 服务),方向很好;本例定位不同:作为**已收录 skills/gitlink-gatekeeper 的配套参考实现**——纯标准库零部署、评分确定性可逐位手算、与 Skill 共用一套策略文件、附全仓批扫模式。两者互补而非重复。 ## 影响面 仅新增 `examples/workflows/pr-quality-gatekeeper/`(17 个文件),不改动任何 Go 代码与现有文件。骨架对齐已合并的 community-ops-automation / project-bootstrap-automation。
recorder added 1 commit 2026-06-12 10:17:58 +08:00
85a67a875f feat(examples): add pr-quality-gatekeeper end-to-end workflow
Runnable reference implementation of the merged gitlink-gatekeeper Skill:
collect -> route -> decide (deterministic 0-100 scorecard, three-state verdict)
-> write-back (comment + label + tracking issue, --apply gated, never auto-merge).

- scripts/gatekeeper_workflow.py: single-PR gate loop (pure stdlib, py>=3.9)
- scripts/gatekeeper_sweep.py: repo-wide triage — real run over all 113 open PRs
  of this repo (read-only): PASS 105 / COMMENT 6 / REQUEST_CHANGES 2, avg 88.5
- findings.example.json: real code-review findings of a real PR diff (verifiable line numbers)
- ci-example/: Gitea Actions integration (exit code 2 = REQUEST_CHANGES as CI gate)
- docs: architecture / quickstart / runbook / verification (real-platform evidence)
- tests/test_scoring.py: determinism regression guard (green)

Closes the sub-task-3 loop on top of the label command (#89) and the
gitlink-gatekeeper Skill (#90), sharing one policy file across all three layers.
wbtiger merged commit d3485fce45 into master 2026-06-14 19:32:56 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#219
No description provided.