Metadata-Version: 2.4
Name: morphism
Version: 0.1.0
Summary: Categorical governance engine — morphisms, functors, natural transformations
Project-URL: Homepage, https://morphism.systems
Project-URL: Repository, https://github.com/morphism-systems/morphism-systems
Project-URL: Documentation, https://morphism.systems/docs
Author: Morphism Systems
License-Expression: BUSL-1.1
License-File: LICENSE
Keywords: ai-governance,category-theory,convergence,drift-detection,functor,governance-framework,morphism
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: click>=8.1
Requires-Dist: pydantic>=2.0
Requires-Dist: rich>=13.0
Provides-Extra: dev
Requires-Dist: asv>=0.6; extra == 'dev'
Requires-Dist: mkdocs-material>=9.0; extra == 'dev'
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: pymdown-extensions>=10.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Requires-Dist: virtualenv>=20.0; extra == 'dev'
Description-Content-Type: text/markdown

# Morphism

[![CI](https://github.com/morphism-systems/morphism/actions/workflows/ci.yml/badge.svg)](https://github.com/morphism-systems/morphism/actions/workflows/ci.yml)
[![Governance Score](https://img.shields.io/badge/governance-98%2F105-brightgreen)](https://morphism.systems)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**Self-healing intelligence layer for AI agent fleets.** Mathematical governance with category-theoretic foundations, drift detection, and autonomous correction.

> Entropy is the default. Governance is the override.

## Why Morphism

- **Mathematical guarantees** — 7 kernel invariants and 10 operational tenets, grounded in category theory
- **Self-healing** — Automatic drift detection and context re-normalization without human intervention
- **Compound learning** — Every agent interaction improves the fleet through proof state logging
- **Installable** — MCP servers, CLI, and npm packages for integration into existing workflows

## Quick Start

### TypeScript (Next.js app + packages)

```bash
npm install
npx turbo dev        # Start development
npx turbo build      # Build all packages
npx turbo test       # Run tests
```

### Python (Governance engine + CLI)

```bash
pip install -e ".[dev]"
morphism --help      # CLI usage
pytest tests/        # Run tests
```

### MCP Server (Claude, Cursor, etc.)

```json
{
  "mcpServers": {
    "morphism-math": {
      "command": "npx",
      "args": ["@morphism-systems/agentic-math"]
    }
  }
}
```

## Architecture

```mermaid
graph TD
    A[morphism.systems] --> B[apps/morphism — Next.js 15]
    A --> C[packages/shared — @morphism-systems/shared]
    A --> D[packages/agentic-math — MCP Server]
    A --> E[packages/cli — CLI]
    A --> F[src/morphism — Python Core]
    F --> G[engine/ — Category Theory]
    F --> H[metrics/ — κ, δ]
    F --> I[cli/ — Governance CLI]
```

| Layer | Stack | Purpose |
|-------|-------|---------|
| **Web** | Next.js 15, Turborepo | SaaS dashboard |
| **Shared** | TypeScript, Zod | Types, schemas, utilities |
| **MCP** | TypeScript, MCP SDK | AI tool integration |
| **Python** | Click, Category Theory | Governance engine, metrics |
| **Scripts** | Python | CI validation, maturity scoring |

## Governance

The governance framework is the core of Morphism. See [AGENTS.md](AGENTS.md) for the full specification.

| Document | Purpose |
|----------|---------|
| [AGENTS.md](AGENTS.md) | Root governance rules |
| [SSOT.md](SSOT.md) | Single source of truth |
| [Kernel](docs/governance/morphism-kernel.md) | 7 invariants (I-1..I-7) |
| [Docs Index](docs/index.md) | Full documentation map |

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, architecture overview, and contribution guidelines.

## License

[MIT](LICENSE)
