codex-genesis-harness 0.1.4 → 0.1.6

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 (153) hide show
  1. package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -216
  2. package/.codebase/CURRENT_STATE.md +9 -7
  3. package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -161
  4. package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -613
  5. package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -429
  6. package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -351
  7. package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -419
  8. package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -292
  9. package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -486
  10. package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -456
  11. package/.codebase/README.md +139 -139
  12. package/.codebase/RECOVERY_POINTS.md +438 -438
  13. package/.codebase/state.json +37 -0
  14. package/.codex/skills/genesis-api-sync/SKILL.md +354 -354
  15. package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -101
  16. package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -257
  17. package/.codex/skills/genesis-debug-guide/SKILL.md +479 -479
  18. package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -339
  19. package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -210
  20. package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -158
  21. package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -365
  22. package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -289
  23. package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -288
  24. package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -1003
  25. package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -359
  26. package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -312
  27. package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -382
  28. package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -851
  29. package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -491
  30. package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -187
  31. package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -297
  32. package/.codex/skills/genesis-harness/SKILL.md +1427 -1418
  33. package/.codex/skills/genesis-harness/agents/openai.yaml +7 -7
  34. package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -169
  35. package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -157
  36. package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -216
  37. package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -211
  38. package/.codex/skills/genesis-harness/references/planning-schema.md +35 -35
  39. package/.codex/skills/genesis-harness/references/quality-rubric.md +21 -21
  40. package/.codex/skills/genesis-harness/references/research-rubric.md +41 -41
  41. package/.codex/skills/genesis-harness/references/workflows.md +33 -33
  42. package/.codex/skills/genesis-harness/resources/agents-template.md +27 -27
  43. package/.codex/skills/genesis-harness/resources/api-docs-template.md +32 -32
  44. package/.codex/skills/genesis-harness/resources/architecture-template.md +30 -30
  45. package/.codex/skills/genesis-harness/resources/audit-template.md +26 -26
  46. package/.codex/skills/genesis-harness/resources/bug-template.md +34 -34
  47. package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -204
  48. package/.codex/skills/genesis-harness/resources/check-template.md +21 -21
  49. package/.codex/skills/genesis-harness/resources/conventions-template.md +42 -42
  50. package/.codex/skills/genesis-harness/resources/decision-template.md +33 -33
  51. package/.codex/skills/genesis-harness/resources/design-template.md +26 -26
  52. package/.codex/skills/genesis-harness/resources/escalation-template.md +21 -21
  53. package/.codex/skills/genesis-harness/resources/feature-template.md +49 -49
  54. package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -131
  55. package/.codex/skills/genesis-harness/resources/integrations-template.md +32 -32
  56. package/.codex/skills/genesis-harness/resources/journeys-template.md +13 -13
  57. package/.codex/skills/genesis-harness/resources/lessons-learned-template.md +12 -12
  58. package/.codex/skills/genesis-harness/resources/observability-template.md +34 -34
  59. package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -76
  60. package/.codex/skills/genesis-harness/resources/phase-template.md +34 -34
  61. package/.codex/skills/genesis-harness/resources/pitfalls-template.md +22 -22
  62. package/.codex/skills/genesis-harness/resources/planning-tree-template.md +39 -39
  63. package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -347
  64. package/.codex/skills/genesis-harness/resources/project-template.md +38 -38
  65. package/.codex/skills/genesis-harness/resources/quality-score-template.md +11 -11
  66. package/.codex/skills/genesis-harness/resources/requirements-template.md +26 -26
  67. package/.codex/skills/genesis-harness/resources/research-template.md +26 -26
  68. package/.codex/skills/genesis-harness/resources/review-template.md +22 -22
  69. package/.codex/skills/genesis-harness/resources/spec-changelog-template.md +6 -6
  70. package/.codex/skills/genesis-harness/resources/stack-template.md +33 -33
  71. package/.codex/skills/genesis-harness/resources/verification-template.md +26 -26
  72. package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +0 -0
  73. package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +0 -0
  74. package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +0 -0
  75. package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +0 -0
  76. package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +0 -0
  77. package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +0 -0
  78. package/.codex/skills/genesis-harness/scripts/compact-context.sh +0 -0
  79. package/.codex/skills/genesis-harness/scripts/create-adr.sh +0 -0
  80. package/.codex/skills/genesis-harness/scripts/create-bug.sh +0 -0
  81. package/.codex/skills/genesis-harness/scripts/create-feature.sh +0 -0
  82. package/.codex/skills/genesis-harness/scripts/detect-stack.sh +0 -0
  83. package/.codex/skills/genesis-harness/scripts/init-planning.sh +0 -0
  84. package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +0 -0
  85. package/.codex/skills/genesis-harness/scripts/offload-log.sh +0 -0
  86. package/.codex/skills/genesis-harness/scripts/run-verification.sh +0 -0
  87. package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +0 -0
  88. package/.codex/skills/genesis-harness/scripts/update-state.sh +0 -0
  89. package/.codex/skills/genesis-mvp-planning/SKILL.md +114 -0
  90. package/.codex/skills/genesis-mvp-planning/agents/openai.yaml +6 -0
  91. package/.codex/skills/genesis-mvp-planning/checklists/mvp-readiness.md +18 -0
  92. package/.codex/skills/genesis-mvp-planning/examples/5-phase-roadmap-example.md +43 -0
  93. package/.codex/skills/genesis-mvp-planning/templates/phase-1-core.md +17 -0
  94. package/.codex/skills/genesis-mvp-planning/templates/phase-2-auth.md +17 -0
  95. package/.codex/skills/genesis-mvp-planning/templates/phase-3-features.md +17 -0
  96. package/.codex/skills/genesis-mvp-planning/templates/phase-4-integrations.md +17 -0
  97. package/.codex/skills/genesis-mvp-planning/templates/phase-5-readiness.md +17 -0
  98. package/.codex/skills/genesis-new-design/agents/openai.yaml +3 -3
  99. package/.codex/skills/genesis-observability-automation/checklists/.gitkeep +0 -0
  100. package/.codex/skills/genesis-observability-automation/observability/.gitkeep +0 -0
  101. package/.codex/skills/genesis-observability-automation/playbooks/.gitkeep +0 -0
  102. package/.codex/skills/genesis-observability-automation/templates/.gitkeep +0 -0
  103. package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -653
  104. package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -274
  105. package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -220
  106. package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -253
  107. package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -472
  108. package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -494
  109. package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -303
  110. package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -420
  111. package/.codex/skills/genesis-research-first/SKILL.md +237 -237
  112. package/.codex/skills/genesis-research-first/templates/.gitkeep +0 -0
  113. package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -534
  114. package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -384
  115. package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -257
  116. package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -373
  117. package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -692
  118. package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -434
  119. package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -407
  120. package/.codex/skills/genesis-state-machine/SKILL.md +34 -0
  121. package/.codex/skills/genesis-upgrade-design/agents/openai.yaml +3 -3
  122. package/.codex/skills/spec-impact-engine/SKILL.md +504 -504
  123. package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +0 -0
  124. package/.codex-plugin/plugin.json +24 -24
  125. package/CHANGELOG.md +42 -0
  126. package/LICENSE +22 -22
  127. package/README.EN.md +784 -719
  128. package/README.VI.md +776 -712
  129. package/README.md +113 -253
  130. package/VERSION +2 -2
  131. package/bin/genesis-harness.js +90 -87
  132. package/package.json +68 -43
  133. package/scripts/README.md +342 -342
  134. package/scripts/compact-context.sh +0 -0
  135. package/scripts/contract_integrity_gate.js +83 -0
  136. package/scripts/detect-changes.sh +0 -0
  137. package/scripts/healing_telemetry.js +118 -0
  138. package/scripts/install.sh +4 -1
  139. package/scripts/offload-log.sh +0 -0
  140. package/scripts/prompt_sentinel.js +84 -0
  141. package/scripts/run-evals.sh +1 -0
  142. package/scripts/run-verify-loop.sh +11 -0
  143. package/scripts/spec_visual_sync.js +157 -0
  144. package/scripts/test_generator.js +142 -0
  145. package/scripts/transition_state.sh +67 -0
  146. package/scripts/uninstall.sh +1 -0
  147. package/scripts/validation_gates.sh +85 -0
  148. package/scripts/verify.sh +5 -0
  149. package/tests/unit/contract_integrity_gate.test.js +74 -0
  150. package/tests/unit/healing_telemetry.test.js +58 -0
  151. package/tests/unit/prompt_sentinel.test.js +50 -0
  152. package/tests/unit/spec_visual_sync.test.js +77 -0
  153. package/tests/unit/test_generator.test.js +62 -0
@@ -1,384 +1,384 @@
1
- # Phase-Specific Update Verification
2
-
3
- Verify that each phase was updated correctly after automatic propagation.
4
-
5
- ---
6
-
7
- ## Phase 2: Test Updates
8
-
9
- ### Checklist: Test Mocks Updated
10
-
11
- - [ ] Mock data file identified: `tests/fixtures/mocks/*.js`
12
- - [ ] Old mock data removed (if breaking)
13
- - [ ] New mock data structure matches API spec
14
- - [ ] All required fields in mocks
15
- - [ ] Optional fields handled correctly
16
- - [ ] Test data types match API response types
17
-
18
- **Example**:
19
- ```javascript
20
- // Before propagation
21
- const mockUser = {
22
- id: 1,
23
- name: 'John',
24
- avatar: '/avatar.png' // This was removed
25
- };
26
-
27
- // After propagation
28
- const mockUser = {
29
- id: 1,
30
- name: 'John'
31
- // avatar removed - matches new API spec
32
- };
33
- ```
34
-
35
- ### Checklist: Test Assertions Updated
36
-
37
- - [ ] Assertions check new fields (if feature change)
38
- - [ ] Assertions removed for deleted fields (if breaking)
39
- - [ ] Type assertions match new types
40
- - [ ] Optional vs required assertions correct
41
- - [ ] Test descriptions updated
42
-
43
- **Example**:
44
- ```javascript
45
- // Before
46
- expect(response.avatar).toBeDefined();
47
- expect(response.avatar).toMatch(/^\/\w+\.png$/);
48
-
49
- // After (avatar removed)
50
- expect(response).not.toHaveProperty('avatar');
51
- ```
52
-
53
- ### Checklist: Test Descriptions
54
-
55
- - [ ] Test descriptions match new spec
56
- - [ ] Comments explain new test scenarios
57
- - [ ] "What changed" explained in test comments
58
- - [ ] No outdated comments about removed fields
59
-
60
- ### Validation
61
-
62
- ```bash
63
- # Run Phase 2 tests
64
- npm test -- tests/
65
- # All tests passing? ✅
66
- ```
67
-
68
- ---
69
-
70
- ## Phase 3: Backend Contract Updates
71
-
72
- ### Checklist: API Contract Schema
73
-
74
- - [ ] Contract file identified: `contracts/api/response.json`
75
- - [ ] Schema matches new API spec exactly
76
- - [ ] New fields added (if feature)
77
- - [ ] Old fields removed (if breaking)
78
- - [ ] Field types correct
79
- - [ ] Required vs optional correct
80
- - [ ] Validation rules updated
81
- - [ ] Comments/descriptions updated
82
-
83
- **Example**:
84
- ```json
85
- {
86
- "type": "object",
87
- "properties": {
88
- "id": { "type": "integer" },
89
- "name": { "type": "string" },
90
- // "avatar" removed - breaking change
91
- "email": { "type": "string", "format": "email" } // new optional
92
- },
93
- "required": ["id", "name"] // avatar removed from required
94
- }
95
- ```
96
-
97
- ### Checklist: Database Schema
98
-
99
- If database schema affected:
100
- - [ ] Schema change identified in `contracts/db/schema.json`
101
- - [ ] Migration script generated (if breaking)
102
- - [ ] Backward compatibility considered (if applicable)
103
- - [ ] Indexes updated (if necessary)
104
- - [ ] Rollback procedure documented
105
-
106
- ### Checklist: Implementation Docstring
107
-
108
- - [ ] Handler docstring updated with new parameters
109
- - [ ] Response structure documented correctly
110
- - [ ] Breaking changes noted in docstring
111
- - [ ] Migration path mentioned (if breaking)
112
-
113
- **Example**:
114
- ```javascript
115
- /**
116
- * GET /api/users/:id
117
- *
118
- * Returns user data (v2 format).
119
- *
120
- * BREAKING CHANGE (v2): Field 'avatar' removed. Use 'avatarUrl' instead.
121
- * Migration: https://docs.example.com/migration-v1-to-v2
122
- *
123
- * Response: { id, name, avatarUrl?, email? }
124
- */
125
- handler.get('/users/:id', (req, res) => { ... });
126
- ```
127
-
128
- ### Validation
129
-
130
- ```bash
131
- # Validate API contract
132
- npm run validate:contracts
133
-
134
- # Type check
135
- npm run tsc --noEmit
136
-
137
- # All valid? ✅
138
- ```
139
-
140
- ---
141
-
142
- ## Phase 4: Client SDK Updates
143
-
144
- ### Checklist: Type Definitions
145
-
146
- - [ ] Type file identified: `types/api.ts`
147
- - [ ] Interface definition matches API contract
148
- - [ ] New fields added with correct types (if feature)
149
- - [ ] Old fields removed (if breaking)
150
- - [ ] Optional vs required correct
151
- - [ ] Union types updated if applicable
152
-
153
- **Example**:
154
- ```typescript
155
- // Before
156
- interface User {
157
- id: number;
158
- name: string;
159
- avatar: string;
160
- }
161
-
162
- // After
163
- interface User {
164
- id: number;
165
- name: string;
166
- avatarUrl?: string; // Optional, new field
167
- email?: string; // Optional, new field
168
- // avatar removed
169
- }
170
- ```
171
-
172
- ### Checklist: Client Methods
173
-
174
- - [ ] Client method signatures updated (if breaking)
175
- - [ ] Return types match new API contract
176
- - [ ] Parameter types updated
177
- - [ ] Optional parameters marked correctly
178
-
179
- **Example**:
180
- ```typescript
181
- // Before
182
- fetchUser(id: number): Promise<User & { avatar: string }> { ... }
183
-
184
- // After
185
- fetchUser(id: number): Promise<User> { ... }
186
- // avatar removed from return type
187
- ```
188
-
189
- ### Checklist: Serialization/Deserialization
190
-
191
- - [ ] Serialization logic updated (request → API)
192
- - [ ] Deserialization logic updated (API → client)
193
- - [ ] Field mapping updated if breaking
194
- - [ ] Type casting correct
195
-
196
- ### Checklist: Deprecation Warnings (BREAKING ONLY)
197
-
198
- - [ ] Deprecation notice added to affected methods
199
- - [ ] Migration path documented
200
- - [ ] Timeline for removal specified
201
- - [ ] Alternative methods suggested
202
-
203
- **Example**:
204
- ```typescript
205
- /**
206
- * @deprecated Use fetchUser() instead, avatar field removed in v2
207
- * Migration: https://docs.example.com/migration-v1-to-v2
208
- * Removal date: 2026-12-31
209
- */
210
- fetchUserWithAvatar(id: number): Promise<User> { ... }
211
- ```
212
-
213
- ### Validation
214
-
215
- ```bash
216
- # Type check
217
- npm run tsc --noEmit
218
-
219
- # Any type errors? ❌
220
- # All types valid? ✅
221
- ```
222
-
223
- ---
224
-
225
- ## Phase 5: E2E Test Updates
226
-
227
- ### Checklist: Scenario Files
228
-
229
- - [ ] Scenario file identified: `playwright/e2e/scenarios.md`
230
- - [ ] New scenarios added for new fields (if feature)
231
- - [ ] Old scenarios removed or updated (if breaking)
232
- - [ ] Scenarios reference correct Phase 4 SDK methods
233
- - [ ] Test data matches updated spec
234
-
235
- **Example**:
236
- ```markdown
237
- ## Create User with Email
238
-
239
- - Input: { name: "John", email: "john@example.com" }
240
- - Expected: User created with email field
241
- - ❌ Removed: "Create User with Avatar" (avatar removed in v2)
242
- ```
243
-
244
- ### Checklist: E2E Assertions
245
-
246
- - [ ] Assertions check new fields (if feature)
247
- - [ ] Assertions removed for deleted fields (if breaking)
248
- - [ ] Assertions match new API response structure
249
- - [ ] Element selectors still valid (if UI affected)
250
-
251
- **Example**:
252
- ```javascript
253
- // Before
254
- page.locator('[data-test="user-avatar"]').isVisible()
255
-
256
- // After (avatar removed from UI)
257
- page.locator('[data-test="user-avatar"]').isHidden()
258
- // OR removed entirely if no UI replacement
259
- ```
260
-
261
- ### Checklist: Test Data
262
-
263
- - [ ] Test data fixtures match new API spec
264
- - [ ] Mock responses updated if needed
265
- - [ ] Page objects reference updated fields
266
- - [ ] Helper functions updated
267
-
268
- ### Checklist: Page Objects
269
-
270
- - [ ] Page object selectors match updated UI
271
- - [ ] Methods return correct data types
272
- - [ ] No references to removed fields
273
-
274
- ### Validation
275
-
276
- ```bash
277
- # Run E2E tests (subset to verify updates)
278
- npm run test:e2e -- --grep "User"
279
-
280
- # All E2E tests passing? ✅
281
- ```
282
-
283
- ---
284
-
285
- ## Cross-Phase Consistency Check
286
-
287
- After all phases updated, verify they're still aligned.
288
-
289
- ### Type System Alignment
290
-
291
- - [ ] Phase 3 API contract types ⊂ Phase 4 SDK types?
292
- - [ ] Phase 2 test data types match Phase 3 API response?
293
- - [ ] Phase 5 test data types match Phase 4 SDK input?
294
-
295
- **Check**: Types shouldn't require conversion between phases
296
-
297
- ### Data Flow Alignment
298
-
299
- ```
300
- Phase 2: Mock data
301
- ↓ (matches)
302
- Phase 3: API response schema
303
- ↓ (matches)
304
- Phase 4: Client type definitions
305
- ↓ (matches)
306
- Phase 5: E2E test expectations
307
- ```
308
-
309
- - [ ] Mock → API Contract: Same fields & types
310
- - [ ] API Contract → Client Types: Same structure
311
- - [ ] Client Types → E2E Tests: Same data
312
-
313
- ### Method Call Alignment
314
-
315
- - [ ] Phase 5 E2E calls Phase 4 methods correctly
316
- - [ ] Phase 4 SDK methods call Phase 3 endpoints correctly
317
- - [ ] Phase 2 tests verify same behavior as Phase 3
318
-
319
- ### Validation
320
-
321
- ```bash
322
- # Run all tests together
323
- npm run test:full
324
-
325
- # No integration errors? ✅
326
- # No type mismatches? ✅
327
- ```
328
-
329
- ---
330
-
331
- ## Conflict Resolution
332
-
333
- If any phase is out of sync with others, document the conflict.
334
-
335
- ### Conflict Recording
336
-
337
- Create `CONFLICT_LOG.md` entry:
338
-
339
- ```markdown
340
- ## Conflict: Phase 3 ↔ Phase 4 Type Mismatch
341
-
342
- **Date**: 2026-05-31
343
- **Severity**: HIGH
344
- **Change**: API response removed 'avatar' field
345
-
346
- **Conflict Details**:
347
- - Phase 3 API contract: { id, name, email } ✓
348
- - Phase 4 SDK types: { id, name, avatar, email } ✗
349
- - Mismatch: avatar field in SDK but not in API
350
-
351
- **Resolution**:
352
- 1. Remove avatar from Phase 4 types
353
- 2. Add deprecation warning
354
- 3. Re-run validation
355
-
356
- **Status**: RESOLVED
357
- ```
358
-
359
- ### Manual Intervention
360
-
361
- If conflicts found:
362
- 1. **Identify**: Which phases are misaligned?
363
- 2. **Cause**: Why did propagation miss this?
364
- 3. **Fix**: Manual update to misaligned phase
365
- 4. **Document**: Add to CONFLICT_LOG.md
366
- 5. **Re-validate**: Run tests again
367
- 6. **Improve**: Update patterns to prevent recurrence
368
-
369
- ---
370
-
371
- ## Sign-Off Checklist
372
-
373
- Once all updates complete and validated:
374
-
375
- - [ ] Phase 2 tests: All green ✅
376
- - [ ] Phase 3 contract: Valid & aligned ✅
377
- - [ ] Phase 4 SDK: Types correct & synchronized ✅
378
- - [ ] Phase 5 E2E: Tests pass & scenarios updated ✅
379
- - [ ] Cross-phase consistency: Verified ✅
380
- - [ ] No conflicts: All aligned ✅
381
- - [ ] Migration guide: Complete (if breaking) ✅
382
- - [ ] SPEC_CHANGELOG.md: Entry added ✅
383
- - [ ] Ready for commit ✅
384
-
1
+ # Phase-Specific Update Verification
2
+
3
+ Verify that each phase was updated correctly after automatic propagation.
4
+
5
+ ---
6
+
7
+ ## Phase 2: Test Updates
8
+
9
+ ### Checklist: Test Mocks Updated
10
+
11
+ - [ ] Mock data file identified: `tests/fixtures/mocks/*.js`
12
+ - [ ] Old mock data removed (if breaking)
13
+ - [ ] New mock data structure matches API spec
14
+ - [ ] All required fields in mocks
15
+ - [ ] Optional fields handled correctly
16
+ - [ ] Test data types match API response types
17
+
18
+ **Example**:
19
+ ```javascript
20
+ // Before propagation
21
+ const mockUser = {
22
+ id: 1,
23
+ name: 'John',
24
+ avatar: '/avatar.png' // This was removed
25
+ };
26
+
27
+ // After propagation
28
+ const mockUser = {
29
+ id: 1,
30
+ name: 'John'
31
+ // avatar removed - matches new API spec
32
+ };
33
+ ```
34
+
35
+ ### Checklist: Test Assertions Updated
36
+
37
+ - [ ] Assertions check new fields (if feature change)
38
+ - [ ] Assertions removed for deleted fields (if breaking)
39
+ - [ ] Type assertions match new types
40
+ - [ ] Optional vs required assertions correct
41
+ - [ ] Test descriptions updated
42
+
43
+ **Example**:
44
+ ```javascript
45
+ // Before
46
+ expect(response.avatar).toBeDefined();
47
+ expect(response.avatar).toMatch(/^\/\w+\.png$/);
48
+
49
+ // After (avatar removed)
50
+ expect(response).not.toHaveProperty('avatar');
51
+ ```
52
+
53
+ ### Checklist: Test Descriptions
54
+
55
+ - [ ] Test descriptions match new spec
56
+ - [ ] Comments explain new test scenarios
57
+ - [ ] "What changed" explained in test comments
58
+ - [ ] No outdated comments about removed fields
59
+
60
+ ### Validation
61
+
62
+ ```bash
63
+ # Run Phase 2 tests
64
+ npm test -- tests/
65
+ # All tests passing? ✅
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Phase 3: Backend Contract Updates
71
+
72
+ ### Checklist: API Contract Schema
73
+
74
+ - [ ] Contract file identified: `contracts/api/response.json`
75
+ - [ ] Schema matches new API spec exactly
76
+ - [ ] New fields added (if feature)
77
+ - [ ] Old fields removed (if breaking)
78
+ - [ ] Field types correct
79
+ - [ ] Required vs optional correct
80
+ - [ ] Validation rules updated
81
+ - [ ] Comments/descriptions updated
82
+
83
+ **Example**:
84
+ ```json
85
+ {
86
+ "type": "object",
87
+ "properties": {
88
+ "id": { "type": "integer" },
89
+ "name": { "type": "string" },
90
+ // "avatar" removed - breaking change
91
+ "email": { "type": "string", "format": "email" } // new optional
92
+ },
93
+ "required": ["id", "name"] // avatar removed from required
94
+ }
95
+ ```
96
+
97
+ ### Checklist: Database Schema
98
+
99
+ If database schema affected:
100
+ - [ ] Schema change identified in `contracts/db/schema.json`
101
+ - [ ] Migration script generated (if breaking)
102
+ - [ ] Backward compatibility considered (if applicable)
103
+ - [ ] Indexes updated (if necessary)
104
+ - [ ] Rollback procedure documented
105
+
106
+ ### Checklist: Implementation Docstring
107
+
108
+ - [ ] Handler docstring updated with new parameters
109
+ - [ ] Response structure documented correctly
110
+ - [ ] Breaking changes noted in docstring
111
+ - [ ] Migration path mentioned (if breaking)
112
+
113
+ **Example**:
114
+ ```javascript
115
+ /**
116
+ * GET /api/users/:id
117
+ *
118
+ * Returns user data (v2 format).
119
+ *
120
+ * BREAKING CHANGE (v2): Field 'avatar' removed. Use 'avatarUrl' instead.
121
+ * Migration: https://docs.example.com/migration-v1-to-v2
122
+ *
123
+ * Response: { id, name, avatarUrl?, email? }
124
+ */
125
+ handler.get('/users/:id', (req, res) => { ... });
126
+ ```
127
+
128
+ ### Validation
129
+
130
+ ```bash
131
+ # Validate API contract
132
+ npm run validate:contracts
133
+
134
+ # Type check
135
+ npm run tsc --noEmit
136
+
137
+ # All valid? ✅
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Phase 4: Client SDK Updates
143
+
144
+ ### Checklist: Type Definitions
145
+
146
+ - [ ] Type file identified: `types/api.ts`
147
+ - [ ] Interface definition matches API contract
148
+ - [ ] New fields added with correct types (if feature)
149
+ - [ ] Old fields removed (if breaking)
150
+ - [ ] Optional vs required correct
151
+ - [ ] Union types updated if applicable
152
+
153
+ **Example**:
154
+ ```typescript
155
+ // Before
156
+ interface User {
157
+ id: number;
158
+ name: string;
159
+ avatar: string;
160
+ }
161
+
162
+ // After
163
+ interface User {
164
+ id: number;
165
+ name: string;
166
+ avatarUrl?: string; // Optional, new field
167
+ email?: string; // Optional, new field
168
+ // avatar removed
169
+ }
170
+ ```
171
+
172
+ ### Checklist: Client Methods
173
+
174
+ - [ ] Client method signatures updated (if breaking)
175
+ - [ ] Return types match new API contract
176
+ - [ ] Parameter types updated
177
+ - [ ] Optional parameters marked correctly
178
+
179
+ **Example**:
180
+ ```typescript
181
+ // Before
182
+ fetchUser(id: number): Promise<User & { avatar: string }> { ... }
183
+
184
+ // After
185
+ fetchUser(id: number): Promise<User> { ... }
186
+ // avatar removed from return type
187
+ ```
188
+
189
+ ### Checklist: Serialization/Deserialization
190
+
191
+ - [ ] Serialization logic updated (request → API)
192
+ - [ ] Deserialization logic updated (API → client)
193
+ - [ ] Field mapping updated if breaking
194
+ - [ ] Type casting correct
195
+
196
+ ### Checklist: Deprecation Warnings (BREAKING ONLY)
197
+
198
+ - [ ] Deprecation notice added to affected methods
199
+ - [ ] Migration path documented
200
+ - [ ] Timeline for removal specified
201
+ - [ ] Alternative methods suggested
202
+
203
+ **Example**:
204
+ ```typescript
205
+ /**
206
+ * @deprecated Use fetchUser() instead, avatar field removed in v2
207
+ * Migration: https://docs.example.com/migration-v1-to-v2
208
+ * Removal date: 2026-12-31
209
+ */
210
+ fetchUserWithAvatar(id: number): Promise<User> { ... }
211
+ ```
212
+
213
+ ### Validation
214
+
215
+ ```bash
216
+ # Type check
217
+ npm run tsc --noEmit
218
+
219
+ # Any type errors? ❌
220
+ # All types valid? ✅
221
+ ```
222
+
223
+ ---
224
+
225
+ ## Phase 5: E2E Test Updates
226
+
227
+ ### Checklist: Scenario Files
228
+
229
+ - [ ] Scenario file identified: `playwright/e2e/scenarios.md`
230
+ - [ ] New scenarios added for new fields (if feature)
231
+ - [ ] Old scenarios removed or updated (if breaking)
232
+ - [ ] Scenarios reference correct Phase 4 SDK methods
233
+ - [ ] Test data matches updated spec
234
+
235
+ **Example**:
236
+ ```markdown
237
+ ## Create User with Email
238
+
239
+ - Input: { name: "John", email: "john@example.com" }
240
+ - Expected: User created with email field
241
+ - ❌ Removed: "Create User with Avatar" (avatar removed in v2)
242
+ ```
243
+
244
+ ### Checklist: E2E Assertions
245
+
246
+ - [ ] Assertions check new fields (if feature)
247
+ - [ ] Assertions removed for deleted fields (if breaking)
248
+ - [ ] Assertions match new API response structure
249
+ - [ ] Element selectors still valid (if UI affected)
250
+
251
+ **Example**:
252
+ ```javascript
253
+ // Before
254
+ page.locator('[data-test="user-avatar"]').isVisible()
255
+
256
+ // After (avatar removed from UI)
257
+ page.locator('[data-test="user-avatar"]').isHidden()
258
+ // OR removed entirely if no UI replacement
259
+ ```
260
+
261
+ ### Checklist: Test Data
262
+
263
+ - [ ] Test data fixtures match new API spec
264
+ - [ ] Mock responses updated if needed
265
+ - [ ] Page objects reference updated fields
266
+ - [ ] Helper functions updated
267
+
268
+ ### Checklist: Page Objects
269
+
270
+ - [ ] Page object selectors match updated UI
271
+ - [ ] Methods return correct data types
272
+ - [ ] No references to removed fields
273
+
274
+ ### Validation
275
+
276
+ ```bash
277
+ # Run E2E tests (subset to verify updates)
278
+ npm run test:e2e -- --grep "User"
279
+
280
+ # All E2E tests passing? ✅
281
+ ```
282
+
283
+ ---
284
+
285
+ ## Cross-Phase Consistency Check
286
+
287
+ After all phases updated, verify they're still aligned.
288
+
289
+ ### Type System Alignment
290
+
291
+ - [ ] Phase 3 API contract types ⊂ Phase 4 SDK types?
292
+ - [ ] Phase 2 test data types match Phase 3 API response?
293
+ - [ ] Phase 5 test data types match Phase 4 SDK input?
294
+
295
+ **Check**: Types shouldn't require conversion between phases
296
+
297
+ ### Data Flow Alignment
298
+
299
+ ```
300
+ Phase 2: Mock data
301
+ ↓ (matches)
302
+ Phase 3: API response schema
303
+ ↓ (matches)
304
+ Phase 4: Client type definitions
305
+ ↓ (matches)
306
+ Phase 5: E2E test expectations
307
+ ```
308
+
309
+ - [ ] Mock → API Contract: Same fields & types
310
+ - [ ] API Contract → Client Types: Same structure
311
+ - [ ] Client Types → E2E Tests: Same data
312
+
313
+ ### Method Call Alignment
314
+
315
+ - [ ] Phase 5 E2E calls Phase 4 methods correctly
316
+ - [ ] Phase 4 SDK methods call Phase 3 endpoints correctly
317
+ - [ ] Phase 2 tests verify same behavior as Phase 3
318
+
319
+ ### Validation
320
+
321
+ ```bash
322
+ # Run all tests together
323
+ npm run test:full
324
+
325
+ # No integration errors? ✅
326
+ # No type mismatches? ✅
327
+ ```
328
+
329
+ ---
330
+
331
+ ## Conflict Resolution
332
+
333
+ If any phase is out of sync with others, document the conflict.
334
+
335
+ ### Conflict Recording
336
+
337
+ Create `CONFLICT_LOG.md` entry:
338
+
339
+ ```markdown
340
+ ## Conflict: Phase 3 ↔ Phase 4 Type Mismatch
341
+
342
+ **Date**: 2026-05-31
343
+ **Severity**: HIGH
344
+ **Change**: API response removed 'avatar' field
345
+
346
+ **Conflict Details**:
347
+ - Phase 3 API contract: { id, name, email } ✓
348
+ - Phase 4 SDK types: { id, name, avatar, email } ✗
349
+ - Mismatch: avatar field in SDK but not in API
350
+
351
+ **Resolution**:
352
+ 1. Remove avatar from Phase 4 types
353
+ 2. Add deprecation warning
354
+ 3. Re-run validation
355
+
356
+ **Status**: RESOLVED
357
+ ```
358
+
359
+ ### Manual Intervention
360
+
361
+ If conflicts found:
362
+ 1. **Identify**: Which phases are misaligned?
363
+ 2. **Cause**: Why did propagation miss this?
364
+ 3. **Fix**: Manual update to misaligned phase
365
+ 4. **Document**: Add to CONFLICT_LOG.md
366
+ 5. **Re-validate**: Run tests again
367
+ 6. **Improve**: Update patterns to prevent recurrence
368
+
369
+ ---
370
+
371
+ ## Sign-Off Checklist
372
+
373
+ Once all updates complete and validated:
374
+
375
+ - [ ] Phase 2 tests: All green ✅
376
+ - [ ] Phase 3 contract: Valid & aligned ✅
377
+ - [ ] Phase 4 SDK: Types correct & synchronized ✅
378
+ - [ ] Phase 5 E2E: Tests pass & scenarios updated ✅
379
+ - [ ] Cross-phase consistency: Verified ✅
380
+ - [ ] No conflicts: All aligned ✅
381
+ - [ ] Migration guide: Complete (if breaking) ✅
382
+ - [ ] SPEC_CHANGELOG.md: Entry added ✅
383
+ - [ ] Ready for commit ✅
384
+