prizmkit 1.0.84 → 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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.0.84",
3
- "bundledAt": "2026-03-22T06:08:56.689Z",
4
- "bundledFrom": "99e8cc5"
2
+ "frameworkVersion": "1.0.86",
3
+ "bundledAt": "2026-03-22T08:00:16.548Z",
4
+ "bundledFrom": "f16dcdb"
5
5
  }
@@ -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
+ }
@@ -342,7 +342,17 @@ fi
342
342
  if [[ "$SESSION_STATUS" == "success" ]]; then
343
343
  PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
344
344
  if git -C "$PROJECT_ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
345
+ # Auto-commit any remaining dirty files produced during the session
345
346
  DIRTY_FILES=$(git -C "$PROJECT_ROOT" status --porcelain 2>/dev/null || true)
347
+ if [[ -n "$DIRTY_FILES" ]]; then
348
+ log_info "Auto-committing remaining session artifacts..."
349
+ git -C "$PROJECT_ROOT" add -A 2>/dev/null || true
350
+ git -C "$PROJECT_ROOT" commit -m "chore($BUG_ID): include remaining session artifacts" 2>/dev/null || true
351
+ fi
352
+
353
+ # Re-check: if still dirty after auto-commit, flag as failed
354
+ DIRTY_FILES=$(git -C "$PROJECT_ROOT" status --porcelain 2>/dev/null || true)
355
+ if [[ -n "$DIRTY_FILES" ]]; then
346
356
  if [[ -n "$DIRTY_FILES" ]]; then
347
357
  log_error "Session reported success but git working tree is not clean."
348
358
  echo "$DIRTY_FILES" | sed 's/^/ - /'
@@ -382,7 +382,17 @@ fi
382
382
  if [[ "$SESSION_STATUS" == "success" ]]; then
383
383
  PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
384
384
  if git -C "$PROJECT_ROOT" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
385
+ # Auto-commit any remaining dirty files produced during the session
385
386
  DIRTY_FILES=$(git -C "$PROJECT_ROOT" status --porcelain 2>/dev/null || true)
387
+ if [[ -n "$DIRTY_FILES" ]]; then
388
+ log_info "Auto-committing remaining session artifacts..."
389
+ git -C "$PROJECT_ROOT" add -A 2>/dev/null || true
390
+ git -C "$PROJECT_ROOT" commit -m "chore($FEATURE_ID): include remaining session artifacts" 2>/dev/null || true
391
+ fi
392
+
393
+ # Re-check: if still dirty after auto-commit, flag as failed
394
+ DIRTY_FILES=$(git -C "$PROJECT_ROOT" status --porcelain 2>/dev/null || true)
395
+ if [[ -n "$DIRTY_FILES" ]]; then
386
396
  if [[ -n "$DIRTY_FILES" ]]; then
387
397
  log_error "Session reported success but git working tree is not clean."
388
398
  echo "$DIRTY_FILES" | sed 's/^/ - /'
@@ -183,8 +183,17 @@ spawn_and_wait_session() {
183
183
  local project_root
184
184
  project_root="$(cd "$SCRIPT_DIR/.." && pwd)"
185
185
  if git -C "$project_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
186
+ # Auto-commit any remaining dirty files produced during the session
186
187
  local dirty_files=""
187
188
  dirty_files=$(git -C "$project_root" status --porcelain 2>/dev/null || true)
189
+ if [[ -n "$dirty_files" ]]; then
190
+ log_info "Auto-committing remaining session artifacts..."
191
+ git -C "$project_root" add -A 2>/dev/null || true
192
+ git -C "$project_root" commit -m "chore($bug_id): include remaining session artifacts" 2>/dev/null || true
193
+ fi
194
+
195
+ # Re-check: if still dirty after auto-commit, flag as failed
196
+ dirty_files=$(git -C "$project_root" status --porcelain 2>/dev/null || true)
188
197
  if [[ -n "$dirty_files" ]]; then
189
198
  log_error "Session reported success but git working tree is not clean."
190
199
  echo "$dirty_files" | sed 's/^/ - /'
@@ -435,12 +444,13 @@ sys.exit(1)
435
444
  "$bootstrap_prompt" "$session_dir" 999
436
445
  local session_status="$_SPAWN_RESULT"
437
446
 
438
- # Auto-push after successful session
439
- if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
440
- local _proj_root
441
- _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
442
- log_info "AUTO_PUSH enabled; pushing to remote..."
443
- git -C "$_proj_root" push -u origin "$_DEV_BRANCH_NAME" 2>/dev/null || log_warn "Auto-push failed"
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
444
454
  fi
445
455
 
446
456
  echo ""
@@ -554,12 +564,18 @@ main() {
554
564
  log_success "════════════════════════════════════════════════════"
555
565
  log_success " All bugs processed! Bug fix pipeline finished."
556
566
  log_success " Total sessions: $session_count"
557
- if [[ -n "$_DEV_BRANCH_NAME" ]]; then
558
- log_success " Dev branch: $_DEV_BRANCH_NAME"
559
- log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
560
- fi
561
567
  log_success "════════════════════════════════════════════════════"
562
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
563
579
  break
564
580
  fi
565
581
 
@@ -632,14 +648,6 @@ os.replace(tmp, target)
632
648
  "$bug_id" "$bug_list" "$session_id" \
633
649
  "$bootstrap_prompt" "$session_dir" "$MAX_RETRIES"
634
650
 
635
- # Auto-push after successful session
636
- if [[ "$_SPAWN_RESULT" == "success" && "$AUTO_PUSH" == "1" ]]; then
637
- local _proj_root
638
- _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
639
- log_info "AUTO_PUSH enabled; pushing to remote..."
640
- git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
641
- fi
642
-
643
651
  session_count=$((session_count + 1))
644
652
 
645
653
  log_info "Pausing 5s before next bug..."
@@ -231,8 +231,18 @@ else: print('')
231
231
  local project_root
232
232
  project_root="$(cd "$SCRIPT_DIR/.." && pwd)"
233
233
  if git -C "$project_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
234
+ # Auto-commit any remaining dirty files produced during the session
235
+ # (pipeline state, runtime data, files the AI session missed)
234
236
  local dirty_files=""
235
237
  dirty_files=$(git -C "$project_root" status --porcelain 2>/dev/null || true)
238
+ if [[ -n "$dirty_files" ]]; then
239
+ log_info "Auto-committing remaining session artifacts..."
240
+ git -C "$project_root" add -A 2>/dev/null || true
241
+ git -C "$project_root" commit -m "chore($feature_id): include remaining session artifacts" 2>/dev/null || true
242
+ fi
243
+
244
+ # Re-check: if still dirty after auto-commit, flag as commit_missing
245
+ dirty_files=$(git -C "$project_root" status --porcelain 2>/dev/null || true)
236
246
  if [[ -n "$dirty_files" ]]; then
237
247
  log_warn "Session reported success but git working tree is not clean."
238
248
  echo "$dirty_files" | sed 's/^/ - /'
@@ -778,12 +788,13 @@ sys.exit(1)
778
788
  "$bootstrap_prompt" "$session_dir" 999 "$feature_model"
779
789
  local session_status="$_SPAWN_RESULT"
780
790
 
781
- # Auto-push after successful session
782
- if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
783
- local _proj_root
784
- _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
785
- log_info "AUTO_PUSH enabled; pushing to remote..."
786
- git -C "$_proj_root" push -u origin "$_DEV_BRANCH_NAME" 2>/dev/null || log_warn "Auto-push failed"
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
787
798
  fi
788
799
 
789
800
  echo ""
@@ -971,12 +982,18 @@ for f in data.get('stuck_features', []):
971
982
  log_success "════════════════════════════════════════════════════"
972
983
  log_success " All features completed! Pipeline finished."
973
984
  log_success " Total sessions: $session_count"
974
- if [[ -n "$_DEV_BRANCH_NAME" ]]; then
975
- log_success " Dev branch: $_DEV_BRANCH_NAME"
976
- log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
977
- fi
978
985
  log_success "════════════════════════════════════════════════════"
979
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
980
997
  break
981
998
  fi
982
999
 
@@ -1086,14 +1103,6 @@ os.replace(tmp, target)
1086
1103
  "$bootstrap_prompt" "$session_dir" "$MAX_RETRIES" "$feature_model"
1087
1104
  local session_status="$_SPAWN_RESULT"
1088
1105
 
1089
- # Auto-push after successful session
1090
- if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
1091
- local _proj_root
1092
- _proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
1093
- log_info "AUTO_PUSH enabled; pushing to remote..."
1094
- git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
1095
- fi
1096
-
1097
1106
  session_count=$((session_count + 1))
1098
1107
 
1099
1108
  # Brief pause before next iteration
@@ -192,15 +192,15 @@ Write to: `{{SESSION_STATUS_PATH}}`
192
192
  git status --short
193
193
  ```
194
194
 
195
- If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
195
+ **Note**: The pipeline runner will auto-commit any remaining dirty files after your session exits. You do NOT need to manually commit pipeline state files (`dev-pipeline/state/`) or runtime logs — just focus on committing your feature code via `/prizmkit-committer`.
196
+
197
+ If any feature-related source files remain uncommitted, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
196
198
 
197
199
  ```bash
198
200
  git add <specific-file-1> <specific-file-2>
199
201
  git commit -m "chore({{FEATURE_ID}}): include session artifacts"
200
202
  ```
201
203
 
202
- Re-check `git status --short` and ensure it is empty before exiting.
203
-
204
204
  ## Critical Paths
205
205
 
206
206
  | Resource | Path |
@@ -217,5 +217,5 @@ Re-check `git status --short` and ensure it is empty before exiting.
217
217
  - Build context-snapshot.md FIRST; use it throughout instead of re-reading files
218
218
  - Session-status.json is written BEFORE commit (as partial), then updated to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
219
219
  - `/prizmkit-committer` is mandatory — do NOT skip the commit phase, and do NOT replace it with manual git commit commands
220
- - Before exiting, `git status --short` must be empty
220
+ - Before exiting, commit your feature code via `/prizmkit-committer` the pipeline runner auto-commits any remaining files after session exit
221
221
  - When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
@@ -247,15 +247,15 @@ Write to: `{{SESSION_STATUS_PATH}}`
247
247
  git status --short
248
248
  ```
249
249
 
250
- If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
250
+ **Note**: The pipeline runner will auto-commit any remaining dirty files after your session exits. You do NOT need to manually commit pipeline state files (`dev-pipeline/state/`) or runtime logs — just focus on committing your feature code via `/prizmkit-committer`.
251
+
252
+ If any feature-related source files remain uncommitted, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
251
253
 
252
254
  ```bash
253
255
  git add <specific-file-1> <specific-file-2>
254
256
  git commit -m "chore({{FEATURE_ID}}): include session artifacts"
255
257
  ```
256
258
 
257
- Re-check `git status --short` and ensure it is empty before exiting.
258
-
259
259
  ## Critical Paths
260
260
 
261
261
  | Resource | Path |
@@ -276,6 +276,6 @@ Re-check `git status --short` and ensure it is empty before exiting.
276
276
  - Do NOT use `run_in_background=true` when spawning subagents
277
277
  - Session-status.json is written BEFORE commit (as partial), then updated to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
278
278
  - `/prizmkit-committer` is mandatory, and must not be replaced with manual git commit commands
279
- - Before exiting, `git status --short` must be empty
279
+ - Before exiting, commit your feature code via `/prizmkit-committer` the pipeline runner auto-commits any remaining files after session exit
280
280
  - When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
281
281
  - On timeout: check snapshot + git diff HEAD → model:lite → remaining steps only → max 2 retries per phase → orchestrator fallback
@@ -438,15 +438,15 @@ After updating `session-status.json`, verify repository is clean:
438
438
  git status --short
439
439
  ```
440
440
 
441
- If any files remain, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
441
+ **Note**: The pipeline runner will auto-commit any remaining dirty files after your session exits. You do NOT need to manually commit pipeline state files (`dev-pipeline/state/`) or runtime logs — just focus on committing your feature code via `/prizmkit-committer`.
442
+
443
+ If any feature-related source files remain uncommitted, stage them **explicitly by name** (do NOT use `git add -A`) and create a follow-up commit:
442
444
 
443
445
  ```bash
444
446
  git add <specific-file-1> <specific-file-2>
445
447
  git commit -m "chore({{FEATURE_ID}}): include session artifacts"
446
448
  ```
447
449
 
448
- Re-check `git status --short` and ensure it is empty before exiting.
449
-
450
450
  ## Critical Paths
451
451
 
452
452
  | Resource | Path |
@@ -468,6 +468,6 @@ Re-check `git status --short` and ensure it is empty before exiting.
468
468
  - Do NOT use `run_in_background=true` when spawning agents
469
469
  - ALWAYS write preliminary session-status.json BEFORE commit (as partial), then update to success AFTER commit — this prevents pipeline from treating a terminated session as crashed
470
470
  - Commit phase must use `/prizmkit-committer`; do NOT replace with manual git commit commands
471
- - Before exiting, `git status --short` must be empty
471
+ - Before exiting, commit your feature code via `/prizmkit-committer` the pipeline runner auto-commits any remaining files after session exit
472
472
  - When staging leftover files in the final clean check, always use explicit file names — NEVER use `git add -A`
473
473
  - On timeout: check snapshot → model:lite → remaining steps only → max 2 retries → orchestrator fallback
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.84",
2
+ "version": "1.0.86",
3
3
  "skills": {
4
4
  "prizm-kit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -72,7 +72,8 @@ Then verify working tree is clean:
72
72
  git status
73
73
  ```
74
74
  - If "nothing to commit, working tree clean": commit verified successfully, proceed
75
- - If there are uncommitted changes remaining: **STOP** and report what files were missed. Stage the missed files explicitly by name and create a new commit (do NOT amend the previous commit amending risks destroying unrelated changes from prior commits)
75
+ - **Ignore `dev-pipeline/state/` files** these are pipeline runtime artifacts written by the pipeline runner process, not part of your changes. They will always appear dirty during pipeline sessions.
76
+ - If there are other uncommitted changes remaining (excluding `dev-pipeline/state/`): **STOP** and report what files were missed. Stage the missed files explicitly by name and create a new commit (do NOT amend the previous commit — amending risks destroying unrelated changes from prior commits)
76
77
 
77
78
  #### Step 6: Optional Push
78
79
  Ask user: "Push to remote?"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.0.84",
3
+ "version": "1.0.86",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {