PHPackages                             milpa/core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. milpa/core

ActiveLibrary[Framework](/categories/framework)

milpa/core
==========

Milpa Framework — core contracts and primitives. Framework-agnostic: no ORM, no HTTP client, no host-application coupling (ADR-001).

v0.4.0(today)0278↑1680.6%Apache-2.0PHP &gt;=8.3

Since Jul 5Compare

[ Source](https://github.com/getmilpa/core)[ Packagist](https://packagist.org/packages/milpa/core)[ RSS](/packages/milpa-core/feed)WikiDiscussions Synced today

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

 [   ![Milpa](https://raw.githubusercontent.com/getmilpa/core/main/art/lockup/milpa-lockup-v-color-light.svg)  ](https://github.com/getmilpa)

Milpa Core
==========

[](#milpa-core)

> The framework-agnostic **contracts core** of Milpa — a modular PHP runtime for applications operable by **both humans and agents**. Not another web framework: the primitives that let modules declare capabilities, expose tools, and gate actions behind verification.

[![CI](https://github.com/getmilpa/core/actions/workflows/ci.yml/badge.svg)](https://github.com/getmilpa/core/actions/workflows/ci.yml)[![Packagist](https://camo.githubusercontent.com/8e3bb567e4793fc1b42dccfe94f35e3773d5ad8aabac30307e8888b452d8a550/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c70612f636f72652e737667)](https://packagist.org/packages/milpa/core)[![PHP](https://camo.githubusercontent.com/ca03f11ea27dac4dedc8ad56a7bdfc4a9ff5feb825055f9d2983616115076607/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135253230382e332d3737376262342e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/798509b4df525f56802b56f8096862487f08023e3d7561c68656f8dab10d0d6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368652d2d322e302d626c75652e737667)](LICENSE)[![Docs](https://camo.githubusercontent.com/c6dc6a3411e15b0ac7cc4583e8e6a8144181caedb82f5d98753353decda06d77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d4150492532307265666572656e63652d626c75652e737667)](https://getmilpa.github.io/core/)

`milpa/core` is the dependency-light heart of the framework: the attributes, events, value objects, enums, interfaces, and the verification seam that every Milpa module builds on. **No Doctrine, no HTTP client, no framework kernel** — just the contracts and primitives, so you can depend on them from anywhere.

Install
-------

[](#install)

```
composer require milpa/core
```

Why Milpa
---------

[](#why-milpa)

Most PHP frameworks are built for one kind of caller: a human writing code, or a browser sending requests. Milpa is built for **two** — humans *and* agents operating the same application through the same declared surface.

Modules don't just register routes and services. They declare the **capabilities** they provide and require, expose **tools** an agent can invoke, and gate mutating actions behind **verification** — deterministic checks, human/agent approvals, or async results. The contract loop that runs through the whole system:

```
plugin → capability → tool → verification → event → result

```

Three seams in this package make that loop possible:

- **Capability system** — a plugin manifest declares what it *provides*, *requires*, and *suggests*, so the runtime can wire modules together and reason about what's installed.
- **Agent tool-readiness** — `ToolProviderInterface` / `ToolRegistryInterface` let a module publish declarative tools that both humans and agents can discover and call.
- **Verification seam** — `VerifierInterface` gates a mutating action behind a deterministic evaluation, a human/agent approval, or a pending async result that resolves through an event.

**Be honest about scope:** this package ships the **contracts and primitives only**. It does not run an HTTP server or boot an application by itself. The web tier lives in the sibling **`milpa/http`** package, and the runtime/CLI is **`coa`**. Depend on `milpa/core`when you want to build against those seams without pulling in a framework.

Quick example
-------------

[](#quick-example)

Value objects are immutable and self-validating. For instance, `SemanticVersion`:

```
use Milpa\ValueObjects\SemanticVersion;

$v = SemanticVersion::parse('2.4.1');

$v->satisfies('^2.0');                              // true
$v->greaterThan(SemanticVersion::parse('2.4.0'));   // true
$v->incrementMinor();                              // 2.5.0 (a new instance)
$v->isStable();                                    // true — no pre-release tag
```

What's inside
-------------

[](#whats-inside)

NamespaceWhat it provides`Milpa\Attributes`Declarative attributes (`RegisterService`, `BusinessRule`, `Subscribe`, …)`Milpa\Interfaces`Core contracts, grouped by seam: `Di`, `Plugin`, `Event`, `Config`, `Observability`, `Tooling`, `Verification``Milpa\ValueObjects`Immutable, validated values (`SemanticVersion`, capability &amp; verification VOs, …)`Milpa\Enums`Shared enums (`ApprovalPolicy`, `VerificationStatus`, `DispatcherType`, …)`Milpa\Events`Framework event contracts + dispatch primitives`Milpa\DTO`Data-transfer objects passed across seam boundaries`Milpa\Exceptions`Typed exception hierarchy for the contracts`Milpa\Services`Framework-agnostic service contracts and helpers`Milpa\Support`Small framework-agnostic utilitiesEvery public symbol carries a DocBlock — the API reference is generated straight from them.

Requirements
------------

[](#requirements)

- PHP **≥ 8.3**

Documentation
-------------

[](#documentation)

**Full API reference: [getmilpa.github.io/core](https://getmilpa.github.io/core/)** — generated straight from the source DocBlocks and dressed with the Milpa design system.

Contributing
------------

[](#contributing)

Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Please report security issues via [SECURITY.md](SECURITY.md), and note that this project follows a [Code of Conduct](CODE_OF_CONDUCT.md).

License
-------

[](#license)

[Apache-2.0](LICENSE) © TeamX Agency.

---

Milpa is designed, built, and maintained by **[TeamX Agency](https://teamx.agency/?utm_source=github&utm_medium=readme&utm_campaign=milpa&utm_content=core)**.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance100

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1993784?v=4)[rodrigomx](/maintainers/rodrigomx)[@rodrigomx](https://github.com/rodrigomx)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/milpa-core/health.svg)

```
[![Health](https://phpackages.com/badges/milpa-core/health.svg)](https://phpackages.com/packages/milpa-core)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.2k](/packages/laravel-framework)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M422](/packages/drupal-core-recommended)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M204](/packages/sulu-sulu)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
