prizmkit 1.1.91 → 1.1.92
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.
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/lib/branch.sh +8 -5
- package/bundled/dev-pipeline/lib/common.sh +122 -0
- package/bundled/dev-pipeline/lib/heartbeat.sh +13 -3
- package/bundled/dev-pipeline/run-bugfix.sh +150 -39
- package/bundled/dev-pipeline/run-feature.sh +98 -33
- package/bundled/dev-pipeline/run-refactor.sh +150 -39
- package/bundled/dev-pipeline/scripts/update-bug-status.py +39 -4
- package/bundled/dev-pipeline/scripts/update-feature-status.py +43 -6
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +36 -4
- package/bundled/dev-pipeline/tests/test_auto_skip.py +92 -3
- package/bundled/dev-pipeline-windows/lib/branch.ps1 +17 -4
- package/bundled/dev-pipeline-windows/lib/common.ps1 +9 -0
- package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +87 -29
- package/bundled/dev-pipeline-windows/scripts/update-bug-status.py +39 -4
- package/bundled/dev-pipeline-windows/scripts/update-feature-status.py +43 -6
- package/bundled/dev-pipeline-windows/scripts/update-refactor-status.py +36 -4
- package/bundled/skills/_metadata.json +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ Usage:
|
|
|
16
16
|
--refactor-list <path> --state-dir <path> \
|
|
17
17
|
--action <get_next|start|update|status|pause|reset|clean|unskip> \
|
|
18
18
|
[--refactor-id <id>] [--session-status <status>] \
|
|
19
|
-
[--session-id <id>] [--max-retries <n>]
|
|
19
|
+
[--session-id <id>] [--max-retries <n>] [--max-infra-retries <n>]
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
import argparse
|
|
@@ -87,7 +87,8 @@ def parse_args():
|
|
|
87
87
|
help="Session outcome status (required for 'update' action)",
|
|
88
88
|
)
|
|
89
89
|
parser.add_argument("--session-id", default=None, help="Session ID (optional, for 'update' action)")
|
|
90
|
-
parser.add_argument("--max-retries", type=int, default=3, help="Maximum retry count (default: 3)")
|
|
90
|
+
parser.add_argument("--max-retries", type=int, default=3, help="Maximum code retry count (default: 3)")
|
|
91
|
+
parser.add_argument("--max-infra-retries", type=int, default=3, help="Maximum infrastructure retry count (default: 3)")
|
|
91
92
|
parser.add_argument("--project-root", default=None, help="Project root directory. Required for 'clean' action.")
|
|
92
93
|
return parser.parse_args()
|
|
93
94
|
|
|
@@ -103,6 +104,9 @@ def _default_status(refactor_id):
|
|
|
103
104
|
"refactor_id": refactor_id,
|
|
104
105
|
"retry_count": 0,
|
|
105
106
|
"max_retries": 3,
|
|
107
|
+
"max_infra_retries": 3,
|
|
108
|
+
"infra_error_count": 0,
|
|
109
|
+
"last_infra_error_session_id": None,
|
|
106
110
|
"sessions": [],
|
|
107
111
|
"last_session_id": None,
|
|
108
112
|
"resume_from_phase": None,
|
|
@@ -268,6 +272,7 @@ def action_get_next(refactor_list_data, state_dir):
|
|
|
268
272
|
"priority": chosen.get("priority", "medium"),
|
|
269
273
|
"complexity": chosen.get("complexity", "medium"),
|
|
270
274
|
"retry_count": chosen_status_data.get("retry_count", 0),
|
|
275
|
+
"infra_error_count": chosen_status_data.get("infra_error_count", 0),
|
|
271
276
|
"resume_from_phase": chosen_status_data.get("resume_from_phase", None),
|
|
272
277
|
}
|
|
273
278
|
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
@@ -282,6 +287,7 @@ def action_update(args, refactor_list_path, state_dir):
|
|
|
282
287
|
session_status = args.session_status
|
|
283
288
|
session_id = args.session_id
|
|
284
289
|
max_retries = args.max_retries
|
|
290
|
+
max_infra_retries = args.max_infra_retries
|
|
285
291
|
|
|
286
292
|
if not refactor_id:
|
|
287
293
|
error_out("--refactor-id is required for 'update' action")
|
|
@@ -296,6 +302,8 @@ def action_update(args, refactor_list_path, state_dir):
|
|
|
296
302
|
new_status = get_refactor_status_from_list(refactor_list_path, refactor_id)
|
|
297
303
|
|
|
298
304
|
if session_status == "success":
|
|
305
|
+
rs["infra_error_count"] = 0
|
|
306
|
+
rs["last_infra_error_session_id"] = None
|
|
299
307
|
new_status = "completed"
|
|
300
308
|
rs["resume_from_phase"] = None
|
|
301
309
|
err = update_refactor_in_list(refactor_list_path, refactor_id, "completed")
|
|
@@ -320,11 +328,25 @@ def action_update(args, refactor_list_path, state_dir):
|
|
|
320
328
|
error_out("Failed to update .prizmkit/plans/refactor-list.json: {}".format(err))
|
|
321
329
|
return
|
|
322
330
|
elif session_status == "infra_error":
|
|
323
|
-
|
|
324
|
-
|
|
331
|
+
# AI CLI/provider outage, auth failure, gateway error, etc.
|
|
332
|
+
# Infra failures do not consume the code retry budget, but they still
|
|
333
|
+
# need their own bounded budget so a flaky provider cannot loop forever.
|
|
334
|
+
infra_error_count = rs.get("infra_error_count", 0) + 1
|
|
335
|
+
rs["infra_error_count"] = infra_error_count
|
|
325
336
|
rs["last_infra_error_session_id"] = session_id
|
|
337
|
+
rs["max_infra_retries"] = max_infra_retries
|
|
338
|
+
rs["degraded_reason"] = "infra_error"
|
|
339
|
+
if session_id:
|
|
340
|
+
rs["last_session_id"] = session_id
|
|
326
341
|
rs["resume_from_phase"] = None
|
|
327
342
|
|
|
343
|
+
if infra_error_count >= max_infra_retries:
|
|
344
|
+
new_status = "failed"
|
|
345
|
+
if session_id:
|
|
346
|
+
rs["last_failed_session_id"] = session_id
|
|
347
|
+
else:
|
|
348
|
+
new_status = "pending"
|
|
349
|
+
|
|
328
350
|
err = update_refactor_in_list(refactor_list_path, refactor_id, new_status)
|
|
329
351
|
if err:
|
|
330
352
|
error_out("Failed to update .prizmkit/plans/refactor-list.json: {}".format(err))
|
|
@@ -379,6 +401,8 @@ def action_update(args, refactor_list_path, state_dir):
|
|
|
379
401
|
"session_status": session_status,
|
|
380
402
|
"new_status": new_status,
|
|
381
403
|
"retry_count": rs["retry_count"],
|
|
404
|
+
"infra_error_count": rs.get("infra_error_count", 0),
|
|
405
|
+
"max_infra_retries": max_infra_retries,
|
|
382
406
|
"resume_from_phase": rs.get("resume_from_phase"),
|
|
383
407
|
"updated_at": rs["updated_at"],
|
|
384
408
|
}
|
|
@@ -728,6 +752,8 @@ def action_reset(args, refactor_list_path, state_dir):
|
|
|
728
752
|
old_retry = rs.get("retry_count", 0)
|
|
729
753
|
|
|
730
754
|
rs["retry_count"] = 0
|
|
755
|
+
rs["infra_error_count"] = 0
|
|
756
|
+
rs["last_infra_error_session_id"] = None
|
|
731
757
|
rs["sessions"] = []
|
|
732
758
|
rs["last_session_id"] = None
|
|
733
759
|
rs["resume_from_phase"] = None
|
|
@@ -799,6 +825,8 @@ def action_clean(args, refactor_list_path, state_dir):
|
|
|
799
825
|
old_retry = rs.get("retry_count", 0)
|
|
800
826
|
|
|
801
827
|
rs["retry_count"] = 0
|
|
828
|
+
rs["infra_error_count"] = 0
|
|
829
|
+
rs["last_infra_error_session_id"] = None
|
|
802
830
|
rs["sessions"] = []
|
|
803
831
|
rs["last_session_id"] = None
|
|
804
832
|
rs["resume_from_phase"] = None
|
|
@@ -887,6 +915,8 @@ def action_start(args, refactor_list_path, state_dir):
|
|
|
887
915
|
"refactor_id": refactor_id,
|
|
888
916
|
"old_status": old_status,
|
|
889
917
|
"new_status": "in_progress",
|
|
918
|
+
"retry_count": rs.get("retry_count", 0),
|
|
919
|
+
"infra_error_count": rs.get("infra_error_count", 0),
|
|
890
920
|
"updated_at": rs["updated_at"],
|
|
891
921
|
}
|
|
892
922
|
print(json.dumps(result, indent=2, ensure_ascii=False))
|
|
@@ -1025,6 +1055,8 @@ def action_unskip(args, refactor_list_path, state_dir):
|
|
|
1025
1055
|
for rid in to_reset:
|
|
1026
1056
|
rs = load_refactor_status(state_dir, rid)
|
|
1027
1057
|
rs["retry_count"] = 0
|
|
1058
|
+
rs["infra_error_count"] = 0
|
|
1059
|
+
rs["last_infra_error_session_id"] = None
|
|
1028
1060
|
rs["sessions"] = []
|
|
1029
1061
|
rs["last_session_id"] = None
|
|
1030
1062
|
rs["resume_from_phase"] = None
|