Skip to content

Commit 24c79b9

Browse files
committed
fix(knowledge): 复制 disciplies JSON 序列化 + stale 判定秒口径(审查 Critical)
1 parent a55649e commit 24c79b9

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎app/src/components/KnowledgeSampleView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default function KnowledgeSampleView({ onCopied, onNeedGlobal, refreshGlo
8888
}
8989
for (const m of SAMPLE_SYSTEM.models) {
9090
await invoke("add_knowledge_model", {
91-
systemId: sys.id, name: m.name, disciplines: m.disciplines, claim: m.claim,
91+
systemId: sys.id, name: m.name, disciplines: JSON.stringify(m.disciplines), claim: m.claim,
9292
validWhen: m.validWhen, invalidWhen: m.invalidWhen,
9393
});
9494
}

‎app/src/components/RouteInfoPopover.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ describe("RouteInfoPopover ⓘ 弹层", () => {
140140
? [{ id: 1, systemId: 2, nodeId: null, conceptId: null, modelId: null, targetType: "note_group", targetId: 3, createdAt: 0 }]
141141
: [];
142142
case "list_knowledge_concepts":
143-
// last_applied_at = 200 天前 → stale(90 天未引用)
144-
return [{ id: 5, systemId: 2, name: "曝光三角", essence: "e", boundary: "b", relation: "r", status: "core", lastAppliedAt: Date.now() - 200 * 86400_000, createdAt: 0, updatedAt: 0 }];
143+
// last_applied_at = 200 天前(Unix 秒)→ stale(90 天未引用)
144+
return [{ id: 5, systemId: 2, name: "曝光三角", essence: "e", boundary: "b", relation: "r", status: "core", lastAppliedAt: Math.floor(Date.now() / 1000) - 200 * 86400, createdAt: 0, updatedAt: 0 }];
145145
default:
146146
return baseInvoke(cmd, args);
147147
}

‎app/src/components/RouteInfoPopover.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ export default function RouteInfoPopover({
136136
let staleConcepts = 0;
137137
if (sys) {
138138
const concepts = await invoke<KnowledgeConcept[]>("list_knowledge_concepts", { systemId: sys.id });
139-
const now = Date.now();
139+
const now = Math.floor(Date.now() / 1000);
140140
staleConcepts = concepts.filter((c) => {
141141
const base = c.lastAppliedAt ?? c.createdAt;
142-
return now - base > 90 * 86400_000;
142+
return now - base > 90 * 86400;
143143
}).length;
144144
}
145145
setSysBrief({ modelCount, staleConcepts, systemName: sys?.name ?? "" });

‎docs/standards/line-limit-exemptions.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
| app/src/components/SessionDetailPanel.tsx | 371 | 会话详情面板:质量报告/段列表/OCR 概览/操作区单一面板完整交互流内聚(前端审查登记) | 若再增长:质量报告区拆至 SessionQualityReport.tsx |
7373
| app/src/components/ProfileDetector.tsx | 373 | 档案检测组件:投票/确认流/记忆偏好 UI + v0.11.5 Task 5 冲突提示内聚 + v0.13.6(REQ-219~222)形态 10 下拉/领域 20 下拉/细目多选 chips/分区映射形态优先 + 审查轮(onProfileChange ref/独立 try/fine_ids 同步,实测 2026-08-24) | 若再增长:确认流与细目 chips 拆至 ProfileConfirmFlow.tsx |
7474
| app/src/components/NoteEditView.tsx | 306 | v0.13.6(审查 H1 修复)重新越线:forwardRef 命令式 flushSave 出口(ESC 先保存后刷新)+ flushLatest 最终保存——编辑视图保存/快捷键/工具栏内聚 | 若再增长:工具栏与 MarkdownEdit 快捷键拆至 NoteToolbar.tsx |
75+
| app/src/components/GroupSidebar.tsx | 314 | v0.13.7(触点①)新增体系引用聚合/徽标渲染逻辑(systemLinks 状态 + load 中并行拉取 + 行内渲染映射)——组行筛选与体系徽标混合在同一 load 域 | 若再增长:体系引用拉取与徽标聚合拆至 useGroupSystemLinks.ts hook |
76+
| app/src/components/RouteInfoPopover.tsx | 344 | v0.13.7(触点③)新增体系简报(loadSystemBrief 并行拉取 + 简报渲染块),v0.12.2 注册值 278 行;本版增量约 +58 行因弹层内新增结算区/简报两个域 | 若再增长:简报拉取与渲染拆至 SystemBriefSection.tsx |
7577
| app/src/components/NoteEditView.tsx | —— | v0.12.2 行数修正:实测 299 行(登记值 315 过期),本版新增 autoFocus 一行后仍 300 行以内——登记移除,见"已拆分/登记移除记录" | —— |
7678
| app/src/pages/NotesPage.tsx | 359 | v0.12.2 三栏编排(GroupSidebar/FeedFragmentList/NoteListView 插槽 + 收件箱动线 onPromoted 接线 + 新建零对话框)——编排层内聚(数据获取/选中态/快捷键/辅助面板插槽),组件已全部下沉拆件;2026-08-23 审查修复(onPromoted 同步清搜索态/onOpenInbox 清组过滤)+6 行;v0.12.8 列表级批量删除(runBatchDelete 确认+逐条 invoke+刷新,confirm 导入,+27 行);v0.13.6(REQ-223)编辑退出统一刷新回调 + 审查轮(ESC flush 出口) | 若再增长:键盘监听与收件箱动线回调拆至 useNotesPageShortcuts.ts / useInboxFlow.ts |
7779
| app/src/components/AiProviderSettings.tsx | 329 | v0.11.6 M1 code-review 修复(2026-08-22):删除/清钥加 window.confirm、window.prompt 改卡片内联 password 输入(+2 state + 内联表单)、模型列表 input 改 textarea、fallbackOrder 透传 initial、run 置"处理中"反馈、预设双源 presetOptions 后端拉取——修复净增约 13 行越线(实测 329,含 4 行豁免头注释) | 若再增长:内联密钥表单拆至 AiProviderKeyInput.tsx |

0 commit comments

Comments
 (0)