prizmkit 1.1.153 → 1.1.155

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 (178) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codex/skill-adapter.js +1 -1
  3. package/bundled/adapters/pi/skill-adapter.js +2 -1
  4. package/bundled/dev-pipeline/.env.example +2 -6
  5. package/bundled/dev-pipeline/README.md +120 -113
  6. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +1 -1
  7. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +355 -15
  8. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +189 -110
  9. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +146 -111
  10. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +4 -20
  11. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  12. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +0 -1
  13. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +0 -3
  14. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +122 -15
  15. package/bundled/dev-pipeline/prizmkit_runtime/reset_preserve.py +1 -1
  16. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  17. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +1 -10
  18. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  19. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +139 -74
  20. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  21. package/bundled/dev-pipeline/prizmkit_runtime/status.py +106 -1
  22. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  23. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  24. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  25. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  26. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +2 -2
  27. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  28. package/bundled/dev-pipeline/scripts/update-bug-status.py +197 -71
  29. package/bundled/dev-pipeline/scripts/update-checkpoint.py +77 -16
  30. package/bundled/dev-pipeline/scripts/update-feature-status.py +46 -121
  31. package/bundled/dev-pipeline/scripts/update-refactor-status.py +46 -123
  32. package/bundled/dev-pipeline/scripts/utils.py +119 -0
  33. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  34. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  35. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +3 -2
  36. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  37. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  38. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  39. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  40. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  41. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  42. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  43. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  44. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  45. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  46. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  47. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  48. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  49. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  50. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  51. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  53. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  54. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  55. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  56. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  57. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  58. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  59. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  60. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  61. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  62. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  63. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  64. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  65. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  66. package/bundled/dev-pipeline/tests/test_auto_skip.py +111 -32
  67. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +617 -30
  68. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -194
  69. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  70. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  71. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +281 -206
  72. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +322 -0
  73. package/bundled/dev-pipeline/tests/test_reset_modes.py +935 -0
  74. package/bundled/dev-pipeline/tests/test_reset_preserve.py +5 -7
  75. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  76. package/bundled/dev-pipeline/tests/test_unified_cli.py +617 -188
  77. package/bundled/skills/_metadata.json +9 -9
  78. package/bundled/skills/app-planner/SKILL.md +3 -3
  79. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  80. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  81. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  82. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  83. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  84. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  85. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  86. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  87. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  88. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  89. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  90. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  91. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  92. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  93. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  94. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  95. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  96. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  97. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  98. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  99. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  100. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  101. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  102. package/bundled/skills/bug-planner/references/schema-validation.md +1 -1
  103. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +1 -1
  104. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -13
  105. package/bundled/skills/feature-pipeline-launcher/SKILL.md +22 -14
  106. package/bundled/skills/prizmkit/SKILL.md +17 -18
  107. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  108. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  109. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  110. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  111. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  112. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  113. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  114. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  115. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  116. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  117. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  118. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  119. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  120. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  121. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  122. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  123. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  124. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  125. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  126. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  127. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  128. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  129. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  130. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  131. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +11 -1
  132. package/bundled/skills/prizmkit-retrospective/SKILL.md +63 -77
  133. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
  134. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  135. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +17 -23
  136. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  137. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  138. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  139. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  140. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  141. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  142. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  143. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  144. package/bundled/skills/recovery-workflow/SKILL.md +9 -6
  145. package/bundled/skills/recovery-workflow/evals/evals.json +2 -2
  146. package/bundled/skills/recovery-workflow/references/detection.md +7 -6
  147. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +16 -6
  148. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +21 -13
  149. package/bundled/templates/project-memory-template.md +19 -11
  150. package/package.json +1 -1
  151. package/src/scaffold.js +33 -22
  152. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +0 -228
  153. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +0 -767
  154. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  155. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  156. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  157. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  158. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  159. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  160. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  161. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  162. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  163. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  164. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  165. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  166. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  167. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  168. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  169. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  170. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  171. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  172. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  173. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  174. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  175. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  176. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  177. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  178. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.153",
2
+ "version": "1.1.155",
3
3
  "skills": {
4
4
  "prizmkit": {
5
5
  "description": "Framework introduction and navigation for the formal single-requirement lifecycle, project initialization, Prizm docs, and independent deployment.",
@@ -23,35 +23,35 @@
23
23
  "hasScripts": false
24
24
  },
25
25
  "prizmkit-plan": {
26
- "description": "Formal requirement lifecycle entry: natural language → spec.md and plan.md with mandatory Main-Agent planning review, optional capability-gated independent correctness review, stable artifact identity, and workflow-state handoff.",
26
+ "description": "Create and review spec.md and plan.md for one supplied requirement; return PLAN_READY or PLAN_BLOCKED.",
27
27
  "tier": "1",
28
28
  "category": "prizmkit-skill",
29
29
  "hasAssets": true,
30
30
  "hasScripts": false
31
31
  },
32
32
  "prizmkit-implement": {
33
- "description": "Execute a reviewed formal requirement plan, preserve artifact identity, and route implementation repairs to the correct review or test gate.",
33
+ "description": "Execute one reviewed plan or explicit repair scope, perform focused verification, and return IMPLEMENTED or IMPLEMENT_BLOCKED.",
34
34
  "tier": "1",
35
35
  "category": "prizmkit-skill",
36
36
  "hasAssets": false,
37
37
  "hasScripts": false
38
38
  },
39
39
  "prizmkit-code-review": {
40
- "description": "Mandatory bounded Main-Agent code review plus optional capability-gated independent correctness review, with evidence-based adjudication, direct repairs, verification, and append-only progress reporting.",
40
+ "description": "Review one supplied change with bounded Main-Agent repair, optional capability-gated independent review, verification, and PASS or NEEDS_FIXES output.",
41
41
  "tier": "1",
42
42
  "category": "prizmkit-skill",
43
43
  "hasAssets": false,
44
44
  "hasScripts": true
45
45
  },
46
46
  "prizmkit-committer": {
47
- "description": "Final formal-requirement commit gate: verifies all prior stages, confirms interactive commits or performs authorized headless pipeline commits, and never pushes automatically.",
47
+ "description": "Create an explicitly confirmed interactive commit or prepare an exact Runtime commit request from caller-supplied evidence; never push automatically.",
48
48
  "tier": "1",
49
49
  "category": "prizmkit-skill",
50
50
  "hasAssets": false,
51
51
  "hasScripts": false
52
52
  },
53
53
  "prizmkit-retrospective": {
54
- "description": "Mandatory formal-requirement retrospective: updates durable Prizm docs or records NO_DOC_CHANGE with machine-verifiable result before commit.",
54
+ "description": "Synchronize durable Prizm docs for exact supplied change paths, or record NO_DOC_CHANGE; return RETRO_COMPLETE or RETRO_BLOCKED.",
55
55
  "tier": "1",
56
56
  "category": "prizmkit-skill",
57
57
  "hasAssets": true,
@@ -72,7 +72,7 @@
72
72
  "hasScripts": false
73
73
  },
74
74
  "prizmkit-test": {
75
- "description": "AI-led project-native testing for the affected business module and Regression Ring, with bounded failure repair, mandatory Main-Agent review, optional strict independent Test Reviewer, and TEST_PASS/TEST_NEEDS_FIXES/TEST_BLOCKED results.",
75
+ "description": "AI-led project-native affected-module and Regression Ring testing with contract authority, test-double fidelity, consumer/provider compatibility, browser and Full-stack E2E classification, persistence re-entry, bounded repair, review, and TEST_PASS/TEST_NEEDS_FIXES/TEST_BLOCKED results.",
76
76
  "tier": "1",
77
77
  "category": "prizmkit-skill",
78
78
  "hasAssets": false,
@@ -159,12 +159,12 @@
159
159
  "hasScripts": false
160
160
  },
161
161
  "recovery-workflow": {
162
- "description": "Detect whether interrupted work belongs to a direct requirement or autonomous pipeline, select the authoritative owner, and hand off without merging state machines.",
162
+ "description": "Detect valid active feature, bugfix, or refactor checkout records and return exact operation-first continuation commands without executing or mutating state.",
163
163
  "tier": "companion",
164
164
  "category": "orchestration-skill",
165
165
  "subcategory": "workflows",
166
166
  "hasAssets": false,
167
- "hasScripts": false
167
+ "hasScripts": true
168
168
  }
169
169
  },
170
170
  "suites": {
@@ -157,7 +157,7 @@ After Infrastructure configuration is complete (CP-AP-1.5), check whether the pr
157
157
 
158
158
  Rules are optional. If the user skips, AI uses general best practices freely — no reminders, no blocking.
159
159
 
160
- → Read `${SKILL_DIR}/references/rules-configuration.md` for the full procedure: layer detection, configuration mode selection, interactive Q&A per layer, template rendering, and root.prizm RULES pointer update. Before rendering final rule files or updating the pointer, run the Pre-Generation Headless Context Completeness Gate on every proposed new or changed rule.
160
+ → Read `${SKILL_DIR}/references/rules-configuration.md` for the full contract: layer detection, explicit Quick/Full/Skip authorization, interactive decisions, invariant-only fixed rules, selected-option derivation with semantic fallback, dual-native profiles, conflict detection, deterministic resource validation, template rendering, and the `root.prizm` `RULES:` pointer update. Run `${SKILL_DIR}/scripts/validate-rules-configuration.py` before questioning and again before final rendering. Before writing rule files or updating the pointer, require both a passing decision-conflict gate and the Pre-Generation Headless Context Completeness Gate for every proposed new or changed rule.
161
161
 
162
162
  ### After rules configuration
163
163
 
@@ -289,7 +289,7 @@ Checkpoints catch cascading errors early — skipping one means the next phase b
289
289
  | **CP-AP-0** | Intent Confirmed | User confirmed session goal (produce / explore) | 1 |
290
290
  | **CP-AP-1** | Conventions Checked | Current-host project instruction target resolved; its `### Project Conventions` section is loaded or asked and up to date | 1 |
291
291
  | **CP-AP-1.5** | Infrastructure Checked | Resolved project instruction target `### Infrastructure` section addressed — database, deployment **and cloud services** each configured or explicitly deferred | 1-2 |
292
- | **CP-AP-1.6** | Rules Configured | For each detected layer (from config.json or self-detection), rules file exists in `.prizmkit/rules/` or user explicitly skipped. `root.prizm` `RULES:` pointer up-to-date. | 2 |
292
+ | **CP-AP-1.6** | Rules Configured | Rules resources pass deterministic validation; Quick defaults are explicitly authorized; every detected layer has a conflict-free `.prizmkit/rules/<layer>-rules.md` or an explicit skip; dual-native choices use separate profiles; no residual placeholders remain; `root.prizm` `RULES:` pointer is up to date. | 2 |
293
293
  | **CP-AP-2** | Vision Summary | Goal/users/differentiators confirmed by user. For brownfield: existing purpose confirmed or refined. | 1-2 |
294
294
  | **CP-AP-3** | Frontend Design Evaluated | For frontend projects: checked for existing UI/UX design system; user was asked if missing. **Auto-pass** for backend-only or non-UI projects. | 2 |
295
295
  | **CP-AP-4** | Project Brief Accumulated | The in-memory brief or `.prizmkit/plans/project-brief.draft.md` contains at least 3 ideas. For brownfield: already-implemented items marked `[x]` count toward this total. The final brief is not written before CP-AP-5.5. | 3 |
@@ -304,7 +304,7 @@ Run this gate before any final handoff whenever the current `app-planner` sessio
304
304
  1. **Load the local reference**: read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the source of truth for app-planner generated content review.
305
305
  2. **Read actual planning artifacts directly**: inspect current-session final outputs such as `.prizmkit/plans/project-brief.md`, changed sections in the resolved project instruction target, `.prizmkit/rules/<layer>-rules.md`, and `.prizmkit/prizm-docs/root.prizm` `RULES:` pointer line. Do not rely on `git status`, `git diff`, or `git diff --cached`, because `.prizmkit` planning artifacts are often gitignored or untracked.
306
306
  3. **Scope to new/changed app-planning content**: compare against pre-session snapshots or in-memory drafts when available. Preserve unchanged historical brief items, instruction-file sections, rules files, and Prizm doc content. For explore-only sessions, draft-save exits, or flows with no new final planning content, report: `Local generated-plan review: not applicable — no new final planning content written.`
307
- 4. **Run the local checklist and fresh-session simulation** from the reference: project brief completeness, consistency of conventions/infrastructure/architecture decisions, rules pointer consistency, normalization of selected decisions, purpose-tagged references, app-planner writable-boundary compliance, and downstream `feature-planner` readiness to produce `.prizmkit/plans/feature-list.json` without guessing or seeing the original conversation.
307
+ 4. **Run the local checklist and fresh-session simulation** from the reference: project brief completeness; consistency of conventions, infrastructure, and architecture decisions; Rules Configuration resource-validation and conflict-gate evidence; selected-decision precedence; explicit not-applicable/deferred sections; dual-native profile separation; rules pointer consistency; normalization of selected decisions; purpose-tagged references; app-planner writable-boundary compliance; and downstream `feature-planner` readiness to produce `.prizmkit/plans/feature-list.json` without guessing or seeing the original conversation.
308
308
  5. **Apply accepted fixes through the source/writer path**: project brief fixes go through the draft/checklist source, instruction-file section fixes go through the resolved project instruction target's section source with user confirmation when changing approved wording, rules fixes re-render from rules configuration answers/templates when available, and `root.prizm` fixes are limited to the `RULES:` pointer line.
309
309
  6. **Recheck changed sections directly** after every accepted fix batch.
310
310
  7. **Report CP-AP-6** in the completion summary: include local generated-plan review verdict, reviewed app-planning artifacts/sections, accepted fixes (or "none"), and final writer/validation result.
@@ -33,7 +33,7 @@ Do not rely on `git status`, `git diff`, or `git diff --cached` to decide whethe
33
33
 
34
34
  - `project-brief.md` fixes go through the draft/checklist project brief source representation described in `project-brief-guide.md`, then rewrite the final brief through the existing project brief writer path.
35
35
  - Project conventions, infrastructure, frontend design direction, and architecture decisions are source sections in the exact project instruction target selected for the current session. If a fix changes user-approved wording or meaning, ask for user confirmation before rewriting.
36
- - `.prizmkit/rules/<layer>-rules.md` fixes should re-render from the rules configuration answers and template inputs when available. If no structured source remains, update the source rule section explicitly and report that source path.
36
+ - `.prizmkit/rules/<layer>-rules.md` fixes should re-render from the normalized decision ledger, invariant/derivation sources, and template inputs. Rerun `scripts/validate-rules-configuration.py` and the Rules Configuration conflict gate before rewriting. If no structured source remains, rebuild the decision ledger or ask for clarification; do not hand-patch a contradictory final rule file.
37
37
  - `root.prizm` fixes are limited to correcting or adding the `RULES:` pointer line; do not rewrite unrelated root content.
38
38
 
39
39
  ## Review Checklist
@@ -43,6 +43,7 @@ For every reviewed app-planning artifact or section, check:
43
43
  - Project brief completeness: goal, users, differentiators, constraints, tech stack assumptions, and at least three actionable ideas when producing a final brief
44
44
  - Consistency among conventions, infrastructure, architecture decisions, and project brief content
45
45
  - Infrastructure completeness or explicit deferral for database, deployment, and cloud services topics when those flows ran
46
+ - Rules Configuration integrity: the deterministic resource validator passed; Quick defaults were explicitly authorized; fixed content contains only invariants; selected decisions own their policy domains; no active rule conflicts with the decision ledger; unmatched/not-applicable choices are explicit; dual-native decisions remain in separate iOS/Android profiles; and rendered files contain no residual placeholders
46
47
  - Rules pointer consistency: generated `.prizmkit/rules/<layer>-rules.md` files are referenced by the `root.prizm` `RULES:` line when rules were configured
47
48
  - Substantive user meaning and detail preservation at matching detail after conversational normalization in project brief ideas, conventions, infrastructure notes, architecture decisions, and rules
48
49
  - Artifact-wide readability: every generated natural-language value across all AI-visible fields and sections—including briefs/drafts, instruction sections, generated rules, appendices, comments, brainstorm summaries, quoted evidence, and parentheticals—is a standalone domain statement without dialogue-role labels, question IDs, answer tokens, planning-option recommendation markers, raw answer-map content, or planning provenance
@@ -13,6 +13,11 @@
13
13
 
14
14
  ---
15
15
 
16
+ ## SEMANTIC_FALLBACK_POLICY
17
+
18
+ Every confirmed option is valid input even when no pre-authored block exists. For an unmatched framework, ORM, datastore, deployment, observability, or permission option, render the complete selected meaning, follow current official and detected project conventions, preserve brownfield behavior unless migration was selected, and import no rules from a recommended alternative. Render `none`, `not required`, deferred, and conditionally skipped decisions as explicit not-applicable or deferred statements; never leave placeholders blank.
19
+
20
+ Validate active blocks against the decision ledger before rendering. Architecture, API style, authentication, data technology, testing, observability, and AI permissions each have one selected owner; incompatible blocks fail generation.
16
21
 
17
22
  ## Phase 2 Normalized Semantic Fill Table
18
23
 
@@ -124,9 +129,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
124
129
  ### D-NODE-02
125
130
  **Trigger**: Q1 = Node.js | **Inject into**: `{{ tech_stack_rules }}`
126
131
 
127
- - Package manager locked to `pnpm` (recommended). Commit `pnpm-lock.yaml`.
128
- - `package.json` declares `"type": "module"`.
129
- - CI validates `engines` field matches `.nvmrc`.
132
+ - Preserve the package manager and lockfile already selected by the project; do not introduce a different manager as an implicit Node.js default.
133
+ - `package.json` declares the selected module format explicitly when the runtime requires it.
134
+ - Keep runtime declarations used by package metadata, local tooling, and CI consistent.
130
135
 
131
136
  ### D-PYTHON-01
132
137
  **Trigger**: Q1 = Python | **Inject into**: `{{ tech_stack_rules }}`
@@ -354,38 +359,35 @@ Resolve each selected option or custom reply into the complete semantic value sh
354
359
  ### D-MONGO-01
355
360
  **Trigger**: Q8 = MongoDB | **Inject into**: `{{ data_rules }}`
356
361
 
357
- - MongoDB document model: schema validation via JSON Schema (`$jsonSchema` validator on collections).
358
- - Indexing strategy for query patterns: create indexes for all query filter fields. Use `explain()` to verify index usage.
359
- - Aggregation pipeline standards: stages must be documented with purpose comments. Forbid complex pipelines without EXPLAIN.
360
- - No-SQL injection prevention: validate and sanitize all user input in queries. Use parameterized query operators (`$eq`, `$gt`), forbid `$where` with user input.
361
- - Collection design with embedded vs. reference trade-offs: embed for read-together data, reference for independently-accessed data.
362
- - The relational-database-oriented F5 fixed rules (migration files, SELECT syntax, normalization) do NOT apply. Skip F5.1-F5.3 of the fixed rules content.
362
+ - Define collection validation at the database or application boundary and keep it synchronized with the selected model source.
363
+ - Derive indexes from measured query/sort paths and verify expensive operations with `explain()`; do not index every filterable field automatically.
364
+ - Treat field names and query operators as allowlisted input and never evaluate caller-controlled `$where` or executable expressions.
365
+ - Choose embedding versus references from aggregate ownership, update atomicity, document growth, and access patterns.
366
+ - Apply document-model, migration, and query rules only; do not import relational SQL or 3NF rules.
363
367
 
364
368
  ### D-MYSQL-01
365
369
  **Trigger**: Q8 = MySQL | **Inject into**: `{{ data_rules }}`
366
370
 
367
- - MySQL 8.0+ with InnoDB engine default. Use `utf8mb4` charset for all tables.
368
- - Forbid `utf8mb3` (deprecated). Forbid MyISAM engine (no transaction support).
369
- - Index types: BTREE for range queries, HASH for exact-match lookups (memory tables only).
370
- - Connection pool: configure `wait_timeout` and `interactive_timeout` to prevent stale connections.
371
- - Migration files use the same tooling as PostgreSQL (golang-migrate, Flyway, Alembic). Schema differences documented in README.
371
+ - Use a supported MySQL release and a transactional engine for state requiring atomicity.
372
+ - Use `utf8mb4` for Unicode text and reject deprecated encodings in new structures.
373
+ - Select indexes from query patterns and engine support, and configure client lifetime against server timeouts.
374
+ - Use the migration mechanism selected by the project; do not inherit PostgreSQL syntax or tooling.
372
375
 
373
376
  ### D-SQLITE-01
374
377
  **Trigger**: Q8 = SQLite | **Inject into**: `{{ data_rules }}`
375
378
 
376
- - SQLite for local development and single-instance deployments. WAL mode enabled by default.
377
- - Forbid SQLite for multi-instance production deployments (no concurrent write support).
378
- - Forbid concurrent write access across multiple processes. Use a single writer pattern.
379
- - Migration files still version-controlled. Test with the same SQLite version as production.
380
- - No connection pool needed (single connection). Close connections explicitly after each operation.
379
+ - Use SQLite only for a workload whose concurrency, durability, and deployment model match its capabilities.
380
+ - Choose journal/WAL mode from the read/write and filesystem constraints and serialize writes when required.
381
+ - Version model changes and test with the supported production SQLite version when SQLite is the deployed store.
382
+ - Follow the selected driver lifecycle; do not impose a server-style connection pool.
381
383
 
382
384
  ### D-JWT-01
383
385
  **Trigger**: Q9 = JWT | **Inject into**: `{{ auth_rules }}`
384
386
 
385
- - Access token TTL 15min. Refresh token TTL 7d.
386
- - Token payload contains no sensitive info (passwords, phone numbers). Only userId + role.
387
- - Secret read from environment variables. Forbid hardcoding.
388
- - Token blacklist (logout/password change invalidation) implemented with Redis.
387
+ - Define issuer, audience, subject, scopes/claims, signing algorithm, access lifetime, refresh/re-issuance, rotation, and revocation from the threat model.
388
+ - Keep sensitive data out of token payloads and validate signature plus temporal and audience claims at every trust boundary.
389
+ - Keep signing material outside source control and support key rotation.
390
+ - Implement revocation through a compatible selected mechanism; JWT does not implicitly authorize Redis.
389
391
 
390
392
  ### D-OAUTH-01
391
393
  **Trigger**: Q9 = OAuth2 | **Inject into**: `{{ auth_rules }}`
@@ -398,19 +400,17 @@ Resolve each selected option or custom reply into the complete semantic value sh
398
400
  ### D-SESSION-01
399
401
  **Trigger**: Q9 = Session | **Inject into**: `{{ auth_rules }}`
400
402
 
401
- - Session storage uses Redis, not memory (loses data on restart, not shared across instances).
402
- - Session ID generated with `crypto.randomUUID()`, not auto-increment IDs.
403
- - Cookie settings: `HttpOnly` + `Secure` (production) + `SameSite=Lax`.
404
- - Session ID must be rotated after successful login (prevent Session Fixation).
403
+ - Store sessions in a mechanism compatible with the selected deployment and availability topology; an external cache is not implied when Q10 selected no cache.
404
+ - Generate high-entropy opaque session identifiers, rotate them at authentication/privilege changes, and invalidate them on logout.
405
+ - Use `HttpOnly`, production `Secure`, and a SameSite/CSRF policy compatible with confirmed cross-site flows.
405
406
 
406
407
  ### D-APIKEY-01
407
408
  **Trigger**: Q9 = API Key | **Inject into**: `{{ auth_rules }}`
408
409
 
409
- - API keys for service-to-service communication. Not for end-user auth.
410
- - Keys stored hashed (SHA-256) in database. Plaintext shown once at creation.
411
- - Key format: `sk_<random_32_bytes_base64url>` with prefix for easy identification in logs.
412
- - Key validation: constant-time comparison to prevent timing attacks.
413
- - Keys must have expiration (default 365d). Must be rotatable without downtime.
410
+ - Restrict API keys to named machine or integration principals, not end-user authentication.
411
+ - Generate high-entropy keys, display plaintext only at creation, and store a one-way verifier plus a non-secret lookup prefix.
412
+ - Compare verifiers safely and support scoped authorization, rotation, revocation, ownership, and last-used audit data.
413
+ - Set expiry from integration risk and lifecycle rather than a universal duration.
414
414
 
415
415
  ### D-REDIS-01
416
416
  **Trigger**: Q10 = Redis | **Inject into**: `{{ cache_rules }}`
@@ -462,18 +462,16 @@ Resolve each selected option or custom reply into the complete semantic value sh
462
462
  ### D-DOCKER-01
463
463
  **Trigger**: Q12 = Docker | **Inject into**: `{{ deploy_rules }}`
464
464
 
465
- - Dockerfile uses multi-stage builds. Final image excludes build tools.
466
- - Base image uses `-slim` or `-alpine` variants.
467
- - Health check: `HEALTHCHECK` points to `/health` endpoint.
468
- - `.dockerignore` excludes node_modules, .git, log files.
465
+ - Use a reproducible build and a minimal runtime image compatible with the selected language/runtime; do not force Alpine when native dependencies make it unsafe.
466
+ - Exclude build-only tools and sensitive/unneeded context from the final image.
467
+ - Connect container health behavior to the selected application liveness/readiness contract rather than assuming one route.
469
468
 
470
469
  ### D-K8S-01
471
470
  **Trigger**: Q12 = Kubernetes | **Inject into**: `{{ deploy_rules }}`
472
471
 
473
- - Must configure liveness and readiness probes (pointing to `/health` and `/health/ready`).
474
- - Resource limits (requests/limits) must be set.
475
- - Sensitive config via Secret, non-sensitive via ConfigMap.
476
- - Pod anti-affinity: same-type pods not scheduled on the same node (high availability).
472
+ - Configure probes against the application's selected liveness/readiness contract and set resource requests/limits from measured behavior.
473
+ - Keep sensitive and non-sensitive configuration in the platform's appropriate boundaries without committing secret values.
474
+ - Replicas, disruption budgets, anti-affinity, and multi-zone placement come from the confirmed availability objective; Kubernetes selection alone does not require them.
477
475
 
478
476
  ### D-AI-DEP-STRICT-01
479
477
  **Trigger**: Q18 = Forbid | **Inject into**: `{{ ai_dependency_rule }}`
@@ -519,10 +517,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
519
517
  ### D-OBS-LOG-01
520
518
  **Trigger**: Q16 = Structured JSON logging | **Inject into**: `{{ observability_rules }}`
521
519
 
522
- - Log format: JSON with fields `timestamp`, `level`, `message`, `traceId`, `userId`, `service`, `path`, `method`, `duration_ms`.
523
- - Centralized collection via ELK (Elasticsearch + Logstash + Kibana) or Grafana Loki.
524
- - Log levels: ERROR (requires alert), WARN (requires investigation), INFO (key business events), DEBUG (development only).
525
- - Forbid logging sensitive data (passwords, tokens, national IDs). Must mask.
520
+ - Emit structured events with timestamp, severity, message, service/operation, and available correlation context; add identity or request fields only when useful and privacy-safe.
521
+ - Send events through the centralized collection boundary selected by the deployment; do not force ELK or Loki.
522
+ - Define severity and alert mappings operationally, and redact credentials, tokens, and sensitive personal data.
526
523
 
527
524
  ### D-OBS-LOG-02
528
525
  **Trigger**: Q16 = local files | **Inject into**: `{{ observability_rules }}`
@@ -543,26 +540,23 @@ Resolve each selected option or custom reply into the complete semantic value sh
543
540
  ### D-OBS-METRICS-01
544
541
  **Trigger**: Q17 = OpenTelemetry + Prometheus + Grafana | **Inject into**: `{{ observability_rules }}`
545
542
 
546
- - OpenTelemetry SDK auto-instruments HTTP/gRPC/database calls.
547
- - Custom metrics: request count, request duration (p50/p95/p99), error rate, DB query duration.
548
- - Prometheus scrapes `/metrics` endpoint. Grafana dashboards for: request latency, error rate, DB connection pool, cache hit rate.
549
- - Alerting rules: error rate > 5% for 5min triggers alert, p95 latency > 500ms for 5min triggers warning.
543
+ - Instrument applicable transport and dependency boundaries with the selected OpenTelemetry-compatible pipeline.
544
+ - Define service metrics and dashboards from confirmed service objectives and selected dependencies; cache metrics appear only when caching is selected.
545
+ - Expose or export telemetry through the selected collector/platform mechanism and derive alert thresholds from objectives and observed baselines rather than universal percentages.
550
546
 
551
547
  ### D-TEST-STRATEGY-01
552
548
  **Trigger**: Q13 = Unit tests + Integration tests | **Inject into**: `{{ test_rules }}`
553
549
 
554
- - Testing tiers: unit tests (service/repository layers) + integration tests (API endpoints + DB).
555
- - Unit tests: fast (<100ms each), no external deps. Mock all I/O.
556
- - Integration tests: use test database or testcontainers. Test realistic scenarios.
557
- - Coverage targets: service layer >= 80%, controller layer >= 60%.
558
- - CI runs all tests. Integration tests run against a fresh DB instance each time.
550
+ - Include unit and integration behavior appropriate to the selected architecture and external boundaries.
551
+ - Unit tests isolate owned behavior; integration tests verify real contract boundaries using the separately selected mock/environment strategy.
552
+ - Set numeric coverage or timing thresholds only when the project confirms them. CI runs the enabled tiers in deterministic isolation.
559
553
 
560
554
  ### D-TEST-STRATEGY-02
561
555
  **Trigger**: Q13 = Unit tests only | **Inject into**: `{{ test_rules }}`
562
556
 
563
- - Unit tests only. Coverage target: service layer >= 80%.
564
- - External deps mocked. No database or network access in tests.
565
- - Recommend adding integration tests for critical data-access paths before production.
557
+ - Keep the mandatory suite at the unit boundary selected by the project and isolate external dependencies according to Q15.
558
+ - Do not inject an unselected coverage percentage.
559
+ - Record the accepted lack of integration evidence and revisit it when production risk changes.
566
560
 
567
561
  ### D-TEST-STRATEGY-03
568
562
  **Trigger**: Q13 = Critical path integration tests only | **Inject into**: `{{ test_rules }}`
@@ -574,10 +568,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
574
568
  ### D-TEST-MOCK-01
575
569
  **Trigger**: Q15 = testcontainers | **Inject into**: `{{ test_rules }}`
576
570
 
577
- - External APIs (payment gateways, email services, third-party SDKs): mocked.
578
- - Database: use testcontainers (dockerized Postgres/MySQL/Redis) for integration tests.
579
- - Testcontainers lifecycle: start before test suite, stop after. Use singleton container pattern to share across tests.
580
- - Test data: seeded per test file, cleaned up after each test. Forbid shared mutable test data.
571
+ - Mock external service dependencies at their contract boundary.
572
+ - For datastore integration tests, use a testcontainer or an in-memory implementation only when it faithfully represents the selected datastore behavior; do not start Redis unless caching/session decisions require it.
573
+ - Bound environment lifecycle and isolate mutable test data so tests remain repeatable.
581
574
 
582
575
  ### D-TEST-MOCK-02
583
576
  **Trigger**: Q15 = including database | **Inject into**: `{{ test_rules }}`
@@ -590,10 +583,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
590
583
  ### D-TEST-MOCK-03
591
584
  **Trigger**: Q15 = real environments | **Inject into**: `{{ test_rules }}`
592
585
 
593
- - Prefer real environments over mocking. Tests run against dedicated test infrastructure.
594
- - Test database is a shared instance (not per-developer).
595
- - Test data isolation: each test creates its own data and cleans up.
596
- - Requires CI access to test infrastructure. Tests may be slower but more realistic.
586
+ - Prefer representative real dependencies through dedicated test infrastructure where the selected risk justifies it.
587
+ - Shared infrastructure must still isolate tenants/data and support deterministic cleanup; a shared instance is not automatically required.
588
+ - Document CI access, cost, failure ownership, and any remaining non-production differences.
597
589
 
598
590
  ---
599
591