prizmkit 1.1.92 → 1.1.93
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/.env.example +0 -4
- package/bundled/dev-pipeline/README.md +9 -39
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +0 -4
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -2
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +0 -1
- package/bundled/dev-pipeline/launch-feature-daemon.sh +2 -3
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +0 -1
- package/bundled/dev-pipeline/run-bugfix.sh +7 -67
- package/bundled/dev-pipeline/run-feature.sh +6 -84
- package/bundled/dev-pipeline/run-recovery.sh +1 -32
- package/bundled/dev-pipeline/run-refactor.sh +6 -68
- package/bundled/dev-pipeline/tests/test-deploy-safety.sh +3 -3
- package/bundled/dev-pipeline-windows/.env.example +0 -4
- package/bundled/dev-pipeline-windows/SCHEMA_ANALYSIS.md +0 -4
- package/bundled/dev-pipeline-windows/assets/prizm-dev-team-integration.md +0 -2
- package/bundled/dev-pipeline-windows/lib/pipeline.ps1 +13 -90
- package/bundled/dev-pipeline-windows/run-recovery.ps1 +4 -19
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +1 -1
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +5 -15
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +4 -4
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +3 -13
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +3 -3
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +4 -14
- package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +1 -1
- package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +4 -14
- package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +4 -4
- package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +2 -12
- package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +3 -3
- package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +4 -14
- package/package.json +1 -1
- package/bundled/dev-pipeline/scripts/cleanup-logs.py +0 -192
- package/bundled/dev-pipeline-windows/scripts/cleanup-logs.py +0 -192
|
@@ -12,7 +12,6 @@ Translating user responses to env vars:
|
|
|
12
12
|
| Verbose: On | `VERBOSE=1` |
|
|
13
13
|
| Max retries: N | `MAX_RETRIES=N` |
|
|
14
14
|
| Critic: On | `ENABLE_CRITIC=1` |
|
|
15
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
16
15
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
17
16
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
18
17
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -28,9 +27,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
28
27
|
| `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `bugfix/pipeline-{run_id}`) |
|
|
29
28
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
30
29
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
31
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
32
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
33
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
34
30
|
|
|
35
31
|
## Interactive Configuration Options
|
|
36
32
|
|
|
@@ -52,28 +48,22 @@ Present these via `AskUserQuestion` in step 5. Round 1 is one `AskUserQuestion`
|
|
|
52
48
|
- On — Enable adversarial critic review (`ENABLE_CRITIC=1`): an independent AI agent reviews the diagnosis/plan for completeness and the fix for defects, edge cases, and regression risks. Adds ~5-10 min per bug.
|
|
53
49
|
|
|
54
50
|
**Question 4 — Advanced config?** (multiSelect: false):
|
|
55
|
-
- No (default) — Use defaults for
|
|
56
|
-
- Yes — Configure
|
|
51
|
+
- No (default) — Use defaults for failure behavior
|
|
52
|
+
- Yes — Configure stop-on-failure, deploy, and reasoning effort options
|
|
57
53
|
|
|
58
54
|
Note: Bug filter defaults to all bugs (by severity order). Default Critic to Off unless bugs have `severity: "critical"` or `severity: "high"` (in which case default to On). If the user selects "Other" on any option, handle their custom input.
|
|
59
55
|
|
|
60
56
|
### Round 2 (only if Advanced config = Yes)
|
|
61
57
|
|
|
62
|
-
**Question 1 —
|
|
63
|
-
- None (default) — No timeout
|
|
64
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
65
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
66
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
67
|
-
|
|
68
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
58
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
69
59
|
- Off (default) — Pipeline continues to next task after failure
|
|
70
60
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
71
61
|
|
|
72
|
-
**Question
|
|
62
|
+
**Question 2 — Deploy after completion?** (multiSelect: false):
|
|
73
63
|
- No (default) — Skip deployment after pipeline completes
|
|
74
64
|
- Yes — Run /prizmkit-deploy automatically after all bugs fixed successfully (`ENABLE_DEPLOY=1`). Deployment is blocked if any bug was not fixed (status not 'completed', 'skipped', or 'needs_info').
|
|
75
65
|
|
|
76
|
-
**Question
|
|
66
|
+
**Question 3 — Reasoning effort** (multiSelect: false):
|
|
77
67
|
- Default (none) — Use CLI default
|
|
78
68
|
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
79
69
|
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
|
@@ -150,12 +150,12 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
150
150
|
- 5
|
|
151
151
|
|
|
152
152
|
**Question 4 — Advanced config?** (multiSelect: false):
|
|
153
|
-
- No (default) — Use defaults for
|
|
154
|
-
- Yes — Configure
|
|
153
|
+
- No (default) — Use defaults for failure behavior
|
|
154
|
+
- Yes — Configure stop-on-failure, deploy-after-completion, and reasoning effort options
|
|
155
155
|
|
|
156
156
|
Default Critic to Off unless features have `estimated_complexity: "high"` or above (in which case default to On).
|
|
157
157
|
|
|
158
|
-
**If user chose "Yes" to Advanced config**, ask a second round of `AskUserQuestion` — see the advanced config questions (
|
|
158
|
+
**If user chose "Yes" to Advanced config**, ask a second round of `AskUserQuestion` — see the advanced config questions (stop-on-failure, deploy-after-completion, reasoning effort) in `${SKILL_DIR}/references/configuration.md`.
|
|
159
159
|
|
|
160
160
|
**Environment variable mapping** and **advanced environment variables** tables — read `${SKILL_DIR}/references/configuration.md` for the full translation tables (8 config→env mappings + 9 advanced variables).
|
|
161
161
|
|
|
@@ -168,7 +168,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
168
168
|
```
|
|
169
169
|
With all options:
|
|
170
170
|
```bash
|
|
171
|
-
VERBOSE=1 ENABLE_CRITIC=true MAX_RETRIES=5
|
|
171
|
+
VERBOSE=1 ENABLE_CRITIC=true MAX_RETRIES=5 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
|
|
172
172
|
.prizmkit/dev-pipeline/run-feature.sh run .prizmkit/plans/feature-list.json --features F-001:F-005
|
|
173
173
|
```
|
|
174
174
|
|
|
@@ -6,21 +6,15 @@ Environment variable mappings for the feature launcher.
|
|
|
6
6
|
|
|
7
7
|
Asked only when the user chose "Yes" to Advanced config in step 6.
|
|
8
8
|
|
|
9
|
-
**Question 1 —
|
|
10
|
-
- None (default) — No timeout
|
|
11
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
12
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
13
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
14
|
-
|
|
15
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
9
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
16
10
|
- Off (default) — Pipeline continues to next task after failure
|
|
17
11
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
18
12
|
|
|
19
|
-
**Question
|
|
13
|
+
**Question 2 — Deploy after completion?** (multiSelect: false):
|
|
20
14
|
- No (default) — Skip deployment after pipeline completes
|
|
21
15
|
- Yes — Run /prizmkit-deploy automatically after all features complete successfully (`ENABLE_DEPLOY=1`). Deployment is blocked if any feature did not complete successfully (status not 'completed' or manually 'skipped').
|
|
22
16
|
|
|
23
|
-
**Question
|
|
17
|
+
**Question 3 — Reasoning effort** (multiSelect: false):
|
|
24
18
|
- Default (none) — Use CLI default
|
|
25
19
|
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
26
20
|
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
|
@@ -38,7 +32,6 @@ Translating user responses to env vars:
|
|
|
38
32
|
| Verbose: Off | `VERBOSE=0` |
|
|
39
33
|
| Verbose: On | `VERBOSE=1` |
|
|
40
34
|
| Max retries: N | `MAX_RETRIES=N` |
|
|
41
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
42
35
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
43
36
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
44
37
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -55,9 +48,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
55
48
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
56
49
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
57
50
|
| `PIPELINE_MODE` | (none) | Override mode for all features: `lite`\|`standard`\|`full` |
|
|
58
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
59
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
60
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
61
51
|
|
|
62
52
|
## Error Handling
|
|
63
53
|
|
|
@@ -154,8 +154,8 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
154
154
|
- Off — Skip post-task test verification (faster but riskier)
|
|
155
155
|
|
|
156
156
|
**Question 4 — Advanced config?** (multiSelect: false):
|
|
157
|
-
- No (default) — Use defaults for critic review
|
|
158
|
-
- Yes — Configure critic review,
|
|
157
|
+
- No (default) — Use defaults for critic review and failure behavior
|
|
158
|
+
- Yes — Configure critic review, stop-on-failure, and reasoning effort options
|
|
159
159
|
|
|
160
160
|
Note: Refactor filter defaults to all refactor items (by priority order). If the user selects "Other" on any option, handle their custom input.
|
|
161
161
|
|
|
@@ -172,7 +172,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
172
172
|
```
|
|
173
173
|
With all options:
|
|
174
174
|
```bash
|
|
175
|
-
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5
|
|
175
|
+
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
|
|
176
176
|
.prizmkit/dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
|
|
177
177
|
```
|
|
178
178
|
|
|
@@ -14,7 +14,6 @@ Translating user responses to env vars:
|
|
|
14
14
|
| Strict behavior: On | `STRICT_BEHAVIOR_CHECK=1` |
|
|
15
15
|
| Strict behavior: Off | `STRICT_BEHAVIOR_CHECK=0` |
|
|
16
16
|
| Critic: On | `ENABLE_CRITIC=true` |
|
|
17
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
18
17
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
19
18
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
20
19
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -30,9 +29,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
30
29
|
| `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `refactor/pipeline-{run_id}`) |
|
|
31
30
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
32
31
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
33
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
34
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
35
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
36
32
|
|
|
37
33
|
## Error Handling
|
|
38
34
|
|
|
@@ -57,23 +53,17 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
57
53
|
|
|
58
54
|
Only run this when the user answered "Yes" to the **Advanced config?** question in step 6. It applies to a minority of sessions.
|
|
59
55
|
|
|
60
|
-
Ask a second round of `AskUserQuestion` with these
|
|
56
|
+
Ask a second round of `AskUserQuestion` with these 3 questions:
|
|
61
57
|
|
|
62
|
-
**Question 1 —
|
|
63
|
-
- None (default) — No timeout
|
|
64
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
65
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
66
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
67
|
-
|
|
68
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
58
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
69
59
|
- Off (default) — Pipeline continues to next task after failure
|
|
70
60
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
71
61
|
|
|
72
|
-
**Question
|
|
62
|
+
**Question 2 — Critic review** (multiSelect: false):
|
|
73
63
|
- Off (default) — Skip adversarial review
|
|
74
64
|
- On — Enable adversarial critic review: an independent AI agent reviews the refactor plan for completeness and the implementation for regressions, missed edge cases, and behavior violations. Adds ~5-10 min per refactor task.
|
|
75
65
|
|
|
76
|
-
**Question
|
|
66
|
+
**Question 3 — Deploy after completion?** (multiSelect: false):
|
|
77
67
|
- No (default) — Skip deployment after pipeline completes
|
|
78
68
|
- Yes — Run /prizmkit-deploy automatically after all refactors complete successfully (`ENABLE_DEPLOY=1`). Deployment is blocked if any refactor did not complete successfully (status not 'completed' or manually 'skipped').
|
|
79
69
|
|
|
@@ -155,7 +155,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
155
155
|
```
|
|
156
156
|
With all options:
|
|
157
157
|
```powershell
|
|
158
|
-
$env:VERBOSE = "1"; $env:MAX_RETRIES = "5"; $env:
|
|
158
|
+
$env:VERBOSE = "1"; $env:MAX_RETRIES = "5"; $env:PRIZMKIT_EFFORT = "high"
|
|
159
159
|
.\.prizmkit\dev-pipeline\run-bugfix.ps1 run .prizmkit/plans/bug-fix-list.json
|
|
160
160
|
```
|
|
161
161
|
|
|
@@ -12,7 +12,6 @@ Translating user responses to env vars:
|
|
|
12
12
|
| Verbose: On | `VERBOSE=1` |
|
|
13
13
|
| Max retries: N | `MAX_RETRIES=N` |
|
|
14
14
|
| Critic: On | `ENABLE_CRITIC=1` |
|
|
15
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
16
15
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
17
16
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
18
17
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -28,9 +27,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
28
27
|
| `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `bugfix/pipeline-{run_id}`) |
|
|
29
28
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
30
29
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
31
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
32
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
33
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
34
30
|
|
|
35
31
|
## Interactive Configuration Options
|
|
36
32
|
|
|
@@ -52,24 +48,18 @@ Present these via `AskUserQuestion` in step 5. Round 1 is one `AskUserQuestion`
|
|
|
52
48
|
- On — Enable adversarial critic review (`ENABLE_CRITIC=1`): an independent AI agent reviews the diagnosis/plan for completeness and the fix for defects, edge cases, and regression risks. Adds ~5-10 min per bug.
|
|
53
49
|
|
|
54
50
|
**Question 4 — Advanced config?** (multiSelect: false):
|
|
55
|
-
- No (default) — Use defaults for
|
|
56
|
-
- Yes — Configure
|
|
51
|
+
- No (default) — Use defaults for failure behavior
|
|
52
|
+
- Yes — Configure stop-on-failure, and reasoning effort options
|
|
57
53
|
|
|
58
54
|
Note: Bug filter defaults to all bugs (by severity order). Default Critic to Off unless bugs have `severity: "critical"` or `severity: "high"` (in which case default to On). If the user selects "Other" on any option, handle their custom input.
|
|
59
55
|
|
|
60
56
|
### Round 2 (only if Advanced config = Yes)
|
|
61
57
|
|
|
62
|
-
**Question 1 —
|
|
63
|
-
- None (default) — No timeout
|
|
64
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
65
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
66
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
67
|
-
|
|
68
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
58
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
69
59
|
- Off (default) — Pipeline continues to next task after failure
|
|
70
60
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
71
61
|
|
|
72
|
-
**Question
|
|
62
|
+
**Question 2 — Reasoning effort** (multiSelect: false):
|
|
73
63
|
- Default (none) — Use CLI default
|
|
74
64
|
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
75
65
|
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
|
@@ -176,12 +176,12 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
176
176
|
- 5
|
|
177
177
|
|
|
178
178
|
**Question 4 — Advanced config?** (multiSelect: false):
|
|
179
|
-
- No (default) — Use defaults for
|
|
180
|
-
- Yes — Configure
|
|
179
|
+
- No (default) — Use defaults for failure behavior
|
|
180
|
+
- Yes — Configure stop-on-failure, and reasoning effort options
|
|
181
181
|
|
|
182
182
|
Default Critic to Off unless features have `estimated_complexity: "high"` or above (in which case default to On).
|
|
183
183
|
|
|
184
|
-
**If user chose "Yes" to Advanced config**, ask a second round of `AskUserQuestion` — see the advanced config questions (
|
|
184
|
+
**If user chose "Yes" to Advanced config**, ask a second round of `AskUserQuestion` — see the advanced config questions (stop-on-failure, reasoning effort) in `${SKILL_DIR}/references/configuration.md`.
|
|
185
185
|
|
|
186
186
|
**Environment variable mapping** and **advanced environment variables** tables — read `${SKILL_DIR}/references/configuration.md` for the full translation tables (8 config→env mappings + 9 advanced variables).
|
|
187
187
|
|
|
@@ -195,7 +195,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
195
195
|
```
|
|
196
196
|
With all options:
|
|
197
197
|
```powershell
|
|
198
|
-
$env:VERBOSE = "1"; $env:ENABLE_CRITIC = "true"; $env:MAX_RETRIES = "5"; $env:
|
|
198
|
+
$env:VERBOSE = "1"; $env:ENABLE_CRITIC = "true"; $env:MAX_RETRIES = "5"; $env:PRIZMKIT_EFFORT = "high"
|
|
199
199
|
.\.prizmkit\dev-pipeline\run-feature.ps1 run .prizmkit/plans/feature-list.json --features F-001:F-005
|
|
200
200
|
```
|
|
201
201
|
|
|
@@ -6,17 +6,11 @@ Environment variable mappings for the feature launcher.
|
|
|
6
6
|
|
|
7
7
|
Asked only when the user chose "Yes" to Advanced config in step 6.
|
|
8
8
|
|
|
9
|
-
**Question 1 —
|
|
10
|
-
- None (default) — No timeout
|
|
11
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
12
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
13
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
14
|
-
|
|
15
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
9
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
16
10
|
- Off (default) — Pipeline continues to next task after failure
|
|
17
11
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
18
12
|
|
|
19
|
-
**Question
|
|
13
|
+
**Question 2 — Reasoning effort** (multiSelect: false):
|
|
20
14
|
- Default (none) — Use CLI default
|
|
21
15
|
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
22
16
|
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
|
@@ -34,7 +28,6 @@ Translating user responses to env vars:
|
|
|
34
28
|
| Verbose: Off | `VERBOSE=0` |
|
|
35
29
|
| Verbose: On | `VERBOSE=1` |
|
|
36
30
|
| Max retries: N | `MAX_RETRIES=N` |
|
|
37
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
38
31
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
39
32
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
40
33
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -51,9 +44,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
51
44
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
52
45
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
53
46
|
| `PIPELINE_MODE` | (none) | Override mode for all features: `lite`\|`standard`\|`full` |
|
|
54
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
55
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
56
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
57
47
|
|
|
58
48
|
## Error Handling
|
|
59
49
|
|
|
@@ -176,8 +176,8 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
176
176
|
- 5
|
|
177
177
|
|
|
178
178
|
**Question 3 — Advanced config?** (multiSelect: false):
|
|
179
|
-
- No (default) — Use defaults for critic review
|
|
180
|
-
- Yes — Configure critic review,
|
|
179
|
+
- No (default) — Use defaults for critic review and failure behavior
|
|
180
|
+
- Yes — Configure critic review, stop-on-failure, and reasoning effort options
|
|
181
181
|
|
|
182
182
|
Note: Refactor filter defaults to all refactor items (by priority order). If the user selects "Other" on any option, handle their custom input.
|
|
183
183
|
|
|
@@ -195,7 +195,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
195
195
|
```
|
|
196
196
|
With all options:
|
|
197
197
|
```powershell
|
|
198
|
-
$env:VERBOSE = "1"; $env:MAX_RETRIES = "5"; $env:
|
|
198
|
+
$env:VERBOSE = "1"; $env:MAX_RETRIES = "5"; $env:PRIZMKIT_EFFORT = "high"
|
|
199
199
|
.\.prizmkit\dev-pipeline\run-refactor.ps1 run .prizmkit/plans/refactor-list.json
|
|
200
200
|
```
|
|
201
201
|
|
|
@@ -14,7 +14,6 @@ Translating user responses to env vars:
|
|
|
14
14
|
| Strict behavior: On | `STRICT_BEHAVIOR_CHECK=1` |
|
|
15
15
|
| Strict behavior: Off | `STRICT_BEHAVIOR_CHECK=0` |
|
|
16
16
|
| Critic: On | `ENABLE_CRITIC=true` |
|
|
17
|
-
| Timeout: value | `SESSION_TIMEOUT=<seconds>` |
|
|
18
17
|
| Stop on failure: On | `STOP_ON_FAILURE=1` |
|
|
19
18
|
| Deploy: Yes | `ENABLE_DEPLOY=1` |
|
|
20
19
|
| Effort: value | `PRIZMKIT_EFFORT=<value>` |
|
|
@@ -30,9 +29,6 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
30
29
|
| `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `refactor/pipeline-{run_id}`) |
|
|
31
30
|
| `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
|
|
32
31
|
| `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
|
|
33
|
-
| `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
|
|
34
|
-
| `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
|
|
35
|
-
| `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
|
|
36
32
|
|
|
37
33
|
## Error Handling
|
|
38
34
|
|
|
@@ -57,23 +53,17 @@ Not exposed in interactive menu, pass via `--env`:
|
|
|
57
53
|
|
|
58
54
|
Only run this when the user answered "Yes" to the **Advanced config?** question in step 6. It applies to a minority of sessions.
|
|
59
55
|
|
|
60
|
-
Ask a second round of `AskUserQuestion` with these
|
|
56
|
+
Ask a second round of `AskUserQuestion` with these 3 questions:
|
|
61
57
|
|
|
62
|
-
**Question 1 —
|
|
63
|
-
- None (default) — No timeout
|
|
64
|
-
- 30 min — `SESSION_TIMEOUT=1800`
|
|
65
|
-
- 1 hour — `SESSION_TIMEOUT=3600`
|
|
66
|
-
- 2 hours — `SESSION_TIMEOUT=7200`
|
|
67
|
-
|
|
68
|
-
**Question 2 — Stop on failure** (multiSelect: false):
|
|
58
|
+
**Question 1 — Stop on failure** (multiSelect: false):
|
|
69
59
|
- Off (default) — Pipeline continues to next task after failure
|
|
70
60
|
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
71
61
|
|
|
72
|
-
**Question
|
|
62
|
+
**Question 2 — Critic review** (multiSelect: false):
|
|
73
63
|
- Off (default) — Skip adversarial review
|
|
74
64
|
- On — Enable adversarial critic review: an independent AI agent reviews the refactor plan for completeness and the implementation for regressions, missing edge cases, and behavior violations. Adds ~5-10 min per refactor task.
|
|
75
65
|
|
|
76
|
-
**Question
|
|
66
|
+
**Question 3 — Reasoning effort** (multiSelect: false):
|
|
77
67
|
- Default (none) — Use CLI default
|
|
78
68
|
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
79
69
|
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
package/package.json
CHANGED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Clean up pipeline session logs by age and total size.
|
|
3
|
-
|
|
4
|
-
Targets files under any `.../sessions/.../logs/` directory inside a state dir.
|
|
5
|
-
|
|
6
|
-
Policies:
|
|
7
|
-
1) Remove files older than retention window.
|
|
8
|
-
2) If total remaining size still exceeds max threshold, remove oldest files first
|
|
9
|
-
until within threshold.
|
|
10
|
-
|
|
11
|
-
Usage:
|
|
12
|
-
python3 cleanup-logs.py --state-dir .prizmkit/state/features
|
|
13
|
-
python3 cleanup-logs.py --state-dir .prizmkit/state/bugfix --retention-days 30 --max-total-mb 2048
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
import argparse
|
|
17
|
-
import json
|
|
18
|
-
import os
|
|
19
|
-
import time
|
|
20
|
-
|
|
21
|
-
from utils import error_out, setup_logging
|
|
22
|
-
|
|
23
|
-
LOGGER = setup_logging("cleanup-logs")
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def parse_args():
|
|
27
|
-
parser = argparse.ArgumentParser(description="Cleanup pipeline logs by age and total size.")
|
|
28
|
-
parser.add_argument("--state-dir", required=True, help="State directory to scan")
|
|
29
|
-
parser.add_argument(
|
|
30
|
-
"--retention-days",
|
|
31
|
-
type=int,
|
|
32
|
-
default=14,
|
|
33
|
-
help="Delete logs older than this many days (default: 14)",
|
|
34
|
-
)
|
|
35
|
-
parser.add_argument(
|
|
36
|
-
"--max-total-mb",
|
|
37
|
-
type=int,
|
|
38
|
-
default=1024,
|
|
39
|
-
help="Target max total log size in MB after cleanup (default: 1024)",
|
|
40
|
-
)
|
|
41
|
-
parser.add_argument("--dry-run", action="store_true", help="Report actions without deleting")
|
|
42
|
-
return parser.parse_args()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def iter_log_files(state_dir):
|
|
46
|
-
"""Yield absolute paths of files inside .../sessions/.../logs/ directories."""
|
|
47
|
-
for root, _dirs, files in os.walk(state_dir):
|
|
48
|
-
if os.path.basename(root) != "logs":
|
|
49
|
-
continue
|
|
50
|
-
|
|
51
|
-
normalized = root.replace("\\", "/")
|
|
52
|
-
if "/sessions/" not in normalized:
|
|
53
|
-
continue
|
|
54
|
-
|
|
55
|
-
for name in files:
|
|
56
|
-
if name == ".DS_Store":
|
|
57
|
-
continue
|
|
58
|
-
yield os.path.join(root, name)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def file_info(path):
|
|
62
|
-
"""Return file metadata dict with path, size, and mtime."""
|
|
63
|
-
st = os.stat(path)
|
|
64
|
-
return {"path": path, "size": st.st_size, "mtime": st.st_mtime}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def remove_file(path, dry_run=False):
|
|
68
|
-
if dry_run:
|
|
69
|
-
return True
|
|
70
|
-
try:
|
|
71
|
-
os.remove(path)
|
|
72
|
-
return True
|
|
73
|
-
except OSError:
|
|
74
|
-
return False
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def cleanup_empty_dirs(state_dir, dry_run=False):
|
|
78
|
-
"""Remove empty logs directories bottom-up."""
|
|
79
|
-
removed = 0
|
|
80
|
-
for root, dirs, _files in os.walk(state_dir, topdown=False):
|
|
81
|
-
for d in dirs:
|
|
82
|
-
full = os.path.join(root, d)
|
|
83
|
-
if os.path.basename(full) != "logs":
|
|
84
|
-
continue
|
|
85
|
-
try:
|
|
86
|
-
if not os.listdir(full):
|
|
87
|
-
if not dry_run:
|
|
88
|
-
os.rmdir(full)
|
|
89
|
-
removed += 1
|
|
90
|
-
except OSError:
|
|
91
|
-
continue
|
|
92
|
-
return removed
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def main():
|
|
96
|
-
args = parse_args()
|
|
97
|
-
state_dir = os.path.abspath(args.state_dir)
|
|
98
|
-
|
|
99
|
-
if not os.path.isdir(state_dir):
|
|
100
|
-
error_out("State directory not found: {}".format(state_dir), code=2)
|
|
101
|
-
|
|
102
|
-
if args.retention_days < 0:
|
|
103
|
-
error_out("retention-days must be >= 0", code=2)
|
|
104
|
-
if args.max_total_mb < 0:
|
|
105
|
-
error_out("max-total-mb must be >= 0", code=2)
|
|
106
|
-
|
|
107
|
-
now = time.time()
|
|
108
|
-
retention_cutoff = now - (args.retention_days * 86400)
|
|
109
|
-
max_total_bytes = args.max_total_mb * 1024 * 1024
|
|
110
|
-
|
|
111
|
-
files = []
|
|
112
|
-
for path in iter_log_files(state_dir):
|
|
113
|
-
try:
|
|
114
|
-
files.append(file_info(path))
|
|
115
|
-
except OSError:
|
|
116
|
-
continue
|
|
117
|
-
|
|
118
|
-
initial_total = sum(f["size"] for f in files)
|
|
119
|
-
|
|
120
|
-
deleted_files = []
|
|
121
|
-
kept_files = []
|
|
122
|
-
|
|
123
|
-
# Step 1: age-based cleanup
|
|
124
|
-
for f in files:
|
|
125
|
-
if f["mtime"] < retention_cutoff:
|
|
126
|
-
if remove_file(f["path"], dry_run=args.dry_run):
|
|
127
|
-
deleted_files.append({**f, "reason": "retention"})
|
|
128
|
-
else:
|
|
129
|
-
kept_files.append(f)
|
|
130
|
-
else:
|
|
131
|
-
kept_files.append(f)
|
|
132
|
-
|
|
133
|
-
# Step 2: size-based cleanup (oldest first)
|
|
134
|
-
current_total = sum(f["size"] for f in kept_files)
|
|
135
|
-
if current_total > max_total_bytes:
|
|
136
|
-
kept_files.sort(key=lambda x: x["mtime"]) # oldest first
|
|
137
|
-
still_kept = []
|
|
138
|
-
for f in kept_files:
|
|
139
|
-
if current_total <= max_total_bytes:
|
|
140
|
-
still_kept.append(f)
|
|
141
|
-
continue
|
|
142
|
-
|
|
143
|
-
if remove_file(f["path"], dry_run=args.dry_run):
|
|
144
|
-
deleted_files.append({**f, "reason": "size"})
|
|
145
|
-
current_total -= f["size"]
|
|
146
|
-
else:
|
|
147
|
-
still_kept.append(f)
|
|
148
|
-
|
|
149
|
-
kept_files = still_kept
|
|
150
|
-
|
|
151
|
-
removed_empty_log_dirs = cleanup_empty_dirs(state_dir, dry_run=args.dry_run)
|
|
152
|
-
|
|
153
|
-
final_total = sum(f["size"] for f in kept_files)
|
|
154
|
-
reclaimed = initial_total - final_total
|
|
155
|
-
|
|
156
|
-
report = {
|
|
157
|
-
"success": True,
|
|
158
|
-
"state_dir": state_dir,
|
|
159
|
-
"dry_run": args.dry_run,
|
|
160
|
-
"retention_days": args.retention_days,
|
|
161
|
-
"max_total_mb": args.max_total_mb,
|
|
162
|
-
"initial_files": len(files),
|
|
163
|
-
"deleted_files": len(deleted_files),
|
|
164
|
-
"deleted_by_reason": {
|
|
165
|
-
"retention": sum(1 for f in deleted_files if f["reason"] == "retention"),
|
|
166
|
-
"size": sum(1 for f in deleted_files if f["reason"] == "size"),
|
|
167
|
-
},
|
|
168
|
-
"removed_empty_log_dirs": removed_empty_log_dirs,
|
|
169
|
-
"initial_total_bytes": initial_total,
|
|
170
|
-
"final_total_bytes": final_total,
|
|
171
|
-
"reclaimed_bytes": reclaimed,
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
LOGGER.info(
|
|
175
|
-
"cleanup complete: deleted=%s reclaimed=%sKB",
|
|
176
|
-
report["deleted_files"],
|
|
177
|
-
int(report["reclaimed_bytes"] / 1024),
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
print(json.dumps(report, indent=2, ensure_ascii=False))
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if __name__ == "__main__":
|
|
184
|
-
try:
|
|
185
|
-
main()
|
|
186
|
-
except KeyboardInterrupt:
|
|
187
|
-
error_out("cleanup-logs interrupted", code=130)
|
|
188
|
-
except SystemExit:
|
|
189
|
-
raise
|
|
190
|
-
except Exception as exc:
|
|
191
|
-
LOGGER.exception("Unhandled exception in cleanup-logs")
|
|
192
|
-
error_out("cleanup-logs failed: {}".format(str(exc)), code=1)
|