prizmkit 1.1.192 → 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.
Files changed (56) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/README.md +23 -34
  3. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +3 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/config.py +24 -2
  6. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +2 -0
  7. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +89 -40
  8. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +9 -1
  9. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +0 -22
  10. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +11 -7
  11. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +26 -20
  12. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +37 -4
  13. package/bundled/dev-pipeline/prizmkit_runtime/reset_preserve.py +20 -41
  14. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +74 -36
  15. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -66
  16. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +271 -52
  17. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +51 -13
  18. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +43 -15
  19. package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +27 -24
  20. package/bundled/dev-pipeline/prizmkit_runtime/task_checkout.py +0 -1
  21. package/bundled/dev-pipeline/scripts/check-session-status.py +13 -1
  22. package/bundled/dev-pipeline/scripts/continuation.py +2 -3
  23. package/bundled/dev-pipeline/scripts/detect-stuck.py +19 -5
  24. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +6 -14
  25. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +13 -8
  26. package/bundled/dev-pipeline/scripts/init-change-artifact.py +17 -2
  27. package/bundled/dev-pipeline/scripts/prompt_framework.py +39 -21
  28. package/bundled/dev-pipeline/scripts/update-checkpoint.py +27 -0
  29. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -1
  30. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -6
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +1 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +1 -1
  33. package/bundled/skills/_metadata.json +1 -1
  34. package/package.json +1 -1
  35. package/bundled/dev-pipeline/tests/_helpers.py +0 -418
  36. package/bundled/dev-pipeline/tests/conftest.py +0 -73
  37. package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +0 -208
  38. package/bundled/dev-pipeline/tests/test_auto_skip.py +0 -1806
  39. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +0 -1439
  40. package/bundled/dev-pipeline/tests/test_daemon_and_scripts.py +0 -257
  41. package/bundled/dev-pipeline/tests/test_e2e_pipeline_run.py +0 -500
  42. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +0 -1654
  43. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +0 -629
  44. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +0 -2973
  45. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +0 -321
  46. package/bundled/dev-pipeline/tests/test_repository_bootstrap.py +0 -251
  47. package/bundled/dev-pipeline/tests/test_reset_modes.py +0 -1196
  48. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -872
  49. package/bundled/dev-pipeline/tests/test_runner_bookkeeping.py +0 -766
  50. package/bundled/dev-pipeline/tests/test_runner_lifecycle.py +0 -1257
  51. package/bundled/dev-pipeline/tests/test_runtime_commit.py +0 -1113
  52. package/bundled/dev-pipeline/tests/test_runtime_helper.py +0 -380
  53. package/bundled/dev-pipeline/tests/test_session_launch.py +0 -1101
  54. package/bundled/dev-pipeline/tests/test_stream_progress.py +0 -585
  55. package/bundled/dev-pipeline/tests/test_unified_cli.py +0 -3625
  56. package/bundled/dev-pipeline/tests/test_utils.py +0 -170
@@ -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())