value, ProviderReasonCodes::ProviderConsentMissing, TenantOperabilityReasonCode::RememberedContextStale->value, RbacReason::ManualAssignmentRequired->value, ]; foreach ($reasonCodes as $reasonCode) { $envelope = $translator->translate($reasonCode); expect($envelope)->not->toBeNull() ->and($envelope?->operatorLabel)->not->toBe($reasonCode) ->and($envelope?->operatorLabel)->not->toContain('_'); } }); it('uses the canonical operator vocabulary for adopted reason families', function (): void { expect(ExecutionDenialReasonCode::MissingCapability->toReasonResolutionEnvelope()->operatorLabel)->toBe('Permission required') ->and(app(ReasonTranslator::class)->translate(ProviderReasonCodes::ProviderPermissionDenied)?->operatorLabel)->toBe('Permission denied') ->and(TenantOperabilityReasonCode::TenantAlreadyArchived->toReasonResolutionEnvelope()->guidanceText())->toBe('No action needed.') ->and(RbacReason::ManualAssignmentRequired->toReasonResolutionEnvelope()->operatorLabel)->toBe('Manual role assignment required'); }); it('keeps primary-surface reason ownership inside the allowed three-way boundary classification', function (): void { $translator = app(ReasonTranslator::class); $classifications = collect([ $translator->boundaryClassification(ExecutionDenialReasonCode::MissingCapability->value, ReasonTranslator::EXECUTION_DENIAL_ARTIFACT), $translator->boundaryClassification(ProviderReasonCodes::ProviderConsentMissing), $translator->boundaryClassification(TenantOperabilityReasonCode::RememberedContextStale->value, ReasonTranslator::TENANT_OPERABILITY_ARTIFACT), $translator->boundaryClassification(RbacReason::ManualAssignmentRequired->value, ReasonTranslator::RBAC_ARTIFACT), $translator->boundaryClassification(BaselineCompareReasonCode::CoverageUnproven->value, ReasonTranslator::GOVERNANCE_ARTIFACT_TRUTH_ARTIFACT), ]) ->filter() ->unique() ->values() ->all(); expect($classifications)->toEqualCanonicalizing([ PlatformVocabularyGlossary::BOUNDARY_PLATFORM_CORE, PlatformVocabularyGlossary::BOUNDARY_CROSS_DOMAIN_GOVERNANCE, PlatformVocabularyGlossary::BOUNDARY_INTUNE_SPECIFIC, ]); });