elspais 0.11.2__py3-none-any.whl → 0.43.5__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 (147) hide show
  1. elspais/__init__.py +1 -10
  2. elspais/{sponsors/__init__.py → associates.py} +102 -56
  3. elspais/cli.py +366 -69
  4. elspais/commands/__init__.py +9 -3
  5. elspais/commands/analyze.py +118 -169
  6. elspais/commands/changed.py +12 -23
  7. elspais/commands/config_cmd.py +10 -13
  8. elspais/commands/edit.py +33 -13
  9. elspais/commands/example_cmd.py +319 -0
  10. elspais/commands/hash_cmd.py +161 -183
  11. elspais/commands/health.py +1177 -0
  12. elspais/commands/index.py +98 -115
  13. elspais/commands/init.py +99 -22
  14. elspais/commands/reformat_cmd.py +41 -433
  15. elspais/commands/rules_cmd.py +2 -2
  16. elspais/commands/trace.py +443 -324
  17. elspais/commands/validate.py +193 -411
  18. elspais/config/__init__.py +799 -5
  19. elspais/{core/content_rules.py → content_rules.py} +20 -2
  20. elspais/docs/cli/assertions.md +67 -0
  21. elspais/docs/cli/commands.md +304 -0
  22. elspais/docs/cli/config.md +262 -0
  23. elspais/docs/cli/format.md +66 -0
  24. elspais/docs/cli/git.md +45 -0
  25. elspais/docs/cli/health.md +190 -0
  26. elspais/docs/cli/hierarchy.md +60 -0
  27. elspais/docs/cli/ignore.md +72 -0
  28. elspais/docs/cli/mcp.md +245 -0
  29. elspais/docs/cli/quickstart.md +58 -0
  30. elspais/docs/cli/traceability.md +89 -0
  31. elspais/docs/cli/validation.md +96 -0
  32. elspais/graph/GraphNode.py +383 -0
  33. elspais/graph/__init__.py +40 -0
  34. elspais/graph/annotators.py +927 -0
  35. elspais/graph/builder.py +1886 -0
  36. elspais/graph/deserializer.py +248 -0
  37. elspais/graph/factory.py +284 -0
  38. elspais/graph/metrics.py +127 -0
  39. elspais/graph/mutations.py +161 -0
  40. elspais/graph/parsers/__init__.py +156 -0
  41. elspais/graph/parsers/code.py +213 -0
  42. elspais/graph/parsers/comments.py +112 -0
  43. elspais/graph/parsers/config_helpers.py +29 -0
  44. elspais/graph/parsers/heredocs.py +225 -0
  45. elspais/graph/parsers/journey.py +131 -0
  46. elspais/graph/parsers/remainder.py +79 -0
  47. elspais/graph/parsers/requirement.py +347 -0
  48. elspais/graph/parsers/results/__init__.py +6 -0
  49. elspais/graph/parsers/results/junit_xml.py +229 -0
  50. elspais/graph/parsers/results/pytest_json.py +313 -0
  51. elspais/graph/parsers/test.py +305 -0
  52. elspais/graph/relations.py +78 -0
  53. elspais/graph/serialize.py +216 -0
  54. elspais/html/__init__.py +8 -0
  55. elspais/html/generator.py +731 -0
  56. elspais/html/templates/trace_view.html.j2 +2151 -0
  57. elspais/mcp/__init__.py +45 -29
  58. elspais/mcp/__main__.py +5 -1
  59. elspais/mcp/file_mutations.py +138 -0
  60. elspais/mcp/server.py +1998 -244
  61. elspais/testing/__init__.py +3 -3
  62. elspais/testing/config.py +3 -0
  63. elspais/testing/mapper.py +1 -1
  64. elspais/testing/scanner.py +301 -12
  65. elspais/utilities/__init__.py +1 -0
  66. elspais/utilities/docs_loader.py +115 -0
  67. elspais/utilities/git.py +607 -0
  68. elspais/{core → utilities}/hasher.py +8 -22
  69. elspais/utilities/md_renderer.py +189 -0
  70. elspais/{core → utilities}/patterns.py +56 -51
  71. elspais/utilities/reference_config.py +626 -0
  72. elspais/validation/__init__.py +19 -0
  73. elspais/validation/format.py +264 -0
  74. {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/METADATA +7 -4
  75. elspais-0.43.5.dist-info/RECORD +80 -0
  76. elspais/config/defaults.py +0 -179
  77. elspais/config/loader.py +0 -494
  78. elspais/core/__init__.py +0 -21
  79. elspais/core/git.py +0 -346
  80. elspais/core/models.py +0 -320
  81. elspais/core/parser.py +0 -639
  82. elspais/core/rules.py +0 -509
  83. elspais/mcp/context.py +0 -172
  84. elspais/mcp/serializers.py +0 -112
  85. elspais/reformat/__init__.py +0 -50
  86. elspais/reformat/detector.py +0 -112
  87. elspais/reformat/hierarchy.py +0 -247
  88. elspais/reformat/line_breaks.py +0 -218
  89. elspais/reformat/prompts.py +0 -133
  90. elspais/reformat/transformer.py +0 -266
  91. elspais/trace_view/__init__.py +0 -55
  92. elspais/trace_view/coverage.py +0 -183
  93. elspais/trace_view/generators/__init__.py +0 -12
  94. elspais/trace_view/generators/base.py +0 -334
  95. elspais/trace_view/generators/csv.py +0 -118
  96. elspais/trace_view/generators/markdown.py +0 -170
  97. elspais/trace_view/html/__init__.py +0 -33
  98. elspais/trace_view/html/generator.py +0 -1140
  99. elspais/trace_view/html/templates/base.html +0 -283
  100. elspais/trace_view/html/templates/components/code_viewer_modal.html +0 -14
  101. elspais/trace_view/html/templates/components/file_picker_modal.html +0 -20
  102. elspais/trace_view/html/templates/components/legend_modal.html +0 -69
  103. elspais/trace_view/html/templates/components/review_panel.html +0 -118
  104. elspais/trace_view/html/templates/partials/review/help/help-panel.json +0 -244
  105. elspais/trace_view/html/templates/partials/review/help/onboarding.json +0 -77
  106. elspais/trace_view/html/templates/partials/review/help/tooltips.json +0 -237
  107. elspais/trace_view/html/templates/partials/review/review-comments.js +0 -928
  108. elspais/trace_view/html/templates/partials/review/review-data.js +0 -961
  109. elspais/trace_view/html/templates/partials/review/review-help.js +0 -679
  110. elspais/trace_view/html/templates/partials/review/review-init.js +0 -177
  111. elspais/trace_view/html/templates/partials/review/review-line-numbers.js +0 -429
  112. elspais/trace_view/html/templates/partials/review/review-packages.js +0 -1029
  113. elspais/trace_view/html/templates/partials/review/review-position.js +0 -540
  114. elspais/trace_view/html/templates/partials/review/review-resize.js +0 -115
  115. elspais/trace_view/html/templates/partials/review/review-status.js +0 -659
  116. elspais/trace_view/html/templates/partials/review/review-sync.js +0 -992
  117. elspais/trace_view/html/templates/partials/review-styles.css +0 -2238
  118. elspais/trace_view/html/templates/partials/scripts.js +0 -1741
  119. elspais/trace_view/html/templates/partials/styles.css +0 -1756
  120. elspais/trace_view/models.py +0 -378
  121. elspais/trace_view/review/__init__.py +0 -63
  122. elspais/trace_view/review/branches.py +0 -1142
  123. elspais/trace_view/review/models.py +0 -1200
  124. elspais/trace_view/review/position.py +0 -591
  125. elspais/trace_view/review/server.py +0 -1032
  126. elspais/trace_view/review/status.py +0 -455
  127. elspais/trace_view/review/storage.py +0 -1343
  128. elspais/trace_view/scanning.py +0 -213
  129. elspais/trace_view/specs/README.md +0 -84
  130. elspais/trace_view/specs/tv-d00001-template-architecture.md +0 -36
  131. elspais/trace_view/specs/tv-d00002-css-extraction.md +0 -37
  132. elspais/trace_view/specs/tv-d00003-js-extraction.md +0 -43
  133. elspais/trace_view/specs/tv-d00004-build-embedding.md +0 -40
  134. elspais/trace_view/specs/tv-d00005-test-format.md +0 -78
  135. elspais/trace_view/specs/tv-d00010-review-data-models.md +0 -33
  136. elspais/trace_view/specs/tv-d00011-review-storage.md +0 -33
  137. elspais/trace_view/specs/tv-d00012-position-resolution.md +0 -33
  138. elspais/trace_view/specs/tv-d00013-git-branches.md +0 -31
  139. elspais/trace_view/specs/tv-d00014-review-api-server.md +0 -31
  140. elspais/trace_view/specs/tv-d00015-status-modifier.md +0 -27
  141. elspais/trace_view/specs/tv-d00016-js-integration.md +0 -33
  142. elspais/trace_view/specs/tv-p00001-html-generator.md +0 -33
  143. elspais/trace_view/specs/tv-p00002-review-system.md +0 -29
  144. elspais-0.11.2.dist-info/RECORD +0 -101
  145. {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/WHEEL +0 -0
  146. {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/entry_points.txt +0 -0
  147. {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/licenses/LICENSE +0 -0
elspais/__init__.py CHANGED
@@ -19,18 +19,9 @@ except PackageNotFoundError:
19
19
  __author__ = "Anspar"
20
20
  __license__ = "MIT"
21
21
 
22
- from elspais.core.models import Assertion, ContentRule, ParsedRequirement, Requirement
23
- from elspais.core.patterns import PatternValidator
24
- from elspais.core.rules import RuleEngine, RuleViolation, Severity
22
+ from elspais.utilities.patterns import PatternValidator
25
23
 
26
24
  __all__ = [
27
25
  "__version__",
28
- "Assertion",
29
- "ContentRule",
30
- "Requirement",
31
- "ParsedRequirement",
32
26
  "PatternValidator",
33
- "RuleEngine",
34
- "RuleViolation",
35
- "Severity",
36
27
  ]
@@ -1,8 +1,8 @@
1
1
  """
2
- elspais.sponsors - Sponsor/associated repository configuration loading.
2
+ elspais.associates - Associate repository configuration loading.
3
3
 
4
- Provides functions for loading sponsor configurations from YAML files
5
- and resolving sponsor spec directories.
4
+ Provides functions for loading associate configurations from YAML files
5
+ and resolving associate spec directories.
6
6
  """
7
7
 
8
8
  import re
@@ -12,16 +12,16 @@ from typing import Any, Dict, List, Optional
12
12
 
13
13
 
14
14
  @dataclass
15
- class Sponsor:
15
+ class Associate:
16
16
  """
17
- Represents a sponsor/associated repository configuration.
17
+ Represents an associate repository configuration.
18
18
 
19
19
  Attributes:
20
- name: Sponsor name (e.g., "callisto")
20
+ name: Associate name (e.g., "callisto")
21
21
  code: Short code used in requirement IDs (e.g., "CAL")
22
- enabled: Whether this sponsor is enabled for scanning
22
+ enabled: Whether this associate is enabled for scanning
23
23
  path: Default path relative to project root
24
- spec_path: Spec directory within sponsor path (e.g., "spec")
24
+ spec_path: Spec directory within associate path (e.g., "spec")
25
25
  local_path: Override path for local development (from .local.yml)
26
26
  """
27
27
 
@@ -33,21 +33,34 @@ class Sponsor:
33
33
  local_path: Optional[str] = None
34
34
 
35
35
 
36
+ # Alias for backwards compatibility
37
+ Sponsor = Associate
38
+
39
+
36
40
  @dataclass
37
- class SponsorsConfig:
41
+ class AssociatesConfig:
38
42
  """
39
- Container for sponsor configuration.
43
+ Container for associate configuration.
40
44
 
41
45
  Attributes:
42
- sponsors: List of Sponsor objects
43
- config_file: Path to the sponsors config file
44
- local_dir: Default base directory for sponsor repos
46
+ associates: List of Associate objects
47
+ config_file: Path to the associates config file
48
+ local_dir: Default base directory for associate repos
45
49
  """
46
50
 
47
- sponsors: List[Sponsor] = field(default_factory=list)
51
+ associates: List[Associate] = field(default_factory=list)
48
52
  config_file: str = ""
49
53
  local_dir: str = "sponsor"
50
54
 
55
+ # Alias property for backwards compatibility
56
+ @property
57
+ def sponsors(self) -> List[Associate]:
58
+ return self.associates
59
+
60
+
61
+ # Alias for backwards compatibility
62
+ SponsorsConfig = AssociatesConfig
63
+
51
64
 
52
65
  def parse_yaml(content: str) -> Dict[str, Any]:
53
66
  """
@@ -156,9 +169,9 @@ def _parse_yaml_value(value: str) -> Any:
156
169
  return value
157
170
 
158
171
 
159
- def load_sponsors_yaml(yaml_path: Path) -> Dict[str, Any]:
172
+ def load_associates_yaml(yaml_path: Path) -> Dict[str, Any]:
160
173
  """
161
- Load sponsors configuration from a YAML file.
174
+ Load associates configuration from a YAML file.
162
175
 
163
176
  Handles the nested structure:
164
177
  ```yaml
@@ -172,27 +185,31 @@ def load_sponsors_yaml(yaml_path: Path) -> Dict[str, Any]:
172
185
  ```
173
186
 
174
187
  Args:
175
- yaml_path: Path to the sponsors YAML file
188
+ yaml_path: Path to the associates YAML file
176
189
 
177
190
  Returns:
178
- Dictionary with sponsor configuration
191
+ Dictionary with associate configuration
179
192
  """
180
193
  if not yaml_path.exists():
181
194
  return {}
182
195
 
183
196
  content = yaml_path.read_text(encoding="utf-8")
184
- return _parse_sponsors_yaml(content)
197
+ return _parse_associates_yaml(content)
198
+
199
+
200
+ # Alias for backwards compatibility
201
+ load_sponsors_yaml = load_associates_yaml
185
202
 
186
203
 
187
- def _parse_sponsors_yaml(content: str) -> Dict[str, Any]:
204
+ def _parse_associates_yaml(content: str) -> Dict[str, Any]:
188
205
  """
189
- Parse sponsors YAML content with proper handling of nested lists.
206
+ Parse associates YAML content with proper handling of nested lists.
190
207
 
191
208
  Args:
192
209
  content: YAML file content
193
210
 
194
211
  Returns:
195
- Parsed dictionary with sponsors configuration
212
+ Parsed dictionary with associates configuration
196
213
  """
197
214
  result: Dict[str, Any] = {"sponsors": {}}
198
215
  current_section = None
@@ -280,43 +297,43 @@ def _parse_sponsors_yaml(content: str) -> Dict[str, Any]:
280
297
  return result
281
298
 
282
299
 
283
- def load_sponsors_config(
300
+ def load_associates_config(
284
301
  config: Dict[str, Any],
285
302
  base_path: Optional[Path] = None,
286
- ) -> SponsorsConfig:
303
+ ) -> AssociatesConfig:
287
304
  """
288
- Load sponsor configurations from config files.
305
+ Load associate configurations from config files.
289
306
 
290
- Reads the main sponsors config file and applies local overrides.
307
+ Reads the main associates config file and applies local overrides.
291
308
 
292
309
  Args:
293
310
  config: Main elspais configuration dictionary
294
311
  base_path: Base path to resolve relative paths (defaults to cwd)
295
312
 
296
313
  Returns:
297
- SponsorsConfig with loaded sponsors
314
+ AssociatesConfig with loaded associates
298
315
  """
299
316
  if base_path is None:
300
317
  base_path = Path.cwd()
301
318
 
302
- sponsors_config = SponsorsConfig()
319
+ associates_config = AssociatesConfig()
303
320
 
304
- # Get sponsors section from config
321
+ # Get sponsors section from config (keeping "sponsors" key for compatibility)
305
322
  sponsors_section = config.get("sponsors", {})
306
323
  config_file = sponsors_section.get("config_file", "")
307
- sponsors_config.config_file = config_file
308
- sponsors_config.local_dir = sponsors_section.get("local_dir", "sponsor")
324
+ associates_config.config_file = config_file
325
+ associates_config.local_dir = sponsors_section.get("local_dir", "sponsor")
309
326
 
310
327
  if not config_file:
311
- return sponsors_config
328
+ return associates_config
312
329
 
313
330
  # Load main sponsors config
314
331
  config_path = base_path / config_file
315
- main_config = load_sponsors_yaml(config_path)
332
+ main_config = load_associates_yaml(config_path)
316
333
 
317
334
  # Load local overrides if present
318
335
  local_config_path = config_path.with_suffix(".local.yml")
319
- local_overrides = load_sponsors_yaml(local_config_path)
336
+ local_overrides = load_associates_yaml(local_config_path)
320
337
 
321
338
  # Parse sponsors from config
322
339
  sponsors_data = main_config.get("sponsors", {})
@@ -343,7 +360,7 @@ def load_sponsors_config(
343
360
  if isinstance(local_override, dict):
344
361
  local_path = local_override.get("local_path")
345
362
 
346
- sponsor = Sponsor(
363
+ associate = Associate(
347
364
  name=name,
348
365
  code=sponsor_data.get("code", ""),
349
366
  enabled=sponsor_data.get("enabled", True),
@@ -351,80 +368,109 @@ def load_sponsors_config(
351
368
  spec_path=sponsor_data.get("spec_path", "spec"),
352
369
  local_path=local_path,
353
370
  )
354
- sponsors_config.sponsors.append(sponsor)
371
+ associates_config.associates.append(associate)
355
372
 
356
- return sponsors_config
373
+ return associates_config
357
374
 
358
375
 
359
- def resolve_sponsor_spec_dir(
360
- sponsor: Sponsor,
361
- config: SponsorsConfig,
376
+ # Alias for backwards compatibility
377
+ load_sponsors_config = load_associates_config
378
+
379
+
380
+ def resolve_associate_spec_dir(
381
+ associate: Associate,
382
+ config: AssociatesConfig,
362
383
  base_path: Optional[Path] = None,
363
384
  ) -> Optional[Path]:
364
385
  """
365
- Resolve the spec directory path for a sponsor.
386
+ Resolve the spec directory path for an associate.
366
387
 
367
388
  Checks local_path override first, then default path.
368
389
 
369
390
  Args:
370
- sponsor: Sponsor configuration
371
- config: Overall sponsors configuration
391
+ associate: Associate configuration
392
+ config: Overall associates configuration
372
393
  base_path: Base path to resolve relative paths (defaults to cwd)
373
394
 
374
395
  Returns:
375
- Path to sponsor spec directory, or None if not found
396
+ Path to associate spec directory, or None if not found
376
397
  """
377
398
  if base_path is None:
378
399
  base_path = Path.cwd()
379
400
 
380
- if not sponsor.enabled:
401
+ if not associate.enabled:
381
402
  return None
382
403
 
383
404
  # Check local_path override first
384
- if sponsor.local_path:
385
- spec_dir = Path(sponsor.local_path) / sponsor.spec_path
405
+ if associate.local_path:
406
+ spec_dir = Path(associate.local_path) / associate.spec_path
386
407
  if not spec_dir.is_absolute():
387
408
  spec_dir = base_path / spec_dir
388
409
  if spec_dir.exists() and spec_dir.is_dir():
389
410
  return spec_dir
390
411
 
391
412
  # Fall back to default path
392
- if sponsor.path:
393
- spec_dir = base_path / sponsor.path / sponsor.spec_path
413
+ if associate.path:
414
+ spec_dir = base_path / associate.path / associate.spec_path
394
415
  if spec_dir.exists() and spec_dir.is_dir():
395
416
  return spec_dir
396
417
 
397
418
  # Try local_dir / name / spec_path
398
- spec_dir = base_path / config.local_dir / sponsor.name / sponsor.spec_path
419
+ spec_dir = base_path / config.local_dir / associate.name / associate.spec_path
399
420
  if spec_dir.exists() and spec_dir.is_dir():
400
421
  return spec_dir
401
422
 
402
423
  return None
403
424
 
404
425
 
405
- def get_sponsor_spec_directories(
426
+ # Alias for backwards compatibility
427
+ resolve_sponsor_spec_dir = resolve_associate_spec_dir
428
+
429
+
430
+ def get_associate_spec_directories(
406
431
  config: Dict[str, Any],
407
432
  base_path: Optional[Path] = None,
408
433
  ) -> List[Path]:
409
434
  """
410
- Get all sponsor spec directories from configuration.
435
+ Get all associate spec directories from configuration.
411
436
 
412
437
  Args:
413
438
  config: Main elspais configuration dictionary
414
439
  base_path: Base path to resolve relative paths (defaults to cwd)
415
440
 
416
441
  Returns:
417
- List of existing sponsor spec directory paths
442
+ List of existing associate spec directory paths
418
443
  """
419
444
  if base_path is None:
420
445
  base_path = Path.cwd()
421
446
 
422
- sponsors_config = load_sponsors_config(config, base_path)
447
+ associates_config = load_associates_config(config, base_path)
423
448
  spec_dirs = []
424
449
 
425
- for sponsor in sponsors_config.sponsors:
426
- spec_dir = resolve_sponsor_spec_dir(sponsor, sponsors_config, base_path)
450
+ for associate in associates_config.associates:
451
+ spec_dir = resolve_associate_spec_dir(associate, associates_config, base_path)
427
452
  if spec_dir:
428
453
  spec_dirs.append(spec_dir)
429
454
 
430
455
  return spec_dirs
456
+
457
+
458
+ # Alias for backwards compatibility
459
+ get_sponsor_spec_directories = get_associate_spec_directories
460
+
461
+
462
+ __all__ = [
463
+ "Associate",
464
+ "Sponsor", # alias
465
+ "AssociatesConfig",
466
+ "SponsorsConfig", # alias
467
+ "parse_yaml",
468
+ "load_associates_yaml",
469
+ "load_sponsors_yaml", # alias
470
+ "load_associates_config",
471
+ "load_sponsors_config", # alias
472
+ "resolve_associate_spec_dir",
473
+ "resolve_sponsor_spec_dir", # alias
474
+ "get_associate_spec_directories",
475
+ "get_sponsor_spec_directories", # alias
476
+ ]