prizmkit 1.1.130 → 1.1.134

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 (119) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/command-adapter.js +0 -2
  3. package/bundled/dev-pipeline/.env.example +1 -1
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
  5. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
  6. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
  7. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
  8. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
  9. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
  12. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +119 -18
  13. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
  14. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +411 -17
  15. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +57 -14
  16. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
  17. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +55 -2
  18. package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
  19. package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
  20. package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
  21. package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
  22. package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
  23. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +5 -5
  24. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +28 -22
  25. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +24 -10
  26. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +20 -2
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
  28. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -19
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
  32. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
  33. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
  34. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  35. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +15 -0
  36. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
  37. package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
  38. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
  39. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
  40. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +15 -11
  41. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
  42. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -6
  43. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
  44. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
  45. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
  46. package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
  47. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
  48. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +349 -48
  49. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +129 -0
  50. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
  51. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +567 -23
  52. package/bundled/dev-pipeline/tests/test_unified_cli.py +37 -10
  53. package/bundled/skills/_metadata.json +63 -26
  54. package/bundled/skills/app-planner/SKILL.md +4 -3
  55. package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
  56. package/bundled/skills/bug-planner/SKILL.md +12 -27
  57. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
  58. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
  59. package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
  60. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
  61. package/bundled/skills/feature-planner/SKILL.md +27 -22
  62. package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
  63. package/bundled/skills/feature-workflow/SKILL.md +94 -121
  64. package/bundled/skills/prizmkit/SKILL.md +130 -94
  65. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
  66. package/bundled/skills/prizmkit-code-review/SKILL.md +132 -86
  67. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
  68. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +42 -1
  69. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
  70. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
  71. package/bundled/skills/prizmkit-committer/SKILL.md +125 -48
  72. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
  73. package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
  74. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
  75. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
  76. package/bundled/skills/prizmkit-init/SKILL.md +5 -5
  77. package/bundled/skills/prizmkit-plan/SKILL.md +146 -105
  78. package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
  79. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
  80. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
  81. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
  82. package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
  83. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
  84. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
  85. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
  86. package/bundled/skills/prizmkit-test/SKILL.md +52 -6
  87. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
  88. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
  89. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
  90. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
  91. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
  92. package/bundled/skills/prizmkit-test/references/examples.md +1 -1
  93. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
  94. package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
  95. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
  96. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
  97. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
  98. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
  99. package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
  100. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
  101. package/bundled/skills/recovery-workflow/SKILL.md +62 -241
  102. package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
  103. package/bundled/skills/recovery-workflow/references/detection.md +28 -52
  104. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
  105. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
  106. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
  107. package/bundled/skills/refactor-planner/SKILL.md +12 -57
  108. package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
  109. package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
  110. package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
  111. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
  112. package/bundled/skills/refactor-workflow/SKILL.md +98 -139
  113. package/bundled/templates/project-memory-template.md +4 -4
  114. package/package.json +1 -1
  115. package/src/index.js +4 -0
  116. package/src/prompts.js +10 -3
  117. package/src/scaffold.js +1 -1
  118. package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
  119. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
@@ -1,67 +1,43 @@
1
- # Recovery Phase Detection
1
+ # Interrupted Task Branch Detection
2
2
 
3
- Detection uses priority-ordered signals, but no single signal is authoritative. Prefer a conservative recovery phase when signals disagree.
3
+ Recovery uses the runtime's durable task checkout identity rather than reconstructing lifecycle phases from branches, diffs, plans, or historical artifacts.
4
4
 
5
- ## Signature Priority
5
+ ## Authoritative Records
6
6
 
7
- 1. Current branch starts with `fix/` -> likely `bug-fix-workflow`.
8
- 2. `.prizmkit/state/bugfix/` or `.prizmkit/plans/bug-fix-list.json` has relevant failed/in-progress state -> likely bugfix pipeline.
9
- 3. `.prizmkit/bugfix/` has optional bugfix artifacts -> possible `bug-fix-workflow`.
10
- 4. Current branch starts with `refactor/` -> likely `refactor-workflow`.
11
- 5. `.prizmkit/plans/refactor-list.json` or `.prizmkit/state/refactor/` exists -> likely refactor pipeline.
12
- 6. Current branch starts with `feat/` -> likely `feature-workflow`.
13
- 7. `.prizmkit/plans/feature-list.json` or `.prizmkit/state/features/` exists -> likely feature pipeline.
14
- 8. `spec.md` or `plan.md` exists without family-specific signals -> current-workspace Fast Path; ask which workflow it belongs to.
15
- 9. None of the above -> no workflow detected.
16
-
17
- Bug-fix signals are prioritized because interactive bug recovery benefits most from preserving local diagnosis and fix work.
7
+ ```text
8
+ .prizmkit/state/features/<F-NNN>/checkout.json
9
+ .prizmkit/state/bugfix/<B-NNN>/checkout.json
10
+ .prizmkit/state/refactor/<R-NNN>/checkout.json
11
+ ```
18
12
 
19
- ## Optional vs Required Artifacts
13
+ A record is resumable only when:
20
14
 
21
- `fix-plan.md` and `fix-report.md` are optional bug recovery signals. They are useful when present, but bug-fix recovery must also infer from branch, diff, `spec.md`, `plan.md`, review artifacts, commits, and bug-list entries.
15
+ 1. `state` equals `active`.
16
+ 2. `task_id` matches the directory family.
17
+ 3. `active_dev_branch` is non-empty.
18
+ 4. `refs/heads/<active_dev_branch>` exists locally.
22
19
 
23
- ## If No Workflow Is Detected
20
+ Ignore records whose state is `completed` or `reset`. Also ignore session logs, plan lists, artifact directories, and checkpoint files when no active checkout record exists. Those files may remain after completed or historical work and are not evidence of an interrupted task.
24
21
 
25
- Show guidance and exit:
22
+ ## Runtime Continuation Contract
26
23
 
27
- ```markdown
28
- No interrupted workflow was detected in this workspace.
24
+ The item-specific foreground command reloads the active checkout record and reuses its branch or linked worktree:
29
25
 
30
- Start a new workflow:
31
- - /feature-workflow build features from idea to code
32
- - /bug-fix-workflow fix a specific bug interactively
33
- - /refactor-workflow restructure code while preserving behavior
26
+ ```bash
27
+ python3 ./.prizmkit/dev-pipeline/cli.py feature run <F-NNN>
28
+ python3 ./.prizmkit/dev-pipeline/cli.py bugfix run <B-NNN>
29
+ python3 ./.prizmkit/dev-pipeline/cli.py refactor run <R-NNN>
34
30
  ```
35
31
 
36
- ## Phase Inference Tables
37
-
38
- ### Bug-Fix Recovery
39
-
40
- | Detected state | Resume from | Actions |
41
- |---|---|---|
42
- | `fix/*` branch, no implementation artifacts | Diagnosis / triage | Restore bug context, confirm understanding, choose next action |
43
- | `spec.md` or `plan.md`, no code changes | Fix | Read plan and implement the root-cause fix |
44
- | Optional `fix-plan.md`, no code changes | Fix | Read fix plan and implement the fix |
45
- | Code/test changes, no review artifact | Review | Run tests if safe, then invoke `/prizmkit-code-review` |
46
- | Review artifact or optional `fix-report.md` | User verification | Ask user whether to verify manually before commit |
47
- | Commit ahead on fix branch | Merge decision | Ask merge / keep branch / decide later |
48
-
49
- Bug-fix diagnosis, triage, and reproduction do not always create durable artifacts. If interrupted before code changes or a plan artifact, restart from diagnosis rather than guessing.
32
+ The command does not need an explicit branch argument. Do not prepend `git checkout`, because the runtime owns checkout identity and branch/worktree reuse.
50
33
 
51
- ### Feature Recovery
34
+ ## Selection Rules
52
35
 
53
- | Detected state | Resume from | Actions |
54
- |---|---|---|
55
- | No feature list and no Fast Path artifacts | Route selection | Clarify whether to plan, implement Fast Path, or start app planning |
56
- | `spec.md` or `plan.md` with feature context | Fast Path continuation | Continue implementation, review, retrospective, or commit based on diff |
57
- | `.prizmkit/plans/feature-list.json`, no pipeline state | Launch | Invoke `feature-pipeline-launcher` |
58
- | Feature list plus `.prizmkit/state/features/` | Monitor/recover | Check launcher status or run recovery script |
36
+ - One active record: return its command directly.
37
+ - Multiple active records: ask the user to select a task by family, task ID, and branch.
38
+ - No active record: report `NO_INTERRUPTED_TASK_FOUND`; do not infer a target from newest timestamps or branch names.
39
+ - Missing recorded branch: omit that record and report it as invalid only when the user explicitly asks for detector diagnostics.
59
40
 
60
- ### Refactor Recovery
41
+ ## Safety
61
42
 
62
- | Detected state | Resume from | Actions |
63
- |---|---|---|
64
- | No refactor list and no Fast Path artifacts | Route selection | Clarify behavior-preserving refactor goal |
65
- | `spec.md` or `plan.md` with refactor context | Fast Path continuation | Continue implementation, behavior checks, review, retrospective, or commit |
66
- | `.prizmkit/plans/refactor-list.json`, no pipeline state | Launch | Invoke `refactor-pipeline-launcher` |
67
- | Refactor list plus `.prizmkit/state/refactor/` | Monitor/recover | Check launcher status or run recovery script |
43
+ Recovery only reports a command. It does not execute the command, reset state, delete artifacts, remove worktrees, switch branches, commit, merge, or push.