Metadata-Version: 2.4
Name: modwire
Version: 5.0.0
Summary: Map architecture boundaries and analyze extracted code maps.
Author: Tomasz Szpak
License-Expression: MIT
Project-URL: Homepage, https://github.com/modwire/modwire
Project-URL: Repository, https://github.com/modwire/modwire
Project-URL: Issues, https://github.com/modwire/modwire/issues
Keywords: architecture,code-analysis,dependency-graph,static-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: modwire-extraction<3,>=2.0.1
Requires-Dist: modwire-mermaid>=1.0.0
Requires-Dist: modwire-siren>=1.0.0
Requires-Dist: pydantic>=2.12
Requires-Dist: pydantic-yaml>=1.7.0
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: twine>=5.1; extra == "dev"
Dynamic: license-file

# Modwire

Modwire is the typed coordination library for the Modwire ecosystem. It composes
in-memory architecture analysis, Siren documents, and Mermaid diagrams without
embedding filesystem or command-line orchestration in the library.

```python
from modwire import ArchitectureConfig, Modwire
from modwire_extraction import QueryableCodeMap


def analyze(code_map: QueryableCodeMap):
    return Modwire().architecture(ArchitectureConfig()).report(code_map)
```

Core accepts in-memory configuration and an already extracted code map. Install
`modwire-cli` when paths, configuration directories, or generated files are
involved.

Install `modwire-cli` when you need the command line:

```bash
pip install modwire-cli
modwire --config-dir .modwire architecture health src python
```

## Package shape

- `modwire.architecture` — architecture maps, boundary policies, shape checks,
  insights, and typed reports.
- `modwire.code` — validated in-memory code-package values.
- `modwire.layers` — named layer contracts; orchestration remains to be defined.
- `modwire.modules` — named module contracts; orchestration remains to be defined.
- `modwire.projects` — project coordination contracts for modules and layers;
  orchestration remains to be defined.
- `modwire.shared.config` — immutable, validated configuration contracts.
- `modwire.shared.report` — architecture report contracts and metadata.

Scaffolding and glossary functionality are not part of this package. The
current [modwire-mcp](https://github.com/modwire/modwire-mcp) repository is a
work-in-progress local scaffolding devserver, not yet an operational ecosystem
package. The MCP package becomes workable after `modwire-cli` exposes the
filesystem, project, and execution capabilities that MCP will coordinate.

The repeatable GitHub coordination model is frozen in the
[ecosystem playbook](docs/governance/github-ecosystem.md) and its
[executable source-of-truth contract](.github/modwire-ecosystem.yml). The
contract's package registry derives repository membership and the shared
Project component taxonomy; CI validates it with strict Pydantic models. The
[Python workflow contract](docs/governance/python-workflows.md) provides the
standard reusable CI and release procedures for member packages.

## Ecosystem

Modwire coordinates three independently released building blocks:

- [modwire-extraction](https://github.com/modwire/modwire-extraction) — canonical
  code extraction. Follow its [Trustworthy Foundation](https://github.com/modwire/modwire-extraction/milestone/2),
  [Canonical Symbol Model v2](https://github.com/modwire/modwire-extraction/milestone/1),
  and [Extensible Production Platform](https://github.com/modwire/modwire-extraction/milestone/3)
  milestones.
- [modwire-siren](https://github.com/modwire/modwire-siren) — typed Siren and
  OpenAPI integration. See [Siren integration improvements](https://github.com/modwire/modwire-siren/milestone/1).
- [modwire-mermaid](https://github.com/modwire/modwire-mermaid) — typed,
  deterministic Mermaid source. See [Package improvements](https://github.com/modwire/modwire-mermaid/milestone/1).

The architecture work here tracks [Architecture Policy Core](https://github.com/modwire/modwire/milestone/1)
and [Architecture Insights and Integration Ergonomics](https://github.com/modwire/modwire/milestone/2).
Modwire 5 migration guidance is available in
[Migrating from Modwire 4 to 5](docs/migration-5.md).

## Model contracts

Public value objects derive from one of three Pydantic bases:
`ModwireModel`, `ModwireConfigModel`, or `ModwireReportModel`. They are frozen,
reject unknown fields, validate defaults, normalize surrounding string
values through domain validators, and provide dictionary, JSON, and YAML
round-trip helpers without filesystem orchestration.

## Development

```bash
uv sync --all-groups
uv run pytest
uv run ruff check src tests
uv build
```
