Skip to content
docsv0.2.0

VersionManifest

Describes one installed piece — a package or plugin — as the resolver sees it: its `package` name and `version`, the architectural `contracts` it implements/requires, the `capabilities` it provides/requires/suggests, the `surfaces` it supports, the things it has marked `deprecations`, and free-form `metadata` (the ingestion layer stamps `metadata`, e.g. `shape = legacy-contracts`). A pure value object: {@see fromArray()} validates, {@see toArray()} serializes deterministically. `adapters` and `profiles` are deliberately NOT modelled in slice 1: the resolver does not yet resolve adapter or profile requirements, and a declared field the engine never reads is decorative metadata (spec §25 anti-pattern 5). They return as typed fields when the resolver actually consumes them (adapter resolution / env profiles — ROADMAP P10, "second consumer").

VersionManifest::__construct()

public function __construct(string $package, string $version, array $contracts, array $capabilities, array $surfaces = [], array $deprecations = [], array $metadata = []):

Parameters

Parameters of __construct()
NameTypeDescription
$packagestring
$versionstring
$contractsarray<string, mixed>
$capabilitiesarray<string, mixed>
$surfacesarray<string, mixed>
$deprecationsarray<string, mixed>
$metadataarray<string, mixed>

VersionManifest::fromArray()

public static function fromArray(array $data): self

Build a manifest from a decoded array, validating `package` (non-empty), `version` (semver), and the presence of the `contracts` and `capabilities` maps.

Parameters

Parameters of fromArray()
NameTypeDescription
$dataarray<string, mixed>

Throws

InvalidManifestException On a missing/empty required field or an invalid version.

VersionManifest::toArray()

public function toArray(): array

Serialize to an array with a fixed, deterministic key order.