feat: enable explicitly authorized human-reviewed clinical adoption

This commit is contained in:
2026-10-10 11:42:08 +08:00
parent 228d93ac3b
commit 91aa1cb595
11 changed files with 80 additions and 9 deletions
@@ -42,6 +42,23 @@ final class FollowupAudioGate
if (!self::scopeAllowed($diagnosisId, $actor, $settings)) { throw new DomainException('FOLLOWUP_AUDIO_PREVIEW_SCOPE_DENIED'); }
}
/** Explicit human-adoption operation is separate from model accuracy certification. */
public static function manualReviewEnabled(?array $settings = null): bool
{
return (($settings ?? (array) config('followup_audio', []))['manual_review_enabled'] ?? false) === true;
}
public static function manualReviewReady(?string $profile = null, ?array $settings = null, ?array $legacy = null): bool
{
$settings = $settings ?? (array) config('followup_audio', []); $legacy = $legacy ?? (array) config('prescription_ai', []);
if (self::previewOnly($settings) || !self::manualReviewEnabled($settings)) { return false; }
if ($profile === null) {
foreach (['qwen', 'openai'] as $slot) { if (self::manualReviewReady($slot, $settings, $legacy)) { return true; } }
return false;
}
return FollowupAudioProviderConfig::previewVerified($profile, $settings, $legacy);
}
public static function ready(?string $profile = null, ?array $settings = null, ?array $legacy = null): bool
{
$settings = $settings ?? (array) config('followup_audio', []); $legacy = $legacy ?? (array) config('prescription_ai', []);
@@ -50,7 +67,7 @@ final class FollowupAudioGate
return false;
}
return self::previewOnly($settings) ? FollowupAudioProviderConfig::previewVerified($profile, $settings, $legacy)
: FollowupAudioProviderConfig::verified($profile, $settings, $legacy);
: FollowupAudioProviderConfig::verified($profile, $settings, $legacy) || self::manualReviewReady($profile, $settings, $legacy);
}
/** Persisted preview-origin tasks never become eligible for adoption after a configuration change. */