## Summary - add a shared baseline compare summary assessment and assessor for compact trust propagation - harden dashboard, landing, and banner baseline compare surfaces against false all-clear claims - add focused Pest coverage for dashboard, landing, banner, reason translation, and canonical detail parity ## Validation - vendor/bin/sail bin pint --dirty --format agent - vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareSummaryAssessmentTest.php tests/Feature/Baselines/BaselineCompareExplanationFallbackTest.php tests/Feature/Filament/BaselineCompareNowWidgetTest.php tests/Feature/Filament/NeedsAttentionWidgetTest.php tests/Feature/Filament/BaselineCompareExplanationSurfaceTest.php tests/Feature/Filament/BaselineCompareLandingWhyNoFindingsTest.php tests/Feature/Filament/BaselineCompareCoverageBannerTest.php tests/Feature/Filament/BaselineCompareSummaryConsistencyTest.php tests/Feature/Filament/OperationRunBaselineTruthSurfaceTest.php tests/Feature/ReasonTranslation/ReasonTranslationExplanationTest.php ## Notes - Livewire compliance: Filament v5 / Livewire v4 stack unchanged - Provider registration: unchanged, Laravel 12 providers remain in bootstrap/providers.php - Global search: no searchable resource behavior changed - Destructive actions: none introduced by this change - Assets: no new assets registered; existing deploy process remains unchanged Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #196
43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Support\Baselines\BaselineCompareReasonCode;
|
|
use App\Support\Baselines\BaselineReasonCodes;
|
|
use App\Support\ReasonTranslation\ReasonPresenter;
|
|
use App\Support\Ui\OperatorExplanation\TrustworthinessLevel;
|
|
|
|
it('exposes trust-impact and absence-pattern semantics for governance reasons', function (
|
|
string $reasonCode,
|
|
string $expectedTrustImpact,
|
|
?string $expectedAbsencePattern,
|
|
): void {
|
|
$envelope = app(ReasonPresenter::class)->forArtifactTruth($reasonCode, 'artifact_truth');
|
|
|
|
expect($envelope)->not->toBeNull()
|
|
->and($envelope?->trustImpact)->toBe($expectedTrustImpact)
|
|
->and($envelope?->absencePattern)->toBe($expectedAbsencePattern)
|
|
->and(app(ReasonPresenter::class)->dominantCauseExplanation($envelope))->not->toBe('');
|
|
})->with([
|
|
'trustworthy no-drift compare result' => [
|
|
BaselineCompareReasonCode::NoDriftDetected->value,
|
|
TrustworthinessLevel::Trustworthy->value,
|
|
'true_no_result',
|
|
],
|
|
'suppressed compare result' => [
|
|
BaselineCompareReasonCode::CoverageUnproven->value,
|
|
TrustworthinessLevel::LimitedConfidence->value,
|
|
'suppressed_output',
|
|
],
|
|
'missing baseline input' => [
|
|
BaselineReasonCodes::SNAPSHOT_CAPTURE_FAILED,
|
|
TrustworthinessLevel::LimitedConfidence->value,
|
|
'unavailable',
|
|
],
|
|
'fallback review blocker' => [
|
|
'review_missing_sections',
|
|
TrustworthinessLevel::Unusable->value,
|
|
'missing_input',
|
|
],
|
|
]);
|