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.
- elspais/__init__.py +1 -10
- elspais/{sponsors/__init__.py → associates.py} +102 -56
- elspais/cli.py +366 -69
- elspais/commands/__init__.py +9 -3
- elspais/commands/analyze.py +118 -169
- elspais/commands/changed.py +12 -23
- elspais/commands/config_cmd.py +10 -13
- elspais/commands/edit.py +33 -13
- elspais/commands/example_cmd.py +319 -0
- elspais/commands/hash_cmd.py +161 -183
- elspais/commands/health.py +1177 -0
- elspais/commands/index.py +98 -115
- elspais/commands/init.py +99 -22
- elspais/commands/reformat_cmd.py +41 -433
- elspais/commands/rules_cmd.py +2 -2
- elspais/commands/trace.py +443 -324
- elspais/commands/validate.py +193 -411
- elspais/config/__init__.py +799 -5
- elspais/{core/content_rules.py → content_rules.py} +20 -2
- elspais/docs/cli/assertions.md +67 -0
- elspais/docs/cli/commands.md +304 -0
- elspais/docs/cli/config.md +262 -0
- elspais/docs/cli/format.md +66 -0
- elspais/docs/cli/git.md +45 -0
- elspais/docs/cli/health.md +190 -0
- elspais/docs/cli/hierarchy.md +60 -0
- elspais/docs/cli/ignore.md +72 -0
- elspais/docs/cli/mcp.md +245 -0
- elspais/docs/cli/quickstart.md +58 -0
- elspais/docs/cli/traceability.md +89 -0
- elspais/docs/cli/validation.md +96 -0
- elspais/graph/GraphNode.py +383 -0
- elspais/graph/__init__.py +40 -0
- elspais/graph/annotators.py +927 -0
- elspais/graph/builder.py +1886 -0
- elspais/graph/deserializer.py +248 -0
- elspais/graph/factory.py +284 -0
- elspais/graph/metrics.py +127 -0
- elspais/graph/mutations.py +161 -0
- elspais/graph/parsers/__init__.py +156 -0
- elspais/graph/parsers/code.py +213 -0
- elspais/graph/parsers/comments.py +112 -0
- elspais/graph/parsers/config_helpers.py +29 -0
- elspais/graph/parsers/heredocs.py +225 -0
- elspais/graph/parsers/journey.py +131 -0
- elspais/graph/parsers/remainder.py +79 -0
- elspais/graph/parsers/requirement.py +347 -0
- elspais/graph/parsers/results/__init__.py +6 -0
- elspais/graph/parsers/results/junit_xml.py +229 -0
- elspais/graph/parsers/results/pytest_json.py +313 -0
- elspais/graph/parsers/test.py +305 -0
- elspais/graph/relations.py +78 -0
- elspais/graph/serialize.py +216 -0
- elspais/html/__init__.py +8 -0
- elspais/html/generator.py +731 -0
- elspais/html/templates/trace_view.html.j2 +2151 -0
- elspais/mcp/__init__.py +45 -29
- elspais/mcp/__main__.py +5 -1
- elspais/mcp/file_mutations.py +138 -0
- elspais/mcp/server.py +1998 -244
- elspais/testing/__init__.py +3 -3
- elspais/testing/config.py +3 -0
- elspais/testing/mapper.py +1 -1
- elspais/testing/scanner.py +301 -12
- elspais/utilities/__init__.py +1 -0
- elspais/utilities/docs_loader.py +115 -0
- elspais/utilities/git.py +607 -0
- elspais/{core → utilities}/hasher.py +8 -22
- elspais/utilities/md_renderer.py +189 -0
- elspais/{core → utilities}/patterns.py +56 -51
- elspais/utilities/reference_config.py +626 -0
- elspais/validation/__init__.py +19 -0
- elspais/validation/format.py +264 -0
- {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/METADATA +7 -4
- elspais-0.43.5.dist-info/RECORD +80 -0
- elspais/config/defaults.py +0 -179
- elspais/config/loader.py +0 -494
- elspais/core/__init__.py +0 -21
- elspais/core/git.py +0 -346
- elspais/core/models.py +0 -320
- elspais/core/parser.py +0 -639
- elspais/core/rules.py +0 -509
- elspais/mcp/context.py +0 -172
- elspais/mcp/serializers.py +0 -112
- elspais/reformat/__init__.py +0 -50
- elspais/reformat/detector.py +0 -112
- elspais/reformat/hierarchy.py +0 -247
- elspais/reformat/line_breaks.py +0 -218
- elspais/reformat/prompts.py +0 -133
- elspais/reformat/transformer.py +0 -266
- elspais/trace_view/__init__.py +0 -55
- elspais/trace_view/coverage.py +0 -183
- elspais/trace_view/generators/__init__.py +0 -12
- elspais/trace_view/generators/base.py +0 -334
- elspais/trace_view/generators/csv.py +0 -118
- elspais/trace_view/generators/markdown.py +0 -170
- elspais/trace_view/html/__init__.py +0 -33
- elspais/trace_view/html/generator.py +0 -1140
- elspais/trace_view/html/templates/base.html +0 -283
- elspais/trace_view/html/templates/components/code_viewer_modal.html +0 -14
- elspais/trace_view/html/templates/components/file_picker_modal.html +0 -20
- elspais/trace_view/html/templates/components/legend_modal.html +0 -69
- elspais/trace_view/html/templates/components/review_panel.html +0 -118
- elspais/trace_view/html/templates/partials/review/help/help-panel.json +0 -244
- elspais/trace_view/html/templates/partials/review/help/onboarding.json +0 -77
- elspais/trace_view/html/templates/partials/review/help/tooltips.json +0 -237
- elspais/trace_view/html/templates/partials/review/review-comments.js +0 -928
- elspais/trace_view/html/templates/partials/review/review-data.js +0 -961
- elspais/trace_view/html/templates/partials/review/review-help.js +0 -679
- elspais/trace_view/html/templates/partials/review/review-init.js +0 -177
- elspais/trace_view/html/templates/partials/review/review-line-numbers.js +0 -429
- elspais/trace_view/html/templates/partials/review/review-packages.js +0 -1029
- elspais/trace_view/html/templates/partials/review/review-position.js +0 -540
- elspais/trace_view/html/templates/partials/review/review-resize.js +0 -115
- elspais/trace_view/html/templates/partials/review/review-status.js +0 -659
- elspais/trace_view/html/templates/partials/review/review-sync.js +0 -992
- elspais/trace_view/html/templates/partials/review-styles.css +0 -2238
- elspais/trace_view/html/templates/partials/scripts.js +0 -1741
- elspais/trace_view/html/templates/partials/styles.css +0 -1756
- elspais/trace_view/models.py +0 -378
- elspais/trace_view/review/__init__.py +0 -63
- elspais/trace_view/review/branches.py +0 -1142
- elspais/trace_view/review/models.py +0 -1200
- elspais/trace_view/review/position.py +0 -591
- elspais/trace_view/review/server.py +0 -1032
- elspais/trace_view/review/status.py +0 -455
- elspais/trace_view/review/storage.py +0 -1343
- elspais/trace_view/scanning.py +0 -213
- elspais/trace_view/specs/README.md +0 -84
- elspais/trace_view/specs/tv-d00001-template-architecture.md +0 -36
- elspais/trace_view/specs/tv-d00002-css-extraction.md +0 -37
- elspais/trace_view/specs/tv-d00003-js-extraction.md +0 -43
- elspais/trace_view/specs/tv-d00004-build-embedding.md +0 -40
- elspais/trace_view/specs/tv-d00005-test-format.md +0 -78
- elspais/trace_view/specs/tv-d00010-review-data-models.md +0 -33
- elspais/trace_view/specs/tv-d00011-review-storage.md +0 -33
- elspais/trace_view/specs/tv-d00012-position-resolution.md +0 -33
- elspais/trace_view/specs/tv-d00013-git-branches.md +0 -31
- elspais/trace_view/specs/tv-d00014-review-api-server.md +0 -31
- elspais/trace_view/specs/tv-d00015-status-modifier.md +0 -27
- elspais/trace_view/specs/tv-d00016-js-integration.md +0 -33
- elspais/trace_view/specs/tv-p00001-html-generator.md +0 -33
- elspais/trace_view/specs/tv-p00002-review-system.md +0 -29
- elspais-0.11.2.dist-info/RECORD +0 -101
- {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/WHEEL +0 -0
- {elspais-0.11.2.dist-info → elspais-0.43.5.dist-info}/entry_points.txt +0 -0
- {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.
|
|
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.
|
|
2
|
+
elspais.associates - Associate repository configuration loading.
|
|
3
3
|
|
|
4
|
-
Provides functions for loading
|
|
5
|
-
and resolving
|
|
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
|
|
15
|
+
class Associate:
|
|
16
16
|
"""
|
|
17
|
-
Represents
|
|
17
|
+
Represents an associate repository configuration.
|
|
18
18
|
|
|
19
19
|
Attributes:
|
|
20
|
-
name:
|
|
20
|
+
name: Associate name (e.g., "callisto")
|
|
21
21
|
code: Short code used in requirement IDs (e.g., "CAL")
|
|
22
|
-
enabled: Whether this
|
|
22
|
+
enabled: Whether this associate is enabled for scanning
|
|
23
23
|
path: Default path relative to project root
|
|
24
|
-
spec_path: Spec directory within
|
|
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
|
|
41
|
+
class AssociatesConfig:
|
|
38
42
|
"""
|
|
39
|
-
Container for
|
|
43
|
+
Container for associate configuration.
|
|
40
44
|
|
|
41
45
|
Attributes:
|
|
42
|
-
|
|
43
|
-
config_file: Path to the
|
|
44
|
-
local_dir: Default base directory for
|
|
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
|
-
|
|
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
|
|
172
|
+
def load_associates_yaml(yaml_path: Path) -> Dict[str, Any]:
|
|
160
173
|
"""
|
|
161
|
-
Load
|
|
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
|
|
188
|
+
yaml_path: Path to the associates YAML file
|
|
176
189
|
|
|
177
190
|
Returns:
|
|
178
|
-
Dictionary with
|
|
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
|
|
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
|
|
204
|
+
def _parse_associates_yaml(content: str) -> Dict[str, Any]:
|
|
188
205
|
"""
|
|
189
|
-
Parse
|
|
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
|
|
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
|
|
300
|
+
def load_associates_config(
|
|
284
301
|
config: Dict[str, Any],
|
|
285
302
|
base_path: Optional[Path] = None,
|
|
286
|
-
) ->
|
|
303
|
+
) -> AssociatesConfig:
|
|
287
304
|
"""
|
|
288
|
-
Load
|
|
305
|
+
Load associate configurations from config files.
|
|
289
306
|
|
|
290
|
-
Reads the main
|
|
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
|
-
|
|
314
|
+
AssociatesConfig with loaded associates
|
|
298
315
|
"""
|
|
299
316
|
if base_path is None:
|
|
300
317
|
base_path = Path.cwd()
|
|
301
318
|
|
|
302
|
-
|
|
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
|
-
|
|
308
|
-
|
|
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
|
|
328
|
+
return associates_config
|
|
312
329
|
|
|
313
330
|
# Load main sponsors config
|
|
314
331
|
config_path = base_path / config_file
|
|
315
|
-
main_config =
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
371
|
+
associates_config.associates.append(associate)
|
|
355
372
|
|
|
356
|
-
return
|
|
373
|
+
return associates_config
|
|
357
374
|
|
|
358
375
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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
|
|
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
|
-
|
|
371
|
-
config: Overall
|
|
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
|
|
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
|
|
401
|
+
if not associate.enabled:
|
|
381
402
|
return None
|
|
382
403
|
|
|
383
404
|
# Check local_path override first
|
|
384
|
-
if
|
|
385
|
-
spec_dir = 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
|
|
393
|
-
spec_dir = base_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 /
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
447
|
+
associates_config = load_associates_config(config, base_path)
|
|
423
448
|
spec_dirs = []
|
|
424
449
|
|
|
425
|
-
for
|
|
426
|
-
spec_dir =
|
|
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
|
+
]
|