prizmkit 1.1.119 → 1.1.121

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 (91) hide show
  1. package/bin/create-prizmkit.js +1 -5
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/README.md +41 -38
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +76 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/config.py +2 -8
  6. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
  7. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +3 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +23 -25
  9. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +8 -2
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +10 -1
  11. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +88 -32
  12. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +28 -6
  13. package/bundled/dev-pipeline/scripts/continuation.py +51 -6
  14. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +60 -102
  15. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -19
  16. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -19
  17. package/bundled/dev-pipeline/scripts/{init-dev-team.py → init-change-artifact.py} +6 -16
  18. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +364 -76
  19. package/bundled/dev-pipeline/scripts/update-bug-status.py +57 -14
  20. package/bundled/dev-pipeline/scripts/update-feature-status.py +54 -5
  21. package/bundled/dev-pipeline/scripts/update-refactor-status.py +57 -14
  22. package/bundled/dev-pipeline/scripts/utils.py +1 -1
  23. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  24. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -11
  25. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -1
  26. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  28. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -1
  30. package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +0 -2
  31. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +6 -7
  33. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +6 -7
  34. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +4 -2
  35. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
  36. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -3
  37. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +20 -0
  38. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  39. package/bundled/dev-pipeline/tests/test_auto_skip.py +5 -5
  40. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +214 -144
  41. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +25 -12
  42. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +11 -14
  43. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +235 -32
  44. package/bundled/dev-pipeline/tests/test_unified_cli.py +219 -16
  45. package/bundled/skills/_metadata.json +4 -4
  46. package/bundled/skills/app-planner/SKILL.md +2 -2
  47. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -3
  48. package/bundled/skills/prizmkit-code-review/SKILL.md +50 -47
  49. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +13 -8
  50. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +47 -33
  51. package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +90 -0
  52. package/bundled/skills/prizmkit-implement/SKILL.md +21 -1
  53. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +67 -0
  54. package/bundled/skills/prizmkit-test/SKILL.md +159 -155
  55. package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +420 -0
  56. package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +116 -0
  57. package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +112 -0
  58. package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +97 -0
  59. package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +76 -192
  60. package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +65 -0
  61. package/bundled/skills/prizmkit-test/references/evidence-protocol.md +194 -0
  62. package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +78 -0
  63. package/bundled/skills/prizmkit-test/references/examples.md +65 -108
  64. package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +10 -7
  65. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +90 -82
  66. package/bundled/skills/prizmkit-test/references/test-report-template.md +77 -98
  67. package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +97 -0
  68. package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +723 -0
  69. package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +1426 -0
  70. package/package.json +1 -1
  71. package/src/clean.js +12 -8
  72. package/src/config.js +24 -42
  73. package/src/index.js +1 -10
  74. package/src/manifest.js +3 -9
  75. package/src/metadata.js +0 -26
  76. package/src/prompts.js +0 -13
  77. package/src/scaffold.js +76 -201
  78. package/src/upgrade.js +16 -33
  79. package/bundled/adapters/claude/agent-adapter.js +0 -96
  80. package/bundled/adapters/claude/team-adapter.js +0 -183
  81. package/bundled/adapters/codebuddy/agent-adapter.js +0 -42
  82. package/bundled/adapters/codebuddy/team-adapter.js +0 -46
  83. package/bundled/adapters/codex/agent-adapter.js +0 -38
  84. package/bundled/adapters/codex/team-adapter.js +0 -37
  85. package/bundled/agents/prizm-dev-team-dev.md +0 -123
  86. package/bundled/agents/prizm-dev-team-reviewer.md +0 -113
  87. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -65
  88. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +0 -436
  89. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +0 -510
  90. package/bundled/skills/prizmkit-test/scripts/validate_boundary_report.py +0 -347
  91. package/bundled/team/prizm-dev-team.json +0 -27
@@ -0,0 +1,97 @@
1
+ {
2
+ "protocol_version": "1.0",
3
+ "records": {
4
+ "change_classification": "change-classification.json",
5
+ "scope": "scope.json",
6
+ "target_inventory": "target-inventory.json",
7
+ "environment": "environment.json",
8
+ "behavior_risk_matrix": "behavior-risk-matrix.json",
9
+ "test_plan": "test-plan.json",
10
+ "infrastructure_changes": "infrastructure-changes.json",
11
+ "differential_proof": "differential-proof.json",
12
+ "executions": "executions.json",
13
+ "verdict": "verdict.json",
14
+ "validation": "validation.json",
15
+ "source_patch": "source-change.patch",
16
+ "derived_report": "test-report.md"
17
+ },
18
+ "directories": {
19
+ "requests": "requests/",
20
+ "receipts": "receipts/",
21
+ "raw_outputs": "raw/",
22
+ "generated_test_snapshots": "generated-tests/",
23
+ "contract_snapshots": "contracts/"
24
+ },
25
+ "stage_statuses": [
26
+ {
27
+ "name": "CHANGE_CLASSIFY",
28
+ "status": "pending",
29
+ "input_sha256": "<sha256>",
30
+ "outputs": []
31
+ },
32
+ {
33
+ "name": "SCOPE_DISCOVER",
34
+ "status": "pending",
35
+ "input_sha256": "<sha256>",
36
+ "outputs": []
37
+ },
38
+ {
39
+ "name": "CONTRACT_MODEL",
40
+ "status": "pending",
41
+ "input_sha256": "<sha256>",
42
+ "outputs": []
43
+ },
44
+ {
45
+ "name": "TEST_PLAN",
46
+ "status": "pending",
47
+ "input_sha256": "<sha256>",
48
+ "outputs": []
49
+ },
50
+ {
51
+ "name": "INFRA_READY",
52
+ "status": "pending",
53
+ "input_sha256": "<sha256>",
54
+ "outputs": []
55
+ },
56
+ {
57
+ "name": "TEST_BUILD",
58
+ "status": "pending",
59
+ "input_sha256": "<sha256>",
60
+ "outputs": []
61
+ },
62
+ {
63
+ "name": "EXECUTE_PROVE",
64
+ "status": "pending",
65
+ "input_sha256": "<sha256>",
66
+ "outputs": []
67
+ },
68
+ {
69
+ "name": "EVIDENCE_PACKAGE",
70
+ "status": "pending",
71
+ "input_sha256": "<sha256>",
72
+ "outputs": []
73
+ },
74
+ {
75
+ "name": "EVIDENCE_VALIDATE",
76
+ "status": "pending",
77
+ "input_sha256": "<sha256>",
78
+ "outputs": []
79
+ }
80
+ ],
81
+ "resume": {
82
+ "last_valid_stage": null,
83
+ "current_target_hashes": {
84
+ "source": "<sha256>",
85
+ "tests": "<sha256>",
86
+ "contracts": "<sha256>",
87
+ "lockfiles": "<sha256>",
88
+ "environment": "<sha256>",
89
+ "plan": "<sha256>"
90
+ },
91
+ "preserve_prior_executions": true,
92
+ "invalidate_downstream_on_input_change": true,
93
+ "semantic_review_required": true
94
+ },
95
+ "required_notice": "Evidence contains complete project-controlled command, environment, and output values. The project owns access control, retention, and upload policy. Production credentials, production services, and destructive real-data operations are prohibited.",
96
+ "compatibility": "legacy-test-report-interface-not-supported"
97
+ }
@@ -1,220 +1,104 @@
1
- # Boundary Coverage Protocol
1
+ # Behavior-Risk Completeness Protocol
2
2
 
3
- Use this protocol during `/prizmkit-test` Phase 4 and update it during Phase 5. The goal is to prevent a common false positive: treating "there is a test for this interface" as equivalent to "this interface is safely covered." A happy path proves that the interface can work once; boundary tests prove that the interface handles realistic invalid inputs, authorization failures, ownership rules, state transitions, and dependency failures.
3
+ This protocol replaces interface-count and line-coverage completion with observable behavior/risk evidence. The authoritative matrix is `behavior-risk-matrix.json`, validated against `${SKILL_DIR}/assets/behavior-risk-matrix.schema.json`.
4
4
 
5
- ## Required Boundary Matrix
5
+ ## Affected Module Boundary
6
6
 
7
- Build this matrix before writing tests and update it after generated tests pass or produce `needs-review` findings. In `scope=this-change`, build the matrix only for interfaces/endpoints in the reviewed change artifact or changed-file set; unrelated interfaces are recorded under `Out of Scope Gaps` and do not trigger generated tests.
7
+ Use an explicit project module when available. Otherwise derive a cohesive boundary from files that jointly implement one observable responsibility. Record the boundary decision, every declared module root, and every discovered file. Every changed file must appear in inventory or an evidence-backed exclusion.
8
8
 
9
- | Module | Interface | Service Type | Happy Path | Request Validation | Auth / Permission / Ownership | Domain Invariants | Collection / Pagination | Date / Time | State Transitions | Dependency Failure | Response Contract | N/A Reasons | Final Status |
10
- |--------|-----------|--------------|------------|--------------------|-------------------------------|-------------------|-------------------------|-------------|-------------------|-------------------|-------------------|-------------|--------------|
11
- | auth | POST /auth/login | Auth / Session | covered | generated | N/A — public route | generated | N/A — no collection input | N/A — no date input | covered | skipped — password hasher not injectable | covered | ... | boundary-covered |
9
+ Inventory discovery is a guard against obvious omissions, not a deterministic proof of semantic completeness. Static patterns cannot fully resolve reflection, registration, generated code, runtime configuration, or business concepts spread across unexpected files; preserve those as model judgment or unresolved edges.
12
10
 
13
- ## Status Values
11
+ - **Primary Scope:** all observable behavior of the affected module.
12
+ - **Regression Ring:** direct callers, consumers, shared contracts, and state dependencies.
13
+ - **Unresolved Edges:** dynamic or unprovable coupling, each marked verdict-capable or informational.
14
14
 
15
- Use these values consistently:
15
+ Changed lines locate the module but do not define completeness. A verdict-capable unresolved edge prevents `TEST_PASS`.
16
16
 
17
- - `covered` — an existing test already asserts this behavior.
18
- - `generated` — this run generated a test and the test passed.
19
- - `needs-review` — a generated test is valid, but production behavior mismatched the expected contract.
20
- - `unresolved` — the test could not be made runnable after the allowed fix attempts.
21
- - `skipped` — not applicable or not practical in this run, with a concrete reason in `N/A Reasons`.
22
- - `boundary-missing` — applicable boundary exists but no test covers it yet.
17
+ ## Behavior-Risk Matrix
23
18
 
24
- ## Completion Gate
19
+ For each public observable behavior, record:
25
20
 
26
- An in-scope interface is complete only when:
21
+ | Dimension | Required Content |
22
+ |-----------|------------------|
23
+ | Public behavior | User/caller-observable capability or guarantee |
24
+ | Contract source | Specification, machine-readable contract, acceptance condition, trusted test, caller, or implementation |
25
+ | Preconditions | Required identity, state, configuration, or dependency state |
26
+ | Inputs | Valid classes, empty/null/type/format variants |
27
+ | Boundaries | Contract-defined min/max/exact transition values |
28
+ | Outputs | Values, errors, response shape, generated identifiers |
29
+ | Side effects | Writes, calls, events, files, messages, or absence of partial effects |
30
+ | State transitions | Before/after state and idempotent/retry semantics |
31
+ | Error behavior | Validation, authorization, dependency, timeout, and malformed-response outcomes |
32
+ | Risks | Functional, boundary, permission, concurrency, idempotency, time, dependency, consumer |
27
33
 
28
- 1. It has happy-path coverage when a happy path exists.
29
- 2. Every applicable boundary category is `covered`, `generated`, or `needs-review`.
30
- 3. Every non-applicable category has a concrete reason.
31
- 4. No applicable category remains `boundary-missing`.
32
- 5. The final status is one of:
33
- - `boundary-covered`
34
- - `generated-needs-review`
35
- - `skipped-with-reason`
34
+ Every risk cell is:
36
35
 
37
- If an interface has only happy-path coverage, set `Final Status` to `boundary-missing` and continue generating applicable boundary tests. Do not call the run complete while any in-scope interface is `boundary-missing` or `happy-path-only`.
36
+ - `applicable`: mapped to one or more actual test IDs and execution IDs;
37
+ - `not_applicable`: a structured decision containing behavior-specific rationale, typed evidence, considered signals, and explanations for every detected conflict;
38
+ - `unresolved`: missing truth, testability, execution, or proof.
38
39
 
39
- ## How to Decide Whether Existing Tests Count
40
+ The model decides applicability from project semantics. The validator checks the structure and obvious signal conflicts only: identity/role/tenant suggests permission risk; locks/shared mutable state/workers suggest concurrency; retry/dedup/idempotency keys suggest idempotency; timeout/TTL/expiry suggests time; clients/contracts/network/storage suggest dependency; callers/consumers/shared contracts suggest consumer risk. A detected signal does not force applicability when the structured conflict explanation and evidence establish why it is irrelevant.
40
41
 
41
- An existing test counts for a boundary category only when it:
42
+ “Covered by happy path,” “probably fine,” or bare “N/A” is invalid rationale.
42
43
 
43
- - targets the same public interface or endpoint,
44
- - creates the boundary input, state, dependency failure, or authorization context,
45
- - asserts the expected error code, exception, state change, response shape, or side effect,
46
- - verifies behavior rather than only checking that the call returned a response.
44
+ ## Truth Resolution
47
45
 
48
- Examples:
46
+ Use this precedence and record the consulted sources:
49
47
 
50
- - `POST /users/create` returns HTTP 200 with non-empty data → happy path only.
51
- - `POST /users/create` with missing email asserts `code=10001` → request validation boundary.
52
- - `POST /items/delete` with another user's item asserts forbidden/not-found code → ownership boundary.
53
- - Service create method with mocked repository failure asserts no partial side effect → dependency failure boundary.
48
+ 1. specification;
49
+ 2. machine-readable contract;
50
+ 3. acceptance condition;
51
+ 4. trusted existing test;
52
+ 5. caller/consumer;
53
+ 6. current implementation.
54
54
 
55
- ## Boundary Categories
55
+ Do not freeze a possible current implementation bug into a characterization test. Conflicting higher-precedence sources that cannot be resolved produce `TEST_BLOCKED`.
56
56
 
57
- ### Request Validation
57
+ ## Applicable Risk Guidance
58
58
 
59
- Use when the interface accepts client input or public parameters.
59
+ ### Functional and Boundary
60
60
 
61
- Generate applicable cases for:
62
- - missing required fields,
63
- - empty string / empty array / empty object,
64
- - malformed JSON or wrong content type when the framework exposes that behavior,
65
- - wrong type,
66
- - unsupported enum,
67
- - invalid numeric values: zero, negative, min/max, just above max,
68
- - invalid string format: URL, email, phone, date, timestamp, UUID/ULID, object key.
61
+ Cover typical/minimal/complex valid inputs; null/empty/wrong type; numeric/string/collection limits; malformed formats; output/error shape; every contract-relevant branch. Do not mechanically test private branches with no observable effect.
69
62
 
70
- ### Auth / Permission / Ownership
63
+ ### Permission
71
64
 
72
- Use when the interface depends on identity, roles, tenant, ownership, entitlement, or token state.
65
+ Apply for identity, role, tenant, ownership, policy, entitlement, secret, or protected-resource behavior. Include missing/invalid identity, wrong owner/tenant, insufficient grant, and default-deny behavior.
73
66
 
74
- Generate applicable cases for:
75
- - missing auth,
76
- - malformed auth header,
77
- - invalid/expired/revoked token,
78
- - authenticated user accessing another user's resource,
79
- - missing role/permission/entitlement,
80
- - default-deny when ownership cannot be proven.
67
+ ### Concurrency
81
68
 
82
- ### Domain Invariants
69
+ Apply when shared mutable state, locks, optimistic versions, duplicate workers/calls, race-prone caches, or transaction ordering can change observable results. Use deterministic coordination rather than timing sleeps.
83
70
 
84
- Use when business rules constrain combinations of fields or state.
71
+ ### Idempotency
85
72
 
86
- Generate applicable cases for:
87
- - ratios or totals that must sum to a value,
88
- - start date before end date,
89
- - calorie/weight/amount ranges,
90
- - unsupported lifecycle status,
91
- - duplicate unique identifiers,
92
- - device binding requirements,
93
- - token rotation/reuse semantics,
94
- - image quality / provider classification rules,
95
- - product-specific thresholds such as 90%-110% calorie hit boundaries.
73
+ Apply to retries, deduplication keys, create/update/delete repetition, webhook/job replay, token rotation, and state transitions. Assert both result and side-effect count.
96
74
 
97
- ### Collection / Pagination
75
+ ### Time
98
76
 
99
- Use when the interface accepts or returns lists, pages, filters, or cursors.
100
-
101
- Generate applicable cases for:
102
- - empty result,
103
- - one item,
104
- - many items,
105
- - duplicate IDs,
106
- - omitted page / page size defaults,
107
- - page 0, negative page, max page size, max + 1,
108
- - invalid filters,
109
- - nullable filters such as true/false/null,
110
- - stable ordering or total count when specified.
111
-
112
- ### Date / Time
113
-
114
- Use when the interface parses, stores, filters, expires, schedules, or compares time.
115
-
116
- Generate applicable cases for:
117
- - invalid date / timestamp format,
118
- - timezone assumptions,
119
- - inclusive vs exclusive date range boundaries,
120
- - start after end,
121
- - exact expiry instant and just before/after expiry,
122
- - today/yesterday/stale streak or schedule semantics,
123
- - leap day/month end when relevant.
124
-
125
- ### State Transitions
126
-
127
- Use when the interface creates, updates, deletes, confirms, unbinds, retries, logs out, refreshes, or changes status.
128
-
129
- Generate applicable cases for:
130
- - create then read,
131
- - update sets expected derived fields,
132
- - delete excludes from later reads,
133
- - double delete / unbind idempotency when specified,
134
- - refresh rotates token and rejects old token,
135
- - batch operation with empty list vs explicit IDs,
136
- - retry count below/at/above max,
137
- - no partial writes when one operation fails.
138
-
139
- ### Dependency Failure
140
-
141
- Use when collaborators are mockable or the test layer can safely simulate failures.
142
-
143
- Generate applicable cases for:
144
- - repository/database error,
145
- - storage/signing provider failure,
146
- - SMS/push/email provider failure,
147
- - LLM/API client error,
148
- - timeout/network failure,
149
- - malformed provider response,
150
- - ID/random/clock failure when injectable.
151
-
152
- If a dependency cannot be mocked in the current test layer, mark it `skipped` with a reason and consider a lower-level unit test where it can be mocked.
153
-
154
- ### Response Contract
155
-
156
- Use for API endpoints and public adapters.
157
-
158
- Generate applicable cases for:
159
- - unified envelope fields (`code`, `message`, `data`) or framework-specific response format,
160
- - fixed business error codes,
161
- - response field names and snake_case/camelCase contract,
162
- - omitted vs empty data shape,
163
- - generated IDs and derived fields,
164
- - side-effect visibility in response.
165
-
166
- ## Endpoint and Interface Mapping
167
-
168
- Use names, routes, methods, schemas, binding tags, repository calls, and service logic to choose categories. When names and behavior disagree, trust behavior.
169
-
170
- | Pattern | Likely Categories |
171
- |---------|-------------------|
172
- | register / signup / create user | request validation, auth/session, domain invariants, dependency failure, response contract |
173
- | login | request validation, auth/session, rate limit, token response, dependency failure |
174
- | refresh / logout | token state, rotation/revocation, idempotency, dependency failure |
175
- | get / detail | auth/ownership, not found, response contract, dependency failure |
176
- | list / search / trends | auth, filters, pagination/empty result, date range, response contract, dependency failure |
177
- | create | request validation, domain invariants, state transition, dependency failure, response contract |
178
- | update / set goal / confirm | request validation, ownership, partial update semantics, domain invariants, state transition |
179
- | delete / unbind | request validation, ownership, not found, soft delete, double operation behavior |
180
- | upload / sign url | request validation, file/storage rules, provider failure, response contract |
181
- | AI / provider / recognize | request validation, date/time, provider error mapping, quality classifications, async job state |
182
- | stats / analytics | date range, empty data, boundary thresholds, response shape, dependency failure |
183
- | achievement / streak | empty state, date continuity, threshold boundaries, state persistence |
184
-
185
- ## N/A Reason Rules
186
-
187
- A skipped category must explain why it does not apply or why it cannot be exercised at this level.
188
-
189
- Good reasons:
190
- - `N/A — public route; no authenticated principal expected`
191
- - `N/A — endpoint has no collection input or paginated response`
192
- - `N/A — dependency is not injectable at handler level; covered by service unit test`
193
- - `N/A — function is pure and has no stateful side effects`
194
- - `N/A — E2E skipped because project has no UI layer`
195
-
196
- Bad reasons:
197
- - `N/A`
198
- - `not tested`
199
- - `probably fine`
200
- - `covered by happy path`
201
-
202
- ## Report Requirements
203
-
204
- The final report must include:
205
-
206
- 1. The Boundary Matrix.
207
- 2. A Completion Gate summary:
208
- - interfaces total,
209
- - boundary-covered count,
210
- - generated-needs-review count,
211
- - skipped-with-reason count,
212
- - boundary-missing count,
213
- - happy-path-only count.
214
- 3. A clear final status:
215
- - `All tests passing and boundary coverage complete`, or
216
- - `Tests passing, but boundary coverage incomplete`, or
217
- - `Tests failing`, or
218
- - `Needs human review`.
219
-
220
- If any interface remains `boundary-missing` or `happy-path-only`, the final report must not say "ready for commit" without qualifying that boundary coverage is incomplete.
77
+ Apply to expiry, schedules, windows, date ranges, TTL, time zones, and clock-sensitive signatures. Control the clock and test exact boundary plus before/after.
78
+
79
+ ### Dependency
80
+
81
+ Apply to databases, filesystems, queues, providers, clocks/randomness, cross-module adapters, and network clients. Use contract-driven doubles and assert failure mapping, no partial side effects, retry bounds, and cleanup.
82
+
83
+ ### Consumer
84
+
85
+ Apply when callers depend on return shape, errors, side effects, ordering, generated assets, shared types/contracts, state, or invocation conventions. Regression Ring executions prove these assumptions.
86
+
87
+ ## Completion Rule
88
+
89
+ The affected module is complete only when:
90
+
91
+ 1. every observable behavior is represented;
92
+ 2. every applicable risk has tests and reliable execution evidence;
93
+ 3. every N/A cell has a concrete rationale;
94
+ 4. every necessary new/changed test has differential proof;
95
+ 5. complete affected-module regression passes;
96
+ 6. Regression Ring verification passes;
97
+ 7. no verdict-capable unresolved edge remains;
98
+ 8. cleanup and deterministic package validation succeed.
99
+
100
+ Line, branch, and function coverage are diagnostic signals for possible omitted behavior. They never substitute for matrix evidence and no mechanical threshold is required.
101
+
102
+ ## Derived Markdown
103
+
104
+ `test-report.md` may render a compact matrix summary, but it is not authoritative. The JSON matrix and hashed test/execution records control the verdict. Editing the report or any linked artifact without regenerating hashes must fail deterministic validation.
@@ -0,0 +1,65 @@
1
+ # Contract-Driven Mock Protocol
2
+
3
+ Use this protocol for external databases, queues, filesystems, SaaS APIs, browser-facing backends, generated clients, and cross-module endpoints. Code-level evidence is mock-first; linking a real test database or deployed environment is outside `/prizmkit-test`.
4
+
5
+ ## Contract Source Precedence
6
+
7
+ Use the highest available source:
8
+
9
+ 1. Shared machine-readable contract used by producer and consumer: OpenAPI, JSON Schema, Protocol Buffers, GraphQL schema, database schema, AsyncAPI, shared language types, or generated client model.
10
+ 2. Versioned contract fixture already stored by the target project.
11
+ 3. Locally derived contract fixture built from a named source such as public adapter types, caller expectations, migration schema, provider documentation snapshot, or captured non-production example already authorized for the project.
12
+
13
+ Never invent request/response fields independently when a shared source exists. Never derive expected behavior only from the changed implementation when a higher-precedence source disagrees.
14
+
15
+ ## Required Contract Snapshot
16
+
17
+ Copy the exact contract input into `contracts/` and record:
18
+
19
+ - contract ID and version when available;
20
+ - source path or derivation source;
21
+ - SHA-256;
22
+ - producer and consumer/module names;
23
+ - derivation command or steps;
24
+ - unsupported or ambiguous fields;
25
+ - whether it represents an external provider, local module, or persistence boundary.
26
+
27
+ If derivation is not reproducible or sources conflict, add an Unresolved Edge and issue `TEST_BLOCKED` when it can affect the verdict.
28
+
29
+ ## Building Doubles
30
+
31
+ Generate or configure fakes, mocks, fixtures, and mock servers from the contract snapshot. Verify both request and response directions where applicable:
32
+
33
+ - required/optional fields and nullability;
34
+ - field names, types, enums, formats, and bounds;
35
+ - status/error variants;
36
+ - stateful sequence or transition rules;
37
+ - pagination/cursor semantics;
38
+ - idempotency, time, and concurrency behavior;
39
+ - malformed, timeout, and dependency-failure variants.
40
+
41
+ A mock-success-only double is insufficient. Record the matrix behavior/risk cells each double supports and the tests/executions that exercised them.
42
+
43
+ ## Databases and Stateful Services
44
+
45
+ Prefer an in-memory fake or isolated disposable service only when it preserves the contract being tested. Do not point code-level tests at production or a user-linked deployed test database. For database adapters, derive the fixture from schema/migrations/shared models and test transaction, constraint, rollback, and error behavior relevant to the affected module.
46
+
47
+ Any isolated resource must have a unique identifier, bounded lifetime, and verified cleanup. Cleanup failure produces `TEST_BLOCKED`.
48
+
49
+ ## Real-Environment Separation
50
+
51
+ Every package and report must state:
52
+
53
+ - `environment_claim=mocked-code-level-only`
54
+ - Mocked code-level evidence does not verify a real deployed environment.
55
+ - Real test-environment, production, credential, network policy, data migration, and operational validation require a separate authorized process.
56
+
57
+ Reject a package that claims deployment/environment verification from contract mocks, local fakes, containers, or isolated services.
58
+
59
+ ## Prohibitions
60
+
61
+ - No production credentials, databases, queues, APIs, object storage, or real user data.
62
+ - No destructive operation against external data.
63
+ - No independently invented incompatible mock contract.
64
+ - No silent contract drift.
65
+ - No automatic upload of complete raw evidence; the project owns access, retention, and upload policy.