-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-ops.json
More file actions
158 lines (158 loc) · 4.61 KB
/
git-ops.json
File metadata and controls
158 lines (158 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
"version": "0.2",
"identity_profiles": [
{
"id": "git-readonly",
"provider": "none",
"subject": {
"kind": "service",
"principal": "agent://ops/git-readonly",
"display_name": "Git Read-Only Agent"
},
"trust": {
"level": "restricted",
"constraints": {
"max_autonomy": "restricted",
"escalation": "fail"
}
}
},
{
"id": "git-write",
"provider": "env-bearer",
"subject": {
"kind": "service",
"principal": "agent://ops/git-write",
"display_name": "Git Write Agent",
"delegation_mode": "none"
},
"auth": {
"mode": "service",
"required": false,
"provider_config": {
"token_env": "GIT_TOKEN"
}
},
"trust": {
"level": "supervised",
"constraints": {
"max_autonomy": "supervised",
"escalation": "human-approval"
}
},
"presentation": {
"bindings": [
{
"source": "credentials.access_token.value",
"target": { "kind": "env", "name": "GIT_TOKEN" },
"required": false,
"redact": true
}
],
"handoff": "none",
"cleanup": "always"
}
}
],
"evidence_profiles": [
{
"id": "git-evidence",
"provider": "ssh",
"payload": {
"bind": ["execution_id", "declared_identity", "command", "result"],
"format": "canonical-json"
},
"verify": { "required": false }
}
],
"workflows": [
{
"id": "git-ops",
"name": "Git Operations",
"contract": {
"sandbox": "permissive",
"network": "unrestricted",
"audit": "always"
},
"tasks": [
{
"id": "status",
"name": "Check Working Tree Status",
"shell": {
"program": "git",
"args": ["status", "--porcelain"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "git-readonly" },
"output": { "format": "text", "preview_bytes": 4000 },
"schedule": { "cron": "*/10 * * * *" }
},
{
"id": "log",
"name": "Recent Commit History",
"shell": {
"program": "git",
"args": ["log", "--oneline", "-20"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "git-readonly" },
"output": { "format": "text", "preview_bytes": 4000 },
"schedule": { "cron": "*/15 * * * *" }
},
{
"id": "diff",
"name": "Show Changes Summary",
"shell": {
"program": "git",
"args": ["diff", "--stat"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "git-readonly" },
"output": { "format": "text", "preview_bytes": 8000 },
"schedule": { "cron": "*/10 * * * *" }
},
{
"id": "commit",
"name": "Commit All Changes",
"shell": {
"program": "sh",
"args": ["-c", "git add -A && git commit -m 'automated: agent commit'"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "git-write" },
"output": { "format": "text", "preview_bytes": 2000 },
"schedule": { "cron": "0 */4 * * *" },
"on_failure": {
"id": "triage-commit-failure",
"name": "Triage Commit Failure",
"prompt": "The git commit operation failed. Determine whether this is a merge conflict, dirty index issue, empty changeset, or hook rejection, and recommend the safest resolution.",
"target": { "session_target": "isolated", "agent_id": "main" },
"intent": { "mode": "plan", "read_only": true },
"context": { "retrieval": "recent", "limit": 3 },
"delivery": { "mode": "announce", "to": "@owner_dm" }
}
},
{
"id": "push",
"name": "Push to Remote",
"shell": {
"program": "git",
"args": ["push", "origin", "HEAD"]
},
"target": { "session_target": "shell" },
"identity": { "ref": "git-write" },
"evidence": { "ref": "git-evidence" },
"output": { "format": "text", "preview_bytes": 2000 },
"contract": {
"required_trust_level": "supervised",
"trust_enforcement": "strict"
},
"trigger": {
"parent": "commit",
"on": "success"
}
}
]
}
]
}