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
| Name | Type | Description |
|---|---|---|
| $matcher | CapabilityMatcher | The single identity criterion, shared with the resolver and the pre-boot check. |
CapabilityGraphValidator::validate()
public function validate(array $manifestFiles): Milpa\DevTools\Validators\CapabilityGraphResultValidates the capability graph across every manifest in `$manifestFiles`.
Parameters
| Name | Type | Description |
|---|---|---|
| $manifestFiles | list<string> |