3 Commits
Author SHA1 Message Date
runny 196478114c fix(onboarding): 租户序列避让保留 ID 并为存量空间补齐开箱默认库
deploy-hxtesting / build-and-deploy (push) Successful in 1m15s
根因(26040006 等首用户空间零知识库):
- 000000 初始迁移把 tenants_id_seq 起点设为 10000,恰好等于内置模型宿主
  保留租户 id(DefaultBuiltinModelTenantID=10000):全新环境的第一个用户
  空间必然撞上 SeedTenantDefaults 的「永不 seed」豁免,一个默认库都没有;
  后续空间(10001+)正常。内置模型行(tenant_id=10000)被真实空间占住,
  还存在归属歧义隐患
- 注册引导是创建时一次性动作,存量空间因引导当时失败(如模型未就绪)或
  上述碰撞而缺库时,此后永不补建

修复:
- migration 000160:租户序列推到 10001 之后——全新库从 10001 起号(10000
  永久保留给内置模型宿主),存量库按 max(id) 连续续号不受影响
- SeedTenantDefaults 拆出 seedStarterKB 供创建时引导与自愈共用;保留租户
  豁免注释同步更新
- 新增 EnsureTenantDefaultKnowledgeBases 惰性自愈:挂在知识库列表读路径
  (幂等/fail-open/进程内互斥防并发重复建档)——企业培训课件/题库两库恒补
  (Source 去重),「新手入门」仅零库空间补建(不复活用户主动删除的入门库)

效果:26040006(租户 10000)等存量用户打开「知识库」页即自动补齐 3 个默认
库;全新环境的首个用户空间不再撞保留 id
2026-11-24 11:10:14 +08:00
runny 9058149576 refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名)
- 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块)
- docreader proto 描述符采用等长替换,保持序列化字节布局有效
- Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像
- 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
2026-11-13 20:52:51 +08:00
runny 9097ee699d chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则) 2026-11-13 17:54:56 +08:00