link2026
6ccbe4ac55
docs(spec): 模型自动下载功能设计(2026-05-29)
...
新增「我的·模型管理」页模型下载功能设计:
- 独立 ModelDownloadService + ModelStore 保持纯存储(§3.1)
- HTTPS 断点续传(Range+追加写)、分模型卡片进度、大小校验
- 旁路文件导入兜底(补 VL)、AI 入口未就绪「前往下载」引导
- base URL https://file.myv0.com/,含精确 24 文件清单
并加 .gitignore 忽略本地模型素材目录 /Models/
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-05-29 22:12:19 +08:00
link2026
fe80e112af
docs(spec): 导出身体档案功能设计(2026-05-27)
...
记录 Tab 顶部入口 + 全屏 sheet,两段式本地 RAG(意图抽取 → 结构化检索 → Markdown 生成),
新增 HealthExport @Model 持久化历史。给 W3 AskService 铺路。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 23:03:35 +08:00
link2026
5f8f492f0e
feat(indicator): 长期监测预设支持长按隐藏 + 恢复
...
- UserProfile 加 hiddenPresetMetrics: [String],存被隐藏的 MonitorMetric.rawValue
- IndicatorQuickSheet monitorTile 加 contextMenu 隐藏入口
- section label 右侧"已隐藏 N 个 ›"chip 触发 HiddenMonitorRestoreSheet
- 纯 UI 过滤,不动 Indicator 历史 / Trends 折线 / MetricReminder
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-26 19:47:55 +08:00
link2026
599d39af35
docs(spec): 长期监测预设支持隐藏(2026-05-26)
...
UserProfile 加 hiddenPresetMetrics 字段;IndicatorQuickSheet
长按 tile 出 contextMenu 隐藏,顶部 chip 显示已隐藏数 + 恢复入口。
历史数据/Trends/Reminder 全不动。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-26 19:37:34 +08:00
link2026
1b01923c8e
feat(capture): 统一报告捕获流程并集成视觉语言模型识别
...
- 替换 QuickCaptureFlow 和 ArchiveFlow 为 UnifiedCaptureFlow 统一流程
- 新增 VLSession 封装 Qwen2.5-VL 模型进行图像文本推理
- 实现 AIRuntime 中 VL 模型的准备和分析功能
- 添加 VLPrompts 定义体检化验单识别的 JSON 输出模板
- 创建 CaptureReviewForm 提供 VL 解析结果的可编辑表单界面
- 集成 VisionKit 文档扫描器支持真机多页文档扫描
- 为模拟器实现 PhotosPicker 回退方案选择已有照片
- 在 RootView 中统一使用 UnifiedCaptureFlow 处理快速和归档流程
- 添加 CustomMetricEditor 支持自定义监测指标的创建编辑删除
- 扩展 KangkangApp 模型配置以支持新数据类型
- 实现档案列表中症状结束功能通过时间线行点击触发
2026-05-26 11:18:00 +08:00
link2026
39edc25dc1
refactor(profile,monitor): move height/weight from MonitorMetric to UserProfile
...
身高/体重对成人变化慢,作为 Profile 静态字段比每次录入 Indicator 更合适。
- MonitorMetric:6 case(从 8 减),删 .height / .weight
- UserProfile:加 weightKG: Double?(支持小数),加 bmi computed
- summaryLine 加体重段:'175cm · 68.5kg'(整数省小数)
- ProfileEditView basics 加 weight 行 + footer 显示 BMI + 分类(偏瘦/正常/超重/肥胖)
- IndicatorQuickSheet:删 .height 回写 Profile 的特殊逻辑
- UserProfileTests:+5 个(weight 字段、summaryLine 含 weight、BMI 计算)
兼容性:老 Indicator 里的 seriesKey 'weight' / 'height' 数据保留(SwiftData String?
不变),只是新录入路径走 Profile 不走 Indicator;Trends 仍能用 String seriesKey
查询历史(如果将来要展示老数据)。
测试:60 case pass / 0 fail / 0 warning。
2026-05-26 07:58:47 +08:00
link2026
37b47b2076
docs(claude): sync §5/§7/§10 with Monitor+Profile; fix SeriesBucket SwiftData import
...
- §5 schema 重写为 7 @Model 完整列表(含 UserProfile + Indicator.seriesKey)
- §7 IA 改成 5 槽 TabBar(2 内容 + 中间 + + 2 设置),记录入口 5 个 kind
- §10.6 红线例外清单加 Monitor + Profile(Symptom 也补上)
- SeriesBucket.swift 缺 import SwiftData(persistentModelID 报错)
全套测试 50 case pass / 0 fail / 0 warning。
2026-05-26 07:53:16 +08:00
link2026
e2fb631b96
feat(timeline): merge bp.systolic + bp.diastolic into single entry
...
- TimelineEntry.from(indicators:) 批处理:找 bp.systolic 配对同 capturedAt
(±5s)的 bp.diastolic,合并成 '血压 120/80 mmHg' 一行
- 未配对的 systolic 单独退回 from(indicator:)
- 非 bp.* series 不动
- ArchiveListView + HomeView 改用 from(indicators:) 批处理
- 6 个新测试覆盖配对/未配对/异常标记/非 bp 不动/不同时间不合并
2026-05-26 07:50:00 +08:00
link2026
0f38bf585b
first commit
2026-05-26 07:48:57 +08:00
link2026
3dcb792131
feat(profile,monitor): ProfileEditView + MeView 卡片 + IndicatorQuickSheet 改造
...
- ProfileEditView Form 风格,即改即存,onDisappear 触发 ctx.save
- basics(出生年 / 性别 / 身高 / 血型)
- 慢病 chips(8 预设 + 自定义)
- allergies / familyHistory / medications 通用 list section
- FlowLayout(Layout 协议自实现)用于 chip 流式换行
- MeView 改造:NavigationStack + ProfileCard 显示 summaryLine,
3 个 settings 卡片(模型 / Face ID / 关于)stub,DEBUG 块仍在底部
- IndicatorQuickSheet 整合 MonitorMetric:
- 顶部 LazyVGrid 2 列展示 8 个 MonitorMetric(进趋势)
- 下方 horizontal scroll 化验项快捷(不进趋势)
- 选血压切到 2 字段 UI(收缩/舒张),保存写 2 条 Indicator(同 capturedAt)
- 选单字段 monitor:自动算 status,锁 name/unit/range
- 选 lab preset:辅助填 name/unit/range,status 手动
- 自由输入路径不变
- 身高 monitor 保存时回写 UserProfile.heightCM
- Profile-aware range hint:'按 67 岁调整' 仅在 effectiveRange 不同于 baseRange 时显示
2026-05-26 07:47:20 +08:00
link2026
9a6d21100b
feat(monitor): add UserProfile + MonitorMetric catalog + Indicator.seriesKey
...
数据层(spec 2026-05-26):
- UserProfile @Model:核心 4 项 + 健康背景 + 用药,SwiftData 单例(loadOrCreate)
- Indicator 加 seriesKey: String?,标识长期指标分组('bp.systolic' 等)
- MonitorMetric enum 8 case:血压(2 field 拆 2 Indicator)/ 空腹+餐后血糖 /
体重 / 体温 / 心率 / SpO2 / 身高
- effectiveRange(for:profile:) 实现 1 条 Profile-aware 规则:
age >= 65 时 bp.systolic 上限 140→150
- KangkangApp schema 加 UserProfile.self
测试 17 个全绿(UserProfile 6 + MonitorMetric 11);schema 烟测扩 2(seriesKey roundtrip + UserProfile persist)。
UI 层 + Timeline 合并下个 commit。
2026-05-26 07:40:42 +08:00
link2026
7ede38ae06
docs(spec): add Monitor + Profile design v1 (approved)
...
long-term formatted indicators(.indicator 入口预设 + 自由)+ 个人资料
(年龄/性别/身高/血型/健康背景/用药)+ Profile-aware reference range
(老人血压 90-150 替代 90-140)。详见 spec §2-§5。
2026-05-26 07:34:43 +08:00
link2026
22cf4bcefe
fix(concurrency): make DateSection nonisolated to silence #expect warnings
...
5 个 Swift Testing macro 展开的 warning:DateSection 的 Equatable 协议被默认
推到 MainActor,但 #expect 在 nonisolated context 比较 — Swift 6 严格模式会报错。
2026-05-25 23:39:52 +08:00
link2026
bb08243aa9
chore(preview): add #Preview to RecordSheet + DebugAIRunner
...
之前 HomeView/MeView/TrendsView/ArchiveListView/RootView/SymptomStartSheet
都有 #Preview,只剩这两个。补完后所有主屏 View 都能在 Xcode Canvas 直接
预览,改 UI 不用 build & run。
2026-05-25 23:37:55 +08:00
link2026
b80fae35c9
docs(w2): mark plan tasks 1-7/9 done + sync CLAUDE.md §8 + write W2 retro
...
- plan: flip 43 checkboxes done across Task 1-7/9; Task 8 (manual speed
baseline) and Task 10 (this retro) intentionally left open
- CLAUDE.md §8: AI/ ⚠️ partial (AIRuntime/LLMSession/ModelStore/TokenChunk
done, VLSession/Prompts/ pending); FileVault ✅ ; add Debug/DebugAIRunner ✅ ;
drop bold from "W2 当前" and tag W2-W3 row 进行中
- new retros/2026-05-31-w2.md: status table, TBD speed baseline,
off-plan Symptom/Timeline/ArchiveListView/AppIcon/Swift6 cleanup,
Swift 6 + Simulator sandbox learnings, W3 prep checklist
2026-05-25 23:36:16 +08:00
link2026
e3ad24ac0e
test(ai): add LLMSession/AIRuntime smoke tests (no real inference)
...
iOS Simulator sandbox 看不到 host ~/tiji-models;Mac Designed for iPad
卡 code signing。真实推理验证由 DebugAIRunner 手动跑,结果记 W2 retro。
W3 把核心 LLM 接口拆独立 SPM target 后,可在 Mac 原生跑真实推理。
烟测覆盖:
- TokenChunk 值字段
- AIRuntimeError 3 case 都有 errorDescription
- AIRuntime actor status 可异步读取
2026-05-25 23:33:04 +08:00
link2026
b63b26bce5
feat(timeline): TimelineRow + DateSection + grouping tests + Diary sheet
...
- TimelineRow: 时间线条目单行视图
- DateSection + TimelineGrouping: 今日/昨日/本周/更早分组
- DiaryQuickSheet: 文字日记快速记录入口
- TimelineGroupingTests: 分组逻辑烟测
- SymptomEndSheet / RootView: 配套微调
2026-05-25 23:23:21 +08:00
link2026
b1b8d0a8c7
fix(timeline): add missing SwiftData import + @MainActor on caller props
...
- TimelineEntry.swift: 缺 import SwiftData,4 处 persistentModelID 报错
- ArchiveListView.allEntries / HomeView.recentEntries: 显式 @MainActor,
否则 default-isolation=MainActor 下被推断为 nonisolated,调用 MainActor
方法 TimelineEntry.from(...) 触发 4+4 个 isolation 警告
2026-05-25 23:22:35 +08:00
link2026
2e728dcd24
chore(assets): add Kangkang AppIcon (light/dark/tinted, 16-1024) + SVG source
...
9 PNG sizes for iOS/macOS + dark + tinted variants. SVG design source under
docs/design/. Updates Contents.json to reference them.
Scheme reference 编码统一为 康康(Xcode 写入格式)。
2026-05-25 23:18:29 +08:00
link2026
46b69cf8e1
feat(symptom): add Symptom @Model + start/end sheets + ongoing card
...
- Symptom @Model with severity 1-5 clamp, isOngoing, duration helpers
- SymptomStartSheet / SymptomEndSheet / OngoingSymptomsCard
- RecordSheet 加 .symptom kind 入口
- RootView 增加 'records' tab + ArchiveListView placeholder
- HomeView 顶部加 OngoingSymptomsCard
- ModelsSchemaTests: 2 个 Symptom 烟测(ongoing predicate + severity clamp)
Note: Symptom 是 CLAUDE.md §10 清单外的新功能,由产品负责人决定加入。
ArchiveListView 仍是 placeholder,真实 C1 实现按计划在 W4。
2026-05-25 23:18:21 +08:00
link2026
e4a68a1bdd
fix(concurrency): clear 4 Swift 6 warnings under default MainActor isolation
...
- ModelStore/FileVault: drop nonisolated(unsafe) on shared, mark all instance
methods nonisolated (they only read filesystem); ModelKind enum also nonisolated
- AIRuntime ↔ ModelStore cross-actor call resolved by the above
- LLMSession: replace deprecated Device.setDefault(device:) with task-scoped
Device.withDefaultDevice(.cpu, body:); wrap both load and generate so the
TaskLocal propagates through ModelContainer.perform
2026-05-25 23:18:08 +08:00
link2026
53da442424
chore: rename Tiji→Kangkang test imports + scheme + sync docs
...
Rename @testable imports across all test/UI test files after the Tiji→Kangkang
project rename in 44ed01a . Add shared scheme. Sync CLAUDE.md / W2 plan / spec
v1.0 to current scope (Symptom feature noted, C1/C2 flow lockdown).
2026-05-25 23:18:00 +08:00
link2026
44ed01acf4
```
...
refactor: 重命名项目名称从"体己"到"康康"
将整个项目的目录结构从"体己"重命名为"康康",包括所有源代码文件、
资源文件、测试文件以及Xcode项目配置文件。此更改涉及项目中所有的
文件路径和应用入口点(App/TijiApp.swift → App/KangkangApp.swift)。
```
2026-05-25 19:01:16 +08:00
link2026
9419e8158f
```
...
feat(debug): 添加模型导入功能并修复模拟器GPU初始化问题
- 在DebugAIRunner中添加文件导入器,支持用户选择并导入LLM模型文件夹
- 添加导入状态管理和错误提示功能
- 修复iOS模拟器环境下MLX GPU stream初始化崩溃问题,强制使用CPU模式
- 添加UniformTypeIdentifiers导入以支持文件选择功能
```
2026-05-25 18:25:20 +08:00
link2026
57536e5319
test(models): 加 3 个 Schema 关系烟测
...
按 W2 plan Task 9 落地:
- insertIndicatorWithReportRelationship: 验证 Indicator.report 反向关系
双向可达(report.indicators 也能找到)
- cascadeDeleteReportRemovesIndicators: 删 Report 触发 cascade,旗下
Indicator 一并被清理(对应"永久删除"语义)
- chatTurnPersistsReferencedIDs: ChatTurn 的 referencedIndicatorIDs
作为 [String] 字段正确持久化
全部用 in-memory ModelContainer 隔离,无副作用。
注:文件需用户在 Xcode 拖入 体己Tests target 后 ⌘U 跑测试。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 18:23:45 +08:00
link2026
a3e758cf83
fix(build): 加 SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES
...
Xcode 26 默认不开 Mac (Designed for iPad) 支持。开启后,iOS App 可
在 M 系列 Mac 上原生运行,使用 host Mac 真实 Metal device,绕过
iOS Simulator 上 MLX 必崩的限制(mlx::core::metal::Device 初始化
在 simulator 下读 device 属性返回 nullptr,libcpp abort)。
6 处 build config(主 target + Tests + UITests × Debug/Release)
都加上,与现有 SUPPORTED_PLATFORMS 包含 macosx 一致。
xcodebuild -destination 'platform=macOS,variant=Designed for iPad'
+ -allowProvisioningUpdates 已验证 BUILD SUCCEEDED。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 17:11:20 +08:00
link2026
acfdaa1f4f
fix(concurrency): nonisolated(unsafe) static shared + 修同 actor 内冗余 await
...
项目开启了 -default-isolation=MainActor upcoming feature,导致:
1. static let shared 默认被视为 MainActor 隔离,即使 class 标了
@unchecked Sendable,从其他 actor(如 AIRuntime)同步访问仍报
"Expression is 'async' but is not marked with 'await'".
修法:ModelStore.shared 和 FileVault.shared 都加 nonisolated(unsafe)
修饰,明确"任何隔离上下文都可同步访问"。
2. AIRuntime.generate() 内的 Task { ... } 继承 AIRuntime actor 隔离,
self.recordRate 是同 actor 内部调用,不需要 await,否则报
"No 'async' operations occur within 'await' expression".
修法:去掉冗余的 await。
** BUILD SUCCEEDED ** 已验证。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 17:00:30 +08:00
link2026
9fbd31458c
feat(debug): DebugAIRunner DEBUG 自检入口挂到 MeView
...
按 W2 plan Task 7 落地,实现胜过 plan 原稿(强化 UX 减少 Xcode console
依赖):
- 卡片显示 Application Support 路径 + 模型预期完整路径
- 一键复制路径到剪贴板,方便 `cp -R` 拷模型
- 模型就绪状态徽章(✓ 就绪 / ⚠ 未就绪),依赖 ModelStore.isReady
- 跑一段 prompt 流式输出,顶部 tok/s 速率显示
- 全文件 #if DEBUG 包裹,Release 不打包
MeView 在 DEBUG 时挂 DebugAIRunner 在 placeholder 下方。
下一步用户手动:把 ~/tiji-models/Qwen3-1.7B-4bit 拷到模拟器沙盒
Application Support/Models/ 下,然后跑 App → Me 页点按钮验收。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:50:07 +08:00
link2026
a02679a623
fix(build): 手动 patch SPM 链接 + 清孤儿文件让 Task 6 真正可编译
...
经过多轮 Xcode UI / SPM 解析失败,本 commit 合并以下修复:
pbxproj 手动 patch:
- 删除孤立的 mlx-swift XCRemoteSwiftPackageReference(版本 0.31.3 与
mlx-swift-examples 2.29.1 锁定的 0.29.1..<0.30.0 冲突)
- 在 体己 target 加入 MLXLLM + MLXLMCommon 两个 product 依赖,绑定到
mlx-swift-examples 包。补齐 PBXBuildFile + XCSwiftPackageProductDependency
+ packageProductDependencies + Frameworks build phase 4 处条目
LLMSession.swift 简化:
- 去掉 import MLX(避免需要把 mlx-swift transitive MLX/MLXFast/MLXNN 等
5 个 product 也链上,大幅简化依赖)
- 移除 MLX.GPU.synchronize() 调用——研究笔记里建议的尾部同步对 AsyncStream
数据正确性无影响,省一份直接 import 依赖
清理孤儿文件:
- 体己/AI/Theme.swift 和 体己/AI/TabBar.swift 是早期混乱中由出错的
fix subagent 创建的占位 stub,跟 DesignSystem/Tokens.swift 重复声明
enum Tj,导致 invalid redeclaration
附:Package.resolved 由 xcodebuild SPM resolve 生成,加入版本控制确保
团队成员锁定相同版本图。
** BUILD SUCCEEDED ** 验证通过(iPhone 17 Pro simulator)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:45:32 +08:00
link2026
f5f78e36a6
fix(ai): 回滚 LLMSession 的错误 stub-out,正确施加 GPU.synchronize cancel guard
...
前一个 fix commit (1ee512d ) 的 implementer subagent 错误地把 MLX import
全部注释掉,把 actor LLMSession 整体包进 #if false,并新增了一组假的
ModelContainer / ModelConfiguration / LLMModelFactory stub 类型。这是
对 spec 的严重偏离——MLX SPM 依赖已经存在(Task 1 用户手动配置 + 多
次 BUILD SUCCEEDED 已验证)。
本 commit 恢复 ad1b045 的真实 MLX 实现,并保留原本只有 2 行的 P0
修复(GPU.synchronize 仅在 !Task.isCancelled 路径执行)。
防再犯:后续 fix subagent prompt 加入"不要修改与 P0 无关的代码"
显式红线。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:07:54 +08:00
link2026
1ee512dce1
harden(ai): LLMSession 取消时跳过 MLX.GPU.synchronize
...
按 code quality review(P0)反馈,for-await 因 Task.isCancelled
退出时,GPU.synchronize() 不必执行——这是一个阻塞的 GPU 同步操作,
取消场景下属浪费。
W3 引入"用户取消推理"UI 时会更频繁触发此路径。
P1/P2 留待 W3 退散考量:
- decodeRate 用窗口平均(目前是累积)
- AIRuntime 持具体 LLMSession 类型,W3 抽 protocol 做 mock
- prompt 空字符串守门
- Float(0.6) 风格
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:06:09 +08:00
link2026
ad1b045e12
feat(ai): LLMSession 接 MLX-Swift,跑 Qwen3-1.7B 流式生成
...
按 W2 plan Task 6 + docs/superpowers/notes/2026-05-25-mlx-api-corrections.md
落地 LLM 推理底座:
- actor LLMSession 包装 MLXLLM.ModelContainer
- load(folderURL:) 用 ModelConfiguration(directory:) + LLMModelFactory.shared.loadContainer
- generate(prompt:maxTokens:) 返回 AsyncThrowingStream<TokenChunk, Error>
- 内部 container.perform { (context: ModelContext) in ... } 拿到模型上下文
- UserInput → processor.prepare → MLXLMCommon.generate(顶层函数, AsyncStream)
- Generation switch 穷举 3 个 case(chunk / info / toolCall)
- maxTokens 通过 GenerateParameters 传递,温度 0.6 topP 0.9
- 取消传播:continuation.onTermination 同步 task.cancel()
- 每 chunk yield 时计算 tok/s decodeRate
API 基线:mlx-swift-examples tag 2.29.1, commit 9bff95ca。
需用户手动:
1. Xcode 把 LLMSession.swift 拖入 体己 target (AI group)
2. ⌘B 验证 AIRuntime 不再报 "Cannot find LLMSession"
3. 把 ~/tiji-models/Qwen3-1.7B-4bit/ 拷到模拟器沙盒 Application Support/Models/
4. Task 7 (DebugAIRunner) 才能跑通
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:03:04 +08:00
link2026
ef0fbeac97
fix(ai,persistence): ModelStore + FileVault 标 @unchecked Sendable
...
Xcode 26 默认开启 Swift 6 严格并发检查。AIRuntime(actor)
调用 ModelStore.shared.isReady(...) 跨 actor 边界,因 ModelStore
非 Sendable 而编译报错"Expression is 'async' but is not marked
with 'await'; this is an error in the Swift 6 language mode"。
两个类的内部状态只读(rootURL: let),方法只做线程安全的
filesystem I/O,符合 Sendable 语义,标 @unchecked Sendable
即可,不必加锁或重构。
修复目标错误:
- AIRuntime.swift:48 - guard ModelStore.shared.isReady(.llm) ...
- 后续 CaptureService 调 FileVault.shared.writeJPEG 同样路径
不影响:
- HomeView/B5ResultView 里 Text "+" 的 macOS 26.0 deprecation 是
warning,不阻塞 build,留待 UI polish 周清理
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 16:00:47 +08:00
link2026
193e478425
docs: 记录 MLX-Swift-Examples 2.29.1 真实 API 与 plan 草稿的偏差
...
W2 plan Task 6 写的 LLMSession 草稿在 4 处与真实 API 不符:
- container.perform 的 context 是具体 ModelContext struct
- MLXLMCommon.generate 是顶层函数,只 try 不 await,返回 AsyncStream 非 Throwing
- Generation 有第三个 case .toolCall,switch 必须穷举
- GenerateParameters 需要 maxTokens,且 temperature/topP 是 Float
- 取消传播需 continuation.onTermination = { _ in task.cancel() }
本笔记含完整修正版 LLMSession.swift,Task 6 implementer 必用此为准。
参考:mlx-swift-examples tag 2.29.1,commit 9bff95ca。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:53:54 +08:00
link2026
771b28e7ef
fix(ai): ModelKind rawValue 改为真实 HF mlx-community 仓库名
...
实际查 HuggingFace 后,mlx-community 下的仓库名:
- Qwen3-1.7B-4bit(不是 Qwen3-1.7B-MLX-4bit)
- Qwen2.5-VL-3B-Instruct-4bit(VL 模型带 Instruct 后缀)
改动:
- ModelKind.llm/vl rawValue 改名,这也是沙盒 Models/ 下的子目录名
- 加 huggingFaceRepo computed:"mlx-community/\(rawValue)"
- CLAUDE.md §2 表格补 HF 仓库 ID
- spec §2.2 模型来源行修正
W2 plan 中的下载脚本已陈旧(用了 huggingface-cli + 错名),
W2 retro 时会修正。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:50:20 +08:00
link2026
e7cdb45472
harden(ai): AIRuntime 去掉冗余 weak self,prepare loading 路径加注释
...
按 code quality review 反馈(2×P0):
- generate() 的 Task 闭包不再 [weak self];actor 单例 strong capture
没有循环引用风险,且避免 Swift 5.10+ weak-on-actor 警告
- prepare() 的 case .loading: return 加注释说明这是有意设计,
调用方需轮询或显示 loading UI(W3 引入 prepare 队列优化)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:33:51 +08:00
link2026
4dcd951821
feat(ai): add AIRuntime actor skeleton + TokenChunk
...
按 W2 plan Task 5 落地推理串行化骨架:
- TokenChunk: Sendable struct (text + decodeRate tok/s)
- AIRuntime: actor 单例
- Status: notReady / loading / ready / error(msg)
- prepare() async throws: 幂等加载,失败回滚 status
- generate(prompt:maxTokens:) -> AsyncThrowingStream: 流式输出
跨 actor 边界用 snapshot 模式捕获 self.status/llmSession
- lastDecodeRate: 给 UI 顶部条 / Live Activity 取
- AIRuntimeError: LocalizedError, 三种 case
WIP: Build will fail until Task 6 lands LLMSession (intentional).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:30:47 +08:00
link2026
d40cb7d1e0
harden(ai): ModelStore seedFromBundle 在 DEBUG 报错,加空目录测试
...
按 code quality review 反馈:
- seedFromBundle 找不到 bundle 资源时,DEBUG 下 assertionFailure 提示
target membership(release 仍静默 return),避免 W6 启用时排查困难
- 补 totalBytesReturnsZeroWhenFolderMissing 测试,覆盖 folder 不存在时
enumerator 为 nil 的 guard 路径
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:12:26 +08:00
link2026
ad6fb660f0
feat(ai): add ModelStore with path management and bundle seed
...
按 W2 plan Task 4 落地模型路径管理:
- ModelKind enum: llm (Qwen3-1.7B-MLX-4bit) / vl (Qwen2.5-VL-3B-MLX-4bit)
- 用 config.json 作为 sentinel 判定模型是否就绪
- isReady / localURL / totalBytes 三个查询接口
- seedFromBundle(_:) 占位:Demo 现场预装模型旁路(W6 启用)
- shared 单例用 Application Support/Models/
测试 3 条:fresh / mark-ready / totalBytes,均用临时目录隔离 + defer cleanup。
注:.swift 文件需用户在 Xcode 拖入 target,⌘U 确认绿后 amend build commit。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:09:51 +08:00
link2026
0739ccea2b
harden(persistence): FileVault path traversal guard + error unification
...
按 code quality review 反馈(P0 + 4×P1):
- 加 resolveSafePath() 拒绝 / 和 .. 并验证 hasPrefix(rootURL)
- loadImage/remove 统一抛 FileVaultError(readFailed/removeFailed)
- 删除测试 struct 上多余的 @MainActor
- 每个 @Test 加 defer cleanup,不泄漏 temp 目录
- 测试图片改用生成 16x16 红色,不依赖 SF Symbol
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:06:49 +08:00
link2026
d704a9eb78
feat(persistence): add FileVault with complete file protection
...
按 W2 plan Task 3 落地原图加密存储:
- writeJPEG / loadImage / remove / wipe 四个核心操作
- Application Support/Vault/ 目录全程 .completeFileProtection
- 文件写入用 .completeFileProtection options(双保险)
- FileVault(rootURL:) 注入便于测试隔离
- shared 单例用真实 App Support 路径
测试 3 条:roundtrip / remove / wipe。
注:.swift 文件需用户在 Xcode 拖入 target(Persistence group + 体己Tests),
之后 ⌘U 跑测试,若全绿再 amend 提交 .pbxproj。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 15:03:15 +08:00
link2026
2b6c4b9726
feat(models): add Asset/ChatTurn, indicator-report relationship, pinned flag
...
按 W2 plan Task 2 落地数据模型:
- Indicator 加 report / asset / pinned 字段
- Report 加 indicators / assets @Relationship(cascade)
- DiaryEntry 加 tags
- 新增 @Model Asset (原图元数据)
- 新增 @Model ChatTurn (问答历史 + 引用)
- TijiApp Schema 加入新 model
注:Schema 破坏性变更,用户需在 Xcode 里 Erase Simulator
后重启 App。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 14:55:26 +08:00
link2026
c050865db5
feat(ui): UI 骨架基线 — 3 Tab + RecordSheet + Quick/Archive 流程占位
...
替换 Xcode 默认模板:
- 删除 ContentView/Item/__App
- 新增 App/TijiApp(SwiftData ModelContainer)、RootView(3 Tab + RecordSheet)
- DesignSystem:Tokens(色板/字体/圆角)+ Components(卡片/按钮/Chip)
- Models:Indicator / Report / DiaryEntry @Model 初版
- Features:Home / Quick(A1-A3)/ Archive(B1-B5)/ Record / Trends / Me 静态 UI
W2 AI 基座工作将在此基线上叠加。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 14:49:21 +08:00
link2026
96cae73d8f
docs(plan): W2 实现计划 — AI 基座 + Schema 重建
...
10 个任务,TDD where possible:
- T1 MLX SPM 接入
- T2 Models.swift 扩展(Asset/ChatTurn + 字段 + cascade)
- T3 FileVault + 3 个单元测试
- T4 ModelStore + 3 个单元测试
- T5 TokenChunk + AIRuntime actor 骨架
- T6 LLMSession 接 MLX 跑 Qwen3-1.7B
- T7 DebugAIRunner 自检入口
- T8 模拟器跑通里程碑(含 R1 红线决断)
- T9 Schema 烟测 + 关系测试
- T10 retro + 状态更新
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 14:35:37 +08:00
link2026
c2c40f33c5
docs: 康记 v1.0 功能设计 spec + CLAUDE.md 工程前提
...
把原始功能清单收敛为方案 B(核心 5 模块 + Live Activity)。
关键决策:MLX Swift 运行时、结构化 RAG 不做 embedding、
系统级 file protection 不造 AES 轮子、统一拍照合并快拍与归档、
补回 C1/C2 档案库视图、加回报告对比(16.1)。
CLAUDE.md 锁定工程红线供后续 IDE 会话对齐。
Spec 含 6 周时间表、风险预案、与原始清单完整映射。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-25 14:27:33 +08:00
link2026
9b2f27e691
Initial Commit
2026-05-25 12:12:47 +08:00