codex-genesis-harness 0.1.1 → 0.1.4
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.
- package/.codebase/ARCHITECTURE_REVIEW_COMPLETE.md +216 -0
- package/.codebase/CURRENT_STATE.md +2 -0
- package/.codebase/DOMAIN_MODELS.md +5 -3
- package/.codebase/FILE_NAMING_CLARIFICATION.md +161 -0
- package/.codebase/HARNESS_COMPLETENESS_AUDIT.md +613 -0
- package/.codebase/IMPLEMENTATION_COMPLETE.md +429 -0
- package/.codebase/IMPLEMENTATION_HANDOFF.md +351 -0
- package/.codebase/IMPROVEMENTS_SUMMARY.md +419 -0
- package/.codebase/PHASE3_SKILLS_NAMING_COMPLETE.md +292 -0
- package/.codebase/PHASE_DEPENDENCY_MAP.md +486 -0
- package/.codebase/QUICK_START_SPEC_IMPACT.md +456 -0
- package/.codebase/README.md +139 -0
- package/.codebase/RECOVERY_POINTS.md +438 -0
- package/.codex/skills/genesis-api-sync/SKILL.md +354 -0
- package/.codex/skills/genesis-api-sync/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-api-sync/checklists/api-sync-checklist.md +101 -0
- package/.codex/skills/genesis-api-sync/examples/example.md +68 -0
- package/.codex/skills/genesis-api-sync/templates/api-change-template.md +257 -0
- package/.codex/skills/genesis-debug-guide/SKILL.md +479 -0
- package/.codex/skills/genesis-debug-guide/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-debug-guide/checklists/flaky-test-investigation.md +339 -0
- package/.codex/skills/genesis-debug-guide/checklists/production-bug-debug.md +210 -0
- package/.codex/skills/genesis-debug-guide/checklists/test-failure-debug.md +158 -0
- package/.codex/skills/genesis-debug-guide/examples/example.md +48 -0
- package/.codex/skills/genesis-debug-guide/observability/debug-commands.md +365 -0
- package/.codex/skills/genesis-debug-guide/playbooks/unit-test-failures.md +289 -0
- package/.codex/skills/genesis-debug-guide/templates/debug-investigation-log.md +288 -0
- package/.codex/skills/genesis-docs-automation/SKILL.md +1003 -0
- package/.codex/skills/genesis-docs-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-docs-automation/checklists/docs-validation.md +359 -0
- package/.codex/skills/genesis-docs-automation/checklists/spec-alignment.md +312 -0
- package/.codex/skills/genesis-docs-automation/examples/example.md +59 -0
- package/.codex/skills/genesis-docs-automation/observability/docs-tracking.md +382 -0
- package/.codex/skills/genesis-docs-automation/playbooks/auto-update-flow.md +851 -0
- package/.codex/skills/genesis-docs-automation/playbooks/changelog-generation.md +491 -0
- package/.codex/skills/genesis-docs-automation/templates/changelog-entry-template.md +187 -0
- package/.codex/skills/genesis-docs-automation/templates/handoff-template.md +297 -0
- package/.codex/skills/genesis-harness/SKILL.md +734 -82
- package/.codex/skills/genesis-harness/checklists/bug-fix-qa.md +169 -0
- package/.codex/skills/genesis-harness/checklists/new-feature-qa.md +157 -0
- package/.codex/skills/genesis-harness/checklists/refactor-qa.md +216 -0
- package/.codex/skills/genesis-harness/checklists/requirements-validation.md +211 -0
- package/.codex/skills/genesis-harness/resources/change-impact-matrix-template.md +204 -0
- package/.codex/skills/genesis-harness/resources/foundation-phase-template.md +131 -0
- package/.codex/skills/genesis-harness/resources/phase-00-foundation-template.md +76 -0
- package/.codex/skills/genesis-harness/resources/post-implementation-guide.md +347 -0
- package/.codex/skills/genesis-harness/scripts/check-architecture-boundaries.sh +23 -23
- package/.codex/skills/genesis-harness/scripts/check-docs-sync.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-no-debug-logs.sh +21 -21
- package/.codex/skills/genesis-harness/scripts/check-required-planning-files.sh +46 -46
- package/.codex/skills/genesis-harness/scripts/check-spec-changelog.sh +24 -24
- package/.codex/skills/genesis-harness/scripts/check-task-tracking.sh +25 -25
- package/.codex/skills/genesis-harness/scripts/compact-context.sh +54 -0
- package/.codex/skills/genesis-harness/scripts/create-adr.sh +74 -74
- package/.codex/skills/genesis-harness/scripts/create-bug.sh +160 -160
- package/.codex/skills/genesis-harness/scripts/create-feature.sh +217 -217
- package/.codex/skills/genesis-harness/scripts/detect-stack.sh +26 -26
- package/.codex/skills/genesis-harness/scripts/init-planning.sh +750 -719
- package/.codex/skills/genesis-harness/scripts/list-changed-files.sh +12 -12
- package/.codex/skills/genesis-harness/scripts/offload-log.sh +72 -0
- package/.codex/skills/genesis-harness/scripts/run-verification.sh +47 -47
- package/.codex/skills/genesis-harness/scripts/run-verify-loop.sh +75 -0
- package/.codex/skills/genesis-harness/scripts/update-state.sh +33 -33
- package/.codex/skills/genesis-harness-engineering/SKILL.md +159 -0
- package/.codex/skills/genesis-harness-engineering/checklists/checklist.md +48 -0
- package/.codex/skills/genesis-harness-engineering/examples/example.md +57 -0
- package/.codex/skills/genesis-harness-engineering/playbooks/harness-evolution.md +99 -0
- package/.codex/skills/genesis-harness-engineering/templates/harness-change-template.md +37 -0
- package/.codex/skills/genesis-observability-automation/SKILL.md +382 -0
- package/.codex/skills/genesis-observability-automation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-observability-automation/examples/example.md +86 -0
- package/.codex/skills/genesis-performance-profiling/SKILL.md +510 -0
- package/.codex/skills/genesis-performance-profiling/agents/openai.yaml +6 -0
- package/.codex/skills/genesis-performance-profiling/checklists/optimization-verification.md +199 -0
- package/.codex/skills/genesis-performance-profiling/checklists/performance-baseline.md +183 -0
- package/.codex/skills/genesis-performance-profiling/examples/example.md +234 -0
- package/.codex/skills/genesis-performance-profiling/observability/performance-tracking.md +202 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/load-testing-orchestration.md +593 -0
- package/.codex/skills/genesis-performance-profiling/playbooks/profiling-playbook.md +601 -0
- package/.codex/skills/genesis-performance-profiling/templates/load-test-config-template.md +428 -0
- package/.codex/skills/genesis-performance-profiling/templates/performance-report-template.md +238 -0
- package/.codex/skills/genesis-release-orchestration/SKILL.md +653 -0
- package/.codex/skills/genesis-release-orchestration/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-release-orchestration/checklists/post-deployment-verification.md +274 -0
- package/.codex/skills/genesis-release-orchestration/checklists/pre-release-validation.md +220 -0
- package/.codex/skills/genesis-release-orchestration/examples/example.md +78 -0
- package/.codex/skills/genesis-release-orchestration/observability/release-tracking.md +253 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/canary-deployment-orchestration.md +472 -0
- package/.codex/skills/genesis-release-orchestration/playbooks/semantic-versioning-automation.md +494 -0
- package/.codex/skills/genesis-release-orchestration/templates/deployment-strategy-template.md +303 -0
- package/.codex/skills/genesis-release-orchestration/templates/release-runbook-template.md +420 -0
- package/.codex/skills/genesis-research-first/SKILL.md +237 -0
- package/.codex/skills/genesis-research-first/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-research-first/examples/example.md +85 -0
- package/.codex/skills/genesis-spec-propagation/SKILL.md +534 -0
- package/.codex/skills/genesis-spec-propagation/agents/openai.yaml +7 -0
- package/.codex/skills/genesis-spec-propagation/checklists/phase-update-verification.md +384 -0
- package/.codex/skills/genesis-spec-propagation/checklists/spec-change-detection.md +257 -0
- package/.codex/skills/genesis-spec-propagation/examples/example.md +63 -0
- package/.codex/skills/genesis-spec-propagation/observability/propagation-tracking.md +373 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/breaking-change-propagation.md +692 -0
- package/.codex/skills/genesis-spec-propagation/playbooks/feature-change-propagation.md +434 -0
- package/.codex/skills/genesis-spec-propagation/templates/migration-guide-template.md +407 -0
- package/.codex/skills/spec-impact-engine/SKILL.md +504 -0
- package/.codex/skills/spec-impact-engine/agents/openai.yaml +7 -0
- package/.codex/skills/spec-impact-engine/detect-spec-changes.sh +262 -0
- package/.codex/skills/spec-impact-engine/examples/example.md +98 -0
- package/.codex/skills/spec-impact-engine/templates/impact-report.md +248 -0
- package/.codex/skills/spec-impact-engine/templates/migration-guide.md +223 -0
- package/.codex-plugin/plugin.json +1 -1
- package/README.EN.md +719 -0
- package/README.VI.md +712 -0
- package/README.md +261 -107
- package/VERSION +1 -1
- package/bin/genesis-harness.js +20 -11
- package/package.json +1 -1
- package/scripts/README.md +342 -0
- package/scripts/compact-context.sh +54 -0
- package/scripts/detect-changes.sh +152 -0
- package/scripts/install.sh +50 -41
- package/scripts/offload-log.sh +72 -0
- package/scripts/run-evals.sh +70 -43
- package/scripts/run-verify-loop.sh +75 -0
- package/scripts/uninstall.sh +52 -43
- package/scripts/verify.sh +165 -73
- package/.codex/skills/harness-engineering-skill/SKILL.md +0 -45
- package/.codex/skills/harness-engineering-skill/checklists/checklist.md +0 -8
- package/.codex/skills/harness-engineering-skill/examples/example.md +0 -4
- package/.codex/skills/harness-engineering-skill/templates/harness-change-template.md +0 -8
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/SKILL.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/agents/openai.yaml +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/checklists/checklist.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/examples/example.md +0 -0
- /package/.codex/skills/{ai-provider-skill → genesis-ai-provider}/templates/provider-contract-template.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/SKILL.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/agents/openai.yaml +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/checklists/checklist.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/examples/example.md +0 -0
- /package/.codex/skills/{api-contract-skill → genesis-api-contract}/templates/api-contract-template.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/SKILL.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/agents/openai.yaml +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/checklists/checklist.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/examples/example.md +0 -0
- /package/.codex/skills/{architecture-skill → genesis-architecture}/templates/architecture-decision-template.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/SKILL.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/agents/openai.yaml +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/checklists/checklist.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/examples/example.md +0 -0
- /package/.codex/skills/{codebase-map-skill → genesis-codebase-map}/templates/map-update-template.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/SKILL.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/agents/openai.yaml +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/checklists/checklist.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/examples/example.md +0 -0
- /package/.codex/skills/{design-spec-skill → genesis-design-spec}/templates/design-spec-template.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/SKILL.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/agents/openai.yaml +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/checklists/checklist.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/examples/example.md +0 -0
- /package/.codex/skills/{docs-skill → genesis-docs}/templates/docs-update-template.md +0 -0
- /package/.codex/skills/{harness-engineering-skill → genesis-harness-engineering}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/SKILL.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/agents/openai.yaml +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/checklists/checklist.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/examples/example.md +0 -0
- /package/.codex/skills/{pipeline-orchestration-skill → genesis-pipeline-orchestration}/templates/orchestration-template.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/SKILL.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/agents/openai.yaml +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/checklists/checklist.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/examples/example.md +0 -0
- /package/.codex/skills/{planning-skill → genesis-planning}/templates/plan-template.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/SKILL.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/agents/openai.yaml +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/checklists/checklist.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/examples/example.md +0 -0
- /package/.codex/skills/{release-skill → genesis-release}/templates/release-checklist-template.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/SKILL.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/agents/openai.yaml +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/checklists/checklist.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/examples/example.md +0 -0
- /package/.codex/skills/{research-skill → genesis-research}/templates/research-note-template.md +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Docs Automation Skill"
|
|
3
|
+
short_description: "Automatically sync documentation with code changes across all phases"
|
|
4
|
+
default_prompt: "Use $genesis-docs-automation to synchronize documentation with the latest code changes."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Docs Validation Checklist
|
|
2
|
+
|
|
3
|
+
**Purpose**: Pre-update verification checklist to catch incomplete/broken documentation before processing
|
|
4
|
+
|
|
5
|
+
**When to Use**:
|
|
6
|
+
- After code changes detected
|
|
7
|
+
- Before auto-doc generation
|
|
8
|
+
- During manual `/update-docs` invocation
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 📋 Pre-Validation: Is Documentation Update Needed?
|
|
13
|
+
|
|
14
|
+
- [ ] At least one file changed in Phase 1-5 (contract/backend/SDK/test)?
|
|
15
|
+
- [ ] Tests passing? (Required for auto-trigger)
|
|
16
|
+
- [ ] Changed files are tracked in Git? (No local-only changes)
|
|
17
|
+
- [ ] Changes are committed/staged (not just pending)?
|
|
18
|
+
|
|
19
|
+
**If any unchecked**: Stop here, resolve first, then re-run
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🔍 Phase 1: Contract Change Detection
|
|
24
|
+
|
|
25
|
+
### If API Contract Changed (contracts/api/*/request.json or response.json)
|
|
26
|
+
|
|
27
|
+
**Contract Validation**:
|
|
28
|
+
- [ ] request.json has valid JSON schema
|
|
29
|
+
- [ ] response.json has valid JSON schema
|
|
30
|
+
- [ ] error.json has valid error code map
|
|
31
|
+
- [ ] All required fields marked as such
|
|
32
|
+
- [ ] Type definitions are precise (string vs enum, number vs range)
|
|
33
|
+
- [ ] Examples provided for each request/response type
|
|
34
|
+
|
|
35
|
+
**Doc Requirements**:
|
|
36
|
+
- [ ] API_REFERENCE.md needs update (endpoint details)
|
|
37
|
+
- [ ] SPEC_CHANGELOG.md needs entry (what changed)
|
|
38
|
+
- [ ] IMPLEMENTATION_HANDOFF.md may need update (if breaking)
|
|
39
|
+
- [ ] Examples need code samples in 2+ languages (JS, Python)
|
|
40
|
+
|
|
41
|
+
**Change Classification**:
|
|
42
|
+
|
|
43
|
+
Is this a BREAKING change?
|
|
44
|
+
- [ ] Removed required field? **YES** → BREAKING
|
|
45
|
+
- [ ] Changed field type? (e.g., string → number) **YES** → BREAKING
|
|
46
|
+
- [ ] Changed response structure? **YES** → BREAKING
|
|
47
|
+
- [ ] Changed endpoint URL? **YES** → BREAKING
|
|
48
|
+
- [ ] Changed error codes? **YES** → BREAKING
|
|
49
|
+
|
|
50
|
+
If ANY yes: **MARK AS BREAKING** (requires manual review gate)
|
|
51
|
+
|
|
52
|
+
Is this a FEATURE change?
|
|
53
|
+
- [ ] Added new optional field? **YES** → FEATURE
|
|
54
|
+
- [ ] Added new endpoint? **YES** → FEATURE
|
|
55
|
+
- [ ] Made required field optional? **YES** → FEATURE (backward compatible)
|
|
56
|
+
- [ ] Added new error code? **YES** → FEATURE
|
|
57
|
+
|
|
58
|
+
If ANY yes: **MARK AS FEATURE** (auto-update OK, provide migration guide)
|
|
59
|
+
|
|
60
|
+
Otherwise: **MARK AS BUG_FIX or INTERNAL**
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 🔄 Phase 2: Test File Changes
|
|
65
|
+
|
|
66
|
+
### If Test Files Changed (tests/unit, tests/integration, playwright/e2e)
|
|
67
|
+
|
|
68
|
+
**Test Validation**:
|
|
69
|
+
- [ ] All tests passing (must have 0 failures)
|
|
70
|
+
- [ ] Test file has clear description of what's being tested
|
|
71
|
+
- [ ] New test cases have proper setup/teardown
|
|
72
|
+
- [ ] Mock data matches expected schema
|
|
73
|
+
- [ ] No hardcoded IDs or timestamps (use factories)
|
|
74
|
+
|
|
75
|
+
**Doc Requirements**:
|
|
76
|
+
- [ ] If new integration test: Add scenario to IMPLEMENTATION.md
|
|
77
|
+
- [ ] If new E2E test: Add user flow to docs
|
|
78
|
+
- [ ] SPEC_CHANGELOG.md: Add "Test Coverage" section if new major scenario
|
|
79
|
+
- [ ] Update test coverage % in IMPLEMENTATION_HANDOFF.md
|
|
80
|
+
|
|
81
|
+
**Test Categorization**:
|
|
82
|
+
- [ ] Unit tests: Testing individual functions
|
|
83
|
+
- [ ] Integration tests: Testing API endpoint + database
|
|
84
|
+
- [ ] E2E tests: Testing user flows across UI + API
|
|
85
|
+
- [ ] Performance tests: Testing response times
|
|
86
|
+
- [ ] Error tests: Testing error handling
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 💾 Phase 3: Backend Implementation Changes
|
|
91
|
+
|
|
92
|
+
### If Backend Files Changed (src/api/handlers, src/services, src/database)
|
|
93
|
+
|
|
94
|
+
**Code Quality**:
|
|
95
|
+
- [ ] Code has docstrings/comments explaining logic
|
|
96
|
+
- [ ] Error handling is explicit (no silent failures)
|
|
97
|
+
- [ ] Database queries are indexed (if new queries)
|
|
98
|
+
- [ ] Performance is acceptable (check test results for timing)
|
|
99
|
+
- [ ] Security implications noted (auth, validation, SQL injection)
|
|
100
|
+
|
|
101
|
+
**Doc Requirements**:
|
|
102
|
+
- [ ] API_REFERENCE.md: Updated if endpoint changed
|
|
103
|
+
- [ ] IMPLEMENTATION.md: Added key code locations
|
|
104
|
+
- [ ] ARCHITECTURE.md: Updated if data flow changed
|
|
105
|
+
- [ ] SPEC_CHANGELOG.md: Entry with implementation notes
|
|
106
|
+
- [ ] IMPLEMENTATION_HANDOFF.md: Updated with next steps
|
|
107
|
+
- [ ] Docstrings: Added/updated for public methods
|
|
108
|
+
|
|
109
|
+
**Implementation Category**:
|
|
110
|
+
- [ ] New handler: Needs full API docs + implementation guide
|
|
111
|
+
- [ ] Modified handler: Needs updated API docs + changelog
|
|
112
|
+
- [ ] New service: Needs architecture docs + implementation guide
|
|
113
|
+
- [ ] Modified service: Needs updated architecture docs
|
|
114
|
+
- [ ] Database change: Needs migration guide + schema docs
|
|
115
|
+
- [ ] Error handling: Needs error code documentation
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 📱 Phase 4: SDK/Client Changes
|
|
120
|
+
|
|
121
|
+
### If SDK Files Changed (src/client/*, src/types/*)
|
|
122
|
+
|
|
123
|
+
**Type Validation**:
|
|
124
|
+
- [ ] All TypeScript types compile without errors
|
|
125
|
+
- [ ] Type definitions match backend schema (Phase 3)
|
|
126
|
+
- [ ] No `any` types without justification
|
|
127
|
+
- [ ] Generic types properly constrained
|
|
128
|
+
- [ ] Deprecation warnings added for old methods
|
|
129
|
+
|
|
130
|
+
**Doc Requirements**:
|
|
131
|
+
- [ ] API Reference: Updated with new methods
|
|
132
|
+
- [ ] Type definitions documented with examples
|
|
133
|
+
- [ ] SPEC_CHANGELOG.md: Entry with SDK changes
|
|
134
|
+
- [ ] IMPLEMENTATION_HANDOFF.md: Updated with next phase steps
|
|
135
|
+
- [ ] Migration guide: Provided if breaking change
|
|
136
|
+
- [ ] Code examples: Added in docs for new methods
|
|
137
|
+
|
|
138
|
+
**SDK Change Type**:
|
|
139
|
+
- [ ] New method: Needs documentation + example
|
|
140
|
+
- [ ] Modified method: Needs updated documentation
|
|
141
|
+
- [ ] Deprecated method: Needs migration guide
|
|
142
|
+
- [ ] New type: Needs type reference documentation
|
|
143
|
+
- [ ] Type change: Breaking change, needs migration guide
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🎯 Phase 5: E2E Test Changes
|
|
148
|
+
|
|
149
|
+
### If E2E Test Files Changed (playwright/e2e/*.spec.ts)
|
|
150
|
+
|
|
151
|
+
**Test Scenario Validation**:
|
|
152
|
+
- [ ] Each scenario tests a complete user flow
|
|
153
|
+
- [ ] Scenarios are independent (no test ordering)
|
|
154
|
+
- [ ] Assertions match expected behavior
|
|
155
|
+
- [ ] Error scenarios included (not just happy path)
|
|
156
|
+
- [ ] Page objects used (not hardcoded selectors)
|
|
157
|
+
|
|
158
|
+
**Doc Requirements**:
|
|
159
|
+
- [ ] User flows documented in IMPLEMENTATION.md
|
|
160
|
+
- [ ] Scenario names match documentation
|
|
161
|
+
- [ ] SPEC_CHANGELOG.md: New scenarios noted
|
|
162
|
+
- [ ] IMPLEMENTATION_HANDOFF.md: Test coverage updated
|
|
163
|
+
- [ ] Examples provided for each scenario
|
|
164
|
+
|
|
165
|
+
**Scenario Classification**:
|
|
166
|
+
- [ ] Happy path: Normal user flow
|
|
167
|
+
- [ ] Error case: User makes mistake
|
|
168
|
+
- [ ] Edge case: Unusual but valid scenario
|
|
169
|
+
- [ ] Regression: Previous bug that came back
|
|
170
|
+
- [ ] Performance: Testing under load
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## ✅ Cross-Phase Consistency Check
|
|
175
|
+
|
|
176
|
+
### Contract ↔ Implementation Alignment
|
|
177
|
+
|
|
178
|
+
- [ ] Phase 1 endpoint in API contract → Phase 3 handler exists?
|
|
179
|
+
- [ ] Phase 1 request schema → Phase 3 validation matches?
|
|
180
|
+
- [ ] Phase 1 response schema → Phase 3 handler response matches?
|
|
181
|
+
- [ ] Phase 1 error codes → Phase 3 error handling matches?
|
|
182
|
+
- [ ] Phase 1 response fields → Phase 2 test mocks match?
|
|
183
|
+
|
|
184
|
+
**If misaligned**: 🔴 STOP - Document conflict in DOCS_UPDATE_LOG.md
|
|
185
|
+
|
|
186
|
+
### Implementation ↔ SDK Alignment
|
|
187
|
+
|
|
188
|
+
- [ ] Phase 3 API response → Phase 4 type definitions match?
|
|
189
|
+
- [ ] Phase 3 error codes → Phase 4 error handling matches?
|
|
190
|
+
- [ ] Phase 3 data flow → Phase 4 client flow matches?
|
|
191
|
+
- [ ] New Phase 3 fields → Phase 4 types include them?
|
|
192
|
+
|
|
193
|
+
**If misaligned**: 🔴 STOP - Document conflict in DOCS_UPDATE_LOG.md
|
|
194
|
+
|
|
195
|
+
### SDK ↔ E2E Alignment
|
|
196
|
+
|
|
197
|
+
- [ ] Phase 4 SDK methods → Phase 5 E2E tests use them?
|
|
198
|
+
- [ ] Phase 4 type definitions → Phase 5 test data matches?
|
|
199
|
+
- [ ] Phase 4 error handling → Phase 5 error scenarios match?
|
|
200
|
+
|
|
201
|
+
**If misaligned**: 🔴 STOP - Document conflict in DOCS_UPDATE_LOG.md
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 🚨 Manual Review Decision Gate
|
|
206
|
+
|
|
207
|
+
If ANY of these apply, require manual review (don't auto-proceed):
|
|
208
|
+
|
|
209
|
+
### 🔴 ALWAYS MANUAL (Critical)
|
|
210
|
+
|
|
211
|
+
- [ ] **BREAKING change** detected (field removed, type changed, etc.)
|
|
212
|
+
- [ ] **Phase misalignment** detected (contract ≠ implementation)
|
|
213
|
+
- [ ] **Security change** (auth, validation, encryption related)
|
|
214
|
+
- [ ] **Database schema change** (new table, column removal)
|
|
215
|
+
- [ ] **Error code change** (new error, changed error behavior)
|
|
216
|
+
- [ ] **Performance regression** (response time increased >10%)
|
|
217
|
+
- [ ] **Deprecated endpoint** without migration guide
|
|
218
|
+
|
|
219
|
+
### 🟡 MANUAL RECOMMENDED (High Value)
|
|
220
|
+
|
|
221
|
+
- [ ] **New public API** (new endpoint or public method)
|
|
222
|
+
- [ ] **Architecture change** (new service, new module, data flow change)
|
|
223
|
+
- [ ] **Significant refactoring** (>50 lines changed in critical path)
|
|
224
|
+
- [ ] **Third-party library update** (new dependency or major version bump)
|
|
225
|
+
- [ ] **Cross-phase impact** (changes affect multiple phases)
|
|
226
|
+
|
|
227
|
+
### 🟢 AUTO OK (Standard)
|
|
228
|
+
|
|
229
|
+
- [ ] Feature addition (new optional field, new optional method)
|
|
230
|
+
- [ ] Bug fix (behavior corrected, backward compatible)
|
|
231
|
+
- [ ] Test addition (new test cases for existing features)
|
|
232
|
+
- [ ] Documentation update (comments, examples, guides)
|
|
233
|
+
- [ ] Internal refactoring (no behavior change, single module)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 📝 Docs Completeness Checklist
|
|
238
|
+
|
|
239
|
+
### If Documentation Update Flagged, Verify:
|
|
240
|
+
|
|
241
|
+
**API Documentation**:
|
|
242
|
+
- [ ] All endpoints documented (GET, POST, PUT, DELETE)
|
|
243
|
+
- [ ] Request parameters documented (required, optional, types)
|
|
244
|
+
- [ ] Response schema documented with example JSON
|
|
245
|
+
- [ ] Error codes documented (code, message, cause, resolution)
|
|
246
|
+
- [ ] Code examples in 2+ languages (JavaScript, Python)
|
|
247
|
+
- [ ] Rate limits noted (if applicable)
|
|
248
|
+
- [ ] Authentication requirements noted
|
|
249
|
+
|
|
250
|
+
**Implementation Documentation**:
|
|
251
|
+
- [ ] File locations referenced (src/api/handlers/xxx.ts, etc.)
|
|
252
|
+
- [ ] Line numbers accurate (spot-check a few)
|
|
253
|
+
- [ ] Docstring examples compile/run
|
|
254
|
+
- [ ] Error handling strategy explained
|
|
255
|
+
- [ ] Performance characteristics noted (if critical path)
|
|
256
|
+
- [ ] Security implications noted (if applicable)
|
|
257
|
+
- [ ] Design decisions explained (why this approach?)
|
|
258
|
+
|
|
259
|
+
**Architecture Documentation**:
|
|
260
|
+
- [ ] Data flow diagram updated (if applicable)
|
|
261
|
+
- [ ] Service interactions documented
|
|
262
|
+
- [ ] Cache strategy documented (if added)
|
|
263
|
+
- [ ] External API dependencies noted
|
|
264
|
+
- [ ] Scalability considerations noted
|
|
265
|
+
- [ ] Failure scenarios documented
|
|
266
|
+
|
|
267
|
+
**Changelog Documentation**:
|
|
268
|
+
- [ ] Change type correct (BREAKING, FEATURE, BUG_FIX)
|
|
269
|
+
- [ ] Change severity matches impact
|
|
270
|
+
- [ ] Migration guide provided for breaking changes
|
|
271
|
+
- [ ] Timeline clear for deprecations
|
|
272
|
+
- [ ] Examples provided for new features
|
|
273
|
+
- [ ] Related resources linked (API ref, implementation guide)
|
|
274
|
+
|
|
275
|
+
**Handoff Documentation**:
|
|
276
|
+
- [ ] Phase completion status clear (✅ what's done)
|
|
277
|
+
- [ ] Testing checklist provided for next phase
|
|
278
|
+
- [ ] Known issues documented (severity, workarounds)
|
|
279
|
+
- [ ] Next steps clear (what Phase 4 needs to do)
|
|
280
|
+
- [ ] Open questions documented
|
|
281
|
+
- [ ] Contact info for questions
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 🎯 Final Sign-Off Checklist
|
|
286
|
+
|
|
287
|
+
Before marking docs update COMPLETE:
|
|
288
|
+
|
|
289
|
+
**Syntax Validation**:
|
|
290
|
+
- [ ] All markdown files compile without errors
|
|
291
|
+
- [ ] All code blocks properly syntax-highlighted
|
|
292
|
+
- [ ] All links internally valid (cross-references work)
|
|
293
|
+
- [ ] No broken image references
|
|
294
|
+
- [ ] Frontmatter (if used) valid YAML/JSON
|
|
295
|
+
|
|
296
|
+
**Content Validation**:
|
|
297
|
+
- [ ] No TODO markers remain (🚫 "TODO: document this")
|
|
298
|
+
- [ ] No placeholder text ("Placeholder for API docs")
|
|
299
|
+
- [ ] All examples tested (code runs without errors)
|
|
300
|
+
- [ ] All file paths exist (spot-check a few)
|
|
301
|
+
- [ ] All line numbers accurate (spot-check a few)
|
|
302
|
+
|
|
303
|
+
**Consistency Validation**:
|
|
304
|
+
- [ ] Terminology consistent (API vs Backend, User vs Account)
|
|
305
|
+
- [ ] Formatting consistent (markdown headers, code blocks)
|
|
306
|
+
- [ ] Tone consistent (technical, not marketing)
|
|
307
|
+
- [ ] All promises kept (referenced features exist)
|
|
308
|
+
|
|
309
|
+
**Phase Alignment**:
|
|
310
|
+
- [ ] Phase 1 contract ⊂ Phase 3 implementation ✓
|
|
311
|
+
- [ ] Phase 3 response ⊂ Phase 4 types ✓
|
|
312
|
+
- [ ] Phase 4 types ⊂ Phase 5 tests ✓
|
|
313
|
+
- [ ] All layers agree on field names, types ✓
|
|
314
|
+
|
|
315
|
+
**Update Complete**: ✅ Ready for commit
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## 📊 Validation Results Template
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
DOCS VALIDATION REPORT
|
|
323
|
+
Generated: [timestamp]
|
|
324
|
+
Change: [brief description]
|
|
325
|
+
|
|
326
|
+
CONTRACT CHANGES: [0-N]
|
|
327
|
+
- [endpoint/field] - [change type]
|
|
328
|
+
|
|
329
|
+
TEST CHANGES: [0-N]
|
|
330
|
+
- [test name] - [scenario]
|
|
331
|
+
|
|
332
|
+
BACKEND CHANGES: [0-N]
|
|
333
|
+
- [file] - [type of change]
|
|
334
|
+
|
|
335
|
+
SDK CHANGES: [0-N]
|
|
336
|
+
- [method/type] - [change type]
|
|
337
|
+
|
|
338
|
+
E2E CHANGES: [0-N]
|
|
339
|
+
- [scenario] - [user flow]
|
|
340
|
+
|
|
341
|
+
PHASE ALIGNMENT: ✅ All phases aligned
|
|
342
|
+
MANUAL REVIEW GATE: ⚠️ BREAKING CHANGE - Manual review required
|
|
343
|
+
|
|
344
|
+
DOCS GENERATED:
|
|
345
|
+
- ✅ API_REFERENCE.md updated
|
|
346
|
+
- ✅ IMPLEMENTATION.md updated
|
|
347
|
+
- ✅ ARCHITECTURE.md updated
|
|
348
|
+
- ✅ SPEC_CHANGELOG.md entry added
|
|
349
|
+
- ⚠️ IMPLEMENTATION_HANDOFF.md incomplete (flagged for manual review)
|
|
350
|
+
|
|
351
|
+
STATUS: ⚠️ CONDITIONAL COMPLETE
|
|
352
|
+
- Auto-update: ✅ DONE
|
|
353
|
+
- Manual review: ⏳ REQUIRED (breaking change gate)
|
|
354
|
+
- Ready for commit: ❌ NO (awaiting manual approval)
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
**Last Updated**: May 31, 2026 | **Status**: ACTIVE
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Spec-Alignment Checklist
|
|
2
|
+
|
|
3
|
+
**Purpose**: Verify that all phases are aligned on specs, types, and data contracts
|
|
4
|
+
|
|
5
|
+
**When to Use**: During doc validation phase, before marking docs ready for commit
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🔗 Cross-Layer Type Alignment
|
|
10
|
+
|
|
11
|
+
### Phase 1 → Phase 3 Alignment (Contract → Backend)
|
|
12
|
+
|
|
13
|
+
**For each endpoint in Phase 1 API contract**:
|
|
14
|
+
|
|
15
|
+
**GET /api/users/{id}**
|
|
16
|
+
- [ ] Phase 1 spec defines response: `{ id: string, email: string, name?: string }`
|
|
17
|
+
- [ ] Phase 3 handler returns exactly this structure (no extra fields)
|
|
18
|
+
- [ ] Phase 3 type definition: `interface User { id: string; email: string; name?: string; }`
|
|
19
|
+
- [ ] No optional fields in Phase 1 become required in Phase 3
|
|
20
|
+
- [ ] No required fields in Phase 1 are optional in Phase 3
|
|
21
|
+
|
|
22
|
+
**POST /api/users**
|
|
23
|
+
- [ ] Phase 1 request schema matches Phase 3 handler parameters
|
|
24
|
+
- [ ] Phase 1 request validation rules enforced in Phase 3
|
|
25
|
+
- [ ] Phase 1 response schema matches Phase 3 handler response
|
|
26
|
+
- [ ] No type coercion surprises (string "123" vs number 123)
|
|
27
|
+
|
|
28
|
+
### Phase 3 → Phase 4 Alignment (Backend → SDK)
|
|
29
|
+
|
|
30
|
+
**For each type in Phase 3 backend**:
|
|
31
|
+
|
|
32
|
+
- [ ] Phase 3 response `{ id, email, name }` → Phase 4 type `User`
|
|
33
|
+
- [ ] Phase 4 type includes all fields from Phase 3 (nothing lost)
|
|
34
|
+
- [ ] Phase 4 optional fields match Phase 3 optional fields
|
|
35
|
+
- [ ] Phase 4 methods signature matches Phase 3 API behavior
|
|
36
|
+
- [ ] Phase 4 error handling matches Phase 3 error codes
|
|
37
|
+
|
|
38
|
+
### Phase 4 → Phase 5 Alignment (SDK → E2E Tests)
|
|
39
|
+
|
|
40
|
+
**For each SDK method used in Phase 5**:
|
|
41
|
+
|
|
42
|
+
- [ ] Phase 5 test calls `userService.getUser(id)` → Phase 4 method exists
|
|
43
|
+
- [ ] Phase 5 test expects type `{ id, email, name }` → Phase 4 type matches
|
|
44
|
+
- [ ] Phase 5 test error handling matches Phase 4 SDK errors
|
|
45
|
+
- [ ] Phase 5 test data setup uses Phase 4 types/methods
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🔄 Data Flow Alignment
|
|
50
|
+
|
|
51
|
+
### End-to-End User Data Flow
|
|
52
|
+
|
|
53
|
+
**Scenario**: User registers, profile updated, retrieved
|
|
54
|
+
|
|
55
|
+
**Phase 1 Contract**:
|
|
56
|
+
```json
|
|
57
|
+
POST /api/users/register {
|
|
58
|
+
"email": "user@example.com",
|
|
59
|
+
"password": "secure",
|
|
60
|
+
"name": "John"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Response 200 {
|
|
64
|
+
"id": "uuid-1",
|
|
65
|
+
"email": "user@example.com",
|
|
66
|
+
"name": "John"
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Phase 2 Tests**:
|
|
71
|
+
- [ ] Test mock: `{ email: "user@example.com", password: "secure", name: "John" }`
|
|
72
|
+
- [ ] Test assertion: Response has `id`, `email`, `name`
|
|
73
|
+
- [ ] Test assertion: Password NOT in response
|
|
74
|
+
|
|
75
|
+
**Phase 3 Backend**:
|
|
76
|
+
- [ ] Handler receives: `{ email, password, name }`
|
|
77
|
+
- [ ] Handler validates: Email format, password strength
|
|
78
|
+
- [ ] Handler hashes: Password stored securely (not plaintext)
|
|
79
|
+
- [ ] Handler returns: `{ id, email, name }` (NO password)
|
|
80
|
+
- [ ] Handler stores: User record in database
|
|
81
|
+
|
|
82
|
+
**Phase 4 SDK**:
|
|
83
|
+
- [ ] Register method signature: `register(email, password, name)`
|
|
84
|
+
- [ ] Type definition: `interface User { id, email, name }`
|
|
85
|
+
- [ ] SDK returns: `User` type with id, email, name
|
|
86
|
+
- [ ] SDK error handling: Maps backend errors to SDK exceptions
|
|
87
|
+
|
|
88
|
+
**Phase 5 E2E Tests**:
|
|
89
|
+
- [ ] Test data setup: `await userService.register("user@ex.com", "pwd", "John")`
|
|
90
|
+
- [ ] Test assertion: `response.id` exists
|
|
91
|
+
- [ ] Test assertion: `response.email === "user@ex.com"`
|
|
92
|
+
- [ ] Test assertion: `response.password` NOT in response (undefined)
|
|
93
|
+
|
|
94
|
+
✅ **Full alignment verified**: Data consistent through all phases
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 🔒 Error Code Alignment
|
|
99
|
+
|
|
100
|
+
### Phase 1: Error Codes Defined
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"409": "Email already registered",
|
|
105
|
+
"400": "Invalid email format",
|
|
106
|
+
"422": "Password too weak"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Phase 3: Error Codes Implemented
|
|
111
|
+
|
|
112
|
+
- [ ] Handler throws error 409 when: Email collision detected
|
|
113
|
+
- [ ] Handler throws error 400 when: Email fails validation
|
|
114
|
+
- [ ] Handler throws error 422 when: Password fails strength check
|
|
115
|
+
- [ ] Handler includes error message in response
|
|
116
|
+
- [ ] Handler doesn't leak sensitive info in error (no stack traces)
|
|
117
|
+
|
|
118
|
+
### Phase 4: Error Codes Documented
|
|
119
|
+
|
|
120
|
+
- [ ] SDK has enum: `UserErrors = { EMAIL_EXISTS: 409, INVALID_EMAIL: 400, WEAK_PASSWORD: 422 }`
|
|
121
|
+
- [ ] SDK throws TypeScript Error with proper type
|
|
122
|
+
- [ ] SDK error message matches Phase 3 message
|
|
123
|
+
- [ ] SDK error handling clear in documentation
|
|
124
|
+
|
|
125
|
+
### Phase 5: Error Codes Tested
|
|
126
|
+
|
|
127
|
+
- [ ] E2E test: Registers with duplicate email → 409 handled correctly
|
|
128
|
+
- [ ] E2E test: Registers with invalid email → 400 handled correctly
|
|
129
|
+
- [ ] E2E test: Registers with weak password → 422 handled correctly
|
|
130
|
+
- [ ] E2E test: Error UI shows correct message to user
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 📋 Database Schema Alignment
|
|
135
|
+
|
|
136
|
+
**If database schema changed**:
|
|
137
|
+
|
|
138
|
+
### Phase 1: Schema Changes Documented
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
"User table:
|
|
142
|
+
- id: UUID (primary key)
|
|
143
|
+
- email: VARCHAR(255) UNIQUE
|
|
144
|
+
- passwordHash: VARCHAR(255)
|
|
145
|
+
- name: VARCHAR(255) NULL
|
|
146
|
+
- createdAt: TIMESTAMP DEFAULT NOW()
|
|
147
|
+
"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Phase 3: Schema Changes Implemented
|
|
151
|
+
|
|
152
|
+
- [ ] Migration script created: `migrations/20260531_add_users_table.sql`
|
|
153
|
+
- [ ] Migration creates `users` table with specified columns
|
|
154
|
+
- [ ] Unique constraint on `email` field (prevents duplicates)
|
|
155
|
+
- [ ] Index on `email` (for fast lookups)
|
|
156
|
+
- [ ] Default timestamp on `createdAt`
|
|
157
|
+
- [ ] Tests verify migration runs successfully
|
|
158
|
+
|
|
159
|
+
### Phase 4: Schema Changes Known
|
|
160
|
+
|
|
161
|
+
- [ ] SDK documentation notes: "User.email is unique"
|
|
162
|
+
- [ ] SDK documentation notes: "User.passwordHash never exposed"
|
|
163
|
+
- [ ] SDK documentation notes: "User.createdAt is timestamp"
|
|
164
|
+
|
|
165
|
+
### Phase 5: Schema Changes Verified
|
|
166
|
+
|
|
167
|
+
- [ ] E2E test: Two users can't have same email (409 on duplicate)
|
|
168
|
+
- [ ] E2E test: User.email is returned (public field)
|
|
169
|
+
- [ ] E2E test: User.passwordHash is NOT returned (private field)
|
|
170
|
+
- [ ] E2E test: User.createdAt is returned (timestamp)
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 📊 Type Definition Alignment
|
|
175
|
+
|
|
176
|
+
### Before (Misaligned)
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
Phase 1: { id: string, email: string, name?: string, avatar?: string }
|
|
180
|
+
Phase 3: { id, email, name } // Missing avatar
|
|
181
|
+
Phase 4: { id: string; email: string; name: string; } // Wrong: name required
|
|
182
|
+
Phase 5: Test expects { id, email, name, avatar } // Expects avatar
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
❌ **MISALIGNED**: Phases disagree on `avatar` field and `name` optionality
|
|
186
|
+
|
|
187
|
+
### After (Aligned)
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Phase 1: { id: string, email: string, name?: string }
|
|
191
|
+
Phase 3: { id, email, name? } // Matches contract
|
|
192
|
+
Phase 4: { id: string; email: string; name?: string; } // Matches contract
|
|
193
|
+
Phase 5: Test expects { id, email, name? } // Matches all phases
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
✅ **ALIGNED**: All phases agree on structure
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## 🔍 Method Signature Alignment
|
|
201
|
+
|
|
202
|
+
### SDK Method Signature
|
|
203
|
+
|
|
204
|
+
**Phase 1 (Contract)**:
|
|
205
|
+
```
|
|
206
|
+
POST /api/users/register
|
|
207
|
+
Request: { email, password, name }
|
|
208
|
+
Response: { id, email, name }
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Phase 4 (SDK)**:
|
|
212
|
+
- [ ] Method name: `register()` or `createUser()`? Pick ONE consistently
|
|
213
|
+
- [ ] Method signature: `register(email: string, password: string, name?: string): Promise<User>`
|
|
214
|
+
- [ ] Parameter types: string (matches contract)
|
|
215
|
+
- [ ] Parameter optionality: name optional (matches contract)
|
|
216
|
+
- [ ] Return type: User object (matches contract response)
|
|
217
|
+
- [ ] Throws errors: Matches Phase 3 errors (409, 400, 422)
|
|
218
|
+
|
|
219
|
+
**Phase 5 (E2E)**:
|
|
220
|
+
- [ ] Test calls: `await userService.register("email@ex.com", "pwd", "John")`
|
|
221
|
+
- [ ] Test expects: Promise returns User object
|
|
222
|
+
- [ ] Test expects: User has { id, email, name }
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## ⚡ Validation Order
|
|
227
|
+
|
|
228
|
+
Check these in order (stop if misaligned):
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
1. Phase 1 API Contract Valid?
|
|
232
|
+
- JSON schema valid, types defined
|
|
233
|
+
|
|
234
|
+
2. Phase 1 → Phase 3 Match?
|
|
235
|
+
- Backend implements contract
|
|
236
|
+
|
|
237
|
+
3. Phase 3 → Phase 4 Match?
|
|
238
|
+
- SDK types match backend response
|
|
239
|
+
|
|
240
|
+
4. Phase 4 → Phase 5 Match?
|
|
241
|
+
- E2E tests use SDK correctly
|
|
242
|
+
|
|
243
|
+
5. Round-trip Test
|
|
244
|
+
- Phase 5 test calls all the way through to Phase 1 contract
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
If any mismatch: 🔴 STOP, document conflict, request manual review
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## 🎓 Example: Breaking Change Detection
|
|
252
|
+
|
|
253
|
+
### Scenario: Removing `legacyId` field
|
|
254
|
+
|
|
255
|
+
**Phase 1 Contract Change**:
|
|
256
|
+
```diff
|
|
257
|
+
{
|
|
258
|
+
"id": "uuid",
|
|
259
|
+
"email": "user@example.com",
|
|
260
|
+
- "legacyId": "legacy-format-id"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Alignment Check**:
|
|
265
|
+
|
|
266
|
+
Phase 1 → Phase 3:
|
|
267
|
+
- [ ] Phase 3 handler: Remove `legacyId` from response ✓
|
|
268
|
+
- [ ] Phase 3 tests: Don't expect `legacyId` ✓
|
|
269
|
+
|
|
270
|
+
Phase 3 → Phase 4:
|
|
271
|
+
- [ ] Phase 4 type: Remove `legacyId` property
|
|
272
|
+
- [ ] But wait: existing code uses `user.legacyId`?
|
|
273
|
+
- [ ] Decision: Add deprecation warning or break?
|
|
274
|
+
- [ ] Need: Migration guide for Phase 4 users
|
|
275
|
+
|
|
276
|
+
Phase 4 → Phase 5:
|
|
277
|
+
- [ ] Phase 5 E2E: Remove test assertions on `legacyId` ✓
|
|
278
|
+
|
|
279
|
+
**Alignment Result**: ⚠️ BREAKING - Requires migration guide
|
|
280
|
+
|
|
281
|
+
**Migration Guide Needed**:
|
|
282
|
+
```
|
|
283
|
+
## Migration: Removing legacyId
|
|
284
|
+
|
|
285
|
+
Before: const legacyId = user.legacyId;
|
|
286
|
+
After: Use user.id instead (single ID field)
|
|
287
|
+
|
|
288
|
+
Deprecation: legacyId removed in v2.1
|
|
289
|
+
Timeline: 6 months from v2.0
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## ✅ Sign-Off
|
|
295
|
+
|
|
296
|
+
When all alignments verified:
|
|
297
|
+
|
|
298
|
+
- [ ] All phase-to-phase connections consistent
|
|
299
|
+
- [ ] No type mismatches found
|
|
300
|
+
- [ ] No missing fields in downstream phases
|
|
301
|
+
- [ ] Error codes aligned across all phases
|
|
302
|
+
- [ ] Database schema known to all phases
|
|
303
|
+
- [ ] Method signatures compatible
|
|
304
|
+
- [ ] Migration guides provided for breaking changes
|
|
305
|
+
|
|
306
|
+
**ALIGNMENT VALIDATION**: ✅ PASSED
|
|
307
|
+
|
|
308
|
+
Document in: `DOCS_UPDATE_LOG.md`
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
**Last Updated**: May 31, 2026 | **Status**: ACTIVE
|