diff --git a/.project-docs/10-decisions/ADR-2026-09-22-coding-teacher.md b/.project-docs/10-decisions/ADR-2026-09-22-coding-teacher.md index 3262ec84..e83e75cc 100644 --- a/.project-docs/10-decisions/ADR-2026-09-22-coding-teacher.md +++ b/.project-docs/10-decisions/ADR-2026-09-22-coding-teacher.md @@ -18,8 +18,13 @@ - 当前咨询与草稿按账号、项目保存,每轮绑定当时的操作会话。旧客户端生成的朋友话题及草稿只读保留,不再继续调用,也不自动绑定云端智能体;旧来源会话级历史不自动迁移。现有云端 `coding-teacher` 契约与存储名保留为实现兼容,不构成角色分类。 - 输入预算在编译时计入完整执行请求。本地旧模型路径按约 2 UTF-8 字节估算 1 Token,工具定义、调用和读取预留纳入同一计量;估算不替代模型上限或实际 usage。云端以完整 JSON 转义后的 query 字节数裁剪来源节选,原文仍可按 ID 读取。固定配置/当前讨论超限与用户问题/引用超限分别提示,不静默修改发布预算、问题、明确引用或话题版本。 +- 咨询回答以 Markdown 渲染标题、列表、表格、代码、HTTP(S) 链接/图片和公式,代码与表格在栏内滚动;普通 JSON、Markdown 链接与代码中的字面转义保持原义。discussion-v1 仅由顶层 reply/quickReplies/tool 或专用围栏识别,组件仍遵循既有生命周期。解析失败保留原讨论卡与可恢复正文,完整 unparsedResponse 单独持久保存并默认折叠,不再次注入后续会话上下文。 +- 工具活动使用实际主线程事件及 Main 本地读取结果的名称/状态,按 run/call 关联与去重,单独折叠展示;参数、输出、错误原文与推理不进入活动 DTO 或回答。未观察到结果的调用明确显示结果缺失,不补写过期事件或旧话题。Yuxi chat_service 保证只有 AI 角色进入回答流,客户端不按内容外形猜测清洗。 + ## Evidence And Release Boundary +- 2026-09-24 渲染源 `97837cef90baf6bb02cfda0cef7b938081f3c5f7` 与 Yuxi 配套源 `02f27f33a8b816589036503f0720d446418c28aa` 已纳入本地主分支集成。客户端源 287 项单测、12 项真实浏览器布局用例及独立审查通过;Yuxi 82 项相关协议回归与真实 LangGraph 确定性模型测试通过。浏览器接口为替身,不代表安装版或线上模型已验收;旧版已覆盖的失败原文无法恢复。 + - 2026-09-24 客户端源 `8a157be4f62d073744164318e02185aebeaadc09` 包含预算修复 `de72b1cd945df373d09402a1cf3a0e9b34832f03`。预算修复通过 289 项相关测试;统一智能体覆盖 323 项相关用例、类型/lint/生产构建、2 项 Electron 交互和 13 项布局测试。扩展 Main 类型检查仍有基线 66 项诊断,无新增;不代表真实收费模型、已安装客户端或生产整链验收。详见两份源任务记录。 - 配套源:Works Square 79b1da574364d6f412e4395c179b5d27cc7bbd7d;Yuxi c2792dc4938a68db8ce1e34056e84af4b06c739b;MakeLore d20c818fe79bc5833cef15d99974b699dde71c6d。 - 源验证包括 WS 66 passed / 1 skipped、Operations 125 项及构建/浏览器验证;Yuxi 2243 passed / 1 skipped、真实 HTTP/PostgreSQL/Redis/worker/SDK 续接验证;MakeLore 51 项相关测试、typecheck、lint、构建及已有 Electron 流程验证。模型使用明确替身,真实供应商扣款与完整生产拓扑未验收。 diff --git a/.project-docs/20-architecture/system-overview.md b/.project-docs/20-architecture/system-overview.md index d8fcca3e..6b6782ff 100644 --- a/.project-docs/20-architecture/system-overview.md +++ b/.project-docs/20-architecture/system-overview.md @@ -4,6 +4,8 @@ Code 咨询由 Works Square 运营下发的 Yuxi 智能体执行,客户端不 ## Current Architecture +咨询正文由 TeacherReply 渲染 Markdown、GFM 与公式,Main 只按明确的 discussion-v1 字段解析讨论组件;普通 JSON/代码仍是正文。失败原文默认折叠持久保存且不重新注入上下文。云端主线程与本地读取活动投影为独立的工具名称/状态,参数、结果和推理不进入回答。Yuxi 在消息投影处筛选 AI 角色;详见[咨询决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)。 + 知识文档上传、附件导入与替换后由客户端自动衔接既有解析索引接口,Main 保留处理 Task、可用性与替换关系。Renderer 每 5 秒串行刷新已加载页面,以服务端持久 Task 与实际分块显示阶段、失败原因及可用于回答的文档;请求未确认时保留同一操作意图,观察到新 Task 后才解除本地不确定状态。替换失败及清理重试保留旧可用内容,零分块不显示可用。见[知识处理交互规则](../10-decisions/ADR-2026-09-11-personal-cloud-agents.md#知识文档处理与可用状态)。 知识库 embedding 独立于原有 one-api 模型网关:Yuxi 拥有目录、供应商地址/密钥与实际维度并直连供应商,平台承担费用,不计算用户用量、词元点数或智能体金额预算。访问资格与运行时限保留,聊天计费不变;见[已接受向量规则](../10-decisions/ADR-2026-09-11-personal-cloud-agents.md)。 diff --git a/.project-docs/30-worklog/current-state.md b/.project-docs/30-worklog/current-state.md index 5bff6ad6..38f421a5 100644 --- a/.project-docs/30-worklog/current-state.md +++ b/.project-docs/30-worklog/current-state.md @@ -4,6 +4,8 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Integrated Through +- 2026-09-24:在 `d2150ce5de5cec541f65eba9260d3cdc5172a66d` 上无冲突集成源 `97837cef90baf6bb02cfda0cef7b938081f3c5f7`,保留主线工作台样式。咨询支持 Markdown/表格/代码/公式/图片,普通 JSON 与代码不再被误判为讨论协议;格式失败原文独立折叠留存,工具名称/状态独立展示,修复多余数字 0。配套 Yuxi 源 `02f27f33a8b816589036503f0720d446418c28aa` 在主分支保证 AI 角色投影。合并树重新通过 287 项相关单测、12 项 319/508px 浏览器布局、Renderer typecheck、scoped lint 和 Vite 全目标构建。未推送、打包或部署,真实模型整链验收未执行。旧版已覆盖的原文不能恢复。详见[源任务](tasks/20260924-agent-rendering-a8c2d419.md)、[集成记录](tasks/20260924-merge-agent-rendering-ml-4efb196c.md)及[咨询决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)。用户批准释放旧集成登记,并以当前主线为基线重新登记;原三份未提交文档仍原样保留,不修改历史来源记录。 + - 2026-09-24:将客户端源 `8a157be4f62d073744164318e02185aebeaadc09` 从 `eb3dc85a2f0ed8457b7f24684c2da3ab192c2e46` 无冲突快进合入本地 `main`,包括预算修复 `de72b1cd945df373d09402a1cf3a0e9b34832f03` 及其源记录 `248776d8550d67de7ce30802a9f827d432c42a99`。 咨询统一使用运营下发的智能体,移除固定老师/朋友角色、本地人设与按名称限制工具的逻辑;名称、头像、简介、欢迎语和推荐问题取自发布定义。旧合成朋友话题与草稿只读保留,不自动绑定或提交;项目级草稿、已发布版本、学生计费和现有讨论/主动跟进保持。 输入预算区分近似模型 Token 与完整 JSON query 字节,固定配置超限单独提示,修复短问题被错误拦截。源覆盖 323 项相关用例,类型/lint/生产构建、2 项 Electron 交互和 13 项布局测试通过;预算源另有 289 项相关测试。扩展 Main 仍为基线 66 项诊断,无新增。合并未改产品实现,沿用源验证;未推送、打包、安装或做真实付费模型验收。 diff --git a/.project-docs/30-worklog/tasks/20260924-merge-agent-rendering-ml-4efb196c.md b/.project-docs/30-worklog/tasks/20260924-merge-agent-rendering-ml-4efb196c.md new file mode 100644 index 00000000..4ef56b2b --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260924-merge-agent-rendering-ml-4efb196c.md @@ -0,0 +1,44 @@ +# Task: Integrate consultation rendering fixes into main + +## Identity + +- Task ID: 20260924-merge-agent-rendering-ml-4efb196c +- Mode: Integration +- Branch: main +- Worktree: D:\Datas\OthersProjects\makelore +- Base commit: d2150ce5de5cec541f65eba9260d3cdc5172a66d +- Owner: codex +- Status: Ready for Integration + +## Scope + +- Merge reviewed source 97837cef90baf6bb02cfda0cef7b938081f3c5f7 (20260924-agent-rendering-a8c2d419) into local main; promote accepted consultation rendering and protocol facts. Paired Yuxi source: 02f27f33a8b816589036503f0720d446418c28aa. + +## Intent And Constraints + +- Concurrent, Planning and Integration Gates Passed: official start/status match Identity and exclusive integration lock. Read entry/memory-index, own/source/reviewer records, positioning/current-state, teacher ADR, architecture, domain, evidence/reflection/commitments and registered peer scopes. Project goal remains server-distributed consultation agents, Main-owned read tools and student billing. No semantic conflict; preserve current workbench styling and guidance from main. +- User explicitly authorized official release --force of the prior integration owner and new --adopt-existing registration for three known foreign untracked task documents. They remain unchanged and excluded from commits. The new base avoids attributing old cross-machine imports to this integration. No registry fields were manually rewritten. +- Plan: merge exact sources, preserve main styling, rerun relevant client unit/type/build/layout checks, promote accepted facts, pass documentation gates and complete. No push, deployment, paid model request or new subagent. Reuse the completed independent review for unchanged source logic. +- Prior source verification: 287 focused unit tests and 12 browser layout cases passed. Full Main typecheck has 66 existing diagnostics; online production acceptance and recovery of previously overwritten malformed replies remain unverified. + +## Outcome + +- Source merge committed as 98559e32a75dfbada12a737d7ff0ffda55aa346a. Before the merge commit the drift checker could not recognize the staged foreign source record; exact source-record equality was confirmed, then the unchanged source import was committed and the official drift check passed. No foreign record was edited/adopted to bypass this gate. + +- Merged source without conflicts; the only TeacherChatPanel difference from reviewed source is main's two header/avatar styling classes, and README keeps main's styling description. Source task record and implementation imported unchanged otherwise; cloud guidance already on main remains intact. Promoted Markdown/explicit protocol parsing, retained malformed originals and separate typed activity into teacher ADR and architecture. + +## Verification + +- Existing user-approved independent reviewer completed a bounded integration review: PASS, no findings. Of 19 source-changed files, 17 match source blobs exactly; README/header classes only preserve existing main styling. Confirmed canonical semantics and evidence boundaries. Official task-aware drift passes with all three adopted foreign documents unchanged; no unmerged files remain. + +- Merged tree: pnpm exec vitest run teacher-discussion teacher-cloud-activity coding-teacher --maxWorkers=1: 8 files / 287 passed. MAKELORE_LAYOUT_BROWSER_CHANNEL=msedge pnpm exec playwright test tests/e2e/teacher-discussion-layout.spec.ts: 12 passed at 319/508px with fixture API. pnpm run typecheck, ESLint on changed TS/TSX, pnpm run build:vite and whitespace checks passed. +- Initial main checkout dependencies were incomplete: Vitest/tsc launchers missing, then css-calc/tslib resolution failed. Restored only ignored dependencies from the existing lockfile via pnpm install --frozen-lockfile --ignore-scripts --offline --force; no dependency manifest/lock change. All affected checks above subsequently passed. +- Source full Main typecheck remains known to have 66 pre-existing diagnostics; no new Main logic was changed during integration, so its recorded baseline evidence is reused. Source independent review passed. Yuxi paired backend matches its reviewed source exactly. + +## Follow-ups + +- No push, installer, app restart, deployment or real provider test. Install an updated client and deploy Yuxi API/worker before online acceptance. Existing malformed history is not rewritten. Source checkout cleanup requires separate user consent. + +## Promotion Candidates + +- Accepted source candidates promoted in integration mode to the teacher ADR, system overview and current-state. No product direction, billing, version or file-permission conflict remains.