prizmkit 1.1.191 → 1.1.193
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/antigravity/skill-adapter.js +13 -4
- package/bundled/adapters/codex/skill-adapter.js +28 -8
- package/bundled/adapters/cursor/skill-adapter.js +13 -4
- package/bundled/adapters/pi/skill-adapter.js +28 -7
- package/bundled/dev-pipeline/.env.example +4 -12
- package/bundled/dev-pipeline/README.md +28 -44
- package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +6 -6
- package/bundled/dev-pipeline/prizmkit_runtime/atomic_io.py +48 -0
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +66 -23
- package/bundled/dev-pipeline/prizmkit_runtime/cli.py +10 -7
- package/bundled/dev-pipeline/prizmkit_runtime/commands.py +2 -21
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +48 -78
- package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +127 -67
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +158 -462
- package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +102 -50
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -25
- package/bundled/dev-pipeline/prizmkit_runtime/paths.py +0 -6
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +47 -21
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +217 -156
- package/bundled/dev-pipeline/prizmkit_runtime/reset.py +39 -27
- package/bundled/dev-pipeline/prizmkit_runtime/reset_preserve.py +34 -174
- package/bundled/dev-pipeline/prizmkit_runtime/results.py +25 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +133 -110
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +15 -5
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +1 -95
- package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +0 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +7 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +540 -262
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +175 -135
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +90 -9
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +214 -133
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +1 -3
- package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +2783 -0
- package/bundled/dev-pipeline/prizmkit_runtime/task_checkout.py +27 -102
- package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +58 -4
- package/bundled/dev-pipeline/scripts/check-session-status.py +56 -20
- package/bundled/dev-pipeline/scripts/continuation.py +8 -7
- package/bundled/dev-pipeline/scripts/detect-stuck.py +47 -33
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +13 -16
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +20 -10
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +10 -7
- package/bundled/dev-pipeline/scripts/init-change-artifact.py +25 -4
- package/bundled/dev-pipeline/scripts/init-pipeline.py +14 -69
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +31 -2616
- package/bundled/dev-pipeline/scripts/patch-completion-notes.py +4 -24
- package/bundled/dev-pipeline/scripts/prompt_framework.py +85 -20
- package/bundled/dev-pipeline/scripts/status_common.py +591 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +85 -463
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +254 -65
- package/bundled/dev-pipeline/scripts/update-feature-status.py +76 -509
- package/bundled/dev-pipeline/scripts/utils.py +5 -12
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -5
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +7 -0
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +7 -7
- package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +2 -1
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -6
- package/bundled/dev-pipeline/templates/session-status-schema.json +2 -5
- package/bundled/skills/_metadata.json +9 -63
- package/bundled/skills/app-planner/SKILL.md +32 -303
- package/bundled/skills/app-planner/references/app-design-guide.md +0 -4
- package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
- package/bundled/skills/app-planner/references/project-brief-guide.md +14 -0
- package/bundled/skills/app-planner/references/project-conventions-discovery.md +4 -6
- package/bundled/skills/app-planner/references/project-state-detection.md +2 -3
- package/bundled/skills/bug-fix-workflow/SKILL.md +1 -2
- package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +4 -7
- package/bundled/skills/bug-planner/SKILL.md +54 -435
- package/bundled/skills/bug-planner/references/generated-plan-review.md +3 -2
- package/bundled/skills/bug-planner/references/input-formats.md +32 -0
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +4 -6
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +4 -28
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +4 -6
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +4 -28
- package/bundled/skills/feature-planner/SKILL.md +60 -439
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/completeness-review.md +34 -0
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +2 -2
- package/bundled/skills/feature-planner/references/error-recovery.md +1 -1
- package/bundled/skills/feature-planner/references/generated-plan-review.md +3 -2
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +3 -1
- package/bundled/skills/feature-workflow/SKILL.md +1 -2
- package/bundled/skills/prizmkit/SKILL.md +7 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +14 -6
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +7 -4
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +16 -0
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +58 -20
- package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/SKILL.md +24 -127
- package/bundled/skills/prizmkit-init/assets/project-brief-template.md +3 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +6 -8
- package/bundled/skills/prizmkit-plan/references/clarify-guide.md +1 -1
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +5 -2
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +6 -5
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +1 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +1 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +6 -4
- package/bundled/skills/prizmkit-test/SKILL.md +25 -133
- package/bundled/skills/prizmkit-test/references/independent-test-review.md +5 -2
- package/bundled/skills/prizmkit-test/references/test-coverage-model.md +6 -0
- package/bundled/skills/prizmkit-workflow/SKILL.md +2 -3
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +4 -3
- package/bundled/skills/recovery-workflow/SKILL.md +7 -7
- package/bundled/skills/recovery-workflow/evals/evals.json +1 -1
- package/bundled/skills/recovery-workflow/references/detection.md +1 -3
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +0 -6
- package/bundled/templates/project-memory-template.md +1 -2
- package/package.json +1 -1
- package/src/scaffold.js +28 -7
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +0 -53
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +0 -649
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +0 -463
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +0 -1512
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +0 -240
- package/bundled/dev-pipeline/templates/refactor-list-schema.json +0 -266
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +0 -15
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +0 -9
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +0 -24
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +0 -16
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +0 -9
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +0 -22
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +0 -19
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +0 -24
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +0 -12
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -6
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +0 -52
- package/bundled/dev-pipeline/tests/conftest.py +0 -29
- package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +0 -208
- package/bundled/dev-pipeline/tests/test_auto_skip.py +0 -1871
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +0 -1314
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +0 -1712
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +0 -627
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +0 -478
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +0 -5641
- package/bundled/dev-pipeline/tests/test_recovery_workflow.py +0 -322
- package/bundled/dev-pipeline/tests/test_repository_bootstrap.py +0 -252
- package/bundled/dev-pipeline/tests/test_reset_modes.py +0 -1208
- package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -957
- package/bundled/dev-pipeline/tests/test_runtime_commit.py +0 -1113
- package/bundled/dev-pipeline/tests/test_runtime_helper.py +0 -303
- package/bundled/dev-pipeline/tests/test_unified_cli.py +0 -5504
- package/bundled/dev-pipeline/tests/test_utils.py +0 -170
- package/bundled/skills/feature-planner/assets/evaluation-guide.md +0 -44
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +0 -219
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +0 -78
- package/bundled/skills/refactor-planner/SKILL.md +0 -467
- package/bundled/skills/refactor-planner/assets/planning-guide.md +0 -291
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +0 -187
- package/bundled/skills/refactor-planner/references/error-recovery.md +0 -45
- package/bundled/skills/refactor-planner/references/fast-path.md +0 -59
- package/bundled/skills/refactor-planner/references/generated-plan-review.md +0 -107
- package/bundled/skills/refactor-planner/references/planning-phases.md +0 -172
- package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +0 -230
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +0 -1120
- package/bundled/skills/refactor-workflow/SKILL.md +0 -205
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
## Refactor Task Contract
|
|
2
|
-
|
|
3
|
-
### Objective
|
|
4
|
-
|
|
5
|
-
Execute {{REFACTOR_ID}}: "{{REFACTOR_TITLE}}".
|
|
6
|
-
|
|
7
|
-
{{REFACTOR_DESCRIPTION}}
|
|
8
|
-
|
|
9
|
-
{{USER_CONTEXT}}
|
|
10
|
-
|
|
11
|
-
### Scope
|
|
12
|
-
|
|
13
|
-
**Files:**
|
|
14
|
-
{{SCOPE_FILES}}
|
|
15
|
-
|
|
16
|
-
**Modules:**
|
|
17
|
-
{{SCOPE_MODULES}}
|
|
18
|
-
|
|
19
|
-
### Behavior Preservation
|
|
20
|
-
|
|
21
|
-
- **Strategy**: {{BEHAVIOR_STRATEGY}}
|
|
22
|
-
|
|
23
|
-
{{BEHAVIOR_PRESERVATION}}
|
|
24
|
-
|
|
25
|
-
### Existing Tests
|
|
26
|
-
|
|
27
|
-
{{EXISTING_TESTS}}
|
|
28
|
-
|
|
29
|
-
### New Tests Needed
|
|
30
|
-
|
|
31
|
-
{{NEW_TESTS_NEEDED}}
|
|
32
|
-
|
|
33
|
-
### Acceptance Criteria
|
|
34
|
-
|
|
35
|
-
{{ACCEPTANCE_CRITERIA}}
|
|
36
|
-
|
|
37
|
-
### Gate Checklist
|
|
38
|
-
|
|
39
|
-
{{AC_CHECKLIST}}
|
|
40
|
-
|
|
41
|
-
Gate rule:
|
|
42
|
-
- `[x]` means verified with behavior-preservation evidence.
|
|
43
|
-
- Any remaining `[ ]` means the refactor is incomplete.
|
|
44
|
-
- Blocked gates must be documented in `failure-log.md`; blocked is not success.
|
|
45
|
-
|
|
46
|
-
### Dependencies
|
|
47
|
-
|
|
48
|
-
{{DEPENDENCIES}}
|
|
49
|
-
|
|
50
|
-
### App Global Context
|
|
51
|
-
|
|
52
|
-
{{GLOBAL_CONTEXT}}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"""Shared fixtures and import helpers for dev-pipeline tests."""
|
|
2
|
-
|
|
3
|
-
import importlib
|
|
4
|
-
import os
|
|
5
|
-
import sys
|
|
6
|
-
|
|
7
|
-
# Add dev-pipeline/scripts to the import path so tests can import modules
|
|
8
|
-
# without requiring package installation.
|
|
9
|
-
_scripts_dir = os.path.join(os.path.dirname(__file__), "..", "scripts")
|
|
10
|
-
sys.path.insert(0, _scripts_dir)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _load_hyphenated_module(module_name, filename):
|
|
14
|
-
"""Load a hyphenated .py file and register it as an importable module."""
|
|
15
|
-
spec = importlib.util.spec_from_file_location(
|
|
16
|
-
module_name,
|
|
17
|
-
os.path.join(_scripts_dir, filename),
|
|
18
|
-
)
|
|
19
|
-
mod = importlib.util.module_from_spec(spec)
|
|
20
|
-
sys.modules[module_name] = mod
|
|
21
|
-
spec.loader.exec_module(mod)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
# Register hyphenated script files so tests can import them with underscores.
|
|
25
|
-
_load_hyphenated_module("generate_bootstrap_prompt", "generate-bootstrap-prompt.py")
|
|
26
|
-
_load_hyphenated_module("generate_bugfix_prompt", "generate-bugfix-prompt.py")
|
|
27
|
-
_load_hyphenated_module("generate_refactor_prompt", "generate-refactor-prompt.py")
|
|
28
|
-
_load_hyphenated_module("update_feature_status", "update-feature-status.py")
|
|
29
|
-
_load_hyphenated_module("update_checkpoint", "update-checkpoint.py")
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Capability-gated live smoke checks for normalized AI CLI session logging.
|
|
3
|
-
|
|
4
|
-
The deterministic fixture suite remains authoritative. This script optionally
|
|
5
|
-
exercises locally installed, authenticated, non-interactive-capable adapters in
|
|
6
|
-
isolated temporary Git repositories.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
import argparse
|
|
12
|
-
import json
|
|
13
|
-
import os
|
|
14
|
-
import shutil
|
|
15
|
-
import subprocess
|
|
16
|
-
import sys
|
|
17
|
-
import tempfile
|
|
18
|
-
from dataclasses import asdict, dataclass
|
|
19
|
-
from pathlib import Path
|
|
20
|
-
from typing import Callable, Iterable
|
|
21
|
-
|
|
22
|
-
PIPELINE_ROOT = Path(__file__).resolve().parents[1]
|
|
23
|
-
if str(PIPELINE_ROOT) not in sys.path:
|
|
24
|
-
sys.path.insert(0, str(PIPELINE_ROOT))
|
|
25
|
-
|
|
26
|
-
from prizmkit_runtime.sessions import AISessionConfig, AISessionLauncher # noqa: E402
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@dataclass(frozen=True)
|
|
30
|
-
class SmokeProfile:
|
|
31
|
-
"""One installed adapter example to exercise."""
|
|
32
|
-
|
|
33
|
-
name: str
|
|
34
|
-
command: str
|
|
35
|
-
platform: str
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
@dataclass(frozen=True)
|
|
39
|
-
class SmokeResult:
|
|
40
|
-
"""Machine-readable capability or execution result."""
|
|
41
|
-
|
|
42
|
-
name: str
|
|
43
|
-
status: str
|
|
44
|
-
reason: str
|
|
45
|
-
log_path: str = ""
|
|
46
|
-
exit_code: int | None = None
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
PROFILE_EXAMPLES = (
|
|
50
|
-
("pi", "pi", "pi"),
|
|
51
|
-
("codebuddy", "cbc", "codebuddy"),
|
|
52
|
-
("codex", "codex", "codex"),
|
|
53
|
-
("claude", "claude", "claude"),
|
|
54
|
-
("cursor", "agent", "cursor"),
|
|
55
|
-
("antigravity", "agy", "antigravity"),
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
AUTH_MARKERS = (
|
|
59
|
-
"authentication",
|
|
60
|
-
"unauthorized",
|
|
61
|
-
"not logged in",
|
|
62
|
-
"login required",
|
|
63
|
-
"invalid api key",
|
|
64
|
-
"missing api key",
|
|
65
|
-
"credential",
|
|
66
|
-
"billing",
|
|
67
|
-
"quota",
|
|
68
|
-
"model access",
|
|
69
|
-
"model not found",
|
|
70
|
-
"no access to model",
|
|
71
|
-
"network is unreachable",
|
|
72
|
-
"connection refused",
|
|
73
|
-
"could not resolve",
|
|
74
|
-
"service unavailable",
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
REQUIRED_LABELS = (
|
|
78
|
-
"[ACTION]",
|
|
79
|
-
"[OBSERVATION]",
|
|
80
|
-
"[FINAL]",
|
|
81
|
-
"[SESSION_END]",
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def discover_profiles(
|
|
86
|
-
which: Callable[[str], str | None] = shutil.which,
|
|
87
|
-
examples: Iterable[tuple[str, str, str]] = PROFILE_EXAMPLES,
|
|
88
|
-
) -> tuple[list[SmokeProfile], list[SmokeResult]]:
|
|
89
|
-
"""Return installed profiles and explicit executable-capability skips."""
|
|
90
|
-
installed = []
|
|
91
|
-
skipped = []
|
|
92
|
-
for name, executable, platform in examples:
|
|
93
|
-
resolved = which(executable)
|
|
94
|
-
if resolved:
|
|
95
|
-
installed.append(SmokeProfile(name, resolved, platform))
|
|
96
|
-
else:
|
|
97
|
-
skipped.append(SmokeResult(name, "skipped", f"executable not found: {executable}"))
|
|
98
|
-
return installed, skipped
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def smoke_prompt() -> str:
|
|
102
|
-
"""Return the isolated harmless tool-and-final-answer prompt."""
|
|
103
|
-
return (
|
|
104
|
-
"This is an isolated logging smoke test. Use one local shell tool to run "
|
|
105
|
-
"`printf 'PRIZMKIT_SMOKE_TOOL_OK\\n'`. Do not read, create, edit, or delete "
|
|
106
|
-
"project files. After the tool succeeds, answer exactly "
|
|
107
|
-
"`PRIZMKIT_SMOKE_FINAL_OK`."
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
def _looks_capability_blocked(text: str) -> bool:
|
|
112
|
-
lowered = text.lower()
|
|
113
|
-
return any(marker in lowered for marker in AUTH_MARKERS)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def run_profile(profile: SmokeProfile, *, timeout_seconds: float = 180) -> SmokeResult:
|
|
117
|
-
"""Run one live adapter in an isolated temporary repository."""
|
|
118
|
-
with tempfile.TemporaryDirectory(prefix=f"prizmkit-{profile.name}-smoke-") as temp_dir:
|
|
119
|
-
root = Path(temp_dir)
|
|
120
|
-
subprocess.run(
|
|
121
|
-
["git", "init", "-b", "main"],
|
|
122
|
-
cwd=root,
|
|
123
|
-
check=True,
|
|
124
|
-
stdout=subprocess.DEVNULL,
|
|
125
|
-
stderr=subprocess.DEVNULL,
|
|
126
|
-
)
|
|
127
|
-
prompt = root / "prompt.md"
|
|
128
|
-
prompt.write_text(smoke_prompt(), encoding="utf-8")
|
|
129
|
-
session_log = root / ".prizmkit" / "state" / "smoke" / "logs" / "session.log"
|
|
130
|
-
progress = session_log.with_name("progress.json")
|
|
131
|
-
result = AISessionLauncher(
|
|
132
|
-
AISessionConfig(
|
|
133
|
-
cli_command=profile.command,
|
|
134
|
-
platform=profile.platform,
|
|
135
|
-
model=None,
|
|
136
|
-
prompt_path=prompt,
|
|
137
|
-
cwd=root,
|
|
138
|
-
log_path=session_log,
|
|
139
|
-
progress_path=progress,
|
|
140
|
-
use_stream_json=True,
|
|
141
|
-
effort=None if profile.platform == "cursor" else "low",
|
|
142
|
-
total_timeout_seconds=timeout_seconds,
|
|
143
|
-
)
|
|
144
|
-
).run()
|
|
145
|
-
text = session_log.read_text(encoding="utf-8", errors="replace") if session_log.is_file() else ""
|
|
146
|
-
missing = [label for label in REQUIRED_LABELS if label not in text]
|
|
147
|
-
if _looks_capability_blocked(text):
|
|
148
|
-
return SmokeResult(
|
|
149
|
-
profile.name,
|
|
150
|
-
"skipped",
|
|
151
|
-
"authentication, model, quota, network, or account capability unavailable",
|
|
152
|
-
str(session_log),
|
|
153
|
-
result.exit_code,
|
|
154
|
-
)
|
|
155
|
-
if result.timed_out:
|
|
156
|
-
return SmokeResult(profile.name, "failed", "live smoke timed out without a capability-block marker", str(session_log), result.exit_code)
|
|
157
|
-
if result.exit_code not in (0, None):
|
|
158
|
-
return SmokeResult(profile.name, "failed", f"AI CLI exited with {result.exit_code}", str(session_log), result.exit_code)
|
|
159
|
-
if missing:
|
|
160
|
-
return SmokeResult(
|
|
161
|
-
profile.name,
|
|
162
|
-
"failed",
|
|
163
|
-
"missing normalized labels: " + ", ".join(missing),
|
|
164
|
-
str(session_log),
|
|
165
|
-
result.exit_code,
|
|
166
|
-
)
|
|
167
|
-
if "PRIZMKIT_SMOKE_TOOL_OK" not in text or "PRIZMKIT_SMOKE_FINAL_OK" not in text:
|
|
168
|
-
return SmokeResult(
|
|
169
|
-
profile.name,
|
|
170
|
-
"failed",
|
|
171
|
-
"tool or final-answer sentinel missing",
|
|
172
|
-
str(session_log),
|
|
173
|
-
result.exit_code,
|
|
174
|
-
)
|
|
175
|
-
return SmokeResult(profile.name, "passed", "normalized live tool session verified", str(session_log), result.exit_code)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
def main(argv: list[str] | None = None) -> int:
|
|
179
|
-
parser = argparse.ArgumentParser(description=__doc__)
|
|
180
|
-
parser.add_argument("--run", action="store_true", help="authorize live AI CLI calls")
|
|
181
|
-
parser.add_argument("--only", action="append", default=[], help="run only a named installed example")
|
|
182
|
-
parser.add_argument("--timeout", type=float, default=180, help="per-profile timeout in seconds")
|
|
183
|
-
args = parser.parse_args(argv)
|
|
184
|
-
|
|
185
|
-
installed, results = discover_profiles()
|
|
186
|
-
selected = set(args.only)
|
|
187
|
-
if selected:
|
|
188
|
-
installed = [profile for profile in installed if profile.name in selected]
|
|
189
|
-
known = {profile.name for profile in installed} | {result.name for result in results}
|
|
190
|
-
for name in sorted(selected - known):
|
|
191
|
-
results.append(SmokeResult(name, "skipped", "unknown or unavailable profile example"))
|
|
192
|
-
|
|
193
|
-
authorized = args.run or os.environ.get("PRIZMKIT_RUN_LIVE_AI_SMOKE") == "1"
|
|
194
|
-
if not authorized:
|
|
195
|
-
results.extend(
|
|
196
|
-
SmokeResult(profile.name, "skipped", "live calls not authorized; pass --run or set PRIZMKIT_RUN_LIVE_AI_SMOKE=1")
|
|
197
|
-
for profile in installed
|
|
198
|
-
)
|
|
199
|
-
else:
|
|
200
|
-
results.extend(run_profile(profile, timeout_seconds=args.timeout) for profile in installed)
|
|
201
|
-
|
|
202
|
-
payload = {"results": [asdict(result) for result in sorted(results, key=lambda item: item.name)]}
|
|
203
|
-
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
|
204
|
-
return 1 if any(result.status == "failed" for result in results) else 0
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if __name__ == "__main__":
|
|
208
|
-
raise SystemExit(main())
|