prizmkit 1.0.85 → 1.0.86
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
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
# Functions:
|
|
10
10
|
# branch_create — Create and checkout a new branch
|
|
11
11
|
# branch_return — Checkout back to original branch
|
|
12
|
+
# branch_merge — Merge dev branch into original and optionally push
|
|
12
13
|
#
|
|
13
14
|
# Environment:
|
|
14
15
|
# DEV_BRANCH — Optional custom branch name override
|
|
@@ -74,3 +75,55 @@ branch_return() {
|
|
|
74
75
|
log_info "Returned to branch: $original_branch"
|
|
75
76
|
return 0
|
|
76
77
|
}
|
|
78
|
+
|
|
79
|
+
# branch_merge <project_root> <dev_branch> <original_branch> [auto_push]
|
|
80
|
+
#
|
|
81
|
+
# Merges dev_branch into original_branch, then optionally pushes.
|
|
82
|
+
# Steps:
|
|
83
|
+
# 1. Checkout original_branch
|
|
84
|
+
# 2. Merge dev_branch (fast-forward when possible)
|
|
85
|
+
# 3. Push to remote if auto_push == "1"
|
|
86
|
+
# 4. Delete dev_branch (local only, it's been merged)
|
|
87
|
+
#
|
|
88
|
+
# Returns 0 on success, 1 on failure.
|
|
89
|
+
branch_merge() {
|
|
90
|
+
local project_root="$1"
|
|
91
|
+
local dev_branch="$2"
|
|
92
|
+
local original_branch="$3"
|
|
93
|
+
local auto_push="${4:-0}"
|
|
94
|
+
|
|
95
|
+
# Step 1: Checkout original branch
|
|
96
|
+
if ! git -C "$project_root" checkout "$original_branch" 2>/dev/null; then
|
|
97
|
+
log_error "Failed to checkout $original_branch for merge"
|
|
98
|
+
return 1
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Step 2: Merge dev branch
|
|
102
|
+
log_info "Merging $dev_branch into $original_branch..."
|
|
103
|
+
if ! git -C "$project_root" merge "$dev_branch" 2>&1; then
|
|
104
|
+
log_error "Merge failed — resolve conflicts manually:"
|
|
105
|
+
log_error " git checkout $original_branch && git merge $dev_branch"
|
|
106
|
+
# Return to dev branch so state is not lost
|
|
107
|
+
git -C "$project_root" merge --abort 2>/dev/null || true
|
|
108
|
+
git -C "$project_root" checkout "$dev_branch" 2>/dev/null || true
|
|
109
|
+
return 1
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
log_success "Merged $dev_branch into $original_branch"
|
|
113
|
+
|
|
114
|
+
# Step 3: Push if AUTO_PUSH enabled
|
|
115
|
+
if [[ "$auto_push" == "1" ]]; then
|
|
116
|
+
log_info "Pushing $original_branch to remote..."
|
|
117
|
+
if git -C "$project_root" push 2>/dev/null; then
|
|
118
|
+
log_success "Pushed $original_branch to remote"
|
|
119
|
+
else
|
|
120
|
+
log_warn "Push failed — run 'git push' manually"
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# Step 4: Delete merged dev branch
|
|
125
|
+
git -C "$project_root" branch -d "$dev_branch" 2>/dev/null && \
|
|
126
|
+
log_info "Deleted merged branch: $dev_branch" || true
|
|
127
|
+
|
|
128
|
+
return 0
|
|
129
|
+
}
|
|
@@ -444,12 +444,13 @@ sys.exit(1)
|
|
|
444
444
|
"$bootstrap_prompt" "$session_dir" 999
|
|
445
445
|
local session_status="$_SPAWN_RESULT"
|
|
446
446
|
|
|
447
|
-
#
|
|
448
|
-
if [[ "$session_status" == "success" && "$
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
447
|
+
# Merge dev branch back to original on success
|
|
448
|
+
if [[ "$session_status" == "success" && -n "$_DEV_BRANCH_NAME" ]]; then
|
|
449
|
+
if branch_merge "$_proj_root" "$_DEV_BRANCH_NAME" "$_ORIGINAL_BRANCH" "$AUTO_PUSH"; then
|
|
450
|
+
_DEV_BRANCH_NAME=""
|
|
451
|
+
else
|
|
452
|
+
log_warn "Auto-merge failed — dev branch preserved: $_DEV_BRANCH_NAME"
|
|
453
|
+
fi
|
|
453
454
|
fi
|
|
454
455
|
|
|
455
456
|
echo ""
|
|
@@ -563,12 +564,18 @@ main() {
|
|
|
563
564
|
log_success "════════════════════════════════════════════════════"
|
|
564
565
|
log_success " All bugs processed! Bug fix pipeline finished."
|
|
565
566
|
log_success " Total sessions: $session_count"
|
|
566
|
-
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
567
|
-
log_success " Dev branch: $_DEV_BRANCH_NAME"
|
|
568
|
-
log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
|
|
569
|
-
fi
|
|
570
567
|
log_success "════════════════════════════════════════════════════"
|
|
571
568
|
rm -f "$STATE_DIR/current-session.json"
|
|
569
|
+
|
|
570
|
+
# Merge dev branch back to original
|
|
571
|
+
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
572
|
+
if branch_merge "$_proj_root" "$_DEV_BRANCH_NAME" "$_ORIGINAL_BRANCH" "$AUTO_PUSH"; then
|
|
573
|
+
_DEV_BRANCH_NAME=""
|
|
574
|
+
else
|
|
575
|
+
log_warn "Auto-merge failed — dev branch preserved: $_DEV_BRANCH_NAME"
|
|
576
|
+
log_warn "Merge manually: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
|
|
577
|
+
fi
|
|
578
|
+
fi
|
|
572
579
|
break
|
|
573
580
|
fi
|
|
574
581
|
|
|
@@ -641,14 +648,6 @@ os.replace(tmp, target)
|
|
|
641
648
|
"$bug_id" "$bug_list" "$session_id" \
|
|
642
649
|
"$bootstrap_prompt" "$session_dir" "$MAX_RETRIES"
|
|
643
650
|
|
|
644
|
-
# Auto-push after successful session
|
|
645
|
-
if [[ "$_SPAWN_RESULT" == "success" && "$AUTO_PUSH" == "1" ]]; then
|
|
646
|
-
local _proj_root
|
|
647
|
-
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
648
|
-
log_info "AUTO_PUSH enabled; pushing to remote..."
|
|
649
|
-
git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
|
|
650
|
-
fi
|
|
651
|
-
|
|
652
651
|
session_count=$((session_count + 1))
|
|
653
652
|
|
|
654
653
|
log_info "Pausing 5s before next bug..."
|
|
@@ -788,12 +788,13 @@ sys.exit(1)
|
|
|
788
788
|
"$bootstrap_prompt" "$session_dir" 999 "$feature_model"
|
|
789
789
|
local session_status="$_SPAWN_RESULT"
|
|
790
790
|
|
|
791
|
-
#
|
|
792
|
-
if [[ "$session_status" == "success" && "$
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
791
|
+
# Merge dev branch back to original on success
|
|
792
|
+
if [[ "$session_status" == "success" && -n "$_DEV_BRANCH_NAME" ]]; then
|
|
793
|
+
if branch_merge "$_proj_root" "$_DEV_BRANCH_NAME" "$_ORIGINAL_BRANCH" "$AUTO_PUSH"; then
|
|
794
|
+
_DEV_BRANCH_NAME=""
|
|
795
|
+
else
|
|
796
|
+
log_warn "Auto-merge failed — dev branch preserved: $_DEV_BRANCH_NAME"
|
|
797
|
+
fi
|
|
797
798
|
fi
|
|
798
799
|
|
|
799
800
|
echo ""
|
|
@@ -981,12 +982,18 @@ for f in data.get('stuck_features', []):
|
|
|
981
982
|
log_success "════════════════════════════════════════════════════"
|
|
982
983
|
log_success " All features completed! Pipeline finished."
|
|
983
984
|
log_success " Total sessions: $session_count"
|
|
984
|
-
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
985
|
-
log_success " Dev branch: $_DEV_BRANCH_NAME"
|
|
986
|
-
log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
|
|
987
|
-
fi
|
|
988
985
|
log_success "════════════════════════════════════════════════════"
|
|
989
986
|
rm -f "$STATE_DIR/current-session.json"
|
|
987
|
+
|
|
988
|
+
# Merge dev branch back to original
|
|
989
|
+
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
990
|
+
if branch_merge "$_proj_root" "$_DEV_BRANCH_NAME" "$_ORIGINAL_BRANCH" "$AUTO_PUSH"; then
|
|
991
|
+
_DEV_BRANCH_NAME=""
|
|
992
|
+
else
|
|
993
|
+
log_warn "Auto-merge failed — dev branch preserved: $_DEV_BRANCH_NAME"
|
|
994
|
+
log_warn "Merge manually: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
|
|
995
|
+
fi
|
|
996
|
+
fi
|
|
990
997
|
break
|
|
991
998
|
fi
|
|
992
999
|
|
|
@@ -1096,14 +1103,6 @@ os.replace(tmp, target)
|
|
|
1096
1103
|
"$bootstrap_prompt" "$session_dir" "$MAX_RETRIES" "$feature_model"
|
|
1097
1104
|
local session_status="$_SPAWN_RESULT"
|
|
1098
1105
|
|
|
1099
|
-
# Auto-push after successful session
|
|
1100
|
-
if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
|
|
1101
|
-
local _proj_root
|
|
1102
|
-
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
1103
|
-
log_info "AUTO_PUSH enabled; pushing to remote..."
|
|
1104
|
-
git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
|
|
1105
|
-
fi
|
|
1106
|
-
|
|
1107
1106
|
session_count=$((session_count + 1))
|
|
1108
1107
|
|
|
1109
1108
|
# Brief pause before next iteration
|