patchrail 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. patchrail/__init__.py +7 -0
  2. patchrail/__main__.py +7 -0
  3. patchrail/ci/__init__.py +7 -0
  4. patchrail/ci/classify.py +888 -0
  5. patchrail/cli.py +8566 -0
  6. patchrail/funded_issues/__init__.py +138 -0
  7. patchrail/funded_issues/algora_board.py +240 -0
  8. patchrail/funded_issues/blocklist.py +112 -0
  9. patchrail/funded_issues/discovery.py +4091 -0
  10. patchrail/funded_issues/importers.py +316 -0
  11. patchrail/funded_issues/source_noise.py +349 -0
  12. patchrail/funded_issues/store.py +459 -0
  13. patchrail/queue/__init__.py +75 -0
  14. patchrail/queue/server.py +273 -0
  15. patchrail/queue/status.py +756 -0
  16. patchrail/queue/store.py +600 -0
  17. patchrail/reviewer_quick_check.py +650 -0
  18. patchrail/schemas/__init__.py +1 -0
  19. patchrail/schemas/application-dossier.v1.schema.json +305 -0
  20. patchrail/schemas/ci-benchmark.v1.schema.json +174 -0
  21. patchrail/schemas/ci-fixture-check.v1.schema.json +122 -0
  22. patchrail/schemas/ci-pilot-metrics.v1.schema.json +164 -0
  23. patchrail/schemas/ci-pilot-summary.v1.schema.json +146 -0
  24. patchrail/schemas/ci-result.v1.schema.json +133 -0
  25. patchrail/schemas/funded-issues-client-report.v1.schema.json +524 -0
  26. patchrail/schemas/funded-issues-recheck-queue.v1.schema.json +333 -0
  27. patchrail/schemas/funded-issues-recheck-summary.v1.schema.json +136 -0
  28. patchrail/schemas/funded-issues-report.v1.schema.json +836 -0
  29. patchrail/schemas/funded-issues-shortlist.v1.schema.json +953 -0
  30. patchrail/schemas/funded-issues-store-status.v1.schema.json +96 -0
  31. patchrail/schemas/funded-issues-store.v1.schema.json +117 -0
  32. patchrail/schemas/queue-audit-event.v1.schema.json +44 -0
  33. patchrail/schemas/queue-audit-summary.v1.schema.json +169 -0
  34. patchrail/schemas/queue-gate-report.v1.schema.json +158 -0
  35. patchrail/schemas/queue-policy-resolution.v1.schema.json +188 -0
  36. patchrail/schemas/queue-policy-scan.v1.schema.json +175 -0
  37. patchrail/schemas/queue-proposal.v1.schema.json +61 -0
  38. patchrail/schemas/queue-review.v1.schema.json +218 -0
  39. patchrail/schemas/queue-status.v1.schema.json +179 -0
  40. patchrail/schemas/queue-work-item.v1.schema.json +64 -0
  41. patchrail/schemas/reviewer-quick-check-artifacts.v1.schema.json +104 -0
  42. patchrail/web_metrics.py +649 -0
  43. patchrail-0.1.0.dist-info/METADATA +279 -0
  44. patchrail-0.1.0.dist-info/RECORD +47 -0
  45. patchrail-0.1.0.dist-info/WHEEL +4 -0
  46. patchrail-0.1.0.dist-info/entry_points.txt +2 -0
  47. patchrail-0.1.0.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1,333 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://patchrail.dev/schemas/funded-issues-recheck-queue.v1.schema.json",
4
+ "title": "PatchRail Funded Issues Recheck Queue",
5
+ "description": "Read-only tracker maintenance queue emitted by patchrail funded-issues recheck-queue.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "source_schema_version",
10
+ "read_only",
11
+ "safe_only",
12
+ "blocked_actions",
13
+ "filters",
14
+ "queue_limit",
15
+ "total_loaded",
16
+ "total_scored",
17
+ "queue_rows_before_limit",
18
+ "queue_rows",
19
+ "no_go_archive_rows",
20
+ "priority_counts",
21
+ "action_counts",
22
+ "focus_batch",
23
+ "items",
24
+ "requirements",
25
+ "boundary"
26
+ ],
27
+ "properties": {
28
+ "schema_version": {
29
+ "const": "patchrail.funded_issues.recheck_queue.v1"
30
+ },
31
+ "source_schema_version": {
32
+ "const": "patchrail.funded_issues.v1"
33
+ },
34
+ "read_only": {
35
+ "const": true
36
+ },
37
+ "safe_only": {
38
+ "type": "boolean"
39
+ },
40
+ "blocked_actions": {
41
+ "$ref": "#/$defs/blocked_actions"
42
+ },
43
+ "filters": {
44
+ "$ref": "#/$defs/filters"
45
+ },
46
+ "queue_limit": {
47
+ "type": ["integer", "null"],
48
+ "minimum": 1
49
+ },
50
+ "total_loaded": {
51
+ "type": "integer",
52
+ "minimum": 0
53
+ },
54
+ "total_scored": {
55
+ "type": "integer",
56
+ "minimum": 0
57
+ },
58
+ "queue_rows_before_limit": {
59
+ "type": "integer",
60
+ "minimum": 0
61
+ },
62
+ "queue_rows": {
63
+ "type": "integer",
64
+ "minimum": 0
65
+ },
66
+ "no_go_archive_rows": {
67
+ "type": "integer",
68
+ "minimum": 0
69
+ },
70
+ "priority_counts": {
71
+ "$ref": "#/$defs/count_map"
72
+ },
73
+ "action_counts": {
74
+ "$ref": "#/$defs/count_map"
75
+ },
76
+ "focus_batch": {
77
+ "$ref": "#/$defs/focus_batch"
78
+ },
79
+ "items": {
80
+ "type": "array",
81
+ "items": {
82
+ "$ref": "#/$defs/recheck_queue_item"
83
+ }
84
+ },
85
+ "requirements": {
86
+ "$ref": "#/$defs/safe_requirements"
87
+ },
88
+ "boundary": {
89
+ "type": "string",
90
+ "minLength": 1
91
+ }
92
+ },
93
+ "additionalProperties": false,
94
+ "$defs": {
95
+ "blocked_actions": {
96
+ "type": "array",
97
+ "contains": { "const": "automatic_claims" },
98
+ "items": {
99
+ "enum": [
100
+ "automatic_claims",
101
+ "automatic_pull_requests",
102
+ "automatic_issue_comments",
103
+ "mass_outreach",
104
+ "ranking_by_money_only"
105
+ ]
106
+ },
107
+ "uniqueItems": true
108
+ },
109
+ "client_profile": {
110
+ "type": "object",
111
+ "required": [
112
+ "schema_version",
113
+ "name",
114
+ "languages",
115
+ "min_usd",
116
+ "allowed_opportunity_states",
117
+ "allowed_risk_levels",
118
+ "excluded_risk_flags",
119
+ "read_only"
120
+ ],
121
+ "properties": {
122
+ "schema_version": {
123
+ "const": "patchrail.funded_issues.client_profile.v1"
124
+ },
125
+ "name": {
126
+ "type": ["string", "null"]
127
+ },
128
+ "languages": {
129
+ "type": "array",
130
+ "items": { "type": "string", "minLength": 1 },
131
+ "uniqueItems": true
132
+ },
133
+ "min_usd": {
134
+ "type": ["number", "null"],
135
+ "minimum": 0
136
+ },
137
+ "allowed_opportunity_states": {
138
+ "type": "array",
139
+ "items": { "$ref": "#/$defs/opportunity_state" },
140
+ "uniqueItems": true
141
+ },
142
+ "allowed_risk_levels": {
143
+ "type": "array",
144
+ "items": { "$ref": "#/$defs/risk_level" },
145
+ "uniqueItems": true
146
+ },
147
+ "excluded_risk_flags": {
148
+ "type": "array",
149
+ "items": { "type": "string", "minLength": 1 },
150
+ "uniqueItems": true
151
+ },
152
+ "read_only": {
153
+ "const": true
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ },
158
+ "count_map": {
159
+ "type": "object",
160
+ "additionalProperties": {
161
+ "type": "integer",
162
+ "minimum": 0
163
+ }
164
+ },
165
+ "filters": {
166
+ "type": "object",
167
+ "required": [
168
+ "profile",
169
+ "platform",
170
+ "language",
171
+ "min_usd",
172
+ "opportunity_state",
173
+ "risk_level"
174
+ ],
175
+ "properties": {
176
+ "profile": {
177
+ "anyOf": [
178
+ { "$ref": "#/$defs/client_profile" },
179
+ { "type": "null" }
180
+ ]
181
+ },
182
+ "platform": { "type": ["string", "null"] },
183
+ "language": { "type": ["string", "null"] },
184
+ "min_usd": { "type": ["number", "null"], "minimum": 0 },
185
+ "opportunity_state": {
186
+ "anyOf": [
187
+ { "$ref": "#/$defs/opportunity_state" },
188
+ { "type": "null" }
189
+ ]
190
+ },
191
+ "risk_level": {
192
+ "anyOf": [
193
+ { "$ref": "#/$defs/risk_level" },
194
+ { "type": "null" }
195
+ ]
196
+ }
197
+ },
198
+ "additionalProperties": false
199
+ },
200
+ "focus_batch": {
201
+ "type": "object",
202
+ "required": [
203
+ "status",
204
+ "primary_action",
205
+ "priority",
206
+ "item_count",
207
+ "references",
208
+ "platform_counts",
209
+ "evidence_checklist",
210
+ "boundary"
211
+ ],
212
+ "properties": {
213
+ "status": {
214
+ "enum": ["active_recheck_batch", "clear"]
215
+ },
216
+ "primary_action": {
217
+ "enum": [
218
+ "confirm_client_authorization",
219
+ "none",
220
+ "recheck_public_issue_state",
221
+ "recheck_scope_and_noise",
222
+ "verify_funding_visibility"
223
+ ]
224
+ },
225
+ "priority": {
226
+ "enum": ["high", "medium", "low", "none"]
227
+ },
228
+ "item_count": {
229
+ "type": "integer",
230
+ "minimum": 0
231
+ },
232
+ "references": {
233
+ "type": "array",
234
+ "items": { "type": "string", "minLength": 1 }
235
+ },
236
+ "platform_counts": {
237
+ "$ref": "#/$defs/count_map"
238
+ },
239
+ "evidence_checklist": {
240
+ "type": "array",
241
+ "items": { "type": "string", "minLength": 1 }
242
+ },
243
+ "boundary": {
244
+ "type": "string",
245
+ "minLength": 1
246
+ }
247
+ },
248
+ "additionalProperties": false
249
+ },
250
+ "opportunity_state": {
251
+ "enum": ["active", "closed", "stale", "unknown"]
252
+ },
253
+ "recheck_queue_item": {
254
+ "type": "object",
255
+ "required": [
256
+ "reference",
257
+ "title",
258
+ "url",
259
+ "platform",
260
+ "funding",
261
+ "opportunity_state",
262
+ "risk_level",
263
+ "score",
264
+ "confidence",
265
+ "decision_gate",
266
+ "priority",
267
+ "action",
268
+ "reason",
269
+ "evidence_checklist",
270
+ "recommended_next_step",
271
+ "blocked_actions"
272
+ ],
273
+ "properties": {
274
+ "reference": { "type": "string", "minLength": 1 },
275
+ "title": { "type": "string", "minLength": 1 },
276
+ "url": { "type": "string", "format": "uri" },
277
+ "platform": { "type": "string", "minLength": 1 },
278
+ "funding": { "type": "string", "minLength": 1 },
279
+ "opportunity_state": { "$ref": "#/$defs/opportunity_state" },
280
+ "risk_level": { "$ref": "#/$defs/risk_level" },
281
+ "score": { "type": "integer", "minimum": 0 },
282
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
283
+ "decision_gate": {
284
+ "enum": [
285
+ "go_after_recheck",
286
+ "needs_authorization",
287
+ "needs_funding_verification",
288
+ "watchlist"
289
+ ]
290
+ },
291
+ "priority": {
292
+ "enum": ["high", "medium", "low"]
293
+ },
294
+ "action": {
295
+ "enum": [
296
+ "confirm_client_authorization",
297
+ "recheck_public_issue_state",
298
+ "recheck_scope_and_noise",
299
+ "verify_funding_visibility"
300
+ ]
301
+ },
302
+ "reason": { "type": "string", "minLength": 1 },
303
+ "evidence_checklist": {
304
+ "type": "array",
305
+ "items": { "type": "string", "minLength": 1 },
306
+ "minItems": 1
307
+ },
308
+ "recommended_next_step": { "type": "string", "minLength": 1 },
309
+ "blocked_actions": { "$ref": "#/$defs/blocked_actions" }
310
+ },
311
+ "additionalProperties": false
312
+ },
313
+ "risk_level": {
314
+ "enum": ["low", "medium", "high"]
315
+ },
316
+ "safe_requirements": {
317
+ "type": "object",
318
+ "required": [
319
+ "network_required",
320
+ "github_write_permission_required",
321
+ "external_model_required",
322
+ "billing_required"
323
+ ],
324
+ "properties": {
325
+ "network_required": { "const": false },
326
+ "github_write_permission_required": { "const": false },
327
+ "external_model_required": { "const": false },
328
+ "billing_required": { "const": false }
329
+ },
330
+ "additionalProperties": false
331
+ }
332
+ }
333
+ }
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://patchrail.dev/schemas/funded-issues-recheck-summary.v1.schema.json",
4
+ "title": "PatchRail Funded Issues Recheck Summary",
5
+ "description": "Read-only summary of applying recheck observations to a funded-issues tracker store, emitted by patchrail funded-issues apply-recheck. Records state transitions only; never triggers a third-party write.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "source_schema_version",
10
+ "read_only",
11
+ "blocked_actions",
12
+ "requirements",
13
+ "store",
14
+ "input",
15
+ "now",
16
+ "stale_after_days",
17
+ "dry_run",
18
+ "total_entries",
19
+ "summary"
20
+ ],
21
+ "properties": {
22
+ "schema_version": {
23
+ "const": "patchrail.funded_issues.recheck_summary.v1"
24
+ },
25
+ "source_schema_version": {
26
+ "const": "patchrail.funded_issues.v1"
27
+ },
28
+ "read_only": {
29
+ "const": true
30
+ },
31
+ "blocked_actions": {
32
+ "$ref": "#/$defs/blocked_actions"
33
+ },
34
+ "requirements": {
35
+ "$ref": "#/$defs/safe_requirements"
36
+ },
37
+ "store": {
38
+ "type": "string"
39
+ },
40
+ "input": {
41
+ "type": "string"
42
+ },
43
+ "now": {
44
+ "type": "string"
45
+ },
46
+ "stale_after_days": {
47
+ "type": "integer",
48
+ "minimum": 0
49
+ },
50
+ "dry_run": {
51
+ "type": "boolean"
52
+ },
53
+ "total_entries": {
54
+ "type": "integer",
55
+ "minimum": 0
56
+ },
57
+ "summary": {
58
+ "$ref": "#/$defs/recheck_summary"
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "$defs": {
63
+ "blocked_actions": {
64
+ "type": "array",
65
+ "contains": { "const": "automatic_claims" },
66
+ "items": {
67
+ "enum": [
68
+ "automatic_claims",
69
+ "automatic_pull_requests",
70
+ "automatic_issue_comments",
71
+ "mass_outreach",
72
+ "ranking_by_money_only"
73
+ ]
74
+ },
75
+ "uniqueItems": true
76
+ },
77
+ "safe_requirements": {
78
+ "type": "object",
79
+ "required": [
80
+ "network_required",
81
+ "github_write_permission_required",
82
+ "external_model_required",
83
+ "billing_required"
84
+ ],
85
+ "properties": {
86
+ "network_required": { "const": false },
87
+ "github_write_permission_required": { "const": false },
88
+ "external_model_required": { "const": false },
89
+ "billing_required": { "const": false }
90
+ },
91
+ "additionalProperties": false
92
+ },
93
+ "recheck_summary": {
94
+ "type": "object",
95
+ "required": [
96
+ "checked",
97
+ "matched",
98
+ "unmatched",
99
+ "transitions",
100
+ "unchanged",
101
+ "transition_log"
102
+ ],
103
+ "properties": {
104
+ "checked": { "type": "integer", "minimum": 0 },
105
+ "matched": { "type": "integer", "minimum": 0 },
106
+ "unmatched": { "type": "integer", "minimum": 0 },
107
+ "unchanged": { "type": "integer", "minimum": 0 },
108
+ "transitions": {
109
+ "type": "object",
110
+ "required": ["to_closed", "to_stale", "to_active"],
111
+ "properties": {
112
+ "to_closed": { "type": "integer", "minimum": 0 },
113
+ "to_stale": { "type": "integer", "minimum": 0 },
114
+ "to_active": { "type": "integer", "minimum": 0 }
115
+ },
116
+ "additionalProperties": false
117
+ },
118
+ "transition_log": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "object",
122
+ "required": ["url", "state", "at", "from"],
123
+ "properties": {
124
+ "url": { "type": "string" },
125
+ "state": { "type": "string" },
126
+ "at": { "type": "string" },
127
+ "from": { "type": ["string", "null"] }
128
+ },
129
+ "additionalProperties": false
130
+ }
131
+ }
132
+ },
133
+ "additionalProperties": false
134
+ }
135
+ }
136
+ }