prizmkit 1.1.193 → 1.1.195
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/bin/create-prizmkit.js +43 -12
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/.env.example +5 -0
- package/bundled/dev-pipeline/README.md +2 -1
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +111 -30
- package/bundled/dev-pipeline/prizmkit_runtime/cli.py +44 -3
- package/bundled/dev-pipeline/prizmkit_runtime/commands.py +29 -9
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +121 -44
- package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +190 -37
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/prizmkit_runtime/iterate.py +2480 -0
- package/bundled/dev-pipeline/prizmkit_runtime/paths.py +3 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +32 -8
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +29 -12
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +13 -5
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +166 -0
- package/bundled/dev-pipeline/scripts/feature_list_contract.py +964 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +18 -40
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +24 -19
- package/bundled/dev-pipeline/scripts/prompt_framework.py +24 -8
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -63
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +8 -6
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +0 -10
- package/bundled/dev-pipeline/templates/feature-list-schema.json +8 -6
- package/bundled/dev-pipeline/templates/iterate/evaluate-prompt.md +97 -0
- package/bundled/dev-pipeline/templates/iterate/evaluation-schema.json +538 -0
- package/bundled/dev-pipeline/templates/iterate/headless-plan-prompt.md +66 -0
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +13 -4
- package/bundled/rules/USAGE.md +15 -48
- package/bundled/rules/_rules-metadata.json +7 -14
- package/bundled/rules/general/coding-baseline.md +23 -0
- package/bundled/rules/prizm/prizm-progressive-loading.md +2 -2
- package/bundled/skills/_metadata.json +12 -42
- package/bundled/skills/app-planner/SKILL.md +2 -2
- package/bundled/skills/app-planner/references/generated-plan-review.md +2 -2
- package/bundled/skills/app-planner/references/project-state-detection.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +158 -88
- package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +543 -12
- package/bundled/skills/bug-planner/references/verification.md +4 -5
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +20 -14
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +49 -9
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +20 -14
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +49 -9
- package/bundled/skills/feature-planner/SKILL.md +3 -3
- package/bundled/skills/feature-planner/references/browser-interaction.md +9 -29
- package/bundled/skills/iterate-pipeline-launcher/SKILL.md +273 -0
- package/bundled/skills/iterate-pipeline-launcher/references/configuration.md +105 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +10 -8
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +4 -1
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -1
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +12 -8
- package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
- package/bundled/skills/prizmkit-init/SKILL.md +10 -10
- package/bundled/skills/prizmkit-init/references/brownfield-deep-init.md +81 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +2 -1
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +2 -0
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +8 -4
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +8 -7
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +33 -16
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +1 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +29 -12
- package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +126 -2
- package/bundled/skills/prizmkit-retrospective/references/rule-evolution-steps.md +86 -0
- package/bundled/skills/prizmkit-test/SKILL.md +2 -1
- package/bundled/skills/prizmkit-workflow/SKILL.md +8 -0
- package/bundled/skills/prizmkit-workflow/references/cold-start-rules.md +84 -0
- package/bundled/templates/project-memory-template.md +3 -3
- package/package.json +1 -1
- package/src/clean.js +2 -3
- package/src/config.js +52 -39
- package/src/index.js +29 -111
- package/src/prompts.js +20 -87
- package/src/runtime-passthrough.js +324 -0
- package/src/scaffold.js +41 -294
- package/src/upgrade.js +7 -39
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +0 -127
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +0 -124
- package/src/external-skills.js +0 -103
package/bin/create-prizmkit.js
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
* npx prizmkit uninstall . --dry-run
|
|
10
10
|
* npx prizmkit upgrade .
|
|
11
11
|
* npx prizmkit config . --platform codebuddy --runtime auto
|
|
12
|
+
* prizmkit run iterate --max-rounds 3
|
|
13
|
+
* prizmkit daemon iterate status
|
|
14
|
+
* prizmkit status all
|
|
15
|
+
* prizmkit reset feature F-001 --state-only
|
|
16
|
+
* prizmkit diagnostics ai-cli
|
|
12
17
|
*/
|
|
13
18
|
|
|
14
19
|
import { readFileSync } from 'fs';
|
|
@@ -19,37 +24,44 @@ import { runScaffold } from '../src/index.js';
|
|
|
19
24
|
import { runClean } from '../src/clean.js';
|
|
20
25
|
import { runUpgrade } from '../src/upgrade.js';
|
|
21
26
|
import { runConfig } from '../src/config.js';
|
|
27
|
+
import { PASSTHROUGH_COMMANDS, runRuntimePassthrough } from '../src/runtime-passthrough.js';
|
|
22
28
|
|
|
23
29
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
30
|
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
|
|
25
31
|
|
|
32
|
+
function rejectTopLevelProjectRoot(commandName) {
|
|
33
|
+
if (program.opts().projectRoot !== undefined) {
|
|
34
|
+
console.error(
|
|
35
|
+
`\n Error: --project-root is only supported for runtime commands (run, status, reset, daemon, diagnostics), not '${commandName}'.\n`,
|
|
36
|
+
);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
26
41
|
program
|
|
27
42
|
.name('prizmkit')
|
|
28
|
-
.description('PrizmKit project installer/uninstaller/configurator')
|
|
29
|
-
.version(pkg.version)
|
|
43
|
+
.description('PrizmKit project installer/uninstaller/configurator and runtime CLI')
|
|
44
|
+
.version(pkg.version)
|
|
45
|
+
.enablePositionalOptions()
|
|
46
|
+
.option('--project-root <dir>', 'Target project root directory for runtime commands (run, status, reset, daemon, diagnostics)');
|
|
30
47
|
|
|
31
48
|
program
|
|
32
49
|
.command('install [directory]')
|
|
33
50
|
.description('Install PrizmKit into a project directory')
|
|
34
51
|
.option('--platform <platform>', 'Target platform: codebuddy, claude, codex, pi, cursor, antigravity, comma-separated list, or all')
|
|
35
52
|
.option('--runtime <runtime>', 'Runtime assets: python or auto; unix/windows are accepted as legacy aliases for python')
|
|
36
|
-
.option('--skills <suite>', '
|
|
53
|
+
.option('--skills <suite>', '[deprecated] Ignored; PrizmKit now always installs the full core skill suite')
|
|
37
54
|
.option('--pipeline', 'Install dev-pipeline (default: true)')
|
|
38
55
|
.option('--no-pipeline', 'Disable dev-pipeline')
|
|
39
56
|
.option('--playwright-cli', 'Install playwright-cli browser tool (default: true)')
|
|
40
57
|
.option('--no-playwright-cli', 'Disable playwright-cli installation')
|
|
41
|
-
.option('--open-cli', 'Install opencli browser tool (default: true)')
|
|
42
|
-
.option('--no-open-cli', 'Disable opencli installation')
|
|
43
|
-
.option('--open-cli-auto-download', 'Auto-download opencli extension if missing (default: true)')
|
|
44
|
-
.option('--no-open-cli-auto-download', 'Skip auto-download, show manual steps only')
|
|
45
|
-
.option('--rules <preset>', 'Rules preset: recommended, minimal, or none', 'recommended')
|
|
46
58
|
.option('--ai-cli <command>', 'AI CLI executable command (e.g. cbc, claude, codex, pi, agent, agy)')
|
|
47
59
|
.option('--headless-prompt-arg <arg>', 'Prompt injection argv token for a custom AI CLI (e.g. -p or -i)')
|
|
48
60
|
.option('--headless-extra-args <args>', 'Additional headless argv tokens for a custom AI CLI')
|
|
49
|
-
.option('--external-skills <names>', 'Comma-separated external skill names to install (e.g. find-skills,frontend-design)')
|
|
50
61
|
.option('--non-interactive', 'Skip interactive prompts (requires --platform)')
|
|
51
62
|
.option('--dry-run', 'Show what would be created without making changes')
|
|
52
63
|
.action(async (directory = '.', options) => {
|
|
64
|
+
rejectTopLevelProjectRoot('install');
|
|
53
65
|
try {
|
|
54
66
|
await runScaffold(directory, options);
|
|
55
67
|
} catch (err) {
|
|
@@ -64,6 +76,7 @@ program
|
|
|
64
76
|
.option('--dry-run', 'Show what would be removed without deleting')
|
|
65
77
|
.option('--global-team', 'Also remove legacy global CodeBuddy team config')
|
|
66
78
|
.action(async (directory = '.', options) => {
|
|
79
|
+
rejectTopLevelProjectRoot('uninstall');
|
|
67
80
|
try {
|
|
68
81
|
await runClean(directory, options);
|
|
69
82
|
} catch (err) {
|
|
@@ -79,6 +92,7 @@ program
|
|
|
79
92
|
.option('--non-interactive', 'Skip confirmation prompt')
|
|
80
93
|
.option('--force', 'Overwrite all files including user-customizable ones')
|
|
81
94
|
.action(async (directory = '.', options) => {
|
|
95
|
+
rejectTopLevelProjectRoot('upgrade');
|
|
82
96
|
try {
|
|
83
97
|
await runUpgrade(directory, options);
|
|
84
98
|
} catch (err) {
|
|
@@ -89,11 +103,10 @@ program
|
|
|
89
103
|
|
|
90
104
|
program
|
|
91
105
|
.command('config [directory]')
|
|
92
|
-
.description('Reconfigure existing PrizmKit installation (change platform,
|
|
106
|
+
.description('Reconfigure existing PrizmKit installation (change platform, AI CLI, pipeline)')
|
|
93
107
|
.option('--platform <platform>', 'Target platform: codebuddy, claude, codex, pi, cursor, antigravity, comma-separated list, or all')
|
|
94
108
|
.option('--runtime <runtime>', 'Runtime assets: python or auto; unix/windows are accepted as legacy aliases for python')
|
|
95
|
-
.option('--skills <suite>', '
|
|
96
|
-
.option('--rules <preset>', 'Rules preset: recommended, minimal, or none')
|
|
109
|
+
.option('--skills <suite>', '[deprecated] Ignored; PrizmKit now always installs the full core skill suite')
|
|
97
110
|
.option('--ai-cli <command>', 'AI CLI executable command (e.g. cbc, claude, codex, pi, agent, agy)')
|
|
98
111
|
.option('--headless-prompt-arg <arg>', 'Prompt injection argv token for a custom AI CLI (e.g. -p or -i)')
|
|
99
112
|
.option('--headless-extra-args <args>', 'Additional headless argv tokens for a custom AI CLI')
|
|
@@ -102,6 +115,7 @@ program
|
|
|
102
115
|
.option('--non-interactive', 'Skip interactive prompts')
|
|
103
116
|
.option('--dry-run', 'Show what would change without applying')
|
|
104
117
|
.action(async (directory = '.', options) => {
|
|
118
|
+
rejectTopLevelProjectRoot('config');
|
|
105
119
|
try {
|
|
106
120
|
await runConfig(directory, options);
|
|
107
121
|
} catch (err) {
|
|
@@ -110,4 +124,21 @@ program
|
|
|
110
124
|
}
|
|
111
125
|
});
|
|
112
126
|
|
|
127
|
+
for (const { name, description } of PASSTHROUGH_COMMANDS) {
|
|
128
|
+
program
|
|
129
|
+
.command(name)
|
|
130
|
+
.description(description)
|
|
131
|
+
.allowUnknownOption(true)
|
|
132
|
+
.allowExcessArguments(true)
|
|
133
|
+
.passThroughOptions()
|
|
134
|
+
.helpOption(false)
|
|
135
|
+
.argument('[args...]')
|
|
136
|
+
.action(() => {
|
|
137
|
+
const exitCode = runRuntimePassthrough(name, process.argv.slice(2), {
|
|
138
|
+
topLevelProjectRoot: program.opts().projectRoot,
|
|
139
|
+
});
|
|
140
|
+
process.exit(exitCode);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
113
144
|
program.parse();
|
package/bundled/VERSION.json
CHANGED
|
@@ -31,3 +31,8 @@
|
|
|
31
31
|
# HEARTBEAT_INTERVAL=30 # Heartbeat log interval in seconds
|
|
32
32
|
# HEARTBEAT_STALE_THRESHOLD=600 # Max seconds without heartbeat before marking stale
|
|
33
33
|
# STALE_KILL_THRESHOLD=600 # Auto-kill after N seconds without parent log progress (0 = disabled)
|
|
34
|
+
|
|
35
|
+
# ─── Autonomous Product Iteration (run iterate) ──────────────────────
|
|
36
|
+
# MAX_ROUNDS= # Optional explicit round budget (unset = autonomous mode)
|
|
37
|
+
# ITERATE_FOCUS= # Optional default focus area when --focus is omitted
|
|
38
|
+
# PRIZMKIT_ITERATE_SAFETY_CAP=10 # Autonomous safety cap before PAUSE_SAFETY_CAP
|
|
@@ -344,7 +344,7 @@ Resolves `{{BUG_ID}}`, `{{BUG_TITLE}}`, `{{SEVERITY}}`, `{{VERIFICATION_TYPE}}`,
|
|
|
344
344
|
|
|
345
345
|
### `scripts/update-feature-status.py` — Feature State Machine
|
|
346
346
|
|
|
347
|
-
Core state management for features. Supports
|
|
347
|
+
Core state management for features. Supports 9 actions (`get_next/start/update/status/pause/reset/clean/reset_state/complete`).
|
|
348
348
|
|
|
349
349
|
```bash
|
|
350
350
|
python3 scripts/update-feature-status.py \
|
|
@@ -362,6 +362,7 @@ python3 scripts/update-feature-status.py \
|
|
|
362
362
|
| `status` | — | Pretty-print pipeline status (progress bar, ETA, per-feature breakdown) |
|
|
363
363
|
| `reset` | `--feature-id` | Reset to pending, retry_count → 0 |
|
|
364
364
|
| `clean` | `--feature-id --feature-slug --project-root` | Reset + delete all session history and .prizmkit artifacts |
|
|
365
|
+
| `reset_state` | `[--feature-id]` | Recover blocking roots and causally recoverable `auto_skipped` descendants while preserving checkouts, branches, and artifacts |
|
|
365
366
|
| `pause` | — | Save state for graceful shutdown |
|
|
366
367
|
| `complete` | `--feature-id` | Shortcut for manually marking completed |
|
|
367
368
|
|
|
@@ -1057,6 +1057,26 @@ def _valid_review_artifact(
|
|
|
1057
1057
|
return verdicts == ["PASS"]
|
|
1058
1058
|
|
|
1059
1059
|
|
|
1060
|
+
_RETROSPECTIVE_REQUIRED_KEYS = frozenset({
|
|
1061
|
+
"schema_version",
|
|
1062
|
+
"outcome",
|
|
1063
|
+
"result",
|
|
1064
|
+
"reason",
|
|
1065
|
+
"change_paths",
|
|
1066
|
+
"documentation_paths",
|
|
1067
|
+
"validation",
|
|
1068
|
+
})
|
|
1069
|
+
_RETROSPECTIVE_ALLOWED_KEYS = _RETROSPECTIVE_REQUIRED_KEYS | {"rule_evolution"}
|
|
1070
|
+
_RETROSPECTIVE_RULE_EVOLUTION_KEYS = frozenset({"status", "updated_paths", "proposals"})
|
|
1071
|
+
_RETROSPECTIVE_RULE_PROPOSAL_KEYS = frozenset({"target_path", "clause", "reason"})
|
|
1072
|
+
_RETROSPECTIVE_RULE_PATHS = frozenset({
|
|
1073
|
+
".prizmkit/rules/frontend-rules.md",
|
|
1074
|
+
".prizmkit/rules/backend-rules.md",
|
|
1075
|
+
".prizmkit/rules/database-rules.md",
|
|
1076
|
+
".prizmkit/rules/mobile-rules.md",
|
|
1077
|
+
})
|
|
1078
|
+
|
|
1079
|
+
|
|
1060
1080
|
def _valid_retrospective_artifact(
|
|
1061
1081
|
step: CheckpointStep,
|
|
1062
1082
|
checkpoint_path: Path | None,
|
|
@@ -1078,39 +1098,100 @@ def _valid_retrospective_artifact(
|
|
|
1078
1098
|
value = json.loads(result_path.read_text(encoding="utf-8"))
|
|
1079
1099
|
except (OSError, UnicodeError, json.JSONDecodeError):
|
|
1080
1100
|
return False
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1101
|
+
return _valid_retrospective_payload(value, require_complete=True)
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
def _valid_retrospective_payload(
|
|
1105
|
+
value: object,
|
|
1106
|
+
*,
|
|
1107
|
+
require_complete: bool = True,
|
|
1108
|
+
) -> bool:
|
|
1109
|
+
if not isinstance(value, dict):
|
|
1110
|
+
return False
|
|
1111
|
+
keys = set(value)
|
|
1112
|
+
if not (_RETROSPECTIVE_REQUIRED_KEYS <= keys <= _RETROSPECTIVE_ALLOWED_KEYS):
|
|
1113
|
+
return False
|
|
1114
|
+
schema_version = value.get("schema_version")
|
|
1115
|
+
if isinstance(schema_version, bool) or schema_version != 1:
|
|
1116
|
+
return False
|
|
1117
|
+
outcome = value.get("outcome")
|
|
1118
|
+
result = value.get("result")
|
|
1119
|
+
if not isinstance(value.get("reason"), str) or not value["reason"].strip():
|
|
1120
|
+
return False
|
|
1121
|
+
if not isinstance(value.get("change_paths"), list) or not all(
|
|
1122
|
+
_valid_retrospective_change_path(path) for path in value["change_paths"]
|
|
1123
|
+
):
|
|
1124
|
+
return False
|
|
1125
|
+
if not isinstance(value.get("documentation_paths"), list) or not all(
|
|
1126
|
+
_valid_retrospective_documentation_path(path)
|
|
1127
|
+
for path in value["documentation_paths"]
|
|
1128
|
+
):
|
|
1129
|
+
return False
|
|
1130
|
+
if not isinstance(value.get("validation"), list) or not all(
|
|
1131
|
+
isinstance(item, str) and item.strip() for item in value["validation"]
|
|
1132
|
+
):
|
|
1133
|
+
return False
|
|
1134
|
+
|
|
1135
|
+
if outcome == "RETRO_BLOCKED":
|
|
1136
|
+
if require_complete:
|
|
1137
|
+
return False
|
|
1138
|
+
return result is None and "rule_evolution" not in value
|
|
1139
|
+
|
|
1140
|
+
if outcome != "RETRO_COMPLETE" or result not in {"DOCS_UPDATED", "NO_DOC_CHANGE"}:
|
|
1141
|
+
return False
|
|
1142
|
+
if result == "DOCS_UPDATED" and not (
|
|
1143
|
+
value["documentation_paths"] and value["validation"]
|
|
1144
|
+
):
|
|
1145
|
+
return False
|
|
1146
|
+
|
|
1147
|
+
if "rule_evolution" in value:
|
|
1148
|
+
rule_evolution = value["rule_evolution"]
|
|
1149
|
+
if not _valid_retrospective_rule_evolution(rule_evolution):
|
|
1150
|
+
return False
|
|
1151
|
+
if rule_evolution["updated_paths"] and not value["validation"]:
|
|
1152
|
+
return False
|
|
1153
|
+
|
|
1154
|
+
return True
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
def _valid_retrospective_rule_evolution(value: object) -> bool:
|
|
1158
|
+
if not isinstance(value, dict) or set(value) != _RETROSPECTIVE_RULE_EVOLUTION_KEYS:
|
|
1159
|
+
return False
|
|
1160
|
+
status = value.get("status")
|
|
1161
|
+
if status not in {"RULES_UPDATED", "NO_RULE_CHANGE", "RULES_PROPOSED"}:
|
|
1162
|
+
return False
|
|
1163
|
+
updated_paths = value.get("updated_paths")
|
|
1164
|
+
if not isinstance(updated_paths, list) or not all(
|
|
1165
|
+
_valid_retrospective_rule_path(path) for path in updated_paths
|
|
1166
|
+
):
|
|
1167
|
+
return False
|
|
1168
|
+
if len(set(updated_paths)) != len(updated_paths):
|
|
1169
|
+
return False
|
|
1170
|
+
proposals = value.get("proposals")
|
|
1171
|
+
if not isinstance(proposals, list) or not all(
|
|
1172
|
+
_valid_retrospective_rule_proposal(item) for item in proposals
|
|
1173
|
+
):
|
|
1174
|
+
return False
|
|
1175
|
+
if status == "RULES_UPDATED":
|
|
1176
|
+
return bool(updated_paths) and not proposals
|
|
1177
|
+
if status == "NO_RULE_CHANGE":
|
|
1178
|
+
return not updated_paths and not proposals
|
|
1179
|
+
return bool(proposals)
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
def _valid_retrospective_rule_path(value: object) -> bool:
|
|
1183
|
+
return isinstance(value, str) and value in _RETROSPECTIVE_RULE_PATHS
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
def _valid_retrospective_rule_proposal(value: object) -> bool:
|
|
1187
|
+
if not isinstance(value, dict) or set(value) != _RETROSPECTIVE_RULE_PROPOSAL_KEYS:
|
|
1188
|
+
return False
|
|
1090
1189
|
return bool(
|
|
1091
|
-
|
|
1092
|
-
and
|
|
1093
|
-
and value.
|
|
1094
|
-
and value.get("outcome") == "RETRO_COMPLETE"
|
|
1095
|
-
and value.get("result") in {"DOCS_UPDATED", "NO_DOC_CHANGE"}
|
|
1190
|
+
_valid_retrospective_rule_path(value.get("target_path"))
|
|
1191
|
+
and isinstance(value.get("clause"), str)
|
|
1192
|
+
and value["clause"].strip()
|
|
1096
1193
|
and isinstance(value.get("reason"), str)
|
|
1097
1194
|
and value["reason"].strip()
|
|
1098
|
-
and isinstance(value.get("change_paths"), list)
|
|
1099
|
-
and all(_valid_retrospective_change_path(path) for path in value["change_paths"])
|
|
1100
|
-
and isinstance(value.get("documentation_paths"), list)
|
|
1101
|
-
and all(
|
|
1102
|
-
_valid_retrospective_documentation_path(path)
|
|
1103
|
-
for path in value["documentation_paths"]
|
|
1104
|
-
)
|
|
1105
|
-
and isinstance(value.get("validation"), list)
|
|
1106
|
-
and all(isinstance(item, str) and item.strip() for item in value["validation"])
|
|
1107
|
-
and (
|
|
1108
|
-
value.get("result") != "DOCS_UPDATED"
|
|
1109
|
-
or (
|
|
1110
|
-
bool(value["documentation_paths"])
|
|
1111
|
-
and bool(value["validation"])
|
|
1112
|
-
)
|
|
1113
|
-
)
|
|
1114
1195
|
)
|
|
1115
1196
|
|
|
1116
1197
|
|
|
@@ -17,14 +17,18 @@ DESCRIPTION = (
|
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
_FAMILIES = ("feature", "bugfix")
|
|
20
|
+
_DAEMON_TARGETS = ("feature", "bugfix", "iterate")
|
|
20
21
|
_GLOBAL_OPTIONS_WITH_VALUES = {"--project-root", "--pipeline-root"}
|
|
21
22
|
_LEAF_OPTIONS_WITH_VALUES = {
|
|
23
|
+
"--checkpoint-every",
|
|
22
24
|
"--env",
|
|
23
25
|
"--features",
|
|
26
|
+
"--focus",
|
|
24
27
|
"--lines",
|
|
25
28
|
"-n",
|
|
26
|
-
"--max-retries",
|
|
27
29
|
"--max-infra-retries",
|
|
30
|
+
"--max-retries",
|
|
31
|
+
"--max-rounds",
|
|
28
32
|
"--resume-phase",
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -48,6 +52,16 @@ def _non_negative_int(value: str) -> int:
|
|
|
48
52
|
return parsed
|
|
49
53
|
|
|
50
54
|
|
|
55
|
+
def _positive_int(value: str) -> int:
|
|
56
|
+
try:
|
|
57
|
+
parsed = int(value)
|
|
58
|
+
except ValueError as exc:
|
|
59
|
+
raise argparse.ArgumentTypeError("must be an integer") from exc
|
|
60
|
+
if parsed < 1:
|
|
61
|
+
raise argparse.ArgumentTypeError("must be >= 1")
|
|
62
|
+
return parsed
|
|
63
|
+
|
|
64
|
+
|
|
51
65
|
def _add_status_arguments(parser: argparse.ArgumentParser, family: str) -> None:
|
|
52
66
|
parser.add_argument("operand", nargs="?", help="Optional task ID or family plan path.")
|
|
53
67
|
parser.add_argument("second_operand", nargs="?", help="Optional family plan path or task ID.")
|
|
@@ -63,15 +77,35 @@ def _add_run_arguments(parser: argparse.ArgumentParser, family: str) -> None:
|
|
|
63
77
|
parser.add_argument("--dry-run", action="store_true")
|
|
64
78
|
|
|
65
79
|
|
|
80
|
+
def _add_iterate_run_arguments(parser: argparse.ArgumentParser, *, allow_dry_run: bool = True) -> None:
|
|
81
|
+
parser.add_argument("--max-rounds", type=_positive_int, help="Optional maximum iteration rounds.")
|
|
82
|
+
parser.add_argument("--focus", help="Optional product-iteration focus guidance.")
|
|
83
|
+
parser.add_argument(
|
|
84
|
+
"--checkpoint-every",
|
|
85
|
+
type=_positive_int,
|
|
86
|
+
help="Pause for checkpoint review every N completed rounds.",
|
|
87
|
+
)
|
|
88
|
+
parser.add_argument(
|
|
89
|
+
"--no-checkpoint",
|
|
90
|
+
action="store_true",
|
|
91
|
+
help="Disable periodic checkpoint review pauses.",
|
|
92
|
+
)
|
|
93
|
+
if allow_dry_run:
|
|
94
|
+
parser.add_argument("--dry-run", action="store_true", help="Validate readiness and preview Phase A prompt without mutating state.")
|
|
95
|
+
|
|
96
|
+
|
|
66
97
|
def _add_run_subparsers(
|
|
67
98
|
subparsers: argparse._SubParsersAction[argparse.ArgumentParser],
|
|
68
99
|
) -> None:
|
|
69
|
-
run_parser = subparsers.add_parser("run", help="Run a foreground pipeline family")
|
|
100
|
+
run_parser = subparsers.add_parser("run", help="Run a foreground pipeline family or iterate loop")
|
|
70
101
|
family_subparsers = run_parser.add_subparsers(dest="run_family", required=True)
|
|
71
102
|
for family in _FAMILIES:
|
|
72
103
|
family_parser = family_subparsers.add_parser(family, help=f"Run the {family} pipeline")
|
|
73
104
|
_add_run_arguments(family_parser, family)
|
|
74
105
|
_set_handler(family_parser, "run", "run", family)
|
|
106
|
+
iterate_parser = family_subparsers.add_parser("iterate", help="Run the autonomous product-iteration loop")
|
|
107
|
+
_add_iterate_run_arguments(iterate_parser, allow_dry_run=True)
|
|
108
|
+
_set_handler(iterate_parser, "run", "run", "iterate")
|
|
75
109
|
|
|
76
110
|
|
|
77
111
|
def _add_status_subparsers(
|
|
@@ -83,6 +117,9 @@ def _add_status_subparsers(
|
|
|
83
117
|
family_parser = target_subparsers.add_parser(family, help=f"Show {family} status")
|
|
84
118
|
_add_status_arguments(family_parser, family)
|
|
85
119
|
_set_handler(family_parser, "status", "status", family)
|
|
120
|
+
iterate_parser = target_subparsers.add_parser("iterate", help="Show read-only iterate status")
|
|
121
|
+
iterate_parser.add_argument("--json", action="store_true", help="Emit structured JSON status.")
|
|
122
|
+
_set_handler(iterate_parser, "status", "status", "iterate")
|
|
86
123
|
all_parser = target_subparsers.add_parser(
|
|
87
124
|
"all",
|
|
88
125
|
help="Show read-only status for every configured family",
|
|
@@ -111,6 +148,10 @@ def _add_reset_subparsers(
|
|
|
111
148
|
|
|
112
149
|
|
|
113
150
|
def _add_daemon_start_arguments(parser: argparse.ArgumentParser, family: str) -> None:
|
|
151
|
+
if family == "iterate":
|
|
152
|
+
_add_iterate_run_arguments(parser, allow_dry_run=False)
|
|
153
|
+
parser.add_argument("--env", help="Quoted KEY=VALUE daemon environment overrides.")
|
|
154
|
+
return
|
|
114
155
|
parser.add_argument("list_path", nargs="?", help="Optional family plan path.")
|
|
115
156
|
parser.add_argument("--env", help="Quoted KEY=VALUE daemon environment overrides.")
|
|
116
157
|
if family == "feature":
|
|
@@ -122,7 +163,7 @@ def _add_daemon_subparsers(
|
|
|
122
163
|
) -> None:
|
|
123
164
|
daemon_parser = subparsers.add_parser("daemon", help="Manage background pipeline processes")
|
|
124
165
|
family_subparsers = daemon_parser.add_subparsers(dest="daemon_family", required=True)
|
|
125
|
-
for family in
|
|
166
|
+
for family in _DAEMON_TARGETS:
|
|
126
167
|
family_parser = family_subparsers.add_parser(family, help=f"Manage the {family} daemon")
|
|
127
168
|
action_subparsers = family_parser.add_subparsers(dest="daemon_action", required=True)
|
|
128
169
|
for action in ("start", "stop", "status", "logs", "restart"):
|
|
@@ -13,6 +13,9 @@ RUNTIME_STATUS = "python-runtime-canonical"
|
|
|
13
13
|
CANONICAL_RUNTIME_NOTE = "The Python CLI and prizmkit_runtime modules are the canonical runtime."
|
|
14
14
|
PYTHON_CLI = "dev-pipeline/cli.py"
|
|
15
15
|
_FAMILIES = ("feature", "bugfix")
|
|
16
|
+
_RUN_TARGETS = ("feature", "bugfix", "iterate")
|
|
17
|
+
_STATUS_TARGETS = ("feature", "bugfix", "iterate")
|
|
18
|
+
_DAEMON_TARGETS = ("feature", "bugfix", "iterate")
|
|
16
19
|
|
|
17
20
|
|
|
18
21
|
@dataclass(frozen=True)
|
|
@@ -70,13 +73,13 @@ def _run_commands() -> tuple[RuntimeCommand, ...]:
|
|
|
70
73
|
_command(
|
|
71
74
|
"run",
|
|
72
75
|
"run",
|
|
73
|
-
target=
|
|
76
|
+
target=target,
|
|
74
77
|
notes=(
|
|
75
78
|
CANONICAL_RUNTIME_NOTE,
|
|
76
79
|
"Foreground pipeline behavior is implemented in Python runtime modules.",
|
|
77
80
|
),
|
|
78
81
|
)
|
|
79
|
-
for
|
|
82
|
+
for target in _RUN_TARGETS
|
|
80
83
|
)
|
|
81
84
|
|
|
82
85
|
|
|
@@ -85,10 +88,10 @@ def _status_commands() -> tuple[RuntimeCommand, ...]:
|
|
|
85
88
|
_command(
|
|
86
89
|
"status",
|
|
87
90
|
"status",
|
|
88
|
-
target=
|
|
89
|
-
notes=(CANONICAL_RUNTIME_NOTE, "Status is resolved by the canonical
|
|
91
|
+
target=target,
|
|
92
|
+
notes=(CANONICAL_RUNTIME_NOTE, "Status is resolved by the canonical runtime status handler."),
|
|
90
93
|
)
|
|
91
|
-
for
|
|
94
|
+
for target in _STATUS_TARGETS
|
|
92
95
|
]
|
|
93
96
|
commands.append(
|
|
94
97
|
_command(
|
|
@@ -121,13 +124,13 @@ def _daemon_commands() -> tuple[RuntimeCommand, ...]:
|
|
|
121
124
|
_command(
|
|
122
125
|
"daemon",
|
|
123
126
|
action,
|
|
124
|
-
target=
|
|
127
|
+
target=target,
|
|
125
128
|
notes=(
|
|
126
129
|
CANONICAL_RUNTIME_NOTE,
|
|
127
130
|
"Daemon lifecycle behavior is implemented by the Python daemon runtime.",
|
|
128
131
|
),
|
|
129
132
|
)
|
|
130
|
-
for
|
|
133
|
+
for target in _DAEMON_TARGETS
|
|
131
134
|
for action in ("start", "stop", "status", "logs", "restart")
|
|
132
135
|
)
|
|
133
136
|
|
|
@@ -187,10 +190,18 @@ def handle_runtime_command(
|
|
|
187
190
|
from .runners import run_pipeline_command
|
|
188
191
|
|
|
189
192
|
return run_pipeline_command(target, "run", legacy_args, runtime_paths)
|
|
193
|
+
if group == "run" and target == "iterate" and action == "run":
|
|
194
|
+
from .iterate import run_iterate_command
|
|
195
|
+
|
|
196
|
+
return run_iterate_command(legacy_args, runtime_paths)
|
|
190
197
|
if group == "status" and target in _FAMILIES and action == "status":
|
|
191
198
|
from .runners import run_pipeline_command
|
|
192
199
|
|
|
193
200
|
return run_pipeline_command(target, "status", legacy_args, runtime_paths)
|
|
201
|
+
if group == "status" and target == "iterate" and action == "status":
|
|
202
|
+
from .status import run_iterate_status_command
|
|
203
|
+
|
|
204
|
+
return run_iterate_status_command(legacy_args, runtime_paths)
|
|
194
205
|
if group == "status" and target == "all" and action == "status":
|
|
195
206
|
if legacy_args:
|
|
196
207
|
return CommandResult(
|
|
@@ -215,7 +226,7 @@ def handle_runtime_command(
|
|
|
215
226
|
from .reset import run_reset_command
|
|
216
227
|
|
|
217
228
|
return run_reset_command(target, legacy_args, runtime_paths)
|
|
218
|
-
if group == "daemon" and target in
|
|
229
|
+
if group == "daemon" and target in _DAEMON_TARGETS and action in {"start", "stop", "status", "logs", "restart"}:
|
|
219
230
|
from .daemon import run_daemon_command
|
|
220
231
|
|
|
221
232
|
try:
|
|
@@ -294,16 +305,25 @@ def diagnostics_version() -> CommandResult:
|
|
|
294
305
|
|
|
295
306
|
def diagnostics_ai_cli(paths: RuntimePaths | None = None) -> CommandResult:
|
|
296
307
|
"""Report the family-neutral AI CLI resolution used by runtime commands."""
|
|
297
|
-
from .config import load_runtime_config
|
|
308
|
+
from .config import ai_cli_capabilities, load_runtime_config
|
|
298
309
|
|
|
299
310
|
runtime_paths = paths or resolve_runtime_paths()
|
|
300
311
|
config = load_runtime_config(runtime_paths)
|
|
301
312
|
cli = config.ai_client.command or "(not found)"
|
|
313
|
+
capabilities = ai_cli_capabilities(config.ai_client.platform)
|
|
314
|
+
supported_efforts = (
|
|
315
|
+
",".join(capabilities.supported_effort_values)
|
|
316
|
+
if capabilities.supported_effort_values
|
|
317
|
+
else "none"
|
|
318
|
+
)
|
|
302
319
|
details = [
|
|
303
320
|
f"detected_cli: {cli}",
|
|
304
321
|
f"platform: {config.ai_client.platform or 'unresolved'}",
|
|
305
322
|
f"source: {config.ai_client.source}",
|
|
306
323
|
f"runtime_mode: {config.runtime_mode}",
|
|
324
|
+
f"model_arg_supported: {'true' if capabilities.model_arg_supported else 'false'}",
|
|
325
|
+
f"effort_flag_mode: {capabilities.effort_flag_mode}",
|
|
326
|
+
f"supported_effort_values: {supported_efforts}",
|
|
307
327
|
]
|
|
308
328
|
if config.model:
|
|
309
329
|
details.append(f"model: {config.model}")
|