atdd 0.3.3__py3-none-any.whl → 0.4.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 (69) hide show
  1. atdd/cli.py +223 -76
  2. atdd/coach/commands/add_persistence_metadata.py +3 -1
  3. atdd/coach/commands/infer_governance_status.py +3 -1
  4. atdd/coach/commands/interface.py +3 -1
  5. atdd/coach/commands/inventory.py +2 -2
  6. atdd/coach/commands/migration.py +11 -6
  7. atdd/coach/commands/test_runner.py +66 -27
  8. atdd/coach/commands/traceability.py +3 -1
  9. atdd/coach/conventions/session.convention.yaml +26 -26
  10. atdd/coach/templates/ATDD.md +15 -15
  11. atdd/coach/templates/SESSION-TEMPLATE.md +12 -12
  12. atdd/coach/utils/repo.py +24 -8
  13. atdd/coach/validators/shared_fixtures.py +8 -3
  14. atdd/coach/validators/test_session_validation.py +4 -4
  15. atdd/coder/conventions/tests/test_component_taxonomy.py +4 -3
  16. atdd/coder/conventions/tests/test_component_urn_naming.py +3 -1
  17. atdd/coder/validators/test_commons_structure.py +3 -1
  18. atdd/coder/validators/test_complexity.py +3 -1
  19. atdd/coder/validators/test_cross_language_consistency.py +3 -1
  20. atdd/coder/validators/test_design_system_compliance.py +3 -1
  21. atdd/coder/validators/test_dto_testing_patterns.py +4 -2
  22. atdd/coder/validators/test_green_cross_stack_layers.py +3 -1
  23. atdd/coder/validators/test_green_layer_dependencies.py +3 -1
  24. atdd/coder/validators/test_green_python_layer_structure.py +3 -1
  25. atdd/coder/validators/test_green_supabase_layer_structure.py +2 -1
  26. atdd/coder/validators/test_import_boundaries.py +3 -1
  27. atdd/coder/validators/test_init_file_urns.py +3 -1
  28. atdd/coder/validators/test_preact_layer_boundaries.py +3 -1
  29. atdd/coder/validators/test_presentation_convention.py +3 -1
  30. atdd/coder/validators/test_python_architecture.py +3 -1
  31. atdd/coder/validators/test_quality_metrics.py +2 -1
  32. atdd/coder/validators/test_station_master_pattern.py +4 -2
  33. atdd/coder/validators/test_train_infrastructure.py +3 -1
  34. atdd/coder/validators/test_train_urns.py +3 -1
  35. atdd/coder/validators/test_typescript_architecture.py +3 -1
  36. atdd/coder/validators/test_usecase_structure.py +3 -1
  37. atdd/coder/validators/test_wagon_boundaries.py +2 -1
  38. atdd/planner/validators/test_plan_urn_resolution.py +3 -1
  39. atdd/planner/validators/test_wagon_urn_chain.py +3 -1
  40. atdd/planner/validators/test_wmbt_consistency.py +3 -1
  41. atdd/planner/validators/test_wmbt_vocabulary.py +2 -1
  42. atdd/tester/conventions/contract.convention.yaml +1 -1
  43. atdd/tester/conventions/migration.convention.yaml +5 -5
  44. atdd/tester/validators/cleanup_duplicate_headers.py +3 -1
  45. atdd/tester/validators/cleanup_duplicate_headers_v2.py +3 -1
  46. atdd/tester/validators/coverage_gap_report.py +3 -1
  47. atdd/tester/validators/fix_dual_ac_references.py +3 -1
  48. atdd/tester/validators/remove_duplicate_lines.py +3 -1
  49. atdd/tester/validators/test_acceptance_urn_filename_mapping.py +3 -1
  50. atdd/tester/validators/test_acceptance_urn_separator.py +3 -1
  51. atdd/tester/validators/test_contract_schema_compliance.py +3 -1
  52. atdd/tester/validators/test_contracts_structure.py +3 -1
  53. atdd/tester/validators/test_coverage_adequacy.py +3 -1
  54. atdd/tester/validators/test_dual_ac_reference.py +3 -1
  55. atdd/tester/validators/test_fixture_validity.py +2 -1
  56. atdd/tester/validators/test_isolation.py +3 -1
  57. atdd/tester/validators/test_migration_coverage.py +4 -2
  58. atdd/tester/validators/test_migration_generation.py +3 -1
  59. atdd/tester/validators/test_python_test_naming.py +3 -1
  60. atdd/tester/validators/test_red_layer_validation.py +2 -1
  61. atdd/tester/validators/test_red_python_layer_structure.py +2 -1
  62. atdd/tester/validators/test_red_supabase_layer_structure.py +3 -1
  63. atdd/tester/validators/test_telemetry_structure.py +3 -1
  64. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/METADATA +41 -12
  65. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/RECORD +69 -69
  66. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/WHEEL +0 -0
  67. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/entry_points.txt +0 -0
  68. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/licenses/LICENSE +0 -0
  69. {atdd-0.3.3.dist-info → atdd-0.4.0.dist-info}/top_level.txt +0 -0
atdd/cli.py CHANGED
@@ -3,14 +3,14 @@
3
3
  ATDD Platform - Unified command-line interface.
4
4
 
5
5
  The coach orchestrates all ATDD lifecycle operations:
6
- - Inventory: Catalog repository artifacts
7
- - Test: Run meta-tests (planner/tester/coder)
8
- - Report: Generate test reports
9
- - Validate: Validate artifacts against conventions
10
- - Init: Initialize ATDD structure in consumer repos
11
- - Session: Manage session files
12
- - Sync: Sync ATDD rules to agent config files
13
- - Gate: Verify agents loaded ATDD rules
6
+ - validate: Run validators (planner/tester/coder/coach)
7
+ - inventory: Catalog repository artifacts
8
+ - status: Show platform status
9
+ - registry: Update registries from source files
10
+ - init: Initialize ATDD structure in consumer repos
11
+ - session: Manage session files
12
+ - sync: Sync ATDD rules to agent config files
13
+ - gate: Verify agents loaded ATDD rules
14
14
 
15
15
  Usage:
16
16
  atdd init # Initialize ATDD in consumer repo
@@ -21,18 +21,22 @@ Usage:
21
21
  atdd sync --verify # Check if files are in sync
22
22
  atdd sync --agent claude # Sync specific agent only
23
23
  atdd gate # Show ATDD gate verification
24
- atdd --inventory # Generate inventory
25
- atdd --test all # Run all meta-tests
26
- atdd --test planner # Run planner phase tests
27
- atdd --test tester # Run tester phase tests
28
- atdd --test coder # Run coder phase tests
29
- atdd --test all --coverage # With coverage report
30
- atdd --test all --html # With HTML report
24
+ atdd validate # Run all validators
25
+ atdd validate planner # Run planner validators
26
+ atdd validate tester # Run tester validators
27
+ atdd validate coder # Run coder validators
28
+ atdd validate --quick # Quick smoke test
29
+ atdd validate --coverage # With coverage report
30
+ atdd inventory # Generate inventory (YAML)
31
+ atdd inventory --format json # Generate inventory (JSON)
32
+ atdd status # Show platform status
33
+ atdd registry update # Update all registries
31
34
  atdd --help # Show help
32
35
  """
33
36
 
34
37
  import argparse
35
38
  import sys
39
+ import warnings
36
40
  from pathlib import Path
37
41
 
38
42
  ATDD_DIR = Path(__file__).parent
@@ -48,6 +52,11 @@ from atdd.coach.utils.repo import find_repo_root
48
52
  from atdd.version_check import print_update_notice, print_upgrade_sync_notice
49
53
 
50
54
 
55
+ def _deprecation_warning(old: str, new: str) -> None:
56
+ """Emit a deprecation warning for legacy flags."""
57
+ print(f"\033[33m⚠️ Deprecated: '{old}' will be removed. Use '{new}' instead.\033[0m")
58
+
59
+
51
60
  class ATDDCoach:
52
61
  """
53
62
  ATDD Platform Coach - orchestrates all operations.
@@ -61,7 +70,7 @@ class ATDDCoach:
61
70
  def __init__(self, repo_root: Path = None):
62
71
  self.repo_root = repo_root or find_repo_root()
63
72
  self.inventory = RepositoryInventory(self.repo_root)
64
- self.test_runner = TestRunner(self.repo_root)
73
+ self.validator_runner = TestRunner(self.repo_root)
65
74
  self.registry_updater = RegistryUpdater(self.repo_root)
66
75
 
67
76
  def run_inventory(self, format: str = "yaml") -> int:
@@ -81,7 +90,7 @@ class ATDDCoach:
81
90
 
82
91
  return 0
83
92
 
84
- def run_tests(
93
+ def run_validators(
85
94
  self,
86
95
  phase: str = "all",
87
96
  verbose: bool = False,
@@ -89,11 +98,11 @@ class ATDDCoach:
89
98
  html: bool = False,
90
99
  quick: bool = False
91
100
  ) -> int:
92
- """Run ATDD meta-tests."""
101
+ """Run ATDD validators."""
93
102
  if quick:
94
- return self.test_runner.quick_check()
103
+ return self.validator_runner.quick_check()
95
104
 
96
- return self.test_runner.run_tests(
105
+ return self.validator_runner.run_tests(
97
106
  phase=phase,
98
107
  verbose=verbose,
99
108
  coverage=coverage,
@@ -119,21 +128,23 @@ class ATDDCoach:
119
128
  print("ATDD Platform Status")
120
129
  print("=" * 60)
121
130
  print("\nDirectory structure:")
122
- print(f" 📋 Planner tests: {ATDD_DIR / 'planner'}")
123
- print(f" 🧪 Tester tests: {ATDD_DIR / 'tester'}")
124
- print(f" ⚙️ Coder tests: {ATDD_DIR / 'coder'}")
125
- print(f" 🎯 Coach: {ATDD_DIR / 'coach'}")
131
+ print(f" 📋 Planner validators: {ATDD_DIR / 'planner' / 'validators'}")
132
+ print(f" 🧪 Tester validators: {ATDD_DIR / 'tester' / 'validators'}")
133
+ print(f" ⚙️ Coder validators: {ATDD_DIR / 'coder' / 'validators'}")
134
+ print(f" 🎯 Coach validators: {ATDD_DIR / 'coach' / 'validators'}")
126
135
 
127
136
  # Quick stats
128
- planner_tests = len(list((ATDD_DIR / "planner").glob("test_*.py")))
129
- tester_tests = len(list((ATDD_DIR / "tester").glob("test_*.py")))
130
- coder_tests = len(list((ATDD_DIR / "coder").glob("test_*.py")))
131
-
132
- print(f"\nTest files:")
133
- print(f" Planner: {planner_tests} files")
134
- print(f" Tester: {tester_tests} files")
135
- print(f" Coder: {coder_tests} files")
136
- print(f" Total: {planner_tests + tester_tests + coder_tests} files")
137
+ planner_validators = len(list((ATDD_DIR / "planner" / "validators").glob("test_*.py")))
138
+ tester_validators = len(list((ATDD_DIR / "tester" / "validators").glob("test_*.py")))
139
+ coder_validators = len(list((ATDD_DIR / "coder" / "validators").glob("test_*.py")))
140
+ coach_validators = len(list((ATDD_DIR / "coach" / "validators").glob("test_*.py")))
141
+
142
+ print(f"\nValidator files:")
143
+ print(f" Planner: {planner_validators} files")
144
+ print(f" Tester: {tester_validators} files")
145
+ print(f" Coder: {coder_validators} files")
146
+ print(f" Coach: {coach_validators} files")
147
+ print(f" Total: {planner_validators + tester_validators + coder_validators + coach_validators} files")
137
148
 
138
149
  return 0
139
150
 
@@ -149,6 +160,27 @@ Examples:
149
160
  %(prog)s init Create atdd-sessions/, .atdd/
150
161
  %(prog)s init --force Overwrite if exists
151
162
 
163
+ # Run validators
164
+ %(prog)s validate Run all validators
165
+ %(prog)s validate planner Run planner validators only
166
+ %(prog)s validate tester Run tester validators only
167
+ %(prog)s validate coder Run coder validators only
168
+ %(prog)s validate --quick Quick smoke test
169
+ %(prog)s validate --coverage With coverage report
170
+ %(prog)s validate --html With HTML report
171
+ %(prog)s validate -v Verbose output
172
+
173
+ # Repository inspection
174
+ %(prog)s inventory Generate full inventory (YAML)
175
+ %(prog)s inventory --format json Generate inventory (JSON)
176
+ %(prog)s status Show platform status
177
+
178
+ # Registry management
179
+ %(prog)s registry update Update all registries
180
+ %(prog)s registry update wagons Update wagon registry only
181
+ %(prog)s registry update contracts Update contract registry only
182
+ %(prog)s registry update telemetry Update telemetry registry only
183
+
152
184
  # Session management
153
185
  %(prog)s session new my-feature Create SESSION-NN-my-feature.md
154
186
  %(prog)s session new my-feature --type migration
@@ -165,29 +197,98 @@ Examples:
165
197
  %(prog)s gate Show gate verification info
166
198
  %(prog)s gate --json Output as JSON
167
199
 
168
- # Existing flag-based commands (backwards compatible)
169
- %(prog)s --inventory Generate full inventory (YAML)
170
- %(prog)s --inventory --format json Generate inventory (JSON)
171
- %(prog)s --test all Run all meta-tests
172
- %(prog)s --test planner Run planner phase tests
173
- %(prog)s --test tester Run tester phase tests
174
- %(prog)s --test coder Run coder phase tests
175
- %(prog)s --test all --coverage Run with coverage report
176
- %(prog)s --test all --html Run with HTML report
177
- %(prog)s --test all --verbose Run with verbose output
178
- %(prog)s --quick Quick smoke test
179
- %(prog)s --status Show platform status
180
-
181
200
  Phase descriptions:
182
201
  planner - Validates planning artifacts (wagons, trains, URNs)
183
202
  tester - Validates testing artifacts (contracts, telemetry)
184
203
  coder - Validates implementation (architecture, quality)
204
+ coach - Validates coach artifacts (sessions, registries)
185
205
  """
186
206
  )
187
207
 
188
- # Subparsers for new commands
208
+ # Subparsers for commands
189
209
  subparsers = parser.add_subparsers(dest="command", help="Commands")
190
210
 
211
+ # ----- atdd validate [phase] -----
212
+ validate_parser = subparsers.add_parser(
213
+ "validate",
214
+ help="Run ATDD validators",
215
+ description="Run validators to check artifacts against conventions"
216
+ )
217
+ validate_parser.add_argument(
218
+ "phase",
219
+ nargs="?",
220
+ type=str,
221
+ default="all",
222
+ choices=["all", "planner", "tester", "coder", "coach"],
223
+ help="Phase to validate (default: all)"
224
+ )
225
+ validate_parser.add_argument(
226
+ "--quick", "-q",
227
+ action="store_true",
228
+ help="Quick smoke test (no parallel, no reports)"
229
+ )
230
+ validate_parser.add_argument(
231
+ "--verbose", "-v",
232
+ action="store_true",
233
+ help="Verbose output"
234
+ )
235
+ validate_parser.add_argument(
236
+ "--coverage",
237
+ action="store_true",
238
+ help="Generate coverage report"
239
+ )
240
+ validate_parser.add_argument(
241
+ "--html",
242
+ action="store_true",
243
+ help="Generate HTML report"
244
+ )
245
+
246
+ # ----- atdd inventory -----
247
+ inventory_parser = subparsers.add_parser(
248
+ "inventory",
249
+ help="Generate repository inventory",
250
+ description="Catalog all ATDD artifacts in the repository"
251
+ )
252
+ inventory_parser.add_argument(
253
+ "--format", "-f",
254
+ type=str,
255
+ choices=["yaml", "json"],
256
+ default="yaml",
257
+ help="Output format (default: yaml)"
258
+ )
259
+
260
+ # ----- atdd status -----
261
+ subparsers.add_parser(
262
+ "status",
263
+ help="Show platform status",
264
+ description="Display ATDD platform status and validator counts"
265
+ )
266
+
267
+ # ----- atdd registry {update} -----
268
+ registry_parser = subparsers.add_parser(
269
+ "registry",
270
+ help="Manage registries",
271
+ description="Update registries from source files"
272
+ )
273
+ registry_subparsers = registry_parser.add_subparsers(
274
+ dest="registry_command",
275
+ help="Registry commands"
276
+ )
277
+
278
+ # atdd registry update [type]
279
+ registry_update_parser = registry_subparsers.add_parser(
280
+ "update",
281
+ help="Update registries from source files"
282
+ )
283
+ registry_update_parser.add_argument(
284
+ "type",
285
+ nargs="?",
286
+ type=str,
287
+ default="all",
288
+ choices=["all", "wagons", "contracts", "telemetry"],
289
+ help="Registry type to update (default: all)"
290
+ )
291
+
191
292
  # ----- atdd init -----
192
293
  init_parser = subparsers.add_parser(
193
294
  "init",
@@ -289,9 +390,9 @@ Phase descriptions:
289
390
  help="Output as JSON for programmatic use"
290
391
  )
291
392
 
292
- # ----- Existing flag-based arguments (backwards compatible) -----
393
+ # ----- Legacy flag-based arguments (deprecated, kept for backwards compatibility) -----
293
394
 
294
- # Repository root override
395
+ # Repository root override (not deprecated - still useful)
295
396
  parser.add_argument(
296
397
  "--repo",
297
398
  type=str,
@@ -299,75 +400,110 @@ Phase descriptions:
299
400
  help="Target repository root (default: auto-detect from .atdd/)"
300
401
  )
301
402
 
302
- # Main command groups
303
- parser.add_argument(
304
- "--inventory",
305
- action="store_true",
306
- help="Generate repository inventory"
307
- )
308
-
403
+ # DEPRECATED: --test → atdd validate
309
404
  parser.add_argument(
310
405
  "--test",
311
406
  type=str,
312
407
  choices=["all", "planner", "tester", "coder"],
313
408
  metavar="PHASE",
314
- help="Run tests for specific phase (all, planner, tester, coder)"
409
+ help=argparse.SUPPRESS # Hide from help, deprecated
315
410
  )
316
411
 
412
+ # DEPRECATED: --inventory → atdd inventory
413
+ parser.add_argument(
414
+ "--inventory",
415
+ action="store_true",
416
+ help=argparse.SUPPRESS # Hide from help, deprecated
417
+ )
418
+
419
+ # DEPRECATED: --status → atdd status
317
420
  parser.add_argument(
318
421
  "--status",
319
422
  action="store_true",
320
- help="Show platform status summary"
423
+ help=argparse.SUPPRESS # Hide from help, deprecated
321
424
  )
322
425
 
426
+ # DEPRECATED: --quick → atdd validate --quick
323
427
  parser.add_argument(
324
428
  "--quick",
325
429
  action="store_true",
326
- help="Quick smoke test (no parallel, no reports)"
430
+ help=argparse.SUPPRESS # Hide from help, deprecated
327
431
  )
328
432
 
433
+ # DEPRECATED: --update-registry → atdd registry update
329
434
  parser.add_argument(
330
435
  "--update-registry",
331
436
  type=str,
332
437
  choices=["all", "wagons", "contracts", "telemetry"],
333
438
  metavar="TYPE",
334
- help="Update registry from source files (all, wagons, contracts, telemetry)"
439
+ help=argparse.SUPPRESS # Hide from help, deprecated
335
440
  )
336
441
 
337
- # Options for inventory
442
+ # Options that work with both legacy and modern commands
338
443
  parser.add_argument(
339
444
  "--format",
340
445
  type=str,
341
446
  choices=["yaml", "json"],
342
447
  default="yaml",
343
- help="Inventory output format (default: yaml)"
448
+ help=argparse.SUPPRESS # Hide, use subcommand option instead
344
449
  )
345
-
346
- # Options for tests
347
450
  parser.add_argument(
348
451
  "--verbose", "-v",
349
452
  action="store_true",
350
- help="Verbose test output"
453
+ help=argparse.SUPPRESS # Hide, use subcommand option instead
351
454
  )
352
-
353
455
  parser.add_argument(
354
456
  "--coverage",
355
457
  action="store_true",
356
- help="Generate coverage report"
458
+ help=argparse.SUPPRESS # Hide, use subcommand option instead
357
459
  )
358
-
359
460
  parser.add_argument(
360
461
  "--html",
361
462
  action="store_true",
362
- help="Generate HTML test report"
463
+ help=argparse.SUPPRESS # Hide, use subcommand option instead
363
464
  )
364
465
 
365
466
  args = parser.parse_args()
366
467
 
367
- # ----- Handle subcommands -----
468
+ # ----- Handle modern subcommands -----
469
+
470
+ # atdd validate [phase]
471
+ if args.command == "validate":
472
+ repo_path = Path(args.repo) if hasattr(args, 'repo') and args.repo else None
473
+ coach = ATDDCoach(repo_root=repo_path)
474
+ return coach.run_validators(
475
+ phase=args.phase,
476
+ verbose=args.verbose,
477
+ coverage=args.coverage,
478
+ html=args.html,
479
+ quick=args.quick
480
+ )
481
+
482
+ # atdd inventory
483
+ elif args.command == "inventory":
484
+ repo_path = Path(args.repo) if hasattr(args, 'repo') and args.repo else None
485
+ coach = ATDDCoach(repo_root=repo_path)
486
+ return coach.run_inventory(format=args.format)
487
+
488
+ # atdd status
489
+ elif args.command == "status":
490
+ repo_path = Path(args.repo) if hasattr(args, 'repo') and args.repo else None
491
+ coach = ATDDCoach(repo_root=repo_path)
492
+ return coach.show_status()
493
+
494
+ # atdd registry {update}
495
+ elif args.command == "registry":
496
+ repo_path = Path(args.repo) if hasattr(args, 'repo') and args.repo else None
497
+ coach = ATDDCoach(repo_root=repo_path)
498
+
499
+ if args.registry_command == "update":
500
+ return coach.update_registries(registry_type=args.type)
501
+ else:
502
+ registry_parser.print_help()
503
+ return 0
368
504
 
369
505
  # atdd init
370
- if args.command == "init":
506
+ elif args.command == "init":
371
507
  initializer = ProjectInitializer()
372
508
  return initializer.init(force=args.force)
373
509
 
@@ -401,18 +537,20 @@ Phase descriptions:
401
537
  gate = ATDDGate()
402
538
  return gate.verify(json=args.json)
403
539
 
404
- # ----- Handle flag-based commands (backwards compatible) -----
540
+ # ----- Handle deprecated flag-based commands -----
405
541
 
406
- # Create coach instance with optional repo override
407
542
  repo_path = Path(args.repo) if args.repo else None
408
543
  coach = ATDDCoach(repo_root=repo_path)
409
544
 
410
- # Handle commands
545
+ # DEPRECATED: --inventory
411
546
  if args.inventory:
547
+ _deprecation_warning("atdd --inventory", "atdd inventory")
412
548
  return coach.run_inventory(format=args.format)
413
549
 
550
+ # DEPRECATED: --test
414
551
  elif args.test:
415
- return coach.run_tests(
552
+ _deprecation_warning(f"atdd --test {args.test}", f"atdd validate {args.test}")
553
+ return coach.run_validators(
416
554
  phase=args.test,
417
555
  verbose=args.verbose,
418
556
  coverage=args.coverage,
@@ -420,13 +558,22 @@ Phase descriptions:
420
558
  quick=False
421
559
  )
422
560
 
561
+ # DEPRECATED: --quick
423
562
  elif args.quick:
424
- return coach.run_tests(quick=True)
563
+ _deprecation_warning("atdd --quick", "atdd validate --quick")
564
+ return coach.run_validators(quick=True)
425
565
 
566
+ # DEPRECATED: --status
426
567
  elif args.status:
568
+ _deprecation_warning("atdd --status", "atdd status")
427
569
  return coach.show_status()
428
570
 
571
+ # DEPRECATED: --update-registry
429
572
  elif args.update_registry:
573
+ _deprecation_warning(
574
+ f"atdd --update-registry {args.update_registry}",
575
+ f"atdd registry update {args.update_registry}"
576
+ )
430
577
  return coach.update_registries(registry_type=args.update_registry)
431
578
 
432
579
  else:
@@ -10,7 +10,9 @@ import re
10
10
  from pathlib import Path
11
11
  from typing import Dict, List, Optional
12
12
 
13
- REPO_ROOT = Path(__file__).resolve().parents[4]
13
+ from atdd.coach.utils.repo import find_repo_root
14
+
15
+ REPO_ROOT = find_repo_root()
14
16
  CONTRACTS_DIR = REPO_ROOT / "contracts"
15
17
  MIGRATIONS_DIR = REPO_ROOT / "supabase" / "migrations"
16
18
 
@@ -15,7 +15,9 @@ import sys
15
15
  import json
16
16
  from pathlib import Path
17
17
 
18
- REPO_ROOT = Path(__file__).resolve().parents[4]
18
+ from atdd.coach.utils.repo import find_repo_root
19
+
20
+ REPO_ROOT = find_repo_root()
19
21
  CONTRACTS_DIR = REPO_ROOT / "contracts"
20
22
 
21
23
 
@@ -21,7 +21,9 @@ import json
21
21
  from jsonschema import Draft7Validator
22
22
  from dataclasses import dataclass, field
23
23
 
24
- REPO_ROOT = Path(__file__).parent.parent.parent.parent
24
+ from atdd.coach.utils.repo import find_repo_root
25
+
26
+ REPO_ROOT = find_repo_root()
25
27
  PLAN_DIR = REPO_ROOT / "plan"
26
28
  CONTRACTS_DIR = REPO_ROOT / "contracts"
27
29
  ARTIFACT_SCHEMA_PATH = REPO_ROOT / ".claude/schemas/tester/artifact.schema.json"
@@ -10,8 +10,8 @@ Catalogs all artifacts across the ATDD lifecycle:
10
10
  - Tracking: Facts/logs, ATDD documentation
11
11
 
12
12
  Usage:
13
- python atdd/inventory.py > atdd/INVENTORY.yaml
14
- pytest atdd/ --inventory
13
+ atdd inventory # Generate inventory (YAML)
14
+ atdd inventory --format json # Generate inventory (JSON)
15
15
  """
16
16
 
17
17
  import yaml
@@ -5,9 +5,12 @@ Generate Supabase JSONB migrations from contract schemas.
5
5
  SPEC-COACH-CONV-0033: Simplified JSONB-only migration generator
6
6
 
7
7
  Usage:
8
- python atdd/coach/commands/migration.py # Generate all missing
9
- python atdd/coach/commands/migration.py --contract <path> # Generate specific
10
- python atdd/coach/commands/migration.py --validate # Check coverage only
8
+ python -m atdd.coach.commands.migration # Generate all missing
9
+ python -m atdd.coach.commands.migration --contract <path> # Generate specific
10
+ python -m atdd.coach.commands.migration --validate # Check coverage only
11
+
12
+ Validation:
13
+ atdd validate tester # Runs migration coverage validators
11
14
  """
12
15
 
13
16
  import argparse
@@ -15,9 +18,11 @@ import json
15
18
  from datetime import datetime
16
19
  from pathlib import Path
17
20
 
21
+ from atdd.coach.utils.repo import find_repo_root
22
+
18
23
 
19
24
  # Path constants
20
- REPO_ROOT = Path(__file__).resolve().parents[4]
25
+ REPO_ROOT = find_repo_root()
21
26
  CONTRACTS_DIR = REPO_ROOT / "contracts"
22
27
  MIGRATIONS_DIR = REPO_ROOT / "supabase" / "migrations"
23
28
 
@@ -164,7 +169,7 @@ def main():
164
169
 
165
170
  if args.validate:
166
171
  print("Validating migration coverage...")
167
- print("Run: pytest atdd/tester/test_migration_coverage.py")
172
+ print("Run: atdd validate tester")
168
173
  return
169
174
 
170
175
  # Generate for specific contract
@@ -233,7 +238,7 @@ def main():
233
238
  print(f"ℹ️ Skipped {skipped} non-persistent contracts")
234
239
  print(f"📦 All use standard JSONB blob storage")
235
240
  print(f"🚀 Apply: supabase db push")
236
- print(f"\nValidate: pytest atdd/tester/test_migration_coverage.py")
241
+ print(f"\nValidate: atdd validate tester")
237
242
 
238
243
 
239
244
  if __name__ == "__main__":