-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_issues.py
More file actions
176 lines (133 loc) · 5.58 KB
/
Copy pathcreate_issues.py
File metadata and controls
176 lines (133 loc) · 5.58 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
import subprocess
import json
import re
import sys
repo = "rhamenator/Project-Copperfin"
# 1. Fetch current issues to check for existing titles
print("Fetching current issues...")
cmd = ["gh", "issue", "list", "-R", repo, "--limit", "300", "--state", "all", "--json", "number,title,url"]
res = subprocess.run(cmd, capture_output=True, text=True, check=True)
issues = json.loads(res.stdout, strict=False)
existing_titles = {iss["title"].strip() for iss in issues}
print(f"Found {len(existing_titles)} existing issues.")
# Exact titles to create
titles = [
"Polyglot Contract v1: define schema, versioning, and compatibility rules",
"Dispatch Registry: implement capability route-state lifecycle (off/shadow/canary/on/retire-legacy)",
"Bridge Invocation Semantics: timeout, cancellation propagation, and fallback matrix",
"Shadow Mode Parity Comparator: diff native vs candidate outputs with mismatch telemetry",
"Polyglot Telemetry & Diagnostics: route decisions, fallback reasons, and migration outcomes",
"Developer Migration Playbook: leaf-unit-first replacement workflow and promotion gates"
]
issue_bodies = {
"Polyglot Contract v1: define schema, versioning, and compatibility rules": """## Summary
Canonical contract artifact for capability id, typed envelopes, execution budget, fallback, observability fields.
Child of #4700.
## Scope
Contract document + machine-readable schema + validator tests.
## Acceptance Criteria
Schema validates required fields; semantic version compatibility policy documented; examples for success/error envelopes.
## Non-Goals
Runtime routing implementation.
## Traceability
Follow-up to #4700.""",
"Dispatch Registry: implement capability route-state lifecycle (off/shadow/canary/on/retire-legacy)": """## Summary
Route each capability by state with deterministic selection behavior.
Child of #4700.
## Scope
Registry model, config loading, route decision function, unit tests.
## Acceptance Criteria
All five states test-covered; invalid state/config errors explicit; default safe state off when config absent.
## Non-Goals
Bridge invocation mechanics.
## Traceability
Child of #4700.""",
"Bridge Invocation Semantics: timeout, cancellation propagation, and fallback matrix": """## Summary
Implement bridge call semantics aligned with runtime concurrency/cancel behavior from #272.
Child of #4700.
## Scope
Timeout handling, cancellation token propagation, fallback policy application.
## Acceptance Criteria
Tests for timeout/cancel/failure classes map to configured fallback; deterministic error mapping emitted.
## Non-Goals
Shadow parity comparator UX.
## Traceability
References #272 and #4700.""",
"Shadow Mode Parity Comparator: diff native vs candidate outputs with mismatch telemetry": """## Summary
Support shadow routing by executing both paths and comparing outputs while returning native.
Child of #4700.
## Scope
Comparator rules, mismatch categories, tolerance knobs, telemetry events.
## Acceptance Criteria
Parity pass/fail metrics emitted; mismatch samples include capability id + reason; no behavior change to caller in shadow mode.
## Non-Goals
Canary traffic policy.
## Traceability
Child of #4700.""",
"Polyglot Telemetry & Diagnostics: route decisions, fallback reasons, and migration outcomes": """## Summary
Standardize event taxonomy for migration visibility and operability.
Child of #4700.
## Scope
Event names/fields, diagnostics formatting, integration with existing runtime event streams.
## Acceptance Criteria
Route decision + fallback + parity mismatch + latency outcomes observable in tests; docs include event contract table.
## Non-Goals
Policy engine redesign.
## Traceability
Child of #4700.""",
"Developer Migration Playbook: leaf-unit-first replacement workflow and promotion gates": """## Summary
Step-by-step process teams can execute from off to retire-legacy.
Child of #4700.
## Scope
Workflow guide, checklists, sample capability migration, CI parity gate criteria.
## Acceptance Criteria
Docs include rollback procedure, promotion thresholds, required evidence for each state transition.
## Non-Goals
Automatic migration tooling.
## Traceability
Child of #4700."""
}
created_issues = []
for t in titles:
body = issue_bodies[t]
# Check if title exists
final_title = t
if final_title in existing_titles:
final_title = t + " (slice)"
print(f"Title already exists, renaming to: {final_title}")
print(f"Creating issue: {final_title}")
create_cmd = [
"gh", "issue", "create",
"-R", repo,
"--title", final_title,
"--body", body
]
res_create = subprocess.run(create_cmd, capture_output=True, text=True, check=True)
out_url = res_create.stdout.strip()
print(f"Created: {out_url}")
# Extract issue number from url
num = out_url.split("/")[-1]
created_issues.append({
"number": num,
"title": final_title,
"url": out_url
})
# Now post comment to issue #4700
comment_body = "Child issue plan (recommended order):\n"
for idx, iss in enumerate(created_issues, 1):
comment_body += f"{idx}. {iss['url']}\n"
print("Posting comment to #4700...")
comment_cmd = [
"gh", "issue", "comment", "4700",
"-R", repo,
"--body", comment_body
]
res_comment = subprocess.run(comment_cmd, capture_output=True, text=True, check=True)
comment_url = res_comment.stdout.strip()
print(f"Comment posted: {comment_url}")
print("\n--- RESULTS ---")
for iss in created_issues:
print(f"Issue Number: {iss['number']}")
print(f"Title: {iss['title']}")
print(f"URL: {iss['url']}\n")
print(f"Comment URL: {comment_url}")