From d16cacece7f323803f7b0e6fe4a02918b341fe73 Mon Sep 17 00:00:00 2001 From: brother7 <7brother7@gmail.com> Date: Thu, 20 Aug 2026 14:47:01 +0800 Subject: [PATCH] docs(integration): remove Learning download size checks --- .project-docs/00-brief/success-criteria.md | 4 +- .../adr-005-learning-project-catalog.md | 7 +- .project-docs/10-decisions/decision-index.md | 2 +- .project-docs/20-architecture/data-flow.md | 4 +- .project-docs/20-architecture/module-map.md | 4 +- .../20-architecture/system-overview.md | 4 +- .project-docs/30-worklog/current-state.md | 11 ++- ...260820-integrate-download-size-6e3a91c2.md | 72 ++++++++++++++++ ...820-remove-download-size-check-4f8a2c1d.md | 84 ------------------- .project-docs/40-domain/business-rules.md | 4 +- .project-docs/40-domain/glossary.md | 2 +- .project-docs/50-evidence/evidence-index.md | 1 + .project-docs/80-commitments/commitments.md | 2 +- README.md | 2 +- ...earning-project-catalog-server-contract.md | 8 +- 15 files changed, 105 insertions(+), 106 deletions(-) create mode 100644 .project-docs/30-worklog/tasks/20260820-integrate-download-size-6e3a91c2.md delete mode 100644 .project-docs/30-worklog/tasks/20260820-remove-download-size-check-4f8a2c1d.md diff --git a/.project-docs/00-brief/success-criteria.md b/.project-docs/00-brief/success-criteria.md index 1ffb80c..4df151d 100644 --- a/.project-docs/00-brief/success-criteria.md +++ b/.project-docs/00-brief/success-criteria.md @@ -13,7 +13,7 @@ - Works Project 首次 create 必须用单一 multipart 合同原子提交文字资料与必选的 PNG/JPEG/WebP 封面;创建失败或冲突不得继续上传版本。已有项目保持 version-only;在没有 metadata revision/条件写前,客户端不得通过无条件 PATCH 修改已有资料。 - Learning 必须保持登录和 `module_access.learning` 门禁,并只呈现服务端已发布的分页项目列表、README 详情和下载动作;旧课程生成、进度、本地库、播放器、Agent/ASR/runtime 代码和打包依赖不得继续存在。 - Learning README 必须禁用原始 HTML;远程 HTTPS raster 图片由 Works Square 在发布时校验、镜像并改写为固定媒体路径,Main 以 Bearer 代理并限制可信 MIME 和 10 MiB,Renderer 不获得任意网络代理能力。 -- Learning 项目下载必须由 Main 打开原生保存窗口并在临时文件上校验最多 512 MiB、最多五跳同源重定向、声明大小、SHA-256 和 ZIP 签名,再原子落盘;Renderer 只能获得 `saved` 或 `cancelled`,不得获得 Token、上游 URL 或本地路径。 +- Learning 项目下载必须由 Main 打开原生保存窗口并写入临时文件,不按 `Content-Length`、`archiveBytes`、实际流字节数或客户端上限阻断;最多五跳同源重定向,校验 SHA-256 和 ZIP 签名后再原子落盘。Renderer 只能获得 `saved` 或 `cancelled`,不得获得 Token、上游 URL 或本地路径。 - 历史课程数据不得被新逻辑读取或迁移,也不得在没有独立用户确认与恢复策略时自动删除。 - Robot Guided Hotspot Binding 必须保持固件零改动、Main-owned default-on capability、精确环境值 `0` 回滚、固定系统浏览器 Portal 和现有六位 Binding facade。Windows/macOS 页面内只能扫描开放 `Xiaozhi-*` 短效候选并连接用户明确选择的项;Makelore 不得接触家庭 Wi-Fi 凭据,也不得把热点发现或 Binding 成功等同于可信身份/在线。 - 用户模块入口策略必须由 Electron Main 将 Works `/api/auth/me` 安全投影为四个布尔值;缺失对象/字段默认开启,`design` 映射 `painting`,Renderer 不获得 Token 或原始 profile。 @@ -24,7 +24,7 @@ - 发布安装包前运行 `pnpm verify:publish-runtime`,并对最终 Windows 产物运行 `pnpm verify:artifact:win`;固定 npm 闭包缺失或版本不符时 fail closed。 - 至少覆盖 release builder/静态产物服务/发布路由/Renderer 状态的聚焦测试、typecheck、scoped lint、Vite 构建和真实 Electron 双视口 production-seam E2E。 - 真实生产发布仍需成组验证服务端合同、不可变 Release、运营审核、CDN/App 播放;客户端本地验证不能替代该整链验收。 -- Learning 上线前必须部署 Works Square 项目管理、对象存储、远程图片镜像和 list/detail/media/archive API,并使用真实账号和正式安装包验证发布/下架、分页、README 图片、下载取消、损坏/超限/摘要不匹配 ZIP,以及 Windows 与签名 macOS 保存行为。 +- Learning 上线前必须部署 Works Square 项目管理、对象存储、README HTTPS URL 校验和 list/detail/media/archive API,并使用真实账号和正式安装包验证发布/下架、分页、README 图片、下载取消、缺失或错误 `Content-Length`、损坏/摘要不匹配 ZIP,以及 Windows 与签名 macOS 保存行为。 - Robot 默认引导路径必须通过聚焦 Renderer/Main/native 测试并保留 `NIANCODE_AI_HARDWARE_GUIDED_HOTSPOT_BINDING=0` 回滚。真实 Host API/native seam Electron E2E、Windows Robot 真机、签名 macOS x64/arm64、指定固件镜像与六位码发行契约未完成前,不得宣称完整双平台硬件兼容或端到端配网已经验收。 - 四模块入口策略发布前必须部署 Works migration/API、重新打包客户端,并以真实账号对 Code、Canvas、Learning、Robot 分别执行关闭 smoke;客户端自动化不得代替服务端 API 授权验收。 diff --git a/.project-docs/10-decisions/adr-005-learning-project-catalog.md b/.project-docs/10-decisions/adr-005-learning-project-catalog.md index 782bf46..6548302 100644 --- a/.project-docs/10-decisions/adr-005-learning-project-catalog.md +++ b/.project-docs/10-decisions/adr-005-learning-project-catalog.md @@ -12,9 +12,9 @@ The integrated Learning module previously implemented course generation, an acco - Keep the existing authenticated Learning entry and `module_access.learning` policy. - Replace the old course model completely with a server-driven project list and README detail page; do not retain a compatibility API or local-course read path. -- Works Square operations owns project name, cover, summary, tags, version, ordering, publication state, Markdown, ZIP, immutable size, and SHA-256 metadata. +- Works Square operations owns project name, cover, summary, tags, version, ordering, publication state, Markdown, ZIP, recorded byte count, and SHA-256 metadata. - Publish-time processing removes raw Markdown HTML and validates image references as credential-free, default-port HTTPS URLs whose current DNS answers are public. It preserves those URLs instead of downloading, decoding, transcoding, or mirroring image bytes. The Learning detail Renderer opts only Markdown image nodes into the guarded direct-HTTPS image path; covers and historical release media keep their existing controlled-media handling. -- Electron Main owns Works credentials, the native save dialog, archive request, redirect/origin policy, temporary file, 512 MiB limit, declared size, SHA-256, ZIP signature, and atomic final rename. Renderer receives only bounded project DTOs, media data, and `saved` or `cancelled`. +- Electron Main owns Works credentials, the native save dialog, archive request, redirect/origin policy, temporary file, SHA-256, ZIP signature, and atomic final rename. It does not reject a download because of `Content-Length`, recorded `archiveBytes`, actual streamed byte count, or a client archive-size ceiling. Renderer receives only bounded project DTOs, media data, and `saved` or `cancelled`. - Remove course generation, progress, local library, OpenMAIC player, Agent, ASR, classroom runtime, Learning IPC channels, player packaging resources, and their tests. - Do not automatically delete historical downloaded course data. The new client never reads or migrates it. @@ -23,6 +23,7 @@ The integrated Learning module previously implemented course generation, an acco - The desktop client and package are substantially smaller and no longer depend on a production Stage player artifact. - The external Works Square operations/admin/API contract must be implemented and deployed before the new client can provide real catalog data. - Remote README images depend on the third-party origin and Electron's supported image formats. Each image failure remains local to that image, while availability and requester network information are visible to the image origin. +- Removing client download-size checks avoids rejecting otherwise valid streams with missing or inaccurate size metadata, but also removes client-side protection against an archive consuming excessive disk space. Works Square may retain an independent operations upload/storage limit. - A future historical-data cleanup must be an explicit, user-controlled maintenance feature. ## Supersedes @@ -37,6 +38,8 @@ The integrated Learning module previously implemented course generation, an acco - Integration merge: `d967b0f` - Direct-image server source: `65ea070` - Direct-image client source: `9956739` +- No-size-validation client source: `8509084` +- No-size-validation integration merge: `0c1a360` ## Related diff --git a/.project-docs/10-decisions/decision-index.md b/.project-docs/10-decisions/decision-index.md index 73d0dd2..c768609 100644 --- a/.project-docs/10-decisions/decision-index.md +++ b/.project-docs/10-decisions/decision-index.md @@ -8,7 +8,7 @@ | ADR-002 | Robot V1 采用 Main 门控的引导式热点配网并衔接现有六位 Binding | Accepted / implemented, default on | 2026-08-16 | Robot Renderer、Host API、Electron Main、现有固件热点入口 | `adr-002-robot-guided-hotspot-binding-v1.md` | | ADR-003 | Robot 配网页内扫描并连接 Windows/macOS 热点 | Accepted / implemented with physical release gates pending | 2026-08-16 | Robot Renderer、Host API、Electron Main、Windows WLAN、macOS CoreWLAN/CoreLocation | `adr-003-robot-in-app-hotspot-connection.md` | | ADR-004 | Works Square 统一拥有桌面认证生命周期边界 | Accepted / implemented | 2026-08-19 | Renderer、Host API、Electron Main、Works Square auth facade | `adr-004-square-auth-lifecycle-boundary.md` | -| ADR-005 | Learning 采用运营精选项目目录、直接渲染经校验的 HTTPS README 图片并退役课程运行时 | Accepted / implemented, amended 2026-08-20 | 2026-08-20 | Learning Renderer、Host API、Electron Main、Works Square operations/API | `adr-005-learning-project-catalog.md` | +| ADR-005 | Learning 采用运营精选项目目录、直接渲染经校验的 HTTPS README 图片、下载不做大小校验并退役课程运行时 | Accepted / implemented, amended 2026-08-20 | 2026-08-20 | Learning Renderer、Host API、Electron Main、Works Square operations/API | `adr-005-learning-project-catalog.md` | ## Superseded Decisions diff --git a/.project-docs/20-architecture/data-flow.md b/.project-docs/20-architecture/data-flow.md index eeb157d..c0b9577 100644 --- a/.project-docs/20-architecture/data-flow.md +++ b/.project-docs/20-architecture/data-flow.md @@ -26,7 +26,7 @@ | 设计项目删除 | Canvas 侧栏精确项目名确认 | Renderer → Main Host API → Works Square Workspace DELETE | 删除成功后清理当前 Workspace/Conversation/task stream 并选择最近更新的剩余项目;结算与软删除语义由服务端负责 | | Prompt Museum 浏览与使用 | Canvas 侧栏“获取灵感” | Renderer → Main Host API → Works Square list/detail;选中 Prompt → 进程内 pending state → 当前 Canvas 输入框 | 只发送白名单筛选/游标;Works Token 留在 Main,Prompt 不自动发送,Museum 不包含客户端静态数据集 | | Learning 项目浏览 | Learning 项目列表 / README 详情 | Renderer → typed Host API → Main fixed list/detail routes → Works Square published projects;README 图片节点 → 远程 HTTPS origin | 保留登录与 `module_access.learning`;Main 严格投影分页项目 DTO,README 禁用原始 HTML,仅图片节点可直连无凭据 HTTPS URL;封面和历史媒体仍使用受控媒体读取 | -| Learning 项目下载 | README 详情页“下载项目” | Renderer → Host API → Main 原生保存对话框 → Works archive stream → 临时文件 → 原子重命名 | 最大 512 MiB;最多五跳同 Works origin 重定向,重定向请求不携带 Bearer;实际字节、声明大小、SHA-256 与 ZIP 签名均匹配后才保存,Renderer 只得到 `saved` 或 `cancelled` | +| Learning 项目下载 | README 详情页“下载项目” | Renderer → Host API → Main 原生保存对话框 → Works archive stream → 临时文件 → 原子重命名 | 不校验 `Content-Length`、`archiveBytes`、实际流字节数或客户端大小上限;最多五跳同 Works origin 重定向且不向重定向请求携带 Bearer;SHA-256 与 ZIP 签名匹配后才保存,Renderer 只得到 `saved` 或 `cancelled` | | Robot 引导式热点配网 V1(已实现、默认开启) | Robot Binding 页面 | 用户选择引导配网 → 进入固件配网模式 → Renderer 经 Host API 请求 Main 扫描 → 用户选择短效候选 → Windows/macOS Adapter 连接并核验当前 SSID → Main 打开固定 Portal → 用户在 Portal 配置 Wi-Fi → 电脑恢复互联网 → 现有六位 Binding | 精确环境值 `0` 或 capability 读取失败回退直接六位码;系统 Wi-Fi 保留兜底,Makelore 不收集 Wi-Fi 密码、不修改固件,热点发现/`bound` 都不等于可信身份或 online/ready | ## State Ownership @@ -63,7 +63,7 @@ - 服务端安全投影后的公共 `play_url`;只接受同源 HTTPS、精确 App 路径和可信版本状态。 - Works Square Workspace/Conversation API、每个 Conversation 的持久 Agent Gateway Session、单次 WebSocket ticket、双向命令/事件帧与幂等 REST 传输回退。 - Works Square Prompt Museum list/detail API;Main 添加当前账号 Bearer Token,Renderer 只使用 Host API 投影。 -- Works Square Learning project list/detail/media/archive API;Main 添加当前账号 Bearer Token,并限制固定路径、DTO、封面/历史媒体 MIME/大小、归档重定向、字节数和摘要。README 中经服务端校验的无凭据 HTTPS 图片由 Renderer 图片节点直接请求。 +- Works Square Learning project list/detail/media/archive API;Main 添加当前账号 Bearer Token,并限制固定路径、DTO、封面/历史媒体 MIME/大小、归档重定向、摘要和 ZIP 签名;归档大小字段只作展示,不参与下载门禁。README 中经服务端校验的无凭据 HTTPS 图片由 Renderer 图片节点直接请求。 - 已实现的本机 Robot provisioning capability、固定 portal-open 与 hotspot scan/connect Host API。它们是本地 Main 操作,不读取 Works access token、不调用上游,也不接受任意 URL/SSID/BSSID/interface/profile。 ## Last Updated diff --git a/.project-docs/20-architecture/module-map.md b/.project-docs/20-architecture/module-map.md index f5a664a..fc7da21 100644 --- a/.project-docs/20-architecture/module-map.md +++ b/.project-docs/20-architecture/module-map.md @@ -36,7 +36,7 @@ | `electron/api/routes/image-prompt-museum.ts` | Main-owned Museum 列表/详情代理与 Works 登录态 | 仅 GET 固定路径和白名单查询;Renderer 不获得 Bearer Token | | `src/pages/ImagePromptMuseum/index.tsx` / `src/lib/image-prompt-museum.ts` / `src/stores/image-prompt-museum.ts` | Museum 搜索/筛选/详情与一次性 Prompt 回填 | 原 Prompt 只带回 Canvas 输入框,不自动发送;页面不接受投稿或互动 | | `shared/learning.ts` / `src/lib/learning.ts` | Learning 项目列表、详情、媒体和下载结果的共享 DTO/Renderer facade | 项目 API 访问走固定 Host API;Renderer 不持有 Token、任意归档 URL 或本地路径,README 仅接受无凭据 HTTPS 图片 URL | -| `electron/api/routes/learning.ts` / `electron/services/learning-project-download.ts` | Main-owned Learning 项目代理、封面/历史媒体读取和原生 ZIP 保存 | 固定 Works 路径、严格 DTO/MIME/大小边界、最多五跳同源重定向、SHA-256/ZIP 签名校验和原子重命名 | +| `electron/api/routes/learning.ts` / `electron/services/learning-project-download.ts` | Main-owned Learning 项目代理、封面/历史媒体读取和原生 ZIP 保存 | 固定 Works 路径、严格 DTO 与媒体 MIME/大小边界、最多五跳同源重定向、SHA-256/ZIP 签名校验和原子重命名;归档不做大小校验 | | `src/pages/Learning/` / `src/components/layout/LearningSidebar.tsx` | 分页项目卡片、README 详情和下载入口 | 保留登录与 `module_access.learning`;README 禁用原始 HTML,仅图片节点直连无凭据 HTTPS URL,旧生成/播放器入口不存在 | | `src/pages/AiHardware/index.tsx` | Robot 管理、现有六位 Binding,以及已实现的 default-on 引导式热点配网状态机 | 只编排非敏感步骤;不接收 Wi-Fi 密码,不把 `bound` 展示为在线证明 | | `src/lib/ai-hardware.ts` | Renderer 侧 Robot Host API 类型、安全错误映射和稳定 Binding/hotspot facade | 读取 Main-owned capability,调用固定 portal-open,并只传递短效 hotspot candidate ID;不添加任意 URL、SSID 或 Renderer IPC | @@ -71,7 +71,7 @@ - 多 Conversation 事件处理必须区分对话快照与 Workspace 任务更新;不得用任务时间戳推进 Conversation 流水位,也不得让旧会话的迟到流覆盖当前会话。 - Quote 编辑、重报价、确认和项目删除都跨 Renderer/Main/Works Square。异步结果必须核对当前 Workspace + Conversation;删除当前项目时必须先使旧选择和事件流失效,再加载剩余 Workspace。 - Prompt Museum 图片和来源 URL 来自服务端数据。服务端必须完成内容授权/署名审核;若未来需要凭据化素材,应新增 Main-owned 媒体代理,不能把对象存储凭据放进 Renderer URL。 -- Learning 的远端 JSON、Markdown、媒体、错误和 ZIP 下载跨信任边界;必须保持严格 DTO、固定项目/封面/历史媒体路径、可信 raster MIME、媒体/README/归档大小、同源重定向、声明字节数、SHA-256、ZIP 签名、一次 401 refresh 和固定安全错误。README 仅允许图片节点直连经服务端校验的无凭据 HTTPS URL,不能扩展为任意 Works 下载或文件系统代理。 +- Learning 的远端 JSON、Markdown、媒体、错误和 ZIP 下载跨信任边界;必须保持严格 DTO、固定项目/封面/历史媒体路径、可信 raster MIME、媒体/README 大小、同源重定向、SHA-256、ZIP 签名、一次 401 refresh 和固定安全错误。ZIP 下载明确不校验 `Content-Length`、`archiveBytes`、实际流字节数或客户端大小上限。README 仅允许图片节点直连经服务端校验的无凭据 HTTPS URL,不能扩展为任意 Works 下载或文件系统代理。 - Gateway 命令的 REST fallback 只处理 WebSocket 发送、断连和 ACK 超时,必须复用 `client_command_id`;业务错误回退会造成重复提交。Quote 任务恢复只更新 Workspace 所有的任务,不能覆盖当前 Conversation。 - `closeEventSessions` 只负责本地流和缓存生命周期;远端 Conversation Session 是服务端持久资源。 - 单图来源选择器当前仍由精确中文 quick reply 触发,并以 Brief medium 判断图生图或视频首帧用途;扩展更多输入用途前应先把消息协议升级为结构化 action/purpose,避免展示文案与行为继续耦合。 diff --git a/.project-docs/20-architecture/system-overview.md b/.project-docs/20-architecture/system-overview.md index 31cd2bb..b2e479c 100644 --- a/.project-docs/20-architecture/system-overview.md +++ b/.project-docs/20-architecture/system-overview.md @@ -25,7 +25,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 | AI Design Quote & Task Controls | 当前 Conversation Quote 与 Workspace 任务 | 最终 Prompt/generation options 每次修改由服务端重新计价;任务结果在详情中预览并经 Main-owned asset download 保存 | | Prompt Museum | Canvas “获取灵感”页面 → Main Host API → Works Square | 服务端驱动的审核内容、筛选和分页;Renderer 不持有 Works Token 或内置数据集,“使用此 Prompt”只回填输入框 | | Learning Project Catalog | 服务端分页项目卡片、README 详情与用户选择的 ZIP 下载 | Renderer 只持有安全项目 DTO 和 Markdown;不提供生成、进度、本地课程库或播放器 | -| Learning Main Boundary | 固定 Host API → Works Square project list/detail/media/archive | Main 持有 Works Bearer、封面/历史媒体代理、原生保存路径、受控重定向、临时文件、大小/SHA-256/ZIP 签名校验与原子落盘;README 图片节点可直接加载无凭据 HTTPS URL,Renderer 不获得任意归档 URL 或本地路径 | +| Learning Main Boundary | 固定 Host API → Works Square project list/detail/media/archive | Main 持有 Works Bearer、封面/历史媒体代理、原生保存路径、受控重定向、临时文件、SHA-256/ZIP 签名校验与原子落盘;归档下载不执行大小校验,README 图片节点可直接加载无凭据 HTTPS URL,Renderer 不获得任意归档 URL 或本地路径 | | Robot Workspace | Account-scoped agent configuration, device activation/binding, assignment, and credential-recovery UI | Renderer receives only safe Works Square projections. Configuration choices come from the USER-scoped safe catalog; unavailable current values remain editable without exposing provider credentials or configuration internals. | | AI Hardware Main Route | Fixed `/api/works/ai-hardware` Host API to Works Square proxy | Main owns Bearer auth, stable operation IDs, bounded retry, ETag/If-Match, request/response limits, error redaction, and the fixed no-store configuration-catalog proxy. Versioned responses accept only canonical strong or weak numeric ETags that equal the DTO revision; mutations always emit strong `If-Match`. It never forwards Renderer authorization headers. | @@ -41,7 +41,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 - Product UI language is Chinese-only. Unsupported system or persisted language values normalize to `zh`; removed locale files are not runtime fallbacks. - Packaged Canvas remains cloud-only with no local fallback. `pnpm run dev` now uses the cloud adapter; the local Workspace adapter requires the explicit development command and remains unpackaged-only. - Prompt Museum is a read-only curated inspiration surface, not a user-content community. Main owns Works authentication and forwards only the bounded list/detail routes; the client never bundles museum content or automatically submits a selected Prompt. -- Learning uses a Main-owned read-only project-catalog boundary. Renderer does not receive Works credentials, object-storage identifiers, arbitrary archive URLs, temporary/final paths, or an arbitrary network proxy. README raw HTML is disabled; Markdown image nodes alone may load validated credential-free HTTPS URLs directly, including SVG and other formats Electron supports. Main continues to validate covers/historical media and streams a selected project ZIP through bounded same-origin redirects, declared size, SHA-256, ZIP signature, and atomic rename before returning only `saved` or `cancelled`. +- Learning uses a Main-owned read-only project-catalog boundary. Renderer does not receive Works credentials, object-storage identifiers, arbitrary archive URLs, temporary/final paths, or an arbitrary network proxy. README raw HTML is disabled; Markdown image nodes alone may load validated credential-free HTTPS URLs directly, including SVG and other formats Electron supports. Main continues to validate covers/historical media and streams a selected project ZIP through bounded same-origin redirects, SHA-256, ZIP signature, and atomic rename before returning only `saved` or `cancelled`; it ignores archive size metadata and applies no client download-size ceiling. - AI hardware network access is Main-owned. Renderer cannot hold Works Square or Xiaozhi credentials and cannot select arbitrary upstream paths or headers. - Robot model, language, and voice choices are dynamically projected from the Xiaozhi USER catalog through Works Square and Electron Main; the catalog is bounded, account-scoped, and `private, no-store` at each public hop. - One local account maps to one server-side Xiaozhi account binding. Agents and devices are resources beneath that account binding, not separate Xiaozhi users. diff --git a/.project-docs/30-worklog/current-state.md b/.project-docs/30-worklog/current-state.md index 3492f7f..9654183 100644 --- a/.project-docs/30-worklog/current-state.md +++ b/.project-docs/30-worklog/current-state.md @@ -4,6 +4,13 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Integrated Through +- Learning archive size-validation source commit `8509084` from feature task + `20260820-remove-download-size-check-4f8a2c1d` is integrated by task + `20260820-integrate-download-size-6e3a91c2` through merge `0c1a360`. + Electron Main no longer rejects a project ZIP because `Content-Length`, + `archiveBytes`, actual streamed bytes, or the former 512 MiB ceiling differ; + same-origin redirects, SHA-256, ZIP signature, temporary-file cleanup, and + atomic save remain enforced. - Direct Learning README-image source commit `9956739` from feature task `20260820-direct-readme-client-a4d8e2c7` is integrated by task `20260820-integrate-direct-readme-client-b7e41c9d`. README Markdown image nodes now @@ -88,7 +95,7 @@ Canvas 侧栏提供“获取灵感”进入 Prompt Museum。列表、筛选、 Makelore 在会话恢复、登录和刷新后由 Electron Main 请求 Works `/api/auth/me`,Renderer 只获得 Code、Canvas、Learning、Robot 四个布尔权限。缺失 `module_access` 或任一字段时默认开启;服务端 `design` 显式映射客户端 `painting`。被关闭的模块卡片置灰且不可点击,根路由、深层路由和别名路由均在 `MainLayout` 或模块初始化前阻断。Code provider 等待认证权限加载完成;权限查询返回终止性 `401` 时同时清理 Main 和 Renderer 会话。`/settings` 是全局设置,不受 Code 入口策略阻断。该机制只是客户端入口策略,不代替服务端 API 授权。 -AI 学习现在是已启用的运营精选项目目录,并继续受登录和 `module_access.learning` 控制。Renderer 通过 Main-owned Host API 获取分页项目卡片和 README 详情;Markdown 支持 GFM、禁用原始 HTML。服务端发布时只校验图片 URL 为无凭据、默认端口、无 fragment 且当前 DNS 结果全部为公网地址的 HTTPS URL,保留地址而不下载、识别格式、转码或镜像;客户端仅为 README 图片节点启用直连,因此 SVG 和 Electron 支持的其他格式可直接显示,单图失败不阻断详情。封面和历史发布媒体继续走受控路径。详情页的下载按钮打开系统保存对话框;Main 将最大 512 MiB 的 ZIP 流式写入临时文件,只允许最多五跳同 Works origin 重定向,校验声明字节数、SHA-256 和 ZIP 签名后原子保存,Renderer 只接收 `saved` 或 `cancelled`。课程生成、进度、本地课程库、OpenMAIC player、Agent、ASR、课堂 runtime、Learning IPC 和 player artifact 打包已删除且没有兼容读取路径;历史课程数据保留但不再读取。服务端和客户端源码契约已完成,不代表生产部署或真实账号安装包联调已经完成。 +AI 学习现在是已启用的运营精选项目目录,并继续受登录和 `module_access.learning` 控制。Renderer 通过 Main-owned Host API 获取分页项目卡片和 README 详情;Markdown 支持 GFM、禁用原始 HTML。服务端发布时只校验图片 URL 为无凭据、默认端口、无 fragment 且当前 DNS 结果全部为公网地址的 HTTPS URL,保留地址而不下载、识别格式、转码或镜像;客户端仅为 README 图片节点启用直连,因此 SVG 和 Electron 支持的其他格式可直接显示,单图失败不阻断详情。封面和历史发布媒体继续走受控路径。详情页的下载按钮打开系统保存对话框;Main 将 ZIP 流式写入临时文件,只允许最多五跳同 Works origin 重定向,不校验 `Content-Length`、`archiveBytes`、实际流字节数或客户端大小上限,校验 SHA-256 和 ZIP 签名后原子保存,Renderer 只接收 `saved` 或 `cancelled`。课程生成、进度、本地课程库、OpenMAIC player、Agent、ASR、课堂 runtime、Learning IPC 和 player artifact 打包已删除且没有兼容读取路径;历史课程数据保留但不再读取。服务端和客户端源码契约已完成,不代表生产部署或真实账号安装包联调已经完成。 AI 编程首次发送在新建 OpenCode session 已知为空时不再等待冗余历史读取,prompt 可直接进入 Host API;普通历史会话仍刷新消息。每个 Session 独立持有 run、loading、error 与内部队列;一个 Session 的回复或终止不会锁住、改写或重放另一个 Session。Host 接受或用户消息落库不算启动确认,只有明确 busy/retry、assistant、question、permission 或 typed terminal event 才确认/终结启动;独立的 10 秒 watchdog 到期时仅以 `SESSION_START_UNCONFIRMED` 终止该 Session。Main 以 runtime generation provenance、Agent 内容 fingerprint 和 live registry id 共同验证项目 Agent,provider/runtime 或 Agent 未应用时在执行前返回 typed `409` 且 `promptSent:false`。普通 message、command、summarize 和后台 provider sync 不自动重启、reload 或 dispose 共享 runtime;只有显式用户 apply/lifecycle 操作可以推进运行时刷新。Main AI proxy 只把明确的上游分组饱和投影为当前 OpenCode 的终止状态,配额耗尽保持独立终止态,通用限速继续保留 `429`。上下文压缩以每个 Session 的持久时间线事件呈现:自动与手动压缩使用不同文案,运行态原位弱化显示,完成后静态保留并可从历史恢复;`session.compacted` 只完成对应事件,只有真实 idle 才结束 run 和释放排队消息。 @@ -146,7 +153,7 @@ Robot 绑定设备默认先显示“引导配网 / 已有激活码”路径选 - 四模块权限只控制 Makelore 客户端入口和初始化,不是 API 授权边界。不得因卡片置灰或路由阻断而放宽 Works/模块服务端的身份与权限校验;旧服务端缺少对象/字段时默认开启是显式兼容策略。 - Prompt Museum 相对媒体必须保持固定的服务端路径并由 Main 处理;如果服务端增加媒体变体,需同步维护 entry/path 语法、Works Bearer 所有权、单次刷新、10 MiB 限制、可信 raster MIME 白名单与 Renderer data URL 校验。HTTPS 直连媒体必须继续无凭据,图片失败必须局限在卡片/详情视图。 -- Learning 项目目录依赖真实 Works 运营发布和固定 API 契约;README 图片只允许服务端校验后的无凭据 HTTPS URL,并由 Markdown 图片节点直接加载,不得扩展为任意网络或归档代理。第三方 origin 的可用性、格式支持和请求隐私是已接受边界。Main 必须保持 Bearer 所有权、封面/历史媒体受控读取、一次 401 refresh、同源最多五跳、512 MiB ZIP、声明大小/SHA-256/ZIP 签名和原子保存;不得把上游错误、Token、对象存储 URL 或本地路径投影到 Renderer。历史课程数据不再读取但也不得被隐式删除。 +- Learning 项目目录依赖真实 Works 运营发布和固定 API 契约;README 图片只允许服务端校验后的无凭据 HTTPS URL,并由 Markdown 图片节点直接加载,不得扩展为任意网络或归档代理。第三方 origin 的可用性、格式支持和请求隐私是已接受边界。Main 必须保持 Bearer 所有权、封面/历史媒体受控读取、一次 401 refresh、同源最多五跳、SHA-256/ZIP 签名和原子保存;客户端下载明确不执行大小门禁,不得把上游错误、Token、对象存储 URL 或本地路径投影到 Renderer。历史课程数据不再读取但也不得被隐式删除。 - Works Project 首次封面已由服务端源 `407c883`(本地 merge `0cedfc4`)提供单请求原子绑定与失败补偿,客户端源 `145a6ce` 因此要求首次发布上传 PNG/JPEG/WebP 封面;部署、安装包和真实账号/对象存储 smoke 仍未完成。服务端仍没有已有 metadata 的 revision/ETag 与 draft-only 条件写,因此已有 draft/published 继续只允许 version-only,客户端不得以无条件 PATCH 替代。 - Guided Hotspot Binding 默认开启并提供未经认证的热点扫描/显式连接,但当前 Hotspot/portal 仍是开放 SoftAP + 明文 HTTP,且精确出货镜像、激活码发行契约、签名 macOS、Windows 真机与完整整链尚未验证。界面必须保留环境警告,异常发布可用精确环境值 `0` 回滚;不得把 SSID 前缀宣称为可信设备发现、自动认领或在线证明。 - 一键提交已成功但本机 submission binding 落盘失败时必须保持提交成功、显示固定 `binding_warning` 并继续轮询,避免用户误判上传失败。 diff --git a/.project-docs/30-worklog/tasks/20260820-integrate-download-size-6e3a91c2.md b/.project-docs/30-worklog/tasks/20260820-integrate-download-size-6e3a91c2.md new file mode 100644 index 0000000..8e74b1d --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260820-integrate-download-size-6e3a91c2.md @@ -0,0 +1,72 @@ +# Task: Integrate Learning download size removal + +## Identity + +- Task ID: 20260820-integrate-download-size-6e3a91c2 +- Mode: Integration +- Branch: codex/20260820-integrate-download-size-6e3a91c2-integrate-download-size +- Worktree: D:\Datas\OthersProjects\makelore-integrate-download-size-6e3a91c2 +- Base commit: 2168e291b2bf8ac8690c482f56400554a8d77531 +- Owner: codex +- Status: Ready for Integration + +## Scope + +- Merge verified source commit `8509084` into the integration branch. +- Promote the accepted Learning download behavior into ADR-005, architecture, + domain rules, success criteria, README, server contract, current state, + evidence, and the pending production-smoke commitment. +- Advance local `main` without overwriting its pre-existing untracked task + record. + +## Intent And Constraints + +- Follow the user's explicit decision that project downloads must not perform + archive-size validation. +- Preserve Main ownership of authentication, fixed archive routes, same-origin + redirects, native destination selection, SHA-256, ZIP signature, temporary + files, cleanup, and atomic rename. +- Keep the Works Square upload/storage size policy distinct from client download + behavior: the service may retain an independent operations upload limit, but + Makelore does not enforce it while downloading. +- Do not modify, add, remove, or adopt the unrelated untracked record already in + the canonical `main` worktree. + +## Outcome + +- Merged source commit `8509084` through integration merge `0c1a360`. +- Promoted the no-size-validation behavior into ADR-005, the decision index, + system overview, module map, data flow, domain rules, glossary, success + criteria, current state, evidence index, README, server collaboration + contract, and Learning production-smoke commitment. +- Kept the optional 512 MiB rule only as an independent Works Square operations + upload/storage policy; Makelore does not enforce it during download. +- Preserved SHA-256, ZIP signature, same-origin redirects, account binding, + temporary-file cleanup, and atomic save. + +## Verification + +- Pinned pnpm 10.33.4 frozen install: passed. +- Focused Learning tests: `2` files, `17 passed`. +- Full unit suite: first run had one unrelated Robot async-loading test failure; + that test passed immediately in isolation, and the complete rerun passed + `176` files / `2061` tests. +- `pnpm run typecheck`: passed. +- `pnpm run lint:check`: passed with zero errors and six pre-existing warnings. +- `pnpm run build:vite`: passed for Renderer, Main, Preload, and utility worker; + existing dynamic-import and chunk-size advisories only. +- Canonical size-rule scan and `git diff --check`: passed. +- Independent sub-agent review was not run because the user explicitly required + that no sub-agents be created; final integration review stayed in the primary + task. + +## Follow-ups + +- Package and smoke the merged client with a real archive response that omits or + misreports `Content-Length`. +- Monitor disk-space behavior for very large archives because the client now has + no archive-size ceiling by explicit product decision. + +## Promotion Candidates + +- None; accepted source-task candidates were promoted in this Integration Gate. diff --git a/.project-docs/30-worklog/tasks/20260820-remove-download-size-check-4f8a2c1d.md b/.project-docs/30-worklog/tasks/20260820-remove-download-size-check-4f8a2c1d.md deleted file mode 100644 index bba5773..0000000 --- a/.project-docs/30-worklog/tasks/20260820-remove-download-size-check-4f8a2c1d.md +++ /dev/null @@ -1,84 +0,0 @@ -# Task: Remove Learning archive size validation - -## Identity - -- Task ID: 20260820-remove-download-size-check-4f8a2c1d -- Mode: Feature -- Branch: codex/20260820-remove-download-size-check-4f8a2c1d-remove-download-size-check -- Worktree: D:\Datas\OthersProjects\makelore-remove-download-size-check-4f8a2c1d -- Base commit: 2168e291b2bf8ac8690c482f56400554a8d77531 -- Owner: codex -- Status: Ready for Integration - -## Scope - -- Remove Learning project ZIP download checks that reject a response because of - an archive byte limit, declared archive size, or `Content-Length` mismatch. -- Keep the existing authenticated Main-owned download route, controlled - same-origin redirects, SHA-256 verification, ZIP signature validation, - temporary-file cleanup, and atomic final rename. -- Add focused regression coverage proving a valid archive downloads even when - its reported sizes are absent, inconsistent, or above the former limit. - -## Intent And Constraints - -- Follow the user's explicit direction to download without any size validation. -- Do not expose Works credentials, upstream archive URLs, temporary paths, or - final local paths to Renderer. -- Do not weaken digest or ZIP-format integrity checks; those are independent of - archive size validation. -- Limit production changes to the existing Electron Main Learning download - service and focused tests. -- This is a feature task, so canonical project memory remains unchanged until a - later Integration Gate. - -## Outcome - -- Electron Main no longer reads or compares archive `Content-Length`, project - `archiveBytes`, actual streamed bytes, or the former 512 MiB ceiling when - saving a Learning project. -- Learning project DTO projection accepts positive safe-integer archive sizes - above the former client limit so those projects can reach the download flow. -- SHA-256, ZIP signature, MIME, account-binding, redirect/origin, temporary-file - cleanup, and atomic rename checks remain unchanged. -- Added regressions for omitted `Content-Length`, inconsistent reported sizes, - and metadata above the former limit. - -## Verification - -- Red phase: the two new size-removal regressions failed against the old - implementation with `LEARNING_PROJECT_INVALID` and - `LEARNING_INVALID_RESPONSE`. -- Focused Learning tests: `2` files, `17 passed`. -- Full unit suite via pinned pnpm 10.33.4: `176` files, `2061 passed`. -- `pnpm run typecheck`: passed. -- `pnpm run lint:check`: passed with zero errors and six pre-existing warnings. -- `pnpm run build:vite`: passed; existing dynamic-import and chunk-size - advisories only. -- `git diff --check`: passed. -- Independent sub-agent review was not run because the user explicitly required - that no sub-agents be created; final review was performed in the primary task. - -## Follow-ups - -- Integrate the source commit into `main`. -- During Integration Gate, reconcile all canonical documentation and remove the - obsolete size-failure smoke cases listed in the promotion candidate below. - -## Promotion Candidates - -- Target: ADR-005, Learning system overview/domain/current state, `README.md`, - `docs/learning-project-catalog-server-contract.md`, success criteria, and the - Learning release commitment. - - Proposal: remove the client download byte ceiling and all declared/ - transport size consistency requirements while retaining same-origin - redirects, SHA-256, ZIP signature, temporary-file cleanup, and atomic save. - - Evidence: explicit user direction and focused download regressions from - this task. - - Future impact: the desktop client may consume disk space according to the - upstream archive size; server-side publication/storage policy may still set - independent upload limits, but they are not enforced during client download. - - Semantic conflicts: supersedes the 512 MiB and declared-size requirements - in accepted ADR-005 and its derivative documentation and smoke checklist. - - Human confirmation required: no; the user explicitly requested removal of - download size validation. diff --git a/.project-docs/40-domain/business-rules.md b/.project-docs/40-domain/business-rules.md index e94df05..1025caa 100644 --- a/.project-docs/40-domain/business-rules.md +++ b/.project-docs/40-domain/business-rules.md @@ -42,7 +42,7 @@ - Learning 是登录必需且受 `module_access.learning` 控制的运营精选项目目录。客户端只提供项目列表、README 详情和用户触发的 ZIP 下载,不提供课程生成、进度、本地课程库、OpenMAIC 播放、Agent、ASR 或课堂 runtime,也不保留旧 API/数据兼容读取路径。 - Works Square 运营后台拥有项目名称、摘要、封面、标签、版本、排序、状态、Markdown、ZIP、声明字节数和 SHA-256。只有冻结了元数据、媒体和归档校验结果的 `published` 项目可被客户端列表或详情读取;客户端不提供上传、编辑或发布入口。 - README 使用安全 Markdown/GFM 并禁用原始 HTML。运营发布时必须解析 Markdown,只保留无凭据、默认端口、无 fragment 且当前 DNS 全部指向公网地址的 HTTPS 图片 URL;不得下载、识别格式、转码或镜像 README 图片。客户端仅允许 Markdown 图片节点直连这些 URL,支持范围和可用性由 Electron 与远程 origin 决定;封面和历史发布媒体继续走受控媒体路径。 -- 项目 ZIP 最大 512 MiB。Main 打开原生保存对话框,将下载流写入临时文件,只允许无 userinfo、最多五跳且保持 Works origin 的重定向,重定向请求不携带 Bearer;实际字节数、声明大小、SHA-256 与 ZIP 签名全部匹配后才原子重命名。Renderer 不得获得 Works Token、对象存储地址、任意下载 URL、临时路径或最终本地路径。 +- Main 打开原生保存对话框,将项目 ZIP 下载流写入临时文件,只允许无 userinfo、最多五跳且保持 Works origin 的重定向,重定向请求不携带 Bearer;客户端下载不校验 `Content-Length`、`archiveBytes`、实际流字节数或大小上限,只在 SHA-256 与 ZIP 签名匹配后原子重命名。Works Square 可保留独立的运营上传/存储限制。Renderer 不得获得 Works Token、对象存储地址、任意下载 URL、临时路径或最终本地路径。 - 新客户端不读取、迁移或展示历史下载课程,但也不自动删除用户现有课程数据。任何清理功能必须另行设计为用户明确控制的可恢复维护动作。 - `game-engine` 不再是内置 OpenCode Skill。`planning-with-files` 在复杂任务中把 `task_plan.md`、`findings.md`、`progress.md` 写到当前项目根目录;不得写入 Skill 安装目录或用户目录。 - Robot V1 在现有 Binding 体验内扫描符合条件的开放 `Xiaozhi-*` 配网热点,并只连接用户明确选择的短效候选;该便利信号不得宣称为可信设备发现、自动下发家庭 Wi-Fi、自动认领或自动确认在线。 @@ -68,7 +68,7 @@ - AI Canvas 请求冻结修复仍需在安装包内用真实账号重复 Quote PATCH、重试报价和继续调整:确认超时在 30 秒内释放 UI、并行请求可继续、服务端没有隐式重复 mutation。临时 `disable-http2` 不构成根因结论;修复确认后应恢复 HTTP/2 做对照 smoke,再决定正式协议策略。 - Robot Guided Hotspot Binding default-on 发布仍需确认指定硬件/固件确实提供被审计的开放 Hotspot/Portal、部署端签发严格六位 ASCII 数字码且与 Works validator 的时效/消费语义一致,并完成 Windows 真机、签名 macOS x64/arm64 native worker/association 与真实设备端到端 smoke。 - Prompt Museum 客户端契约和页面完成不等于 Works Square 内容后台、审核数据或 CDN 已部署;上线前需以真实登录账号验证列表、详情、署名链接、分页、图片和 Prompt 回填。 -- Learning 客户端集成不等于 Works Square 运营后台、对象存储或项目 API 已部署;上线前需先部署服务端合同,再以真实账号验证发布/下架、分页、远程 HTTPS README 图片(含 SVG 与失败隔离)、保存取消、ZIP 大小/摘要/签名错误以及 Windows/签名 macOS 安装包。 +- Learning 客户端集成不等于 Works Square 运营后台、对象存储或项目 API 已部署;上线前需先部署服务端合同,再以真实账号验证发布/下架、分页、远程 HTTPS README 图片(含 SVG 与失败隔离)、保存取消、缺失或错误 `Content-Length` 的 ZIP、摘要/签名错误以及 Windows/签名 macOS 安装包。 - 四模块入口策略上线前需确认 Works `module_access` migration/API 已部署,安装包包含对应客户端,并用真实账号逐一关闭四个模块验证卡片、根/深层/别名路由和独立 API 授权。 ## Last Reviewed diff --git a/.project-docs/40-domain/glossary.md b/.project-docs/40-domain/glossary.md index 679b0db..5075c50 100644 --- a/.project-docs/40-domain/glossary.md +++ b/.project-docs/40-domain/glossary.md @@ -22,7 +22,7 @@ | Learning Project | Works Square 运营发布、供用户阅读 README 并下载源码/素材 ZIP 的精选学习项目 | 客户端只读;不是课程、生成任务或本地播放器实体 | | Published Learning Project | 在一个发布代际中冻结名称、封面、Markdown、镜像媒体、ZIP 字节数和 SHA-256 的公开项目快照 | 只有 `published` 状态进入客户端列表/详情;下架后不可见,审计记录保留 | | Learning Project Media | README 远程 HTTPS raster 图片经服务端校验、镜像后生成的固定项目媒体资源 | 客户端只接受固定 `/api/learning/projects/:projectId/media/:mediaId` 路径;Main 验证可信 MIME 和 10 MiB 上限 | -| Learning Project Archive | 用户在详情页明确选择保存的项目 ZIP | Main 负责原生保存窗口、受控下载、512 MiB、声明大小、SHA-256、ZIP 签名和原子重命名;不在客户端形成课程库 | +| Learning Project Archive | 用户在详情页明确选择保存的项目 ZIP | Main 负责原生保存窗口、受控下载、SHA-256、ZIP 签名和原子重命名;不按大小字段或客户端上限阻断,也不在客户端形成课程库 | | Robot Provisioning | 让 Robot 获得目标 Wi-Fi 凭据并尝试联网的阶段 | 与云端 Activation、账号 Binding、协议在线是不同阶段;V1 由现有固件 Hotspot portal 完成 | | Robot Activation | Robot 联网后向既有服务获取六位激活码的阶段 | 激活码由设备展示/播报给用户;Makelore 不生成该码 | | Robot Binding | 用户把六位激活码和 Agent 提交到 Works Square,建立账号侧设备关系 | `bound` 不等于设备当前 online 或 protocol-ready | diff --git a/.project-docs/50-evidence/evidence-index.md b/.project-docs/50-evidence/evidence-index.md index aa8032b..a3ebacf 100644 --- a/.project-docs/50-evidence/evidence-index.md +++ b/.project-docs/50-evidence/evidence-index.md @@ -4,6 +4,7 @@ Use this index for searchable, traceable evidence records. | Date | Topic | Status | Source | Detail | |---|---|---|---|---| +| 2026-08-20 | Learning 项目下载移除大小校验 | 客户端实现与自动化验证通过;真实账号安装包 smoke 待验收 | 源任务 `20260820-remove-download-size-check-4f8a2c1d`、源提交 `8509084`、集成任务 `20260820-integrate-download-size-6e3a91c2` | 聚焦 Learning 2 files / 17 tests、176 files / 2061 full unit、typecheck、lint(0 errors / 6 existing warnings)及 Renderer/Main/Preload/utility production build 通过。覆盖缺失或错误 `Content-Length`、`archiveBytes` 超过旧 512 MiB 上限时继续下载;SHA-256、ZIP 签名、同源重定向、临时文件清理和原子落盘仍保留。未执行真实账号、安装包或磁盘空间压力 smoke。 | | 2026-08-19 | AI Design 请求冻结与 mutation 隐式重放修复 | 客户端实现与自动化验证通过;安装包真实账号 smoke 待验收 | 源任务 `20260819-design-freeze-live-6e2c`、源提交 `87e4140`、集成任务 `20260819-integrate-design-freeze-3f8b7c` | 源分支通过 59 focused、2190 full unit、typecheck、lint(0 errors / 7 existing warnings)、Renderer/Main/Preload production build 与 package verifier;集成树另行通过 7 files / 134 focused、184 files / 2190 full、typecheck、同样的 lint 结果和 Renderer/Main/Preload/utility production build。覆盖 30 秒完整 Workspace JSON deadline、忽略 abort 时确定性 reject、shared refresh coalescing/释放/后续重试,以及只对 `GET`/`HEAD`/`OPTIONS` 保留 Electron→Node fallback;PATCH/POST transport failure 不再隐式二次发送。原生密码/SMS 登录与临时 `disable-http2` 诊断 bootstrap 同包保留;不据此宣称现场冻结已消失或 HTTP/2 是根因。 | | 2026-08-17 | AI 编程多 Session 应用侧隔离与 runtime/Agent acceptance | 客户端实现及独立复审通过;真实 bundled OpenCode/provider 并发 smoke 待验收 | 源任务 `20260817-multichat-runtime-fix-f3a91c`、源提交 `6504073` | 最终 176 files / 2100 unit tests、Main focused 164/164、typecheck、full lint(0 errors / 7 existing warnings)、Renderer/Main/Preload build、Electron E2E 1/1 与第七轮独立 Sol Standards/Spec review PASS。覆盖 per-Session run/error/queue、hard 10s startup ACK、无自动重放、Agent fingerprint + fresh generation、typed pre-send pending、manager/project FIFO、timeout lease revocation、A-held/B-abort/C ordering 和无普通路径自动 runtime restart/dispose;不据此宣称真实 provider 同时执行两个模型 turn。 | | 2026-08-17 | 首次项目封面原子提交 | 客户端与匹配服务端本地集成;发布/部署待验收 | 客户端源 `145a6ce`、服务端源 `407c883` / merge `0cedfc4`、任务 `20260817-project-cover-upload-a6a98e56` | 首次弹窗必选 PNG/JPEG/WebP ≤10 MiB,提供预览/文件名/重选;Main 用 `metadata` + `cover` multipart 创建,409 不上传版本,已有项目 version-only。源验证通过 76 单测、typecheck、scoped ESLint、Vite build、Electron E2E 1/1 和跨仓库 Sol review;未执行真实账号、生产对象存储或安装包 smoke。 | diff --git a/.project-docs/80-commitments/commitments.md b/.project-docs/80-commitments/commitments.md index b7b5c38..39e7284 100644 --- a/.project-docs/80-commitments/commitments.md +++ b/.project-docs/80-commitments/commitments.md @@ -7,7 +7,7 @@ Track future-facing memory: promised follow-ups, unfinished loops, timed checks, | 2026-08-19 | 验收 AI Design 有限请求生命周期并决定正式 HTTP/2 策略 | 发布包含源 `87e4140` 的正式安装包前 | 客户端/Works 服务端/发布集成 | Pending | 使用真实账号连续执行 Quote PATCH、重试报价与继续调整,制造或等待慢响应,确认 30 秒内稳定返回、其他请求不被共同挂住、服务端无隐式重复 mutation;随后恢复 HTTP/2 重新打包做同场景对照。只有证据确认后才能移除临时 `disable-http2` 或把协议策略固化为正式决定。 | | 2026-08-17 | 验收 AI 编程真实双 Session runtime/provider 行为与 Agent 刷新边界 | 升级 bundled OpenCode、改变 provider 并发策略,或对外宣称双会话真实并发/即时 Agent 热更新前 | 客户端/OpenCode/provider 集成 | Pending | 使用明确配置的测试 provider 运行 opt-in bundled OpenCode 双 Session smoke,区分应用隔离与上游并发/串行/限流;若要求运行期即时应用 Agent 编辑,先提供 directory-scoped authoritative invalidation 或 whole-instance quiescence oracle。在此之前只允许回复完成后的手动 runtime restart,不从 `/session/status` 推断 dispose/reload 安全。 | | 2026-08-17 | 验收用户级四模块入口策略的真实发布链 | 发布包含源 tip `3b799af` 的 Makelore 安装包前 | Works 服务端/客户端/发布集成 | Pending | 部署 `module_access` migration 和 `/api/auth/me` API,重新打包并安装 Makelore;使用真实账号依次关闭 Code、Canvas、Learning、Robot,重启后验证卡片置灰/不可点、根/深层/别名路由阻断、`/settings` 仍可访问和 terminal `401` 退出;另行以直接 API 请求确认服务端授权,不以 UI 置灰代替 | -| 2026-08-20 | 部署并验收 AI Learning 项目目录完整链路 | 发布包含源 `38db158`、`9956739` 的 Makelore 安装包前 | Works 运营后台/服务端/客户端/发布集成 | Pending | 实现并部署项目管理、对象存储、发布代际、README HTTPS URL 校验、list/detail/media/archive API;以真实账号验证发布/下架、排序分页、README/GFM/远程图片(含 SVG、失效 origin 和请求隐私说明)、原生保存取消、同源重定向、512 MiB、声明大小、SHA-256、ZIP 签名失败和 Windows/签名 macOS 安装包。不得以客户端测试宣称运营后台或生产数据已上线 | +| 2026-08-20 | 部署并验收 AI Learning 项目目录完整链路 | 发布包含源 `38db158`、`9956739`、`8509084` 的 Makelore 安装包前 | Works 运营后台/服务端/客户端/发布集成 | Pending | 实现并部署项目管理、对象存储、发布代际、README HTTPS URL 校验、list/detail/media/archive API;以真实账号验证发布/下架、排序分页、README/GFM/远程图片(含 SVG、失效 origin 和请求隐私说明)、原生保存取消、同源重定向、缺失或错误 `Content-Length` 时仍可下载、SHA-256/ZIP 签名失败和 Windows/签名 macOS 安装包。客户端下载不再验证 `archiveBytes`、实际字节数或大小上限;不得以客户端测试宣称运营后台或生产数据已上线 | | 2026-08-17 | 验收首次项目封面并补齐已有资料条件写 | 发布包含源 `145a6ce` 的 Makelore 前,或启用 draft/published metadata 编辑前 | Works 服务端/客户端发布集成 | Partial / Pending | 首次封面已由服务端源 `407c883` 与客户端源 `145a6ce` 通过单请求绑定和失败补偿落地;仍需先部署服务端、重新打包客户端,并以真实对象存储/账号验证 404→create 409、cover 失败和版本阻断。已有资料编辑继续等待 metadata revision/ETag 与 draft-only 条件写;在此之前保持 existing version-only。 | | 2026-08-16 | 验收 Prompt Museum 与 Canvas 删除/重报价的真实服务端链路 | 发布包含 `26b52d7` Canvas 行为的安装包前 | 客户端/服务端集成 | Pending | 使用真实 Works 账号核对 Museum 列表/详情/分页/筛选/署名/CDN/Prompt 回填,并确认固定相对媒体路径可经 Main Bearer 代理、401 刷新、10 MiB/可信 raster MIME 边界后在 Renderer 展示;核对最终 Prompt/options 重报价和确认设计点;删除 Workspace 后确认软删除可见性、未提交任务取消/预留积分释放、已运行任务结算。保留 Main 错误脱敏和严格 DTO/HTTPS 投影,不以客户端回归替代服务端验收 | | 2026-08-16 | 验收 default-on Robot Guided Hotspot Binding 的 Windows/macOS 真实设备链路 | 下一份包含页面内热点连接行为的安装包发布前 | 客户端/硬件/服务端集成 | Pending | 核对精确出货固件与固定 Portal、六位码发行/消费语义;执行 Windows Robot 真机扫描/连接、签名 macOS x64/arm64 CoreLocation/CoreWLAN/worker/ASAR/Koffi smoke,以及真实 Host/native Electron 端到端配网+Binding;保留 `NIANCODE_AI_HARDWARE_GUIDED_HOTSPOT_BINDING=0` 回滚并记录支持矩阵 | diff --git a/README.md b/README.md index a011922..9d1edd3 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Makelore 是一个面向软件、视觉创作、互动学习与智能机器人 - AI 绘画:每个设计项目固定一个设计 Agent,并可包含多条互相独立的设计会话。消息、Brief、Quote 和 `turnRevision` 属于 Conversation;图片/视频生成任务与资产属于 Workspace,切换或新建会话不会创建新项目,也不会隐藏项目任务。图片创作既支持文生图,也支持从当前项目已完成作品或本地上传中选择一张参考图继续生成;输入框支持直接上传参考图,上传后可在候选区点击或输入 `@` 选择,并将所选资产随消息提交;视频沿用同一单图选择器绑定首帧。每条 Conversation 复用服务端持久 Agent Gateway Session;已连接时 Agent 命令、流式回复和任务进度共用 WebSocket,断流时使用幂等 REST 提交与低频同步。确认栏展示并允许编辑服务端最终提示词和 generation options,分别展示清晰度、画幅和视频时长;每次修改都会按当前 Quote 重新报价、刷新设计点,报价完成前不能确认,确认时将最新提示词与参数原值提交给后端。客户端不计算百炼尺寸、供应商价格或积分价格,服务端 Quote 是唯一计费准则。确认结果会按 Quote 对账,即使 Run 在任务落库后异常结束,Workspace 任务仍会恢复到统一列表。生产环境使用 Works Square 云端 Workspace 契约,上游不可用时明确报错。 - AI 绘画项目栏会在当前项目下保留会话历史,默认显示最近五条消息摘要和更新时间,更多会话可展开;新建或点击历史条目都在同一项目中切换并恢复完整对话。 - AI 绘画项目支持从侧栏删除。确认删除时必须完整输入项目名称;删除后项目及其会话、任务、参考图和生成作品会从账户中隐藏且无法访问,不影响用户已另存到磁盘的副本。服务端采用软删除,数据库记录和对象存储暂不物理清理。未提交的任务会被取消并释放预留积分,已提交或运行中的任务继续后台结算但对用户隐藏;删除当前项目后自动打开最近更新的剩余项目,删除最后一个项目后进入空状态。 -- AI 学习:主区展示服务端分页项目卡片,详情页用安全 Markdown 渲染 README;原始 HTML 被禁用,Markdown 图片节点直接加载服务端校验后的无凭据 HTTPS URL,包括 SVG 和 Electron 支持的其他图片格式,不经过服务端下载、识别、转码或镜像。下载按钮打开系统保存对话框,Main 流式校验声明大小、SHA-256 与 ZIP 签名后原子保存,单包最大 512 MiB。客户端不提供课程生成、课程播放器、本地课程库、Agent、ASR 或课堂 runtime。运营管理与接口字段见 [`docs/learning-project-catalog-server-contract.md`](docs/learning-project-catalog-server-contract.md)。 +- AI 学习:主区展示服务端分页项目卡片,详情页用安全 Markdown 渲染 README;原始 HTML 被禁用,Markdown 图片节点直接加载服务端校验后的无凭据 HTTPS URL,包括 SVG 和 Electron 支持的其他图片格式,不经过服务端下载、识别、转码或镜像。下载按钮打开系统保存对话框,Main 不按 `Content-Length`、声明字节数或客户端上限阻断下载,流式校验 SHA-256 与 ZIP 签名后原子保存。客户端不提供课程生成、课程播放器、本地课程库、Agent、ASR 或课堂 runtime。运营管理与接口字段见 [`docs/learning-project-catalog-server-contract.md`](docs/learning-project-catalog-server-contract.md)。 - 提示词博物馆:只陈列经过审核的作品预览、Prompt、分类以及作者/来源/许可证信息,支持搜索、使用场景/风格/主体筛选和详情抽屉;“使用此 Prompt”只把原文带回当前 Canvas 会话输入框,不自动发送、不构成社区。列表和详情数据由服务端提供,客户端不打包数据集;服务端字段契约见 [`docs/prompt-museum-server-contract.md`](docs/prompt-museum-server-contract.md)。 - 视觉系统:单一浅色主题,品牌蓝 `#3A5578`、星火橙 `#F26A3D`、白色画布与低饱和蓝灰层级。 - 字体系统:Renderer UI 内嵌 Inter Variable 与经过字符子集化的 Source Han Sans SC WOFF2,按字符范围统一中英文并保留系统中文字体 fallback;代码、路径和日志使用独立等宽字体。 diff --git a/docs/learning-project-catalog-server-contract.md b/docs/learning-project-catalog-server-contract.md index ab6ff86..68a5a8d 100644 --- a/docs/learning-project-catalog-server-contract.md +++ b/docs/learning-project-catalog-server-contract.md @@ -19,7 +19,7 @@ Renderer 的固定链路为 `Renderer -> Host API -> Electron Main -> Works Squa | 项目名称 `name` | 必填,1–200 字符 | | 摘要 `summary` | 必填,1–2,000 字符,用于卡片 | | 封面 `cover` | 必填,PNG/JPEG/WebP,最大 10 MiB;服务端读取真实 MIME、尺寸并生成受控媒体 | -| 项目压缩包 `archive` | 必填 ZIP,最大 512 MiB;服务端流式计算字节数与 SHA-256,并验证 ZIP 签名 | +| 项目压缩包 `archive` | 必填 ZIP;运营上传可保留独立的 512 MiB 服务端限制,服务端流式记录字节数、计算 SHA-256 并验证 ZIP 签名;该上传限制不由客户端在下载时执行 | | README `readme` | 必填 `.md`,UTF-8,最大 500 KiB;不接受可执行 HTML 作为发布内容 | | 标签 `tags` | 0–16 个,每项 1–64 字符,去重 | | 版本 `version` | 可空,最大 64 字符,仅作展示 | @@ -118,8 +118,8 @@ TypeScript 权威字段定义位于 [`shared/learning.ts`](../shared/learning.ts ### 媒体与归档响应 - 媒体接口只用于封面和历史已镜像内容,返回受控 raster 内容并设置准确 `Content-Type` 与 `Content-Length`;Main 限制 10 MiB,并转换为 data URL 给 Renderer。新发布 README 的 HTTPS 图片不经过该接口。 -- 归档接口返回 `application/zip`、`application/x-zip-compressed` 或 `application/octet-stream`,设置准确 `Content-Length`。如需重定向,只能跳转到与 Works API 相同 origin 的 HTTP(S) 地址,最多 5 跳;Main 不向重定向目标转发 Bearer。 -- 归档字节必须与详情中的 `archiveBytes` 和 `archiveSha256` 精确一致。客户端验证失败时删除临时文件,不留下部分下载。 +- 归档接口返回 `application/zip`、`application/x-zip-compressed` 或 `application/octet-stream`;`Content-Length` 可省略,客户端也不使用它决定是否保存。如需重定向,只能跳转到与 Works API 相同 origin 的 HTTP(S) 地址,最多 5 跳;Main 不向重定向目标转发 Bearer。 +- `archiveBytes` 是列表、详情和运营审计使用的展示元数据,不是客户端下载门禁。客户端不比较它、`Content-Length` 与实际流字节数,也不设置归档大小上限;客户端仍要求实际归档匹配 `archiveSha256` 和 ZIP 签名,验证失败时删除临时文件,不留下部分下载。 ## 5. 错误、缓存与上线顺序 @@ -133,4 +133,4 @@ TypeScript 权威字段定义位于 [`shared/learning.ts`](../shared/learning.ts 列表/详情可对发布代际生成 ETag;媒体和归档按内容摘要设置不可变缓存,但不得缓存带用户私有授权的响应到公共共享缓存。日志不得记录 Bearer、签名 URL、完整 README 图片 URL 或对象存储 key;可记录规范化主机、URL 摘要和图片数量。 -上线顺序:先部署数据库/对象存储、运营后台、README HTTPS URL 校验和四个公开接口,再发布包含直连图片支持的新客户端;随后用真实账号完成发布/下架/远程图片(含 SVG、失效 origin 和隐私提示)/ZIP 联调。旧 `/api/learning/courses`、generation/progress/runtime 接口不在新客户端兼容范围内,可按服务端消费者盘点结果独立退役。 +上线顺序:先部署数据库/对象存储、运营后台、README HTTPS URL 校验和四个公开接口,再发布包含直连图片与无下载大小校验的新客户端;随后用真实账号完成发布/下架/远程图片(含 SVG、失效 origin 和隐私提示)/ZIP 联调,并覆盖缺失或不准确 `Content-Length` 的归档响应。旧 `/api/learning/courses`、generation/progress/runtime 接口不在新客户端兼容范围内,可按服务端消费者盘点结果独立退役。