PHPackages                             coretsia/core-contracts - 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. coretsia/core-contracts

ActiveLibrary[Framework](/categories/framework)

coretsia/core-contracts
=======================

Coretsia Contracts package (public interfaces, SPIs, cross-package abstractions)

v0.4.0(2w ago)031Apache-2.0PHPPHP ^8.4

Since May 4Pushed 1w agoCompare

[ Source](https://github.com/coretsia/core-contracts)[ Packagist](https://packagist.org/packages/coretsia/core-contracts)[ RSS](/packages/coretsia-core-contracts/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (4)Used By (1)

coretsia/core-contracts
=======================

[](#coretsiacore-contracts)

`core/contracts` is the **contracts-only** package for the Coretsia Framework monorepo.

**Scope:** public interfaces, ports, enums, small value objects, and contract-level shapes that define cross-package boundaries.

**Out of scope:** runtime implementations, DI wiring, filesystem scanning, platform adapters, integrations, generated artifacts, and tooling-only behavior.

Package identity
----------------

[](#package-identity)

- **Monorepo source path:** `framework/packages/core/contracts`
- **Split repository:** `coretsia/core-contracts`
- **Package id:** `core/contracts`
- **Composer name:** `coretsia/core-contracts`
- **Namespace:** `Coretsia\Contracts\*` (PSR-4: `src/`)
- **Kind:** library

Versioning is monorepo-wide.

The monorepo tag `vMAJOR.MINOR.PATCH` is the single version source of truth, and the split repository receives the same tag for the corresponding package subtree.

Per-package independent versions MUST NOT be used.

Dependency policy
-----------------

[](#dependency-policy)

This package is **boundary-only** and MUST stay lightweight.

- **Depends on:** PHP only
- **Forbidden:**
    - `platform/*`
    - `integrations/*`
    - `devtools/*`

Contracts MUST NOT introduce concrete runtime dependencies or vendor-specific implementation types that would leak implementation details across package boundaries.

Contracts MUST remain:

- stable;
- minimal;
- format-neutral;
- deterministic where they expose exported shapes;
- safe to depend on from runtime packages.

Contract areas
--------------

[](#contract-areas)

This package contains contracts for cross-package capabilities such as:

- CLI command/input/output boundaries;
- module identity, descriptors, manifests, and mode preset access;
- config, env, source tracking, and validation result shapes;
- runtime reset and unit-of-work hooks;
- observability, health, profiling, and error descriptor boundaries;
- routing and HTTP application ports;
- validation ports;
- filesystem ports;
- database and migrations ports;
- rate limit ports;
- mail ports;
- secrets ports.

Implementations live outside `core/contracts`.

CLI ports
---------

[](#cli-ports)

CLI contracts prevent package-local cross-package interfaces and keep CLI behavior implementation-owned.

### `Cli\Input\InputInterface`

[](#cliinputinputinterface)

- Exposes raw input tokens only.
- MUST NOT freeze parsing semantics.
- Flags, options, argv rules, and command-line policy are owned by CLI implementations.

### `Cli\Output\OutputInterface`

[](#clioutputoutputinterface)

Output adapters MUST enforce:

- deterministic output behavior;
- redaction safety;
- no secrets or PII leakage.

The interface intentionally does not define styling, verbosity, formatting, or terminal capability policy.

### `Cli\Command\CommandInterface`

[](#clicommandcommandinterface)

- Provides a stable command identifier via `name(): string`.
- Executes via `run(InputInterface $input, OutputInterface $output): int`.
- Returns a standard process exit code.

Runtime contracts
-----------------

[](#runtime-contracts)

Runtime contracts are format-neutral and transport-neutral.

Examples include:

- `Coretsia\Contracts\Runtime\ResetInterface`
- `Coretsia\Contracts\Runtime\Hook\BeforeUowHookInterface`
- `Coretsia\Contracts\Runtime\Hook\AfterUowHookInterface`

The contracts package does not own DI tags, reset discovery, hook discovery, lifecycle execution, config defaults, config rules, or provider wiring.

Runtime discovery and execution are owned by runtime implementation packages.

Config and env contracts
------------------------

[](#config-and-env-contracts)

Config and env contracts define stable ports and safe shapes for:

- merged config access;
- env-derived values;
- config source tracking;
- config validation results;
- config validation violations;
- declarative ruleset boundaries.

The contracts package does not implement config loading, config merging, env loading, ruleset discovery, validation execution, or generated config artifacts.

Package `config/rules.php` files are implementation-owned by their package owners and MUST remain declarative data.

Observability and errors contracts
----------------------------------

[](#observability-and-errors-contracts)

Observability and error contracts define boundaries and safe shapes only.

They MUST NOT require concrete logger, tracer, metrics, HTTP, database, queue, or vendor-specific clients.

Diagnostic shapes MUST NOT expose:

- raw payloads;
- secrets;
- credentials;
- tokens;
- cookies;
- authorization headers;
- private customer data;
- absolute local paths;
- host-specific bytes.

Notes for implementers
----------------------

[](#notes-for-implementers)

Implementations belong in owner packages such as:

- `core/foundation`
- `core/kernel`
- `platform/cli`
- `platform/http`
- future platform or integration packages

Implementation packages MAY depend on `core/contracts`.

`core/contracts` MUST NOT depend back on implementation packages.

Observability
-------------

[](#observability)

This package does not emit telemetry directly.

It defines observability-related contract boundaries and safe shapes only.

Errors
------

[](#errors)

This package does not define runtime error mapping behavior directly.

Error mapping, exception normalization, and transport-specific error responses are owned by higher layers.

Security / Redaction
--------------------

[](#security--redaction)

This package does not process sensitive runtime payloads directly.

Contracts that expose diagnostic or exported shapes MUST be safe by construction and MUST NOT require storing raw secrets, raw env values, raw request data, raw response data, credentials, tokens, cookies, authorization headers, private customer data, or absolute local paths.

References
----------

[](#references)

- [Coretsia monorepo](https://github.com/coretsia/monorepo)
- [Contracts package source](https://github.com/coretsia/monorepo/tree/main/framework/packages/core/contracts)
- [Packaging strategy](https://github.com/coretsia/monorepo/blob/main/docs/architecture/PACKAGING.md)
- [Roadmap](https://github.com/coretsia/monorepo/blob/main/docs/roadmap/ROADMAP.md)
- [Modules and manifests SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/modules-and-manifests.md)
- [Config and env SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/config-and-env.md)
- [UoW and Reset Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/uow-and-reset-contracts.md)
- [Observability and Errors SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/observability-and-errors.md)
- [Routing and HttpApp Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/routing-and-http-app-contracts.md)
- [Validation Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/validation-contracts.md)
- [Filesystem Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/filesystem-contracts.md)
- [Database Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/database-contracts.md)
- [Rate Limit Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/rate-limit-contracts.md)
- [Mail Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/mail-contracts.md)
- [Secrets Contracts SSoT](https://github.com/coretsia/monorepo/blob/main/docs/ssot/secrets-contracts.md)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance97

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~8 days

Total

3

Last Release

20d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0e13fe6d7470c325fd7c93433427cb996558c8cc18ae1195e31810a9bb65564?d=identicon)[velhbxtyrj](/maintainers/velhbxtyrj)

---

Top Contributors

[![velhbxtyrj](https://avatars.githubusercontent.com/u/21306412?v=4)](https://github.com/velhbxtyrj "velhbxtyrj (23 commits)")

---

Tags

abstractionscomposer-packagecontractscoretsiadddframeworkinterfacesphpphp84portsspipsrphpapiframeworkinterfacescontractsabstractionsdddmodularspicoretsia

### Embed Badge

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

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

###  Alternatives

[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

934.2k3](/packages/digitalstars-simplevk)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)

PHPackages © 2026

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