prizmkit 1.1.154 → 1.1.156

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 (164) 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 +75 -11
  116. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
  117. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
  118. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
  119. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
  120. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
  121. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
  122. package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
  123. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
  124. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  125. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
  126. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  127. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  128. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  129. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  130. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  131. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  132. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  133. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  134. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  135. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  136. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  137. package/bundled/templates/hooks/validate-prizm-docs.py +124 -12
  138. package/package.json +1 -1
  139. package/src/scaffold.js +33 -22
  140. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  141. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  142. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  143. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  144. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  145. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  146. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  147. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  148. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  149. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  150. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  151. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  152. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  153. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  154. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  155. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  156. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  157. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  158. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  159. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  160. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  161. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  162. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  163. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  164. 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,96 +1,153 @@
1
- # Structural Sync — Detailed Steps
1
+ # Structural Sync — Capacity-Safe 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.
7
+ Do not expand the path set through repository-wide status or diff discovery. Never run an unconditional repository-wide documentation rewrite. If the validated list is empty, structural sync is not needed.
12
8
 
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.
9
+ ## 2. Map exact changes to a bounded target set
14
10
 
15
- ## 2. Map files to modules
11
+ Read `.prizmkit/prizm-docs/root.prizm` only as the project map, then map each exact changed path through its MODULE_INDEX or MODULE_GROUPS pointer to the most specific existing documentation owner.
16
12
 
17
- Read `.prizmkit/prizm-docs/root.prizm` and map each changed file to MODULE_INDEX or MODULE_GROUPS entries.
13
+ The writable set contains only:
18
14
 
19
- If a changed source file maps to no module, evaluate whether its directory qualifies as a new module:
15
+ - the most specific detail targets that own eligible changed paths;
16
+ - their necessary direct parent summary or pointer at each affected level;
17
+ - a new detail target only when the eligible source change proves meaningful durable behavior and deterministic identity;
18
+ - root only when module structure or its resolving module/group pointer changes.
20
19
 
21
- - Contains source files forming a logical unit
22
- - Contains entry/config/interface files
23
- - Contains qualifying submodules
24
- - Is referenced by multiple modules as a dependency
20
+ Affected docs may be read to reconcile current content and resolve pointers, but they cannot independently add source facts or pull sibling docs into the writable set. Do not clean unrelated targets merely because they are stale or near a limit.
25
21
 
26
- ## 3. Classify changes
22
+ If a changed source path maps to no module, evaluate only that path and narrowly required directory context to determine whether its directory is a real logical module with entry/config/interface files or cross-module dependency use. Do not perform a repository scan to manufacture a module.
27
23
 
28
- - `A` added add to KEY_FILES and check for new public interfaces
29
- - `D` deleted → remove from KEY_FILES and update file counts
30
- - `M` modified → check public interfaces, dependencies, data flow, and durable traps/decisions
31
- - `R` renamed → update path references
24
+ ## 3. Classify eligible structural changes
32
25
 
33
- ## 4. Decide whether sync is needed
26
+ - `A` added: update navigation only when the file passes the Value Gate; check source-established public/wire contracts.
27
+ - `D` deleted: remove stale owned navigation and source-invalidated knowledge.
28
+ - `M` modified: check non-obvious public/wire interfaces, dependencies, data flow, behavior, traps, rules, and decisions.
29
+ - `R` renamed: update only implicated ownership and resolving paths.
34
30
 
35
- Skip structural sync when changes are limited to:
31
+ Skip structural writes for comments, whitespace, formatting, internal implementation detail with no durable contract/behavior impact, and test-only changes that reveal no durable boundary. Do not skip a bug or test change when its exact source evidence changes durable behavior or constraints.
36
32
 
37
- - comments, whitespace, or formatting
38
- - internal implementation details with no interface, dependency, data-flow, or module mapping impact
39
- - test-only changes that reveal no durable boundaries, traps, interface constraints, behavior rules, or regression knowledge
33
+ ## 4. Select the most specific detail identity
40
34
 
41
- Do not skip automatically just because the task is a bug fix or test change. Run the relevant part of retrospective when the change affects structure, interfaces, dependencies, observable behavior, or durable knowledge.
35
+ ### Mirrored source identity
42
36
 
43
- ## 5. Update affected docs bottom-up
37
+ When identities compete, mirrored source identity takes precedence.
44
38
 
45
- ### L2
39
+ A real source submodule uses its mirrored detail path. Mirrored source identity takes precedence over a semantic concern with the same path or meaning. Update an existing mirrored detail before considering a semantic split.
46
40
 
47
- If L2 exists, update only sections affected by changed files in that module.
48
-
49
- If L2 does not exist and the current diff includes Added or Modified source files with meaningful logic, create L2 with:
41
+ A new mirrored detail uses these required sections:
50
42
 
51
43
  ```text
52
44
  MODULE
53
45
  FILES
54
46
  RESPONSIBILITY
47
+ INTERFACES
55
48
  KEY_FILES
56
49
  DEPENDENCIES
57
- INTERFACES
58
50
  TRAPS
59
51
  ```
60
52
 
61
- 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.
53
+ Add `DATA_FLOW`, `RULES`, `DECISIONS`, rejected alternatives, or domain sections only for facts that pass the Value Gate.
54
+
55
+ ### Deterministic semantic concern identity
56
+
57
+ For a flat source module, create a semantic concern detail only when current eligible source proves multiple stable product/domain behavior concerns and protected durable knowledge cannot fit one 5120B detail after safe cleanup. A semantic concern is not another documentation level.
58
+
59
+ Derive one deterministic concern slug:
60
+
61
+ 1. Choose a concise stable product/domain concern name from current source responsibility; task, change, file-count, or temporary initiative labels are invalid.
62
+ 2. Normalize the name with Unicode NFKC.
63
+ 3. Apply Unicode lowercase.
64
+ 4. Replace each maximal run of characters that is neither a Unicode letter nor a Unicode decimal digit with one ASCII hyphen.
65
+ 5. Trim leading/trailing hyphens and require one non-empty, unambiguous lowercase kebab-case result.
66
+ 6. Compare it with sibling semantic concerns, sibling `DETAILS` entries, and mirrored submodule paths. Task IDs, numeric suffixes, timestamps, and branch names are prohibited as collision workarounds.
67
+
68
+ The detail path is `.prizmkit/prizm-docs/<module>/<concern-slug>.prizm`. It has `MODULE`, `CONCERN`, `FILES`, `RESPONSIBILITY`, `INTERFACES`, `DATA_FLOW`, `KEY_FILES`, `DEPENDENCIES`, `RULES`, `TRAPS`, and `DECISIONS`; use `<SECTION>: none` rather than invented filler when a required behavioral section has no qualifying fact.
69
+
70
+ `FILES` is a non-empty exhaustive normalized source-file ownership list for the concern. Sibling semantic details require explicit non-overlapping `FILES` ownership. The direct module parent has exactly one `DETAILS` pointer:
71
+
72
+ ```text
73
+ - <concern-slug>: <concise stable behavior summary> -> .prizmkit/prizm-docs/<module>/<concern-slug>.prizm
74
+ ```
75
+
76
+ The pointer path, target `MODULE`, normalized `CONCERN` slug, and `FILES` ownership must agree. Mirrored source identity takes precedence; ambiguity, collision, or overlapping ownership blocks the split. Never add a suffix or partial semantic document to guess around it.
77
+
78
+ ## 5. Preflight every target before replacement
79
+
80
+ For each target in the bounded writable set:
81
+
82
+ 1. Read current content and resolving parent/child pointers. For an existing target, preserve its exact pre-write bytes; for a new target, record that no pre-write file exists.
83
+ 2. Measure the current target before replacement using exact raw UTF-8 bytes, never characters, lines, rounded kilobytes, or locale-dependent encoding.
84
+ 3. Establish a protected set before cleanup. It includes every still-valid public or wire contract, CRITICAL/HIGH trap, data-flow or data-integrity constraint, security/concurrency/transaction/compatibility rule, cross-module rule, non-obvious dependency, side effect, and durable decision with necessary rationale.
85
+ 4. Build the complete candidate result before replacement. Match existing and candidate facts by meaning; update the canonical entry in place, merge synonyms, remove equivalent, stale, derivable, conflicting, duplicate, or parent-copied material, and never append another version of the same knowledge.
86
+ 5. Measure the candidate as exact raw UTF-8 bytes and classify both current and candidate against the target's level.
87
+
88
+ Capacity limits and bands:
89
+
90
+ - Exact root project map: hard limit 4096B.
91
+ - Direct module index: hard limit 4096B.
92
+ - Nested mirrored or semantic detail: hard limit 5120B.
93
+ - normal: `size * 100 < limit * 80`.
94
+ - warning: `size * 100 >= limit * 80` and `size * 100 < limit * 90`.
95
+ - strong-warning: `size * 100 >= limit * 90` and `size <= limit`.
96
+ - error: `size > limit`.
97
+
98
+ When the current or candidate reaches at least 80%, perform the minimum safe cleanup or semantic split before final replacement:
99
+
100
+ 1. trim stale, source-derivable, procedural, historical, transient, and low-value wording;
101
+ 2. merge synonymous facts and remove duplicate meanings;
102
+ 3. move child-owned behavior from the root/module index into the existing or newly justified resolving detail;
103
+ 4. if one detail still cannot retain protected durable knowledge within 5120B, use the deterministic semantic split only when its stable identity and non-overlapping ownership are unambiguous.
104
+
105
+ Aim for 3277–3686B for a root/module index and 4096–4607B for a detail document, preserving approximately 10% headroom. Do not pad naturally concise output and do not trim merely to one byte below a hard limit. A post-remediation warning-range result is valid; do not force a needless split when the minimum safe cleanup establishes the target range.
106
+
107
+ Never remove protected knowledge solely to pass capacity validation. If it cannot fit after concise wording, safe movement, or an unambiguous split, do not replace that target.
108
+
109
+ ## 6. Write bottom-up
62
110
 
63
- ### L1
111
+ Prepare all candidates before the first replacement and write only after each candidate passes its local format, identity, protected-set, and capacity preflight.
64
112
 
65
- Update FILES count, KEY_FILES, SUBDIRS, and DEPENDENCIES when module-level structure changes.
113
+ 1. Create or update the most specific detail first.
114
+ 2. Re-read and validate that detail before modifying its parent.
115
+ 3. Update the direct module index only as concise summaries and resolving pointers, using `SUBDIRS` or `DETAILS` as applicable.
116
+ 4. Update the root project map last and only when module structure or its concise resolving pointer changed.
66
117
 
67
- L1 does not contain INTERFACES, DATA_FLOW, TRAPS, or DECISIONS; those belong in L2.
118
+ Complete `INTERFACES`, `DATA_FLOW`, `TRAPS`, `DECISIONS`, and full RULES owned by a child must not be copied into the module index or root project map. Parent docs retain the shortest useful summary and pointer. Preserve any root `PROJECT_BRIEF:` line because it is managed separately.
68
119
 
69
- ### L0
120
+ Before each replacement, compare candidate bytes with current bytes. A byte-identical candidate is not written, reordered, or reported as an update.
70
121
 
71
- Update MODULE_INDEX or MODULE_GROUPS only when module structure changed. Preserve any `PROJECT_BRIEF:` line because it is managed by `/prizmkit-init`.
122
+ ## 7. Re-read and validate the actual final files
72
123
 
73
- ## 6. New module handling
124
+ After every write:
74
125
 
75
- If a new directory qualifies as a module and matches no existing module:
126
+ 1. Re-read the actual bytes from disk and recompute exact raw UTF-8 size.
127
+ 2. Reapply the 4096B/4096B/5120B hard limit and 80%/90% band formulas.
128
+ 3. Validate required KEY/value format and memory hygiene.
129
+ 4. Resolve every affected `MODULE_INDEX`, `MODULE_GROUPS`, `SUBDIRS`, and `DETAILS` pointer; validate both each changed target and its affected direct parent/child.
130
+ 5. Confirm semantic `MODULE`, `CONCERN`, path, slug, and `FILES` ownership agree and do not collide or overlap.
131
+ 6. Review only the targeted documentation diff for duplicate meanings, copied child behavior, unstable reorder, and unintended paths.
76
132
 
77
- 1. Create L1 immediately.
78
- 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.
133
+ If any post-write check fails, restore every replaced target from its preserved exact pre-write bytes and remove any invalid newly created target. Re-read the restored affected set and ensure no invalid oversized final document remains. Restoration is a bounded file operation; never use Git reset, checkout, or stash.
80
134
 
81
- ## 7. Size limits
135
+ ## 8. Capacity blocker evidence
82
136
 
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
137
+ When no safe compression or stable split exists, stop with no invalid candidate left in place. The blocked result's `reason` must include:
86
138
 
87
- ## 8. TRAPS staleness check
139
+ - exact target path;
140
+ - measured current bytes and/or candidate bytes, hard limit, and band;
141
+ - protected knowledge that prevented trimming;
142
+ - why attempted cleanup, movement, or identity/ownership checks could not establish a safe split;
143
+ - a concrete recommended split boundary that a future manual decision can evaluate.
88
144
 
89
- Run only when an L2 doc's TRAPS section has more than 10 entries.
145
+ Its `validation` contains only checks actually attempted. Its `documentation_paths` follows the result schema and never invents a change. `RETRO_COMPLETE` is prohibited after any unresolved capacity, pointer, format, or restoration check.
90
146
 
91
- Process at most 5 oldest TRAPS per L2 doc:
147
+ ## 9. Bounded TRAPS staleness check
92
148
 
93
- 1. If a TRAP has `STALE_IF:` and matched files no longer exist, delete the TRAP.
94
- 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.
149
+ Run only for an affected detail target whose `TRAPS` section has more than 10 entries. Process at most five oldest traps:
95
150
 
96
- This bounds context cost and prevents unbounded trap accumulation.
151
+ 1. Delete a trap only when eligible source evidence proves it stale, including a `STALE_IF` path that no longer exists within the exact scope.
152
+ 2. If a `REF` cannot be validated from eligible evidence, retain the trap or mark it `[REVIEW]`; do not mine repository history or unrelated source to decide.
153
+ 3. Never remove a still-valid CRITICAL/HIGH trap merely for capacity.
@@ -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.