Repository navigation
feat(git): 远端 Git、Pull Request 与凭证/网络授权 - #81
Merged
Merged
Conversation
repository_remote.v1:fetch/pull_ff/push_branch/create_pr/update_pr 五个封闭操作;force push、远端分支删除、protected branch 改写不可表达。 验证:仅 HTTPS(无凭据/query/fragment、非 loopback),host/branch/TTL 有界;push 前 ls-remote 探测,已存在分支默认拒绝(永不传 --force)。 执行边界:hardened 环境 + http/https.proxy 置空、core.sshCommand 置空(禁 SSH/ProxyCommand)、protocol.ext.allow=never(禁协议 wrapper)、GIT_ASKPASS 临时助手 + GIT_PASSWORD 子进程环境变量(credential 仅按名称引用,不入 argv/日志/存储,用后即删,stderr 自动脱敏)。 测试:https-only/loopback/URL 内凭据/未知操作/PR 缺 base 拒绝;fetch+fast-forward pull 端到端(本地 bare 远端);push 新分支成功、已存在分支默认拒绝;credential 按名解析与输出脱敏。
PRClient:仅 github.com、Bearer token 引用、响应 ≤64KiB、401/403 rate limit/422/404 可解释错误、收据仅 URL/number/state/title。RemoteOperation 移入 gitmutation 包供 store 复用;run 事件 git.remote_completed 常量。
schema v107 git_remote_operations:operation key 幂等、request_fingerprint 绑定 Run/Workspace/host/port/protocol/branch、凭据名称不入库、receipt 脱敏、git.remote_completed run 事件。GitRemoteService:ValidateSpec → 台账 → ExecuteGit(hardened askpass 路径)或 PRClient(Bearer token 引用)→ Complete + 事件。RemoteRecord/PRNumber 类型共享重构。
CLI cyberagent git-remote(先审阅 remote/branch/TTL/PR 元数据,--confirm 执行 + 脱敏收据)。PRClient httptest 错误矩阵(201/401/403 限流/403 权限/422/404 + Bearer 断言);service 端到端(create_pr + credential 按名引用:secret/名称不进 spec JSON 与 run 事件,断言验证)。ADR 0109 与 usage 文档。
CLI cyberagent git-remote(先审阅 remote/branch/TTL/PR 元数据,--confirm 执行 + 脱敏收据)。PRClient httptest 错误矩阵(201/401/403 限流/403 权限/422/404 + Bearer 断言);service 端到端(create_pr + credential 按名引用:secret/名称不进 spec JSON 与 run 事件,断言验证)。ADR 0109 与 usage 文档。
Qiyuanqiii
force-pushed
the
codex/issue-45-remote-git-pr
branch
from
August 16, 2026 08:40
4d2f46e to
8288c85
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 #45(Parent #34,依赖 #44):Prayu 需要远端 Git 与 Pull Request 产品工作流。网络与凭证必须与本地 mutation 分离,经 Go 的 Scope/Credential/Approval/审计执行,网络默认关闭、任何远端访问显式授权。
本次改动
测试覆盖
验证结果
安全边界与非目标
Closes #45