# CODEOWNERS
# This file defines code ownership for the Dify project.
# Each line is a file pattern followed by one or more owners.
# Owners can be @username, @org/team-name, or email addresses.
# For more information, see: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @crazywoola @laipz8200

# Lint bulk suppression baselines.
/oxlint-suppressions.json

# CODEOWNERS file
/.github/CODEOWNERS @laipz8200 @crazywoola

# Agents
/.agents/skills/ @hyoban

# Packages
/packages/ @lyzno1 @hyoban
/packages/contracts/ @crazywoola @laipz8200

# Docs
/docs/ @crazywoola

# CLI
/cli/ @GareArc
/.github/workflows/cli-tests.yml @GareArc

# Dify Agent
/dify-agent/ @BeautyyuYanli

# E2E
/e2e/ @lyzno1 @hyoban
/.github/workflows/web-e2e.yml @lyzno1 @hyoban

# Backend (default owner, more specific rules below will override)
/api/ @QuantumGhost

# Backend - Tests (inherit the production owners)
/api/tests/**/core/rag/ @JohnJyong
/api/tests/**/services/knowledge/ @JohnJyong
/api/tests/**/services/rag_pipeline/ @JohnJyong
/api/tests/**/services/test_hit_testing_service.py @JohnJyong
/api/tests/**/services/entities/knowledge_entities/ @JohnJyong
/api/tests/**/services/entities/external_knowledge_entities/ @JohnJyong
/api/tests/**/controllers/console/datasets/ @JohnJyong
/api/tests/**/controllers/service_api/dataset/ @JohnJyong
/api/tests/**/models/test_dataset.py @JohnJyong
/api/tests/**/tasks/rag_pipeline/ @JohnJyong
/api/tests/**/tasks/test_add_document_to_index_task.py @JohnJyong
/api/tests/**/tasks/test_batch_clean_document_task.py @JohnJyong
/api/tests/**/tasks/test_clean_document_task.py @JohnJyong
/api/tests/**/tasks/test_clean_notion_document_task.py @JohnJyong
/api/tests/**/tasks/test_document_indexing_task.py @JohnJyong
/api/tests/**/tasks/test_document_indexing_sync_task.py @JohnJyong
/api/tests/**/tasks/test_document_indexing_update_task.py @JohnJyong
/api/tests/**/tasks/test_duplicate_document_indexing_task.py @JohnJyong
/api/tests/**/tasks/test_recover_document_indexing_task.py @JohnJyong
/api/tests/**/tasks/test_remove_document_from_index_task.py @JohnJyong
/api/tests/**/tasks/test_retry_document_indexing_task.py @JohnJyong
/api/tests/**/tasks/test_sync_website_document_indexing_task.py @JohnJyong
/api/tests/**/tasks/test_batch_create_segment_to_index_task.py @JohnJyong
/api/tests/**/tasks/test_create_segment_to_index_task.py @JohnJyong
/api/tests/**/tasks/test_delete_segment_from_index_task.py @JohnJyong
/api/tests/**/tasks/test_disable_segment_from_index_task.py @JohnJyong
/api/tests/**/tasks/test_disable_segments_from_index_task.py @JohnJyong
/api/tests/**/tasks/test_enable_segment_to_index_task.py @JohnJyong
/api/tests/**/tasks/test_enable_segments_to_index_task.py @JohnJyong
/api/tests/**/tasks/test_clean_dataset_task.py @JohnJyong
/api/tests/**/tasks/test_deal_dataset_index_update_task.py @JohnJyong
/api/tests/**/tasks/test_deal_dataset_vector_index_task.py @JohnJyong
/api/tests/**/core/plugin/ @WH-2099
/api/tests/**/services/plugin/ @WH-2099
/api/tests/**/controllers/console/workspace/test_plugin.py @WH-2099
/api/tests/**/controllers/inner_api/plugin/ @WH-2099
/api/tests/**/tasks/test_process_tenant_plugin_autoupgrade_check_task.py @WH-2099
/api/tests/**/controllers/trigger/ @CourTeous33
/api/tests/**/controllers/console/app/test_workflow_trigger.py @CourTeous33
/api/tests/**/controllers/console/workspace/test_trigger_providers.py @CourTeous33
/api/tests/**/core/trigger/ @CourTeous33
/api/tests/**/core/app/layers/test_trigger_post_layer.py @CourTeous33
/api/tests/**/services/trigger/ @CourTeous33
/api/tests/**/models/test_trigger.py @CourTeous33
/api/tests/**/repositories/test_workflow_trigger_log_repository.py @CourTeous33
/api/tests/**/repositories/test_sqlalchemy_workflow_trigger_log_repository.py @CourTeous33
/api/tests/**/libs/test_schedule_utils.py @CourTeous33
/api/tests/**/services/workflow/test_scheduler.py @CourTeous33
/api/tests/**/schedule/test_trigger_provider_refresh_task.py @CourTeous33
/api/tests/**/schedule/test_workflow_schedule_task.py @CourTeous33
/api/tests/**/tasks/test_trigger_processing_tasks.py @CourTeous33
/api/tests/**/tasks/test_trigger_subscription_refresh_tasks.py @CourTeous33
/api/tests/**/tasks/test_workflow_schedule_tasks.py @CourTeous33
/api/tests/**/tasks/workflow_cfs_scheduler/ @CourTeous33
/api/tests/**/events/event_handlers/test_sync_plugin_trigger_when_app_created.py @CourTeous33
/api/tests/**/events/event_handlers/test_update_app_triggers_when_app_published_workflow_updated.py @CourTeous33
/api/tests/**/events/event_handlers/test_sync_workflow_schedule_when_app_published.py @CourTeous33
/api/tests/**/events/event_handlers/test_sync_webhook_when_app_created.py @CourTeous33
/api/tests/**/services/test_async_workflow_service.py @Mairuis
/api/tests/**/tasks/test_async_workflow_tasks.py @Mairuis
/api/tests/**/services/test_billing_service.py @zyssyz123
/api/tests/**/controllers/console/billing/ @zyssyz123
/api/tests/**/configs/enterprise/ @GareArc
/api/tests/**/services/enterprise/ @GareArc
/api/tests/**/services/test_feature_service.py @GareArc
/api/tests/**/controllers/console/test_feature.py @GareArc
/api/tests/**/controllers/web/test_feature.py @GareArc
/api/tests/**/migrations/ @snakevash @laipz8200 @MRZHUH
/api/tests/**/configs/middleware/vdb/* @JohnJyong

# E2E scenarios retain names spanning the corresponding production modules.
/api/tests/e2e_tests/*/services/test_dataset* @JohnJyong
/api/tests/e2e_tests/*/services/test_document* @JohnJyong
/api/tests/e2e_tests/*/services/test_metadata* @JohnJyong
/api/tests/e2e_tests/*/services/test_schedule_service.py @CourTeous33
/api/tests/e2e_tests/*/services/test_webhook* @CourTeous33
/api/tests/e2e_tests/*/services/test_trigger* @CourTeous33
/api/tests/e2e_tests/*/trigger/ @CourTeous33
/api/tests/e2e_tests/*/commands/test_legacy_model_type_migration.py @QuantumGhost

# Backend - RAG (Retrieval Augmented Generation)
/api/core/rag/ @JohnJyong
/api/services/knowledge/ @JohnJyong
/api/services/rag_pipeline/ @JohnJyong
/api/services/hit_testing_service.py @JohnJyong
/api/services/entities/knowledge_entities/ @JohnJyong
/api/services/entities/external_knowledge_entities/ @JohnJyong
/api/controllers/console/datasets/ @JohnJyong
/api/controllers/service_api/dataset/ @JohnJyong
/api/models/dataset.py @JohnJyong
/api/tasks/rag_pipeline/ @JohnJyong
/api/tasks/add_document_to_index_task.py @JohnJyong
/api/tasks/batch_clean_document_task.py @JohnJyong
/api/tasks/clean_document_task.py @JohnJyong
/api/tasks/clean_notion_document_task.py @JohnJyong
/api/tasks/document_indexing_task.py @JohnJyong
/api/tasks/document_indexing_sync_task.py @JohnJyong
/api/tasks/document_indexing_update_task.py @JohnJyong
/api/tasks/duplicate_document_indexing_task.py @JohnJyong
/api/tasks/recover_document_indexing_task.py @JohnJyong
/api/tasks/remove_document_from_index_task.py @JohnJyong
/api/tasks/retry_document_indexing_task.py @JohnJyong
/api/tasks/sync_website_document_indexing_task.py @JohnJyong
/api/tasks/batch_create_segment_to_index_task.py @JohnJyong
/api/tasks/create_segment_to_index_task.py @JohnJyong
/api/tasks/delete_segment_from_index_task.py @JohnJyong
/api/tasks/disable_segment_from_index_task.py @JohnJyong
/api/tasks/disable_segments_from_index_task.py @JohnJyong
/api/tasks/enable_segment_to_index_task.py @JohnJyong
/api/tasks/enable_segments_to_index_task.py @JohnJyong
/api/tasks/clean_dataset_task.py @JohnJyong
/api/tasks/deal_dataset_index_update_task.py @JohnJyong
/api/tasks/deal_dataset_vector_index_task.py @JohnJyong

# Backend - Plugins
/api/core/plugin/ @WH-2099
/api/services/plugin/ @WH-2099
/api/controllers/console/workspace/plugin.py @WH-2099
/api/controllers/inner_api/plugin/ @WH-2099
/api/tasks/process_tenant_plugin_autoupgrade_check_task.py @WH-2099

# Backend - Trigger/Schedule/Webhook
/api/controllers/trigger/ @CourTeous33
/api/controllers/console/app/workflow_trigger.py @CourTeous33
/api/controllers/console/workspace/trigger_providers.py @CourTeous33
/api/core/trigger/ @CourTeous33
/api/core/app/layers/trigger_post_layer.py @CourTeous33
/api/services/trigger/ @CourTeous33
/api/models/trigger.py @CourTeous33
/api/repositories/workflow_trigger_log_repository.py @CourTeous33
/api/repositories/sqlalchemy_workflow_trigger_log_repository.py @CourTeous33
/api/libs/schedule_utils.py @CourTeous33
/api/services/workflow/scheduler.py @CourTeous33
/api/schedule/trigger_provider_refresh_task.py @CourTeous33
/api/schedule/workflow_schedule_task.py @CourTeous33
/api/tasks/trigger_processing_tasks.py @CourTeous33
/api/tasks/trigger_subscription_refresh_tasks.py @CourTeous33
/api/tasks/workflow_schedule_tasks.py @CourTeous33
/api/tasks/workflow_cfs_scheduler/ @CourTeous33
/api/events/event_handlers/sync_plugin_trigger_when_app_created.py @CourTeous33
/api/events/event_handlers/update_app_triggers_when_app_published_workflow_updated.py @CourTeous33
/api/events/event_handlers/sync_workflow_schedule_when_app_published.py @CourTeous33
/api/events/event_handlers/sync_webhook_when_app_created.py @CourTeous33

# Backend - Async Workflow
/api/services/async_workflow_service.py @Mairuis
/api/tasks/async_workflow_tasks.py @Mairuis

# Backend - Billing
/api/services/billing_service.py @zyssyz123
/api/controllers/console/billing/ @zyssyz123

# Backend - Enterprise
/api/configs/enterprise/ @GareArc
/api/services/enterprise/ @GareArc
/api/services/feature_service.py @GareArc
/api/controllers/console/feature.py @GareArc
/api/controllers/web/feature.py @GareArc

# Backend - Database Migrations
/api/migrations/ @snakevash @laipz8200 @MRZHUH

# Backend - Vector DB Middleware
/api/configs/middleware/vdb/* @JohnJyong

# Frontend
/web/ @iamjoel

# Frontend - Tooling
/packages/tooling/ @hyoban @lyzno1
/eslint.config.mjs @hyoban @lyzno1
/knip.config.ts @hyoban @lyzno1
/vite.config.ts @hyoban @lyzno1
/web/vite.config.ts @lyzno1 @hyoban
/web/next.config.ts @lyzno1 @hyoban
/web/plugins/vite/ @lyzno1 @hyoban
/web/next/ @lyzno1 @hyoban

# Frontend - Platform and Features
/web/config/ @lyzno1 @hyoban
/web/env.ts @lyzno1 @hyoban
/web/features/ @lyzno1 @hyoban
/web/hooks/ @lyzno1 @hyoban

# Frontend - Web Tests
/.github/workflows/web-tests.yml @iamjoel

# Frontend - App - Orchestration
/web/app/components/workflow/ @iamjoel @zxhlyh
/web/app/components/workflow-app/ @iamjoel @zxhlyh
/web/app/components/app/configuration/ @iamjoel @zxhlyh
/web/app/components/app/app-publisher/ @iamjoel @zxhlyh

# Frontend - WebApp - Chat
/web/app/components/base/chat/ @iamjoel @zxhlyh

# Frontend - WebApp - Completion
/web/app/components/share/text-generation/ @iamjoel @zxhlyh

# Frontend - App - List and Creation
/web/app/components/apps/ @JzoNgKVO @iamjoel
/web/app/components/app/create-app-dialog/ @JzoNgKVO @iamjoel
/web/app/components/app/create-app-modal/ @JzoNgKVO @iamjoel
/web/app/components/app/create-from-dsl-modal/ @JzoNgKVO @iamjoel

# Frontend - App - Logs and Annotations
/web/app/components/app/workflow-log/ @JzoNgKVO @iamjoel
/web/app/components/app/log/ @JzoNgKVO @iamjoel
/web/app/components/app/log-annotation/ @JzoNgKVO @iamjoel
/web/app/components/app/annotation/ @JzoNgKVO @iamjoel

# Frontend - App - Monitoring
/web/app/(commonLayout)/app/(appDetailLayout)/\[appId\]/overview/ @JzoNgKVO @iamjoel
/web/app/components/app/overview/ @JzoNgKVO @iamjoel

# Frontend - App - Settings
/web/app/components/app-sidebar/ @JzoNgKVO @iamjoel

# Frontend - RAG - Hit Testing
/web/app/components/datasets/hit-testing/ @JzoNgKVO @iamjoel

# Frontend - RAG - List and Creation
/web/app/components/datasets/list/ @iamjoel @WTW0313
/web/app/components/datasets/create/ @iamjoel @WTW0313
/web/app/components/datasets/create-from-pipeline/ @iamjoel @WTW0313
/web/app/components/datasets/external-knowledge-base/ @iamjoel @WTW0313

# Frontend - RAG - Orchestration (general rule first, specific rules below override)
/web/app/components/rag-pipeline/ @iamjoel @WTW0313
/web/app/components/rag-pipeline/components/rag-pipeline-main.tsx @iamjoel @zxhlyh
/web/app/components/rag-pipeline/store/ @iamjoel @zxhlyh

# Frontend - RAG - Documents List
/web/app/components/datasets/documents/create-from-pipeline/ @iamjoel @WTW0313

# Frontend - RAG - Segments List
/web/app/components/datasets/documents/detail/ @iamjoel @WTW0313

# Frontend - RAG - Settings
/web/app/components/datasets/settings/ @iamjoel @WTW0313

# Frontend - Ecosystem - Plugins
/web/app/components/plugins/ @iamjoel @zhsama

# Frontend - Ecosystem - Tools
/web/app/components/tools/ @iamjoel @Yessenia-d

# Frontend - Ecosystem - MarketPlace
/web/app/components/plugins/marketplace/ @iamjoel @Yessenia-d

# Frontend - Login and Registration
/web/app/signin/ @iamjoel
/web/app/signup/ @iamjoel
/web/app/reset-password/ @iamjoel
/web/app/install/ @iamjoel
/web/app/init/ @iamjoel
/web/app/forgot-password/ @iamjoel
/web/app/account/ @iamjoel

# Frontend - Service Authentication
/web/service/base.ts @iamjoel

# Frontend - WebApp Authentication and Access Control
/web/app/(shareLayout)/components/ @iamjoel
/web/app/(shareLayout)/webapp-signin/ @iamjoel
/web/app/(shareLayout)/webapp-reset-password/ @iamjoel
/web/app/components/app/app-access-control/ @iamjoel

# Frontend - Explore Page
/web/app/components/explore/ @CodingOnStar @iamjoel

# Frontend - Personal Settings
/web/app/components/header/account-setting/ @CodingOnStar @iamjoel
/web/app/components/header/account-menu/ @CodingOnStar @iamjoel

# Frontend - Analytics
/web/app/components/base/ga/ @CodingOnStar @iamjoel

# Frontend - Base Components
/web/app/components/base/ @iamjoel @zxhlyh

# Frontend - Base Components Tests
/web/app/components/base/**/*.spec.tsx @hyoban @CodingOnStar

# Frontend - Utils and Hooks
/web/utils/time.ts @iamjoel @zxhlyh
/web/utils/format.ts @iamjoel @zxhlyh
/web/utils/clipboard.ts @iamjoel @zxhlyh

# Frontend - Billing and Education
/web/app/components/billing/ @iamjoel @zxhlyh
/web/app/education/ @iamjoel @zxhlyh

# Frontend - Workspace
/web/app/components/header/account-menu/workplace-selector/ @iamjoel @zxhlyh

# Frontend - App Shell and Console Bootstrap
/web/app/layout.tsx @iamjoel @lyzno1
/web/app/error.tsx @iamjoel @lyzno1
/web/app/(commonLayout)/layout.tsx @iamjoel @lyzno1
/web/app/(commonLayout)/providers.tsx @iamjoel @lyzno1
/web/app/(commonLayout)/hydration-boundary.tsx @iamjoel @lyzno1
/web/app/(commonLayout)/error.tsx @iamjoel @lyzno1
/web/app/account/(commonLayout)/layout.tsx @iamjoel @lyzno1
/web/app/components/main-nav/ @iamjoel @lyzno1
/web/proxy.ts @iamjoel @lyzno1
/web/app/auth/refresh/route.ts @iamjoel @lyzno1

# Frontend - Query Infrastructure and Console Service
/web/app/get-query-client.ts @lyzno1 @hyoban
/web/service/console/ @lyzno1 @hyoban

# Frontend - Browser Mode Tests
/web/app/**/*.browser.spec.tsx @lyzno1 @hyoban

# Docker
/docker/* @laipz8200
