prizmkit 1.1.162 → 1.1.164

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 (58) hide show
  1. package/bin/create-prizmkit.js +4 -4
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/adapters/cursor/assets/prizmkit-hook.cjs +65 -0
  4. package/bundled/adapters/cursor/hooks-adapter.js +139 -0
  5. package/bundled/adapters/cursor/paths.js +11 -0
  6. package/bundled/adapters/cursor/rules-adapter.js +49 -0
  7. package/bundled/adapters/cursor/skill-adapter.js +27 -0
  8. package/bundled/dev-pipeline/README.md +18 -5
  9. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +3 -25
  10. package/bundled/dev-pipeline/prizmkit_runtime/config.py +71 -14
  11. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +28 -4
  12. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +5 -2
  13. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +21 -3
  14. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +19 -5
  15. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +123 -28
  16. package/bundled/dev-pipeline/prizmkit_runtime/status.py +2 -0
  17. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +1 -42
  18. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +43 -6
  19. package/bundled/dev-pipeline/scripts/init-pipeline.py +46 -8
  20. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +41 -6
  21. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +143 -27
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +2 -2
  23. package/bundled/dev-pipeline/scripts/utils.py +3 -12
  24. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +4 -2
  25. package/bundled/dev-pipeline/templates/feature-list-schema.json +4 -2
  26. package/bundled/dev-pipeline/templates/refactor-list-schema.json +4 -2
  27. package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +2 -1
  28. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +5 -23
  29. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +2 -2
  30. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +231 -0
  31. package/bundled/dev-pipeline/tests/test_unified_cli.py +406 -30
  32. package/bundled/dev-pipeline/tests/test_utils.py +23 -0
  33. package/bundled/rules/USAGE.md +3 -0
  34. package/bundled/skills/_metadata.json +1 -1
  35. package/bundled/skills/bug-planner/SKILL.md +0 -1
  36. package/bundled/skills/bug-planner/references/verification.md +0 -2
  37. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +37 -7
  38. package/bundled/skills/feature-planner/SKILL.md +5 -8
  39. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +43 -19
  40. package/bundled/skills/prizmkit-init/SKILL.md +1 -1
  41. package/bundled/skills/prizmkit-init/references/config-schema.md +2 -2
  42. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +2 -3
  43. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +1 -1
  44. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +1 -1
  45. package/bundled/skills/refactor-planner/SKILL.md +1 -3
  46. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +38 -9
  47. package/package.json +4 -2
  48. package/src/ai-cli-launch.js +9 -2
  49. package/src/clean.js +42 -6
  50. package/src/config.js +51 -10
  51. package/src/detect-platform.js +30 -8
  52. package/src/external-skills.js +33 -99
  53. package/src/index.js +5 -0
  54. package/src/manifest.js +30 -4
  55. package/src/platforms.js +11 -4
  56. package/src/prompts.js +12 -4
  57. package/src/scaffold.js +75 -4
  58. package/src/upgrade.js +15 -14
@@ -23,6 +23,15 @@ EXPECTED_SCHEMA = "dev-pipeline-feature-list-v1"
23
23
  FEATURE_ID_PATTERN = re.compile(r"^F-\d{3}(-[A-Z])?$")
24
24
  TERMINAL_STATUSES = {"completed", "failed", "skipped", "split", "auto_skipped"}
25
25
  VALID_PRIORITIES = {"critical", "high", "medium", "low"}
26
+ ALLOWED_LIST_FIELDS = {
27
+ "$schema", "project_name", "project_description", "created_at",
28
+ "created_by", "features", "global_context",
29
+ }
30
+ ALLOWED_GLOBAL_CONTEXT_FIELDS = {
31
+ "tech_stack", "language", "runtime", "frontend_framework",
32
+ "frontend_styling", "backend_framework", "database", "orm",
33
+ "design_system", "testing_strategy", "bundler", "project_type",
34
+ }
26
35
 
27
36
  REQUIRED_FEATURE_FIELDS = [
28
37
  "id",
@@ -33,6 +42,16 @@ REQUIRED_FEATURE_FIELDS = [
33
42
  "acceptance_criteria",
34
43
  "status",
35
44
  ]
45
+ ALLOWED_FEATURE_FIELDS = set(REQUIRED_FEATURE_FIELDS) | {
46
+ "estimated_complexity",
47
+ "session_granularity",
48
+ "sub_features",
49
+ "model",
50
+ "completion_notes",
51
+ "user_context",
52
+ "browser_interaction",
53
+ "testing",
54
+ }
36
55
 
37
56
 
38
57
  def parse_args():
@@ -71,6 +90,12 @@ def validate_schema(data):
71
90
  """Validate the top-level schema and structure of the feature list."""
72
91
  errors = []
73
92
 
93
+ unknown_root = set(data) - ALLOWED_LIST_FIELDS
94
+ if unknown_root:
95
+ errors.append("Feature list has unknown fields: {}".format(
96
+ ", ".join(sorted(unknown_root))
97
+ ))
98
+
74
99
  # Check $schema
75
100
  schema = data.get("$schema")
76
101
  if schema != EXPECTED_SCHEMA:
@@ -78,13 +103,24 @@ def validate_schema(data):
78
103
  "Invalid $schema: expected '{}', got '{}'".format(EXPECTED_SCHEMA, schema)
79
104
  )
80
105
 
81
- # Check project_name (supports legacy app_name for backward compatibility)
82
- project_name = data.get("project_name", data.get("app_name"))
106
+ # Check project_name
107
+ project_name = data.get("project_name")
83
108
  if project_name is None:
84
109
  errors.append("Missing required field: project_name")
85
110
  elif not isinstance(project_name, str) or not project_name.strip():
86
111
  errors.append("project_name must be a non-empty string")
87
112
 
113
+ global_context = data.get("global_context")
114
+ if global_context is not None:
115
+ if not isinstance(global_context, dict):
116
+ errors.append("global_context must be an object")
117
+ else:
118
+ unknown_context = set(global_context) - ALLOWED_GLOBAL_CONTEXT_FIELDS
119
+ if unknown_context:
120
+ errors.append("global_context has unknown fields: {}".format(
121
+ ", ".join(sorted(unknown_context))
122
+ ))
123
+
88
124
  # Check features array
89
125
  if "features" not in data:
90
126
  errors.append("Missing required field: features")
@@ -106,12 +142,6 @@ def validate_features(features):
106
142
  errors.append("Feature at index {} is not an object".format(i))
107
143
  continue
108
144
 
109
- for retired_field in ("critic", "critic_count"):
110
- if retired_field in feature:
111
- errors.append(
112
- "Feature at index {} uses retired field '{}'".format(i, retired_field)
113
- )
114
-
115
145
  # Check required fields
116
146
  for field in REQUIRED_FEATURE_FIELDS:
117
147
  if field not in feature:
@@ -119,6 +149,14 @@ def validate_features(features):
119
149
  "Feature at index {} missing required field: {}".format(i, field)
120
150
  )
121
151
 
152
+ unknown = set(feature) - ALLOWED_FEATURE_FIELDS
153
+ if unknown:
154
+ errors.append(
155
+ "Feature at index {} has unknown fields: {}".format(
156
+ i, ", ".join(sorted(unknown))
157
+ )
158
+ )
159
+
122
160
  # Validate feature ID format
123
161
  fid = feature.get("id")
124
162
  if fid is not None:
@@ -21,6 +21,15 @@ from utils import load_json_file, stable_topological_order
21
21
 
22
22
  EXPECTED_SCHEMA = "dev-pipeline-refactor-list-v1"
23
23
  REFACTOR_ID_PATTERN = re.compile(r"^R-\d{3}$")
24
+ ALLOWED_LIST_FIELDS = {
25
+ "$schema", "project_name", "project_description", "created_at",
26
+ "created_by", "refactors", "global_context",
27
+ }
28
+ ALLOWED_GLOBAL_CONTEXT_FIELDS = {
29
+ "tech_stack", "language", "runtime", "frontend_framework",
30
+ "frontend_styling", "backend_framework", "database", "orm",
31
+ "testing_strategy", "bundler", "project_type", "ci_pipeline",
32
+ }
24
33
 
25
34
  REQUIRED_REFACTOR_FIELDS = [
26
35
  "id",
@@ -35,6 +44,13 @@ REQUIRED_REFACTOR_FIELDS = [
35
44
  "dependencies",
36
45
  "status",
37
46
  ]
47
+ ALLOWED_REFACTOR_FIELDS = set(REQUIRED_REFACTOR_FIELDS) | {
48
+ "estimated_lines",
49
+ "completion_notes",
50
+ "user_context",
51
+ "browser_interaction",
52
+ "model",
53
+ }
38
54
 
39
55
  VALID_TYPES = ["extract", "rename", "restructure", "simplify", "decouple", "migrate"]
40
56
  VALID_PRIORITIES = ["critical", "high", "medium", "low"]
@@ -75,6 +91,12 @@ def validate_schema(data):
75
91
  """Validate the top-level schema and structure of the refactor list."""
76
92
  errors = []
77
93
 
94
+ unknown_root = set(data) - ALLOWED_LIST_FIELDS
95
+ if unknown_root:
96
+ errors.append("Refactor list has unknown fields: {}".format(
97
+ ", ".join(sorted(unknown_root))
98
+ ))
99
+
78
100
  # Check $schema
79
101
  schema = data.get("$schema")
80
102
  if schema != EXPECTED_SCHEMA:
@@ -88,6 +110,17 @@ def validate_schema(data):
88
110
  elif not isinstance(data["project_name"], str) or not data["project_name"].strip():
89
111
  errors.append("project_name must be a non-empty string")
90
112
 
113
+ global_context = data.get("global_context")
114
+ if global_context is not None:
115
+ if not isinstance(global_context, dict):
116
+ errors.append("global_context must be an object")
117
+ else:
118
+ unknown_context = set(global_context) - ALLOWED_GLOBAL_CONTEXT_FIELDS
119
+ if unknown_context:
120
+ errors.append("global_context has unknown fields: {}".format(
121
+ ", ".join(sorted(unknown_context))
122
+ ))
123
+
91
124
  # Check refactors array
92
125
  if "refactors" not in data:
93
126
  errors.append("Missing required field: refactors")
@@ -109,12 +142,6 @@ def validate_refactors(refactors):
109
142
  errors.append("Refactor at index {} is not an object".format(i))
110
143
  continue
111
144
 
112
- for retired_field in ("critic", "critic_count"):
113
- if retired_field in refactor:
114
- errors.append(
115
- "Refactor at index {} uses retired field '{}'".format(i, retired_field)
116
- )
117
-
118
145
  # Check required fields
119
146
  for field in REQUIRED_REFACTOR_FIELDS:
120
147
  if field not in refactor:
@@ -122,6 +149,14 @@ def validate_refactors(refactors):
122
149
  "Refactor at index {} missing required field: {}".format(i, field)
123
150
  )
124
151
 
152
+ unknown = set(refactor) - ALLOWED_REFACTOR_FIELDS
153
+ if unknown:
154
+ errors.append(
155
+ "Refactor at index {} has unknown fields: {}".format(
156
+ i, ", ".join(sorted(unknown))
157
+ )
158
+ )
159
+
125
160
  # Validate refactor ID format
126
161
  rid = refactor.get("id")
127
162
  if rid is not None:
@@ -199,6 +199,43 @@ def _normalize_status(status, default="unknown"):
199
199
  return text
200
200
 
201
201
 
202
+ def _cursor_tool_call_parts(event):
203
+ """Return Cursor tool name, arguments, result, and error signal."""
204
+ tool_call = event.get("tool_call") if isinstance(event, dict) else None
205
+ if not isinstance(tool_call, dict) or not tool_call:
206
+ return "unknown", {}, {}, False
207
+ key, payload = next(iter(tool_call.items()))
208
+ payload = payload if isinstance(payload, dict) else {}
209
+ if key == "function":
210
+ name = str(payload.get("name") or "function")
211
+ arguments = payload.get("arguments") or payload.get("args") or {}
212
+ else:
213
+ name = re.sub(r"ToolCall$", "", str(key)) or "unknown"
214
+ name = name[:1].upper() + name[1:]
215
+ arguments = payload.get("args") or {}
216
+ result = payload.get("result") or {}
217
+ is_error = bool(event.get("is_error"))
218
+ if isinstance(result, dict):
219
+ is_error = is_error or bool(result.get("error") or result.get("failure"))
220
+ return name, arguments, result, is_error
221
+
222
+
223
+ def _cursor_compact_value(value, limit=800):
224
+ """Render Cursor tool metadata without copying full file content into logs."""
225
+ def compact(item, key=""):
226
+ if key in {"fileText", "content"} and isinstance(item, str):
227
+ return f"<{len(item)} chars>"
228
+ if isinstance(item, dict):
229
+ return {child_key: compact(child, child_key) for child_key, child in item.items()}
230
+ if isinstance(item, list):
231
+ return [compact(child) for child in item]
232
+ return item
233
+
234
+ value = compact(value)
235
+ rendered = value if isinstance(value, str) else json.dumps(value, ensure_ascii=False, sort_keys=True, default=str)
236
+ return rendered[:limit]
237
+
238
+
202
239
  @dataclass(frozen=True)
203
240
  class SemanticLogEvent:
204
241
  """One provider-neutral semantic fragment destined for session.log."""
@@ -631,6 +668,19 @@ class SemanticLogNormalizer:
631
668
  if event_type == "message_stop":
632
669
  return self.renderer.finish()
633
670
 
671
+ if event_type == "tool_call":
672
+ tool_name, arguments, result, is_error = _cursor_tool_call_parts(event)
673
+ call_id = str(event.get("call_id") or "")
674
+ if event.get("subtype") == "started":
675
+ self._remember_action_id(call_id)
676
+ return self._complete("action", f"{tool_name} {_cursor_compact_value(arguments)}")
677
+ if event.get("subtype") == "completed":
678
+ rendered += self._complete("observation", f"{tool_name} {_cursor_compact_value(result)}")
679
+ if is_error:
680
+ rendered += self._complete("error", f"{tool_name} failed")
681
+ return rendered
682
+ return ""
683
+
634
684
  if event_type == "assistant":
635
685
  self._scope += 1
636
686
  return self._message_parts(event.get("message"))
@@ -713,8 +763,9 @@ class SemanticLogNormalizer:
713
763
  class ProgressTracker:
714
764
  """Tracks progress state from stream-json events."""
715
765
 
716
- def __init__(self, session_log=None):
766
+ def __init__(self, session_log=None, provider_hint=None):
717
767
  self.session_log_path = Path(session_log).expanduser() if session_log else None
768
+ self.provider_hint = str(provider_hint or "").strip().lower()
718
769
  self.message_count = 0
719
770
  self.event_type_counts = Counter()
720
771
  self.current_tool = None
@@ -733,9 +784,9 @@ class ProgressTracker:
733
784
  self.is_active = True
734
785
  self.errors = []
735
786
  self.event_format = ""
736
- self.active_subagent_count = 0
787
+ self.active_subagents = 0
737
788
  self.subagent_status_counts = Counter()
738
- self._subagent_spawn_count = 0
789
+ self.subagents_spawned = 0
739
790
  self.subagent_records = {}
740
791
  self.subagent_aliases = {}
741
792
  self.subagent_source_providers = set()
@@ -743,6 +794,7 @@ class ProgressTracker:
743
794
  self.parent_subagent_activity_ids = set()
744
795
  self.codex_child_thread_ids = set()
745
796
  self.cb_session_id = ""
797
+ self.cursor_session_id = ""
746
798
  self.result_subtype = ""
747
799
  self.stop_reason = ""
748
800
  self.has_usage = False
@@ -795,6 +847,86 @@ class ProgressTracker:
795
847
 
796
848
  self._record_structured_subagent_metadata(event)
797
849
 
850
+ # ── Cursor Agent --output-format stream-json ─────────────────
851
+ is_cursor_event = (
852
+ self.provider_hint == "cursor"
853
+ or event_type == "tool_call"
854
+ or self.event_format == "cursor-stream-json"
855
+ )
856
+ if is_cursor_event:
857
+ self.event_format = "cursor-stream-json"
858
+ if event_type == "tool_call" and not self.cursor_session_id and self.claude_session_id:
859
+ self.cursor_session_id = self.claude_session_id
860
+ self.claude_session_id = ""
861
+ self.claude_cwd = ""
862
+ session_id = event.get("session_id")
863
+ if isinstance(session_id, str) and session_id.strip() and not self.cursor_session_id:
864
+ self.cursor_session_id = session_id.strip()
865
+ if event_type == "system" and event.get("subtype") == "init":
866
+ self.is_active = True
867
+ elif event_type == "assistant":
868
+ self.message_count += 1
869
+ self.is_active = True
870
+ message = event.get("message") if isinstance(event.get("message"), dict) else {}
871
+ content = message.get("content")
872
+ texts = []
873
+ if isinstance(content, str):
874
+ texts = [content]
875
+ elif isinstance(content, list):
876
+ texts = [
877
+ str(item.get("text") or "")
878
+ for item in content
879
+ if isinstance(item, dict) and item.get("type") in {"text", "output_text"}
880
+ ]
881
+ text = "\n".join(part for part in texts if part)
882
+ if text.strip():
883
+ self.last_text_snippet = text.strip()[-120:]
884
+ self._detect_phase(text)
885
+ self._detect_terminal_error(text, require_error_context=True)
886
+ elif event_type == "tool_call":
887
+ tool_name, arguments, result, is_error = _cursor_tool_call_parts(event)
888
+ subtype = str(event.get("subtype") or "")
889
+ if subtype == "started":
890
+ self.current_tool = tool_name
891
+ self.tool_call_counts[tool_name] += 1
892
+ self.total_tool_calls += 1
893
+ self.is_active = True
894
+ if isinstance(arguments, dict):
895
+ self._extract_tool_summary_from_dict(arguments)
896
+ else:
897
+ self._extract_tool_summary(str(arguments))
898
+ self._detect_phase(_cursor_compact_value(arguments, 500))
899
+ self._record_agent_tool_call(
900
+ "cursor",
901
+ tool_name,
902
+ arguments,
903
+ source_event="tool_call.started",
904
+ event_id=str(event.get("call_id") or ""),
905
+ )
906
+ elif subtype == "completed":
907
+ self.current_tool = None
908
+ if is_error:
909
+ error_text = _cursor_compact_value(result, 500)
910
+ self.errors.append(error_text)
911
+ self._detect_terminal_error(error_text, require_error_context=True)
912
+ elif event_type == "result":
913
+ self.current_tool = None
914
+ self.is_active = False
915
+ self.result_subtype = str(event.get("subtype") or "")
916
+ result_text = str(event.get("result") or event.get("message") or "")
917
+ self._record_terminal_result(
918
+ text=result_text,
919
+ is_error=bool(event.get("is_error")) or self.result_subtype.lower() != "success",
920
+ api_error_status=event.get("api_error_status"),
921
+ api_error_code=str(event.get("error_code") or ""),
922
+ stop_reason=str(event.get("stop_reason") or ""),
923
+ )
924
+ elif event_type == "error":
925
+ error_text = str(event.get("error") or event.get("message") or "Cursor Agent error")
926
+ self.errors.append(error_text[:500])
927
+ self._detect_terminal_error(error_text, require_error_context=True)
928
+ return
929
+
798
930
  # ── Pi --mode json JSONL format ─────────────────────────────
799
931
  pi_event_types = {
800
932
  "session", "agent_start", "agent_end", "turn_start", "turn_end",
@@ -1443,7 +1575,7 @@ class ProgressTracker:
1443
1575
  return canonical
1444
1576
 
1445
1577
  def _refresh_normalized_subagent_totals(self):
1446
- """Mirror normalized records into legacy progress fields."""
1578
+ """Refresh normalized totals from authoritative subagent records."""
1447
1579
  counts = Counter()
1448
1580
  active = 0
1449
1581
  spawned = 0
@@ -1455,8 +1587,8 @@ class ProgressTracker:
1455
1587
  if bool(record.get("spawned")):
1456
1588
  spawned += 1
1457
1589
  self.subagent_status_counts = counts
1458
- self.active_subagent_count = active
1459
- self._subagent_spawn_count = spawned
1590
+ self.active_subagents = active
1591
+ self.subagents_spawned = spawned
1460
1592
 
1461
1593
  def _subagent_statistics(self):
1462
1594
  """Return additive normalized subagent statistics for progress.json."""
@@ -1490,8 +1622,8 @@ class ProgressTracker:
1490
1622
  return {
1491
1623
  "source": "session_log",
1492
1624
  "providers": sorted(self.subagent_source_providers),
1493
- "spawned": self._subagent_spawn_count,
1494
- "active": self.active_subagent_count,
1625
+ "spawned": self.subagents_spawned,
1626
+ "active": self.active_subagents,
1495
1627
  "status_counts": dict(self.subagent_status_counts),
1496
1628
  "states": states,
1497
1629
  "observed_ids": sorted(set(observed_ids)),
@@ -1614,7 +1746,7 @@ class ProgressTracker:
1614
1746
 
1615
1747
  def _record_agent_tool_call(self, provider, tool_name, raw_args, *, source_event="tool_use", event_id=""):
1616
1748
  """Record delegated execution tool calls as session-log subagent spawns."""
1617
- if tool_name != "Agent":
1749
+ if tool_name not in {"Agent", "Task"}:
1618
1750
  return
1619
1751
  if isinstance(raw_args, dict):
1620
1752
  args = raw_args
@@ -1625,7 +1757,7 @@ class ProgressTracker:
1625
1757
  args = {"raw_args": raw_args}
1626
1758
  else:
1627
1759
  args = {}
1628
- if tool_name == "Agent" and not any(args.get(key) for key in ("subagent_type", "prompt", "description")):
1760
+ if not any(args.get(key) for key in ("subagent_type", "prompt", "description")):
1629
1761
  return
1630
1762
  explicit_ids = []
1631
1763
  for key in ("id", "tool_use_id", "call_id", "callId", "task_id", "taskId"):
@@ -2134,10 +2266,6 @@ class ProgressTracker:
2134
2266
  {"name": name, "count": count}
2135
2267
  for name, count in self.tool_call_counts.most_common()
2136
2268
  ]
2137
- subagent_states = [
2138
- {"status": status, "count": count}
2139
- for status, count in self.subagent_status_counts.most_common()
2140
- ]
2141
2269
  subagent_stats = self._subagent_statistics()
2142
2270
  return {
2143
2271
  "updated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
@@ -2146,6 +2274,7 @@ class ProgressTracker:
2146
2274
  "claude_session_id": self.claude_session_id,
2147
2275
  "result_subtype": self.result_subtype,
2148
2276
  "stop_reason": self.stop_reason,
2277
+ "cursor_session_id": self.cursor_session_id,
2149
2278
  "has_usage": self.has_usage,
2150
2279
  "permission_denial_count": len(self.permission_denials),
2151
2280
  "permission_denials": self.permission_denials[-10:],
@@ -2156,19 +2285,6 @@ class ProgressTracker:
2156
2285
  "detected_phases": self.detected_phases,
2157
2286
  "tool_calls": tool_calls,
2158
2287
  "total_tool_calls": self.total_tool_calls,
2159
- "active_subagent_count": self.active_subagent_count,
2160
- "subagent_states": subagent_states,
2161
- "subagent_spawn_count": self._subagent_spawn_count,
2162
- "subagent_stats_source": "session_log",
2163
- "subagent_provider": ",".join(subagent_stats["providers"]),
2164
- "subagent_observed_ids": subagent_stats["observed_ids"],
2165
- "subagent_source_metadata": {
2166
- "source": subagent_stats["source"],
2167
- "providers": subagent_stats["providers"],
2168
- "source_events": subagent_stats["source_events"],
2169
- "parent_activity_ids": subagent_stats["parent_activity_ids"],
2170
- "child_activity_source": subagent_stats["child_activity_source"],
2171
- },
2172
2288
  "subagent_statistics": subagent_stats,
2173
2289
  "child_activity_source": "filesystem_liveness_only",
2174
2290
  "child_thread_ids": sorted(self.codex_child_thread_ids),
@@ -1347,7 +1347,7 @@ def action_status(feature_list_data, state_dir, feature_filter=None, project_roo
1347
1347
  and workflow-checkpoint.json.
1348
1348
  """
1349
1349
  features = feature_list_data.get("features", [])
1350
- app_name = feature_list_data.get("project_name", feature_list_data.get("app_name", "Unknown"))
1350
+ project_name = feature_list_data.get("project_name", "Unknown")
1351
1351
  project_root = os.path.abspath(project_root) if project_root else _default_project_root()
1352
1352
 
1353
1353
  # Apply feature filter
@@ -1541,7 +1541,7 @@ def action_status(feature_list_data, state_dir, feature_filter=None, project_roo
1541
1541
  print("╔" + "═" * BOX_WIDTH + "╗")
1542
1542
  print("║" + pad_right(COLOR_BOLD + " Dev-Pipeline Status" + COLOR_RESET, inner) + " ║")
1543
1543
  print("╠" + "═" * BOX_WIDTH + "╣")
1544
- print("║" + pad_right(" Project: {}".format(app_name), inner) + " ║")
1544
+ print("║" + pad_right(" Project: {}".format(project_name), inner) + " ║")
1545
1545
  print("║" + pad_right(" {}".format(summary_line), inner) + " ║")
1546
1546
  print("║" + pad_right(" {}".format(summary_line2), inner) + " ║")
1547
1547
  if summary_line3:
@@ -588,12 +588,6 @@ def detect_project_context(project_root):
588
588
  detected["backend_framework"] = fw_name
589
589
  break
590
590
 
591
- # Legacy "framework" field for backward compatibility
592
- if "frontend_framework" in detected:
593
- detected["framework"] = detected["frontend_framework"]
594
- elif "backend_framework" in detected:
595
- detected["framework"] = detected["backend_framework"]
596
-
597
591
  # ── Frontend styling ──
598
592
  styling_libs = [
599
593
  ("tailwindcss", "Tailwind CSS"),
@@ -723,7 +717,6 @@ def detect_project_context(project_root):
723
717
  for dep_name, fw_name in py_backend:
724
718
  if dep_name in py_deps:
725
719
  detected["backend_framework"] = fw_name
726
- detected["framework"] = fw_name
727
720
  break
728
721
 
729
722
  # Database / ORM
@@ -771,7 +764,6 @@ def detect_project_context(project_root):
771
764
  elif "go-chi/chi" in go_content:
772
765
  detected["backend_framework"] = "Chi"
773
766
  if "backend_framework" in detected:
774
- detected["framework"] = detected["backend_framework"]
775
767
  detected["project_type"] = "backend"
776
768
 
777
769
  # ── 4. Rust / Java / other languages (basic detection) ──
@@ -828,7 +820,6 @@ def enrich_global_context(global_context, project_root):
828
820
  key_mapping = {
829
821
  "language": "language",
830
822
  "testing_framework": "testing_strategy",
831
- "framework": "framework",
832
823
  "frontend_framework": "frontend_framework",
833
824
  "frontend_styling": "frontend_styling",
834
825
  "backend_framework": "backend_framework",
@@ -864,8 +855,8 @@ def resolve_prompt_platform(project_root):
864
855
  if resolution.platform:
865
856
  return resolution.platform
866
857
  raise RuntimeError(
867
- "PrizmKit platform skills not found. None of .claude/commands/, .agents/skills/, or .codebuddy/skills/ exists. "
868
- "Run `npx prizmkit install` first, set .prizmkit/config.json ai_cli/platform, or set PRIZMKIT_PLATFORM=claude|codex|codebuddy explicitly."
858
+ "PrizmKit platform skills not found. None of .claude/commands/, .agents/skills/, .codebuddy/skills/, .pi/skills/, or .cursor/skills/ exists. "
859
+ "Run `npx prizmkit install` first, set .prizmkit/config.json ai_cli/platform, or set PRIZMKIT_PLATFORM=claude|codex|codebuddy|pi|cursor explicitly."
869
860
  )
870
861
 
871
862
  def read_platform_conventions(project_root):
@@ -882,7 +873,7 @@ def read_platform_conventions(project_root):
882
873
  platform = os.environ.get("PRIZMKIT_PLATFORM", "claude")
883
874
  if platform == "codebuddy":
884
875
  candidates = ["CODEBUDDY.md", "CLAUDE.md", "AGENTS.md"]
885
- elif platform == "codex":
876
+ elif platform in {"codex", "cursor"}:
886
877
  candidates = ["AGENTS.md", "CLAUDE.md", "CODEBUDDY.md"]
887
878
  else:
888
879
  candidates = ["CLAUDE.md", "CODEBUDDY.md", "AGENTS.md"]
@@ -260,7 +260,9 @@
260
260
  "ci_pipeline": {
261
261
  "type": "string"
262
262
  }
263
- }
263
+ },
264
+ "additionalProperties": false
264
265
  }
265
- }
266
+ },
267
+ "additionalProperties": false
266
268
  }
@@ -246,7 +246,9 @@
246
246
  "project_type": {
247
247
  "type": "string"
248
248
  }
249
- }
249
+ },
250
+ "additionalProperties": false
250
251
  }
251
- }
252
+ },
253
+ "additionalProperties": false
252
254
  }
@@ -258,7 +258,9 @@
258
258
  "ci_pipeline": {
259
259
  "type": "string"
260
260
  }
261
- }
261
+ },
262
+ "additionalProperties": false
262
263
  }
263
- }
264
+ },
265
+ "additionalProperties": false
264
266
  }
@@ -51,6 +51,7 @@ PROFILE_EXAMPLES = (
51
51
  ("codebuddy", "cbc", "codebuddy"),
52
52
  ("codex", "codex", "codex"),
53
53
  ("claude", "claude", "claude"),
54
+ ("cursor", "agent", "cursor"),
54
55
  )
55
56
 
56
57
  AUTH_MARKERS = (
@@ -136,7 +137,7 @@ def run_profile(profile: SmokeProfile, *, timeout_seconds: float = 180) -> Smoke
136
137
  log_path=session_log,
137
138
  progress_path=progress,
138
139
  use_stream_json=True,
139
- effort="low",
140
+ effort=None if profile.platform == "cursor" else "low",
140
141
  total_timeout_seconds=timeout_seconds,
141
142
  )
142
143
  ).run()
@@ -1111,38 +1111,20 @@ def test_completion_rejects_inconsistent_independent_review_metadata(tmp_path):
1111
1111
  assert state.semantic.artifacts_valid is False
1112
1112
 
1113
1113
 
1114
- def test_legacy_completed_checkpoint_accepts_historical_test_projection_read_only(tmp_path):
1114
+ def test_completed_checkpoint_rejects_unknown_test_projection_field(tmp_path):
1115
1115
  payload = _family_checkpoint(tmp_path)
1116
- by_skill = {step["skill"]: step for step in payload["steps"]}
1117
- legacy_order = [
1118
- "prizmkit-implement",
1119
- "prizmkit-code-review",
1120
- "prizmkit-test",
1121
- "prizmkit-retrospective",
1122
- "prizmkit-committer",
1123
- "completion-summary",
1124
- ]
1125
- payload["steps"] = [by_skill[skill] for skill in legacy_order]
1126
- previous = None
1127
- for index, step in enumerate(payload["steps"], start=1):
1128
- step["id"] = f"S{index:02d}"
1129
- step["depends_on"] = previous
1130
- previous = step["id"]
1131
1116
  checkpoint = _write(
1132
1117
  tmp_path / ".prizmkit/specs/feature/workflow-checkpoint.json", payload,
1133
1118
  )
1134
1119
  result_path = checkpoint.parent / "test-result.json"
1135
1120
  projection = json.loads(result_path.read_text(encoding="utf-8"))
1136
- projection["review_required"] = False
1137
- projection["review_scope"] = None
1121
+ projection["unexpected_field"] = True
1138
1122
  result_path.write_text(json.dumps(projection), encoding="utf-8")
1139
- assert load_test_result(result_path) is None
1140
1123
 
1124
+ assert load_test_result(result_path) is None
1141
1125
  state = load_checkpoint_state(checkpoint, project_root=tmp_path)
1142
-
1143
- assert state.semantic_complete is True
1144
- assert state.semantic.artifacts_valid is True
1145
- assert state.semantic_commit_ready is False
1126
+ assert state.semantic_complete is False
1127
+ assert state.semantic.artifacts_valid is False
1146
1128
 
1147
1129
 
1148
1130
  def test_completion_accepts_legacy_terminal_result_report(tmp_path):
@@ -183,8 +183,8 @@ class TestFormatGlobalContext:
183
183
  assert format_global_context({}) == "- (none specified)"
184
184
 
185
185
  def test_dict(self):
186
- result = format_global_context({"framework": "React", "lang": "TypeScript"})
187
- assert "**framework**: React" in result
186
+ result = format_global_context({"frontend_framework": "React", "lang": "TypeScript"})
187
+ assert "**frontend_framework**: React" in result
188
188
  assert "**lang**: TypeScript" in result
189
189
 
190
190