WeKnora/docs
wizardchen 7b192e546f feat(builtin-models): reconcile YAML lifecycle with drift sweep
Extend the builtin_models.yaml loader so the YAML file becomes a complete
source of truth for the rows it owns. Builds on the previous commit's
managed_by column.

Lifecycle contract:
- Every UPSERTed entry is tagged managed_by="yaml".
- The DoUpdates list now includes deleted_at, so an entry that was
  soft-deleted (e.g. via UI/API) is automatically resurrected when it
  reappears in the file. Closes the "ghost row that exists but is
  invisible" failure mode.
- After all UPSERTs, the loader soft-deletes rows where
  managed_by='yaml' AND id NOT IN (current YAML id set). Removing an
  entry from YAML is now the supported way to retire a built-in model —
  no manual SQL needed.
- Rows tagged managed_by='' (UI/API/SQL-seeded built-ins) are invisible
  to the reconcile path and never touched.
- When a YAML entry sets is_default=true, the loader first clears
  is_default on any other rows in the same (tenant_id, type) bucket,
  mirroring the invariant enforced by the API path
  (repository.UnsetDefaultModel).

Failure handling stays defensive:
- File missing / not a regular file / parse error: warn and skip; the
  drift sweep is NOT executed so a malformed file cannot wipe rows.
- Per-entry UPSERT error: warn, drop the id from the keep-set so the
  sweep also leaves the existing row alone ("leave alone on failure").

Tests cover: file-missing, parse-error, basic upsert + defaults,
idempotency, ${ENV} interpolation (set vs unset), drift sweep removing
YAML rows, drift sweep ignoring manual rows, soft-delete resurrection,
is_default cleanup across tenant+type, explicit empty list sweeping all
yaml-managed rows, and a regression guard ensuring BeforeCreate does not
overwrite YAML-supplied stable ids.

Docs are rewritten so operators see "delete from YAML and restart" as
the supported removal path; SQL is retained only for the legacy
managed_by='' slice.
2026-05-26 11:37:03 +08:00
..
api feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
cloud-image docs(cloud-image): add cloud-agnostic image packaging scripts 2026-05-11 12:25:19 +08:00
images chore(release): v0.6.0 2026-05-21 16:56:19 +08:00
wiki docs: add Chinese RBAC guide and link with shared space docs 2026-05-21 12:28:31 +08:00
zh feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
BUILTIN_MCP_SERVICES.md feat: add built-in MCP service support 2026-03-05 21:57:01 +08:00
BUILTIN_MODELS.md feat(builtin-models): reconcile YAML lifecycle with drift sweep 2026-05-26 11:37:03 +08:00
CHUNKING.md fix(chunking): post-review polish — error surfacing + doc accuracy 2026-05-06 17:17:07 +08:00
IM集成开发文档.md add oidc 2026-03-30 11:13:44 +08:00
KnowledgeGraph.md docs: 更新多语言文档,新增知识图谱与MCP配置指南及目录结构 2025-11-19 16:56:49 +08:00
LITE.md feat: add LAN access configuration for desktop app, allowing users to enable public API access with corresponding UI updates and translations 2026-04-11 18:51:16 +08:00
Langfuse集成.md feat(observability): instrument agent ReAct loop and tool calls in Langfuse 2026-04-24 19:58:08 +08:00
MCP功能使用说明.md feat: Revamp conversation configuration management and enhance localization 2025-11-18 23:18:43 +08:00
OIDC认证调用流程.md simplify oidc callback result payload 2026-04-01 20:47:18 +08:00
QA.md chore(release): v0.6.0 2026-05-21 16:56:19 +08:00
RBAC说明.md chore(release): v0.6.0 2026-05-21 16:56:19 +08:00
ROADMAP.md feat(roadmap): update progress on document parsing and IM integration 2026-03-31 20:22:34 +08:00
agent-skills.md feat: adjust sandbox setting of agentConfig 2026-02-04 20:08:49 +08:00
docs.go refactor(knowledge): route single delete through async pipeline 2026-05-25 17:11:20 +08:00
migration-troubleshooting.md feat(system-info): surface DB migration errors with troubleshooting links 2026-05-14 16:34:50 +08:00
swagger.json refactor(knowledge): route single delete through async pipeline 2026-05-25 17:11:20 +08:00
swagger.yaml refactor(knowledge): route single delete through async pipeline 2026-05-25 17:11:20 +08:00
使用其他向量数据库.md feat: support Tencent VectorDB keyword retrieval 2026-05-10 00:02:05 +08:00
共享空间说明.md docs: add Chinese RBAC guide and link with shared space docs 2026-05-21 12:28:31 +08:00
开发指南.md feat: optimize security and deployment of agent skills 2026-02-04 20:08:49 +08:00
开启知识图谱功能.md feat: Update VLM configuration in knowledge base and API documentation 2025-11-20 20:08:24 +08:00
快速开发模式说明.md docs: update Air installation command from cosmtrek/air to air-verse/air 2026-02-04 19:27:44 +08:00
数据源导入开发文档.md docs: remove WeCom document integration from data source import documentation 2026-03-30 20:46:07 +08:00
日志配置.md refactor(logger): support LOG_FORMAT template and harden level coloring 2026-05-22 20:31:54 +08:00
添加新的网络搜索引擎.md feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00