prizmkit 1.1.195 → 1.1.197

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 (107) hide show
  1. package/bin/create-prizmkit.js +0 -2
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/adapters/antigravity/assets/prizmkit-hook.cjs +1 -1
  4. package/bundled/adapters/antigravity/rules-adapter.js +1 -13
  5. package/bundled/adapters/claude/paths.js +0 -1
  6. package/bundled/adapters/codex/paths.js +0 -1
  7. package/bundled/adapters/codex/settings-adapter.js +1 -1
  8. package/bundled/adapters/cursor/assets/prizmkit-hook.cjs +1 -1
  9. package/bundled/adapters/cursor/rules-adapter.js +1 -13
  10. package/bundled/adapters/pi/paths.js +0 -1
  11. package/bundled/dev-pipeline/.env.example +2 -2
  12. package/bundled/dev-pipeline/README.md +9 -6
  13. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +2 -2
  14. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +15 -25
  15. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +31 -0
  16. package/bundled/dev-pipeline/prizmkit_runtime/iterate.py +1 -69
  17. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +1 -114
  18. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +2 -2
  19. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +78 -0
  20. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +4 -234
  21. package/bundled/dev-pipeline/prizmkit_runtime/status.py +0 -5
  22. package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +9 -1
  23. package/bundled/dev-pipeline/scripts/feature_list_contract.py +0 -43
  24. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -76
  25. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +9 -112
  26. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +0 -13
  27. package/bundled/dev-pipeline/scripts/init-pipeline.py +0 -1
  28. package/bundled/dev-pipeline/scripts/prompt_framework.py +0 -79
  29. package/bundled/dev-pipeline/scripts/status_common.py +150 -4
  30. package/bundled/dev-pipeline/scripts/update-bug-status.py +20 -2
  31. package/bundled/dev-pipeline/scripts/update-feature-status.py +20 -2
  32. package/bundled/dev-pipeline/scripts/utils.py +6 -0
  33. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -5
  34. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -101
  35. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +0 -35
  36. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -52
  37. package/bundled/dev-pipeline/templates/feature-list-schema.json +0 -25
  38. package/bundled/dev-pipeline/templates/iterate/evaluate-prompt.md +5 -16
  39. package/bundled/dev-pipeline/templates/iterate/evaluation-schema.json +1 -58
  40. package/bundled/dev-pipeline/templates/iterate/headless-plan-prompt.md +1 -12
  41. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +0 -1
  42. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +0 -1
  43. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +2 -2
  44. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
  45. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +1 -1
  46. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +0 -2
  47. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  48. package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +0 -5
  49. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -2
  50. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +1 -1
  51. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +3 -3
  52. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  53. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -3
  54. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +1 -1
  55. package/bundled/dev-pipeline/templates/sections/retrospective.md +3 -3
  56. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +1 -1
  57. package/bundled/rules/USAGE.md +5 -19
  58. package/bundled/rules/general/coding-baseline.md +2 -2
  59. package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
  60. package/bundled/skills/_metadata.json +4 -4
  61. package/bundled/skills/app-planner/SKILL.md +1 -1
  62. package/bundled/skills/app-planner/references/generated-plan-review.md +1 -1
  63. package/bundled/skills/app-planner/references/rules-configuration.md +6 -7
  64. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +2 -20
  65. package/bundled/skills/bug-planner/SKILL.md +5 -6
  66. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +1 -1
  67. package/bundled/skills/bug-planner/references/input-formats.md +2 -2
  68. package/bundled/skills/bug-planner/references/schema-validation.md +0 -1
  69. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +2 -9
  70. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +36 -25
  71. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +38 -31
  72. package/bundled/skills/feature-pipeline-launcher/SKILL.md +33 -25
  73. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +38 -31
  74. package/bundled/skills/feature-planner/SKILL.md +4 -10
  75. package/bundled/skills/feature-planner/references/completeness-review.md +2 -2
  76. package/bundled/skills/feature-planner/references/new-project-planning.md +0 -1
  77. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -25
  78. package/bundled/skills/iterate-pipeline-launcher/SKILL.md +53 -42
  79. package/bundled/skills/iterate-pipeline-launcher/references/configuration.md +52 -47
  80. package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
  81. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +2 -2
  82. package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
  83. package/bundled/skills/prizmkit-init/SKILL.md +6 -7
  84. package/bundled/skills/prizmkit-init/references/config-schema.md +5 -9
  85. package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +1 -1
  86. package/bundled/skills/prizmkit-plan/SKILL.md +1 -1
  87. package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
  88. package/bundled/skills/prizmkit-retrospective/references/rule-evolution-steps.md +11 -17
  89. package/bundled/skills/prizmkit-workflow/SKILL.md +6 -3
  90. package/bundled/skills/prizmkit-workflow/references/cold-start-rules.md +8 -7
  91. package/bundled/templates/project-memory-template.md +2 -1
  92. package/package.json +1 -1
  93. package/src/clean.js +29 -7
  94. package/src/config.js +13 -15
  95. package/src/index.js +1 -5
  96. package/src/manifest.js +3 -6
  97. package/src/platforms.js +0 -14
  98. package/src/scaffold.js +93 -313
  99. package/src/upgrade.js +32 -31
  100. package/bundled/adapters/claude/rules-adapter.js +0 -25
  101. package/bundled/adapters/codebuddy/rules-adapter.js +0 -30
  102. package/bundled/adapters/codex/rules-adapter.js +0 -30
  103. package/bundled/adapters/pi/rules-adapter.js +0 -13
  104. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +0 -10
  105. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +0 -111
  106. package/bundled/skills/bug-planner/references/verification.md +0 -26
  107. package/bundled/skills/feature-planner/references/browser-interaction.md +0 -39
@@ -35,7 +35,6 @@ MAX_CONSECUTIVE_FAILURES = 2
35
35
  MAX_CONSECUTIVE_NO_PROGRESS = 2
36
36
 
37
37
  PRODUCT_SHAPES = frozenset({"web_saas", "cli_devtool", "mobile", "api_sdk", "internal_ops"})
38
- EVIDENCE_MODES = frozenset({"live_walkthrough", "source_only"})
39
38
  EVIDENCE_TIERS = frozenset({"fact", "inference", "taste"})
40
39
  PAIN_LENSES = frozenset(
41
40
  {
@@ -80,8 +79,6 @@ _EVAL_ROOT_KEYS = frozenset(
80
79
  {
81
80
  "schema_version",
82
81
  "product_shapes",
83
- "evidence_mode",
84
- "walkthrough_notes",
85
82
  "candidates_discovered",
86
83
  "approved_candidates",
87
84
  "requires_user_confirm",
@@ -90,7 +87,6 @@ _EVAL_ROOT_KEYS = frozenset(
90
87
  "summary",
91
88
  }
92
89
  )
93
- _WALKTHROUGH_KEYS = frozenset({"target_attempted", "server_cleanup_confirmed", "reason"})
94
90
  _DISCOVERED_KEYS = frozenset(
95
91
  {
96
92
  "id",
@@ -127,7 +123,6 @@ _APPROVED_KEYS = frozenset(
127
123
  "blast_radius_flags",
128
124
  "target_paths",
129
125
  "acceptance_hints",
130
- "ui_affected",
131
126
  }
132
127
  )
133
128
  _CONFIRM_KEYS = frozenset(
@@ -612,33 +607,6 @@ def validate_evaluation_payload(data: Any) -> tuple[bool, tuple[str, ...]]:
612
607
  f"{sorted(PRODUCT_SHAPES)}, got {product_shapes!r}"
613
608
  )
614
609
 
615
- evidence_mode = data.get("evidence_mode")
616
- if evidence_mode not in EVIDENCE_MODES:
617
- errors.append(
618
- f"evidence_mode must be one of {sorted(EVIDENCE_MODES)}, got {evidence_mode!r}"
619
- )
620
-
621
- walkthrough = data.get("walkthrough_notes")
622
- if not isinstance(walkthrough, dict):
623
- errors.append("walkthrough_notes must be an object")
624
- else:
625
- _check_exact_keys(walkthrough, _WALKTHROUGH_KEYS, "walkthrough_notes", errors)
626
- if not isinstance(walkthrough.get("target_attempted"), bool):
627
- errors.append("walkthrough_notes.target_attempted must be a boolean")
628
- if not isinstance(walkthrough.get("server_cleanup_confirmed"), bool):
629
- errors.append("walkthrough_notes.server_cleanup_confirmed must be a boolean")
630
- if not _is_non_empty_str(walkthrough.get("reason")):
631
- errors.append("walkthrough_notes.reason must be a non-empty string")
632
- if evidence_mode == "live_walkthrough":
633
- if walkthrough.get("target_attempted") is not True:
634
- errors.append(
635
- "evidence_mode='live_walkthrough' requires walkthrough_notes.target_attempted=true"
636
- )
637
- if walkthrough.get("server_cleanup_confirmed") is not True:
638
- errors.append(
639
- "evidence_mode='live_walkthrough' requires walkthrough_notes.server_cleanup_confirmed=true"
640
- )
641
-
642
610
  discovered = data.get("candidates_discovered")
643
611
  if not isinstance(discovered, list):
644
612
  errors.append("candidates_discovered must be an array")
@@ -719,8 +687,6 @@ def validate_evaluation_payload(data: Any) -> tuple[bool, tuple[str, ...]]:
719
687
  errors.append(f"{label}.target_paths must be an array of non-empty strings")
720
688
  if not _is_str_list(item.get("acceptance_hints"), min_items=1):
721
689
  errors.append(f"{label}.acceptance_hints must be a non-empty array of strings")
722
- if not isinstance(item.get("ui_affected"), bool):
723
- errors.append(f"{label}.ui_affected must be a boolean")
724
690
 
725
691
  confirm = data.get("requires_user_confirm")
726
692
  if not isinstance(confirm, list):
@@ -865,7 +831,6 @@ def _write_state(
865
831
  consecutive_no_progress: int,
866
832
  started_at: str,
867
833
  last_verdict: str | None,
868
- last_evidence_mode: str | None,
869
834
  summary: str,
870
835
  ) -> None:
871
836
  payload = {
@@ -884,7 +849,6 @@ def _write_state(
884
849
  "started_at": started_at,
885
850
  "updated_at": _utc_iso(),
886
851
  "last_verdict": last_verdict,
887
- "last_evidence_mode": last_evidence_mode,
888
852
  "summary": summary,
889
853
  }
890
854
  write_json_atomic(iterate_paths.state_file, payload)
@@ -953,11 +917,10 @@ def _write_final_summary(
953
917
  continue
954
918
  rnum = entry.get("round")
955
919
  verdict = entry.get("verdict")
956
- mode = entry.get("evidence_mode")
957
920
  appended = ", ".join(entry.get("appended_ids") or []) or "none"
958
921
  completed = ", ".join(entry.get("completed_ids") or []) or "none"
959
922
  lines.append(
960
- f"- Round {rnum}: verdict=`{verdict}` evidence_mode=`{mode}` "
923
+ f"- Round {rnum}: verdict=`{verdict}` "
961
924
  f"appended=[{appended}] completed=[{completed}]"
962
925
  )
963
926
  lines.append("")
@@ -1022,7 +985,6 @@ def render_evaluate_prompt(
1022
985
  """Render Phase A evaluate-prompt.md without disclosing any round quota or cap."""
1023
986
  template_path = paths.pipeline_root / "templates" / "iterate" / "evaluate-prompt.md"
1024
987
  schema_path = paths.pipeline_root / "templates" / "iterate" / "evaluation-schema.json"
1025
- helper_script = paths.pipeline_root / "scripts" / "prizmkit-runtime-helper.py"
1026
988
  template = template_path.read_text(encoding="utf-8")
1027
989
 
1028
990
  focus_section = (
@@ -1034,7 +996,6 @@ def render_evaluate_prompt(
1034
996
  "{{PROJECT_ROOT}}": str(paths.project_root),
1035
997
  "{{OUTPUT_PATH}}": str(output_path),
1036
998
  "{{SCHEMA_PATH}}": str(schema_path),
1037
- "{{RUNTIME_HELPER_CMD}}": f"{sys.executable} {helper_script}",
1038
999
  "{{ROUND_DIR}}": str(round_dir),
1039
1000
  "{{FOCUS_SECTION}}": focus_section,
1040
1001
  "{{LEDGER_SUMMARY}}": _format_ledger_summary(ledger),
@@ -1391,7 +1352,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1391
1352
  consecutive_no_progress = 0
1392
1353
  current_round = 0
1393
1354
  last_verdict: str | None = None
1394
- last_evidence_mode: str | None = None
1395
1355
 
1396
1356
  _write_state(
1397
1357
  iterate_paths,
@@ -1407,7 +1367,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1407
1367
  consecutive_no_progress=0,
1408
1368
  started_at=started_at,
1409
1369
  last_verdict=None,
1410
- last_evidence_mode=None,
1411
1370
  summary="Iterate session started.",
1412
1371
  )
1413
1372
  _append_event(
@@ -1441,7 +1400,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1441
1400
  consecutive_no_progress=0,
1442
1401
  started_at=started_at,
1443
1402
  last_verdict=None,
1444
- last_evidence_mode=None,
1445
1403
  summary=f"Draining existing backlog ({len(backlog_ids)} incomplete features).",
1446
1404
  )
1447
1405
  _append_event(
@@ -1509,7 +1467,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1509
1467
  consecutive_no_progress=0,
1510
1468
  started_at=started_at,
1511
1469
  last_verdict=None,
1512
- last_evidence_mode=None,
1513
1470
  summary=summary,
1514
1471
  )
1515
1472
  _write_final_summary(
@@ -1553,7 +1510,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1553
1510
  consecutive_no_progress=consecutive_no_progress,
1554
1511
  started_at=started_at,
1555
1512
  last_verdict=last_verdict,
1556
- last_evidence_mode=last_evidence_mode,
1557
1513
  summary=f"Round {round_num}: running Phase A read-only evaluation.",
1558
1514
  )
1559
1515
  _append_event(iterate_paths, "round_started", round_num=round_num, phase="evaluating")
@@ -1594,7 +1550,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1594
1550
  "started_at": round_started_at,
1595
1551
  "ended_at": _utc_iso(),
1596
1552
  "verdict": reason,
1597
- "evidence_mode": None,
1598
1553
  "product_shapes": [],
1599
1554
  "appended_ids": [],
1600
1555
  "completed_ids": [],
@@ -1624,7 +1579,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1624
1579
  consecutive_no_progress=consecutive_no_progress,
1625
1580
  started_at=started_at,
1626
1581
  last_verdict=reason,
1627
- last_evidence_mode=last_evidence_mode,
1628
1582
  summary=summary,
1629
1583
  )
1630
1584
  _write_final_summary(
@@ -1669,7 +1623,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1669
1623
  "started_at": round_started_at,
1670
1624
  "ended_at": _utc_iso(),
1671
1625
  "verdict": reason,
1672
- "evidence_mode": None,
1673
1626
  "product_shapes": [],
1674
1627
  "appended_ids": [],
1675
1628
  "completed_ids": [],
@@ -1699,7 +1652,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1699
1652
  consecutive_no_progress=consecutive_no_progress,
1700
1653
  started_at=started_at,
1701
1654
  last_verdict=reason,
1702
- last_evidence_mode=last_evidence_mode,
1703
1655
  summary=summary,
1704
1656
  )
1705
1657
  _write_final_summary(
@@ -1719,14 +1671,12 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1719
1671
  return CommandResult(1, "Python iterate runner", f"{reason}: {summary}")
1720
1672
 
1721
1673
  verdict = str(eval_data["verdict"])
1722
- evidence_mode = str(eval_data["evidence_mode"])
1723
1674
  product_shapes = list(eval_data["product_shapes"])
1724
1675
  approved_candidates = list(eval_data["approved_candidates"])
1725
1676
  requires_user_confirm = list(eval_data["requires_user_confirm"])
1726
1677
  rejected_candidates = list(eval_data["rejected_candidates"])
1727
1678
  eval_summary = str(eval_data["summary"])
1728
1679
  last_verdict = verdict
1729
- last_evidence_mode = evidence_mode
1730
1680
 
1731
1681
  _append_event(
1732
1682
  iterate_paths,
@@ -1735,7 +1685,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1735
1685
  phase="evaluating",
1736
1686
  details={
1737
1687
  "verdict": verdict,
1738
- "evidence_mode": evidence_mode,
1739
1688
  "approved_count": len(approved_candidates),
1740
1689
  "confirm_count": len(requires_user_confirm),
1741
1690
  "rejected_count": len(rejected_candidates),
@@ -1750,7 +1699,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1750
1699
  "started_at": round_started_at,
1751
1700
  "ended_at": _utc_iso(),
1752
1701
  "verdict": verdict,
1753
- "evidence_mode": evidence_mode,
1754
1702
  "product_shapes": product_shapes,
1755
1703
  "appended_ids": [],
1756
1704
  "completed_ids": [],
@@ -1779,7 +1727,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1779
1727
  consecutive_no_progress=consecutive_no_progress,
1780
1728
  started_at=started_at,
1781
1729
  last_verdict=verdict,
1782
- last_evidence_mode=evidence_mode,
1783
1730
  summary=eval_summary,
1784
1731
  )
1785
1732
  _write_final_summary(
@@ -1809,7 +1756,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1809
1756
  f"{verdict}: {eval_summary}",
1810
1757
  details=(
1811
1758
  f"round: {round_num}",
1812
- f"evidence_mode: {evidence_mode}",
1813
1759
  f"summary_file: {iterate_paths.summary_file}",
1814
1760
  ),
1815
1761
  )
@@ -1828,7 +1774,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1828
1774
  "started_at": round_started_at,
1829
1775
  "ended_at": _utc_iso(),
1830
1776
  "verdict": verdict,
1831
- "evidence_mode": evidence_mode,
1832
1777
  "product_shapes": product_shapes,
1833
1778
  "appended_ids": [],
1834
1779
  "completed_ids": [],
@@ -1857,7 +1802,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1857
1802
  consecutive_no_progress=consecutive_no_progress,
1858
1803
  started_at=started_at,
1859
1804
  last_verdict=verdict,
1860
- last_evidence_mode=evidence_mode,
1861
1805
  summary=eval_summary,
1862
1806
  )
1863
1807
  _write_final_summary(
@@ -1923,7 +1867,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1923
1867
  consecutive_no_progress=consecutive_no_progress,
1924
1868
  started_at=started_at,
1925
1869
  last_verdict=verdict,
1926
- last_evidence_mode=evidence_mode,
1927
1870
  summary=f"Round {round_num}: running Phase B headless feature planning.",
1928
1871
  )
1929
1872
  _append_event(
@@ -1955,7 +1898,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
1955
1898
  consecutive_failures=consecutive_failures,
1956
1899
  consecutive_no_progress=consecutive_no_progress,
1957
1900
  verdict=verdict,
1958
- evidence_mode=evidence_mode,
1959
1901
  product_shapes=product_shapes,
1960
1902
  requires_user_confirm=requires_user_confirm,
1961
1903
  rejected_candidates=rejected_candidates,
@@ -2072,7 +2014,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2072
2014
  consecutive_failures=consecutive_failures,
2073
2015
  consecutive_no_progress=consecutive_no_progress,
2074
2016
  verdict=verdict,
2075
- evidence_mode=evidence_mode,
2076
2017
  product_shapes=product_shapes,
2077
2018
  requires_user_confirm=requires_user_confirm,
2078
2019
  rejected_candidates=rejected_candidates,
@@ -2112,7 +2053,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2112
2053
  consecutive_failures=consecutive_failures,
2113
2054
  consecutive_no_progress=consecutive_no_progress,
2114
2055
  verdict=verdict,
2115
- evidence_mode=evidence_mode,
2116
2056
  product_shapes=product_shapes,
2117
2057
  requires_user_confirm=requires_user_confirm,
2118
2058
  rejected_candidates=rejected_candidates,
@@ -2150,7 +2090,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2150
2090
  consecutive_no_progress=consecutive_no_progress,
2151
2091
  started_at=started_at,
2152
2092
  last_verdict=verdict,
2153
- last_evidence_mode=evidence_mode,
2154
2093
  summary=f"Round {round_num}: delivering features {feature_range}.",
2155
2094
  )
2156
2095
  _append_event(
@@ -2224,7 +2163,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2224
2163
  "started_at": round_started_at,
2225
2164
  "ended_at": _utc_iso(),
2226
2165
  "verdict": verdict,
2227
- "evidence_mode": evidence_mode,
2228
2166
  "product_shapes": product_shapes,
2229
2167
  "appended_ids": appended_ids,
2230
2168
  "completed_ids": completed_ids,
@@ -2275,7 +2213,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2275
2213
  consecutive_no_progress=consecutive_no_progress,
2276
2214
  started_at=started_at,
2277
2215
  last_verdict=verdict,
2278
- last_evidence_mode=evidence_mode,
2279
2216
  summary=final_summary,
2280
2217
  )
2281
2218
  _write_final_summary(
@@ -2325,7 +2262,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2325
2262
  consecutive_no_progress=consecutive_no_progress,
2326
2263
  started_at=started_at,
2327
2264
  last_verdict=last_verdict,
2328
- last_evidence_mode=last_evidence_mode,
2329
2265
  summary=summary,
2330
2266
  )
2331
2267
  _append_event(
@@ -2355,7 +2291,6 @@ def run_iterate_loop(paths: RuntimePaths, options: IterateOptions) -> CommandRes
2355
2291
  consecutive_no_progress=consecutive_no_progress,
2356
2292
  started_at=started_at,
2357
2293
  last_verdict=last_verdict,
2358
- last_evidence_mode=last_evidence_mode,
2359
2294
  summary=summary,
2360
2295
  )
2361
2296
  _write_final_summary(
@@ -2418,7 +2353,6 @@ def _record_plan_failure(
2418
2353
  consecutive_failures: int,
2419
2354
  consecutive_no_progress: int,
2420
2355
  verdict: str,
2421
- evidence_mode: str,
2422
2356
  product_shapes: list[str],
2423
2357
  requires_user_confirm: list[dict[str, Any]],
2424
2358
  rejected_candidates: list[dict[str, Any]],
@@ -2432,7 +2366,6 @@ def _record_plan_failure(
2432
2366
  "started_at": round_started_at,
2433
2367
  "ended_at": _utc_iso(),
2434
2368
  "verdict": verdict,
2435
- "evidence_mode": evidence_mode,
2436
2369
  "product_shapes": product_shapes,
2437
2370
  "appended_ids": [],
2438
2371
  "completed_ids": [],
@@ -2461,7 +2394,6 @@ def _record_plan_failure(
2461
2394
  consecutive_no_progress=consecutive_no_progress,
2462
2395
  started_at=started_at,
2463
2396
  last_verdict=verdict,
2464
- last_evidence_mode=evidence_mode,
2465
2397
  summary=summary,
2466
2398
  )
2467
2399
  _write_final_summary(
@@ -1,4 +1,4 @@
1
- """Shared AI platform and skill path detection for prompt/runtime helpers."""
1
+ """Shared AI platform detection for prompt/runtime helpers."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -52,26 +52,6 @@ class PlatformResolution:
52
52
  notes: tuple[str, ...] = ()
53
53
 
54
54
 
55
- @dataclass(frozen=True)
56
- class SkillCandidate:
57
- """One possible filesystem location for a skill."""
58
-
59
- platform: str
60
- scope: str
61
- path: Path
62
-
63
-
64
- @dataclass(frozen=True)
65
- class SkillResolution:
66
- """Resolved skill lookup result."""
67
-
68
- marker: str
69
- platform: str
70
- skill: str
71
- path: Path | None
72
- candidates: tuple[SkillCandidate, ...]
73
-
74
-
75
55
  _PLATFORM_MARKERS = {
76
56
  "claude": (".claude/commands", ".claude/skills"),
77
57
  "codex": (".agents/skills",),
@@ -82,40 +62,6 @@ _PLATFORM_MARKERS = {
82
62
  }
83
63
 
84
64
 
85
- _PLATFORM_SKILL_PATTERNS = {
86
- "claude": (
87
- ("project-command-file", ".claude/commands/{skill}.md"),
88
- ("project-command-dir", ".claude/commands/{skill}"),
89
- ("project-skill", ".claude/skills/{skill}"),
90
- ("home-skill", "~/.claude/skills/{skill}"),
91
- ),
92
- "codex": (
93
- ("project-skill", ".agents/skills/{skill}"),
94
- ("project-codex-skill", ".codex/skills/{skill}"),
95
- ),
96
- "codebuddy": (
97
- ("project-skill", ".codebuddy/skills/{skill}"),
98
- ("home-skill", "~/.codebuddy/skills/{skill}"),
99
- ("legacy-home-skill", "~/.cbc/skills/{skill}"),
100
- ),
101
- "pi": (
102
- ("project-skill", ".pi/skills/{skill}"),
103
- ("project-agent-skill", ".agents/skills/{skill}"),
104
- ("home-skill", "~/.pi/agent/skills/{skill}"),
105
- ),
106
- "cursor": (
107
- ("project-skill", ".cursor/skills/{skill}"),
108
- ("project-agent-skill", ".agents/skills/{skill}"),
109
- ("home-skill", "~/.cursor/skills/{skill}"),
110
- ),
111
- "antigravity": (
112
- ("project-plugin-skill", ".agents/plugins/prizmkit/skills/{skill}"),
113
- ("project-agent-skill", ".agents/skills/{skill}"),
114
- ("home-skill", "~/.gemini/config/skills/{skill}"),
115
- ),
116
- }
117
-
118
-
119
65
  def read_json_object(path: str | Path) -> dict:
120
66
  """Read a JSON object, returning an empty dict when unavailable."""
121
67
  try:
@@ -268,62 +214,3 @@ def resolve_platform(project_root: str | Path, env: Mapping[str, str] | None = N
268
214
  "or install Claude/Codex/CodeBuddy/Pi/Cursor/Antigravity platform files.",
269
215
  ),
270
216
  )
271
-
272
-
273
- def _expand_skill_pattern(project_root: Path, skill: str, platform: str, scope: str, pattern: str) -> SkillCandidate:
274
- rendered = pattern.format(skill=skill)
275
- if rendered.startswith("~"):
276
- path = Path(rendered).expanduser()
277
- else:
278
- path = project_root / rendered
279
- return SkillCandidate(platform=platform, scope=scope, path=path.resolve())
280
-
281
-
282
- def skill_candidates(project_root: str | Path, skill: str, platform: str) -> tuple[SkillCandidate, ...]:
283
- """Return deterministic candidate locations for a skill on one platform."""
284
- normalized = valid_prompt_platform(platform)
285
- if not normalized:
286
- return ()
287
- root = Path(project_root).expanduser().resolve()
288
- return tuple(
289
- _expand_skill_pattern(root, skill, normalized, scope, pattern)
290
- for scope, pattern in _PLATFORM_SKILL_PATTERNS[normalized]
291
- )
292
-
293
-
294
- def _candidate_matches(candidate: SkillCandidate, skill: str, *, prefix: bool) -> bool:
295
- path = candidate.path
296
- if path.exists():
297
- return True
298
- if not prefix:
299
- return False
300
- parent = path.parent
301
- if not parent.is_dir():
302
- return False
303
- return any(child.name.startswith(skill) for child in parent.iterdir())
304
-
305
-
306
- def resolve_skill(
307
- project_root: str | Path,
308
- skill: str,
309
- *,
310
- platform: str = "auto",
311
- env: Mapping[str, str] | None = None,
312
- prefix: bool = False,
313
- ) -> SkillResolution:
314
- """Resolve a skill path for the selected platform."""
315
- normalized_skill = str(skill or "").strip()
316
- selected_platform = valid_prompt_platform(platform)
317
- if platform == "auto" or not platform:
318
- selected_platform = resolve_platform(project_root, env=env).platform
319
- if not selected_platform:
320
- return SkillResolution("NOT_INSTALLED", "", normalized_skill, None, ())
321
-
322
- candidates = skill_candidates(project_root, normalized_skill, selected_platform)
323
- for candidate in candidates:
324
- if _candidate_matches(candidate, normalized_skill, prefix=prefix):
325
- if candidate.path.exists():
326
- return SkillResolution("SKILL_EXISTS", selected_platform, normalized_skill, candidate.path, candidates)
327
- matches = sorted(child for child in candidate.path.parent.iterdir() if child.name.startswith(normalized_skill))
328
- return SkillResolution("SKILL_EXISTS", selected_platform, normalized_skill, matches[0].resolve(), candidates)
329
- return SkillResolution("SKILL_MISSING", selected_platform, normalized_skill, None, candidates)
@@ -35,7 +35,7 @@ class RunnerFamily:
35
35
  class RunnerEnvironment:
36
36
  """Legacy runner environment controls modeled as one cohesive unit."""
37
37
 
38
- stop_on_failure: bool = False
38
+ stop_on_failure: bool = True
39
39
  auto_push: bool = False
40
40
  dev_branch: str = ""
41
41
  verbose: bool = False
@@ -49,7 +49,7 @@ class RunnerEnvironment:
49
49
  def from_env(cls, env: Mapping[str, str] | None = None) -> "RunnerEnvironment":
50
50
  values = dict(os.environ if env is None else env)
51
51
  return cls(
52
- stop_on_failure=_truthy(values.get("STOP_ON_FAILURE")),
52
+ stop_on_failure=not _falsey(values.get("STOP_ON_FAILURE")),
53
53
  auto_push=_truthy(values.get("AUTO_PUSH")),
54
54
  dev_branch=values.get("DEV_BRANCH", ""),
55
55
  verbose=_truthy(values.get("VERBOSE")),
@@ -1549,6 +1549,12 @@ def _complete_success_merge(
1549
1549
  raise RuntimeError(f"Task {item_id} checkout identity disappeared before completion")
1550
1550
  complete_task_checkout_locked(family.state_dir, checkout)
1551
1551
  _emit_success(f"Merged {branch_name} into {base_branch}")
1552
+ artifact_dir = _artifact_path_for_item(paths.project_root, status_family, item_id, {})
1553
+ if not (artifact_dir / "retrospective-result.json").is_file() and execution_root != paths.project_root:
1554
+ fallback_dir = _artifact_path_for_item(execution_root, status_family, item_id, {})
1555
+ if (fallback_dir / "retrospective-result.json").is_file():
1556
+ artifact_dir = fallback_dir
1557
+ _emit_pending_rule_proposals_for_item(family, item_id, artifact_dir, paths.project_root)
1552
1558
  return new_status
1553
1559
  abort_in_progress_git_operation(paths.project_root)
1554
1560
  _emit_warning(
@@ -1771,6 +1777,78 @@ def _artifact_path_for_item(project_root: Path, family: RunnerFamily, item_id: s
1771
1777
  return project_root / ".prizmkit" / family.artifact_root_name / item_id
1772
1778
 
1773
1779
 
1780
+ def _emit_pending_rule_proposals_for_item(
1781
+ family: RunnerFamily,
1782
+ item_id: str,
1783
+ artifact_dir: Path | None,
1784
+ project_root: Path,
1785
+ ) -> list[dict[str, str]]:
1786
+ """Log RULES_PROPOSED entries from retrospective-result.json on completion."""
1787
+ candidate_dirs: list[Path] = []
1788
+ if artifact_dir is not None:
1789
+ candidate_dirs.append(artifact_dir)
1790
+ resolved_dir = _artifact_path_for_item(project_root, family, item_id, {})
1791
+ if resolved_dir not in candidate_dirs:
1792
+ candidate_dirs.append(resolved_dir)
1793
+ if family.kind == "feature":
1794
+ exact_dir = project_root / ".prizmkit" / "specs" / item_id
1795
+ if exact_dir not in candidate_dirs:
1796
+ candidate_dirs.append(exact_dir)
1797
+
1798
+ result_file = next(
1799
+ (candidate / "retrospective-result.json" for candidate in candidate_dirs if (candidate / "retrospective-result.json").is_file()),
1800
+ None,
1801
+ )
1802
+ if result_file is None:
1803
+ return []
1804
+ try:
1805
+ payload = json.loads(result_file.read_text(encoding="utf-8"))
1806
+ except (OSError, ValueError, TypeError):
1807
+ return []
1808
+ if not isinstance(payload, dict):
1809
+ return []
1810
+ rule_evolution = payload.get("rule_evolution")
1811
+ if not isinstance(rule_evolution, dict) or rule_evolution.get("status") != "RULES_PROPOSED":
1812
+ return []
1813
+ proposals = rule_evolution.get("proposals")
1814
+ if not isinstance(proposals, list):
1815
+ return []
1816
+
1817
+ normalized: list[dict[str, str]] = []
1818
+ for entry in proposals:
1819
+ if not isinstance(entry, dict):
1820
+ continue
1821
+ target_path = entry.get("target_path")
1822
+ clause = entry.get("clause")
1823
+ reason = entry.get("reason")
1824
+ if (
1825
+ isinstance(target_path, str)
1826
+ and target_path.strip()
1827
+ and isinstance(clause, str)
1828
+ and clause.strip()
1829
+ and isinstance(reason, str)
1830
+ and reason.strip()
1831
+ ):
1832
+ normalized.append(
1833
+ {
1834
+ "target_path": target_path.strip(),
1835
+ "clause": clause.strip(),
1836
+ "reason": reason.strip(),
1837
+ }
1838
+ )
1839
+ if not normalized:
1840
+ return []
1841
+
1842
+ try:
1843
+ display_path = result_file.relative_to(project_root).as_posix()
1844
+ except ValueError:
1845
+ display_path = str(result_file)
1846
+ _emit_info(f"Pending rule proposals for {item_id} (manual confirmation required; see {display_path}):")
1847
+ for proposal in normalized:
1848
+ _emit_info(f" - [{proposal['target_path']}] {proposal['clause']} ({proposal['reason']})")
1849
+ return normalized
1850
+
1851
+
1774
1852
  def _feature_slug(feature_id: str, title: str) -> str:
1775
1853
  import re
1776
1854