atdd 0.1.0__py3-none-any.whl

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 (183) hide show
  1. atdd/__init__.py +0 -0
  2. atdd/cli.py +404 -0
  3. atdd/coach/__init__.py +0 -0
  4. atdd/coach/commands/__init__.py +0 -0
  5. atdd/coach/commands/add_persistence_metadata.py +215 -0
  6. atdd/coach/commands/analyze_migrations.py +188 -0
  7. atdd/coach/commands/consumers.py +720 -0
  8. atdd/coach/commands/infer_governance_status.py +149 -0
  9. atdd/coach/commands/initializer.py +177 -0
  10. atdd/coach/commands/interface.py +1078 -0
  11. atdd/coach/commands/inventory.py +565 -0
  12. atdd/coach/commands/migration.py +240 -0
  13. atdd/coach/commands/registry.py +1560 -0
  14. atdd/coach/commands/session.py +430 -0
  15. atdd/coach/commands/sync.py +405 -0
  16. atdd/coach/commands/test_interface.py +399 -0
  17. atdd/coach/commands/test_runner.py +141 -0
  18. atdd/coach/commands/tests/__init__.py +1 -0
  19. atdd/coach/commands/tests/test_telemetry_array_validation.py +235 -0
  20. atdd/coach/commands/traceability.py +4264 -0
  21. atdd/coach/conventions/session.convention.yaml +754 -0
  22. atdd/coach/overlays/__init__.py +2 -0
  23. atdd/coach/overlays/claude.md +2 -0
  24. atdd/coach/schemas/config.schema.json +34 -0
  25. atdd/coach/schemas/manifest.schema.json +101 -0
  26. atdd/coach/templates/ATDD.md +282 -0
  27. atdd/coach/templates/SESSION-TEMPLATE.md +327 -0
  28. atdd/coach/utils/__init__.py +0 -0
  29. atdd/coach/utils/graph/__init__.py +0 -0
  30. atdd/coach/utils/graph/urn.py +875 -0
  31. atdd/coach/validators/__init__.py +0 -0
  32. atdd/coach/validators/shared_fixtures.py +365 -0
  33. atdd/coach/validators/test_enrich_wagon_registry.py +167 -0
  34. atdd/coach/validators/test_registry.py +575 -0
  35. atdd/coach/validators/test_session_validation.py +1183 -0
  36. atdd/coach/validators/test_traceability.py +448 -0
  37. atdd/coach/validators/test_update_feature_paths.py +108 -0
  38. atdd/coach/validators/test_validate_contract_consumers.py +297 -0
  39. atdd/coder/__init__.py +1 -0
  40. atdd/coder/conventions/adapter.recipe.yaml +88 -0
  41. atdd/coder/conventions/backend.convention.yaml +460 -0
  42. atdd/coder/conventions/boundaries.convention.yaml +666 -0
  43. atdd/coder/conventions/commons.convention.yaml +460 -0
  44. atdd/coder/conventions/complexity.recipe.yaml +109 -0
  45. atdd/coder/conventions/component-naming.convention.yaml +178 -0
  46. atdd/coder/conventions/design.convention.yaml +327 -0
  47. atdd/coder/conventions/design.recipe.yaml +273 -0
  48. atdd/coder/conventions/dto.convention.yaml +660 -0
  49. atdd/coder/conventions/frontend.convention.yaml +542 -0
  50. atdd/coder/conventions/green.convention.yaml +1012 -0
  51. atdd/coder/conventions/presentation.convention.yaml +587 -0
  52. atdd/coder/conventions/refactor.convention.yaml +535 -0
  53. atdd/coder/conventions/technology.convention.yaml +206 -0
  54. atdd/coder/conventions/tests/__init__.py +0 -0
  55. atdd/coder/conventions/tests/test_adapter_recipe.py +302 -0
  56. atdd/coder/conventions/tests/test_complexity_recipe.py +289 -0
  57. atdd/coder/conventions/tests/test_component_taxonomy.py +278 -0
  58. atdd/coder/conventions/tests/test_component_urn_naming.py +165 -0
  59. atdd/coder/conventions/tests/test_thinness_recipe.py +286 -0
  60. atdd/coder/conventions/thinness.recipe.yaml +82 -0
  61. atdd/coder/conventions/train.convention.yaml +325 -0
  62. atdd/coder/conventions/verification.protocol.yaml +53 -0
  63. atdd/coder/schemas/design_system.schema.json +361 -0
  64. atdd/coder/validators/__init__.py +0 -0
  65. atdd/coder/validators/test_commons_structure.py +485 -0
  66. atdd/coder/validators/test_complexity.py +416 -0
  67. atdd/coder/validators/test_cross_language_consistency.py +431 -0
  68. atdd/coder/validators/test_design_system_compliance.py +413 -0
  69. atdd/coder/validators/test_dto_testing_patterns.py +268 -0
  70. atdd/coder/validators/test_green_cross_stack_layers.py +168 -0
  71. atdd/coder/validators/test_green_layer_dependencies.py +148 -0
  72. atdd/coder/validators/test_green_python_layer_structure.py +103 -0
  73. atdd/coder/validators/test_green_supabase_layer_structure.py +103 -0
  74. atdd/coder/validators/test_import_boundaries.py +396 -0
  75. atdd/coder/validators/test_init_file_urns.py +593 -0
  76. atdd/coder/validators/test_preact_layer_boundaries.py +221 -0
  77. atdd/coder/validators/test_presentation_convention.py +260 -0
  78. atdd/coder/validators/test_python_architecture.py +674 -0
  79. atdd/coder/validators/test_quality_metrics.py +420 -0
  80. atdd/coder/validators/test_station_master_pattern.py +244 -0
  81. atdd/coder/validators/test_train_infrastructure.py +454 -0
  82. atdd/coder/validators/test_train_urns.py +293 -0
  83. atdd/coder/validators/test_typescript_architecture.py +616 -0
  84. atdd/coder/validators/test_usecase_structure.py +421 -0
  85. atdd/coder/validators/test_wagon_boundaries.py +586 -0
  86. atdd/conftest.py +126 -0
  87. atdd/planner/__init__.py +1 -0
  88. atdd/planner/conventions/acceptance.convention.yaml +538 -0
  89. atdd/planner/conventions/appendix.convention.yaml +187 -0
  90. atdd/planner/conventions/artifact-naming.convention.yaml +852 -0
  91. atdd/planner/conventions/component.convention.yaml +670 -0
  92. atdd/planner/conventions/criteria.convention.yaml +141 -0
  93. atdd/planner/conventions/feature.convention.yaml +371 -0
  94. atdd/planner/conventions/interface.convention.yaml +382 -0
  95. atdd/planner/conventions/steps.convention.yaml +141 -0
  96. atdd/planner/conventions/train.convention.yaml +552 -0
  97. atdd/planner/conventions/wagon.convention.yaml +275 -0
  98. atdd/planner/conventions/wmbt.convention.yaml +258 -0
  99. atdd/planner/schemas/acceptance.schema.json +336 -0
  100. atdd/planner/schemas/appendix.schema.json +78 -0
  101. atdd/planner/schemas/component.schema.json +114 -0
  102. atdd/planner/schemas/feature.schema.json +197 -0
  103. atdd/planner/schemas/train.schema.json +192 -0
  104. atdd/planner/schemas/wagon.schema.json +281 -0
  105. atdd/planner/schemas/wmbt.schema.json +59 -0
  106. atdd/planner/validators/__init__.py +0 -0
  107. atdd/planner/validators/conftest.py +5 -0
  108. atdd/planner/validators/test_draft_wagon_registry.py +374 -0
  109. atdd/planner/validators/test_plan_cross_refs.py +240 -0
  110. atdd/planner/validators/test_plan_uniqueness.py +224 -0
  111. atdd/planner/validators/test_plan_urn_resolution.py +268 -0
  112. atdd/planner/validators/test_plan_wagons.py +174 -0
  113. atdd/planner/validators/test_train_validation.py +514 -0
  114. atdd/planner/validators/test_wagon_urn_chain.py +648 -0
  115. atdd/planner/validators/test_wmbt_consistency.py +327 -0
  116. atdd/planner/validators/test_wmbt_vocabulary.py +632 -0
  117. atdd/tester/__init__.py +1 -0
  118. atdd/tester/conventions/artifact.convention.yaml +257 -0
  119. atdd/tester/conventions/contract.convention.yaml +1009 -0
  120. atdd/tester/conventions/filename.convention.yaml +555 -0
  121. atdd/tester/conventions/migration.convention.yaml +509 -0
  122. atdd/tester/conventions/red.convention.yaml +797 -0
  123. atdd/tester/conventions/routing.convention.yaml +51 -0
  124. atdd/tester/conventions/telemetry.convention.yaml +458 -0
  125. atdd/tester/schemas/a11y.tmpl.json +17 -0
  126. atdd/tester/schemas/artifact.schema.json +189 -0
  127. atdd/tester/schemas/contract.schema.json +591 -0
  128. atdd/tester/schemas/contract.tmpl.json +95 -0
  129. atdd/tester/schemas/db.tmpl.json +20 -0
  130. atdd/tester/schemas/e2e.tmpl.json +17 -0
  131. atdd/tester/schemas/edge_function.tmpl.json +17 -0
  132. atdd/tester/schemas/event.tmpl.json +17 -0
  133. atdd/tester/schemas/http.tmpl.json +19 -0
  134. atdd/tester/schemas/job.tmpl.json +18 -0
  135. atdd/tester/schemas/load.tmpl.json +21 -0
  136. atdd/tester/schemas/metric.tmpl.json +19 -0
  137. atdd/tester/schemas/pack.schema.json +139 -0
  138. atdd/tester/schemas/realtime.tmpl.json +20 -0
  139. atdd/tester/schemas/rls.tmpl.json +18 -0
  140. atdd/tester/schemas/script.tmpl.json +16 -0
  141. atdd/tester/schemas/sec.tmpl.json +18 -0
  142. atdd/tester/schemas/storage.tmpl.json +18 -0
  143. atdd/tester/schemas/telemetry.schema.json +128 -0
  144. atdd/tester/schemas/telemetry_tracking_manifest.schema.json +143 -0
  145. atdd/tester/schemas/test_filename.schema.json +194 -0
  146. atdd/tester/schemas/test_intent.schema.json +179 -0
  147. atdd/tester/schemas/unit.tmpl.json +18 -0
  148. atdd/tester/schemas/visual.tmpl.json +18 -0
  149. atdd/tester/schemas/ws.tmpl.json +17 -0
  150. atdd/tester/utils/__init__.py +0 -0
  151. atdd/tester/utils/filename.py +300 -0
  152. atdd/tester/validators/__init__.py +0 -0
  153. atdd/tester/validators/cleanup_duplicate_headers.py +116 -0
  154. atdd/tester/validators/cleanup_duplicate_headers_v2.py +135 -0
  155. atdd/tester/validators/conftest.py +5 -0
  156. atdd/tester/validators/coverage_gap_report.py +321 -0
  157. atdd/tester/validators/fix_dual_ac_references.py +179 -0
  158. atdd/tester/validators/remove_duplicate_lines.py +93 -0
  159. atdd/tester/validators/test_acceptance_urn_filename_mapping.py +359 -0
  160. atdd/tester/validators/test_acceptance_urn_separator.py +166 -0
  161. atdd/tester/validators/test_artifact_naming_category.py +307 -0
  162. atdd/tester/validators/test_contract_schema_compliance.py +706 -0
  163. atdd/tester/validators/test_contracts_structure.py +200 -0
  164. atdd/tester/validators/test_coverage_adequacy.py +797 -0
  165. atdd/tester/validators/test_dual_ac_reference.py +225 -0
  166. atdd/tester/validators/test_fixture_validity.py +372 -0
  167. atdd/tester/validators/test_isolation.py +487 -0
  168. atdd/tester/validators/test_migration_coverage.py +204 -0
  169. atdd/tester/validators/test_migration_criteria.py +276 -0
  170. atdd/tester/validators/test_migration_generation.py +116 -0
  171. atdd/tester/validators/test_python_test_naming.py +410 -0
  172. atdd/tester/validators/test_red_layer_validation.py +95 -0
  173. atdd/tester/validators/test_red_python_layer_structure.py +87 -0
  174. atdd/tester/validators/test_red_supabase_layer_structure.py +90 -0
  175. atdd/tester/validators/test_telemetry_structure.py +634 -0
  176. atdd/tester/validators/test_typescript_test_naming.py +301 -0
  177. atdd/tester/validators/test_typescript_test_structure.py +84 -0
  178. atdd-0.1.0.dist-info/METADATA +191 -0
  179. atdd-0.1.0.dist-info/RECORD +183 -0
  180. atdd-0.1.0.dist-info/WHEEL +5 -0
  181. atdd-0.1.0.dist-info/entry_points.txt +2 -0
  182. atdd-0.1.0.dist-info/licenses/LICENSE +674 -0
  183. atdd-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,754 @@
1
+ version: "2.1"
2
+ name: "Session Convention"
3
+ description: "Deterministic template and rules for planning sessions in consumer repos"
4
+
5
+ # =============================================================================
6
+ # ATDD WORKFLOW SEQUENCE (MANDATORY)
7
+ # =============================================================================
8
+ # The ATDD workflow MUST be followed in strict order. Gate tests enforce this.
9
+ # Reference: atdd/tester/conventions/red.convention.yaml (contract_schema_validation)
10
+
11
+ workflow:
12
+ name: "ATDD Flow"
13
+ description: "Planner → Tester → Coder sequence with gate enforcement"
14
+ principle: "Plan before Test, Test before Code"
15
+
16
+ phases:
17
+ # -------------------------------------------------------------------------
18
+ # PHASE 1: PLANNER (Design)
19
+ # -------------------------------------------------------------------------
20
+ planner:
21
+ order: 1
22
+ description: "Define WHAT needs to be built"
23
+ scope: "atdd/planner/"
24
+ artifacts:
25
+ train:
26
+ description: "Release orchestration manifest"
27
+ location: "plan/_trains.yaml"
28
+ convention: "atdd/planner/conventions/train.convention.yaml"
29
+ wagon:
30
+ description: "Bounded context definition"
31
+ location: "plan/{wagon}/_{wagon}.yaml"
32
+ convention: "atdd/planner/conventions/wagon.convention.yaml"
33
+ feature:
34
+ description: "Feature specification with sizing"
35
+ location: "plan/{wagon}/features/{feature}.yaml"
36
+ convention: "atdd/planner/conventions/feature.convention.yaml"
37
+ wmbt:
38
+ description: "What Must Be True acceptance criteria"
39
+ location: "plan/{wagon}/features/{feature}.yaml (wmbt section)"
40
+ convention: "atdd/planner/conventions/wmbt.convention.yaml"
41
+ validators:
42
+ - "atdd/planner/validators/test_train_validation.py"
43
+ - "atdd/planner/validators/test_wagon_urn_chain.py"
44
+ - "atdd/planner/validators/test_wmbt_consistency.py"
45
+ - "atdd/planner/validators/test_wmbt_vocabulary.py"
46
+ gate_command: "python3 -m pytest atdd/planner/validators/ -v"
47
+ gate_expected: "PASS"
48
+ completion_criteria:
49
+ - "Train manifest exists and is valid"
50
+ - "Wagon manifest exists with produce/consume contracts"
51
+ - "Feature YAML exists with WMBTs"
52
+ - "All planner validators pass"
53
+
54
+ # -------------------------------------------------------------------------
55
+ # PHASE 2: TESTER (Contract + RED)
56
+ # -------------------------------------------------------------------------
57
+ tester:
58
+ order: 2
59
+ description: "Define HOW to verify it works (contracts + failing tests)"
60
+ scope: "atdd/tester/"
61
+ depends_on: ["planner"]
62
+ artifacts:
63
+ contract:
64
+ description: "JSON Schema contracts for data exchange"
65
+ location: "contracts/{domain}/{resource}.schema.json"
66
+ convention: "atdd/tester/conventions/contract.convention.yaml"
67
+ red_test:
68
+ description: "Failing acceptance tests from WMBTs"
69
+ location: "{runtime}/{wagon}/{feature}/tests/"
70
+ convention: "atdd/tester/conventions/red.convention.yaml"
71
+ validators:
72
+ - "atdd/tester/validators/test_contract_schema_compliance.py"
73
+ - "atdd/tester/validators/test_acceptance_urn_filename_mapping.py"
74
+ - "atdd/tester/validators/test_python_test_naming.py"
75
+ - "atdd/tester/validators/test_typescript_test_naming.py"
76
+ gate_command: "python3 -m pytest atdd/tester/validators/ -v"
77
+ gate_expected: "PASS"
78
+ red_phase:
79
+ description: "Write failing tests BEFORE any implementation"
80
+ rule: "All acceptance tests MUST fail (no implementation exists yet)"
81
+ gate_command: "pytest {test_path} -v"
82
+ gate_expected: "FAIL"
83
+ completion_criteria:
84
+ - "Contracts exist for all wagon I/O boundaries"
85
+ - "RED tests exist for all WMBTs"
86
+ - "All RED tests fail (NotImplementedError)"
87
+ - "All tester validators pass"
88
+
89
+ # -------------------------------------------------------------------------
90
+ # PHASE 3: CODER (GREEN + REFACTOR)
91
+ # -------------------------------------------------------------------------
92
+ coder:
93
+ order: 3
94
+ description: "Implement code that makes tests pass"
95
+ scope: "atdd/coder/"
96
+ depends_on: ["planner", "tester"]
97
+ artifacts:
98
+ implementation:
99
+ description: "Code following 4-layer architecture"
100
+ location: "{runtime}/{wagon}/{feature}/src/{layer}/"
101
+ convention: "atdd/coder/conventions/green.convention.yaml"
102
+ validators:
103
+ - "atdd/coder/validators/test_python_architecture.py"
104
+ - "atdd/coder/validators/test_typescript_architecture.py"
105
+ - "atdd/coder/validators/test_import_boundaries.py"
106
+ - "atdd/coder/validators/test_wagon_boundaries.py"
107
+ gate_command: "python3 -m pytest atdd/coder/validators/ -v"
108
+ gate_expected: "PASS"
109
+ green_phase:
110
+ description: "Make tests pass with minimal implementation"
111
+ rule: "RED test MUST exist before writing implementation"
112
+ convention: "atdd/coder/conventions/green.convention.yaml"
113
+ gate_command: "pytest {test_path} -v"
114
+ gate_expected: "PASS"
115
+ refactor_phase:
116
+ description: "Clean architecture, convention compliance"
117
+ rule: "All coder validators must pass after GREEN"
118
+ convention: "atdd/coder/conventions/refactor.convention.yaml"
119
+ gate_command: "python3 -m pytest atdd/coder/validators/ -v"
120
+ gate_expected: "PASS"
121
+ completion_criteria:
122
+ - "All acceptance tests pass"
123
+ - "Code follows 4-layer architecture"
124
+ - "All coder validators pass"
125
+
126
+ # ---------------------------------------------------------------------------
127
+ # WORKFLOW ENFORCEMENT RULES
128
+ # ---------------------------------------------------------------------------
129
+ enforcement:
130
+ principle: "Gate tests block progression until phase is complete"
131
+
132
+ sequence_rules:
133
+ - id: "WF-001"
134
+ rule: "MUST complete planner phase before tester phase"
135
+ check: "atdd/planner/validators/ PASS before writing contracts/tests"
136
+
137
+ - id: "WF-002"
138
+ rule: "MUST complete tester phase before coder phase"
139
+ check: "atdd/tester/validators/ PASS and RED tests fail before implementation"
140
+
141
+ - id: "WF-003"
142
+ rule: "MUST have RED test before writing implementation"
143
+ check: "Test file exists and fails before src file is created"
144
+ reference: "atdd/coder/conventions/green.convention.yaml:220"
145
+
146
+ - id: "WF-004"
147
+ rule: "MUST complete GREEN before REFACTOR"
148
+ check: "All tests pass before running coder validators"
149
+
150
+ violation_handling:
151
+ skip_planner: "BLOCKED - Cannot write tests without WMBT specifications"
152
+ skip_tester: "BLOCKED - Cannot implement without failing tests"
153
+ skip_red: "BLOCKED - Implementation without RED test is untested code"
154
+
155
+ # ---------------------------------------------------------------------------
156
+ # SESSION TYPE WORKFLOW MAPPING
157
+ # ---------------------------------------------------------------------------
158
+ session_type_workflows:
159
+ implementation:
160
+ required_phases: ["planner", "tester", "coder"]
161
+ workflow: "Full ATDD cycle: Plan → Test (RED) → Code (GREEN) → Refactor"
162
+
163
+ migration:
164
+ required_phases: ["planner", "tester", "coder"]
165
+ workflow: "Plan migration → Write tests for new behavior → Migrate code"
166
+
167
+ refactor:
168
+ required_phases: ["tester", "coder"]
169
+ workflow: "Ensure tests exist → Refactor code → Verify tests still pass"
170
+
171
+ analysis:
172
+ required_phases: []
173
+ workflow: "No code changes - investigation only"
174
+
175
+ planning:
176
+ required_phases: ["planner"]
177
+ workflow: "Design only - produce specifications"
178
+
179
+ cleanup:
180
+ required_phases: ["coder"]
181
+ workflow: "Fix violations - tests already exist"
182
+
183
+ tracking:
184
+ required_phases: []
185
+ workflow: "Progress log - no direct implementation"
186
+
187
+ # File format
188
+ format:
189
+ type: "hybrid"
190
+ description: "YAML frontmatter (machine-parseable) + Markdown body (human-readable)"
191
+ frontmatter:
192
+ delimiter: "---"
193
+ parser: "yaml.safe_load"
194
+ required: true
195
+ body:
196
+ format: "markdown"
197
+ sections: "## headings"
198
+
199
+ # Session file location and naming
200
+ # Note: atdd-sessions/ is created in the consuming repo via `atdd init`
201
+ filesystem:
202
+ # Consumer repo paths (where sessions are created)
203
+ directory: "atdd-sessions/"
204
+ archive: "atdd-sessions/archive/"
205
+ config_dir: ".atdd/"
206
+ manifest: ".atdd/manifest.yaml"
207
+ # Package template location (copy to consumer repo via `atdd init`)
208
+ template: "atdd.coach.templates/SESSION-TEMPLATE.md"
209
+ naming:
210
+ pattern: "SESSION-{NN}-{slug}.md"
211
+ examples:
212
+ - "SESSION-36-atdd-validator-fixes.md"
213
+ - "SESSION-37-contract-alignment.md"
214
+ rules:
215
+ - "NN = two-digit zero-padded sequence (01-99)"
216
+ - "slug = kebab-case descriptive name"
217
+ - "Always use next available number"
218
+
219
+ # Session types - determines context and focus
220
+ session_types:
221
+ implementation:
222
+ description: "Building new features via ATDD cycle"
223
+ focus: "WMBT decomposition, RED→GREEN→REFACTOR phases"
224
+
225
+ migration:
226
+ description: "Moving from one architecture/pattern to another"
227
+ focus: "Before/after diagrams, ripple effects, rollback plan"
228
+
229
+ refactor:
230
+ description: "Improving code structure without changing behavior"
231
+ focus: "Problem statement, architecture changes, test preservation"
232
+
233
+ analysis:
234
+ description: "Investigation and discovery work"
235
+ focus: "Findings, recommendations, evidence"
236
+
237
+ planning:
238
+ description: "Designing approach before implementation"
239
+ focus: "Design decisions, WMBT decomposition, scope definition"
240
+
241
+ cleanup:
242
+ description: "Removing tech debt, deprecated code, or fixing violations"
243
+ focus: "Inventory of issues, prioritized fixes, validation gates"
244
+
245
+ tracking:
246
+ description: "Ongoing progress log across multiple sessions"
247
+ focus: "Chronological log, metrics, cross-session dependencies"
248
+
249
+ # Status values - deterministic state machine
250
+ status:
251
+ values:
252
+ - INIT # Session file created, scope being defined
253
+ - PLANNED # Scope locked, phases defined, ready for work
254
+ - ACTIVE # Work in progress
255
+ - BLOCKED # Cannot proceed, dependency or decision needed
256
+ - COMPLETE # All success criteria met
257
+ - OBSOLETE # Superseded by another session
258
+ transitions:
259
+ INIT: [PLANNED, OBSOLETE]
260
+ PLANNED: [ACTIVE, OBSOLETE]
261
+ ACTIVE: [BLOCKED, COMPLETE, OBSOLETE]
262
+ BLOCKED: [ACTIVE, OBSOLETE]
263
+ COMPLETE: [] # Terminal state
264
+ OBSOLETE: [] # Terminal state
265
+
266
+ # Infrastructure archetypes - what can be changed
267
+ archetypes:
268
+ database:
269
+ id: "db"
270
+ description: "Supabase PostgreSQL with JSONB contract pattern"
271
+ artifacts:
272
+ - "supabase/migrations/*.sql"
273
+ patterns:
274
+ - "Contract-driven JSONB: id + data JSONB + timestamps"
275
+ - "Views for query optimization"
276
+ - "RLS policies for security"
277
+ validation: "supabase db push --dry-run"
278
+
279
+ backend:
280
+ id: "be"
281
+ description: "Python FastAPI with 4-layer architecture"
282
+ artifacts:
283
+ - "python/{wagon}/{feature}/src/domain/"
284
+ - "python/{wagon}/{feature}/src/application/"
285
+ - "python/{wagon}/{feature}/src/integration/"
286
+ - "python/{wagon}/{feature}/src/presentation/"
287
+ patterns:
288
+ - "Domain: Pure business logic, no external imports"
289
+ - "Application: Use cases, orchestration"
290
+ - "Integration: Adapters, clients, repositories"
291
+ - "Presentation: Controllers, DTOs"
292
+ validation: "python3 -m pytest atdd/coder/validators/test_python_architecture.py -v"
293
+
294
+ frontend:
295
+ id: "fe"
296
+ description: "TypeScript/Preact with 4-layer architecture"
297
+ artifacts:
298
+ - "web/src/{wagon}/{feature}/domain/"
299
+ - "web/src/{wagon}/{feature}/application/"
300
+ - "web/src/{wagon}/{feature}/integration/"
301
+ - "web/src/{wagon}/{feature}/presentation/"
302
+ patterns:
303
+ - "Domain: Types, interfaces, pure logic"
304
+ - "Application: Hooks, state management"
305
+ - "Integration: API clients, adapters"
306
+ - "Presentation: Components, pages"
307
+ validation: "cd web && npm run typecheck"
308
+
309
+ contracts:
310
+ id: "contracts"
311
+ description: "JSON Schema contracts for cross-wagon communication"
312
+ artifacts:
313
+ - "contracts/{domain}/{entity}/*.schema.json"
314
+ patterns:
315
+ - "Schema-first design"
316
+ - "Version in filename if breaking changes"
317
+ - "Shared via contracts/ directory"
318
+ validation: "python3 -m pytest atdd/tester/validators/test_contract_*.py -v"
319
+
320
+ wmbt:
321
+ id: "wmbt"
322
+ description: "What Must Be True acceptance criteria"
323
+ artifacts:
324
+ - "plan/{wagon}/*.yaml"
325
+ patterns:
326
+ - "URN: wmbt:{wagon}:{STEP_CODE}{NNN}"
327
+ - "Step codes: D=define, L=locate, P=prepare, C=confirm, E=execute, M=monitor, Y=modify, R=resolve, K=conclude"
328
+ - "Max 5 acceptances per WMBT"
329
+ validation: "python3 -m pytest atdd/planner/validators/test_wmbt_*.py -v"
330
+
331
+ wagon:
332
+ id: "wagon"
333
+ description: "Bounded context / domain module"
334
+ artifacts:
335
+ - "plan/{wagon}/_*.yaml"
336
+ - "plan/{wagon}/features/*.yaml"
337
+ patterns:
338
+ - "Manifest: plan/{wagon}/_{wagon}.yaml"
339
+ - "Features: plan/{wagon}/features/{feature}.yaml"
340
+ - "Registered in plan/_wagons.yaml"
341
+ validation: "python3 -m pytest atdd/planner/validators/test_wagon_*.py -v"
342
+
343
+ train:
344
+ id: "train"
345
+ description: "Production release orchestration"
346
+ artifacts:
347
+ - "plan/_trains.yaml"
348
+ patterns:
349
+ - "Train = release with multiple wagons"
350
+ - "Defines deployment order and dependencies"
351
+ validation: "python3 -m pytest atdd/planner/validators/test_train_*.py -v"
352
+
353
+ telemetry:
354
+ id: "telemetry"
355
+ description: "Observability and monitoring artifacts"
356
+ artifacts:
357
+ - "telemetry/_telemetry.yaml"
358
+ - "telemetry/{domain}/*.yaml"
359
+ patterns:
360
+ - "Metrics: telemetry:metric:{layer}:{wagon}:{name}"
361
+ - "Logs: Structured with URN attributes"
362
+ - "Traces: Span context propagation"
363
+ validation: "python3 -m pytest atdd/tester/validators/test_telemetry_*.py -v"
364
+
365
+ migrations:
366
+ id: "migrations"
367
+ description: "Database schema evolution"
368
+ artifacts:
369
+ - "supabase/migrations/*.sql"
370
+ patterns:
371
+ - "Filename: {timestamp}_{description}.sql"
372
+ - "Idempotent when possible"
373
+ - "Rollback plan documented"
374
+ validation: "supabase db push --dry-run"
375
+
376
+ # Mandatory sections - ALL sessions must have these
377
+ sections:
378
+ header:
379
+ required: true
380
+ description: "Session metadata at top of file"
381
+ fields:
382
+ - name: "title"
383
+ format: "# SESSION-{NN}: {Title}"
384
+ example: "# SESSION-36: Fix ATDD Validator Failures"
385
+
386
+ - name: "date"
387
+ format: "**Date:** YYYY-MM-DD"
388
+ example: "**Date:** 2026-01-19"
389
+
390
+ - name: "status"
391
+ format: "**Status:** {STATUS}"
392
+ values: ["INIT", "PLANNED", "ACTIVE", "BLOCKED", "COMPLETE", "OBSOLETE"]
393
+
394
+ - name: "branch"
395
+ format: "**Branch:** {branch-name}"
396
+ example: "**Branch:** mechanic"
397
+
398
+ - name: "type"
399
+ format: "**Type:** {type}"
400
+ values: ["implementation", "migration", "refactor", "analysis", "planning", "cleanup", "tracking"]
401
+
402
+ - name: "complexity"
403
+ format: "**Complexity:** {stars} ({label})"
404
+ values:
405
+ - "1 (Trivial)"
406
+ - "2 (Low)"
407
+ - "3 (Medium)"
408
+ - "4 (High)"
409
+ - "5 (Very High)"
410
+
411
+ - name: "archetypes"
412
+ format: "**Archetypes:** {comma-separated-list}"
413
+ example: "**Archetypes:** db, be, contracts, wmbt"
414
+
415
+ context:
416
+ required: true
417
+ description: "Why this session exists"
418
+ subsections:
419
+ - name: "Problem Statement"
420
+ format: "table"
421
+ columns: ["Aspect", "Current", "Target", "Issue"]
422
+
423
+ - name: "User Impact"
424
+ format: "paragraph"
425
+ description: "How this affects users or developers"
426
+
427
+ - name: "Root Cause"
428
+ format: "paragraph"
429
+ description: "Why the problem exists"
430
+
431
+ scope:
432
+ required: true
433
+ description: "Boundaries of the work"
434
+ subsections:
435
+ - name: "In Scope"
436
+ format: "bullet-list"
437
+
438
+ - name: "Out of Scope"
439
+ format: "bullet-list"
440
+
441
+ - name: "Dependencies"
442
+ format: "bullet-list"
443
+ description: "Other sessions or external requirements"
444
+
445
+ architecture:
446
+ required: true
447
+ description: "Technical design"
448
+ subsections:
449
+ - name: "Conceptual Model"
450
+ format: "ascii-diagram or table"
451
+ description: "Key concepts and relationships"
452
+
453
+ - name: "Before State"
454
+ format: "code-block"
455
+ description: "Current architecture/structure"
456
+
457
+ - name: "After State"
458
+ format: "code-block"
459
+ description: "Target architecture/structure"
460
+
461
+ - name: "Data Model"
462
+ format: "sql or yaml"
463
+ description: "Schema changes if applicable"
464
+ when: "archetypes includes db"
465
+
466
+ phases:
467
+ required: true
468
+ description: "Ordered work breakdown"
469
+ format: |
470
+ ### Phase {N}: {Name}
471
+ **Gate:** {validation-command}
472
+ **Deliverables:**
473
+ - {artifact-path} - {description}
474
+ **Files:**
475
+ | File | Change |
476
+ |------|--------|
477
+
478
+ progress:
479
+ required: true
480
+ description: "Current state tracking"
481
+ subsections:
482
+ - name: "Progress Tracker"
483
+ format: "table"
484
+ columns: ["Phase", "Task", "Status", "Gate"]
485
+ status_values: ["TODO", "IN_PROGRESS", "DONE", "BLOCKED", "SKIPPED", "N/A"]
486
+
487
+ - name: "WMBT Status"
488
+ format: "table"
489
+ columns: ["WMBT", "Description", "RED", "GREEN", "REFACTOR"]
490
+ when: "type == implementation"
491
+ status_values: ["TODO", "IN_PROGRESS", "DONE", "SKIPPED", "N/A"]
492
+
493
+ - name: "ATDD Phase Summary"
494
+ format: "table"
495
+ columns: ["Phase", "Description", "Status", "Gate"]
496
+ when: "type == implementation"
497
+ phases:
498
+ RED:
499
+ description: "Write failing tests from acceptances"
500
+ gate: "pytest {test-path} -v (expect FAIL)"
501
+ GREEN:
502
+ description: "Implement minimal code to pass tests"
503
+ gate: "pytest {test-path} -v (expect PASS)"
504
+ REFACTOR:
505
+ description: "Clean architecture, 4-layer compliance"
506
+ gate: "pytest atdd/coder/validators/ -v"
507
+
508
+ validation:
509
+ required: true
510
+ description: "How to verify correctness"
511
+ subsections:
512
+ - name: "Gate Commands"
513
+ format: "code-blocks"
514
+ description: "Commands to run at each phase gate"
515
+
516
+ - name: "Success Criteria"
517
+ format: "checkbox-list"
518
+ description: "Measurable outcomes"
519
+
520
+ decisions:
521
+ required: true
522
+ description: "Choices made during session"
523
+ format: "table"
524
+ columns: ["#", "Question", "Decision", "Rationale"]
525
+
526
+ session_log:
527
+ required: true
528
+ description: "Chronological work diary"
529
+ format: |
530
+ ### Session {N} (YYYY-MM-DD): {Focus}
531
+ **Completed:**
532
+ - {work-item}
533
+ **Blocked:**
534
+ - {blocker} (if any)
535
+ **Next:**
536
+ - {next-action}
537
+
538
+ artifacts:
539
+ required: true
540
+ description: "Files created or modified"
541
+ subsections:
542
+ - name: "Created"
543
+ format: "bullet-list with paths"
544
+
545
+ - name: "Modified"
546
+ format: "bullet-list with paths"
547
+
548
+ - name: "Deleted"
549
+ format: "bullet-list with paths"
550
+
551
+ related:
552
+ required: true
553
+ description: "Cross-references"
554
+ subsections:
555
+ - name: "Related Sessions"
556
+ format: "bullet-list"
557
+
558
+ - name: "Related WMBTs"
559
+ format: "bullet-list"
560
+ when: "type == implementation"
561
+
562
+ # Rules for session management
563
+ rules:
564
+ creation:
565
+ - "FIRST: Rename Claude conversation with /rename SESSION-{NN}-{slug}"
566
+ - "Use next available session number"
567
+ - "Copy template from atdd package and fill all sections"
568
+ - "Set status to INIT"
569
+ - "Create branch if needed"
570
+
571
+ implementation:
572
+ - "BEFORE creating/updating files: Identify existing patterns in the codebase"
573
+ - "New files MUST follow conventions in atdd/*/conventions/*.yaml"
574
+ - "New files MUST match patterns of similar existing files"
575
+ - "When in doubt: find 2-3 similar files and replicate their structure"
576
+ - "NEVER introduce new patterns without explicit decision documented"
577
+ - "Validate against conventions before committing"
578
+
579
+ pattern_discovery:
580
+ - "Search for similar files: glob, grep for class/function names"
581
+ - "Check layer structure: domain/, application/, integration/, presentation/"
582
+ - "Check naming conventions: URN patterns, file naming, test naming"
583
+ - "Check import patterns: what's allowed between layers/wagons"
584
+ - "Document discovered patterns in Architecture section"
585
+
586
+ progression:
587
+ - "Update status on state transitions"
588
+ - "Log all work in Session Log section"
589
+ - "Run gate commands before marking phase DONE"
590
+ - "Update Progress Tracker after each work item"
591
+
592
+ completion:
593
+ - "All success criteria must be checked"
594
+ - "All phases must be DONE or SKIPPED with rationale"
595
+ - "Set status to COMPLETE"
596
+ - "Rename file: SESSION-{NN}-{slug}.md → SESSION-{NN}-{slug}-(completed).md"
597
+ - "Or add checkmark: SESSION-{NN}-{slug}-✅.md"
598
+ - "Move to archive/ after 1 week"
599
+
600
+ blocking:
601
+ - "Document blocker in Session Log"
602
+ - "Set status to BLOCKED"
603
+ - "Create dependency link if blocked by another session"
604
+
605
+ obsolete:
606
+ - "Add warning banner at top of file"
607
+ - "Link to superseding session"
608
+ - "Set status to OBSOLETE"
609
+
610
+ # Gate Tests - Required validation gates per session
611
+ # Each session MUST define gate_tests that reference ATDD validators
612
+ gate_tests:
613
+ description: "Validation gates that enforce conventions via ATDD validators"
614
+ required: true
615
+
616
+ # Structure of a gate_test entry
617
+ structure:
618
+ id:
619
+ type: "string"
620
+ pattern: "GT-{NNN}"
621
+ description: "Unique gate test identifier"
622
+ phase:
623
+ type: "string"
624
+ values: ["design", "implementation", "validation", "completion"]
625
+ description: "Which phase this gate applies to"
626
+ archetype:
627
+ type: "string"
628
+ values: ["db", "be", "fe", "contracts", "wmbt", "wagon", "train", "telemetry", "migrations", "all"]
629
+ description: "Which archetype this gate validates (or 'all')"
630
+ command:
631
+ type: "string"
632
+ description: "Bash command to execute for validation"
633
+ expected:
634
+ type: "string"
635
+ values: ["PASS", "FAIL"]
636
+ description: "Expected outcome (FAIL for RED phase, PASS otherwise)"
637
+ atdd_validator:
638
+ type: "string"
639
+ pattern: "atdd/{scope}/validators/{file}.py"
640
+ description: "Path to ATDD validator being invoked"
641
+ required: true
642
+
643
+ # Required gates based on archetypes
644
+ required_by_archetype:
645
+ db:
646
+ - command: "supabase db push --dry-run"
647
+ atdd_validator: "manual"
648
+ - command: "python3 -m pytest atdd/tester/validators/test_migration_*.py -v"
649
+ atdd_validator: "atdd/tester/validators/test_migration_coverage.py"
650
+
651
+ be:
652
+ - command: "python3 -m pytest atdd/coder/validators/test_python_architecture.py -v"
653
+ atdd_validator: "atdd/coder/validators/test_python_architecture.py"
654
+ - command: "python3 -m pytest atdd/coder/validators/test_import_boundaries.py -v"
655
+ atdd_validator: "atdd/coder/validators/test_import_boundaries.py"
656
+
657
+ fe:
658
+ - command: "cd web && npm run typecheck"
659
+ atdd_validator: "manual"
660
+ - command: "python3 -m pytest atdd/coder/validators/test_typescript_architecture.py -v"
661
+ atdd_validator: "atdd/coder/validators/test_typescript_architecture.py"
662
+
663
+ contracts:
664
+ - command: "python3 -m pytest atdd/tester/validators/test_contract_*.py -v"
665
+ atdd_validator: "atdd/tester/validators/test_contract_schema_compliance.py"
666
+
667
+ wmbt:
668
+ - command: "python3 -m pytest atdd/planner/validators/test_wmbt_*.py -v"
669
+ atdd_validator: "atdd/planner/validators/test_wmbt_consistency.py"
670
+
671
+ wagon:
672
+ - command: "python3 -m pytest atdd/planner/validators/test_wagon_*.py -v"
673
+ atdd_validator: "atdd/planner/validators/test_wagon_urn_chain.py"
674
+ - command: "python3 -m pytest atdd/coder/validators/test_wagon_boundaries.py -v"
675
+ atdd_validator: "atdd/coder/validators/test_wagon_boundaries.py"
676
+
677
+ train:
678
+ - command: "python3 -m pytest atdd/planner/validators/test_train_*.py -v"
679
+ atdd_validator: "atdd/planner/validators/test_train_validation.py"
680
+
681
+ telemetry:
682
+ - command: "python3 -m pytest atdd/tester/validators/test_telemetry_*.py -v"
683
+ atdd_validator: "atdd/tester/validators/test_telemetry_structure.py"
684
+
685
+ migrations:
686
+ - command: "supabase db push --dry-run"
687
+ atdd_validator: "manual"
688
+ - command: "python3 -m pytest atdd/tester/validators/test_migration_*.py -v"
689
+ atdd_validator: "atdd/tester/validators/test_migration_coverage.py"
690
+
691
+ # Universal gates (all sessions)
692
+ universal:
693
+ design_phase:
694
+ - id: "GT-001"
695
+ phase: "design"
696
+ archetype: "all"
697
+ command: "python3 -m pytest atdd/coach/validators/test_session_validation.py -v"
698
+ expected: "PASS"
699
+ atdd_validator: "atdd/coach/validators/test_session_validation.py"
700
+ description: "Session structure compliance"
701
+
702
+ completion_phase:
703
+ - id: "GT-900"
704
+ phase: "completion"
705
+ archetype: "all"
706
+ command: "python3 -m pytest atdd/ -v --tb=short"
707
+ expected: "PASS"
708
+ atdd_validator: "atdd/"
709
+ description: "Full ATDD validator suite"
710
+
711
+ # ATDD cycle gates (for implementation sessions)
712
+ atdd_cycle:
713
+ red:
714
+ description: "Write failing tests from acceptances"
715
+ gates:
716
+ - id: "GT-100"
717
+ phase: "implementation"
718
+ command: "pytest {test_path} -v"
719
+ expected: "FAIL"
720
+ atdd_validator: "feature-specific"
721
+ description: "Tests must fail before implementation"
722
+
723
+ green:
724
+ description: "Implement minimal code to pass tests"
725
+ gates:
726
+ - id: "GT-200"
727
+ phase: "implementation"
728
+ command: "pytest {test_path} -v"
729
+ expected: "PASS"
730
+ atdd_validator: "feature-specific"
731
+ description: "Tests must pass after implementation"
732
+
733
+ refactor:
734
+ description: "Clean architecture, convention compliance"
735
+ gates:
736
+ - id: "GT-300"
737
+ phase: "implementation"
738
+ command: "python3 -m pytest atdd/coder/validators/ -v"
739
+ expected: "PASS"
740
+ atdd_validator: "atdd/coder/validators/"
741
+ description: "Architecture conventions met"
742
+
743
+ # Validation
744
+ validation:
745
+ command: "python3 -m pytest atdd/coach/validators/test_session_*.py -v"
746
+ checks:
747
+ - "All required sections present"
748
+ - "Status is valid value"
749
+ - "Type is valid value"
750
+ - "Archetypes are valid values"
751
+ - "Progress tracker has valid status values"
752
+ - "Session log has at least one entry"
753
+ - "Gate tests defined for all declared archetypes"
754
+ - "Gate tests reference valid ATDD validators"