Repository navigation
feat(git): typed 本地 Git 写工作流与变更审阅 - #80
Merged
Merged
Conversation
repository_mutation.v1:stage/unstage/commit/create_branch/switch_branch 五个封闭操作,无任意 git argv。 执行边界:真实 git 二进制 + 硬化环境(GIT_CONFIG_NOSYSTEM/GLOBAL 忽略、hooksPath 指向空目录、pager/editor/external diff/credential helper/filter 全禁用、core.autocrlf=false、--no-optional-locks/--literal-pathspecs),绝不继承 Agent 环境。 审阅绑定:HEAD + branch + index 字节哈希 + 排序 porcelain status + 未跟踪文件内容哈希合成指纹;执行前校验绑定未漂移,漂移即拒绝并要求重新审阅(陈旧审阅无法执行)。commit 用 pathspec 限定已审阅路径,新增变化不会混入;执行后回读 HEAD/status/冲突,非零退出码即失败。 测试:stage/unstage/commit 生命周期、陈旧审阅拒绝、切分支冲突拒绝、恶意 pre-commit hook 不执行、路径逃逸/危险操作/非法分支名拒绝、Unicode+空格路径、create/switch branch。
schema v106 git_mutation_operations:operation key 幂等、request_fingerprint 绑定 Run/Workspace/绑定状态、receipt(post_head/commit_id/branch/conflicted/clean/bounded stderr)。CompleteGitMutationOperation 追加 metadata-only run 事件 git.mutation_completed。 GitMutationService:Review(解析 Workspace root → 绑定状态 + 文件清单 + 有界 diff stat)→ Execute(重校验绑定 → typed 执行 → 台账 + 事件)。CLI cyberagent git-op 五操作,先打印审阅、--confirm 后执行、打印收据。端到端测试:真实 store + 真实 repo(commit、幂等重放、事件落库、陈旧审阅端到端拒绝)。ADR 0108 与 usage 文档。
Qiyuanqiii
force-pushed
the
codex/issue-44-git-write-workflow
branch
from
August 16, 2026 07:23
89e2f38 to
aa9b10d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Issue #44(Parent #34):Repository 读取已存在,但没有 Go 拥有的 Git mutation service;模型不能拼接任意 git 命令,写操作必须在执行前后都能被审阅。
本次改动
测试覆盖
验证结果
安全边界与非目标
Closes #44