Skip to content

设置新增资料库位置迁移入口 - #277

Merged
taekchef merged 8 commits into
mainfrom
codex/library-location-setting
Aug 21, 2026
Merged

taekchef merged 8 commits into
mainfrom
codex/library-location-setting

Conversation

@taekchef

@taekchef taekchef commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

实际改动

  • migrateLibrary(to:)(WorkspaceStore+LibraryRoot.swift):前置校验(嵌套/上级/相等/非空/合法库)、同卷原子移动、跨卷暂存目录逐项搬运+失败回滚、重绑+refreshRuntimeItemURLs+逐课程清单校验、完成后补排空挂起写回并持久化
  • CourseProjectRootError 新增 5 个迁移错误分支(含用户文案)
  • 迁移期间挂起:reconcileCourseFilesNow / scheduleCourseNoteLoad / flushPendingNotePersistence(for:) / persistCurrentNote(libraryMigrationInFlight 标志)
  • 设置「界面」页新增「资料库」组:路径显示 + 更改… + 确认框(云同步目录黄色提示,不阻止)+ 行内进度条 + 红/成功状态;目标是合法库时提示改走认领(configureCourseLibrary)
  • 新增 Tests/WeiBeiSafetyTests/LibraryMigrationSafetyTests.swift 五项:移动重绑、嵌套/非空拒绝、合法库认领、失败保原库、服务挂起与恢复

[growth-exempt: WorkspaceStore.swift +4 行(迁移挂起标志属性与两处一行守卫),新逻辑全部落在非冻结的 LibraryRoot 扩展与设置 UI]

未做内容

  • swift test 本机无法执行(无 Xcode,仅 CLT),由 CI 执行 --filter LibraryMigrationSafetyTests

共享核心面占用

  • WorkspaceStore.swift(libraryMigrationInFlight 属性 + 两处守卫,净增 4 行)
  • WeiBeiSelfCheck/main.swift:未改动
  • 合并即释放

验证命令

  • swift build ✅
  • swift run WeiBeiSelfCheck ✅
  • ./script/check_file_growth.sh ✅(WorkspaceStore 净增 4 行走 growth-exempt 豁免)
  • swift test --filter LibraryMigrationSafetyTests → CI

轻量冒烟

本机无 Xcode 无法起真实 App 包;构建产物级验证通过。真实 App 冒烟留待候选包阶段统一执行。

回退自查表(六条)

  1. 可见性:无状态展示变化,通过
  2. 数据安全:纯新增能力,未动任何锁,通过
  3. 编辑:dirty 守卫未动,通过
  4. 性能:比对仅在迁移时发生,通过
  5. 功能:多机搬运/搜索索引/Agent 授权/崩溃恢复未动,通过
  6. 可逆:独立提交可整体回滚,通过

- migrateLibrary(to:):同卷原子移动、跨卷暂存目录逐项搬运+失败回滚、重绑与逐课程清单校验
- 迁移期间写回/3秒对账/课程笔记加载挂起,完成后补排空
- 设置界面:路径显示+更改按钮+确认框(云同步目录黄色提示)+进度/错误/成功状态;目标是合法库时改走认领
- 新增 LibraryMigrationSafetyTests 五项专项验证
@taekchef taekchef added the growth-exempt 维护者批准冻结核心文件超过 50 行的净增长 label Aug 21, 2026
@taekchef taekchef closed this Aug 21, 2026
@taekchef taekchef reopened this Aug 21, 2026
@taekchef
taekchef marked this pull request as ready for review August 21, 2026 20:23
@taekchef
taekchef merged commit cc24f6a into main Aug 21, 2026
2 checks passed
taekchef added a commit that referenced this pull request Aug 22, 2026
…gence

revert: 回退文件模型收敛与库迁移方案全部已合并 PR(#277 #280 #281 #286)
@taekchef
taekchef deleted the codex/library-location-setting branch August 22, 2026 01:19
wang-kaopu pushed a commit to wang-kaopu/weibei that referenced this pull request Aug 22, 2026
…ary-location-setting"

This reverts commit cc24f6a, reversing
changes made to 34bb59e.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

growth-exempt 维护者批准冻结核心文件超过 50 行的净增长

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant