Repository navigation
Expand file tree
/
Copy pathsource-control.schema.json
More file actions
367 lines (367 loc) · 21 KB
/
Copy pathsource-control.schema.json
File metadata and controls
367 lines (367 loc) · 21 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/melodic-software/claude-code-plugins/main/plugins/source-control/schemas/source-control.schema.json",
"title": "source-control team config",
"description": "Schema for a repository's docs/conventions/source-control.yaml, the team layer of the source-control plugin's YAML settings. Each key here wins over the plugin's userConfig value of the same name. Resolution: plugins/source-control/reference/config-resolution.md.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"pr_open_state": {
"enum": ["draft", "ready"],
"default": "ready",
"description": "State /source-control:pull-request create leaves a pull request in. ready runs /source-control:pull-request ready on the new pull request, which flips it after its gates; draft leaves it a draft for that action to flip later."
},
"review_venue": {
"enum": ["auto", "local", "ci", "both"],
"default": "auto",
"description": "Which venue reviews a pull request, read at its base branch and honored only when that base is the default branch. auto reads each review lane's CI health and runs a local review only where CI does not cover the lane; local runs every local review step; ci skips the local review steps and leaves the review to the CI lanes; both runs the local steps and still counts the CI lanes. An unknown value falls back to auto."
},
"pr_body_preview": {
"enum": ["post", "preview"],
"default": "post",
"description": "What /source-control:pull-request does with a PR body it is about to post, at create or when it edits one. post posts it; preview prints the body text and waits for a yes, in attended sessions only, while unattended runs always post. An unknown value falls back to post."
},
"pr_body_refresh": {
"type": "boolean",
"default": true,
"description": "When true, a /source-control:pull-request run, or a pr-unblock address-feedback round, that pushes a change making an open pull request's body stale (what changed, verification, the Left out: line) rewrites those sections in place, so the body describes the current head. false leaves the body as it was."
},
"sync_stale_base": {
"type": "boolean",
"default": false,
"description": "When true, push-branch.sh merges the pull request's base into a branch that is behind it on overlapping paths just before it pushes, using the repository's scripts/check-stale-base-overlap.sh as the overlap rule when the checkout has one. A merge, never a rebase; a conflict aborts it and pushes nothing (exit 4). --sync-stale-base and --no-sync-stale-base override it for one push."
},
"pr_update_method": {
"enum": ["auto", "merge", "rebase"],
"default": "auto",
"description": "How a pull request branch takes its base, read at the pull request's base branch and honored only when that base is the default branch. auto applies the shared criteria; merge or rebase replaces the method on the rows plugins/source-control/scripts/branch-update-method.sh marks forceable. Team level only. An unknown value falls back to auto."
},
"dialect": {
"type": "string",
"minLength": 1,
"default": "posix-ere",
"description": "The regex dialect subject_pattern and pr_title_pattern are written in, for a reader that needs to know it. The guardrails convention gate enforces posix-ere only: any other value turns its enforcement off with a diagnostic. Unset means posix-ere."
},
"subject_pattern": {
"type": "string",
"minLength": 1,
"description": "The commit-subject convention: the literal keyword Conventional Commits, or one anchored regex. Exactly one value, never a list; several accepted shapes are alternation inside the one regex. Unset falls through to the repository's own CLAUDE.md, rules or commit-msg hook, then the bundled Conventional Commits default."
},
"type_list": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "The commit type vocabulary. Meaningful only when subject_pattern is Conventional-Commits-shaped; a list inherited from a lower layer is dropped when the effective subject_pattern is a custom regex. A closed list: the winning layer's list is taken whole."
},
"pr_title_pattern": {
"type": "string",
"minLength": 1,
"description": "The pull-request title shape: an anchored regex, or the deferral marker spelled exactly Same as `subject_pattern`. (capital S, backticked key, trailing period)."
},
"trailer_policy": {
"type": "string",
"minLength": 1,
"description": "The attribution-trailer template /source-control:commit appends, or none. Unset applies the skill's default trailer."
},
"pr_body_attribution": {
"type": "string",
"minLength": 1,
"description": "The attribution line /source-control:pull-request create appends to the PR body, or none. Unset applies the default Generated with Claude Code line. Separate from trailer_policy on purpose: a commit trailer and a PR-body line are different surfaces."
},
"pr_body_required_sections": {
"description": "The PR-body section scaffold /source-control:pull-request create drafts and pre-checks before gh pr create: a list of H2 headings, or one keyword. briefing drafts Why, What changed, Scope, Tradeoffs, Risk and Verification and requires Why, What changed, Scope and Verification. summary-test-plan requires Summary and Test plan. none requires nothing. Unset falls through to briefing. A closed list: the winning layer's list is taken whole, never unioned.",
"oneOf": [
{ "enum": ["briefing", "summary-test-plan", "none"] },
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 }
}
]
},
"babysit_loop_stop_mode": {
"enum": ["standing", "drain"],
"default": "standing",
"description": "The /source-control:babysit-loop lane's stop shape: standing keeps watching, drain stops once the target repository has no open pull requests and no open issues (exclusions: the babysit-loop skill's Stop modes). An invocation argument overrides it."
},
"babysit_loop_tier": {
"enum": ["safe", "worker", "autopilot"],
"default": "safe",
"description": "The babysit-prs tier the loop lane runs, the named preset over the autonomy dimensions. Never widens the merge dimension. An invocation argument overrides it."
},
"babysit_loop_merge": {
"enum": ["human-only", "c2-mechanical", "c3-autonomous", "full-autonomy"],
"description": "The loop lane's standing merge rung, ordered human-only < c2-mechanical < c3-autonomous < full-autonomy. A raise binds from this team layer only; every other source may only lower it. Absent, it is human-only while the team layer carries no babysit_loop_* key and c2-mechanical once it does. The unattended merge gate reads this value alone; it sets the gate's rung by itself."
},
"babysit_loop_grace_window_minutes": {
"type": "integer",
"minimum": 1,
"default": 30,
"description": "The loop lane's concurrency-safety activity grace window, in minutes. An invocation argument overrides it."
},
"babysit_loop_discovery_scope": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 1 (which pull requests enter the queue) out of the babysit_loop_tier preset. Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_fixing": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 2 (branch-owned CI and review fix authority). Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_thread_resolution": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 3 (review-thread resolution). Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_draft_elevation": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 4 (draft handling and ready-marking). Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_barrier_overrides": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 5 (blocker handling: escalate, or attempt with research). Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_escalation": {
"enum": ["safe", "worker", "autopilot"],
"description": "A babysit-prs tier name overriding autonomy dimension 7 (escalation posture). The escalation surface is fixed by the loop-lane convention, never by config. Unset takes the preset's value. An invocation argument overrides it."
},
"babysit_loop_cycle_budget": {
"type": "integer",
"minimum": 1,
"description": "Cycles per loop-lane session before the budget-hit stop. Unset means no per-session budget. An invocation argument overrides it."
},
"babysit_loop_no_progress_threshold": {
"type": "integer",
"minimum": 1,
"default": 3,
"description": "Consecutive no-progress cycles before the loop lane raises its stall escalation; it escalates and keeps looping. An invocation argument overrides it."
},
"babysit_loop_trusted_internal_bot_logins": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "Exact GitHub App bot logins the repository attests as its own internal automation, the C5 trust test's one reviewed widening. Honored only from the target repository's team files on its default branch, never an invocation argument or a personal layer. A closed list, taken whole. Unset is the empty set."
},
"babysit_merge_method": {
"enum": ["squash", "merge", "rebase"],
"description": "The merge method /source-control:babysit-prs uses on this repository. Wins over the deprecated userConfig value."
},
"babysit_merge_block_labels": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "Labels that veto a babysit-prs autopilot-tier merge, for example do-not-merge. A hold list: the add-only union with the userConfig list, so neither side drops an entry."
},
"babysit_extra_dependency_manager_logins": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "Dependency-manager bot logins beyond the built-in dependabot and renovate set whose pull requests the babysit-prs merge gate holds, the same as the built-ins. A hold list: the add-only union with the userConfig list."
},
"babysit_approval_downgrade_logins": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "AI reviewer logins whose approval carrying blocking-looking prose babysit-prs surfaces as a material finding instead of ignoring it. A hold list: the add-only union with the userConfig list."
},
"babysit_skip_downgrade_logins": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1 },
"description": "AI reviewer logins whose skip or no-op review babysit-prs does not treat as an approval. Remove-only: it narrows the userConfig set to the logins listed here and never adds one."
},
"babysit_review_gate_context": {
"type": "string",
"minLength": 1,
"description": "The check or status context name of the AI-review gate, which must pass before /source-control:babysit-prs posts the review trigger. Wins over the deprecated userConfig value."
},
"babysit_ci_gateway_context": {
"type": "string",
"minLength": 1,
"description": "The check or status context name of a CI gateway check /source-control:babysit-prs classifies, which must pass before it posts the review trigger. Wins over the deprecated userConfig value."
},
"branch_issue_pattern": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "A POSIX ERE /source-control:pull-request create uses to parse the work-item reference from the branch name; its last capture group holds the reference, an issue number or a tracker key. At most 200 characters, every repetition bound at most 16, no quantifier on a group that already holds one, no backreference. Unset falls through to the deprecated userConfig value, then the built-in <type>/<N>-<slug> convention."
},
"dossier_branch_prefix": {
"type": "string",
"minLength": 1,
"default": "dossier/",
"description": "The prefix of an owning work item's dossier branch, <prefix><key>-<slug>, where <key> is the bound tracker adapter's branch_ref for the item. The branch holds the item's docs, exploration notes and draft plan. One dossier per owning item: a parent or spec container gets its own, and a child item adds its own only when it needs one. Unset means dossier/."
},
"worktree_branch_naming": {
"enum": ["verbatim", "conventional-commits"],
"default": "verbatim",
"description": "How the source-control worktree helper, the WorktreeCreate hook included, names a new worktree's branch from the worktree name. verbatim uses the name itself. conventional-commits derives <type>/<description>: only a slash marks a type, and a first segment that is a Conventional Commits type, an alias of one (feature, bugfix, hotfix, documentation, doc, tests, performance), or a worktree_branch_extra_prefixes entry is the type, matched in any case; any other name goes whole under worktree_branch_default_type. Each part is made ref-safe. An unknown value keeps the name verbatim."
},
"worktree_branch_default_type": {
"type": "string",
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"default": "chore",
"description": "The type a conventional-commits branch takes when the worktree name names none, as in chore/agent-<id> for an isolated Agent spawn. One lowercase segment; an invalid value uses chore."
},
"worktree_branch_extra_prefixes": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
"description": "First segments beyond the Conventional Commits types that a conventional-commits branch keeps as its type, such as claude, codex or dependabot, written as listed. One lowercase segment each; an invalid entry is skipped."
},
"pre_ready": {
"type": "array",
"maxItems": 6,
"allOf": [
{
"contains": {
"properties": { "step": { "const": "base-merge" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
},
{
"contains": {
"properties": { "step": { "const": "plan-evidence" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
},
{
"contains": {
"properties": { "step": { "const": "code-review" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
},
{
"contains": {
"properties": { "step": { "const": "security-review" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
},
{
"contains": {
"properties": { "step": { "const": "verify" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
},
{
"contains": {
"properties": { "step": { "const": "evidence" } },
"required": ["step"]
},
"minContains": 0,
"maxContains": 1
}
],
"description": "Which configurable steps /source-control:pull-request ready runs, read at the pull request's base branch and honored only when that base is the base repository's default branch. A list of {step, enabled} mappings rather than a mapping keyed by step, so the shared YAML-subset reader reads each item by index. A step the list leaves out runs. The hold checks, the push and the flip are not steps here and always run. Each step appears at most once (the allOf maxContains entries); the reader runs every step when one repeats, names an unknown step, or the list does not parse.",
"default": [
{ "step": "base-merge", "enabled": true },
{ "step": "plan-evidence", "enabled": true },
{ "step": "code-review", "enabled": true },
{ "step": "security-review", "enabled": true },
{ "step": "verify", "enabled": true },
{ "step": "evidence", "enabled": true }
],
"items": {
"type": "object",
"additionalProperties": false,
"required": ["step", "enabled"],
"properties": {
"step": {
"enum": [
"base-merge",
"plan-evidence",
"code-review",
"security-review",
"verify",
"evidence"
],
"description": "base-merge: update the branch from its base, by the method the shared branch update decision chooses. plan-evidence: gather the review evidence a plan's Review: value asks for. code-review and security-review: the fresh-context reviews of the pull request's diff. verify: the verify gate on the updated head. evidence: after the flip, post the evidence comment for a confirmed head that has an evidence file."
},
"enabled": {
"type": "boolean",
"description": "false skips the step and reports it as disabled by pre_ready at the base branch, never as passing."
}
}
}
},
"prep_audits": {
"type": "array",
"maxItems": 5,
"allOf": [
{
"contains": { "properties": { "class": { "const": "markdown" } }, "required": ["class"] },
"minContains": 0,
"maxContains": 1
},
{
"contains": { "properties": { "class": { "const": "renames" } }, "required": ["class"] },
"minContains": 0,
"maxContains": 1
},
{
"contains": { "properties": { "class": { "const": "skills" } }, "required": ["class"] },
"minContains": 0,
"maxContains": 1
},
{
"contains": { "properties": { "class": { "const": "rules" } }, "required": ["class"] },
"minContains": 0,
"maxContains": 1
},
{
"contains": { "properties": { "class": { "const": "tests" } }, "required": ["class"] },
"minContains": 0,
"maxContains": 1
}
],
"description": "Which audit /source-control:pull-request prep runs for each change class, read at the default branch and honored only when the pull request targets it. A list of {class, enabled, skill} mappings, shaped like pre_ready. A class the list leaves out runs its default audit. Each class appears at most once; the reader runs every default audit when one repeats, names an unknown class, or the list does not parse.",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["class", "enabled"],
"properties": {
"class": {
"enum": ["markdown", "renames", "skills", "rules", "tests"],
"description": "markdown: the prose audits over changed .md files. renames: the rename-reference audit. skills: the skill check over changed skills and agents. rules: the check over changed .claude/rules files. tests: the judge pass over changed tests, which can be turned off but not replaced."
},
"enabled": {
"type": "boolean",
"description": "false runs no audit for the class and reports it as off by prep_audits at the default branch, never as passing."
},
"skill": {
"type": "string",
"pattern": "^/[a-z0-9]+(-[a-z0-9]+)*(:[a-z0-9]+(-[a-z0-9]+)*)?$",
"description": "A skill run in place of the class's default audit, with the class's changed files as its arguments. A skill name only: no arguments and no shell command."
}
},
"allOf": [
{
"if": { "properties": { "class": { "const": "tests" } }, "required": ["class"] },
"then": { "not": { "required": ["skill"] } }
},
{
"if": { "properties": { "enabled": { "const": false } }, "required": ["enabled"] },
"then": { "not": { "required": ["skill"] } }
}
]
}
}
}
}