Skip to content

feat(governance): add Git-backed GovernanceStore - #27

Merged
Kucell merged 3 commits into
mainfrom
feat/rdg-ms004-git-governance-store
Oct 6, 2026
Merged

Kucell merged 3 commits into
mainfrom
feat/rdg-ms004-git-governance-store

Conversation

@Kucell

@Kucell Kucell commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Purpose

Implement Remote & Detached Governance MS-004 — Git-backed Governance Store approved by D-RDG-MS004-20261006.

This PR adds a provider-neutral GitGovernanceStore using standard Git plumbing only.

Architecture

read ref -> commit SHA (RevisionToken)
  -> read blob/tree
  -> prepare blob + tree + commit
  -> git update-ref <ref> <new> <expected-old>
  -> success OR RevisionConflict

No checkout, GitHub API, GitLab API, Gitee API, clone/fetch/push, or credential handling is introduced.

Scope

  • add lib/governance/git-store.js;
  • support ordinary and bare Git repositories;
  • use commit SHA as store revision;
  • implement atomic compare-and-write with git update-ref;
  • support unborn refs / create-if-absent;
  • support append with immutable Git history;
  • expose history capability;
  • reuse GovernanceStore key traversal protections;
  • add stale-writer conflict tests;
  • add Git store tests to M-040 validation.

Not in this PR

  • provider adapters;
  • network transport;
  • clone/fetch/push;
  • repository creation;
  • credentials;
  • remote Management API;
  • migration/cutover;
  • init/rebind CLI.

Governance

@Kucell
Kucell marked this pull request as ready for review October 6, 2026 06:59
@Kucell
Kucell merged commit 332e4b5 into main Oct 6, 2026
2 checks passed
@Kucell
Kucell deleted the feat/rdg-ms004-git-governance-store branch October 22, 2026 06:53
Kucell added a commit that referenced this pull request Oct 23, 2026
对比 PR-Agent / Qodo v2 后确认的最小缺口:cortex 能产出经过机械校验的
review artifact,但没有出口——finding 只活在文件里,没有人在 PR 上看到它。

治理仓侧(.agent gitlink → 19d50601,PR #27):
- vcs-pr github backend 新增 getDiff / listComments / listReviews /
  createComment / submitReview
- CLI 新增 diff / comments / reviews / comment / review
- comment 与 review 归入 GATE_USER_ONLY——发布到别人会读的 PR
- backend 未实现某操作时报 capability_unavailable,不以空列表冒充数据
- agent-review-benchmark 新增 render-pr-comment.js:artifact → PR 评论体
- 新增 CI workflow 覆盖此前未被任何 workflow 触达的两个 skill

主仓侧(L1 分发面 + 测试):
- 同步 _shared / en 两层的 vcs-pr 实现与 SKILL.md
- _shared 的 vcs-pr SKILL.md 此前缺少 update 命令、fail-closed run 关联
  等章节,zh 层项目拿到的是它——已补齐为与 en 层同构
- 同步治理仓 #23 引入的 4 个实现文件与 2 个 schema 漂移
- 新增 tests/review-surface/(双副本:治理仓 + L1 各跑一遍)
- issue-15 测试改为断言新契约:decisions resolve 不再释放 Waitpoint

验证:484/484 全量通过,三道门禁零违规。

Co-authored-by: cortex-agent <cortex-agent@local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant