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,953 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://patchrail.dev/schemas/funded-issues-shortlist.v1.schema.json",
4
+ "title": "PatchRail Funded Issues Shortlist",
5
+ "description": "Read-only decision-support shortlist emitted by patchrail funded-issues shortlist.",
6
+ "type": "object",
7
+ "required": [
8
+ "schema_version",
9
+ "source_schema_version",
10
+ "read_only",
11
+ "safe_only",
12
+ "limit",
13
+ "blocked_actions",
14
+ "filters",
15
+ "summary",
16
+ "shortlist",
17
+ "no_go_evidence",
18
+ "no_go_moat",
19
+ "decision_summary",
20
+ "delivery_budget",
21
+ "delivery_pack",
22
+ "source_quality",
23
+ "recheck_plan",
24
+ "evidence_debt",
25
+ "client_fit_summary",
26
+ "client_fit_gaps",
27
+ "intake_followup",
28
+ "cash_path_status",
29
+ "operator_next_steps",
30
+ "requirements",
31
+ "boundary"
32
+ ],
33
+ "properties": {
34
+ "schema_version": {
35
+ "const": "patchrail.funded_issues.shortlist.v1"
36
+ },
37
+ "source_schema_version": {
38
+ "const": "patchrail.funded_issues.v1"
39
+ },
40
+ "read_only": {
41
+ "const": true
42
+ },
43
+ "safe_only": {
44
+ "type": "boolean"
45
+ },
46
+ "limit": {
47
+ "type": "integer",
48
+ "minimum": 1
49
+ },
50
+ "blocked_actions": {
51
+ "$ref": "#/$defs/blocked_actions"
52
+ },
53
+ "filters": {
54
+ "$ref": "#/$defs/filters"
55
+ },
56
+ "summary": {
57
+ "type": "object",
58
+ "required": [
59
+ "total_loaded",
60
+ "total_scored",
61
+ "rating_counts",
62
+ "in_scope",
63
+ "safe_to_list",
64
+ "high_risk",
65
+ "opportunity_states"
66
+ ],
67
+ "properties": {
68
+ "total_loaded": { "type": "integer", "minimum": 0 },
69
+ "total_scored": { "type": "integer", "minimum": 0 },
70
+ "rating_counts": { "$ref": "#/$defs/count_map" },
71
+ "in_scope": { "type": "integer", "minimum": 0 },
72
+ "safe_to_list": { "type": "integer", "minimum": 0 },
73
+ "high_risk": { "type": "integer", "minimum": 0 },
74
+ "opportunity_states": { "$ref": "#/$defs/count_map" }
75
+ },
76
+ "additionalProperties": false
77
+ },
78
+ "shortlist": {
79
+ "type": "array",
80
+ "items": { "$ref": "#/$defs/scored_issue" }
81
+ },
82
+ "no_go_evidence": {
83
+ "type": "array",
84
+ "items": { "$ref": "#/$defs/scored_issue" }
85
+ },
86
+ "no_go_moat": {
87
+ "$ref": "#/$defs/no_go_moat"
88
+ },
89
+ "decision_summary": {
90
+ "$ref": "#/$defs/decision_summary"
91
+ },
92
+ "delivery_budget": {
93
+ "$ref": "#/$defs/delivery_budget"
94
+ },
95
+ "delivery_pack": {
96
+ "$ref": "#/$defs/delivery_pack"
97
+ },
98
+ "source_quality": {
99
+ "$ref": "#/$defs/source_quality"
100
+ },
101
+ "recheck_plan": {
102
+ "$ref": "#/$defs/recheck_plan"
103
+ },
104
+ "evidence_debt": {
105
+ "$ref": "#/$defs/evidence_debt"
106
+ },
107
+ "client_fit_summary": {
108
+ "$ref": "#/$defs/client_fit_summary"
109
+ },
110
+ "client_fit_gaps": {
111
+ "$ref": "#/$defs/client_fit_gaps"
112
+ },
113
+ "intake_followup": {
114
+ "$ref": "#/$defs/intake_followup"
115
+ },
116
+ "cash_path_status": {
117
+ "$ref": "#/$defs/cash_path_status"
118
+ },
119
+ "operator_next_steps": {
120
+ "$ref": "#/$defs/operator_next_steps"
121
+ },
122
+ "requirements": {
123
+ "$ref": "#/$defs/safe_requirements"
124
+ },
125
+ "boundary": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ }
129
+ },
130
+ "additionalProperties": false,
131
+ "$defs": {
132
+ "blocked_actions": {
133
+ "type": "array",
134
+ "contains": { "const": "automatic_claims" },
135
+ "items": {
136
+ "enum": [
137
+ "automatic_claims",
138
+ "automatic_pull_requests",
139
+ "automatic_issue_comments",
140
+ "mass_outreach",
141
+ "ranking_by_money_only"
142
+ ]
143
+ },
144
+ "uniqueItems": true
145
+ },
146
+ "count_map": {
147
+ "type": "object",
148
+ "additionalProperties": {
149
+ "type": "integer",
150
+ "minimum": 0
151
+ }
152
+ },
153
+ "filters": {
154
+ "type": "object",
155
+ "required": [
156
+ "profile",
157
+ "platform",
158
+ "language",
159
+ "min_usd",
160
+ "opportunity_state",
161
+ "risk_level"
162
+ ],
163
+ "properties": {
164
+ "profile": {
165
+ "anyOf": [
166
+ { "$ref": "#/$defs/client_profile" },
167
+ { "type": "null" }
168
+ ]
169
+ },
170
+ "platform": { "type": ["string", "null"] },
171
+ "language": { "type": ["string", "null"] },
172
+ "min_usd": { "type": ["number", "null"], "minimum": 0 },
173
+ "opportunity_state": { "anyOf": [{ "$ref": "#/$defs/opportunity_state" }, { "type": "null" }] },
174
+ "risk_level": { "anyOf": [{ "$ref": "#/$defs/risk_level" }, { "type": "null" }] }
175
+ },
176
+ "additionalProperties": false
177
+ },
178
+ "client_profile": {
179
+ "type": "object",
180
+ "required": [
181
+ "schema_version",
182
+ "name",
183
+ "languages",
184
+ "min_usd",
185
+ "allowed_opportunity_states",
186
+ "allowed_risk_levels",
187
+ "excluded_risk_flags",
188
+ "read_only"
189
+ ],
190
+ "properties": {
191
+ "schema_version": {
192
+ "const": "patchrail.funded_issues.client_profile.v1"
193
+ },
194
+ "name": { "type": ["string", "null"] },
195
+ "languages": {
196
+ "type": "array",
197
+ "items": { "type": "string" }
198
+ },
199
+ "min_usd": { "type": ["number", "null"], "minimum": 0 },
200
+ "allowed_opportunity_states": {
201
+ "type": "array",
202
+ "items": { "$ref": "#/$defs/opportunity_state" }
203
+ },
204
+ "allowed_risk_levels": {
205
+ "type": "array",
206
+ "items": { "$ref": "#/$defs/risk_level" }
207
+ },
208
+ "excluded_risk_flags": {
209
+ "type": "array",
210
+ "items": { "type": "string", "minLength": 1 }
211
+ },
212
+ "read_only": { "const": true }
213
+ },
214
+ "additionalProperties": false
215
+ },
216
+ "funded_issue": {
217
+ "type": "object",
218
+ "required": [
219
+ "id",
220
+ "platform",
221
+ "repository",
222
+ "issue_number",
223
+ "reference",
224
+ "title",
225
+ "url",
226
+ "funding",
227
+ "language",
228
+ "labels",
229
+ "contribution_signals",
230
+ "risk_flags",
231
+ "risk_level",
232
+ "safe_to_list",
233
+ "source_review",
234
+ "opportunity_state",
235
+ "maintainer_permission",
236
+ "contribution_guidelines_url",
237
+ "read_only",
238
+ "blocked_actions"
239
+ ],
240
+ "properties": {
241
+ "id": { "type": "string", "minLength": 1 },
242
+ "platform": { "type": "string", "minLength": 1 },
243
+ "repository": { "type": "string", "minLength": 1 },
244
+ "issue_number": { "type": ["integer", "null"], "minimum": 0 },
245
+ "reference": { "type": "string", "minLength": 1 },
246
+ "title": { "type": "string", "minLength": 1 },
247
+ "url": { "type": "string", "format": "uri" },
248
+ "funding": {
249
+ "type": "object",
250
+ "required": ["amount", "currency", "display"],
251
+ "properties": {
252
+ "amount": { "type": ["number", "null"] },
253
+ "currency": { "type": ["string", "null"] },
254
+ "display": { "type": "string", "minLength": 1 }
255
+ },
256
+ "additionalProperties": false
257
+ },
258
+ "language": { "type": ["string", "null"] },
259
+ "labels": {
260
+ "type": "array",
261
+ "items": { "type": "string" }
262
+ },
263
+ "contribution_signals": {
264
+ "type": "array",
265
+ "items": { "type": "string" }
266
+ },
267
+ "risk_flags": {
268
+ "type": "array",
269
+ "items": { "type": "string" }
270
+ },
271
+ "risk_level": { "enum": ["low", "medium", "high"] },
272
+ "safe_to_list": { "type": "boolean" },
273
+ "source_review": { "$ref": "#/$defs/source_review" },
274
+ "opportunity_state": { "$ref": "#/$defs/opportunity_state" },
275
+ "maintainer_permission": { "type": "string", "minLength": 1 },
276
+ "contribution_guidelines_url": { "type": ["string", "null"], "format": "uri" },
277
+ "read_only": { "const": true },
278
+ "blocked_actions": { "$ref": "#/$defs/blocked_actions" }
279
+ },
280
+ "additionalProperties": false
281
+ },
282
+ "source_review": {
283
+ "type": "object",
284
+ "required": [
285
+ "primary_source_required",
286
+ "risk_flags",
287
+ "required_before_shortlist",
288
+ "next_step"
289
+ ],
290
+ "properties": {
291
+ "primary_source_required": { "type": "boolean" },
292
+ "risk_flags": {
293
+ "type": "array",
294
+ "items": {
295
+ "enum": [
296
+ "aggregator_only_source",
297
+ "discovery_only_source",
298
+ "primary_source_required"
299
+ ]
300
+ },
301
+ "uniqueItems": true
302
+ },
303
+ "required_before_shortlist": { "type": "boolean" },
304
+ "next_step": { "type": "string", "minLength": 1 }
305
+ },
306
+ "additionalProperties": false
307
+ },
308
+ "no_go_moat": {
309
+ "type": "object",
310
+ "required": [
311
+ "high_risk_or_excluded",
312
+ "missing_contribution_guidelines",
313
+ "ambiguous_scope",
314
+ "spam_attractive",
315
+ "funding_unknown",
316
+ "stale_or_closed"
317
+ ],
318
+ "properties": {
319
+ "high_risk_or_excluded": { "type": "integer", "minimum": 0 },
320
+ "missing_contribution_guidelines": { "type": "integer", "minimum": 0 },
321
+ "ambiguous_scope": { "type": "integer", "minimum": 0 },
322
+ "spam_attractive": { "type": "integer", "minimum": 0 },
323
+ "funding_unknown": { "type": "integer", "minimum": 0 },
324
+ "stale_or_closed": { "type": "integer", "minimum": 0 }
325
+ },
326
+ "additionalProperties": false
327
+ },
328
+ "decision_summary": {
329
+ "type": "object",
330
+ "required": [
331
+ "total_rows",
332
+ "candidate_rows",
333
+ "no_go_rows",
334
+ "gate_counts",
335
+ "verification_needed",
336
+ "authorization_needed",
337
+ "recommended_batch_action",
338
+ "safety_boundary"
339
+ ],
340
+ "properties": {
341
+ "total_rows": { "type": "integer", "minimum": 0 },
342
+ "candidate_rows": { "type": "integer", "minimum": 0 },
343
+ "no_go_rows": { "type": "integer", "minimum": 0 },
344
+ "gate_counts": { "$ref": "#/$defs/count_map" },
345
+ "verification_needed": { "type": "integer", "minimum": 0 },
346
+ "authorization_needed": { "type": "integer", "minimum": 0 },
347
+ "recommended_batch_action": { "type": "string", "minLength": 1 },
348
+ "safety_boundary": { "type": "string", "minLength": 1 }
349
+ },
350
+ "additionalProperties": false
351
+ },
352
+ "delivery_budget": {
353
+ "type": "object",
354
+ "required": [
355
+ "suggested_package",
356
+ "estimated_review_minutes",
357
+ "estimated_review_hours",
358
+ "max_paid_hours",
359
+ "within_margin_budget",
360
+ "analysis_rows",
361
+ "boundary"
362
+ ],
363
+ "properties": {
364
+ "suggested_package": {
365
+ "enum": [
366
+ "none",
367
+ "mini_diagnostic",
368
+ "validation_sprint",
369
+ "opportunity_shortlist",
370
+ "custom_batch"
371
+ ]
372
+ },
373
+ "estimated_review_minutes": { "type": "integer", "minimum": 0 },
374
+ "estimated_review_hours": { "type": "number", "minimum": 0 },
375
+ "max_paid_hours": { "type": ["number", "null"], "minimum": 0 },
376
+ "within_margin_budget": { "type": "boolean" },
377
+ "analysis_rows": {
378
+ "type": "object",
379
+ "required": [
380
+ "l1_state_and_noise_review",
381
+ "l2_scope_and_readiness_review",
382
+ "l3_deep_dive_deferred"
383
+ ],
384
+ "properties": {
385
+ "l1_state_and_noise_review": { "type": "integer", "minimum": 0 },
386
+ "l2_scope_and_readiness_review": { "type": "integer", "minimum": 0 },
387
+ "l3_deep_dive_deferred": { "type": "integer", "minimum": 0 }
388
+ },
389
+ "additionalProperties": false
390
+ },
391
+ "boundary": { "type": "string", "minLength": 1 }
392
+ },
393
+ "additionalProperties": false
394
+ },
395
+ "delivery_pack": {
396
+ "type": "object",
397
+ "required": [
398
+ "suggested_package",
399
+ "phase_counts",
400
+ "phases",
401
+ "handoff",
402
+ "boundary"
403
+ ],
404
+ "properties": {
405
+ "suggested_package": {
406
+ "enum": [
407
+ "none",
408
+ "mini_diagnostic",
409
+ "validation_sprint",
410
+ "opportunity_shortlist",
411
+ "custom_batch"
412
+ ]
413
+ },
414
+ "phase_counts": { "$ref": "#/$defs/count_map" },
415
+ "phases": {
416
+ "type": "array",
417
+ "items": { "$ref": "#/$defs/delivery_phase" }
418
+ },
419
+ "handoff": { "$ref": "#/$defs/delivery_handoff" },
420
+ "boundary": { "type": "string", "minLength": 1 }
421
+ },
422
+ "additionalProperties": false
423
+ },
424
+ "delivery_phase": {
425
+ "type": "object",
426
+ "required": ["phase", "row_count", "references", "objective", "exit_criteria"],
427
+ "properties": {
428
+ "phase": {
429
+ "enum": [
430
+ "l1_state_and_noise_review",
431
+ "l2_shortlist_readiness_review",
432
+ "l3_deep_dive_deferred"
433
+ ]
434
+ },
435
+ "row_count": { "type": "integer", "minimum": 0 },
436
+ "references": {
437
+ "type": "array",
438
+ "items": { "type": "string", "minLength": 1 }
439
+ },
440
+ "objective": { "type": "string", "minLength": 1 },
441
+ "exit_criteria": { "type": "string", "minLength": 1 }
442
+ },
443
+ "additionalProperties": false
444
+ },
445
+ "delivery_handoff": {
446
+ "type": "object",
447
+ "required": [
448
+ "candidate_references",
449
+ "verification_references",
450
+ "no_go_references"
451
+ ],
452
+ "properties": {
453
+ "candidate_references": {
454
+ "type": "array",
455
+ "items": { "type": "string", "minLength": 1 }
456
+ },
457
+ "verification_references": {
458
+ "type": "array",
459
+ "items": { "type": "string", "minLength": 1 }
460
+ },
461
+ "no_go_references": {
462
+ "type": "array",
463
+ "items": { "type": "string", "minLength": 1 }
464
+ }
465
+ },
466
+ "additionalProperties": false
467
+ },
468
+ "source_quality": {
469
+ "type": "object",
470
+ "required": ["summary", "sources", "boundary"],
471
+ "properties": {
472
+ "summary": { "$ref": "#/$defs/source_quality_summary" },
473
+ "sources": {
474
+ "type": "object",
475
+ "additionalProperties": { "$ref": "#/$defs/source_quality_source" }
476
+ },
477
+ "boundary": { "type": "string", "minLength": 1 }
478
+ },
479
+ "additionalProperties": false
480
+ },
481
+ "source_quality_summary": {
482
+ "type": "object",
483
+ "required": [
484
+ "source_count",
485
+ "total_rows",
486
+ "candidate_rows",
487
+ "no_go_rows",
488
+ "candidate_source_count",
489
+ "no_go_only_source_count",
490
+ "funding_verification_needed",
491
+ "authorization_needed",
492
+ "status",
493
+ "next_tracker_action",
494
+ "boundary"
495
+ ],
496
+ "properties": {
497
+ "source_count": { "type": "integer", "minimum": 0 },
498
+ "total_rows": { "type": "integer", "minimum": 0 },
499
+ "candidate_rows": { "type": "integer", "minimum": 0 },
500
+ "no_go_rows": { "type": "integer", "minimum": 0 },
501
+ "candidate_source_count": { "type": "integer", "minimum": 0 },
502
+ "no_go_only_source_count": { "type": "integer", "minimum": 0 },
503
+ "funding_verification_needed": { "type": "integer", "minimum": 0 },
504
+ "authorization_needed": { "type": "integer", "minimum": 0 },
505
+ "status": {
506
+ "enum": [
507
+ "candidate_sources_available",
508
+ "collect_more_rows",
509
+ "needs_authorization",
510
+ "needs_funding_verification",
511
+ "no_go_only_sources",
512
+ "no_sources"
513
+ ]
514
+ },
515
+ "next_tracker_action": { "type": "string", "minLength": 1 },
516
+ "boundary": { "type": "string", "minLength": 1 }
517
+ },
518
+ "additionalProperties": false
519
+ },
520
+ "source_quality_source": {
521
+ "type": "object",
522
+ "required": [
523
+ "total_rows",
524
+ "candidate_rows",
525
+ "no_go_rows",
526
+ "safe_to_list",
527
+ "funding_verification_needed",
528
+ "authorization_needed",
529
+ "average_score",
530
+ "usable_signal_ratio",
531
+ "recommended_use"
532
+ ],
533
+ "properties": {
534
+ "total_rows": { "type": "integer", "minimum": 0 },
535
+ "candidate_rows": { "type": "integer", "minimum": 0 },
536
+ "no_go_rows": { "type": "integer", "minimum": 0 },
537
+ "safe_to_list": { "type": "integer", "minimum": 0 },
538
+ "funding_verification_needed": { "type": "integer", "minimum": 0 },
539
+ "authorization_needed": { "type": "integer", "minimum": 0 },
540
+ "average_score": { "type": "number", "minimum": 0, "maximum": 100 },
541
+ "usable_signal_ratio": { "type": "number", "minimum": 0, "maximum": 1 },
542
+ "recommended_use": { "type": "string", "minLength": 1 }
543
+ },
544
+ "additionalProperties": false
545
+ },
546
+ "recheck_plan": {
547
+ "type": "object",
548
+ "required": [
549
+ "total_rows",
550
+ "recheck_rows",
551
+ "no_go_rows",
552
+ "priority_counts",
553
+ "action_counts",
554
+ "next_rows",
555
+ "boundary"
556
+ ],
557
+ "properties": {
558
+ "total_rows": { "type": "integer", "minimum": 0 },
559
+ "recheck_rows": { "type": "integer", "minimum": 0 },
560
+ "no_go_rows": { "type": "integer", "minimum": 0 },
561
+ "priority_counts": { "$ref": "#/$defs/count_map" },
562
+ "action_counts": { "$ref": "#/$defs/count_map" },
563
+ "next_rows": {
564
+ "type": "array",
565
+ "items": { "$ref": "#/$defs/recheck_row" }
566
+ },
567
+ "boundary": { "type": "string", "minLength": 1 }
568
+ },
569
+ "additionalProperties": false
570
+ },
571
+ "evidence_debt": {
572
+ "type": "object",
573
+ "required": [
574
+ "status",
575
+ "blocking_rows",
576
+ "archive_only_rows",
577
+ "highest_priority",
578
+ "next_action",
579
+ "action_counts",
580
+ "platform_counts",
581
+ "priority_counts",
582
+ "references",
583
+ "payment_route_allowed_now",
584
+ "external_body_allowed",
585
+ "boundary"
586
+ ],
587
+ "properties": {
588
+ "status": { "enum": ["active_evidence_debt", "clear"] },
589
+ "blocking_rows": { "type": "integer", "minimum": 0 },
590
+ "archive_only_rows": { "type": "integer", "minimum": 0 },
591
+ "highest_priority": { "enum": ["high", "medium", "low", "none"] },
592
+ "next_action": {
593
+ "enum": [
594
+ "confirm_client_authorization",
595
+ "ready_for_delivery_readiness_review",
596
+ "recheck_public_issue_state",
597
+ "recheck_scope_and_noise",
598
+ "verify_funding_visibility"
599
+ ]
600
+ },
601
+ "action_counts": { "$ref": "#/$defs/count_map" },
602
+ "platform_counts": { "$ref": "#/$defs/count_map" },
603
+ "priority_counts": { "$ref": "#/$defs/count_map" },
604
+ "references": {
605
+ "type": "array",
606
+ "items": { "type": "string", "minLength": 1 }
607
+ },
608
+ "payment_route_allowed_now": { "const": false },
609
+ "external_body_allowed": { "const": false },
610
+ "boundary": { "type": "string", "minLength": 1 }
611
+ },
612
+ "additionalProperties": false
613
+ },
614
+ "recheck_row": {
615
+ "type": "object",
616
+ "required": [
617
+ "reference",
618
+ "platform",
619
+ "decision_gate",
620
+ "priority",
621
+ "action",
622
+ "reason"
623
+ ],
624
+ "properties": {
625
+ "reference": { "type": "string", "minLength": 1 },
626
+ "platform": { "type": "string", "minLength": 1 },
627
+ "decision_gate": {
628
+ "enum": [
629
+ "go_after_recheck",
630
+ "needs_authorization",
631
+ "needs_funding_verification",
632
+ "no_go",
633
+ "watchlist"
634
+ ]
635
+ },
636
+ "priority": { "enum": ["high", "medium", "low", "none"] },
637
+ "action": {
638
+ "enum": [
639
+ "archive_as_no_go_evidence",
640
+ "confirm_client_authorization",
641
+ "recheck_public_issue_state",
642
+ "recheck_scope_and_noise",
643
+ "verify_funding_visibility"
644
+ ]
645
+ },
646
+ "reason": { "type": "string", "minLength": 1 }
647
+ },
648
+ "additionalProperties": false
649
+ },
650
+ "client_fit_gaps": {
651
+ "type": "array",
652
+ "items": { "$ref": "#/$defs/client_fit_gap" }
653
+ },
654
+ "client_fit_summary": {
655
+ "type": "object",
656
+ "required": [
657
+ "profile_name",
658
+ "status",
659
+ "total_rows",
660
+ "matching_rows",
661
+ "excluded_rows",
662
+ "gap_counts",
663
+ "recommended_action",
664
+ "boundary"
665
+ ],
666
+ "properties": {
667
+ "profile_name": { "type": ["string", "null"], "minLength": 1 },
668
+ "status": {
669
+ "enum": [
670
+ "all_rows_match",
671
+ "no_matching_rows",
672
+ "no_profile",
673
+ "no_rows",
674
+ "partial_match"
675
+ ]
676
+ },
677
+ "total_rows": { "type": "integer", "minimum": 0 },
678
+ "matching_rows": { "type": "integer", "minimum": 0 },
679
+ "excluded_rows": { "type": "integer", "minimum": 0 },
680
+ "gap_counts": { "$ref": "#/$defs/count_map" },
681
+ "recommended_action": { "type": "string", "minLength": 1 },
682
+ "boundary": { "type": "string", "minLength": 1 }
683
+ },
684
+ "additionalProperties": false
685
+ },
686
+ "client_fit_gap": {
687
+ "type": "object",
688
+ "required": ["reference", "title", "url", "platform", "gap_codes", "gap_summary"],
689
+ "properties": {
690
+ "reference": { "type": "string", "minLength": 1 },
691
+ "title": { "type": "string", "minLength": 1 },
692
+ "url": { "type": "string", "format": "uri" },
693
+ "platform": { "type": "string", "minLength": 1 },
694
+ "gap_codes": {
695
+ "type": "array",
696
+ "items": { "type": "string", "minLength": 1 },
697
+ "minItems": 1
698
+ },
699
+ "gap_summary": { "type": "string", "minLength": 1 }
700
+ },
701
+ "additionalProperties": false
702
+ },
703
+ "intake_followup": {
704
+ "type": "object",
705
+ "required": [
706
+ "status",
707
+ "suggested_package",
708
+ "required_before_paid_delivery",
709
+ "requested_fields",
710
+ "next_internal_action",
711
+ "boundary"
712
+ ],
713
+ "properties": {
714
+ "status": {
715
+ "enum": [
716
+ "needs_buyer_intake",
717
+ "needs_source_expansion",
718
+ "ready_after_read_only_recheck",
719
+ "ready_for_scope_confirmation"
720
+ ]
721
+ },
722
+ "suggested_package": {
723
+ "enum": [
724
+ "none",
725
+ "mini_diagnostic",
726
+ "validation_sprint",
727
+ "opportunity_shortlist",
728
+ "custom_batch"
729
+ ]
730
+ },
731
+ "required_before_paid_delivery": { "type": "integer", "minimum": 0 },
732
+ "requested_fields": {
733
+ "type": "array",
734
+ "items": { "$ref": "#/$defs/intake_field" }
735
+ },
736
+ "next_internal_action": { "type": "string", "minLength": 1 },
737
+ "boundary": { "type": "string", "minLength": 1 }
738
+ },
739
+ "additionalProperties": false
740
+ },
741
+ "cash_path_status": {
742
+ "type": "object",
743
+ "required": [
744
+ "status",
745
+ "next_revenue_action",
746
+ "copy_brief_facts_available",
747
+ "payment_route_allowed_now",
748
+ "requires_written_acceptance_before_payment_route",
749
+ "buyer_ready",
750
+ "boundary"
751
+ ],
752
+ "properties": {
753
+ "status": {
754
+ "enum": [
755
+ "needs_buyer_intake",
756
+ "needs_source_expansion",
757
+ "ready_after_read_only_recheck",
758
+ "ready_for_scope_confirmation"
759
+ ]
760
+ },
761
+ "next_revenue_action": {
762
+ "enum": [
763
+ "collect_buyer_intake",
764
+ "expand_permitted_sources",
765
+ "run_read_only_recheck",
766
+ "confirm_paid_scope"
767
+ ]
768
+ },
769
+ "copy_brief_facts_available": { "type": "boolean" },
770
+ "payment_route_allowed_now": { "const": false },
771
+ "requires_written_acceptance_before_payment_route": { "const": true },
772
+ "buyer_ready": { "type": "boolean" },
773
+ "boundary": { "type": "string", "minLength": 1 }
774
+ },
775
+ "additionalProperties": false
776
+ },
777
+ "operator_next_steps": {
778
+ "type": "object",
779
+ "required": [
780
+ "schema_version",
781
+ "status",
782
+ "primary_action",
783
+ "copy_brief_facts_available",
784
+ "payment_route_allowed_now",
785
+ "external_body_allowed",
786
+ "steps",
787
+ "boundary"
788
+ ],
789
+ "properties": {
790
+ "schema_version": {
791
+ "const": "patchrail.funded_issues.operator_next_steps.v1"
792
+ },
793
+ "status": {
794
+ "enum": [
795
+ "needs_buyer_intake",
796
+ "needs_source_expansion",
797
+ "ready_after_read_only_recheck",
798
+ "ready_for_scope_confirmation"
799
+ ]
800
+ },
801
+ "primary_action": {
802
+ "enum": [
803
+ "collect_buyer_intake",
804
+ "expand_permitted_sources",
805
+ "run_read_only_recheck",
806
+ "confirm_paid_scope"
807
+ ]
808
+ },
809
+ "copy_brief_facts_available": { "type": "boolean" },
810
+ "payment_route_allowed_now": { "const": false },
811
+ "external_body_allowed": { "const": false },
812
+ "steps": {
813
+ "type": "array",
814
+ "items": { "$ref": "#/$defs/operator_next_step" }
815
+ },
816
+ "boundary": { "type": "string", "minLength": 1 }
817
+ },
818
+ "additionalProperties": false
819
+ },
820
+ "operator_next_step": {
821
+ "type": "object",
822
+ "required": [
823
+ "priority",
824
+ "action",
825
+ "source",
826
+ "reason",
827
+ "reference_scope",
828
+ "evidence_required",
829
+ "blocks_paid_delivery",
830
+ "copy_brief_allowed",
831
+ "external_body_allowed",
832
+ "payment_route_allowed_now",
833
+ "blocked_actions"
834
+ ],
835
+ "properties": {
836
+ "priority": { "enum": ["high", "medium", "low", "none"] },
837
+ "action": {
838
+ "enum": [
839
+ "collect_buyer_intake",
840
+ "confirm_paid_scope",
841
+ "expand_permitted_sources",
842
+ "preserve_no_go_evidence",
843
+ "run_read_only_recheck"
844
+ ]
845
+ },
846
+ "source": {
847
+ "enum": ["cash_path", "delivery_pack", "recheck_plan", "source_quality"]
848
+ },
849
+ "reason": { "type": "string", "minLength": 1 },
850
+ "reference_scope": {
851
+ "type": "array",
852
+ "items": { "type": "string", "minLength": 1 }
853
+ },
854
+ "evidence_required": {
855
+ "type": "array",
856
+ "items": { "type": "string", "minLength": 1 }
857
+ },
858
+ "blocks_paid_delivery": { "type": "boolean" },
859
+ "copy_brief_allowed": { "type": "boolean" },
860
+ "external_body_allowed": { "const": false },
861
+ "payment_route_allowed_now": { "const": false },
862
+ "blocked_actions": { "$ref": "#/$defs/blocked_actions" }
863
+ },
864
+ "additionalProperties": false
865
+ },
866
+ "intake_field": {
867
+ "type": "object",
868
+ "required": ["field", "reason", "required_before_paid_delivery"],
869
+ "properties": {
870
+ "field": { "type": "string", "minLength": 1 },
871
+ "reason": { "type": "string", "minLength": 1 },
872
+ "required_before_paid_delivery": { "type": "boolean" }
873
+ },
874
+ "additionalProperties": false
875
+ },
876
+ "opportunity_state": {
877
+ "enum": ["active", "stale", "closed", "unknown"]
878
+ },
879
+ "risk_level": {
880
+ "enum": ["low", "medium", "high"]
881
+ },
882
+ "safe_requirements": {
883
+ "type": "object",
884
+ "required": [
885
+ "network_required",
886
+ "github_write_permission_required",
887
+ "external_model_required",
888
+ "billing_required"
889
+ ],
890
+ "properties": {
891
+ "network_required": { "const": false },
892
+ "github_write_permission_required": { "const": false },
893
+ "external_model_required": { "const": false },
894
+ "billing_required": { "const": false }
895
+ },
896
+ "additionalProperties": false
897
+ },
898
+ "scored_issue": {
899
+ "type": "object",
900
+ "required": [
901
+ "issue",
902
+ "score",
903
+ "confidence",
904
+ "rating",
905
+ "decision_gate",
906
+ "reason_codes",
907
+ "components",
908
+ "recommended_next_step"
909
+ ],
910
+ "properties": {
911
+ "issue": { "$ref": "#/$defs/funded_issue" },
912
+ "score": { "type": "integer", "minimum": 0, "maximum": 100 },
913
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
914
+ "rating": { "enum": ["go_candidate", "watchlist", "no_go"] },
915
+ "decision_gate": {
916
+ "enum": [
917
+ "go_after_recheck",
918
+ "needs_authorization",
919
+ "needs_funding_verification",
920
+ "no_go",
921
+ "watchlist"
922
+ ]
923
+ },
924
+ "reason_codes": {
925
+ "type": "array",
926
+ "items": { "type": "string", "minLength": 1 }
927
+ },
928
+ "components": {
929
+ "type": "object",
930
+ "required": [
931
+ "base",
932
+ "funding_visible",
933
+ "guidelines_visible",
934
+ "contribution_signals",
935
+ "risk_penalty",
936
+ "safe_boundary_bonus"
937
+ ],
938
+ "properties": {
939
+ "base": { "type": "integer" },
940
+ "funding_visible": { "type": "integer" },
941
+ "guidelines_visible": { "type": "integer" },
942
+ "contribution_signals": { "type": "integer" },
943
+ "risk_penalty": { "type": "integer" },
944
+ "safe_boundary_bonus": { "type": "integer" }
945
+ },
946
+ "additionalProperties": false
947
+ },
948
+ "recommended_next_step": { "type": "string", "minLength": 1 }
949
+ },
950
+ "additionalProperties": false
951
+ }
952
+ }
953
+ }