modwire 2.3.0__tar.gz → 3.1.1__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 (166) hide show
  1. {modwire-2.3.0 → modwire-3.1.1}/.github/ISSUE_TEMPLATE/bug_report.yml +10 -10
  2. {modwire-2.3.0 → modwire-3.1.1}/.github/ISSUE_TEMPLATE/feature_request.yml +6 -7
  3. {modwire-2.3.0 → modwire-3.1.1}/.github/workflows/ci.yml +0 -15
  4. {modwire-2.3.0 → modwire-3.1.1}/.github/workflows/release.yml +11 -16
  5. modwire-3.1.1/CHANGELOG.md +31 -0
  6. {modwire-2.3.0 → modwire-3.1.1}/CONTRIBUTING.md +6 -11
  7. modwire-3.1.1/PKG-INFO +198 -0
  8. modwire-3.1.1/README.md +163 -0
  9. modwire-3.1.1/docs/wiki/Development-checks.md +18 -0
  10. modwire-3.1.1/docs/wiki/Home.md +25 -0
  11. {modwire-2.3.0 → modwire-3.1.1}/docs/wiki/Reporting-bugs.md +5 -7
  12. {modwire-2.3.0 → modwire-3.1.1}/pyproject.toml +12 -7
  13. modwire-3.1.1/src/modwire/__init__.py +6 -0
  14. {modwire-2.3.0 → modwire-3.1.1}/src/modwire/_version.py +3 -3
  15. modwire-3.1.1/src/modwire/architecture/__init__.py +26 -0
  16. modwire-3.1.1/src/modwire/architecture/boundaries/__init__.py +0 -0
  17. modwire-3.1.1/src/modwire/architecture/boundaries/analyzers/__init__.py +0 -0
  18. modwire-3.1.1/src/modwire/architecture/boundaries/analyzers/backward.py +35 -0
  19. modwire-3.1.1/src/modwire/architecture/boundaries/analyzers/no_cycles.py +88 -0
  20. modwire-3.1.1/src/modwire/architecture/boundaries/analyzers/no_reentry.py +74 -0
  21. modwire-3.1.1/src/modwire/architecture/boundaries/base.py +93 -0
  22. modwire-3.1.1/src/modwire/architecture/boundaries/config.py +43 -0
  23. modwire-3.1.1/src/modwire/architecture/boundaries/map.py +155 -0
  24. modwire-3.1.1/src/modwire/architecture/boundaries/pipeline.py +108 -0
  25. modwire-3.1.1/src/modwire/architecture/boundaries/tags/__init__.py +0 -0
  26. modwire-3.1.1/src/modwire/architecture/boundaries/tags/matcher.py +131 -0
  27. modwire-3.1.1/src/modwire/architecture/boundaries/tags/tag_map.py +24 -0
  28. modwire-3.1.1/src/modwire/architecture/config.py +14 -0
  29. modwire-3.1.1/src/modwire/architecture/insight/__init__.py +0 -0
  30. modwire-3.1.1/src/modwire/architecture/insight/base.py +14 -0
  31. modwire-3.1.1/src/modwire/architecture/insight/pipeline.py +92 -0
  32. modwire-3.1.1/src/modwire/architecture/insight/reports/__init__.py +22 -0
  33. modwire-3.1.1/src/modwire/architecture/insight/reports/callables.py +54 -0
  34. modwire-3.1.1/src/modwire/architecture/insight/reports/clusters.py +119 -0
  35. modwire-3.1.1/src/modwire/architecture/insight/reports/coherence.py +56 -0
  36. modwire-3.1.1/src/modwire/architecture/insight/reports/exports.py +64 -0
  37. modwire-3.1.1/src/modwire/architecture/insight/reports/hotspots.py +57 -0
  38. modwire-3.1.1/src/modwire/architecture/report.py +102 -0
  39. modwire-3.1.1/src/modwire/architecture/root.py +18 -0
  40. modwire-3.1.1/src/modwire/architecture/shape/__init__.py +0 -0
  41. modwire-3.1.1/src/modwire/architecture/shape/base.py +52 -0
  42. modwire-3.1.1/src/modwire/architecture/shape/config.py +45 -0
  43. modwire-3.1.1/src/modwire/architecture/shape/pipeline.py +95 -0
  44. modwire-3.1.1/src/modwire/architecture/shape/rules/__init__.py +20 -0
  45. modwire-3.1.1/src/modwire/architecture/shape/rules/abstract_class_resolver.py +60 -0
  46. modwire-3.1.1/src/modwire/architecture/shape/rules/callable_resolver.py +129 -0
  47. modwire-3.1.1/src/modwire/architecture/shape/rules/class_resolver.py +89 -0
  48. modwire-3.1.1/src/modwire/architecture/shape/rules/file_resolver.py +57 -0
  49. modwire-3.1.1/src/modwire/architecture/shape/rules/import_resolver.py +58 -0
  50. modwire-3.1.1/src/modwire/architecture/shape/rules/property_resolver.py +81 -0
  51. modwire-3.1.1/src/modwire/architecture/shape/rules/signature_resolver.py +75 -0
  52. modwire-3.1.1/src/modwire/architecture/shape/rules/symbol_resolver.py +34 -0
  53. modwire-3.1.1/src/modwire/modules/__init__.py +3 -0
  54. modwire-3.1.1/src/modwire/modules/generate.py +74 -0
  55. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/copier.yml +38 -0
  56. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Application/{{ command_name }}.php.jinja +14 -0
  57. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Application/{{ service_name }}.php.jinja +24 -0
  58. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Domain/{{ aggregate_name }}.php.jinja +27 -0
  59. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Infrastructure/InMemory{{ repository_name }}.php.jinja +24 -0
  60. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Ports/{{ repository_name }}.php.jinja +14 -0
  61. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/php/src/Ui/{{ controller_name }}.php.jinja +27 -0
  62. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/__init__.py.jinja +5 -0
  63. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/application.py.jinja +22 -0
  64. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/domain.py.jinja +20 -0
  65. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/infrastructure.py.jinja +17 -0
  66. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/ports.py.jinja +16 -0
  67. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/python/{{ module_name }}/ui.py.jinja +21 -0
  68. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/typescript/{{ module_name }}/application.ts.jinja +20 -0
  69. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/typescript/{{ module_name }}/domain.ts.jinja +18 -0
  70. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/typescript/{{ module_name }}/infrastructure.ts.jinja +14 -0
  71. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/typescript/{{ module_name }}/ports.ts.jinja +6 -0
  72. modwire-3.1.1/src/modwire/modules/scaffoldings/hexagonal/template/typescript/{{ module_name }}/ui.ts.jinja +19 -0
  73. modwire-3.1.1/src/modwire/modules/scaffoldings/layered/copier.yml +23 -0
  74. modwire-3.1.1/src/modwire/modules/scaffoldings/layered/template/{{ module_name }}/application.py.jinja +18 -0
  75. modwire-3.1.1/src/modwire/modules/scaffoldings/layered/template/{{ module_name }}/domain.py.jinja +12 -0
  76. modwire-3.1.1/src/modwire/modules/scaffoldings/layered/template/{{ module_name }}/infrastructure.py.jinja +11 -0
  77. modwire-3.1.1/src/modwire/modules/scaffoldings/layered/template/{{ module_name }}/ui.py.jinja +20 -0
  78. modwire-3.1.1/src/modwire.egg-info/PKG-INFO +198 -0
  79. modwire-3.1.1/src/modwire.egg-info/SOURCES.txt +91 -0
  80. {modwire-2.3.0 → modwire-3.1.1}/src/modwire.egg-info/requires.txt +2 -0
  81. modwire-3.1.1/tests/architecture/boundaries/test_map.py +69 -0
  82. modwire-3.1.1/tests/architecture/boundaries/test_pipeline.py +122 -0
  83. modwire-3.1.1/tests/architecture/test_report.py +110 -0
  84. modwire-3.1.1/tests/modules/test_generate.py +56 -0
  85. {modwire-2.3.0 → modwire-3.1.1}/uv.lock +328 -41
  86. modwire-2.3.0/.github/workflows/large-repo-fixtures.yml +0 -88
  87. modwire-2.3.0/PKG-INFO +0 -288
  88. modwire-2.3.0/README.md +0 -255
  89. modwire-2.3.0/docs/wiki/Development-checks.md +0 -23
  90. modwire-2.3.0/docs/wiki/Home.md +0 -31
  91. modwire-2.3.0/show_test_source_files.py +0 -28
  92. modwire-2.3.0/src/modwire/__init__.py +0 -96
  93. modwire-2.3.0/src/modwire/architecture/__init__.py +0 -61
  94. modwire-2.3.0/src/modwire/architecture/analyzers.py +0 -166
  95. modwire-2.3.0/src/modwire/architecture/config.py +0 -170
  96. modwire-2.3.0/src/modwire/architecture/insights.py +0 -246
  97. modwire-2.3.0/src/modwire/architecture/matching.py +0 -189
  98. modwire-2.3.0/src/modwire/architecture/policy.py +0 -75
  99. modwire-2.3.0/src/modwire/architecture/render.py +0 -99
  100. modwire-2.3.0/src/modwire/architecture/violations.py +0 -47
  101. modwire-2.3.0/src/modwire/callables.py +0 -162
  102. modwire-2.3.0/src/modwire/definitions.py +0 -200
  103. modwire-2.3.0/src/modwire/exports.py +0 -188
  104. modwire-2.3.0/src/modwire/extraction/__init__.py +0 -33
  105. modwire-2.3.0/src/modwire/extraction/cache.py +0 -92
  106. modwire-2.3.0/src/modwire/extraction/manifest.py +0 -98
  107. modwire-2.3.0/src/modwire/extraction/models.py +0 -199
  108. modwire-2.3.0/src/modwire/extraction/roots.py +0 -100
  109. modwire-2.3.0/src/modwire/extraction/serialization.py +0 -107
  110. modwire-2.3.0/src/modwire/extraction/service.py +0 -100
  111. modwire-2.3.0/src/modwire/extractors/__init__.py +0 -5
  112. modwire-2.3.0/src/modwire/extractors/base.py +0 -781
  113. modwire-2.3.0/src/modwire/extractors/loader.py +0 -36
  114. modwire-2.3.0/src/modwire/extractors/php.py +0 -348
  115. modwire-2.3.0/src/modwire/extractors/python.py +0 -472
  116. modwire-2.3.0/src/modwire/extractors/resources.py +0 -29
  117. modwire-2.3.0/src/modwire/extractors/scripts/__init__.py +0 -2
  118. modwire-2.3.0/src/modwire/extractors/scripts/php_extractor.php +0 -1344
  119. modwire-2.3.0/src/modwire/extractors/scripts/python_extractor.py +0 -1000
  120. modwire-2.3.0/src/modwire/extractors/scripts/typescript_extractor.js +0 -1727
  121. modwire-2.3.0/src/modwire/extractors/typescript.py +0 -97
  122. modwire-2.3.0/src/modwire/graph.py +0 -116
  123. modwire-2.3.0/src/modwire/metadata.py +0 -124
  124. modwire-2.3.0/src/modwire/shape/__init__.py +0 -16
  125. modwire-2.3.0/src/modwire/shape/config.py +0 -93
  126. modwire-2.3.0/src/modwire/shape/evaluator.py +0 -32
  127. modwire-2.3.0/src/modwire/shape/rules.py +0 -389
  128. modwire-2.3.0/src/modwire/shape/violations.py +0 -23
  129. modwire-2.3.0/src/modwire/testing/__init__.py +0 -24
  130. modwire-2.3.0/src/modwire/testing/factories.py +0 -277
  131. modwire-2.3.0/src/modwire.egg-info/PKG-INFO +0 -288
  132. modwire-2.3.0/src/modwire.egg-info/SOURCES.txt +0 -89
  133. modwire-2.3.0/src/modwire.egg-info/scm_file_list.json +0 -85
  134. modwire-2.3.0/src/modwire.egg-info/scm_version.json +0 -8
  135. modwire-2.3.0/tests/apps/php/ignored/generated.php +0 -6
  136. modwire-2.3.0/tests/apps/php/src/application/use_cases/activate.php +0 -28
  137. modwire-2.3.0/tests/apps/php/src/domain/model/user.php +0 -16
  138. modwire-2.3.0/tests/apps/php/src/domain/services/policy.php +0 -17
  139. modwire-2.3.0/tests/apps/php/src/interfaces/http/controller.php +0 -18
  140. modwire-2.3.0/tests/apps/python/ignored/generated.py +0 -5
  141. modwire-2.3.0/tests/apps/python/src/application/use_cases/activate.py +0 -26
  142. modwire-2.3.0/tests/apps/python/src/domain/model/user.py +0 -11
  143. modwire-2.3.0/tests/apps/python/src/domain/services/policy.py +0 -10
  144. modwire-2.3.0/tests/apps/python/src/interfaces/http/controller.py +0 -14
  145. modwire-2.3.0/tests/apps/typescript/ignored/generated.ts +0 -3
  146. modwire-2.3.0/tests/apps/typescript/src/application/use_cases/activate.ts +0 -24
  147. modwire-2.3.0/tests/apps/typescript/src/domain/model/profile.tsx +0 -5
  148. modwire-2.3.0/tests/apps/typescript/src/domain/model/user.ts +0 -11
  149. modwire-2.3.0/tests/apps/typescript/src/domain/services/audit.js +0 -3
  150. modwire-2.3.0/tests/apps/typescript/src/domain/services/policy.ts +0 -11
  151. modwire-2.3.0/tests/apps/typescript/src/interfaces/http/controller.ts +0 -13
  152. modwire-2.3.0/tests/apps/typescript/src/interfaces/http/view.jsx +0 -3
  153. modwire-2.3.0/tests/large_projects/README.md +0 -47
  154. modwire-2.3.0/tests/large_projects/fixtures.json +0 -242
  155. modwire-2.3.0/tests/large_projects/run_large_project_fixtures.py +0 -534
  156. modwire-2.3.0/tests/test_api.py +0 -2234
  157. modwire-2.3.0/tests/test_architecture_api.py +0 -455
  158. modwire-2.3.0/tests/test_standalone.py +0 -44
  159. {modwire-2.3.0 → modwire-3.1.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  160. {modwire-2.3.0 → modwire-3.1.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  161. {modwire-2.3.0 → modwire-3.1.1}/.gitignore +0 -0
  162. {modwire-2.3.0 → modwire-3.1.1}/LICENSE +0 -0
  163. {modwire-2.3.0 → modwire-3.1.1}/docs/wiki/Requesting-features.md +0 -0
  164. {modwire-2.3.0 → modwire-3.1.1}/setup.cfg +0 -0
  165. {modwire-2.3.0 → modwire-3.1.1}/src/modwire.egg-info/dependency_links.txt +0 -0
  166. {modwire-2.3.0 → modwire-3.1.1}/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
 
@@ -46,21 +46,20 @@ jobs:
46
46
  exit 1
47
47
  fi
48
48
 
49
+ - name: Use release tag as package version
50
+ if: github.event_name == 'release'
51
+ run: |
52
+ tag_name="${{ github.event.release.tag_name }}"
53
+ release_version="${tag_name#v}"
54
+
55
+ echo "MODWIRE_RELEASE_VERSION=$release_version" >> "$GITHUB_ENV"
56
+ echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MODWIRE=$release_version" >> "$GITHUB_ENV"
57
+
49
58
  - name: Set up Python
50
59
  uses: actions/setup-python@v5
51
60
  with:
52
61
  python-version: "3.12"
53
62
 
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
63
  - name: Clean packaging artifacts
65
64
  run: rm -rf .dev build dist src/*.egg-info
66
65
 
@@ -93,11 +92,6 @@ jobs:
93
92
  - name: Run tests
94
93
  run: python -m pytest
95
94
 
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
95
  - name: Build distributions
102
96
  run: python -m build --outdir dist
103
97
 
@@ -105,12 +99,13 @@ jobs:
105
99
  if: github.event_name == 'release'
106
100
  run: |
107
101
  python - <<'PY'
102
+ import os
108
103
  import sys
109
104
  import zipfile
110
105
  from email.parser import Parser
111
106
  from pathlib import Path
112
107
 
113
- expected_version = "${{ github.event.release.tag_name }}".removeprefix("v")
108
+ expected_version = os.environ["MODWIRE_RELEASE_VERSION"]
114
109
  wheels = sorted(Path("dist").glob("*.whl"))
115
110
  versions: dict[str, str] = {}
116
111
 
@@ -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.1.1/PKG-INFO ADDED
@@ -0,0 +1,198 @@
1
+ Metadata-Version: 2.4
2
+ Name: modwire
3
+ Version: 3.1.1
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: copier>=9.16.0
27
+ Requires-Dist: modwire-extraction>=1.0.1
28
+ Requires-Dist: pydantic>=2.8
29
+ Provides-Extra: dev
30
+ Requires-Dist: build>=1.2; extra == "dev"
31
+ Requires-Dist: pytest>=8.0; extra == "dev"
32
+ Requires-Dist: ruff>=0.8; extra == "dev"
33
+ Requires-Dist: twine>=5.1; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # modwire
37
+
38
+ `modwire` turns code maps from
39
+ [`modwire-extraction`](https://github.com/9orky/modwire-extraction) into
40
+ architecture reports: boundary maps, dependency-flow violations, shape-policy
41
+ violations, and architecture insights.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ python -m pip install modwire
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```python
52
+ from pathlib import Path
53
+
54
+ from modwire.architecture import (
55
+ ArchitectureConfig,
56
+ ArchitectureReportRunner,
57
+ BoundariesConfig,
58
+ FlowRealm,
59
+ FlowRules,
60
+ ShapeConfig,
61
+ TagRule,
62
+ )
63
+ from modwire_extraction import ModwireExtraction
64
+
65
+ code_map = ModwireExtraction(Path("src")).generate_map("python")
66
+
67
+ config = ArchitectureConfig(
68
+ language="python",
69
+ boundaries=BoundariesConfig(
70
+ tags=(
71
+ TagRule(name="module", match="features/*"),
72
+ TagRule(name="ui", match="features/*/ui"),
73
+ TagRule(name="domain", match="features/*/domain"),
74
+ ),
75
+ flow=FlowRules(
76
+ module_tag="module",
77
+ realms=(
78
+ FlowRealm(
79
+ name="feature",
80
+ layers=("domain", "ui"),
81
+ ),
82
+ ),
83
+ ),
84
+ ),
85
+ shape=ShapeConfig(
86
+ max_functions_per_file=8,
87
+ max_methods_per_class=12,
88
+ allow_import_aliases=False,
89
+ ),
90
+ )
91
+
92
+ report = ArchitectureReportRunner(config).run(code_map)
93
+
94
+ print(report.map.modules)
95
+ print(report.violations.flow.violations)
96
+ print(report.violations.shape.violations)
97
+ print(report.insights.hotspots[:5])
98
+ ```
99
+
100
+ ## Report Sections
101
+
102
+ `ArchitectureReportRunner` returns a typed `ArchitectureReport` with three
103
+ top-level sections:
104
+
105
+ - `map`: normalized module and layer groupings plus unknown files
106
+ - `violations`: dependency-flow and shape-policy violations
107
+ - `insights`: clusters, hotspots, dependency coherence, callable graph, and
108
+ unused exports
109
+
110
+ Reports are Pydantic models, so they can be serialized with `model_dump()` or
111
+ `model_dump_json()`.
112
+
113
+ ```python
114
+ payload = report.model_dump(mode="json")
115
+ ```
116
+
117
+ ## Module Generation
118
+
119
+ `modwire.modules` can generate a module from any Copier template. A caller only
120
+ needs to create a normal Copier template directory and pass it to
121
+ `generate_module`.
122
+
123
+ ```python
124
+ from pathlib import Path
125
+
126
+ from modwire.modules import generate_module
127
+
128
+ generate_module(
129
+ "billing",
130
+ Path("src/features"),
131
+ Path("templates/modwire-module"),
132
+ data={"service_name": "BillingService"},
133
+ )
134
+ ```
135
+
136
+ If no template path is provided, `generate_module` uses the bundled `layered`
137
+ scaffolding. Bundled scaffoldings are packaged with the distribution wheel.
138
+
139
+ ## Configuration
140
+
141
+ Boundary tags classify source IDs. Flow rules then use those tags to detect
142
+ backward dependencies, module cycles, and module re-entry.
143
+
144
+ ```python
145
+ from modwire.architecture import BoundariesConfig, FlowRules, TagRule
146
+
147
+ boundaries = BoundariesConfig(
148
+ tags=(
149
+ TagRule(name="module", match="features/*"),
150
+ TagRule(name="api", match="features/*/api"),
151
+ TagRule(name="domain", match="features/*/domain"),
152
+ ),
153
+ flow=FlowRules(
154
+ module_tag="module",
155
+ layers=("domain", "api"),
156
+ ),
157
+ )
158
+ ```
159
+
160
+ Shape limits are disabled with `-1` and enabled with non-negative integers.
161
+
162
+ ```python
163
+ from modwire.architecture import ShapeConfig
164
+
165
+ shape = ShapeConfig(
166
+ max_classes_per_file=3,
167
+ max_function_lines=40,
168
+ require_joined_imports=True,
169
+ )
170
+ ```
171
+
172
+ ## Migration
173
+
174
+ The current API is intentionally OOP-first. Older helper functions such as
175
+ `evaluate_shape`, `render_callable_report`, `structured_callable_report`,
176
+ `find_unused_exports`, `map_code`, `find_hotspots`, and
177
+ `coherence_summary` have been replaced by `ArchitectureReportRunner`.
178
+
179
+ See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
180
+ major release.
181
+
182
+ ## Development
183
+
184
+ See [Development checks](docs/wiki/Development-checks.md) for the local command
185
+ set used before pull requests and releases.
186
+
187
+ ## Contributing
188
+
189
+ Feature requests and bug reports are tracked through GitHub Issues:
190
+
191
+ - Open a feature request for architecture analyzers, output formats, or
192
+ integrations.
193
+ - Open a bug report for incorrect architecture violations, graph output, shape
194
+ reports, callable reports, unused export reports, packaging problems, or
195
+ documentation mismatches.
196
+
197
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
198
+ checks to run before opening a pull request.
@@ -0,0 +1,163 @@
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
+ ## Module Generation
83
+
84
+ `modwire.modules` can generate a module from any Copier template. A caller only
85
+ needs to create a normal Copier template directory and pass it to
86
+ `generate_module`.
87
+
88
+ ```python
89
+ from pathlib import Path
90
+
91
+ from modwire.modules import generate_module
92
+
93
+ generate_module(
94
+ "billing",
95
+ Path("src/features"),
96
+ Path("templates/modwire-module"),
97
+ data={"service_name": "BillingService"},
98
+ )
99
+ ```
100
+
101
+ If no template path is provided, `generate_module` uses the bundled `layered`
102
+ scaffolding. Bundled scaffoldings are packaged with the distribution wheel.
103
+
104
+ ## Configuration
105
+
106
+ Boundary tags classify source IDs. Flow rules then use those tags to detect
107
+ backward dependencies, module cycles, and module re-entry.
108
+
109
+ ```python
110
+ from modwire.architecture import BoundariesConfig, FlowRules, TagRule
111
+
112
+ boundaries = BoundariesConfig(
113
+ tags=(
114
+ TagRule(name="module", match="features/*"),
115
+ TagRule(name="api", match="features/*/api"),
116
+ TagRule(name="domain", match="features/*/domain"),
117
+ ),
118
+ flow=FlowRules(
119
+ module_tag="module",
120
+ layers=("domain", "api"),
121
+ ),
122
+ )
123
+ ```
124
+
125
+ Shape limits are disabled with `-1` and enabled with non-negative integers.
126
+
127
+ ```python
128
+ from modwire.architecture import ShapeConfig
129
+
130
+ shape = ShapeConfig(
131
+ max_classes_per_file=3,
132
+ max_function_lines=40,
133
+ require_joined_imports=True,
134
+ )
135
+ ```
136
+
137
+ ## Migration
138
+
139
+ The current API is intentionally OOP-first. Older helper functions such as
140
+ `evaluate_shape`, `render_callable_report`, `structured_callable_report`,
141
+ `find_unused_exports`, `map_code`, `find_hotspots`, and
142
+ `coherence_summary` have been replaced by `ArchitectureReportRunner`.
143
+
144
+ See [CHANGELOG.md](CHANGELOG.md) before publishing or upgrading across the next
145
+ major release.
146
+
147
+ ## Development
148
+
149
+ See [Development checks](docs/wiki/Development-checks.md) for the local command
150
+ set used before pull requests and releases.
151
+
152
+ ## Contributing
153
+
154
+ Feature requests and bug reports are tracked through GitHub Issues:
155
+
156
+ - Open a feature request for architecture analyzers, output formats, or
157
+ integrations.
158
+ - Open a bug report for incorrect architecture violations, graph output, shape
159
+ reports, callable reports, unused export reports, packaging problems, or
160
+ documentation mismatches.
161
+
162
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the information to include and the
163
+ 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: