## 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
67 lines
2.4 KiB
PHP
67 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Baselines;
|
|
|
|
use App\Support\Ui\OperatorExplanation\ExplanationFamily;
|
|
use App\Support\Ui\OperatorExplanation\TrustworthinessLevel;
|
|
|
|
enum BaselineCompareReasonCode: string
|
|
{
|
|
case NoSubjectsInScope = 'no_subjects_in_scope';
|
|
case CoverageUnproven = 'coverage_unproven';
|
|
case EvidenceCaptureIncomplete = 'evidence_capture_incomplete';
|
|
case RolloutDisabled = 'rollout_disabled';
|
|
case NoDriftDetected = 'no_drift_detected';
|
|
|
|
public function message(): string
|
|
{
|
|
return match ($this) {
|
|
self::NoSubjectsInScope => 'No subjects were in scope for this comparison.',
|
|
self::CoverageUnproven => 'Coverage proof was missing or incomplete, so some findings were suppressed for safety.',
|
|
self::EvidenceCaptureIncomplete => 'Evidence capture was incomplete, so some drift evaluation may have been suppressed.',
|
|
self::RolloutDisabled => 'Full-content baseline compare is currently disabled by rollout configuration.',
|
|
self::NoDriftDetected => 'No drift was detected for in-scope subjects.',
|
|
};
|
|
}
|
|
|
|
public function explanationFamily(): ExplanationFamily
|
|
{
|
|
return match ($this) {
|
|
self::NoDriftDetected => ExplanationFamily::NoIssuesDetected,
|
|
self::CoverageUnproven,
|
|
self::EvidenceCaptureIncomplete,
|
|
self::RolloutDisabled => ExplanationFamily::CompletedButLimited,
|
|
self::NoSubjectsInScope => ExplanationFamily::MissingInput,
|
|
};
|
|
}
|
|
|
|
public function trustworthinessLevel(): TrustworthinessLevel
|
|
{
|
|
return match ($this) {
|
|
self::NoDriftDetected => TrustworthinessLevel::Trustworthy,
|
|
self::CoverageUnproven,
|
|
self::EvidenceCaptureIncomplete => TrustworthinessLevel::LimitedConfidence,
|
|
self::RolloutDisabled,
|
|
self::NoSubjectsInScope => TrustworthinessLevel::Unusable,
|
|
};
|
|
}
|
|
|
|
public function absencePattern(): ?string
|
|
{
|
|
return match ($this) {
|
|
self::NoDriftDetected => 'true_no_result',
|
|
self::CoverageUnproven,
|
|
self::EvidenceCaptureIncomplete => 'suppressed_output',
|
|
self::RolloutDisabled => 'blocked_prerequisite',
|
|
self::NoSubjectsInScope => 'missing_input',
|
|
};
|
|
}
|
|
|
|
public function supportsPositiveClaim(): bool
|
|
{
|
|
return $this === self::NoDriftDetected;
|
|
}
|
|
}
|