prizmkit 1.1.154 → 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 (157) 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 +21 -27
  6. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
  7. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
  9. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  17. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  18. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  19. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  20. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
  21. package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
  23. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
  24. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  25. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  26. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  27. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  28. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  32. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  35. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  36. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  37. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  39. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  40. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  43. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  44. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  45. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  47. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  48. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  50. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  51. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  53. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  54. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  55. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  56. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
  57. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
  58. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  59. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  60. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
  61. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
  62. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
  63. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  64. package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
  65. package/bundled/skills/_metadata.json +9 -9
  66. package/bundled/skills/app-planner/SKILL.md +3 -3
  67. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  68. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  69. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  70. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  71. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  72. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  73. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  74. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  75. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  76. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  77. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  78. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  79. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  80. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  81. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  82. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  83. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  84. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  85. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  86. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  87. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  88. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  89. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  90. package/bundled/skills/prizmkit/SKILL.md +17 -18
  91. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  93. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  94. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  95. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  96. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  97. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  98. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  99. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  100. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  101. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  102. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  103. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  104. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  105. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  106. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  107. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  108. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  109. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  110. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  111. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  112. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  113. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  114. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  115. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +11 -1
  116. package/bundled/skills/prizmkit-retrospective/SKILL.md +63 -77
  117. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
  118. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  119. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +17 -23
  120. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  121. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  122. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  123. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  124. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  125. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  126. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  127. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  128. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  129. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  130. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  131. package/package.json +1 -1
  132. package/src/scaffold.js +33 -22
  133. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  134. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  135. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  136. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  137. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  138. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  139. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  140. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  141. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  142. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  143. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  144. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  145. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  146. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  147. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  148. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  149. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  150. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  151. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  152. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  153. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  154. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  155. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  156. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  157. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -0,0 +1,138 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "PrizmKit Retrospective Result",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schema_version",
8
+ "outcome",
9
+ "result",
10
+ "reason",
11
+ "change_paths",
12
+ "documentation_paths",
13
+ "validation"
14
+ ],
15
+ "properties": {
16
+ "schema_version": {
17
+ "const": 1
18
+ },
19
+ "outcome": {
20
+ "enum": ["RETRO_COMPLETE", "RETRO_BLOCKED"]
21
+ },
22
+ "result": {
23
+ "enum": ["DOCS_UPDATED", "NO_DOC_CHANGE", null]
24
+ },
25
+ "reason": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "change_paths": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "allOf": [
35
+ {
36
+ "not": {
37
+ "pattern": "\\\\"
38
+ }
39
+ },
40
+ {
41
+ "not": {
42
+ "pattern": "^/"
43
+ }
44
+ },
45
+ {
46
+ "not": {
47
+ "pattern": "//"
48
+ }
49
+ },
50
+ {
51
+ "not": {
52
+ "pattern": "(?:^|/)\\.\\.?(?:/|$)"
53
+ }
54
+ },
55
+ {
56
+ "not": {
57
+ "pattern": "^\\.prizmkit(?:/|$)"
58
+ }
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ "documentation_paths": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string",
67
+ "pattern": "^\\.prizmkit/prizm-docs/.+\\.prizm$",
68
+ "allOf": [
69
+ {
70
+ "not": {
71
+ "pattern": "\\\\"
72
+ }
73
+ },
74
+ {
75
+ "not": {
76
+ "pattern": "//"
77
+ }
78
+ },
79
+ {
80
+ "not": {
81
+ "pattern": "(?:^|/)\\.\\.?(?:/|$)"
82
+ }
83
+ }
84
+ ]
85
+ }
86
+ },
87
+ "validation": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ }
93
+ }
94
+ },
95
+ "oneOf": [
96
+ {
97
+ "properties": {
98
+ "outcome": {
99
+ "const": "RETRO_COMPLETE"
100
+ },
101
+ "result": {
102
+ "enum": ["DOCS_UPDATED", "NO_DOC_CHANGE"]
103
+ }
104
+ },
105
+ "allOf": [
106
+ {
107
+ "if": {
108
+ "properties": {
109
+ "result": {
110
+ "const": "DOCS_UPDATED"
111
+ }
112
+ }
113
+ },
114
+ "then": {
115
+ "properties": {
116
+ "documentation_paths": {
117
+ "minItems": 1
118
+ },
119
+ "validation": {
120
+ "minItems": 1
121
+ }
122
+ }
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "properties": {
129
+ "outcome": {
130
+ "const": "RETRO_BLOCKED"
131
+ },
132
+ "result": {
133
+ "type": "null"
134
+ }
135
+ }
136
+ }
137
+ ]
138
+ }
@@ -1,16 +1,10 @@
1
1
  # Structural Sync — Detailed Steps
2
2
 
3
- ## 1. Get changed files
3
+ ## 1. Validate supplied changed files
4
4
 
5
- Get changed project files from staged and unstaged changes relative to HEAD while excluding the entire `.prizmkit/` tree:
5
+ Use only the caller-supplied `change_paths`. Normalize each repository-relative path, reject paths outside the checkout or under `.prizmkit/`, and verify its current added/modified/deleted/renamed state with exact pathspecs.
6
6
 
7
- ```bash
8
- git diff HEAD --name-status -- . ':(exclude).prizmkit/**'
9
- ```
10
-
11
- If pathspec exclusion is unavailable, filter every result whose normalized repository-relative path is exactly `.prizmkit` or starts with `.prizmkit/` before classification. Do not infer project structure or durable knowledge from excluded files.
12
-
13
- If the caller supplied an explicit file list, apply the same `.prizmkit/` exclusion before using it and note the source in the report. If no files remain, structural sync is not needed.
7
+ Do not expand the path set through repository-wide status or diff discovery. If the validated list is empty, structural sync is not needed.
14
8
 
15
9
  ## 2. Map files to modules
16
10
 
@@ -42,11 +36,11 @@ Do not skip automatically just because the task is a bug fix or test change. Run
42
36
 
43
37
  ## 5. Update affected docs bottom-up
44
38
 
45
- ### L2
39
+ ### Detail documentation
46
40
 
47
- If L2 exists, update only sections affected by changed files in that module.
41
+ If a relevant detail document exists, update only sections affected by supplied changed files in that module.
48
42
 
49
- If L2 does not exist and the current diff includes Added or Modified source files with meaningful logic, create L2 with:
43
+ If detail documentation does not exist and the supplied changes include Added or Modified source files with meaningful logic, create it with:
50
44
 
51
45
  ```text
52
46
  MODULE
@@ -60,35 +54,35 @@ TRAPS
60
54
 
61
55
  Add DATA_FLOW, RULES, or DECISIONS only when the changed files provide durable information for those sections. Populate from the diff files and targeted source reads, not from an unbounded full-module rescan.
62
56
 
63
- ### L1
57
+ ### Module index
64
58
 
65
59
  Update FILES count, KEY_FILES, SUBDIRS, and DEPENDENCIES when module-level structure changes.
66
60
 
67
- L1 does not contain INTERFACES, DATA_FLOW, TRAPS, or DECISIONS; those belong in L2.
61
+ Module indexes do not contain INTERFACES, DATA_FLOW, TRAPS, or DECISIONS; those belong in detail documentation.
68
62
 
69
- ### L0
63
+ ### Root project map
70
64
 
71
- Update MODULE_INDEX or MODULE_GROUPS only when module structure changed. Preserve any `PROJECT_BRIEF:` line because it is managed by `/prizmkit-init`.
65
+ Update MODULE_INDEX or MODULE_GROUPS only when module structure changed. Preserve any `PROJECT_BRIEF:` line because it is managed separately.
72
66
 
73
67
  ## 6. New module handling
74
68
 
75
69
  If a new directory qualifies as a module and matches no existing module:
76
70
 
77
- 1. Create L1 immediately.
71
+ 1. Create its module index immediately.
78
72
  2. Add it to MODULE_INDEX or MODULE_GROUPS.
79
- 3. Create L2 only when the current diff includes meaningful Added or Modified source files for the module.
73
+ 3. Create detail documentation only when the supplied changes include meaningful Added or Modified source files for the module.
80
74
 
81
75
  ## 7. Size limits
82
76
 
83
- - L0 > 4KB → consolidate MODULE_INDEX or convert to MODULE_GROUPS when module count is high
84
- - L1 > 4KB → trim KEY_FILES descriptions and keep RULES concise
85
- - L2 > 5KB → remove derived detail or stale entries; keep durable knowledge only
77
+ - Root project map > 4KB → consolidate MODULE_INDEX or convert to MODULE_GROUPS when module count is high
78
+ - Module index > 4KB → trim KEY_FILES descriptions and keep RULES concise
79
+ - Detail document > 5KB → remove derived detail or stale entries; keep durable knowledge only
86
80
 
87
81
  ## 8. TRAPS staleness check
88
82
 
89
- Run only when an L2 doc's TRAPS section has more than 10 entries.
83
+ Run only when a detail document's TRAPS section has more than 10 entries.
90
84
 
91
- Process at most 5 oldest TRAPS per L2 doc:
85
+ Process at most 5 oldest TRAPS per detail document:
92
86
 
93
87
  1. If a TRAP has `STALE_IF:` and matched files no longer exist, delete the TRAP.
94
88
  2. If a TRAP has `REF:` and the referenced file is gone or the commit is older than the review horizon, mark it `[REVIEW]` for the next knowledge pass.
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: "prizmkit-test"
3
- description: "AI-led project-native testing for the complete affected business module and its Regression Ring. Adds comprehensive behavior, boundary, error, state, side-effect, permission, concurrency, idempotency, time, dependency, and consumer tests; repairs valid failures in a bounded loop; performs mandatory Main-Agent review plus one optional strict independent Test Reviewer; and returns TEST_PASS, TEST_NEEDS_FIXES, or TEST_BLOCKED with a human report and minimal terminal result. (project)"
3
+ description: "Test one supplied current change with project-native affected-module and Regression Ring coverage. Use for contract testing, test-double fidelity, consumer/provider compatibility, browser and Full-stack E2E, persistence re-entry, and cross-boundary integration; returns TEST_PASS, TEST_NEEDS_FIXES, or TEST_BLOCKED with stage-owned report/result artifacts. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Test
7
7
 
8
8
  `/prizmkit-test` is the independent testing stage for the current workspace. It understands the affected business behavior, fills project-native test gaps, executes the tests, repairs valid failures, reviews the final tests, and reports a truthful testing-domain result.
9
9
 
10
- It does not build an evidence package, prove historical TDD order, validate a previous checkout, or manage pipeline/session state.
10
+ It does not build an evidence package, prove historical TDD order, or validate a previous checkout.
11
11
 
12
12
  ## Atomic Skill Boundary
13
13
 
@@ -26,25 +26,21 @@ resolve current change and requirement context
26
26
  → return TEST_PASS | TEST_NEEDS_FIXES | TEST_BLOCKED
27
27
  ```
28
28
 
29
- After writing its result, this skill returns control to its caller. It must not:
30
-
31
- - invoke implementation, Code Review, retrospective, or committer;
32
- - update a workflow checkpoint or pipeline runtime state;
33
- - classify an AI CLI session as success, crash, retry, or continuation;
34
- - decide whether a workflow terminates or resumes;
35
- - call a testing-domain non-pass result a runtime failure.
29
+ After writing its result, this Skill stops. It owns only testing-local source/test repairs and its two terminal artifacts. It does not invoke another Skill.
36
30
 
37
31
  ## Inputs and Outputs
38
32
 
39
33
  | Parameter | Required | Description |
40
34
  |---|---|---|
41
35
  | `scope` | No | `full-project`, `module:<name>`, `feature:<slug>`, or `this-change`. Defaults to `this-change` when current change context exists, otherwise `full-project`. |
42
- | `artifact_dir` | No | Active requirement directory containing available specification, plan, and prior review context. Reuse the caller-provided path. |
36
+ | `artifact_dir` | Yes | Exact caller-supplied project-relative directory for the two terminal artifacts and any available specification, plan, and behavior context. Reuse it unchanged. |
43
37
  | `changed_files` | No | Explicit current changed paths. Highest-priority scope locator. |
44
38
  | `diff_base` | No | Git comparison base when explicit changed paths are absent. |
45
39
  | `test_commands` | No | Project-native commands when repository conventions are ambiguous. |
46
40
 
47
- Write exactly two terminal artifacts in `artifact_dir` when it is available; otherwise use a clearly reported caller-visible artifact directory selected from the active request context:
41
+ Resolve `artifact_dir` before Test execution. In interactive use, ask the user to confirm an exact project-relative directory when omitted. In non-interactive use, a missing or unsafe directory is a response-only `TEST_BLOCKED` precondition failure: create no fallback directory or artifact and report that the caller must retry with `artifact_dir`. This precondition rejection is the sole case where terminal files cannot be written because their required identity is absent.
42
+
43
+ For every invocation that passes input resolution, write exactly two terminal artifacts in the supplied `artifact_dir`:
48
44
 
49
45
  ```text
50
46
  {artifact_dir}/
@@ -52,16 +48,16 @@ Write exactly two terminal artifacts in `artifact_dir` when it is available; oth
52
48
  └── test-result.json
53
49
  ```
54
50
 
55
- Do not create `.prizmkit/test/evidence/`, manifests, hashes, attestations, package lifecycle records, or test-internal checkpoints.
51
+ Do not create `.prizmkit/test/evidence/`, manifests, hashes, attestations, package state records, or test-internal checkpoints.
56
52
 
57
53
  ## Context Loading and Scope Resolution
58
54
 
59
55
  1. Reuse current requirement and workspace context already loaded by the Main Agent.
60
56
  2. Load `root.prizm`, the relevant module indexes, and the applicable detail docs before modifying source or tests.
61
57
  3. Inspect current staged, unstaged, untracked, deleted, and renamed paths. Changed lines locate impact but never define completeness.
62
- 4. Read the available specification, acceptance criteria, plan, and prior review only as needed to establish expected behavior.
58
+ 4. Read the available specification, acceptance criteria, plan, and caller-supplied behavior context only as needed to establish expected behavior.
63
59
  5. Inspect manifests, runner configuration, CI conventions, existing test assertions, fixtures, fakes, mocks, contracts, and coverage support.
64
- 6. If necessary scope cannot be determined safely, report the precise missing input and return `TEST_BLOCKED`.
60
+ 6. If necessary scope cannot be determined safely, report the precise missing input and return `TEST_BLOCKED` in the resolved artifact pair.
65
61
 
66
62
  Do not infer the active requirement solely from the name of an old artifact directory. Do not use a historical worktree, second checkout, mutation proof, baseline-failure proof, or test overlay.
67
63
 
@@ -101,29 +97,29 @@ Use the lowest layer that proves a property without losing relevant composition,
101
97
 
102
98
  ```text
103
99
  focused/unit
104
- → module/component
105
- → contract/integration
106
- code-level E2E when applicable
100
+ → module/component or UI component
101
+ consumer/provider contract or integration
102
+ Mock Browser or Full-stack E2E according to actual composition
107
103
  → complete affected-module regression
108
104
  → Regression Ring verification
109
105
  ```
110
106
 
111
- Do not mechanically test every private function. Add direct focused tests for critical low-level logic when complexity, boundaries, risk, or failure localization justify them; otherwise prove it through public behavior.
107
+ Browser execution alone is not Full-stack E2E. Do not mechanically test every private function. Add direct focused tests for critical low-level logic when complexity, boundaries, risk, or failure localization justify them; otherwise prove it through public behavior.
112
108
 
113
109
  ## Test Construction
114
110
 
115
- Read `${SKILL_DIR}/references/test-coverage-model.md` and, when external or cross-module contracts apply, `${SKILL_DIR}/references/external-contract-mock-guidance.md`.
111
+ Read `${SKILL_DIR}/references/test-coverage-model.md` and, whenever serialization, a producer-consumer boundary, or any test double replaces a producer or consumer, `${SKILL_DIR}/references/boundary-contract-and-test-double-guidance.md`.
116
112
 
117
- Expected behavior follows this precedence:
113
+ Expected behavior follows boundary-specific authority:
118
114
 
119
- 1. confirmed specification;
120
- 2. machine-readable contract;
121
- 3. acceptance criteria;
122
- 4. trusted existing tests;
123
- 5. callers and consumers;
124
- 6. current implementation.
115
+ 1. confirmed specification and acceptance criteria;
116
+ 2. machine-readable wire contract;
117
+ 3. traceably generated type, client, server stub, or fixture;
118
+ 4. provider raw-wire contract evidence or authorized isolated observation;
119
+ 5. provider implementation, locked SDK behavior, and matching official documentation;
120
+ 6. trusted existing tests, callers and consumers, consumer-local types/fixtures/mocks, and other current implementation evidence.
125
121
 
126
- Conflicting higher-precedence truth that cannot be resolved is `TEST_BLOCKED`; do not preserve a possible implementation defect as a characterization test.
122
+ Lower-authority material cannot override higher-authority truth or prove a property outside its boundary. Conflicts that cannot be resolved are `TEST_BLOCKED`; do not preserve a possible implementation defect as a characterization test.
127
123
 
128
124
  Tests must:
129
125
 
@@ -135,6 +131,20 @@ Tests must:
135
131
  - avoid vacuous assertions and assertions that merely duplicate implementation steps;
136
132
  - never delete or weaken a valid existing test just to obtain green output.
137
133
 
134
+ ## Boundary Contract and Composition Gate
135
+
136
+ A test cannot prove a property that depends on production composition it replaces. Before test construction and again before `TEST_PASS`:
137
+
138
+ 1. Inventory every verdict-relevant mock, fake, fixture, route interception, mock server, container, emulator, or isolated service that crosses or replaces a producer-consumer boundary.
139
+ 2. Record its producer, consumer, boundary/protocol, contract authority, fidelity proof, composition removed, property not proven, composition-preserving test, and remaining risk.
140
+ 3. Treat consumer-local types, fixtures, and mocks as expectations, not provider truth, unless they are generated from or validated against the authoritative boundary contract.
141
+ 4. Classify tests by actual composition. An API-intercepted browser test is a Mock Browser Test, not Full-stack E2E.
142
+ 5. Require risk-relevant Provider Contract Tests to inspect raw wire payload before provider-owned deserialization.
143
+ 6. For any verdict-capable serialization or multi-layer risk in removed composition, require provider/consumer contract evidence, a composition-preserving integration test, or a Full-stack path appropriate to the risk and keeping the defect-bearing boundary real.
144
+ 7. For state-changing workflows, verify commit point, cancellation, pending/duplicate protection, failure recovery, reload or re-entry, retry/conflict/idempotency, and downstream consumption.
145
+
146
+ If required composition-preserving evidence cannot run in a proven safe isolated environment, return `TEST_BLOCKED`. Never substitute a lower-layer green test or downgrade the proof requirement.
147
+
138
148
  Reuse an adequate existing framework. Add only the smallest necessary project-native infrastructure when a required property cannot otherwise be expressed.
139
149
 
140
150
  Minimal behavior-preserving testability seams are allowed, including dependency injection through an existing abstraction, pure-function extraction, an internal adapter, or controllable clock/randomness/state. Classify any production change under the repair boundary below.
@@ -145,13 +155,13 @@ The target project owns its runner, command, working directory, timeout, concurr
145
155
 
146
156
  During construction and repair, run the smallest relevant tests first. Before a pass decision, run all required layers, the complete affected-module regression, the Regression Ring, and project-wide regression when concrete coupling or project convention requires it.
147
157
 
148
- A nonzero execution is development feedback, not an immediate workflow stop. Classify it:
158
+ A nonzero execution is testing feedback, not an immediate terminal result. Classify it:
149
159
 
150
160
  | Classification | Action |
151
161
  |---|---|
152
162
  | `test-defect` | Repair the test, fixture, mock, import, syntax, or test infrastructure. |
153
163
  | `local-production-defect` | Repair the proven internal implementation defect when public and cross-module contracts remain unchanged. |
154
- | `high-risk-production-defect` | Repair only when safe, then require delta Code Review and return `TEST_NEEDS_FIXES`. |
164
+ | `high-risk-production-defect` | Do not repair it in this invocation; record the proven defect and return `TEST_NEEDS_FIXES`. |
155
165
  | `environment-unavailable` | Return `TEST_BLOCKED` with the unavailable safe prerequisite. |
156
166
  | `truth-unresolved` | Return `TEST_BLOCKED`; never guess the assertion. |
157
167
  | `flaky-or-unreliable` | Diagnose within budget; otherwise return `TEST_BLOCKED`. |
@@ -165,9 +175,9 @@ Never retry until green or weaken scope/assertions to manufacture a pass.
165
175
 
166
176
  ## Production Repair Boundary
167
177
 
168
- A repair may close inside this skill only when evidence establishes that it is limited to private/internal implementation, a behavior-preserving algorithm correction, test infrastructure, a behavior-preserving testability seam, or local error handling with unchanged public obligations.
178
+ A repair may close inside this Skill only when evidence establishes that it is limited to private/internal implementation, a behavior-preserving algorithm correction, test infrastructure, a behavior-preserving testability seam, or local error handling with unchanged public obligations.
169
179
 
170
- Set `review_required=true` and `review_scope=delta` when a repair affects or may affect:
180
+ Do not perform the repair in this invocation when it affects or may affect:
171
181
 
172
182
  - public API or observable public behavior;
173
183
  - schema, migration, serialization, or generated protocol shape;
@@ -178,7 +188,7 @@ Set `review_required=true` and `review_scope=delta` when a repair affects or may
178
188
  - compatibility guarantees;
179
189
  - any change whose locality cannot be established confidently.
180
190
 
181
- Record completed repairs and test results, return `TEST_NEEDS_FIXES`, and stop. Do not invoke Code Review or prescribe caller routing from this skill.
191
+ Record the defect evidence and required correction, return `TEST_NEEDS_FIXES`, and stop. Do not prescribe or execute work outside this testing invocation.
182
192
 
183
193
  ## Mandatory Main-Agent Test Review
184
194
 
@@ -200,7 +210,10 @@ Every complete round checks:
200
210
  - critical low-level boundary logic;
201
211
  - incorrect truth precedence or expected behavior;
202
212
  - weak, vacuous, implementation-only, nondeterministic, or flaky assertions;
203
- - over-mocking, invented contracts, and missing negative side-effect assertions;
213
+ - complete boundary/test-double inventory, boundary-appropriate authority, fidelity proof, and consumer-authored ideal fixtures not being treated as provider truth;
214
+ - Provider raw-wire assertions, test-layer labels matching actual composition, and Browser Tests with intercepted critical APIs not being called Full-stack E2E;
215
+ - any test that would still pass with the target defect, any verdict-capable composition removed without preserving evidence, and missing negative side-effect assertions;
216
+ - state-changing workflow commit, cancellation, failure recovery, reload/re-entry, retry/conflict/idempotency, and repeated-operation coverage;
204
217
  - unjustified layer omissions or tests absent from actual native execution;
205
218
  - production repairs outside this skill's safe boundary.
206
219
 
@@ -244,17 +257,17 @@ Only after Main-Agent review converges, read `${SKILL_DIR}/references/independen
244
257
  - If response five still contains unresolved truth, input, or safety, return `TEST_BLOCKED`.
245
258
  - Never claim `TEST_PASS` for a final mutation that was not independently rechecked when independent review had already begun, unless the reference's strict downgrade rule establishes the permitted Main-Agent fallback.
246
259
 
247
- ## External Services and Safety
260
+ ## Boundary Contracts and External Safety
248
261
 
249
- Read `${SKILL_DIR}/references/external-contract-mock-guidance.md` whenever an external service, persistence boundary, queue, filesystem, generated client, or cross-module endpoint affects the tested property.
262
+ Read `${SKILL_DIR}/references/boundary-contract-and-test-double-guidance.md` for internal and external APIs, cross-module endpoints, persistence, queues, filesystems, caches, generated clients/servers, and any test double replacing a producer or consumer.
250
263
 
251
- - Prefer project-owned schemas, generated types, SDK interfaces, fixtures, and documentation.
252
- - Use approved retrieval of public official documentation only when project artifacts are insufficient.
264
+ - Select authority for the property at the actual boundary; a database schema does not independently prove HTTP or message serialization.
265
+ - Use approved retrieval of public official documentation only when higher-authority project artifacts are insufficient.
253
266
  - Never expose secrets, private source, proprietary payloads, or repository-private data during retrieval.
254
267
  - Never use production credentials, production databases/APIs/queues/storage, real user data, or destructive external operations.
255
268
  - If an endpoint cannot be proven non-production, do not connect to it.
256
- - Use contract-backed local fakes, mocks, fixtures, mock servers, containers, or project-owned isolated services.
257
- - Record necessary unverified external behavior as a remaining risk or `TEST_BLOCKED` when it prevents the verdict.
269
+ - Use contract-backed local doubles or project-owned isolated services only within their stated proof boundary.
270
+ - Missing fidelity or composition evidence that affects the verdict produces `TEST_BLOCKED`, not a conditional pass.
258
271
 
259
272
  ## Final Verification
260
273
 
@@ -262,11 +275,13 @@ Before writing `TEST_PASS`:
262
275
 
263
276
  1. Main-Agent review converged on the exact final state.
264
277
  2. Independent review converged or was strictly and visibly downgraded under its capability contract.
265
- 3. Every required focused, module, contract/integration, applicable E2E, affected-module, and Regression Ring test passes reliably.
266
- 4. Any required project-wide regression passes.
267
- 5. No accepted correction, unresolved finding, verdict-capable scope edge, or required environment check remains.
268
- 6. No high-risk production repair awaits delta Code Review.
269
- 7. No mutation occurred after the final applicable review and execution.
278
+ 3. Every required focused, module/component, consumer/provider contract, integration, actual-composition E2E, affected-module, and Regression Ring test passes reliably.
279
+ 4. Every verdict-relevant test double has boundary-appropriate authority and fidelity proof, and every test-layer claim matches actual composition.
280
+ 5. Every verdict-capable property in removed composition has composition-preserving evidence; applicable Provider Contract Tests assert raw wire output and state-changing workflows cover the required lifecycle.
281
+ 6. Any required project-wide regression passes.
282
+ 7. No accepted correction, unresolved finding, verdict-capable scope edge, missing fidelity/composition proof, or required environment check remains.
283
+ 8. No high-risk production defect or correction remains.
284
+ 9. No mutation occurred after the final applicable review and execution.
270
285
 
271
286
  ## Terminal Results
272
287
 
@@ -276,15 +291,15 @@ Only these testing-domain outcomes are valid:
276
291
  TEST_PASS | TEST_NEEDS_FIXES | TEST_BLOCKED
277
292
  ```
278
293
 
279
- - `TEST_PASS`: final reviewed state passes every required native test and no high-risk repair awaits review.
280
- - `TEST_NEEDS_FIXES`: a known correction remains, a review/repair budget did not converge, or a completed high-risk repair requires delta Code Review.
294
+ - `TEST_PASS`: final reviewed state passes every required native test and no high-risk correction remains.
295
+ - `TEST_NEEDS_FIXES`: a known correction remains or a testing-local review/repair budget did not converge.
281
296
  - `TEST_BLOCKED`: expected truth, safe input, environment, execution reliability, external-target safety, or required review input prevents a safe verdict.
282
297
 
283
298
  No conditional pass exists.
284
299
 
285
300
  ## Terminal Report and Result
286
301
 
287
- Read `${SKILL_DIR}/references/test-report-template.md` before finalization. Write `test-report.md` and `test-result.json` together for every terminal outcome. The report must use the exact canonical `## Final Result` section and `- Result: <TEST_*>` marker from that template; do not rename it to `Terminal Result`, `Final Decision`, or another heading.
302
+ Read `${SKILL_DIR}/references/test-report-template.md` before finalization. After required input resolution, write `test-report.md` and `test-result.json` together for every terminal outcome. The report must use the exact canonical `## Final Result` section and `- Result: <TEST_*>` marker from that template; do not rename it to `Terminal Result`, `Final Decision`, or another heading.
288
303
 
289
304
  `test-result.json` is a terminal projection, not a checkpoint:
290
305
 
@@ -302,12 +317,10 @@ Read `${SKILL_DIR}/references/test-report-template.md` before finalization. Writ
302
317
  },
303
318
  "repair_rounds": 1,
304
319
  "production_changed": false,
305
- "review_required": false,
306
- "review_scope": null,
307
320
  "unresolved_items": []
308
321
  }
309
322
  ```
310
323
 
311
- Allowed `independent_review.status` values are `completed`, `downgraded`, and `not_applicable`. `completed` requires one through five responses and `final_state_rechecked=true`; `downgraded` requires zero responses, a non-empty reason, and `final_state_rechecked=false`; `not_applicable` requires zero responses, no reason, and `final_state_rechecked=false`. `review_scope` is `delta` only when `review_required=true`; otherwise it is null. The report and JSON must agree on result, review requirement, and unresolved items. If consistency cannot be established, write a truthful `TEST_BLOCKED` result rather than fabricating pass.
324
+ Allowed `independent_review.status` values are `completed`, `downgraded`, and `not_applicable`. `completed` requires one through five responses and `final_state_rechecked=true`; `downgraded` requires zero responses, a non-empty reason, and `final_state_rechecked=false`; `not_applicable` requires zero responses, no reason, and `final_state_rechecked=false`. `TEST_PASS` requires an empty `unresolved_items`; each non-pass result requires at least one exact unresolved correction or blocker. The report and JSON must agree on result, production-change diagnostics, and unresolved items. If consistency cannot be established, write a truthful `TEST_BLOCKED` result rather than fabricating pass.
312
325
 
313
- **HANDOFF:** Return the testing result plus `test-report.md` and `test-result.json` paths to the caller, then stop.
326
+ Return only the testing result, `test-report.md`/`test-result.json` paths, execution summary, repair diagnostics, and unresolved items.