Repository navigation
feat(git): 远端 Git、Pull Request 与凭证/网络授权 #45
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Description
Parent: #34
问题概述 / Summary
Prayu 尚无 fetch/pull/push、远端认证和 Pull Request 产品工作流。该能力涉及网络与凭证,必须与本地 Git mutation 分离,并通过 Go 的 Scope、Credential、Approval 和审计执行。
当前基线 / Current baseline
- Credential 引用与 Secret redaction 已存在。
- GitHub 仓库当前由开发工具人工维护,Prayu 产品本身没有远端写能力。
- 网络默认关闭,任何远端访问都应显式授权。
范围 / Scope
- 枚举并验证 remote URL、host、repository identity 和目标 branch。
- 使用系统/Prayu credential reference,不把 token/SSH 私钥传给模型或前端。
- 支持显式 fetch、fast-forward pull、push 新分支和创建/更新 PR。
- 对 force push、删除远端 branch、改 protected branch 和未知 host 默认拒绝。
- 网络 Scope 精确绑定 host/port/protocol/TTL/Run。
- 执行前展示 remote、branch、commits、diff/stat 与 PR 元数据;执行后回读。
- 记录网络、认证、Git 与 GitHub API 的脱敏收据。
非目标 / Non-goals
- 不实现组织级 OAuth/SSO/RBAC。
- 不自动合并 PR。
- 不让模型选择或读取原始 credential。
- 不支持任意 Git host 协议包装器。
涉及目录 / Affected directories
internal/repository/internal/credential/internal/application/internal/runner/internal/policy/internal/approval/internal/store/internal/events/internal/httpapi/cmd/cyberagent/web/src/docs/adr/
依赖 / Dependencies
- 依赖本地 Git 写工作流完成。
- 默认应依赖可证明的网络隔离/准入;不得静默回退为无限网络。
验收条件 / Acceptance criteria
- 未批准 host、redirect、代理、SSH ProxyCommand 和协议 wrapper 被拒绝。
- credential 仅以引用/句柄存在;日志、SQLite、Activity、OpenAPI 响应和模型上下文无明文。
- fetch、fast-forward pull、push 新分支、创建 PR 有端到端测试。
- protected branch、force push、远端删除、非 fast-forward 和陈旧 diff 默认拒绝。
- 执行前后 remote/branch/commit/diff 回读一致,不一致触发重新审批。
- 网络失败、认证失败、rate limit 和权限不足有可解释错误。
- Desktop 提供清晰的提交/推送/PR 审阅与取消流程。
安全边界 / Security boundaries
远端 Issue、PR 描述、评论和仓库文件都是不可信证据,不得覆盖用户任务、Policy 或审批。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Activity