modwire 2.3.0__tar.gz → 3.0.0__tar.gz

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 (142) hide show
  1. {modwire-2.3.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/bug_report.yml +10 -10
  2. {modwire-2.3.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/feature_request.yml +6 -7
  3. {modwire-2.3.0 → modwire-3.0.0}/.github/workflows/ci.yml +0 -15
  4. {modwire-2.3.0 → modwire-3.0.0}/.github/workflows/release.yml +0 -15
  5. modwire-3.0.0/CHANGELOG.md +31 -0
  6. {modwire-2.3.0 → modwire-3.0.0}/CONTRIBUTING.md +6 -11
  7. modwire-3.0.0/PKG-INFO +175 -0
  8. modwire-3.0.0/README.md +141 -0
  9. modwire-3.0.0/docs/wiki/Development-checks.md +18 -0
  10. modwire-3.0.0/docs/wiki/Home.md +25 -0
  11. {modwire-2.3.0 → modwire-3.0.0}/docs/wiki/Reporting-bugs.md +5 -7
  12. {modwire-2.3.0 → modwire-3.0.0}/pyproject.toml +5 -7
  13. modwire-3.0.0/src/modwire/__init__.py +6 -0
  14. {modwire-2.3.0 → modwire-3.0.0}/src/modwire/_version.py +3 -3
  15. modwire-3.0.0/src/modwire/architecture/__init__.py +26 -0
  16. modwire-3.0.0/src/modwire/architecture/boundaries/__init__.py +0 -0
  17. modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/__init__.py +0 -0
  18. modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/backward.py +35 -0
  19. modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/no_cycles.py +88 -0
  20. modwire-3.0.0/src/modwire/architecture/boundaries/analyzers/no_reentry.py +74 -0
  21. modwire-3.0.0/src/modwire/architecture/boundaries/base.py +93 -0
  22. modwire-3.0.0/src/modwire/architecture/boundaries/config.py +43 -0
  23. modwire-3.0.0/src/modwire/architecture/boundaries/map.py +155 -0
  24. modwire-3.0.0/src/modwire/architecture/boundaries/pipeline.py +108 -0
  25. modwire-3.0.0/src/modwire/architecture/boundaries/tags/__init__.py +0 -0
  26. modwire-3.0.0/src/modwire/architecture/boundaries/tags/matcher.py +131 -0
  27. modwire-3.0.0/src/modwire/architecture/boundaries/tags/tag_map.py +24 -0
  28. modwire-3.0.0/src/modwire/architecture/config.py +14 -0
  29. modwire-3.0.0/src/modwire/architecture/insight/__init__.py +0 -0
  30. modwire-3.0.0/src/modwire/architecture/insight/base.py +14 -0
  31. modwire-3.0.0/src/modwire/architecture/insight/pipeline.py +92 -0
  32. modwire-3.0.0/src/modwire/architecture/insight/reports/__init__.py +22 -0
  33. modwire-3.0.0/src/modwire/architecture/insight/reports/callables.py +54 -0
  34. modwire-3.0.0/src/modwire/architecture/insight/reports/clusters.py +119 -0
  35. modwire-3.0.0/src/modwire/architecture/insight/reports/coherence.py +56 -0
  36. modwire-3.0.0/src/modwire/architecture/insight/reports/exports.py +64 -0
  37. modwire-3.0.0/src/modwire/architecture/insight/reports/hotspots.py +57 -0
  38. modwire-3.0.0/src/modwire/architecture/report.py +102 -0
  39. modwire-3.0.0/src/modwire/architecture/root.py +18 -0
  40. modwire-3.0.0/src/modwire/architecture/shape/__init__.py +0 -0
  41. modwire-3.0.0/src/modwire/architecture/shape/base.py +52 -0
  42. modwire-3.0.0/src/modwire/architecture/shape/config.py +45 -0
  43. modwire-3.0.0/src/modwire/architecture/shape/pipeline.py +95 -0
  44. modwire-3.0.0/src/modwire/architecture/shape/rules/__init__.py +20 -0
  45. modwire-3.0.0/src/modwire/architecture/shape/rules/abstract_class_resolver.py +60 -0
  46. modwire-3.0.0/src/modwire/architecture/shape/rules/callable_resolver.py +129 -0
  47. modwire-3.0.0/src/modwire/architecture/shape/rules/class_resolver.py +89 -0
  48. modwire-3.0.0/src/modwire/architecture/shape/rules/file_resolver.py +57 -0
  49. modwire-3.0.0/src/modwire/architecture/shape/rules/import_resolver.py +58 -0
  50. modwire-3.0.0/src/modwire/architecture/shape/rules/property_resolver.py +81 -0
  51. modwire-3.0.0/src/modwire/architecture/shape/rules/signature_resolver.py +75 -0
  52. modwire-3.0.0/src/modwire/architecture/shape/rules/symbol_resolver.py +34 -0
  53. modwire-3.0.0/src/modwire.egg-info/PKG-INFO +175 -0
  54. modwire-3.0.0/src/modwire.egg-info/SOURCES.txt +67 -0
  55. {modwire-2.3.0 → modwire-3.0.0}/src/modwire.egg-info/requires.txt +1 -0
  56. modwire-3.0.0/src/modwire.egg-info/scm_file_list.json +63 -0
  57. modwire-3.0.0/src/modwire.egg-info/scm_version.json +8 -0
  58. modwire-3.0.0/tests/architecture/boundaries/test_map.py +69 -0
  59. modwire-3.0.0/tests/architecture/boundaries/test_pipeline.py +122 -0
  60. modwire-3.0.0/tests/architecture/test_report.py +110 -0
  61. {modwire-2.3.0 → modwire-3.0.0}/uv.lock +64 -41
  62. modwire-2.3.0/.github/workflows/large-repo-fixtures.yml +0 -88
  63. modwire-2.3.0/PKG-INFO +0 -288
  64. modwire-2.3.0/README.md +0 -255
  65. modwire-2.3.0/docs/wiki/Development-checks.md +0 -23
  66. modwire-2.3.0/docs/wiki/Home.md +0 -31
  67. modwire-2.3.0/show_test_source_files.py +0 -28
  68. modwire-2.3.0/src/modwire/__init__.py +0 -96
  69. modwire-2.3.0/src/modwire/architecture/__init__.py +0 -61
  70. modwire-2.3.0/src/modwire/architecture/analyzers.py +0 -166
  71. modwire-2.3.0/src/modwire/architecture/config.py +0 -170
  72. modwire-2.3.0/src/modwire/architecture/insights.py +0 -246
  73. modwire-2.3.0/src/modwire/architecture/matching.py +0 -189
  74. modwire-2.3.0/src/modwire/architecture/policy.py +0 -75
  75. modwire-2.3.0/src/modwire/architecture/render.py +0 -99
  76. modwire-2.3.0/src/modwire/architecture/violations.py +0 -47
  77. modwire-2.3.0/src/modwire/callables.py +0 -162
  78. modwire-2.3.0/src/modwire/definitions.py +0 -200
  79. modwire-2.3.0/src/modwire/exports.py +0 -188
  80. modwire-2.3.0/src/modwire/extraction/__init__.py +0 -33
  81. modwire-2.3.0/src/modwire/extraction/cache.py +0 -92
  82. modwire-2.3.0/src/modwire/extraction/manifest.py +0 -98
  83. modwire-2.3.0/src/modwire/extraction/models.py +0 -199
  84. modwire-2.3.0/src/modwire/extraction/roots.py +0 -100
  85. modwire-2.3.0/src/modwire/extraction/serialization.py +0 -107
  86. modwire-2.3.0/src/modwire/extraction/service.py +0 -100
  87. modwire-2.3.0/src/modwire/extractors/__init__.py +0 -5
  88. modwire-2.3.0/src/modwire/extractors/base.py +0 -781
  89. modwire-2.3.0/src/modwire/extractors/loader.py +0 -36
  90. modwire-2.3.0/src/modwire/extractors/php.py +0 -348
  91. modwire-2.3.0/src/modwire/extractors/python.py +0 -472
  92. modwire-2.3.0/src/modwire/extractors/resources.py +0 -29
  93. modwire-2.3.0/src/modwire/extractors/scripts/__init__.py +0 -2
  94. modwire-2.3.0/src/modwire/extractors/scripts/php_extractor.php +0 -1344
  95. modwire-2.3.0/src/modwire/extractors/scripts/python_extractor.py +0 -1000
  96. modwire-2.3.0/src/modwire/extractors/scripts/typescript_extractor.js +0 -1727
  97. modwire-2.3.0/src/modwire/extractors/typescript.py +0 -97
  98. modwire-2.3.0/src/modwire/graph.py +0 -116
  99. modwire-2.3.0/src/modwire/metadata.py +0 -124
  100. modwire-2.3.0/src/modwire/shape/__init__.py +0 -16
  101. modwire-2.3.0/src/modwire/shape/config.py +0 -93
  102. modwire-2.3.0/src/modwire/shape/evaluator.py +0 -32
  103. modwire-2.3.0/src/modwire/shape/rules.py +0 -389
  104. modwire-2.3.0/src/modwire/shape/violations.py +0 -23
  105. modwire-2.3.0/src/modwire/testing/__init__.py +0 -24
  106. modwire-2.3.0/src/modwire/testing/factories.py +0 -277
  107. modwire-2.3.0/src/modwire.egg-info/PKG-INFO +0 -288
  108. modwire-2.3.0/src/modwire.egg-info/SOURCES.txt +0 -89
  109. modwire-2.3.0/src/modwire.egg-info/scm_file_list.json +0 -85
  110. modwire-2.3.0/src/modwire.egg-info/scm_version.json +0 -8
  111. modwire-2.3.0/tests/apps/php/ignored/generated.php +0 -6
  112. modwire-2.3.0/tests/apps/php/src/application/use_cases/activate.php +0 -28
  113. modwire-2.3.0/tests/apps/php/src/domain/model/user.php +0 -16
  114. modwire-2.3.0/tests/apps/php/src/domain/services/policy.php +0 -17
  115. modwire-2.3.0/tests/apps/php/src/interfaces/http/controller.php +0 -18
  116. modwire-2.3.0/tests/apps/python/ignored/generated.py +0 -5
  117. modwire-2.3.0/tests/apps/python/src/application/use_cases/activate.py +0 -26
  118. modwire-2.3.0/tests/apps/python/src/domain/model/user.py +0 -11
  119. modwire-2.3.0/tests/apps/python/src/domain/services/policy.py +0 -10
  120. modwire-2.3.0/tests/apps/python/src/interfaces/http/controller.py +0 -14
  121. modwire-2.3.0/tests/apps/typescript/ignored/generated.ts +0 -3
  122. modwire-2.3.0/tests/apps/typescript/src/application/use_cases/activate.ts +0 -24
  123. modwire-2.3.0/tests/apps/typescript/src/domain/model/profile.tsx +0 -5
  124. modwire-2.3.0/tests/apps/typescript/src/domain/model/user.ts +0 -11
  125. modwire-2.3.0/tests/apps/typescript/src/domain/services/audit.js +0 -3
  126. modwire-2.3.0/tests/apps/typescript/src/domain/services/policy.ts +0 -11
  127. modwire-2.3.0/tests/apps/typescript/src/interfaces/http/controller.ts +0 -13
  128. modwire-2.3.0/tests/apps/typescript/src/interfaces/http/view.jsx +0 -3
  129. modwire-2.3.0/tests/large_projects/README.md +0 -47
  130. modwire-2.3.0/tests/large_projects/fixtures.json +0 -242
  131. modwire-2.3.0/tests/large_projects/run_large_project_fixtures.py +0 -534
  132. modwire-2.3.0/tests/test_api.py +0 -2234
  133. modwire-2.3.0/tests/test_architecture_api.py +0 -455
  134. modwire-2.3.0/tests/test_standalone.py +0 -44
  135. {modwire-2.3.0 → modwire-3.0.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  136. {modwire-2.3.0 → modwire-3.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  137. {modwire-2.3.0 → modwire-3.0.0}/.gitignore +0 -0
  138. {modwire-2.3.0 → modwire-3.0.0}/LICENSE +0 -0
  139. {modwire-2.3.0 → modwire-3.0.0}/docs/wiki/Requesting-features.md +0 -0
  140. {modwire-2.3.0 → modwire-3.0.0}/setup.cfg +0 -0
  141. {modwire-2.3.0 → modwire-3.0.0}/src/modwire.egg-info/dependency_links.txt +0 -0
  142. {modwire-2.3.0 → modwire-3.0.0}/src/modwire.egg-info/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  name: Bug report
2
- description: Report incorrect extraction, graph output, architecture analysis, packaging, or runtime behavior.
2
+ description: Report incorrect architecture analysis, graph output, package metadata, or report output.
3
3
  title: "Bug: "
4
4
  labels:
5
5
  - bug
@@ -7,7 +7,7 @@ body:
7
7
  - type: markdown
8
8
  attributes:
9
9
  value: |
10
- Thanks for reporting a bug. Clear reproduction details make it much easier to fix issues in extractors and graph analysis.
10
+ Thanks for reporting a bug. Clear reproduction details make it much easier to fix issues in architecture analysis, report output, and package metadata.
11
11
 
12
12
  - type: textarea
13
13
  id: summary
@@ -23,11 +23,11 @@ body:
23
23
  attributes:
24
24
  label: Affected area
25
25
  options:
26
- - Python extractor
27
- - TypeScript/JavaScript extractor
28
- - PHP extractor
29
- - Dependency graph
26
+ - Dependency graph report
30
27
  - Architecture policy API
28
+ - Shape policy API
29
+ - Callable report
30
+ - Unused export report
31
31
  - Packaging or installation
32
32
  - Documentation
33
33
  - Other
@@ -59,7 +59,7 @@ body:
59
59
  id: expected
60
60
  attributes:
61
61
  label: Expected output
62
- description: Describe the graph, source IDs, symbols, imports, or violations you expected.
62
+ description: Describe the graph, report entries, or violations you expected.
63
63
  validations:
64
64
  required: false
65
65
 
@@ -83,9 +83,9 @@ body:
83
83
  - type: input
84
84
  id: runtime-versions
85
85
  attributes:
86
- label: Node.js or PHP version, if relevant
87
- description: TypeScript/JavaScript extraction requires Node.js. PHP extraction requires PHP.
88
- placeholder: "Node.js 20.x, PHP 8.3, or not applicable"
86
+ label: modwire-extraction version, if relevant
87
+ description: Include the producer version when the issue depends on source metadata.
88
+ placeholder: "1.0.1 or not applicable"
89
89
  validations:
90
90
  required: false
91
91
 
@@ -1,5 +1,5 @@
1
1
  name: Feature request
2
- description: Suggest a new capability, supported language, extractor improvement, graph API, or architecture rule.
2
+ description: Suggest a new architecture, graph, shape, callable, export, or integration capability.
3
3
  title: "Feature: "
4
4
  labels:
5
5
  - enhancement
@@ -23,13 +23,12 @@ body:
23
23
  attributes:
24
24
  label: Feature area
25
25
  options:
26
- - New language support
27
- - Python extractor
28
- - TypeScript/JavaScript extractor
29
- - PHP extractor
30
- - Dependency graph
26
+ - Dependency graph report
31
27
  - Architecture policy API
32
- - Exports or integrations
28
+ - Shape policy API
29
+ - Callable report
30
+ - Unused export report
31
+ - Integrations
33
32
  - Documentation
34
33
  - Other
35
34
  validations:
@@ -27,16 +27,6 @@ jobs:
27
27
  with:
28
28
  python-version: ${{ matrix.python-version }}
29
29
 
30
- - name: Set up Node.js
31
- uses: actions/setup-node@v4
32
- with:
33
- node-version: "20"
34
-
35
- - name: Set up PHP
36
- uses: shivammathur/setup-php@v2
37
- with:
38
- php-version: "8.3"
39
-
40
30
  - name: Clean packaging artifacts
41
31
  run: rm -rf .dev build dist src/*.egg-info
42
32
 
@@ -48,11 +38,6 @@ jobs:
48
38
  - name: Run unit tests
49
39
  run: python -m pytest
50
40
 
51
- - name: Validate extractor syntax
52
- run: |
53
- node --check src/modwire/extractors/scripts/typescript_extractor.js
54
- php -l src/modwire/extractors/scripts/php_extractor.php
55
-
56
41
  - name: Build distributions
57
42
  run: python -m build --outdir dist
58
43
 
@@ -51,16 +51,6 @@ jobs:
51
51
  with:
52
52
  python-version: "3.12"
53
53
 
54
- - name: Set up Node.js
55
- uses: actions/setup-node@v4
56
- with:
57
- node-version: "20"
58
-
59
- - name: Set up PHP
60
- uses: shivammathur/setup-php@v2
61
- with:
62
- php-version: "8.3"
63
-
64
54
  - name: Clean packaging artifacts
65
55
  run: rm -rf .dev build dist src/*.egg-info
66
56
 
@@ -93,11 +83,6 @@ jobs:
93
83
  - name: Run tests
94
84
  run: python -m pytest
95
85
 
96
- - name: Validate extractor syntax
97
- run: |
98
- node --check src/modwire/extractors/scripts/typescript_extractor.js
99
- php -l src/modwire/extractors/scripts/php_extractor.php
100
-
101
86
  - name: Build distributions
102
87
  run: python -m build --outdir dist
103
88
 
@@ -0,0 +1,31 @@
1
+ # Changelog
2
+
3
+ ## 3.0.0 - Unreleased
4
+
5
+ ### Breaking Changes
6
+
7
+ - Replaced the previous function-style public API with an OOP-first architecture
8
+ reporting API.
9
+ - Removed legacy helper entry points documented by older releases, including
10
+ `evaluate_shape`, `render_callable_report`, `structured_callable_report`,
11
+ `find_unused_exports`, `map_code`, `find_hotspots`, and `coherence_summary`.
12
+ - Consolidated architecture mapping, flow violations, shape violations, and
13
+ insights into `ArchitectureReportRunner`.
14
+
15
+ ### Added
16
+
17
+ - `ArchitectureReportRunner`, returning a typed `ArchitectureReport`.
18
+ - Normalized report sections for map data, violations, and insights.
19
+ - Public exports for the configuration objects needed to build reports from
20
+ `modwire.architecture`.
21
+
22
+ ### Migration
23
+
24
+ Use `ArchitectureReportRunner(config).run(code_map)` instead of calling
25
+ individual helper functions:
26
+
27
+ ```python
28
+ from modwire.architecture import ArchitectureConfig, ArchitectureReportRunner
29
+
30
+ report = ArchitectureReportRunner(ArchitectureConfig(language="python")).run(code_map)
31
+ ```
@@ -1,15 +1,14 @@
1
1
  # Contributing to Modwire
2
2
 
3
- Modwire is a Python package for extracting source-code dependencies and
4
- evaluating architecture rules across Python, TypeScript/JavaScript, and PHP
5
- projects.
3
+ Modwire is a Python package for architecture mapping, violation evaluation, and
4
+ code-map reports produced from `modwire-extraction` data.
6
5
 
7
6
  ## Requesting Features
8
7
 
9
8
  Use the `Feature request` issue form for new capabilities, such as:
10
9
 
11
- - support for another language or framework convention
12
- - richer symbol, import, or graph metadata
10
+ - architecture mapping for another framework convention
11
+ - richer architecture analysis, shape reports, callable reports, or export checks
13
12
  - new architecture analyzers or policy matching behavior
14
13
  - export formats or integrations with other tools
15
14
  - documentation examples for common workflows
@@ -21,22 +20,18 @@ solved, a small example input, and the desired API or output shape.
21
20
 
22
21
  Use the `Bug report` issue form for incorrect current behavior, such as:
23
22
 
24
- - missing or incorrect imports, symbols, source IDs, or graph edges
25
23
  - incorrect architecture-policy violations
26
- - extractor crashes or runtime failures
24
+ - incorrect shape, callable, unused-export, or graph reports
27
25
  - packaging, installation, or compatibility problems
28
26
  - documentation that contradicts the implemented behavior
29
27
 
30
28
  Bug reports should include a minimal reproduction, the expected output, the
31
- actual output, and relevant versions for Python, Modwire, Node.js, or PHP.
29
+ actual output, and relevant versions for Python, Modwire, and modwire-extraction.
32
30
 
33
31
  ## Pull Requests
34
32
 
35
33
  Before opening a pull request, run the local checks documented in
36
34
  [Development checks](docs/wiki/Development-checks.md).
37
35
 
38
- Extractor changes should include focused tests under `tests/` and, when
39
- relevant, a small fixture under `tests/apps/`.
40
-
41
36
  Keep pull requests scoped to one behavior change. If an issue exists, link it in
42
37
  the pull request description.
modwire-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: modwire
3
+ Version: 3.0.0
4
+ Summary: Map architecture boundaries and analyze extracted code maps.
5
+ Author: Tomasz Szpak
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/9orky/modwire
8
+ Project-URL: Repository, https://github.com/9orky/modwire
9
+ Project-URL: Issues, https://github.com/9orky/modwire/issues
10
+ Keywords: architecture,code-analysis,dependency-graph,static-analysis
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: modwire-extraction>=1.0.1
27
+ Requires-Dist: pydantic>=2.8
28
+ Provides-Extra: dev
29
+ Requires-Dist: build>=1.2; extra == "dev"
30
+ Requires-Dist: pytest>=8.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.8; extra == "dev"
32
+ Requires-Dist: twine>=5.1; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # modwire
36
+
37
+ `modwire` turns code maps from
38
+ [`modwire-extraction`](https://github.com/9orky/modwire-extraction) into
39
+ architecture reports: boundary maps, dependency-flow violations, shape-policy
40
+ violations, and architecture insights.
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ python -m pip install modwire
46
+ ```
47
+
48
+ ## Quick Start
49
+
50
+ ```python
51
+ from pathlib import Path
52
+
53
+ from modwire.architecture import (
54
+ ArchitectureConfig,
55
+ ArchitectureReportRunner,
56
+ BoundariesConfig,
57
+ FlowRealm,
58
+ FlowRules,
59
+ ShapeConfig,
60
+ TagRule,
61
+ )
62
+ from modwire_extraction import ModwireExtraction
63
+
64
+ code_map = ModwireExtraction(Path("src")).generate_map("python")
65
+
66
+ config = ArchitectureConfig(
67
+ language="python",
68
+ boundaries=BoundariesConfig(
69
+ tags=(
70
+ TagRule(name="module", match="features/*"),
71
+ TagRule(name="ui", match="features/*/ui"),
72
+ TagRule(name="domain", match="features/*/domain"),
73
+ ),
74
+ flow=FlowRules(
75
+ module_tag="module",
76
+ realms=(
77
+ FlowRealm(
78
+ name="feature",
79
+ layers=("domain", "ui"),
80
+ ),
81
+ ),
82
+ ),
83
+ ),
84
+ shape=ShapeConfig(
85
+ max_functions_per_file=8,
86
+ max_methods_per_class=12,
87
+ allow_import_aliases=False,
88
+ ),
89
+ )
90
+
91
+ report = ArchitectureReportRunner(config).run(code_map)
92
+
93
+ print(report.map.modules)
94
+ print(report.violations.flow.violations)
95
+ print(report.violations.shape.violations)
96
+ print(report.insights.hotspots[:5])
97
+ ```
98
+
99
+ ## Report Sections
100
+
101
+ `ArchitectureReportRunner` returns a typed `ArchitectureReport` with three
102
+ top-level sections:
103
+
104
+ - `map`: normalized module and layer groupings plus unknown files
105
+ - `violations`: dependency-flow and shape-policy violations
106
+ - `insights`: clusters, hotspots, dependency coherence, callable graph, and
107
+ unused exports
108
+
109
+ Reports are Pydantic models, so they can be serialized with `model_dump()` or
110
+ `model_dump_json()`.
111
+
112
+ ```python
113
+ payload = report.model_dump(mode="json")
114
+ ```
115
+
116
+ ## Configuration
117
+
118
+ Boundary tags classify source IDs. Flow rules then use those tags to detect
119
+ backward dependencies, module cycles, and module re-entry.
120
+
121
+ ```python
122
+ from modwire.architecture import BoundariesConfig, FlowRules, TagRule
123
+
124
+ boundaries = BoundariesConfig(
125
+ tags=(
126
+ TagRule(name="module", match="features/*"),
127
+ TagRule(name="api", match="features/*/api"),
128
+ TagRule(name="domain", match="features/*/domain"),
129
+ ),
130
+ flow=FlowRules(
131
+ module_tag="module",
132
+ layers=("domain", "api"),
133
+ ),
134
+ )
135
+ ```
136
+
137
+ Shape limits are disabled with `-1` and enabled with non-negative integers.
138
+
139
+ ```python
140
+ from modwire.architecture import ShapeConfig
141
+
142
+ shape = ShapeConfig(
143
+ max_classes_per_file=3,
144
+ max_function_lines=40,
145
+ require_joined_imports=True,
146
+ )
147
+ ```
148
+
149
+ ## Migration
150
+
151
+ The current API is intentionally OOP-first. Older helper functions such as
152
+ `evaluate_shape`, `render_callable_report`, `structured_callable_report`,
153
+ `find_unused_exports`, `map_code`, `find_hotspots`, and
154
+ `coherence_summary` have been replaced by `ArchitectureReportRunner`.
155
+
156
+ See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
157
+ major release.
158
+
159
+ ## Development
160
+
161
+ See [Development checks](docs/wiki/Development-checks.md) for the local command
162
+ set used before pull requests and releases.
163
+
164
+ ## Contributing
165
+
166
+ Feature requests and bug reports are tracked through GitHub Issues:
167
+
168
+ - Open a feature request for architecture analyzers, output formats, or
169
+ integrations.
170
+ - Open a bug report for incorrect architecture violations, graph output, shape
171
+ reports, callable reports, unused export reports, packaging problems, or
172
+ documentation mismatches.
173
+
174
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
175
+ checks to run before opening a pull request.
@@ -0,0 +1,141 @@
1
+ # modwire
2
+
3
+ `modwire` turns code maps from
4
+ [`modwire-extraction`](https://github.com/9orky/modwire-extraction) into
5
+ architecture reports: boundary maps, dependency-flow violations, shape-policy
6
+ violations, and architecture insights.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ python -m pip install modwire
12
+ ```
13
+
14
+ ## Quick Start
15
+
16
+ ```python
17
+ from pathlib import Path
18
+
19
+ from modwire.architecture import (
20
+ ArchitectureConfig,
21
+ ArchitectureReportRunner,
22
+ BoundariesConfig,
23
+ FlowRealm,
24
+ FlowRules,
25
+ ShapeConfig,
26
+ TagRule,
27
+ )
28
+ from modwire_extraction import ModwireExtraction
29
+
30
+ code_map = ModwireExtraction(Path("src")).generate_map("python")
31
+
32
+ config = ArchitectureConfig(
33
+ language="python",
34
+ boundaries=BoundariesConfig(
35
+ tags=(
36
+ TagRule(name="module", match="features/*"),
37
+ TagRule(name="ui", match="features/*/ui"),
38
+ TagRule(name="domain", match="features/*/domain"),
39
+ ),
40
+ flow=FlowRules(
41
+ module_tag="module",
42
+ realms=(
43
+ FlowRealm(
44
+ name="feature",
45
+ layers=("domain", "ui"),
46
+ ),
47
+ ),
48
+ ),
49
+ ),
50
+ shape=ShapeConfig(
51
+ max_functions_per_file=8,
52
+ max_methods_per_class=12,
53
+ allow_import_aliases=False,
54
+ ),
55
+ )
56
+
57
+ report = ArchitectureReportRunner(config).run(code_map)
58
+
59
+ print(report.map.modules)
60
+ print(report.violations.flow.violations)
61
+ print(report.violations.shape.violations)
62
+ print(report.insights.hotspots[:5])
63
+ ```
64
+
65
+ ## Report Sections
66
+
67
+ `ArchitectureReportRunner` returns a typed `ArchitectureReport` with three
68
+ top-level sections:
69
+
70
+ - `map`: normalized module and layer groupings plus unknown files
71
+ - `violations`: dependency-flow and shape-policy violations
72
+ - `insights`: clusters, hotspots, dependency coherence, callable graph, and
73
+ unused exports
74
+
75
+ Reports are Pydantic models, so they can be serialized with `model_dump()` or
76
+ `model_dump_json()`.
77
+
78
+ ```python
79
+ payload = report.model_dump(mode="json")
80
+ ```
81
+
82
+ ## Configuration
83
+
84
+ Boundary tags classify source IDs. Flow rules then use those tags to detect
85
+ backward dependencies, module cycles, and module re-entry.
86
+
87
+ ```python
88
+ from modwire.architecture import BoundariesConfig, FlowRules, TagRule
89
+
90
+ boundaries = BoundariesConfig(
91
+ tags=(
92
+ TagRule(name="module", match="features/*"),
93
+ TagRule(name="api", match="features/*/api"),
94
+ TagRule(name="domain", match="features/*/domain"),
95
+ ),
96
+ flow=FlowRules(
97
+ module_tag="module",
98
+ layers=("domain", "api"),
99
+ ),
100
+ )
101
+ ```
102
+
103
+ Shape limits are disabled with `-1` and enabled with non-negative integers.
104
+
105
+ ```python
106
+ from modwire.architecture import ShapeConfig
107
+
108
+ shape = ShapeConfig(
109
+ max_classes_per_file=3,
110
+ max_function_lines=40,
111
+ require_joined_imports=True,
112
+ )
113
+ ```
114
+
115
+ ## Migration
116
+
117
+ The current API is intentionally OOP-first. Older helper functions such as
118
+ `evaluate_shape`, `render_callable_report`, `structured_callable_report`,
119
+ `find_unused_exports`, `map_code`, `find_hotspots`, and
120
+ `coherence_summary` have been replaced by `ArchitectureReportRunner`.
121
+
122
+ See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
123
+ major release.
124
+
125
+ ## Development
126
+
127
+ See [Development checks](docs/wiki/Development-checks.md) for the local command
128
+ set used before pull requests and releases.
129
+
130
+ ## Contributing
131
+
132
+ Feature requests and bug reports are tracked through GitHub Issues:
133
+
134
+ - Open a feature request for architecture analyzers, output formats, or
135
+ integrations.
136
+ - Open a bug report for incorrect architecture violations, graph output, shape
137
+ reports, callable reports, unused export reports, packaging problems, or
138
+ documentation mismatches.
139
+
140
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
141
+ checks to run before opening a pull request.
@@ -0,0 +1,18 @@
1
+ # Development Checks
2
+
3
+ Run these checks before opening a pull request:
4
+
5
+ ```bash
6
+ uv run ruff check .
7
+ uv run --with pytest python -m pytest
8
+ uv run --with build python -m build --outdir dist
9
+ uv run --with twine python -m twine check dist/*
10
+ ```
11
+
12
+ This page is the canonical local-check list; README and contributor guidance
13
+ link here to avoid release-process drift.
14
+
15
+ The CI workflow currently validates:
16
+
17
+ - Python 3.11, 3.12, and 3.13
18
+ - package build and distribution metadata
@@ -0,0 +1,25 @@
1
+ # Modwire Wiki
2
+
3
+ Modwire maps architecture boundaries and evaluates policies from code maps
4
+ produced by `modwire-extraction`.
5
+
6
+ ## Start Here
7
+
8
+ - README examples cover the OOP architecture report runner, including boundary
9
+ maps, flow violations, shape violations, callable insights, hotspots, and
10
+ unused export checks.
11
+ - [Reporting bugs](Reporting-bugs.md)
12
+ - [Requesting features](Requesting-features.md)
13
+ - [Development checks](Development-checks.md)
14
+
15
+ ## Useful Project Links
16
+
17
+ - Repository: https://github.com/9orky/modwire
18
+ - Issues: https://github.com/9orky/modwire/issues
19
+ - Bug report form: https://github.com/9orky/modwire/issues/new?template=bug_report.yml
20
+ - Feature request form: https://github.com/9orky/modwire/issues/new?template=feature_request.yml
21
+
22
+ ## Code Maps
23
+
24
+ Use `modwire-extraction` to produce `CodeMap` objects. Pass those maps into
25
+ `ArchitectureReportRunner` to produce a full architecture report.
@@ -5,20 +5,18 @@ Use the GitHub `Bug report` issue form when Modwire behaves incorrectly.
5
5
  ## Good Bug Reports Include
6
6
 
7
7
  - a short summary of what went wrong
8
- - the affected area, such as an extractor, dependency graph, or architecture
9
- analyzer
8
+ - the affected area, such as architecture mapping, dependency graph reporting,
9
+ shape policy, callable reports, or unused exports
10
10
  - the smallest source snippet or fixture that reproduces the problem
11
11
  - the actual output, traceback, graph edges, or violations
12
12
  - the expected output
13
- - Modwire, Python, Node.js, PHP, and operating-system versions where relevant
13
+ - Modwire, modwire-extraction, Python, and operating-system versions where relevant
14
14
 
15
15
  ## Examples of Bugs
16
16
 
17
- - an import is missed or linked to the wrong source ID
18
- - a symbol is extracted with incorrect metadata
19
17
  - graph edges are missing, duplicated, or pointed at the wrong node
20
- - an architecture policy reports the wrong violation
21
- - extraction crashes on valid Python, TypeScript/JavaScript, or PHP source
18
+ - an architecture policy returns the wrong violation
19
+ - shape, callable, or unused-export reports omit or misclassify source metadata
22
20
  - package installation or distribution metadata is broken
23
21
 
24
22
  Open a bug report at:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "modwire"
7
- description = "Extract source-code dependencies and build dependency graphs."
7
+ description = "Map architecture boundaries and analyze extracted code maps."
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.11"
10
10
  license = "MIT"
@@ -33,6 +33,7 @@ classifiers = [
33
33
  "Topic :: Software Development :: Quality Assurance",
34
34
  ]
35
35
  dependencies = [
36
+ "modwire-extraction>=1.0.1",
36
37
  "pydantic>=2.8",
37
38
  ]
38
39
 
@@ -57,6 +58,9 @@ dev = [
57
58
  "twine>=5.1",
58
59
  ]
59
60
 
61
+ [tool.uv.sources]
62
+ modwire-extraction = { path = "../modwire-extraction", editable = true }
63
+
60
64
  [tool.pytest.ini_options]
61
65
  testpaths = ["tests"]
62
66
  cache_dir = ".dev/pytest_cache"
@@ -71,12 +75,6 @@ include-package-data = true
71
75
  [tool.setuptools.packages.find]
72
76
  where = ["src"]
73
77
 
74
- [tool.setuptools.package-data]
75
- "modwire.extractors.scripts" = [
76
- "*.js",
77
- "*.php",
78
- ]
79
-
80
78
  [tool.setuptools_scm]
81
79
  fallback_version = "0.0.0.dev0"
82
80
  local_scheme = "no-local-version"
@@ -0,0 +1,6 @@
1
+ from ._version import __version__, version
2
+
3
+ __all__ = [
4
+ "__version__",
5
+ "version",
6
+ ]
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.3.0'
22
- __version_tuple__ = version_tuple = (2, 3, 0)
21
+ __version__ = version = '3.0.0'
22
+ __version_tuple__ = version_tuple = (3, 0, 0)
23
23
 
24
- __commit_id__ = commit_id = 'gdb0b34253'
24
+ __commit_id__ = commit_id = 'g84d5eeaca'
@@ -0,0 +1,26 @@
1
+ from .boundaries.config import BoundariesConfig, FlowRealm, FlowRules, TagRule
2
+ from .config import ArchitectureConfig
3
+ from .report import (
4
+ ArchitectureGroup,
5
+ ArchitectureMapReport,
6
+ ArchitectureReport,
7
+ ArchitectureReportRunner,
8
+ ArchitectureViolationReport,
9
+ )
10
+ from .root import ArchitectureRoot
11
+ from .shape.config import ShapeConfig
12
+
13
+ __all__ = [
14
+ "ArchitectureConfig",
15
+ "ArchitectureGroup",
16
+ "ArchitectureMapReport",
17
+ "ArchitectureReport",
18
+ "ArchitectureReportRunner",
19
+ "ArchitectureRoot",
20
+ "ArchitectureViolationReport",
21
+ "BoundariesConfig",
22
+ "FlowRealm",
23
+ "FlowRules",
24
+ "ShapeConfig",
25
+ "TagRule",
26
+ ]