dootask/config/ai.php
kuaifan ec1ab31b0e refactor(ai-kb): 索引同步改为容器启动 reconcile
- 删除 CI reindex workflow(ai-kb-reindex.yml):内容入库不再依赖 CI
  远程触发,AI 插件容器每次启动按文件 hash 对账(reconcile)自动增量
  收敛,免重启即时生效时可手动调 POST /kb/reindex(默认 mode=reconcile)
- ai-kb README.md 同步更新贡献流程与内容同步机制说明
- CLAUDE.md 精简 ai-kb 同步规则:去除与 _schema/README 重复的写作规范
  与背景说明,保留同步时机、操作指引、改完无需触发索引三条
- 另:auth 接口 locale 检索语种缺省改为由请求语言推导(含 zh 视为 zh,
  否则 en),删除 config/ai.php 的 rag_supported_locales 与回退逻辑,
  前端改用 getLanguage() 统一映射,同步更新 ai-kb auth.md
- appstore 镜像升级 0.4.3 -> 0.5.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 09:46:58 +00:00

49 lines
1.9 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
|--------------------------------------------------------------------------
| DooTask AI 助手灰度配置
|--------------------------------------------------------------------------
|
| RAG帮助知识库检索功能上线时按以下顺序灰度
| Stage 1 — stagingRAG_ENABLED=true 仅 staging 环境,全体可用
| Stage 2 — canaryRAG_ENABLED=true + RAG_CANARY_USERIDS="1,2,3,4,5"
| 仅白名单 user 命中 RAG
| Stage 3 — broad清空 RAG_CANARY_USERIDS全局启用
|
| 紧急关停kill switch5 分钟生效):
| 1) 改容器 env RAG_ENABLED=false
| 2) ./cmd php restart 让 swoole 重读 config
| 3) AI 容器收到 rag_enabled=0 时跳过 RAG hint 注入与 search_help_docs 工具挂载
|
| 灰度判定语义:
| rag_enabled (env total switch)
| ├─ false → 所有人都不走 RAGkill switch
| └─ true → 进一步看 canary
| ├─ rag_canary_userids 为空(默认)→ 全员启用
| └─ rag_canary_userids 有值 → 仅白名单 userid 启用
|
*/
return [
/*
|--------------------------------------------------------------------------
| RAG 总开关
|--------------------------------------------------------------------------
| true - 默认开启,按 canary 白名单进一步过滤
| false - 紧急 kill switch所有用户都不走 RAG
*/
'rag_enabled' => filter_var(env('RAG_ENABLED', true), FILTER_VALIDATE_BOOLEAN),
/*
|--------------------------------------------------------------------------
| RAG canary 白名单
|--------------------------------------------------------------------------
| 逗号分隔的 userid 列表。
| 留空表示 全员启用Stage 3 broad rollout
| 有值表示 仅白名单 userid 命中 RAGStage 2 canary
*/
'rag_canary_userids' => env('RAG_CANARY_USERIDS', ''),
];