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,206 @@
1
+ # Boundary Contract and Test Double Guidance
2
+
3
+ ## Purpose
4
+
5
+ Apply one contract discipline to every serialized or producer-consumer boundary, whether internal or external: browser/backend APIs, cross-module endpoints, persistence, queues, filesystems, caches, generated clients/servers, SDK providers, and any test double that replaces a producer or consumer.
6
+
7
+ Mocks are test tools, not proof of provider behavior or a deployed environment. Consumer-local types, fixtures, and mocks are expectations, not provider truth. A test cannot prove a property that depends on production composition it replaces.
8
+
9
+ ## Boundary-Specific Contract Authority
10
+
11
+ Choose the highest authority that actually defines the property at the tested boundary:
12
+
13
+ 1. confirmed specification;
14
+ 2. machine-readable wire contract, such as OpenAPI, JSON Schema, Protocol Buffers, GraphQL, or AsyncAPI;
15
+ 3. type, client, server stub, or fixture that is traceably generated from that contract;
16
+ 4. provider raw-wire contract test or explicitly authorized isolated provider observation;
17
+ 5. provider implementation, version-locked SDK behavior, and matching public official service documentation;
18
+ 6. consumer-local types, existing tests, historical fixtures, and mocks.
19
+
20
+ Lower-authority material cannot override higher-authority material. A generated artifact must retain traceable provenance. A database schema can define applicable persistence structure and constraints, but a database schema cannot independently prove network serialization. Current provider implementation is evidence, not automatic product truth when it conflicts with a higher-authority contract.
21
+
22
+ Use the current locked/provider version when behavior differs by version. Record the source path, public URL, document/version identifier, generated provenance, raw-wire test, or isolated observation used in `test-report.md`.
23
+
24
+ Never invent fields, statuses, error shapes, retry rules, pagination behavior, ordering, or timing guarantees without a traceable source. If authorities conflict and expected behavior cannot be resolved safely, return `TEST_BLOCKED`.
25
+
26
+ ## Safe Documentation Retrieval
27
+
28
+ Public official service documentation retrieval may be used only to read the minimum contract material needed for tests.
29
+
30
+ - Do not send source code, repository-private content, proprietary payloads, secrets, credentials, or user data to a public endpoint.
31
+ - Prefer a project-local or vendored source when it is authoritative.
32
+ - Distinguish official provider documentation from blogs, examples, forum answers, and third-party tutorials.
33
+ - When official sources conflict with the project's pinned generated client or schema, apply the skill's truth precedence and report the conflict.
34
+ - If the required contract cannot be established, return `TEST_BLOCKED` when it prevents a safe verdict.
35
+
36
+ ## Boundary and Test-Double Inventory
37
+
38
+ Inventory every test double that crosses or replaces a producer-consumer boundary, including mocks, fakes, fixtures, route interceptions, mock servers, containers, emulators, and isolated services. Record:
39
+
40
+ | Field | Required Content |
41
+ |---|---|
42
+ | Producer | Component that creates the value, message, file, state, or response. |
43
+ | Consumer | Component that parses, reads, maps, or acts on it. |
44
+ | Boundary type | Internal/external API, module, persistence, queue, filesystem, cache, generated client/server, or other boundary. |
45
+ | Serialization or protocol | JSON, HTTP, event/message, database encoding, file format, RPC, or other wire form. |
46
+ | Contract authority | Boundary-appropriate source and provenance from the authority order. |
47
+ | Test Double | Mock, fake, fixture, interception, server, container, emulator, or isolated service. |
48
+ | Fidelity proof | Generation, schema validation, shared raw-wire fixture, contract framework, or authorized isolated observation. |
49
+ | Composition removed | Serializer, adapter, network, provider, persistence, process, or other production component replaced. |
50
+ | Property not proven | Behavior that depends on the removed composition. |
51
+ | Composition-preserving test | Contract, integration, or Full-stack path that keeps the verdict-relevant combination real. |
52
+ | Remaining risk | Unproven behavior and its effect on the verdict. |
53
+
54
+ A boundary with no test double still records its authority and the composition-preserving test when that boundary affects the verdict.
55
+
56
+ ## Test-Double Fidelity Proof
57
+
58
+ A cross-boundary test double is fidelity-proven only when at least one of these applies:
59
+
60
+ - generated from the authoritative contract with provenance;
61
+ - validated against the authoritative schema during tests;
62
+ - shared with a provider raw-wire contract test that validates the same fixture;
63
+ - captured through an explicitly authorized isolated provider observation with source/version provenance;
64
+ - checked by the project's consumer/provider contract framework.
65
+
66
+ A consumer-authored ideal fixture without one of these proofs may support local UI or logic tests, but it does not count as provider compatibility evidence. Record its proof boundary explicitly.
67
+
68
+ ## Build the Smallest Faithful Double
69
+
70
+ Use the target project's existing fake, fixture, mock library, mock server, container, or isolated service when adequate. Model only behavior relevant to the affected module, but preserve the contract property being tested.
71
+
72
+ Applicable variants include:
73
+
74
+ - normal success;
75
+ - empty success;
76
+ - minimum, maximum, pagination, cursor, or size boundary;
77
+ - malformed or contract-invalid response;
78
+ - timeout or cancellation;
79
+ - rate limiting or quota rejection;
80
+ - authentication or authorization rejection;
81
+ - transient service failure;
82
+ - permanent service failure;
83
+ - partial response or interrupted stream;
84
+ - retry, replay, and idempotency behavior;
85
+ - transaction, constraint, rollback, or conflict behavior for stateful services.
86
+
87
+ Do not require every variant mechanically. Select variants from the actual behavior/risk model and explain material omissions.
88
+
89
+ ## Assertions
90
+
91
+ Assert the application's observable handling of the contract:
92
+
93
+ - outbound request shape, required headers or metadata, and serialization;
94
+ - response mapping, nullability, enum and format handling;
95
+ - retry count and retryable versus permanent classification;
96
+ - timeout and cancellation propagation;
97
+ - pagination and cursor behavior;
98
+ - idempotency and side-effect counts;
99
+ - state transition, rollback, cleanup, and absence of partial effects;
100
+ - consumer-visible error type or result.
101
+
102
+ A mock-success-only test is insufficient when dependency failure can change observable behavior.
103
+
104
+ ### Provider Raw-Wire Assertions
105
+
106
+ A Provider Contract Test for an HTTP response, message, event, file, cache value, or other serialized output must inspect the raw wire payload before any provider-owned model rehydrates it. Select risk-relevant assertions for:
107
+
108
+ - required, optional, omitted, `null`, empty, and zero values;
109
+ - field names, scalar types, enums, formats, timestamps, and default/omission behavior;
110
+ - status or result code, error envelope, required headers, and metadata;
111
+ - exact bytes or encoding when consumers depend on them.
112
+
113
+ Deserializing output back into the provider's own model is not sufficient because defaults and zero values can conceal missing fields, nullability changes, or serializer-tag drift.
114
+
115
+ ## Avoid Over-Mocking
116
+
117
+ Keep production composition real when that composition is the property under test. Mock at a stable external boundary rather than mocking the method being verified or every internal collaborator.
118
+
119
+ Reject a double when it:
120
+
121
+ - repeats the current implementation instead of the external contract;
122
+ - bypasses serialization, mapping, retries, or state transitions under test;
123
+ - returns impossible provider behavior;
124
+ - asserts only that a mock was called without proving the business result;
125
+ - silently drifts from the project or official contract.
126
+
127
+ Use contract/integration or isolated infrastructure tests when a mock cannot preserve the relevant transaction, protocol, or composition property.
128
+
129
+ ## Test Layer Taxonomy
130
+
131
+ Classify a test by the production composition it actually executes, not by runner or user-interface presence:
132
+
133
+ | Layer | Critical Provider Replaced? | Proof Capability |
134
+ |---|---:|---|
135
+ | Focused / Unit Test | yes | Local logic, boundaries, and deterministic errors. |
136
+ | UI Component Test | yes | Component rendering and interaction under supplied data. |
137
+ | Mock Browser Test | yes | Browser UI workflow under intercepted or fixture-backed boundaries. |
138
+ | Consumer Contract Test | contract-validated double | Consumer handling of the authoritative contract. |
139
+ | Provider Contract Test | not applicable | Provider raw wire behavior at its serialization boundary. |
140
+ | Integration Test | no for the combination under test | The named modules or infrastructure composed together. |
141
+ | Full-stack E2E | no for critical production boundaries | Complete user path across real application layers in safe isolation. |
142
+
143
+ Browser execution alone does not make a test Full-stack E2E. A browser test that intercepts a critical API is a Mock Browser Test and cannot prove browser/backend compatibility, provider serialization, persistence, or reload behavior.
144
+
145
+ ## Composition-Preserving Verdict Rule
146
+
147
+ Locate each material risk in the combination where the defect can occur. Preserve that combination for risks involving consumer/provider serialization, UI/API behavior, API/persistence behavior, generated client/server compatibility, queue producer/consumer behavior, filesystem writer/reader behavior, cache producer/consumer behavior, or transaction/lock/retry/recovery state.
148
+
149
+ Lower layers may diagnose a defect, but they cannot supply verdict evidence for a property that their doubles remove. Before `TEST_PASS`:
150
+
151
+ 1. identify every verdict-capable risk located in removed composition;
152
+ 2. require a provider contract, consumer contract plus provider raw-wire evidence, composition-preserving integration test, or Full-stack E2E path that proves the property without replacing that composition;
153
+ 3. verify the preserving test would fail while the target defect exists;
154
+ 4. record the preserving evidence and remaining risk in the report.
155
+
156
+ If required composition-preserving verification cannot run in a proven safe isolated environment, return `TEST_BLOCKED`. Do not substitute a lower-layer green result or relabel a Mock Browser Test as E2E.
157
+
158
+ ## Databases and Stateful Services
159
+
160
+ Prefer project-provided isolated infrastructure, a faithful local fake, or a disposable service. Derive structure and constraints from schemas, migrations, models, or official protocol contracts.
161
+
162
+ Any disposable resource must have:
163
+
164
+ - a unique non-production identity;
165
+ - bounded lifetime;
166
+ - deterministic setup;
167
+ - verified cleanup;
168
+ - no dependency on production credentials or data.
169
+
170
+ Test relevant constraints, transactions, rollback, concurrency, idempotency, and failure mapping. Cleanup failure that undermines reliability produces `TEST_BLOCKED`.
171
+
172
+ ## Production and Data Prohibitions
173
+
174
+ Never use:
175
+
176
+ - production credentials or tokens;
177
+ - production databases, APIs, queues, object storage, caches, or services;
178
+ - real customer or user data;
179
+ - a target whose non-production status cannot be established;
180
+ - destructive operations against external data.
181
+
182
+ Project configuration may be reused only when it demonstrably selects a safe isolated test target. If safety cannot be proven, do not connect; report the unexecuted check and return `TEST_BLOCKED` when it is necessary for the verdict.
183
+
184
+ ## Reporting
185
+
186
+ For every verdict-relevant boundary or test double, complete the Boundary and Test-Double Inventory fields. Distinguish local/unit, consumer-contract, provider-contract, integration, Mock Browser, and Full-stack evidence. State whether a composition-preserving test exists and whether any missing proof changes the verdict.
187
+
188
+ Also record:
189
+
190
+ - variants exercised;
191
+ - production resources used: `no`;
192
+ - unresolved fidelity or deployed-environment risk.
193
+
194
+ Do not claim that a local mock, fake, contract snapshot, container, isolated service, or Mock Browser Test verifies composition it replaces or a deployed production environment.
195
+
196
+ ## Generic Composition Example
197
+
198
+ For a browser reading a provider response:
199
+
200
+ 1. Treat the machine-readable wire contract as the response-shape authority.
201
+ 2. Add a Provider Contract Test that asserts the raw serialized response, including a risk-relevant omitted or null field.
202
+ 3. Validate the Consumer Contract Test fixture against the same contract or share the provider-validated fixture.
203
+ 4. Classify a route-intercepted browser flow as a Mock Browser Test; it proves UI behavior under that fixture but not live browser/provider compatibility.
204
+ 5. Add a safe integration or Full-stack E2E path that keeps browser mapping, provider serialization, and required persistence real when those components contain the verdict-capable risk.
205
+
206
+ The field names and protocol vary by project; the authority, fidelity, proof-boundary, and composition reasoning remain the same.
@@ -18,7 +18,7 @@ Main Agent builds and executes project-native tests
18
18
  → TEST_PASS | TEST_NEEDS_FIXES | TEST_BLOCKED
19
19
  ```
20
20
 
21
- Keep at most one Reviewer active for this invocation and permit at most one replacement. Prefer native continuation and never reuse a Reviewer from another lifecycle stage. A compliant replacement may continue the same shared response budget only with complete latest state, never only a conversation summary.
21
+ Keep at most one Reviewer active for this invocation and permit at most one replacement. Prefer native continuation and never reuse a Reviewer from another invocation. A compliant replacement may continue the same shared response budget only with complete latest state, never only a conversation summary.
22
22
 
23
23
  ## Host Capability Gate
24
24
 
@@ -50,7 +50,7 @@ Rules:
50
50
 
51
51
  ## Stage-Specific Review Input
52
52
 
53
- Resolve exact requirement identity from workflow state or explicit handoff on every response:
53
+ Use the exact caller-supplied testing identity on every response:
54
54
 
55
55
  ```text
56
56
  artifact_dir: [EXACT_ARTIFACT_DIR]
@@ -67,9 +67,9 @@ The Main Agent supplies:
67
67
  - exact artifact, spec, and plan paths plus current contents;
68
68
  - complete current production-and-test change;
69
69
  - affected business module, observable behaviors, applicable risks, and Regression Ring;
70
- - existing, added, and modified tests, fixtures, mocks, schemas, contracts, and selected layers;
70
+ - existing, added, and modified tests, fixtures, mocks, schemas, contracts, selected layers, and the complete boundary/test-double inventory with authority, fidelity, removed composition, proof limits, preserving evidence, and verdict impact;
71
71
  - native test commands and results executed by Main Agent;
72
- - test-stage repairs;
72
+ - testing-local repairs;
73
73
  - response number and total budget;
74
74
  - prior adjudication and actual corrections on continuation or replacement.
75
75
 
@@ -100,7 +100,7 @@ Execution boundaries:
100
100
  - Complete this review personally.
101
101
  - Do not create, schedule, resume, continue, request, or coordinate another execution unit.
102
102
  - Do not ask the Main Agent to create a helper.
103
- - Do not re-enter orchestration, delegation, another review workflow, or an equivalent process.
103
+ - Do not re-enter delegation or another review process.
104
104
  - Do not modify, create, delete, rename, stage, commit, or otherwise mutate files.
105
105
  - Do not execute shell, Git, tests, builds, network calls, external processes, or any operation that can change state.
106
106
  - Use read-only checkout access only for concrete module, caller, consumer, schema, type, configuration, fixture, test, or contract coupling.
@@ -119,13 +119,20 @@ First validate input consistency. Then review:
119
119
  - selection of focused, module, contract/integration, applicable E2E, module-regression, and Regression Ring layers;
120
120
  - assertion strength and observable effect;
121
121
  - vacuous or false-positive tests and tests that cannot fail for the intended defect;
122
- - over-mocking or removal of production composition;
123
- - mock fidelity to project or public official contracts;
122
+ - every producer-consumer boundary and test double having boundary-appropriate contract authority and fidelity proof;
123
+ - any consumer-authored ideal fixture being treated only as consumer expectation unless independently contract-validated;
124
+ - Provider Contract Tests containing raw Provider serialization evidence, including risk-relevant omitted, null, empty, zero, type, and field-name behavior;
125
+ - each Browser Test being classified from actual production composition, with intercepted critical APIs classified as Mock Browser rather than Full-stack E2E;
126
+ - no test claim exceeding the property its test double can prove and no verdict-capable composition being removed without preserving contract, integration, or Full-stack evidence;
127
+ - each relevant test being able to fail while the target defect exists;
128
+ - state-changing workflows covering commit, cancellation, failure recovery, reload or re-entry, retry/conflict/idempotency, and repeated operation semantics;
124
129
  - nondeterminism and flakiness risk;
125
130
  - native execution results matching the declared scope;
126
- - production repairs that require delta Code Review;
131
+ - production defects or attempted repairs outside the permitted testing-local repair boundary;
127
132
  - remaining risks being stated honestly.
128
133
 
134
+ Return `CORRECTION_NEEDED` when a verdict-relevant producer-consumer combination is replaced by a test double without authoritative fidelity proof and composition-preserving evidence, or when a test-layer claim exceeds the actual composition executed.
135
+
129
136
  Do not rewrite the requirement, modify code, execute tests, or perform broad exploration.
130
137
  Return exactly one result using the Reviewer Output Protocol.
131
138
  ```
@@ -159,7 +166,7 @@ All initial execution boundaries and the Reviewer Output Protocol remain mandato
159
166
 
160
167
  ## Reviewer Output Protocol
161
168
 
162
- Return exactly one form. Do not add severity, confidence, dimension, workflow routing, or acceptance fields.
169
+ Return exactly one form. Do not add severity, confidence, dimension, caller routing, or acceptance fields.
163
170
 
164
171
  ### No Correction Needed
165
172
 
@@ -262,6 +269,7 @@ Record:
262
269
  - each response number `1..5`, input identity, result, and correction count;
263
270
  - every Main-Agent adjudication and its evidence;
264
271
  - actual repair and native verification;
272
+ - boundary authority/fidelity, removed-composition, proof-limit, preserving-evidence, layer-classification, and mutation-lifecycle corrections;
265
273
  - whether the exact final state was independently rechecked;
266
274
  - capability basis, continuation mode (`native`, `replacement`, `mixed`, or `not-applicable`), and replacement count.
267
275
 
@@ -40,16 +40,16 @@ Record dynamic or unprovable coupling as a remaining edge. An edge that can chan
40
40
 
41
41
  ## Truth Precedence
42
42
 
43
- Resolve expected behavior in this order:
43
+ Resolve expected business behavior from confirmed specifications and acceptance criteria before lower-authority observations. For a producer-consumer boundary, apply the boundary-specific authority in `boundary-contract-and-test-double-guidance.md`:
44
44
 
45
45
  1. confirmed specification;
46
- 2. machine-readable contract;
47
- 3. acceptance criteria;
48
- 4. trusted existing tests;
49
- 5. callers and consumers;
50
- 6. current implementation.
46
+ 2. machine-readable wire contract;
47
+ 3. traceably generated type, client, server stub, or fixture;
48
+ 4. provider raw-wire contract evidence or authorized isolated observation;
49
+ 5. provider implementation, locked SDK behavior, and matching official documentation;
50
+ 6. trusted existing tests, callers and consumers, consumer-local types/fixtures/mocks, and other current implementation evidence.
51
51
 
52
- Do not encode a possible implementation defect as expected behavior. Conflicting higher-precedence truth that cannot be resolved produces `TEST_BLOCKED`.
52
+ Lower-authority material cannot override a higher-authority source or prove a property outside its boundary. Do not encode a possible implementation defect as expected behavior. Conflicting higher-precedence truth that cannot be resolved produces `TEST_BLOCKED`.
53
53
 
54
54
  ## Behavior Inventory
55
55
 
@@ -88,6 +88,21 @@ Cover validation, dependency, malformed-response, timeout, cancellation, cleanup
88
88
 
89
89
  Cover valid and invalid transitions, retries, repeated calls, writes, events, call counts, ordering, rollback, and cleanup.
90
90
 
91
+ For every applicable state-changing user or system workflow, model and test the complete mutation lifecycle:
92
+
93
+ 1. precondition;
94
+ 2. input or selection;
95
+ 3. explicit commit point;
96
+ 4. cancel without side effects before commit;
97
+ 5. pending and duplicate-action protection;
98
+ 6. success visibility;
99
+ 7. failure recovery and absence of partial effects;
100
+ 8. reload or re-entry, including process restart when relevant;
101
+ 9. retry, conflict, and idempotency behavior;
102
+ 10. downstream read or consumption of the committed result.
103
+
104
+ If the confirmed specification does not establish the commit point or interaction semantics, request clarification or return `TEST_BLOCKED` when the ambiguity affects the verdict. Do not infer the expected workflow from the current implementation.
105
+
91
106
  ### Permission
92
107
 
93
108
  Apply to identity, role, tenant, ownership, policy, entitlement, secret, or protected-resource behavior. Include missing/invalid identity, wrong owner or tenant, insufficient grants, and default-deny behavior.
@@ -112,20 +127,26 @@ Apply to databases, filesystems, queues, providers, clocks/randomness, cross-mod
112
127
 
113
128
  Apply when callers depend on return shape, errors, side effects, ordering, generated assets, shared types, contracts, state, or invocation conventions.
114
129
 
115
- ## Layer Selection
130
+ ## Layer Selection and Proof Capability
116
131
 
117
- Use the lowest layer that proves a property without removing relevant composition.
132
+ Use the lowest layer that proves a property without removing relevant composition. Classify tests by components actually executed:
118
133
 
119
134
  | Layer | Use For |
120
135
  |---|---|
121
- | Focused/unit | Critical pure logic, exact boundaries, deterministic errors, fast localization. |
122
- | Module/component | Public module behavior with internal collaborators composed as production uses them. |
123
- | Contract/integration | Shared protocol compatibility or isolated infrastructure that mocks cannot adequately prove. |
124
- | Code-level E2E | User-visible CLI, API, or UI composition when an applicable native harness exists. |
136
+ | Focused / Unit Test | Critical pure logic, exact boundaries, deterministic errors, and fast localization; dependencies may be replaced. |
137
+ | Module / Component Test | Public module behavior or UI component behavior under supplied dependencies. |
138
+ | UI Component Test | Rendering and interaction with provider compatibility explicitly out of scope. |
139
+ | Mock Browser Test | Browser workflow with an intercepted or fixture-backed critical boundary; not Full-stack evidence. |
140
+ | Consumer Contract Test | Consumer handling against a contract-validated test double. |
141
+ | Provider Contract Test | Provider raw wire payload at its serialization boundary. |
142
+ | Integration Test | A named module/infrastructure combination with that combination kept real. |
143
+ | Full-stack E2E | Complete user path with critical application boundaries not replaced. |
125
144
  | Affected-module regression | Every required test for the complete affected module. |
126
145
  | Regression Ring | Concrete callers, consumers, contracts, adapters, and shared state dependencies. |
127
146
 
128
- Not every behavior needs every layer. Record a concise reason for omitted higher layers, such as a pure library having no process or UI boundary.
147
+ Browser execution alone does not determine the layer. Every test claim must state the property proved and any property not proven because a test double removes relevant composition.
148
+
149
+ Not every behavior needs every layer. Record a concise reason for omitted higher layers, such as a pure library having no process or UI boundary. A missing layer blocks `TEST_PASS` only when it is needed to preserve a verdict-capable combination.
129
150
 
130
151
  ## Critical Low-Level Logic
131
152
 
@@ -182,12 +203,15 @@ Coverage is complete enough for `TEST_PASS` only when:
182
203
  1. every discoverable observable behavior is represented;
183
204
  2. every applicable risk has a credible project-native test;
184
205
  3. critical low-level logic has direct focused coverage when justified;
185
- 4. selected layers preserve the property being proved;
186
- 5. complete affected-module regression passes;
187
- 6. Regression Ring verification passes;
188
- 7. concrete unresolved coupling no longer affects the verdict;
189
- 8. Main-Agent review converges;
190
- 9. applicable independent review converges or is strictly downgraded;
191
- 10. no mutation follows final review and execution.
206
+ 4. every verdict-relevant boundary and test double has contract authority, fidelity proof, removed-composition, proof-limit, and remaining-risk analysis;
207
+ 5. selected layers preserve the property being proved and composition-preserving evidence covers every verdict-capable removed combination;
208
+ 6. provider contracts inspect risk-relevant raw wire output;
209
+ 7. applicable state-changing workflows cover commit, cancellation, failure, re-entry, and repeated-operation semantics;
210
+ 8. complete affected-module regression passes;
211
+ 9. Regression Ring verification passes;
212
+ 10. concrete unresolved coupling no longer affects the verdict;
213
+ 11. Main-Agent review converges;
214
+ 12. applicable independent review converges or is strictly downgraded;
215
+ 13. no mutation follows final review and execution.
192
216
 
193
217
  Absolute completeness cannot be guaranteed. State remaining informational risks honestly without presenting them as proven behavior.
@@ -49,7 +49,7 @@ Coverage metrics, when available: <diagnostic values or not collected>. Percenta
49
49
 
50
50
  | Path | Layer | Behaviors and Risks | Change |
51
51
  |---|---|---|---|
52
- | <path> | focused / module / contract / integration / E2E / regression | <coverage> | added / updated / existing |
52
+ | <path> | focused/unit / module/component / UI component / Mock Browser / consumer contract / provider contract / integration / Full-stack E2E / regression | <coverage and proof boundary> | added / updated / existing |
53
53
 
54
54
  - Existing native framework reused: <yes/no and framework>
55
55
  - Infrastructure changes: <none or concise list>
@@ -104,12 +104,19 @@ Coverage metrics, when available: <diagnostic values or not collected>. Percenta
104
104
  - Review scope: delta / none
105
105
  - Rationale: <contract and risk analysis>
106
106
 
107
- ## External Contracts and Mocks
107
+ ## Boundary Contracts and Test Doubles
108
108
 
109
- | Dependency | Contract Source | Test Double / Isolation | Variants | Remaining Risk |
109
+ | Boundary | Contract Authority | Fidelity Proof | Test Double | Composition Removed |
110
110
  |---|---|---|---|---|
111
- | <dependency> | <project path or public official source/version> | <mock/fake/server/container/isolated service> | <success/boundary/failure variants> | <none or risk> |
111
+ | <producer → consumer; protocol> | <boundary-appropriate source and provenance> | <generation/schema/raw-wire/shared fixture/isolated observation/contract framework> | <mock/fake/fixture/interception/server/container/service or none> | <serializer/adapter/network/provider/persistence/process or none> |
112
112
 
113
+ | Property Not Proven | Composition-Preserving Test | Evidence Classification | Remaining Risk / Verdict Impact |
114
+ |---|---|---|---|
115
+ | <property outside the double-backed proof boundary> | <provider/consumer contract, integration, Full-stack E2E, or missing> | <local / consumer contract / provider contract / integration / Mock Browser / Full-stack> | <none, informational, TEST_NEEDS_FIXES correction, or TEST_BLOCKED prerequisite> |
116
+
117
+ - Test-layer claims match actual composition: yes / no
118
+ - Every verdict-capable removed combination has preserving evidence: yes / no
119
+ - Provider raw wire asserted where serialization affects the verdict: yes / no / not-applicable
113
120
  - Production credentials or resources used: no
114
121
  - Real deployed environment validated: no
115
122
 
@@ -125,15 +132,18 @@ Render `TEST_PASS` only when:
125
132
  - mandatory Main-Agent review converged;
126
133
  - independent review converged or was visibly downgraded under its strict capability gate;
127
134
  - all required native tests pass on the exact final state;
135
+ - every verdict-relevant test double has boundary-specific authority and fidelity proof;
136
+ - every verdict-capable property removed by a double has composition-preserving evidence, and every layer claim matches actual composition;
137
+ - applicable provider contract tests assert risk-relevant raw wire payload and state-changing workflows cover commit, cancellation, failure, re-entry, and repeated-operation semantics;
128
138
  - no accepted or unresolved finding remains;
129
- - no high-risk production repair awaits delta Code Review;
139
+ - no high-risk production defect or correction remains;
130
140
  - no mutation occurred after final applicable review and execution.
131
141
 
132
- Render `TEST_NEEDS_FIXES` for a known remaining correction, exhausted review/repair budget with known work, or a completed high-risk repair requiring delta Code Review.
142
+ Render `TEST_NEEDS_FIXES` for a known remaining correction, an exhausted testing-local review/repair budget with known work, or a proven high-risk production defect that this invocation must not repair.
133
143
 
134
- Render `TEST_BLOCKED` when truth, required input, safe environment, execution reliability, external-target safety, or required Reviewer input prevents a safe verdict.
144
+ Render `TEST_BLOCKED` when truth, required input, safe environment, execution reliability, external-target safety, or required Reviewer input prevents a safe verdict. This includes unavailable required composition-preserving execution and unresolved contract authority or test-double fidelity that affects the verdict; lower-layer green tests cannot substitute.
135
145
 
136
- No conditional pass, commit authorization, release authorization, runtime classification, target hash, manifest, attestation, or package lifecycle belongs in the report.
146
+ No conditional pass, commit authorization, release authorization, runtime classification, target hash, manifest, attestation, or package state belongs in the report.
137
147
 
138
148
  ## Terminal Machine Projection
139
149
 
@@ -153,8 +163,6 @@ Write `test-result.json` together with the report:
153
163
  },
154
164
  "repair_rounds": 0,
155
165
  "production_changed": false,
156
- "review_required": false,
157
- "review_scope": null,
158
166
  "unresolved_items": []
159
167
  }
160
168
  ```
@@ -170,7 +178,6 @@ Constraints:
170
178
  - `downgraded` requires `responses=0`, a non-empty `downgrade_reason`, and `final_state_rechecked=false`.
171
179
  - `not_applicable` requires `responses=0`, `downgrade_reason=null`, and `final_state_rechecked=false`.
172
180
  - `independent_review.responses` is otherwise bounded from `0` through `5`.
173
- - `review_scope` is `delta` exactly when `review_required=true`; otherwise it is null.
174
- - `unresolved_items` contains concise strings and agrees with the report.
175
- - Report and JSON agree on final result and production-review requirement.
181
+ - `TEST_PASS` requires an empty `unresolved_items`; `TEST_NEEDS_FIXES` and `TEST_BLOCKED` each require at least one concise correction or blocker string, and the list agrees with the report.
182
+ - Report and JSON agree on final result and production-change diagnostics.
176
183
  - The JSON is terminal output only and is never updated as an internal checkpoint.