feat: DiviFeatureGate ersetzt DiviToolGate – Ablehnung je Fähigkeit für Lese- und Schreib-Tools, Details nach D6, kein Hinweis mehr in warnings; DiviContentComposer::refusal prüft seine Fähigkeiten
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
fdbda8012c
commit
74cf0c54a8
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Support;
|
||||
|
||||
use LIT\MCP\Integrations\Divi\Release\CompatibilityMatrix;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
|
||||
use LIT\MCP\Integrations\Divi\Release\FeatureStatus;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseGate;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseState;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseStatus;
|
||||
|
||||
/** A release status in which single Divi capabilities are locked – for guard and tool tests. */
|
||||
final class DiviFeatureFixtures
|
||||
{
|
||||
/**
|
||||
* Makes ReleaseGate answer with $states; every capability not named is released. TestCase resets the gate.
|
||||
*
|
||||
* @param array<string, ReleaseState> $states DiviFeature value => state
|
||||
*/
|
||||
public static function useStates(array $states, string $version = '5.3.0'): void
|
||||
{
|
||||
$features = [];
|
||||
$overall = ReleaseState::Released;
|
||||
foreach (DiviFeature::cases() as $feature) {
|
||||
$state = $states[$feature->value] ?? ReleaseState::Released;
|
||||
$features[$feature->value] = new FeatureStatus(
|
||||
$feature,
|
||||
$state,
|
||||
$state === ReleaseState::Released ? [] : ['Abweichung bei ' . $feature->label()],
|
||||
null
|
||||
);
|
||||
if ($state === ReleaseState::Incompatible || ($state === ReleaseState::Untested
|
||||
&& $overall === ReleaseState::Released)) {
|
||||
$overall = $state;
|
||||
}
|
||||
}
|
||||
|
||||
$status = new ReleaseStatus($overall, $version, null, [], null, matrix: new CompatibilityMatrix($features));
|
||||
ReleaseGate::useResolver(static fn (): ReleaseStatus => $status);
|
||||
}
|
||||
|
||||
public static function lock(DiviFeature $feature, ReleaseState $state = ReleaseState::Untested): void
|
||||
{
|
||||
self::useStates([$feature->value => $state]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user