prizmkit 1.0.35 → 1.0.58
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/adapters/claude/agent-adapter.js +2 -1
- package/bundled/adapters/claude/command-adapter.js +4 -3
- package/bundled/agents/prizm-dev-team-dev.md +12 -12
- package/bundled/agents/prizm-dev-team-reviewer.md +10 -10
- package/bundled/dev-pipeline/README.md +15 -19
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +16 -23
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +8 -0
- package/bundled/dev-pipeline/launch-daemon.sh +2 -0
- package/bundled/dev-pipeline/lib/branch.sh +76 -0
- package/bundled/dev-pipeline/retry-bug.sh +5 -2
- package/bundled/dev-pipeline/retry-feature.sh +5 -2
- package/bundled/dev-pipeline/run-bugfix.sh +74 -0
- package/bundled/dev-pipeline/run.sh +76 -2
- package/bundled/dev-pipeline/scripts/check-session-status.py +3 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +0 -8
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +24 -1
- package/bundled/dev-pipeline/scripts/update-feature-status.py +3 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +11 -25
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +12 -26
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -65
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +7 -7
- package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
- package/bundled/dev-pipeline/tests/conftest.py +19 -131
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
- package/bundled/dev-pipeline/tests/test_utils.py +51 -110
- package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
- package/bundled/skills/_metadata.json +15 -16
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/bug-fix-workflow/SKILL.md +174 -0
- package/bundled/skills/bug-planner/SKILL.md +20 -32
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +3 -5
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +4 -6
- package/bundled/skills/feature-workflow/SKILL.md +25 -42
- package/bundled/skills/prizm-kit/SKILL.md +57 -21
- package/bundled/skills/prizm-kit/assets/{claude-md-template.md → project-memory-template.md} +2 -2
- package/bundled/skills/prizmkit-analyze/SKILL.md +41 -29
- package/bundled/skills/prizmkit-clarify/SKILL.md +40 -30
- package/bundled/skills/prizmkit-code-review/SKILL.md +48 -43
- package/bundled/skills/prizmkit-committer/SKILL.md +30 -68
- package/bundled/skills/prizmkit-implement/SKILL.md +48 -24
- package/bundled/skills/prizmkit-init/SKILL.md +57 -66
- package/bundled/skills/prizmkit-plan/SKILL.md +46 -20
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +60 -19
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +23 -23
- package/bundled/skills/prizmkit-retrospective/SKILL.md +142 -65
- package/bundled/skills/prizmkit-retrospective/assets/retrospective-template.md +13 -0
- package/bundled/skills/prizmkit-specify/SKILL.md +63 -13
- package/bundled/skills/refactor-workflow/SKILL.md +105 -49
- package/bundled/team/prizm-dev-team.json +5 -19
- package/package.json +1 -1
- package/src/clean.js +0 -2
- package/src/manifest.js +8 -4
- package/src/scaffold.js +72 -6
- package/src/upgrade.js +32 -5
- package/bundled/agents/prizm-dev-team-coordinator.md +0 -141
- package/bundled/agents/prizm-dev-team-pm.md +0 -126
- package/bundled/dev-pipeline/tests/__init__.py +0 -0
- package/bundled/dev-pipeline/tests/test_check_session.py +0 -127
- package/bundled/dev-pipeline/tests/test_cleanup_logs.py +0 -119
- package/bundled/dev-pipeline/tests/test_detect_stuck.py +0 -207
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +0 -181
- package/bundled/dev-pipeline/tests/test_generate_prompt.py +0 -190
- package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +0 -153
- package/bundled/dev-pipeline/tests/test_init_pipeline.py +0 -241
- package/bundled/dev-pipeline/tests/test_update_bug_status.py +0 -142
- package/bundled/dev-pipeline/tests/test_update_feature_status.py +0 -268
- package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +0 -35
- package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +0 -15
- package/bundled/skills/prizmkit-summarize/SKILL.md +0 -51
- package/bundled/skills/prizmkit-summarize/assets/registry-template.md +0 -18
- package/bundled/templates/hooks/commit-intent-claude.json +0 -26
- /package/bundled/templates/hooks/{commit-intent-codebuddy.json → commit-intent.json} +0 -0
package/bundled/VERSION.json
CHANGED
|
@@ -65,7 +65,8 @@ export function convertAgent(agentContent, options = {}) {
|
|
|
65
65
|
'run `/$1` command'
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
//
|
|
68
|
+
// Legacy fallback: replace any remaining prizmkit.xxx shorthand with /prizmkit-xxx
|
|
69
|
+
// Core files now use /prizmkit-xxx natively, but this catches any stragglers
|
|
69
70
|
convertedBody = convertedBody.replace(
|
|
70
71
|
/prizmkit\.(\w+)/g,
|
|
71
72
|
(match, sub) => `/prizmkit-${sub.replace(/_/g, '-')}`
|
|
@@ -56,7 +56,7 @@ export function convertSkillToCommand(skillContent, skillName) {
|
|
|
56
56
|
const { frontmatter, body } = parseFrontmatter(skillContent);
|
|
57
57
|
|
|
58
58
|
// Claude Code command frontmatter only uses description
|
|
59
|
-
// Also convert prizmkit.xxx references in the description field
|
|
59
|
+
// Also convert any remaining prizmkit.xxx references in the description field (legacy fallback)
|
|
60
60
|
let desc = frontmatter.description || `PrizmKit ${skillName} command`;
|
|
61
61
|
desc = desc.replace(/prizmkit\.(\w+)/g, (_m, sub) => `/${toClaudePrizmkitCommand(sub)}`);
|
|
62
62
|
|
|
@@ -74,13 +74,14 @@ export function convertSkillToCommand(skillContent, skillName) {
|
|
|
74
74
|
`.claude/command-assets/${skillName}`
|
|
75
75
|
);
|
|
76
76
|
|
|
77
|
-
// Replace "invoke the X skill" or "prizmkit.X" patterns with /X slash command
|
|
77
|
+
// Replace "invoke the X skill" or "prizmkit.X" patterns with /X slash command (legacy fallback)
|
|
78
78
|
convertedBody = convertedBody.replace(
|
|
79
79
|
/invoke\s+(?:the\s+)?[`"]?(\w[\w-]*)[`"]?\s+skill/gi,
|
|
80
80
|
'run the `/$1` command'
|
|
81
81
|
);
|
|
82
82
|
|
|
83
|
-
//
|
|
83
|
+
// Legacy fallback: replace any remaining prizmkit.xxx with /prizmkit-xxx for Claude Code
|
|
84
|
+
// Core files now use /prizmkit-xxx natively, but this catches any stragglers
|
|
84
85
|
convertedBody = convertedBody.replace(
|
|
85
86
|
/prizmkit\.(\w+)/g,
|
|
86
87
|
(_match, sub) => {
|
|
@@ -18,7 +18,7 @@ skills: prizmkit-implement, prizmkit-prizm-docs
|
|
|
18
18
|
|
|
19
19
|
### 项目上下文
|
|
20
20
|
|
|
21
|
-
项目文档在 `.prizm-docs/`。实现前先读 `root.prizm` 了解规则和已知陷阱(TRAPS),修改某模块时读该模块的文档。
|
|
21
|
+
项目文档在 `.prizm-docs/`。实现前先读 `context-snapshot.md`(若存在于 `.prizmkit/specs/###-feature-name/`),其 Section 3 含 Prizm Context、Section 4 含源文件,无需再读 `.prizm-docs/` 或原始源文件。若 snapshot 不存在,则读 `root.prizm` 了解规则和已知陷阱(TRAPS),修改某模块时读该模块的文档。
|
|
22
22
|
|
|
23
23
|
### 制品路径
|
|
24
24
|
|
|
@@ -32,22 +32,22 @@ skills: prizmkit-implement, prizmkit-prizm-docs
|
|
|
32
32
|
1. 按照分配的任务和 plan.md 中的接口设计实现功能模块
|
|
33
33
|
2. 遵循 TDD 方式:先写测试,再实现,再验证
|
|
34
34
|
3. 产出的代码必须通过本模块的单元测试
|
|
35
|
-
4.
|
|
35
|
+
4. 发现接口设计歧义时,立即上报给 Orchestrator(不自行假设)
|
|
36
36
|
5. 遵循 `/prizmkit-implement` 工作流:读取 plan.md(含 Tasks section)+ spec.md,逐任务实现
|
|
37
37
|
6. 每个任务完成后**立即**标记 plan.md Tasks section 中的 `[x]`(不批量标记)
|
|
38
|
-
7. 实现前读取 `.prizm-docs/`
|
|
38
|
+
7. 实现前读取 TRAPS 段避免已知陷阱:优先从 `context-snapshot.md` Section 3 获取,若 snapshot 不存在则读 `.prizm-docs/`
|
|
39
39
|
8. 检查点任务须验证构建通过和测试通过后才能继续下一阶段
|
|
40
40
|
9. 顺序任务按序执行,失败则停止;并行 `[P]` 任务可继续
|
|
41
41
|
10. 新建子模块时,生成对应的 `.prizm-docs/` L2 文档
|
|
42
42
|
|
|
43
43
|
### 绝不做 (NEVER)
|
|
44
44
|
|
|
45
|
-
- 不修改 plan.md 中的接口设计(修改需通过
|
|
45
|
+
- 不修改 plan.md 中的接口设计(修改需通过 Orchestrator)
|
|
46
46
|
- 不修改其他 Dev Agent 负责的模块代码
|
|
47
47
|
- 不进行集成测试(Reviewer 的职责)
|
|
48
48
|
- **不执行任何 git 操作**(git commit / git add / git reset / git push 均禁止 — 由 Orchestrator 通过 /prizmkit-committer 统一提交)
|
|
49
49
|
- 不修改 `.prizmkit/specs/` 中除 `plan.md`(标记 Tasks section [x])以外的任何文件
|
|
50
|
-
- 不为 bug 修复创建新的文档条目;bug
|
|
50
|
+
- 不为 bug 修复创建新的文档条目;bug 修复是现有功能的完善,应更新原始功能的文档
|
|
51
51
|
- 不使用 TaskCreate/TaskUpdate 创建或修改 Orchestrator 层的任务(Task 工具仅用于内部进度追踪,且任务 ID 在各 agent 子会话中互不共享)
|
|
52
52
|
|
|
53
53
|
### 行为规则
|
|
@@ -62,7 +62,7 @@ DEV-06: 不得引入未在任务描述中声明的外部依赖
|
|
|
62
62
|
DEV-07: 遵循 /prizmkit-implement 工作流
|
|
63
63
|
DEV-08: 每个任务完成后立即标记 plan.md Tasks section [x]
|
|
64
64
|
DEV-09: TDD:先写测试 → 再实现 → 再验证
|
|
65
|
-
DEV-10: 实现每个模块前必须读取 .prizm-docs/
|
|
65
|
+
DEV-10: 实现每个模块前必须读取 TRAPS 段:优先从 context-snapshot.md Section 3 获取,无 snapshot 时读 .prizm-docs/
|
|
66
66
|
DEV-11: 检查点任务必须验证构建通过和测试通过
|
|
67
67
|
DEV-12: 新建子模块时生成 L2 .prizm-docs/ 文档
|
|
68
68
|
DEV-13: 禁止执行任何 git 命令(git add/commit/reset/push 全部禁止)
|
|
@@ -72,13 +72,13 @@ DEV-14: 若 `npm test` 中存在 pre-existing 失败,不得忽略——必须
|
|
|
72
72
|
### 工作流程
|
|
73
73
|
|
|
74
74
|
1. 接收任务分配
|
|
75
|
-
2. 读取 `.prizm-docs/root.prizm` 和相关模块文档
|
|
75
|
+
2. 读取 `.prizmkit/specs/###-feature-name/context-snapshot.md`(若存在)——Section 3 含 Prizm Context,Section 4 含源文件。若 snapshot 不存在,则读取 `.prizm-docs/root.prizm` 和相关模块文档
|
|
76
76
|
3. 读取 `.prizmkit/specs/###-feature-name/` 中的 `plan.md`(含 Tasks section)、`spec.md`
|
|
77
77
|
4. 对每个分配的任务,按 plan.md Tasks 顺序执行:
|
|
78
|
-
a.
|
|
78
|
+
a. 从 context-snapshot.md 获取目标文件上下文和 TRAPS(若无 snapshot 则读取目标文件模块的文档)
|
|
79
79
|
b. TDD:基于验收标准编写测试 → 实现功能代码 → 运行测试验证
|
|
80
80
|
c. 在 plan.md Tasks section 中标记该任务为 `[x]`
|
|
81
|
-
d. 发送 STATUS_UPDATE 给
|
|
81
|
+
d. 发送 STATUS_UPDATE 给 Orchestrator
|
|
82
82
|
5. 如遇检查点任务,验证构建通过和测试通过后才继续
|
|
83
83
|
6. 遇到接口设计歧义,发送 ESCALATION(不自行假设)
|
|
84
84
|
7. 如新建了子模块,生成对应 `.prizm-docs/` L2 文档
|
|
@@ -88,14 +88,14 @@ DEV-14: 若 `npm test` 中存在 pre-existing 失败,不得忽略——必须
|
|
|
88
88
|
|
|
89
89
|
| 场景 | 策略 |
|
|
90
90
|
|------|------|
|
|
91
|
-
| 接口设计歧义 | 标记 BLOCKED → ESCALATION → 等待
|
|
91
|
+
| 接口设计歧义 | 标记 BLOCKED → ESCALATION → 等待 Orchestrator 裁定 |
|
|
92
92
|
| 单元测试失败 | 最多重试修复 3 次 → 仍失败则 ISSUE_REPORT |
|
|
93
93
|
| 外部依赖不可用 | 使用 Mock → 标注说明 |
|
|
94
|
-
| 任务超出预估 | ESCALATION → 建议
|
|
94
|
+
| 任务超出预估 | ESCALATION → 建议 Orchestrator 拆分任务 |
|
|
95
95
|
|
|
96
96
|
### 通信规则
|
|
97
97
|
|
|
98
|
-
允许 Agent 之间直接通信,但关键消息和结论必须通知
|
|
98
|
+
允许 Agent 之间直接通信,但关键消息和结论必须通知 Orchestrator。
|
|
99
99
|
- 发送 STATUS_UPDATE 汇报每个子任务完成
|
|
100
100
|
- 发送 COMPLETION_SIGNAL 标志所有任务完成
|
|
101
101
|
- 发送 ESCALATION 上报接口歧义或任务阻塞
|
|
@@ -16,7 +16,7 @@ skills: prizmkit-code-review, prizmkit-analyze, prizmkit-prizm-docs
|
|
|
16
16
|
|
|
17
17
|
### 项目上下文
|
|
18
18
|
|
|
19
|
-
项目文档在 `.prizm-docs/`。审查前先读 `root.prizm` 了解项目规则(RULES)、模式(PATTERNS)和已知陷阱(TRAPS),需要时读取模块级文档。
|
|
19
|
+
项目文档在 `.prizm-docs/`。审查前先读 `context-snapshot.md`(若存在于 `.prizmkit/specs/###-feature-name/`),其 Section 3 含 Prizm Context(RULES、PATTERNS、TRAPS),无需再读 `.prizm-docs/` 或原始源文件。若 snapshot 不存在,则读 `root.prizm` 了解项目规则(RULES)、模式(PATTERNS)和已知陷阱(TRAPS),需要时读取模块级文档。
|
|
20
20
|
|
|
21
21
|
### 制品路径
|
|
22
22
|
|
|
@@ -40,8 +40,8 @@ skills: prizmkit-code-review, prizmkit-analyze, prizmkit-prizm-docs
|
|
|
40
40
|
### 绝不做 (NEVER)
|
|
41
41
|
|
|
42
42
|
- 不编写实现代码(Dev 的职责)
|
|
43
|
-
- 不分解任务(
|
|
44
|
-
- 不进行任务调度(
|
|
43
|
+
- 不分解任务(Orchestrator 的职责)
|
|
44
|
+
- 不进行任务调度(Orchestrator 的职责)
|
|
45
45
|
- **不执行任何 git 操作**(git commit / git add / git reset / git push 均禁止)
|
|
46
46
|
- 不使用 TaskCreate/TaskUpdate 创建或修改 Orchestrator 层的任务(Task 工具仅用于内部进度追踪,且任务 ID 在各 agent 子会话中互不共享)
|
|
47
47
|
|
|
@@ -62,21 +62,21 @@ REV-10: 禁止使用 timeout 命令(macOS 不兼容)。运行测试时直接
|
|
|
62
62
|
|
|
63
63
|
### Phase 4 工作流程:交叉校验
|
|
64
64
|
|
|
65
|
-
**前置条件**:
|
|
65
|
+
**前置条件**: Orchestrator 已完成 spec.md / plan.md(含 Tasks section)
|
|
66
66
|
|
|
67
67
|
1. 调用 `/prizmkit-analyze` skill(**不是 CLI 命令**,使用 Skill 工具或 `/prizmkit-analyze` 指令调用)
|
|
68
68
|
- 输入: spec.md, plan.md(含 Tasks section)
|
|
69
69
|
- 6 个检测通道: 重复检测、歧义检测、不完整检测、Prizm 规则对齐、覆盖缺口、不一致性
|
|
70
70
|
- 输出: 一致性分析报告(仅对话输出)
|
|
71
71
|
- 若 Skill 工具不可用,则根据 6 个检测通道手动执行交叉一致性分析
|
|
72
|
-
2. 如发现 CRITICAL 问题,报告给
|
|
72
|
+
2. 如发现 CRITICAL 问题,报告给 Orchestrator 退回修复
|
|
73
73
|
3. 发送 COMPLETION_SIGNAL(含分析结果)
|
|
74
74
|
|
|
75
75
|
### Phase 6 工作流程:评审
|
|
76
76
|
|
|
77
77
|
**前置条件**: Dev 已完成实现,所有任务标记 `[x]`
|
|
78
78
|
|
|
79
|
-
1. 读取 `.prizm-docs/root.prizm
|
|
79
|
+
1. 读取 `context-snapshot.md`(若存在),其 Section 3 含 RULES 和 PATTERNS。若 snapshot 不存在,则读 `.prizm-docs/root.prizm`
|
|
80
80
|
2. 运行 `/prizmkit-code-review`(只读)
|
|
81
81
|
- 6 个审查维度: 规格符合度、计划遵循度、代码质量、安全性、一致性、测试覆盖
|
|
82
82
|
- 判定: PASS | PASS WITH WARNINGS | NEEDS FIXES
|
|
@@ -109,15 +109,15 @@ REV-10: 禁止使用 timeout 命令(macOS 不兼容)。运行测试时直接
|
|
|
109
109
|
|
|
110
110
|
| 场景 | 策略 |
|
|
111
111
|
|------|------|
|
|
112
|
-
| analyze 发现 CRITICAL | 报告
|
|
113
|
-
| code-review 发现 CRITICAL | 报告
|
|
114
|
-
| 集成测试失败 | 分类严重级别 → ISSUE_REPORT →
|
|
112
|
+
| analyze 发现 CRITICAL | 报告 Orchestrator → 退回修复 |
|
|
113
|
+
| code-review 发现 CRITICAL | 报告 Orchestrator → 退回 Dev 修复 |
|
|
114
|
+
| 集成测试失败 | 分类严重级别 → ISSUE_REPORT → Orchestrator 派发给 Dev |
|
|
115
115
|
| 审查发现超过 30 个 | 只保留最严重的 30 个 |
|
|
116
116
|
| Prizm RULES 违规 | 自动标记为 CRITICAL |
|
|
117
117
|
|
|
118
118
|
### 通信规则
|
|
119
119
|
|
|
120
|
-
允许 Agent 之间直接通信,但关键消息和结论必须通知
|
|
120
|
+
允许 Agent 之间直接通信,但关键消息和结论必须通知 Orchestrator。
|
|
121
121
|
- 发送 COMPLETION_SIGNAL(含判定结果)标志完成
|
|
122
122
|
- 发送 ISSUE_REPORT 报告 CRITICAL 发现
|
|
123
123
|
- 接收 TASK_ASSIGNMENT 获取分配的工作
|
|
@@ -221,12 +221,9 @@ run.sh main loop
|
|
|
221
221
|
├─ AI CLI session # cbc --print -y < prompt (CodeBuddy)
|
|
222
222
|
│ │ # claude --print -p "$(cat prompt)" --yes (Claude Code)
|
|
223
223
|
│ └─ prizm-dev-team # Multi-agent team implements the feature
|
|
224
|
-
│ ├─
|
|
225
|
-
│ ├─
|
|
226
|
-
│
|
|
227
|
-
│ ├─ QA # Phase 7: integration tests + code review
|
|
228
|
-
│ ├─ Review # Phase 7: code consistency audit
|
|
229
|
-
│ └─ Coordinator # Phase 9: summarize → commit → retrospective
|
|
224
|
+
│ ├─ Orchestrator # Main agent: init, plan, schedule, retrospective, commit
|
|
225
|
+
│ ├─ Dev x N # Implementation with TDD
|
|
226
|
+
│ └─ Reviewer # Analyze + code review
|
|
230
227
|
│
|
|
231
228
|
├─ check-session-status.py # Parse session outcome
|
|
232
229
|
├─ update-feature-status.py # Update feature state (completed/failed/retry)
|
|
@@ -238,19 +235,19 @@ run.sh main loop
|
|
|
238
235
|
|
|
239
236
|
Each AI CLI session drives the prizm-dev-team through these phases. **All phases are mandatory** — the bootstrap prompt enforces sequential execution.
|
|
240
237
|
|
|
241
|
-
> **Note**: The
|
|
238
|
+
> **Note**: The bootstrap prompt adapts these phases based on complexity mode (lite/standard/full). The 10-phase breakdown below is the most granular view for pipeline monitoring.
|
|
242
239
|
|
|
243
240
|
| Phase | Name | Agent | PrizmKit Skills | Artifacts |
|
|
244
241
|
|-------|------|-------|----------------|-----------|
|
|
245
|
-
| 0 | Init |
|
|
246
|
-
| 1 | Specify |
|
|
247
|
-
| 2 | Plan + Tasks |
|
|
248
|
-
| 3 | Analyze |
|
|
249
|
-
| 4 | Schedule |
|
|
242
|
+
| 0 | Init | Orchestrator | `prizmkit-init` | `.prizm-docs/root.prizm`, `.prizmkit/config.json` |
|
|
243
|
+
| 1 | Specify | Orchestrator | `prizmkit-specify`, `prizmkit-clarify` | `.prizmkit/specs/spec.md` |
|
|
244
|
+
| 2 | Plan + Tasks | Orchestrator | `prizmkit-plan` | `.prizmkit/specs/plan.md` (含 Tasks section) |
|
|
245
|
+
| 3 | Analyze | Reviewer | `prizmkit-analyze` | Analysis report (no CRITICAL issues) |
|
|
246
|
+
| 4 | Schedule | Orchestrator | — | TaskList entries assigned |
|
|
250
247
|
| 5 | Implement | Dev x N | `prizmkit-implement` | Code + tests, plan.md Tasks marked `[x]` |
|
|
251
|
-
| 6 | Review |
|
|
248
|
+
| 6 | Review | Reviewer | `prizmkit-code-review` | Integration tests, review report |
|
|
252
249
|
| 7 | Fix Loop | Dev | — | Max 3 rounds of fixes |
|
|
253
|
-
| 8 |
|
|
250
|
+
| 8 | Retrospective & Commit | Orchestrator | `prizmkit-retrospective`, `prizmkit-committer` | .prizm-docs/ synced + enriched, git commit |
|
|
254
251
|
|
|
255
252
|
### Feature Dependency Resolution
|
|
256
253
|
|
|
@@ -386,7 +383,6 @@ Each feature generates artifacts in a dedicated subdirectory under `.prizmkit/sp
|
|
|
386
383
|
.prizmkit/
|
|
387
384
|
├── config.json # PrizmKit configuration
|
|
388
385
|
└── specs/
|
|
389
|
-
├── REGISTRY.md # Feature registry (Phase 9 appends here)
|
|
390
386
|
├── 001-project-infrastructure-setup/
|
|
391
387
|
│ ├── spec.md # Phase 1: Feature specification
|
|
392
388
|
│ ├── checklists/
|
|
@@ -461,7 +457,7 @@ The pipeline expects:
|
|
|
461
457
|
|
|
462
458
|
| Resource | Location | Description |
|
|
463
459
|
|----------|----------|-------------|
|
|
464
|
-
| Agent Definitions | `.codebuddy/agents/prizm-dev-team-*.md` |
|
|
460
|
+
| Agent Definitions | `.codebuddy/agents/prizm-dev-team-*.md` | 2 agent types: dev, reviewer |
|
|
465
461
|
| Team Config | `~/.codebuddy/teams/prizm-dev-team/config.json` | Team runtime configuration |
|
|
466
462
|
| Team Inboxes | `~/.codebuddy/teams/prizm-dev-team/inboxes/` | Agent message inboxes |
|
|
467
463
|
|
|
@@ -469,7 +465,7 @@ The pipeline expects:
|
|
|
469
465
|
|
|
470
466
|
| Resource | Location | Description |
|
|
471
467
|
|----------|----------|-------------|
|
|
472
|
-
| Agent Definitions | `.claude/agents/prizm-dev-team-*.md` |
|
|
468
|
+
| Agent Definitions | `.claude/agents/prizm-dev-team-*.md` | 2 agent types: dev, reviewer |
|
|
473
469
|
| Team Config | `.claude/team-info.json` | Team runtime configuration (project-level) |
|
|
474
470
|
|
|
475
471
|
The `generate-bootstrap-prompt.py` script resolves these paths automatically. If paths are incorrect, check the `build_replacements()` function in that script.
|
|
@@ -576,8 +572,8 @@ dev-pipeline/bugfix-state/ # Runtime state (gitignored)
|
|
|
576
572
|
| State dir | `state/` | N/A (in-session) | `bugfix-state/` |
|
|
577
573
|
| Ordering | Dependencies DAG → priority | N/A (single refactor per session) | Severity → priority (no dependencies) |
|
|
578
574
|
| Phases | 10-phase (specify → plan → tasks → implement → review) | 6-phase (analyze → plan → tasks → implement → review → commit) | 5-phase (triage → reproduce → fix → verify → commit) |
|
|
579
|
-
| Agents |
|
|
580
|
-
| Artifacts | spec.md, plan.md, tasks.md
|
|
575
|
+
| Agents | Orchestrator + Dev + Reviewer | Dev + Reviewer only | Dev + Reviewer only |
|
|
576
|
+
| Artifacts | spec.md, plan.md, tasks.md | refactor-analysis.md, plan.md, tasks.md | fix-plan.md, fix-report.md only |
|
|
581
577
|
| Commit prefix | `feat(<scope>):` | `refactor(<scope>):` | `fix(<scope>):` |
|
|
582
578
|
| Scope Guard | N/A | ✅ (behavior change → STOP) | N/A |
|
|
583
579
|
| Test Strategy | TDD per task | Full suite after EVERY task | Reproduction test |
|
|
@@ -13,18 +13,14 @@ dev-pipeline (outer loop)
|
|
|
13
13
|
├── scripts/ Python state management scripts
|
|
14
14
|
├── templates/bootstrap-prompt.md Session prompt template
|
|
15
15
|
│
|
|
16
|
-
└── [per session]
|
|
16
|
+
└── [per session] AI CLI
|
|
17
17
|
│
|
|
18
|
-
├──
|
|
19
|
-
├──
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
│ ├── Phase 6: Dev x N (parallel implement)
|
|
25
|
-
│ ├── Phase 7: QA + Review (parallel)
|
|
26
|
-
│ ├── Phase 8: Fix Loop (max 3 rounds)
|
|
27
|
-
│ └── Phase 9: Summarize & Commit
|
|
18
|
+
├── Phase 0: Init (Orchestrator)
|
|
19
|
+
├── Phase 1-2: Context snapshot + Plan & Tasks (Orchestrator)
|
|
20
|
+
├── Phase 3-4: Analyze (Reviewer agent)
|
|
21
|
+
├── Phase 5: Implement (Dev agent)
|
|
22
|
+
├── Phase 6: Review (Reviewer agent)
|
|
23
|
+
└── Phase 7: Retrospective & Commit (Orchestrator)
|
|
28
24
|
│
|
|
29
25
|
└── Write session-status.json → exit
|
|
30
26
|
```
|
|
@@ -33,16 +29,14 @@ dev-pipeline (outer loop)
|
|
|
33
29
|
|
|
34
30
|
| Agent | Definition Path | Type |
|
|
35
31
|
|-------|----------------|------|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| Review | `agent-team-master/prizm-dev-team/prizm-dev-team-review/subagent.md` | prizm-dev-team-review |
|
|
41
|
-
| Doc-Reader | `agent-team-master/prizm-dev-team/prizm-dev-team-doc-reader/subagent.md` | prizm-dev-team-doc-reader |
|
|
32
|
+
| Dev | `core/agents/prizm-dev-team-dev.md` | prizm-dev-team-dev |
|
|
33
|
+
| Reviewer | `core/agents/prizm-dev-team-reviewer.md` | prizm-dev-team-reviewer |
|
|
34
|
+
|
|
35
|
+
Note: The Orchestrator role is handled by the main agent (session orchestrator) directly — no separate agent definition needed.
|
|
42
36
|
|
|
43
37
|
## Validator Scripts
|
|
44
38
|
|
|
45
|
-
Located at `
|
|
39
|
+
Located at `dev-pipeline/scripts/`:
|
|
46
40
|
|
|
47
41
|
| Script | Checkpoint | Purpose |
|
|
48
42
|
|--------|-----------|---------|
|
|
@@ -62,7 +56,6 @@ Located at `agent-team-master/prizm-dev-team/prizm-dev-team-coordinator/scripts/
|
|
|
62
56
|
| 2 | `plans/plan.md` | Technical plan (architecture, API, tests) |
|
|
63
57
|
| 3 | `tasks/tasks.md` | Executable task list with `[ ]` / `[x]` |
|
|
64
58
|
| 4 | `analysis/analyze-report.md` | Consistency analysis |
|
|
65
|
-
| 9 | `specs/REGISTRY.md` | Completed features archive |
|
|
66
59
|
|
|
67
60
|
### Dev-Team Artifacts (.dev-team/)
|
|
68
61
|
|
|
@@ -82,13 +75,13 @@ Located at `agent-team-master/prizm-dev-team/prizm-dev-team-coordinator/scripts/
|
|
|
82
75
|
### 1. Session Start
|
|
83
76
|
|
|
84
77
|
The bootstrap prompt instructs the agent to:
|
|
85
|
-
-
|
|
86
|
-
- Spawn
|
|
87
|
-
-
|
|
78
|
+
- Execute phases directly as the session orchestrator
|
|
79
|
+
- Spawn Dev and Reviewer agents as subagents for implementation and review phases
|
|
80
|
+
- The orchestrator handles context building, planning, retrospective, and commit phases directly
|
|
88
81
|
|
|
89
82
|
### 2. Pipeline Execution
|
|
90
83
|
|
|
91
|
-
The
|
|
84
|
+
The Orchestrator drives the pipeline phases with checkpoints (CP-0 through CP-3). Each checkpoint validates artifacts.
|
|
92
85
|
|
|
93
86
|
### 3. Session End
|
|
94
87
|
|
|
@@ -430,6 +430,14 @@ Examples:
|
|
|
430
430
|
./launch-bugfix-daemon.sh logs --follow # Live log tailing
|
|
431
431
|
./launch-bugfix-daemon.sh stop # Graceful shutdown
|
|
432
432
|
./launch-bugfix-daemon.sh restart # Stop + start
|
|
433
|
+
|
|
434
|
+
Environment Variables (pass via --env):
|
|
435
|
+
MAX_RETRIES Max retries per bug (default: 3)
|
|
436
|
+
SESSION_TIMEOUT Session timeout in seconds (default: 0 = no limit)
|
|
437
|
+
VERBOSE Set to 1 for verbose AI CLI output
|
|
438
|
+
HEARTBEAT_INTERVAL Heartbeat log interval in seconds (default: 30)
|
|
439
|
+
DEV_BRANCH Custom dev branch name (default: auto-generated)
|
|
440
|
+
AUTO_PUSH Auto-push to remote after successful bug fix (default: 0, set 1 to enable)
|
|
433
441
|
HELP
|
|
434
442
|
}
|
|
435
443
|
|
|
@@ -576,6 +576,8 @@ Environment Variables (pass via --env):
|
|
|
576
576
|
SESSION_TIMEOUT Session timeout in seconds (default: 0 = no limit)
|
|
577
577
|
VERBOSE Set to 1 for verbose AI CLI output
|
|
578
578
|
HEARTBEAT_INTERVAL Heartbeat log interval in seconds (default: 30)
|
|
579
|
+
DEV_BRANCH Custom dev branch name (default: auto-generated)
|
|
580
|
+
AUTO_PUSH Auto-push to remote after successful feature (default: 0, set 1 to enable)
|
|
579
581
|
HELP
|
|
580
582
|
}
|
|
581
583
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================
|
|
3
|
+
# dev-pipeline/lib/branch.sh - Git Branch Lifecycle Library
|
|
4
|
+
#
|
|
5
|
+
# Shared by run.sh and run-bugfix.sh for branch-based serial
|
|
6
|
+
# development. Each pipeline run creates a dev branch and all
|
|
7
|
+
# features/bugs commit directly on it in sequence.
|
|
8
|
+
#
|
|
9
|
+
# Functions:
|
|
10
|
+
# branch_create — Create and checkout a new branch
|
|
11
|
+
# branch_return — Checkout back to original branch
|
|
12
|
+
#
|
|
13
|
+
# Environment:
|
|
14
|
+
# DEV_BRANCH — Optional custom branch name override
|
|
15
|
+
# AUTO_PUSH — Set to 1 to auto-push after successful feature
|
|
16
|
+
# ============================================================
|
|
17
|
+
|
|
18
|
+
# branch_create <project_root> <branch_name> <source_branch>
|
|
19
|
+
#
|
|
20
|
+
# Creates a new branch from source_branch and checks it out.
|
|
21
|
+
# If the branch already exists, checks it out instead.
|
|
22
|
+
#
|
|
23
|
+
# Returns 0 on success, 1 on failure.
|
|
24
|
+
branch_create() {
|
|
25
|
+
local project_root="$1"
|
|
26
|
+
local branch_name="$2"
|
|
27
|
+
local source_branch="$3"
|
|
28
|
+
|
|
29
|
+
# Check if branch already exists
|
|
30
|
+
if git -C "$project_root" rev-parse --verify "$branch_name" >/dev/null 2>&1; then
|
|
31
|
+
log_info "Branch already exists: $branch_name — checking out"
|
|
32
|
+
if ! git -C "$project_root" checkout "$branch_name" 2>/dev/null; then
|
|
33
|
+
log_error "Failed to checkout existing branch: $branch_name"
|
|
34
|
+
return 1
|
|
35
|
+
fi
|
|
36
|
+
return 0
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Create and checkout new branch
|
|
40
|
+
if ! git -C "$project_root" checkout -b "$branch_name" "$source_branch" 2>/dev/null; then
|
|
41
|
+
log_error "Failed to create branch: $branch_name from $source_branch"
|
|
42
|
+
return 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
log_info "Created and checked out branch: $branch_name (from $source_branch)"
|
|
46
|
+
return 0
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# branch_return <project_root> <original_branch>
|
|
50
|
+
#
|
|
51
|
+
# Checks out the original branch after pipeline completes.
|
|
52
|
+
# Safe to call even if already on the original branch.
|
|
53
|
+
#
|
|
54
|
+
# Returns 0 on success, 1 on failure.
|
|
55
|
+
branch_return() {
|
|
56
|
+
local project_root="$1"
|
|
57
|
+
local original_branch="$2"
|
|
58
|
+
|
|
59
|
+
local current_branch
|
|
60
|
+
current_branch=$(git -C "$project_root" rev-parse --abbrev-ref HEAD 2>/dev/null) || {
|
|
61
|
+
log_error "Failed to determine current branch"
|
|
62
|
+
return 1
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if [[ "$current_branch" == "$original_branch" ]]; then
|
|
66
|
+
return 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if ! git -C "$project_root" checkout "$original_branch" 2>/dev/null; then
|
|
70
|
+
log_error "Failed to checkout original branch: $original_branch"
|
|
71
|
+
return 1
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
log_info "Returned to branch: $original_branch"
|
|
75
|
+
return 0
|
|
76
|
+
}
|
|
@@ -232,17 +232,20 @@ if [[ -n "${MODEL:-}" ]]; then
|
|
|
232
232
|
MODEL_FLAG="--model $MODEL"
|
|
233
233
|
fi
|
|
234
234
|
|
|
235
|
+
unset CLAUDECODE 2>/dev/null || true
|
|
236
|
+
|
|
235
237
|
case "$CLI_CMD" in
|
|
236
238
|
*claude*)
|
|
239
|
+
# Claude Code: prompt via -p argument, --dangerously-skip-permissions for auto-accept
|
|
237
240
|
"$CLI_CMD" \
|
|
238
|
-
--print \
|
|
239
241
|
-p "$(cat "$BOOTSTRAP_PROMPT")" \
|
|
240
|
-
--
|
|
242
|
+
--dangerously-skip-permissions \
|
|
241
243
|
$STREAM_JSON_FLAG \
|
|
242
244
|
$MODEL_FLAG \
|
|
243
245
|
> "$SESSION_LOG" 2>&1 &
|
|
244
246
|
;;
|
|
245
247
|
*)
|
|
248
|
+
# CodeBuddy (cbc) and others: prompt via stdin
|
|
246
249
|
"$CLI_CMD" \
|
|
247
250
|
--print \
|
|
248
251
|
-y \
|
|
@@ -233,17 +233,20 @@ if [[ -n "${MODEL:-}" ]]; then
|
|
|
233
233
|
MODEL_FLAG="--model $MODEL"
|
|
234
234
|
fi
|
|
235
235
|
|
|
236
|
+
unset CLAUDECODE 2>/dev/null || true
|
|
237
|
+
|
|
236
238
|
case "$CLI_CMD" in
|
|
237
239
|
*claude*)
|
|
240
|
+
# Claude Code: prompt via -p argument, --dangerously-skip-permissions for auto-accept
|
|
238
241
|
"$CLI_CMD" \
|
|
239
|
-
--print \
|
|
240
242
|
-p "$(cat "$BOOTSTRAP_PROMPT")" \
|
|
241
|
-
--
|
|
243
|
+
--dangerously-skip-permissions \
|
|
242
244
|
$STREAM_JSON_FLAG \
|
|
243
245
|
$MODEL_FLAG \
|
|
244
246
|
> "$SESSION_LOG" 2>&1 &
|
|
245
247
|
;;
|
|
246
248
|
*)
|
|
249
|
+
# CodeBuddy (cbc) and others: prompt via stdin
|
|
247
250
|
"$CLI_CMD" \
|
|
248
251
|
--print \
|
|
249
252
|
-y \
|
|
@@ -25,6 +25,8 @@ set -euo pipefail
|
|
|
25
25
|
# LOG_CLEANUP_ENABLED Run periodic log cleanup (default: 1)
|
|
26
26
|
# LOG_RETENTION_DAYS Delete logs older than N days (default: 14)
|
|
27
27
|
# LOG_MAX_TOTAL_MB Keep total logs under N MB via oldest-first cleanup (default: 1024)
|
|
28
|
+
# DEV_BRANCH Custom dev branch name (default: auto-generated bugfix/pipeline-{run_id})
|
|
29
|
+
# AUTO_PUSH Auto-push to remote after successful bug fix (default: 0). Set to 1 to enable.
|
|
28
30
|
# ============================================================
|
|
29
31
|
|
|
30
32
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
@@ -40,6 +42,8 @@ LOG_CLEANUP_ENABLED=${LOG_CLEANUP_ENABLED:-1}
|
|
|
40
42
|
LOG_RETENTION_DAYS=${LOG_RETENTION_DAYS:-14}
|
|
41
43
|
LOG_MAX_TOTAL_MB=${LOG_MAX_TOTAL_MB:-1024}
|
|
42
44
|
VERBOSE=${VERBOSE:-0}
|
|
45
|
+
DEV_BRANCH=${DEV_BRANCH:-""}
|
|
46
|
+
AUTO_PUSH=${AUTO_PUSH:-0}
|
|
43
47
|
|
|
44
48
|
# Source shared common helpers (CLI/platform detection + logs + deps)
|
|
45
49
|
source "$SCRIPT_DIR/lib/common.sh"
|
|
@@ -48,12 +52,19 @@ prizm_detect_cli_and_platform
|
|
|
48
52
|
# Source shared heartbeat library
|
|
49
53
|
source "$SCRIPT_DIR/lib/heartbeat.sh"
|
|
50
54
|
|
|
55
|
+
# Source shared branch library
|
|
56
|
+
source "$SCRIPT_DIR/lib/branch.sh"
|
|
57
|
+
|
|
51
58
|
# Detect stream-json support
|
|
52
59
|
detect_stream_json_support "$CLI_CMD"
|
|
53
60
|
|
|
54
61
|
# Bug list path (set in main, used by cleanup trap)
|
|
55
62
|
BUG_LIST=""
|
|
56
63
|
|
|
64
|
+
# Branch tracking (for cleanup on interrupt)
|
|
65
|
+
_ORIGINAL_BRANCH=""
|
|
66
|
+
_DEV_BRANCH_NAME=""
|
|
67
|
+
|
|
57
68
|
# ============================================================
|
|
58
69
|
# Shared: Spawn AI CLI session and wait for result
|
|
59
70
|
# ============================================================
|
|
@@ -206,6 +217,12 @@ cleanup() {
|
|
|
206
217
|
# Kill all child processes (claude-internal, heartbeat, progress parser, etc.)
|
|
207
218
|
kill 0 2>/dev/null || true
|
|
208
219
|
|
|
220
|
+
# Log current branch info for recovery
|
|
221
|
+
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
222
|
+
log_info "Development was on branch: $_DEV_BRANCH_NAME"
|
|
223
|
+
log_info "Original branch was: $_ORIGINAL_BRANCH"
|
|
224
|
+
fi
|
|
225
|
+
|
|
209
226
|
if [[ -n "$BUG_LIST" && -f "$BUG_LIST" ]]; then
|
|
210
227
|
python3 "$SCRIPTS_DIR/update-bug-status.py" \
|
|
211
228
|
--bug-list "$BUG_LIST" \
|
|
@@ -386,17 +403,44 @@ sys.exit(1)
|
|
|
386
403
|
echo ""
|
|
387
404
|
log_warn "Interrupted. Killing session..."
|
|
388
405
|
kill 0 2>/dev/null || true
|
|
406
|
+
# Log current branch info
|
|
407
|
+
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
408
|
+
log_info "Development was on branch: $_DEV_BRANCH_NAME"
|
|
409
|
+
fi
|
|
389
410
|
log_info "Session log: $session_dir/logs/session.log"
|
|
390
411
|
exit 130
|
|
391
412
|
}
|
|
392
413
|
trap cleanup_single_bug SIGINT SIGTERM
|
|
393
414
|
|
|
394
415
|
_SPAWN_RESULT=""
|
|
416
|
+
|
|
417
|
+
# Branch lifecycle: create and checkout bugfix branch
|
|
418
|
+
local _proj_root
|
|
419
|
+
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
420
|
+
local _source_branch
|
|
421
|
+
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
422
|
+
_ORIGINAL_BRANCH="$_source_branch"
|
|
423
|
+
|
|
424
|
+
local _branch_name="${DEV_BRANCH:-bugfix/${bug_id}-$(date +%s)}"
|
|
425
|
+
if branch_create "$_proj_root" "$_branch_name" "$_source_branch"; then
|
|
426
|
+
_DEV_BRANCH_NAME="$_branch_name"
|
|
427
|
+
else
|
|
428
|
+
log_warn "Failed to create branch; running session on current branch"
|
|
429
|
+
fi
|
|
430
|
+
|
|
395
431
|
spawn_and_wait_session \
|
|
396
432
|
"$bug_id" "$bug_list" "$session_id" \
|
|
397
433
|
"$bootstrap_prompt" "$session_dir" 999
|
|
398
434
|
local session_status="$_SPAWN_RESULT"
|
|
399
435
|
|
|
436
|
+
# Auto-push after successful session
|
|
437
|
+
if [[ "$session_status" == "success" && "$AUTO_PUSH" == "1" ]]; then
|
|
438
|
+
local _proj_root
|
|
439
|
+
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
440
|
+
log_info "AUTO_PUSH enabled; pushing to remote..."
|
|
441
|
+
git -C "$_proj_root" push -u origin "$_DEV_BRANCH_NAME" 2>/dev/null || log_warn "Auto-push failed"
|
|
442
|
+
fi
|
|
443
|
+
|
|
400
444
|
echo ""
|
|
401
445
|
if [[ "$session_status" == "success" ]]; then
|
|
402
446
|
log_success "════════════════════════════════════════════════════"
|
|
@@ -472,6 +516,23 @@ main() {
|
|
|
472
516
|
echo -e "${BOLD}════════════════════════════════════════════════════${NC}"
|
|
473
517
|
echo ""
|
|
474
518
|
|
|
519
|
+
# Branch lifecycle: create bugfix branch for this pipeline run
|
|
520
|
+
local _proj_root
|
|
521
|
+
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
522
|
+
local _source_branch
|
|
523
|
+
_source_branch=$(git -C "$_proj_root" rev-parse --abbrev-ref HEAD 2>/dev/null || echo "main")
|
|
524
|
+
_ORIGINAL_BRANCH="$_source_branch"
|
|
525
|
+
|
|
526
|
+
local run_id_for_branch
|
|
527
|
+
run_id_for_branch=$(jq -r '.run_id' "$STATE_DIR/pipeline.json" 2>/dev/null || echo "$$")
|
|
528
|
+
local _branch_name="${DEV_BRANCH:-bugfix/pipeline-${run_id_for_branch}}"
|
|
529
|
+
if branch_create "$_proj_root" "$_branch_name" "$_source_branch"; then
|
|
530
|
+
_DEV_BRANCH_NAME="$_branch_name"
|
|
531
|
+
log_info "Dev branch: $_branch_name"
|
|
532
|
+
else
|
|
533
|
+
log_warn "Failed to create bugfix branch; running on current branch: $_source_branch"
|
|
534
|
+
fi
|
|
535
|
+
|
|
475
536
|
local session_count=0
|
|
476
537
|
|
|
477
538
|
while true; do
|
|
@@ -488,6 +549,10 @@ main() {
|
|
|
488
549
|
log_success "════════════════════════════════════════════════════"
|
|
489
550
|
log_success " All bugs processed! Bug fix pipeline finished."
|
|
490
551
|
log_success " Total sessions: $session_count"
|
|
552
|
+
if [[ -n "$_DEV_BRANCH_NAME" ]]; then
|
|
553
|
+
log_success " Dev branch: $_DEV_BRANCH_NAME"
|
|
554
|
+
log_success " Merge with: git checkout $_ORIGINAL_BRANCH && git merge $_DEV_BRANCH_NAME"
|
|
555
|
+
fi
|
|
491
556
|
log_success "════════════════════════════════════════════════════"
|
|
492
557
|
rm -f "$STATE_DIR/current-session.json"
|
|
493
558
|
break
|
|
@@ -557,10 +622,19 @@ os.replace(tmp, target)
|
|
|
557
622
|
# Spawn session
|
|
558
623
|
log_info "Spawning AI CLI session: $session_id"
|
|
559
624
|
_SPAWN_RESULT=""
|
|
625
|
+
|
|
560
626
|
spawn_and_wait_session \
|
|
561
627
|
"$bug_id" "$bug_list" "$session_id" \
|
|
562
628
|
"$bootstrap_prompt" "$session_dir" "$MAX_RETRIES"
|
|
563
629
|
|
|
630
|
+
# Auto-push after successful session
|
|
631
|
+
if [[ "$_SPAWN_RESULT" == "success" && "$AUTO_PUSH" == "1" ]]; then
|
|
632
|
+
local _proj_root
|
|
633
|
+
_proj_root="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
634
|
+
log_info "AUTO_PUSH enabled; pushing to remote..."
|
|
635
|
+
git -C "$_proj_root" push 2>/dev/null || log_warn "Auto-push failed"
|
|
636
|
+
fi
|
|
637
|
+
|
|
564
638
|
session_count=$((session_count + 1))
|
|
565
639
|
|
|
566
640
|
log_info "Pausing 5s before next bug..."
|