Skip to content
docsv0.24.0

CapabilityGraphValidator

Validates the capability graph across a set of plugin manifests: every hard `requires` must be satisfied by some plugin's `provides`, and the plugin dependency graph must be acyclic. Unprovided `suggests` are reported as a degradation path, never a failure. Reads both capability formats: the typed `capabilities.*` records and the legacy bare-FQCN `contracts.*` arrays. Matching is NOT decided here — it comes from {@see CapabilityMatcher}, the single criterion the resolver and the pre-boot check also consume. This class used to match by interface FQCN alone, which made it strictly weaker than the engine: it ignored a record identified only by `id`, and it ignored `oneOf`, so it reported violations the engine never had (`settlement-q-p17.md`). Ported 1:1 from `scripts/library/validate-capability-graph.php` (B5 / T014) — this class takes the already-resolved list of manifest file paths (the caller globs; kept filesystem-glob-decoupled so it is trivially testable against a synthetic fixture set).

CapabilityGraphValidator::__construct()

public function __construct(Milpa\Services\CapabilityMatcher $matcher = new CapabilityMatcher()):

Parameters

Parameters of __construct()
NameTypeDescription
$matcherCapabilityMatcherThe single identity criterion, shared with the resolver and the pre-boot check.

CapabilityGraphValidator::validate()

public function validate(array $manifestFiles): Milpa\DevTools\Validators\CapabilityGraphResult

Validates the capability graph across every manifest in `$manifestFiles`.

Parameters

Parameters of validate()
NameTypeDescription
$manifestFileslist<string>