Metadata-Version: 2.4
Name: sempa
Version: 0.1.0
Summary: Semantic Pattern Address — reference implementation of the MORPH semantic canonicalization standard
Author-email: Anton Kupreev <antonio@vrlg.tech>
License: Apache-2.0
Project-URL: Homepage, https://vrlg.tech
Project-URL: Repository, https://github.com/kupreano/sempa
Project-URL: Documentation, https://app.vrlg.tech/morph-demo
Keywords: semantic,pattern,address,canonicalization,deduplication,code-analysis,morph,sempa
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# SEMPA — Semantic Pattern Address

**SEMPA** is the reference implementation of the **MORPH** semantic canonicalization standard.

> MORPH is the standard. SEMPA is the implementation.

## What is MORPH?

MORPH (Multidimensional Executable Patterns) is a semantic canonicalization standard that computes a language-independent **PatternAddress** for any function or program — based on its semantic structure, not its syntax.

Two functions that do the same thing, written differently or in different languages, get the same PatternAddress.

```
Python function
    ↓
SEMPA extractor
    ↓
PatternAddress: 0xa727d60b670188b9...
    ↓
Veralog attestation (Ed25519 signed, publicly verifiable)
```

## Key Concepts

- **PatternAddress** — SHA3-256 of the canonical semantic representation. Language-independent.
- **SourceHash** — SHA-256 of the exact source text. Language-specific.
- **PatternFamily** — semantic category: Decision, PureFunction, StateMachine, Loop, etc.

## Status

Currently in early development (Alpha). Full SDK coming in 0.2.0.

Live demo: [app.vrlg.tech/morph-demo](https://app.vrlg.tech/morph-demo)

## Quick Start

```bash
pip install sempa
```

```python
import sempa
print(sempa.version())  # 0.1.0
```

Full API (coming in 0.2.0):

```python
from sempa import analyze, attest

result = analyze("""
def approve_loan(credit_score: int, amount: float):
    if credit_score >= 700 and amount > 0:
        return "Approved"
    return "Rejected"
""")

print(result.pattern_address)   # 0x40f5d23e...
print(result.pattern_family)    # Decision
print(result.source_hash)       # 0x65593b32...

# Attest to Veralog (cryptographic proof)
proof = attest(result, api_key="vrlg_...")
print(proof.verify_url)         # https://vrlg.tech/verify/.../page
```

## Architecture

```
MORPH Standard
    └── SEMPA SDK (this package)
            ├── sempa.analyze()     — compute PatternAddress
            ├── sempa.attest()      — sign via Veralog
            ├── sempa.verify()      — verify a PatternAddress
            └── sempa.store         — semantic deduplication store
```

## Links

- Standard: [MORPH](https://vrlg.tech)
- Attestation: [Veralog](https://vrlg.tech)
- Demo: [app.vrlg.tech/morph-demo](https://app.vrlg.tech/morph-demo)
- Issues: [github.com/kupreano/sempa](https://github.com/kupreano/sempa/issues)

## License

Apache 2.0
