diff --git a/.project-docs/00-brief/success-criteria.md b/.project-docs/00-brief/success-criteria.md index 0d84260..0d7fd65 100644 --- a/.project-docs/00-brief/success-criteria.md +++ b/.project-docs/00-brief/success-criteria.md @@ -7,7 +7,7 @@ ## Task Completion Standard - 可发布交互式 AI 应用的一键提交必须由 Electron Main 对安全源码快照执行固定 npm 11.6.2 的 `npm ci --ignore-scripts`,并调用项目 `package-lock.json` 锁定的 Vite 生成静态产物。 -- Project Scaffold Skill 可生成固定起步文件并只读说明发布要求、禁止项和证据缺口,但不得安装依赖、构建、上传、提审或把静态检查表述为平台批准。 +- 官方 bundled Project Scaffold Skill 可生成固定起步文件并只读说明发布要求、禁止项和证据缺口,但不得安装依赖、构建、上传、提审或把静态检查表述为平台批准;其 `.mjs` 只来自签名客户端固定资源,Marketplace 下载 artifact 仍必须拒绝脚本。 - Electron 双视口预检必须检查与最终 `built_archive` 相同的内存文件字节;预检失败不得上传,预检成功不得被表述为可信审核凭据。 - 上传协议必须同时携带源码归档、构建归档和严格版本化 artifact contract;服务端独立重算摘要、校验合同并固化不可变 Release。 - Renderer 不得获得发布凭据、归档、临时目录、构建 origin 或任意本地路径;旧客户端和旧 sandbox/browser 任务必须提示升级后重新构建提交。 diff --git a/.project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md b/.project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md index f80ae7c..2b1fe1c 100644 --- a/.project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md +++ b/.project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md @@ -2,30 +2,30 @@ - Status: Accepted / implemented - Date: 2026-09-04 -- Applies to: Project creation, `ProjectType`, Device Packages, scaffold Skill, release readiness +- Applies to: Project creation, `ProjectType`, official bundled Marketplace Plugins, scaffold Skill, release readiness ## Context 历史客户端把 `mini_game` 和 `mini_program` 作为两个可发布产品类型,并在创建项目时自动生成两套业务模板。这把项目身份、起步文件和发布规则绑定在同一次创建操作中,使模板演进和平台发布约束难以独立维护。 -项目服务当前已经只负责 `.makelore/project.json` 与 `knowledge/`。用户确认将小游戏和小程序合并为一个“交互式 AI 应用”类型,并把生成文件、目录以及提交审批要求放进可独立分发的 Skill。 +项目服务当前已经只负责 `.makelore/project.json` 与 `knowledge/`。用户确认将小游戏和小程序合并为一个“交互式 AI 应用”类型,并把生成文件、目录以及提交审批要求放进由官方 Marketplace 管理、随签名客户端交付的 Skill。 ## Decision - 新建项目只提供规范产品类型 `interactive_ai_app`(显示为“交互式 AI 应用”)和 `custom`。`ProjectType` 创建后仍不可变。 - `mini_game` 与 `mini_program` 只作为历史读取和脚手架兼容别名,在内存中归一为 `interactive_ai_app`。读取或运行脚手架不会改写原配置;后续普通配置变更可以保存规范值。缺少类型字段的旧项目仍归一为 `custom`。 - 项目创建只生成 `.makelore/project.json` 和 `knowledge/`,不生成业务源码、依赖、锁文件或发布模板。 -- 独立 Device Package `makelore-project-scaffold` 提供显式 Scaffold Skill。其脚本按固定版本生成六个交互式 AI 应用起步文件;写入前预检全部目标,不覆盖已有路径,受控失败时只回滚本次创建的文件和目录。 +- 代码内置的官方 Marketplace Plugin `makelore.project-scaffold` 提供显式 Skill `makelore-project-scaffold`。它保留 Account Library 获取、项目启用和 Agent 分配语义,但固定版本资源随 MakeLore 客户端交付,不经过 Package Store 下载。其脚本生成六个交互式 AI 应用起步文件;写入前预检全部目标,不覆盖已有路径,受控失败时只回滚本次创建的文件和目录。 - Scaffold Skill 不安装依赖、不访问网络、不执行构建、不上传、不提交审核,也不提供 `--force`、类型覆盖或模板迁移状态。Main 继续独占固定 npm/Vite 构建、同字节预检、打包和上传;Works Square 继续独占服务端校验、不可变 Release 与运营审核。 -- 非空标准 Skill `scripts/` 目录属于可执行代码,即使 Device Package 仍为 `skill-only`,也必须在预览和独立后续确认中披露文件、网络、进程及桌面用户权限。应用通过不可覆盖的 `MAKELORE_NODE_EXECUTABLE` 向父 Pi worker/Agent Server 提供自身 Node;不得回退系统 Node。 +- 官方 Plugin 的 `.mjs` 仅因它位于客户端固定、代码所有的 bundled resource root 中而可执行。应用通过不可覆盖的 `MAKELORE_NODE_EXECUTABLE` 向父 Pi worker/Agent Server 提供自身 Node;不得回退系统 Node。该例外不适用于 Marketplace 下载 artifact:P0 下载包仍只接受文本/图片 Skill 资源并拒绝 `.mjs`。第三方 Device Package 的可执行代码继续走自身的披露与确认边界。 - Skill 的发布检查只是只读准备度指导:区分确定阻断、源码包排除影响、运行时/平台待确认项和静态已满足项,并引用项目相对证据。它不能宣称构建、上传、审核或生产发布成功。 ## Consequences -- 模板可随独立插件版本演进,不再扩大项目创建服务的职责。 +- 模板可随官方 Plugin 版本演进,不再扩大项目创建服务的职责,也不需要把脚本上传为 Marketplace artifact。 - 旧项目无需批量迁移即可继续打开、生成脚手架和发布;新写入只使用规范类型。 - 发布规则在 Skill 中可被 Agent 解释和预检,但权威执行仍只有 Main 与 Works Square,避免形成第二套发布实现。 -- 对外分发仍需不可变 SemVer/Git 版本、真实 Device Package 安装链和已安装 Windows、签名 macOS、native Linux 运行证据;工作区测试不能替代这些发布门禁。 +- 对外分发仍需不可变 SemVer/Git 版本、服务端 bundled Release 元数据、已安装 Windows、签名 macOS 与 native Linux 运行证据;工作区测试不能替代这些发布门禁。 ## Supersedes @@ -35,5 +35,9 @@ - Source commit: `959b633` - Integration merge: `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952` +- Official Marketplace source commit: `ddb678b46ff10a28e04beeafcfc00c8c8a23ff9f` +- Official Marketplace integration merge: `2bc3e4420852388ce46841e05c1cbf49e80b250c` - Source task: `20260904-project-scaffold-implementation-7e4c2a91` +- Marketplace source task: `20260904-marketplace-scaffold-client-6c4e8a21` +- Marketplace integration task: `20260904-project-scaffold-integration-client-4f2a8c71` - Proposal: `10-decisions/proposals/20260904-project-scaffold-implementation-7e4c2a91__interactive-ai-app-type.md` diff --git a/.project-docs/10-decisions/decision-index.md b/.project-docs/10-decisions/decision-index.md index 8c5fe12..68f5a5c 100644 --- a/.project-docs/10-decisions/decision-index.md +++ b/.project-docs/10-decisions/decision-index.md @@ -4,7 +4,7 @@ | ID | Decision | Status | Date | Applies To | Detail | |---|---|---|---|---|---| -| ADR-008 | 交互式 AI 应用使用单一规范类型,项目创建与显式 Scaffold Skill、发布权威分离 | Accepted / implemented | 2026-09-04 | Project creation、`ProjectType`、Device Packages、scaffold、release readiness | `adr-008-interactive-ai-app-scaffold.md` | +| ADR-008 | 交互式 AI 应用使用单一规范类型,项目创建与官方 bundled Scaffold Skill、发布权威分离 | Accepted / implemented, amended 2026-09-04 | 2026-09-04 | Project creation、`ProjectType`、Official Plugins、Marketplace delivery、release readiness | `adr-008-interactive-ai-app-scaffold.md` | | ADR-007 | AI Design 采用单一 Current Specification、Living Form 与不可变 Quote 的 V2 权威 | Accepted / implemented | 2026-08-30 | AI Design Renderer、Electron Main、Works Square V2 API | `adr-007-ai-design-living-form-v2.md` | | 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` | diff --git a/.project-docs/10-decisions/proposals/20260904-project-scaffold-implementation-7e4c2a91__interactive-ai-app-type.md b/.project-docs/10-decisions/proposals/20260904-project-scaffold-implementation-7e4c2a91__interactive-ai-app-type.md deleted file mode 100644 index ebaf5b5..0000000 --- a/.project-docs/10-decisions/proposals/20260904-project-scaffold-implementation-7e4c2a91__interactive-ai-app-type.md +++ /dev/null @@ -1,45 +0,0 @@ -# 交互式 AI 应用统一类型提案 - -## 文档信息 - -- 状态:Proposed,等待 Integration Gate 提升 -- 所有者:`20260904-project-scaffold-implementation-7e4c2a91` -- 日期:2026-09-04 -- 影响范围:项目创建、项目配置读取、脚手架、发布打包与作品元数据 - -## 决策 - -新建项目的唯一可发布类型改为: - -- 稳定标识:`interactive_ai_app` -- 展示名称:`交互式 AI 应用` - -`mini_game` 与 `mini_program` 不再出现在新建入口,也不再由新客户端写入。两者作为历史只读别名,在项目配置读取边界统一归一化为 `interactive_ai_app`,不批量改写用户已有的 `.makelore/project.json`。归一化后的打包清单和后续提交元数据只输出规范值。 - -`custom` 仍是独立的工作空间类型,并继续禁止进入平台的一键发布流程。 - -## 脚手架与发布合同 - -- 脚手架只维护一套通用 Vite 静态应用模板,不再按小游戏/小程序维护两套业务模板。 -- 历史项目调用脚手架时使用相同的统一模板,脚本返回规范类型,但保留原始项目元数据。 -- 固定 npm/Vite 构建、静态产物合同、浏览器预检、上传和审批要求不因类型合并而放宽。 -- 平台服务应先兼容接收三个值并统一输出 `interactive_ai_app`,再发布只写规范值的新客户端,以支持滚动升级。 - -## 兼容与迁移边界 - -- 不执行数据库或本地配置的批量历史迁移。 -- 不增加版本开关、双写、模板迁移框架或类型特有构建分支。 -- 旧客户端上传 `mini_game` / `mini_program` 时,服务端在校验边界接受并归一化;`custom`、未知值仍拒绝。 -- 历史发布记录保持不可变;公开读取和信息流投影使用规范类型。 - -## 被取代的语义 - -本提案在集成后取代既有文档中“小游戏与小程序是两个可发布项目类型”以及“二者分别生成不同模板”的部分。既有关于静态 Vite 发布、安全预检、制品不可变与审批流程的约束继续有效。 - -## 验收 - -- 新建界面只显示“交互式 AI 应用”和“自定义项目”。 -- 新建可发布项目落盘 `interactive_ai_app`,脚手架生成统一模板。 -- 两种历史配置均可打开和发布,原配置文件不会仅因读取而被改写。 -- 客户端清单、上传元数据和平台公开投影均使用 `interactive_ai_app`。 -- `custom` 与未知类型仍被拒绝发布。 diff --git a/.project-docs/20-architecture/data-flow.md b/.project-docs/20-architecture/data-flow.md index e49ae7d..c825e8a 100644 --- a/.project-docs/20-architecture/data-flow.md +++ b/.project-docs/20-architecture/data-flow.md @@ -6,7 +6,7 @@ |---|---|---|---| | Marketplace catalog and Account Library | Signed-in Renderer intent | bounded Host API → Main Marketplace client/cache → Works Square catalog, Library, resolve, Admission, and download APIs | Main binds requests to the current Account and response generation. Free acquisition changes only Account Library; it does not install, enable a project, assign an Agent Skill, or authorize runtime execution. | | Marketplace device installation | Account Library entry and explicit channel | Main resolve/Admission/download → descriptor/signature/archive/client compatibility verification → immutable Package Store index switch | Stable and explicit Beta remain distinct even when they resolve to the same immutable Release. Failed install/update retains the previous current release; explicit uninstall waits only for protecting worker/account references and completes after the final worker exits. | -| Official bundled hosted Plugin acquisition | Account Library entry for Game Resource | server stable bundled Release/Admission + MakeLore resource package | Free acquisition changes Library only. No device download, update, Beta, signature, or device-uninstall action exists for this exact code-owned identity. Historical Hosted Web Search entries are ignored by current clients. | +| Official bundled Plugin acquisition | Account Library entry for Game Resource or Project Scaffold | server stable bundled Release/Admission + exact MakeLore resource package | Free acquisition changes Library only; project enablement and Agent assignment remain separate. No device download, update, Beta, artifact signature, or device-uninstall action exists for either code-owned identity. Game Resource is hosted; Project Scaffold is `skill_only` and may execute only its bundled `.mjs`. Historical Hosted Web Search entries are ignored. | | Selected-model Web Search | Parent Pi turn with an explicitly supported selected model | `makelore_web_search` core tool → frozen model/provider/credential request with provider-native forced search → ordinary model response/usage | No Marketplace Release, Account Library, Admission, Hosted Web Search client, Plugin Charge, or `agent_browser` fallback participates. Unsupported selected models expose no tool; child workers receive none. | | Conversation-driven Device Package install | Agent tool inspects npm/Git/absolute local Plugin/loose Skill source | Main preview → distinct later user confirmation → immutable device-package generation → new/idle parent worker resources | Renderer has no install picker. Lifecycle scripts never run. Pi extensions and non-empty Skill `scripts/` are disclosed as desktop-user executable code before confirmation. Active workers retain their frozen generation until the turn settles; child workers remain empty. | | Effective Plugin worker snapshot | Installed trusted package or acquired official bundled definition + project selection + Agent assignments + current server policy | effective resolver → Registry/resource loader/Extension Host/tool catalog → parent Pi worker | One frozen snapshot supplies Skills, tools, package roots, and runtime authorization. Disable, account/project switch, logout, Renderer crash, Main shutdown, or worker generation change invalidates future actions without mutating persisted unknown assignments; child workers receive no Plugin projection. | @@ -14,7 +14,7 @@ | 桌面认证生命周期 | Renderer 登录、刷新与注销请求 | Host API → Main Works Session → Works Square `/api/auth/{login,mobile-login,refresh,logout}` → one-feel auth | Main 加密持有并先持久化轮换 token;客户端不携带 OAuth client secret;连续 7 天未使用才清除会话,终止性 `400`/`401` fail closed | | 用户模块入口策略 | 会话恢复 / 登录 / 刷新 | Electron Main → Works `/api/auth/me` → 四布尔安全投影 → Renderer auth store → 卡片/路由/provider gate | 缺失对象或字段默认 `true`;`design` 映射 `painting`;终止性 `401` 清理 Main/Renderer 会话;全局 `/settings` 不受 Code gate | | 项目创建 | 新建项目对话框 | Host API → Main 项目初始化 | 固定 `interactive_ai_app` 或 `custom`,只生成 `.makelore/project.json` 与 `knowledge/`;历史双类型在读取边界归一,不因读取改写 | -| 显式项目脚手架 | 用户在交互式 AI 应用 Conversation 中要求初始化 | Pi `bash` + 项目 write lease → `MAKELORE_NODE_EXECUTABLE` → `makelore-project-scaffold` 脚本 | 固定六文件目标;全量预检、不覆盖、受控失败只回滚本次路径;不安装依赖、不联网、不构建、不上传、不提审 | +| 显式项目脚手架 | 用户为已获取、项目启用并分配给 Agent 的 Project Scaffold Plugin 明确要求初始化 | Pi `bash` + 项目 write lease → `MAKELORE_NODE_EXECUTABLE` → bundled `makelore-project-scaffold` 脚本 | 固定六文件目标;全量预检、不覆盖、受控失败只回滚本次路径;不安装依赖、不联网、不构建、不上传、不提审;下载 artifact 不参与 | | 一键提交 | `ProjectPublishAction` | Renderer capability → Host API → Main 本地 npm/Vite build → built snapshot preflight → source+built+contract 上传 | 只对规范交互式 AI 应用(含读取时归一的历史别名)开放;首次 create 通过单一 multipart 合同原子提交文字资料与必选 PNG/JPEG/WebP 封面,创建失败或冲突不上传版本;已有 draft/published 只提交版本并沿用云端资料/封面,不做无条件 metadata PATCH | | 构建产物预检 | Main-owned built snapshot | 一次性 loopback origin → fresh Electron WebContents/CDP(桌面、移动) | 检查错误、白屏和外域;不调用 Playwright,检查与上传归档相同字节,但不产生可信 receipt | | 提交绑定 | 云端成功上传响应 | Main → submission binding v2 | 只持久化成功的 app/version/review/hash;落盘失败返回固定告警但不反转提交 | diff --git a/.project-docs/20-architecture/module-map.md b/.project-docs/20-architecture/module-map.md index 4afc58d..b942174 100644 --- a/.project-docs/20-architecture/module-map.md +++ b/.project-docs/20-architecture/module-map.md @@ -4,7 +4,7 @@ | Path | Responsibility | Owner Notes | |---|---|---| -| `electron/coding-plugins/manifest.ts`, `release-descriptor.ts`, `signature-verifier.ts`, and `trusted-keys.ts` | Closed Plugin package/descriptor parsing, fixed code-owned resource roots, compatibility checks, canonical archive validation, and Ed25519 trust | Data Service plus exact Game Resource roots are code-owned. Other schema-2 `skill_only`/`platform_hosted` packages remain signed Marketplace artifacts and fail closed without the official public key. Hosted Web Search is not a current Plugin root. | +| `electron/coding-plugins/manifest.ts`, `release-descriptor.ts`, `signature-verifier.ts`, and `trusted-keys.ts` | Closed Plugin package/descriptor parsing, fixed code-owned resource roots, compatibility checks, canonical archive validation, and Ed25519 trust | Data Service plus exact Game Resource and Project Scaffold roots are code-owned. Other schema-2 packages still pass descriptor/signature/archive validation; downloadable P0 Skill assets remain text/image-only. Hosted Web Search is not a current Plugin root. | | `electron/coding-plugins/account-plugin-cache.ts`, `marketplace-client.ts`, and `package-store.ts` | Main-owned Account Library cache, authenticated server client, and atomic immutable device installation store | Account acquisition and device installation are separate. Package bytes switch atomically only after descriptor, signature, archive, client-range, and provenance checks; failed updates preserve the prior current release. | | `electron/coding-plugins/effective-resolver.ts`, `registry.ts`, `project-service.ts`, and `electron/coding-runtime/pi/**` | Effective official Plugin projection, selected-model tools, Device Package resources, and frozen parent logical-thread runtime snapshot | Project enablement and Agent Skill assignment are preserved independently. Trusted Marketplace artifacts, exact acquired official bundled definitions, and immutable local Device Package generations enter through distinct authorities. Child workers remain empty; active threads retain frozen resources until settlement/disposal. | | `electron/coding-runtime/pi/model-tools/**` and `shared/model-tools.ts` | Closed selected-model tool registry and provider-specific Web Search request shaping | The frozen selected model capability controls whether `makelore_web_search` exists. The tool uses that model/provider/credential and normal model billing; no Hosted Plugin adapter, Admission, Plugin Charge, or browser fallback exists. | @@ -13,7 +13,7 @@ | `electron/api/routes/plugin-marketplace.ts`, `src/stores/{plugin-marketplace,device-packages,coding-plugins}.ts`, and `src/pages/Plugins/` | Existing Main/store authorities plus the pure unified Renderer projection for official catalog, Account Library, official package-device state, local Device Packages, retained IDs, and current-project actions | `/plugins` is the sole canonical surface; legacy Plugin routes only replace-redirect into deterministic filters. `official:`, `local:`, and `retained:` identities stay separate, source failures are isolated, and no Account token, filesystem path, Admission, package bytes, signed URL, or visible install-source picker enters Renderer. | | `src/components/works/ProjectPublishAction.tsx` | 可发布项目的一键提交、云构建轮询与用户可理解状态 | 只通过 Renderer API 提交非敏感元数据;绑定告警不终止轮询 | | `shared/project-config.ts` and `electron/coding-projects/project-config.ts` | 规范 `ProjectType` 归一与最小项目创建 | 新写入只使用 `interactive_ai_app` / `custom`;历史 `mini_game` / `mini_program` 只读归一,项目创建只生成 metadata 与 `knowledge/` | -| `plugins/makelore-project-scaffold/` | 独立 Scaffold Skill、固定六文件模板、确定性 Node 脚本、发布要求参考与回归测试 | 通过既有 Pi `bash` write lease 和 `MAKELORE_NODE_EXECUTABLE` 显式运行;不覆盖、不安装依赖、不联网,也不复制 build/upload/review 实现 | +| `resources/coding-plugins/project-scaffold/` and `tests/project-scaffold/` | 官方 bundled Scaffold Plugin、固定六文件模板、确定性 Node 脚本、发布要求参考与回归测试 | 通过既有 Pi `bash` write lease 和 `MAKELORE_NODE_EXECUTABLE` 显式运行;脚本信任来自固定客户端资源,而非下载 artifact;不覆盖、不安装依赖、不联网,也不复制 build/upload/review 实现 | | `src/lib/works-square.ts` | Renderer 侧 Works Square Host API 契约与安全错误映射 | 不接触 Token、ZIP、本地绝对路径或自动部署状态 | | `electron/api/routes/works.ts` | Works Host API、Renderer capability 门禁、上游安全投影 | 发布凭据、打包、上传与本地绑定均在 Main 内完成 | | `electron/services/project-release-builder.ts` | Main-owned 安全快照、本地 npm/Vite 构建、source+built 双归档与 v1 contract | 固定 npm 11.6.2;项目 Vite 由 lockfile 决定;Vite config/plugins 以桌面用户权限执行 | diff --git a/.project-docs/20-architecture/system-overview.md b/.project-docs/20-architecture/system-overview.md index 15ad4e8..816cd53 100644 --- a/.project-docs/20-architecture/system-overview.md +++ b/.project-docs/20-architecture/system-overview.md @@ -11,7 +11,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 | Renderer | 项目配置、一键提交状态 | 不接触账号 Token、ZIP、幂等键或本地绝对路径 | | Host API | 校验本地项目请求并投影安全响应 | 发布 mutation 还必须通过 Renderer capability;Host token/base 不能单独触发发布 | | Project Configuration | 保存不可变 `ProjectType`,原子创建最小项目空间 | 只生成 `.makelore/project.json` 与 `knowledge/`;规范类型为 `interactive_ai_app` / `custom`,历史双类型只在读取边界归一 | -| Project Scaffold Skill | 显式生成固定版本的交互式 AI 应用起步文件,并提供发布准备度指导 | 独立 Device Package;完整预检、不覆盖、受控回滚,不安装依赖、不联网、不构建、不上传、不提审 | +| Project Scaffold Skill | 显式生成固定版本的交互式 AI 应用起步文件,并提供发布准备度指导 | 官方 `makelore.project-scaffold` bundled Marketplace Plugin;完整预检、不覆盖、受控回滚,不安装依赖、不联网、不构建、不上传、不提审 | | Project Release Builder | Main-owned 安全快照、本地 npm/Vite 构建、双归档与 artifact contract | 固定 npm 11.6.2;Vite 由项目 lockfile 锁定;产物与预检使用同一内存字节 | | Works Session & Remembered Password | Main-owned 登录、刷新、注销、七天真实活动滑动续期与可选密码回填 | 登录、刷新、注销统一经过 Works Square;轮换凭据由 Main 安全持有和持久化。记住密码使用独立的 packaged-only OS 加密记录,不进入 Renderer 持久状态或 Works Square;客户端不携带 OAuth client secret | | Module Access Policy | Main-owned `/api/auth/me` projection → Renderer auth state → module chooser/router | Renderer 只接收 Code/Canvas/Learning/Robot 四个布尔值;缺失对象或字段默认开启,服务端 `design` 映射客户端 `painting` | @@ -24,7 +24,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 | Pi Conversation Runtime | 一个长驻 Pi `0.84.2` Agent Server 承载每条 active/warm Conversation 的隔离逻辑 Runtime/Session/JSONL channel | 严格 LF JSONL RPC、generation recovery、Snapshot hydration;正式包从 staged `pi-runtime` manifest/root 定位并校验 Pi 包入口;top-level 逻辑 turn 并发 4、warm idle LRU 8;Server 退出统一使旧 channel 失效并按需单实例重启 | | Pi Provider & Managed Resources | Provider catalog、thread-local secret projection、model/resource revision、Prompt/Skill/extension materialization、selected-model tools | 父凭据只进入选中逻辑线程的内存 credential store,child 凭据只进入该短命进程;Works `model_capabilities` 由 Main 严格归一化并作为安全 Provider metadata 持久化。Web Search 仅在精确 capability 存在时随冻结的 selected model/provider/credential 进入 parent tool catalog,并走普通模型计费;不回退 `agent_browser` 或独立 Hosted Provider。服务端 reasoning levels 优先于本地 profile,缺字段则清理 override 并回退;不扫描项目或用户的 `.pi/.agents/.codex`,不把 secret 或原始响应放进 argv、catalog 或 Renderer | | Pi Extension, Subagents & Lifecycle | 必需的生成式 Makelore extension、Main 显式选定的已安装 extensions、UI interaction、ephemeral child、write lease 与 background run lease | Makelore bridge 固定为首个 extension,其余选定 extension 全部经 Pi 的 explicit additional paths 加载且 ambient discovery 关闭;child 并发 4、单次最多 8、禁止递归;active/uncertain run 不因页面隐藏或 confirmation timeout 被停止,replacement/stop 必须可解释并清理所有 ownership | -| Official Hosted Plugins | Acquired code-owned bundled Game Resource package → effective parent snapshot → code-owned Main adapter → fixed Works Square hosted route | 无设备下载、更新、Beta 或签名步骤;Renderer/Package/Pi 不持有 Provider key、model 或 URL。每次计费操作要求显式确认,child 不继承 hosted tool。历史 Hosted Web Search 不再进入当前客户端。 | +| Official Bundled Plugins | Acquired code-owned bundled Game Resource / Project Scaffold package → project enablement and Agent assignment → effective parent snapshot | 两者都不经过设备下载、更新、Beta 或 artifact 签名。Game Resource 进入固定 Works Square hosted route;Project Scaffold 仅提供 Skill,其 `.mjs` 来自签名客户端固定资源。Marketplace 下载包仍只接受 P0 文本/图片资源。child 不继承 Plugin。 | | Device Packages | Conversation install tools → Main-owned inspect/preview/confirm/commit → immutable local generation → parent Skill/Pi-extension resources | 支持 npm、Git、绝对本地 Plugin 目录与 loose `SKILL.md`;没有可见安装入口、Account Library、Release、Admission 或 Marketplace Package Store。可执行 extension 与非空 Skill `scripts/` 拥有桌面用户权限,必须披露并独立确认;生命周期脚本禁用。每个 generation 包含所有显式安装且当前启用的 Skill/extension;新/idle parent 自动刷新,active parent 在 turn settled 后刷新,child 始终为空。 | | AI Design Workspace & Living Form | 一个 Workspace 的当前 Direction、Current Specification、持久 Agent Session、conversation timeline、Tasks 与 Assets | 自然对话是主创作面;Living Form 仅以“AI 已理解”的紧凑辅助摘要与可选手动调整投影服务端 Current Specification,Renderer 只持有草稿和已接受投影 | | AI Design Input & Reconciliation | Chat、字段/集合编辑、decision、proposal、lock、Asset binding 与 restore | 全部进入同一 `design.input.apply` reducer;稳定 command/operation ID 支持 unknown-result 重放,revision conflict 刷新权威状态;待提交 chat 从同一 pending operation 临时投影,assistant delta 只能在匹配该 operation 的一个未完成助手气泡中临时绘制且不生成独立整理进度栏 | @@ -80,6 +80,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 - 客户端预检是可绕过的 UX fail-fast:没有可信 receipt,也不复刻生产 opaque-origin。服务端不执行项目 Vite,而是独立重算和校验 source/built/contract 字节、固化不可变 Release;人工审核仍不可绕过。未来若要求 runtime 强门禁,需由可信 verifier 绑定精确构建产物。 - `ProjectType` 由创建请求写入项目配置,UI 与 Host API 不提供类型变更。新项目只写 `interactive_ai_app` 或 `custom`;历史 `mini_game` / `mini_program` 在读取边界归一为 `interactive_ai_app` 且不因读取被改写,缺少类型的旧配置归一为 `custom`。 - 项目创建只拥有 `.makelore/project.json` 和 `knowledge/`。交互式 AI 应用起步树由用户明确调用 Scaffold Skill 生成;Skill 的发布准备度结论不执行也不替代 Main build/preflight/package/upload 或 Works Square 校验与审核。 +- `makelore.project-scaffold` 是代码所有的 bundled `skill_only` Marketplace Plugin。其官方 `.mjs` 只从固定客户端资源根加载;下载 artifact 的扩展名/资产校验没有放宽,仍拒绝 `.mjs`。 - 本地 `projectType` 只选择显式脚手架和内部构建路径,不是可信授权声明;Main 仍需安全打包,服务端仍需独立校验清单和包体。 - 云端确认上传成功后,本机 submission binding 失败只能产生固定、无路径的 `binding_warning`,不能把请求改判为失败;Renderer 仍继续轮询服务端校验与 Release 固化状态。 - 公共播放投影只有在上游 `playable === true`、版本名非空且 URL 通过同源 HTTPS、无 userinfo/loopback、长度、精确路径和无 query/fragment 校验时才可播放;不可信数据 fail closed。 diff --git a/.project-docs/30-worklog/current-state.md b/.project-docs/30-worklog/current-state.md index 978e579..fa3cb5d 100644 --- a/.project-docs/30-worklog/current-state.md +++ b/.project-docs/30-worklog/current-state.md @@ -4,24 +4,31 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Integrated Through -- Interactive AI application and explicit scaffold source `959b633` is integrated - through merge `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952` and canonically reconciled by - task `20260904-reconcile-project-scaffold-f7b4d2a9`. New projects use one +- Interactive AI application source `959b633` and official Marketplace packaging + source `ddb678b46ff10a28e04beeafcfc00c8c8a23ff9f` are integrated through merges + `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952` and + `2bc3e4420852388ce46841e05c1cbf49e80b250c`, then canonically reconciled by tasks + `20260904-reconcile-project-scaffold-f7b4d2a9` and + `20260904-project-scaffold-integration-client-4f2a8c71`. New projects use one `interactive_ai_app` / “交互式 AI 应用” type or `custom`; historical `mini_game` and `mini_program` values normalize at the read boundary without a batch rewrite. - Project creation owns only `.makelore/project.json` and `knowledge/`. The independent - `makelore-project-scaffold` Device Package provides an explicit, non-overwriting, - fixed six-file Vite starter and read-only publication-readiness guidance; it does not - install, build, upload, submit, or approve. Non-empty Skill `scripts/` are now disclosed - as desktop-user executable code and use the non-overridable application Node exposed as - `MAKELORE_NODE_EXECUTABLE`. Main and Works Square retain build, preflight, artifact, + Project creation owns only `.makelore/project.json` and `knowledge/`. The official + code-owned bundled Marketplace Plugin `makelore.project-scaffold` version `1.0.0` + provides the explicit `makelore-project-scaffold` Skill, a non-overwriting fixed + six-file Vite starter, and read-only publication-readiness guidance; it does not + install, build, upload, submit, or approve. Its `.mjs` uses the non-overridable + application Node exposed as `MAKELORE_NODE_EXECUTABLE` and is executable only because + it ships in the fixed signed-client resource root. Downloadable Marketplace artifacts + remain text/image-only and reject `.mjs`; acquisition, project enablement, Agent + assignment, and immutable bundled Release/Admission remain distinct. Main and Works + Square retain build, preflight, artifact, upload, immutable Release, and review authority. Exact integration verification passed the 12-test scaffold suite, 123 focused Vitest tests, typecheck, scoped ESLint, and the Renderer/Main/Preload/utility Vite build. Source evidence additionally includes the project-configuration Electron flow, real scaffold-to-locked-Vite build, plugin/Skill - validation, and installed Device Package prepare→confirm→commit/resource reads. Immutable - distribution plus installed Windows, signed macOS, and native Linux proof remain pending; - no plugin publication, production upload, approval, or remote push is claimed. + validation and bundled resource loading. A packaged-app smoke plus installed Windows, + signed macOS, and native Linux proof remain pending; no live Marketplace migration, + production upload, approval, deployment, or remote push is claimed. - AI Design streamed-reply diagnosis `229b1b1ce39b7f1541a93ea3c980ab82b6d6266c` and client fix `23f96a523eb37d8397bb3766ce95a59d56e59225` from tasks @@ -605,7 +612,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Current Focus -客户端面向非专业用户提供“创建交互式 AI 应用 → 明确调用 Scaffold Skill 生成起步文件 → 项目配置中一键提交 → Main 本地 npm/Vite 构建 → Electron 双视口预检最终产物 → 上传 source+built 双归档与 contract → 运营审核”的唯一创建者链路。项目创建只生成 `.makelore/project.json` 和 `knowledge/`;`makelore-project-scaffold` 只负责不覆盖的固定起步树与只读发布准备度说明,不能安装、构建、上传、提审或批准。Main 对安全源码快照运行安装包内固定 npm 11.6.2 的 `npm ci --ignore-scripts`,再显式调用项目 `package-lock.json` 锁定的 Vite;Vite config/plugins 以当前桌面用户权限执行,因此只适用于用户信任的本地项目,不是 sandbox。预检由 Main 以临时 loopback origin 和 Electron WebContents/CDP 检查与最终 `built_archive` 相同的内存文件字节,覆盖桌面/移动视口、运行错误、白屏和外域访问;不使用 Playwright。该检查仍可由非官方客户端绕过,不产生可信 receipt,也不复刻生产 opaque-origin。服务端不再替客户端运行项目 Vite,而是把源码、构建归档和 contract 视为不可信输入,逐字节重算与校验并固化不可变 Release;人工审核仍不可绕过。`custom` 和缺少类型字段的旧项目不提供该入口;历史 `mini_game` / `mini_program` 只在读取边界归一为规范 `interactive_ai_app`。已发布作品优先使用安全投影后的 `play_url`,`runtime_url` 仅保留一个客户端版本的兼容回退。 +客户端面向非专业用户提供“创建交互式 AI 应用 → 明确调用官方 bundled Project Scaffold Skill 生成起步文件 → 项目配置中一键提交 → Main 本地 npm/Vite 构建 → Electron 双视口预检最终产物 → 上传 source+built 双归档与 contract → 运营审核”的唯一创建者链路。项目创建只生成 `.makelore/project.json` 和 `knowledge/`;`makelore.project-scaffold` 只负责不覆盖的固定起步树与只读发布准备度说明,不能安装、构建、上传、提审或批准。其 `.mjs` 只从签名客户端固定资源加载,Marketplace 下载 artifact 仍拒绝脚本。Main 对安全源码快照运行安装包内固定 npm 11.6.2 的 `npm ci --ignore-scripts`,再显式调用项目 `package-lock.json` 锁定的 Vite;Vite config/plugins 以当前桌面用户权限执行,因此只适用于用户信任的本地项目,不是 sandbox。预检由 Main 以临时 loopback origin 和 Electron WebContents/CDP 检查与最终 `built_archive` 相同的内存文件字节,覆盖桌面/移动视口、运行错误、白屏和外域访问;不使用 Playwright。该检查仍可由非官方客户端绕过,不产生可信 receipt,也不复刻生产 opaque-origin。服务端不再替客户端运行项目 Vite,而是把源码、构建归档和 contract 视为不可信输入,逐字节重算与校验并固化不可变 Release;人工审核仍不可绕过。`custom` 和缺少类型字段的旧项目不提供该入口;历史 `mini_game` / `mini_program` 只在读取边界归一为规范 `interactive_ai_app`。已发布作品优先使用安全投影后的 `play_url`,`runtime_url` 仅保留一个客户端版本的兼容回退。 AI Design Canvas 现在默认以对话和一张持续可见的“我的创作”卡服务 8-16 岁创作者;专业字段矩阵收进按需打开的“精细调整”,移动端保持对话优先并只挂载一个卡片/底部面板。Creation Card、精细调整、Quote、Task 与结果提示都只投影权威状态,已知问题按 code 转成通俗中文,未知服务端或 Provider 文本不会直接显示。一个 Workspace 仍只公开一个 current Direction、一个 persistent Agent Session 和一个 Current Specification;conversation timeline 只记录交互历史。Chat、direct edits、decision responses、proposal acceptance、locks、Asset binding 与 restore 都通过 `design.input.apply` 进入同一服务端 reducer,Renderer drafts 在 accepted 前保持本地。Main 持有 Works Token、stream ticket、WebSocket、request deadline、stable command/operation IDs 与错误脱敏;unknown result 只能复用原 identity,结构化业务错误不得重放。Generation 由服务端对 exact Specification revision 编译 immutable Quote,客户端只展示 public output plan、warnings、expiry 与 Token Points,并以 Quote ID 调用 `design.generation.confirm`;Provider Prompt、model、route、storage 和 billing atoms 不进入 Renderer。Task/Asset events 独立收敛 Workspace resources,不改写 Living Form。Development 与 packaged builds 均使用 Works Square V2,V1 DTO、local semantic adapter、mutable Quote PATCH 与 editable provider Prompt 已移除。 diff --git a/.project-docs/30-worklog/task-history.md b/.project-docs/30-worklog/task-history.md index be9301a..781ad84 100644 --- a/.project-docs/30-worklog/task-history.md +++ b/.project-docs/30-worklog/task-history.md @@ -4,6 +4,7 @@ | Date | Task | Outcome | Docs Updated | |---|---|---|---| +| 2026-09-04 | Official Marketplace Project Scaffold integration | 将 `makelore.project-scaffold` 作为代码所有、随签名客户端交付的 bundled `skill_only` Plugin 接入 Account Library/项目启用/Agent 分配;官方 `.mjs` 不经过下载 artifact,下载包仍保持文本/图片 P0 限制 | ADR-008、current-state、architecture、domain、success criteria、integration task | | 2026-09-04 | 交互式 AI 应用与显式 Scaffold Skill 集成 | 合并小游戏/小程序为规范 `interactive_ai_app`,项目创建保持最小边界,独立 Skill 生成固定起步树并说明发布要求;Main/Works 继续拥有发布权威 | ADR-008、current-state、architecture、domain、commitments | | 2026-08-07 | 客户端登录七天滑动续期 | Main-owned 刷新凭据与真实活动续期 | README、current-state | | 2026-08-08 | Makelore 一键提交审核 | 项目配置单入口,Main 安全打包与幂等提交 | README、architecture、domain | diff --git a/.project-docs/30-worklog/tasks/20260904-marketplace-scaffold-client-6c4e8a21.md b/.project-docs/30-worklog/tasks/20260904-marketplace-scaffold-client-6c4e8a21.md deleted file mode 100644 index 93609ba..0000000 --- a/.project-docs/30-worklog/tasks/20260904-marketplace-scaffold-client-6c4e8a21.md +++ /dev/null @@ -1,52 +0,0 @@ -# Task: Publish scaffold Skill through official Marketplace - -## Identity - -- Task ID: 20260904-marketplace-scaffold-client-6c4e8a21 -- Mode: Feature -- Branch: codex/20260904-integrate-project-scaffold-b6d3e8a1-integrate-project-scaffold -- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260904-integrate-project-scaffold-b6d3e8a1 -- Base commit: 22078060386e38dd5f12af4717dc6c6e3378c2df -- Owner: codex -- Status: Ready for Integration - -## Scope - -- Publish `makelore.project-scaffold` as a code-owned bundled Marketplace plugin. -- Move the existing project-scaffold Skill runtime into `resources/coding-plugins/project-scaffold` so it ships with the signed MakeLore application. -- Register the bundled release in the client plugin registry and preserve the acquire, project-enable, and Agent-assignment lifecycle. -- Cover the official-script boundary with focused manifest, resolver, scaffold, and artifact-package tests. - -## Intent And Constraints - -- The Skill owns creation of the fixed interactive AI application starter and static publish-readiness checks; it does not build, upload, submit, or approve a project. -- Official executable resources may be loaded only from the code-owned bundled plugin root. Downloadable Marketplace artifacts keep the existing text/image-only P0 asset policy, including rejection of `.mjs`. -- Keep one runtime copy of the Skill rather than a Device Package copy plus a bundled copy. -- Use plugin ID `makelore.project-scaffold`, Skill ID `makelore-project-scaffold`, release version `1.0.0`, and minimum client version `2.0.0`. -- Preserve non-overwrite scaffolding and explicit user invocation of the Skill. - -## Outcome - -- Moved the existing scaffold Skill, templates, release reference, and `.mjs` runner into the signed client resource tree at `resources/coding-plugins/project-scaffold`; no second runtime copy remains. -- Added schema-v2 MakeLore capability metadata and retained the portable `.codex-plugin/plugin.json`, both identifying `makelore.project-scaffold` version `1.0.0` and Skill `makelore-project-scaffold`. -- Registered the plugin as a fixed, code-owned, `skill_only` bundled release with ID `00000000-0000-4000-8000-000000000303` and the existing acquire, project-enable, and Agent-assignment lifecycle. -- Narrowed executable-script authority to the fixed bundled root. Downloaded Marketplace ZIPs still reject `.mjs`; they do not install this plugin's runtime. -- Preserved the existing non-overwrite scaffold behavior, legacy `mini_game` / `mini_program` read compatibility, canonical `interactive_ai_app` output, and static publication-readiness guidance. - -## Verification - -- `pnpm exec vitest run tests/unit/coding-plugin-manifest.test.ts tests/unit/coding-plugin-marketplace-client.test.ts tests/unit/project-scaffold-plugin.test.ts --maxWorkers=2`: 54 passed. -- `node --test tests/project-scaffold/scaffold.test.mjs`: 12 passed. -- `pnpm exec vitest run tests/unit/plugin-workspace-model.test.ts tests/unit/coding-plugin-effective-resolver.test.ts tests/unit/coding-composition-paths.test.ts --maxWorkers=2`: 33 passed. -- ESLint on the changed TypeScript files: passed. -- `pnpm run typecheck`: passed. -- Plugin manifest validation: passed. Skill validation: passed with UTF-8 mode and the repository Python environment that provides PyYAML. -- `pnpm test`: 224 test files and 1,879 tests passed, 2 skipped; one unrelated real-process timing assertion exceeded two seconds under full parallel load. Re-running `tests/unit/pi-agent-server-process-real.test.ts` alone with one worker passed all 6 tests, so no unrelated timeout change was made. - -## Follow-ups - -- Run a packaged-app smoke test before the first public client release to prove the signed resource layout and `ELECTRON_RUN_AS_NODE` execution path outside the repository environment. - -## Promotion Candidates - -- Update ADR-008 after integration: project scaffolding is distributed as a code-owned bundled Marketplace plugin, while downloadable artifacts remain non-executable in P0. diff --git a/.project-docs/30-worklog/tasks/20260904-project-scaffold-implementation-7e4c2a91.md b/.project-docs/30-worklog/tasks/20260904-project-scaffold-implementation-7e4c2a91.md deleted file mode 100644 index 90e9837..0000000 --- a/.project-docs/30-worklog/tasks/20260904-project-scaffold-implementation-7e4c2a91.md +++ /dev/null @@ -1,105 +0,0 @@ -# Task: Implement project scaffold Skill plugin - -## Identity - -- Task ID: 20260904-project-scaffold-implementation-7e4c2a91 -- Mode: Feature -- Branch: codex/20260904-diagnose-design-stream-6a4e9c21-diagnose-design-stream -- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260904-diagnose-design-stream-6a4e9c21 -- Base commit: 336e0bb0caf24537b7b0f350aba3e04a37f5544c -- Owner: codex -- Status: Ready for Integration - -## Scope - -- Preserve the current project-creation boundary and add regression coverage proving that no mini-game, mini-program, or custom business scaffold is created. -- Correct the new-project product copy so users are directed to the explicit project-scaffold Skill after creation. -- Expose the application-owned Node executable to direct Pi workers and the shared Agent Server. -- Treat non-empty standard Skill `scripts/` directories as executable code in Device Package preview, confirmation, and details copy. -- Add an independently installable `plugins/makelore-project-scaffold/` package containing one Skill, deterministic scaffold script, fixed templates, submission requirements, and tests. -- Make the Skill itself route publication/readiness requests and carry the current platform contract as four distinct classes: required input, direct blocker, source-package exclusion, and runtime/platform-only confirmation. -- Add regression coverage that keeps the documented source-package exclusion set aligned with the current packager without introducing a second build or publication implementation. -- Verify the unified generated project through the current project packager and local npm/Vite release seam, plus both historical input aliases at the compatibility boundary. -- Replace the two publishable project types with canonical `interactive_ai_app` / “交互式 AI 应用” across creation, configuration, packaging, the scaffold Skill, and Works Square-facing metadata while retaining read compatibility for existing `mini_game` and `mini_program` projects. - -## Intent And Constraints - -- Implement accepted proposal `ML-PROJECT-SCAFFOLD-001` without restoring project-creation side effects. -- Keep immutable `.makelore/project.json.projectType` as the only scaffold selector; do not add scaffold state, a template migration layer, `--force`, or a dedicated Pi extension/tool. -- Execute scaffolding only through the existing Pi `bash` project write lease and `MAKELORE_NODE_EXECUTABLE`; do not fall back to system Node or Python. -- Never overwrite target files. Preflight the full fixed target set and roll back only files/directories created by the current handled invocation. -- Preserve Main-owned fixed npm/Vite build, source/built artifact contract, browser preflight, and Works Square operational review as the release authority. -- Keep feature-task writes within product code, tests, this task record, and task-prefixed supporting records; canonical project memory changes remain promotion candidates for Integration Gate. -- Stage the plugin source under `plugins/makelore-project-scaffold/` for local Device Package installation. Immutable Git tagging, publication, and cross-platform packaged smoke remain release follow-ups and are not claimed by this task. - -## Outcome - -- Confirmed the request's original deletion premise was already true on base `336e0bb`: Project Service creates only `.makelore/project.json` and `knowledge/`. Added creation regressions for the canonical interactive type and `custom`, and removed the Sidebar promise that project creation itself makes a publishable scaffold. -- Added the non-overridable `MAKELORE_NODE_EXECUTABLE` host contract to both direct Pi workers and the shared Agent Server process. A worker overlay cannot spoof the application-selected executable path. -- Extended Device Package inspection so a declared Skill with a non-empty standard `scripts/` subtree is executable code. Skill-only script packages retain `kind: skill-only`, require the existing cross-turn executable confirmation, and show Skill-specific file/network/process authority copy in preview and plugin details. Existing Pi-extension and mixed packages retain executable warnings. -- Added `plugins/makelore-project-scaffold/` as a standard, independently versioned `0.1.0` plugin with one Skill and no Pi extension. Its package and plugin manifests are same-name/same-version and have no install lifecycle scripts. -- Added a deterministic Node-only `scaffold.mjs` selected exclusively by `.makelore/project.json.projectType`. It accepts only `--project-root`, creates one fixed six-file interactive AI application target set, reads all templates and preflights every target before writing, uses exclusive creation, preserves unrelated files, returns the flat version-1 JSON protocol, and rolls back only current-invocation files/directories on handled write failure. It provides no `--force`, type override, migration state, dependency install, network request, or publisher replacement. -- Regenerated the Vite 7.3.1 lockfile with the repository's fixed npm 11.6.2 and verified the unified template through source packaging and a real locked npm/Vite build. Added an approval-readiness reference that distinguishes static preparation from authoritative Main build/preflight/upload and Works Square operational review. -- Expanded the Skill's model-invocation routing and package-facing copy so requests about publishing, one-click submission, forbidden content, failure causes, or release readiness enter an explicit read-only readiness workflow. Project-specific reports now separate confirmed blockers, excluded-package impact, runtime/platform checks, and statically proven requirements, cite project-relative evidence, and use bounded conclusions that never claim approval. -- Reconciled the bundled publication reference against the current project packager, fixed npm/Vite release builder, static-artifact browser preflight, and Works submission route. It now records the full schema-v2 project prerequisite, root build inputs, exact size/count limits, direct path/link/output blockers, root `release.json` prohibition, both viewports and runtime failures, first-submit metadata/cover contract, and the exact case-insensitive excluded directory/file/suffix sets plus dynamic `.env`, credential JSON, Terraform, and `works-` patterns. -- Kept exclusion semantics explicit: excluded paths may remain in a project and are not blockers by existence; the Skill reports their effect only when required source or assets depend on them. The reference also states that an HTTP(S) literal is only a risk until the authoritative preflight makes an actual cross-origin request. -- Did not add a release-check script, duplicate packager, local dependency install, Vite invocation, browser launch, upload, or submission path to the plugin. Main and Works Square remain the only execution and approval authorities. -- Verified the real plugin through Device Package prepare, later-turn confirmation, commit, enabled-resource resolution, and installed script/template/reference reads. -- Replaced the two new-project values with canonical `interactive_ai_app` / “交互式 AI 应用”. New creation, generated `niancode.yml`, submission metadata, and publish UI use only the canonical value. Existing `mini_game` and `mini_program` configs normalize at the read boundary; a read or scaffold invocation does not rewrite the original config, while a later ordinary config mutation may persist the normalized value. -- Replaced the two business-specific starter trees with one generic interactive Vite starter. The scaffold continues to accept both historical values solely as compatibility aliases and reports the canonical type. -- Added the task-owned interactive-type proposal instead of modifying accepted ADRs or canonical project memory in feature mode. -- No existing user project files were removed or migrated. No plugin tag was published and the plugin was not silently installed into the running application. - -## Verification - -- `node --test plugins/makelore-project-scaffold/tests/scaffold.test.mjs`: 12 passed. Covers the canonical value, both historical aliases, exact unified output tree, metadata preservation, conflicts, invalid/missing/custom configs, invalid CLI, missing template, Chinese/space paths, and handled-write rollback. -- Focused type/scaffold/release/UI regressions: 7 Vitest files and 107 tests passed. -- `pnpm typecheck` and scoped ESLint over the changed type, configuration, packaging, UI, route, and test files passed. -- Desktop project-configuration Playwright E2E: 1 passed; the new-project dialog exposed only “交互式 AI 应用” and `custom`, and the publish action remained available for the canonical type. -- Real unified-template smoke: the actual scaffold ran in a verified temporary directory, fixed npm 11.6.2 completed `ci --ignore-scripts`, Vite 7.3.1 built successfully, and non-empty `dist/index.html` was produced; the temporary directory was removed. -- Plugin creator validation passed; Skill creator `quick_validate.py` returned `Skill is valid!` under explicit Python UTF-8 mode. -- `pnpm run build:vite` passed for Renderer, Main, Preload, and utility worker. Only existing Browserslist, mixed-import, and large-chunk warnings remained. -- Full serial main suite: 225/226 files passed; 1886 tests passed and 2 skipped. The only failure was the existing Pi Agent Server two-Bash-call wall-clock assertion (`2657ms < 2000ms`). An immediate isolated rerun again exceeded the fixed threshold (`2170ms`) while its other 5 tests passed; no project-type/scaffold path is involved and this task did not relax the threshold. The separately excluded pressure suite passed 1/1. -- Earlier focused Device Package, Pi environment, Plugin Details, release-builder, and browser-preflight suites recorded by this same task remained green; the type follow-up did not modify those implementations. -- Final `git diff --check` and task-aware project-doc drift check passed; only the task record and task-prefixed proposal changed under `.project-docs/`. -- Merge handoff re-ran `git diff --check` and the task-aware drift check after the explicit integration request; both remained green and no product files changed during handoff. - -## Follow-ups - -- Release `SCF-060`: move or mirror the staged plugin source to the chosen independent distribution repository, create an immutable SemVer tag, document the Device Package install source, and complete a small real-user prepare → confirm → install → initialize trial. Distribution location remains a product/release decision; this task does not invent it. -- Before claiming packaged support, run the Skill through an installed MakeLore build with the actual packaged executable and Git Bash on Windows. Run equivalent packaged smoke on macOS and native Linux; only then claim three-platform support. -- Verify enable/disable, upgrade to a second immutable version, downgrade/reinstall of a known version, and uninstall semantics. Uninstall must not delete files already created in user projects. -- Official Marketplace Skill artifacts currently reject executable `.mjs` assets. Continue using Device Package/Git distribution unless a separately approved Marketplace artifact policy adds executable Skill support. -- Track the existing `pi-agent-server-process-real` `<2000ms` assertion as a separate performance-test stability issue; it currently exceeds the threshold both under the full serial suite and in one isolated rerun, while its functional assertions pass. -- After code/plugin integration and release acceptance, run an Integration Gate task to promote the canonical project-creation and Device Package facts listed below. - -## Promotion Candidates - -- **Canonical interactive AI application type** - - Target canonical documents: `.project-docs/10-decisions/`, `.project-docs/30-worklog/current-state.md`, `.project-docs/40-domain/glossary.md`, `.project-docs/40-domain/business-rules.md`, and relevant architecture/data-flow summaries. - - Proposal: replace the distinct new-project `mini_game` / `mini_program` values and templates with `interactive_ai_app` / “交互式 AI 应用” and one generic interactive Vite scaffold; retain both old values only as historical read aliases. - - Evidence: shared/config normalizer and regressions, new-project E2E, canonical package/submission tests, all three scaffold input tests, real unified-template build, and task proposal `20260904-project-scaffold-implementation-7e4c2a91__interactive-ai-app-type.md`. - - Future impact: future templates and publishing rules evolve against one stable product type while existing local projects continue to open and publish without a batch rewrite. - - Semantic conflicts: supersedes the canonical two-publishable-type classification and any separate mini-game/mini-program template promises; it preserves fixed npm/Vite build, approval, and immutable release rules. - - Human confirmation required: no additional product decision is required because the user explicitly requested the merge; Integration Gate review is still required before canonical writes. -- **Project creation / scaffold ownership** - - Target canonical documents: `.project-docs/30-worklog/current-state.md`, `20-architecture/system-overview.md`, `20-architecture/data-flow.md`, `40-domain/glossary.md`, `40-domain/business-rules.md`; add a new integration entry to `30-worklog/task-history.md` rather than rewriting historical task rows. - - Proposal: replace current-state claims that mini-game/program creation atomically generates Vite templates with the accepted three-boundary model: Project Service owns only project metadata and `knowledge/`; explicit `makelore-project-scaffold` Skill owns starter files; Main/Works release code owns build, preflight, packaging, upload, and review state. - - Evidence: `electron/coding-projects/project-config.ts`, the canonical/custom creation regression, plugin script/tests, unified-template build smoke, and accepted proposal `ML-PROJECT-SCAFFOLD-001`. - - Future impact: prevents UI/docs/agents from assuming a newly created project is immediately publishable and keeps template evolution independent from project identity. - - Semantic conflicts: supersedes the integrated 2026-08-09 current-state claim; old task records remain historical evidence and must not be edited. - - Human confirmation required: no for factual promotion after the implementation commit is integrated; yes if product wants automatic/bundled initialization instead of the accepted explicit Skill boundary. -- **Executable Skill scripts and host runtime** - - Target canonical documents: `.project-docs/30-worklog/current-state.md`, `20-architecture/system-overview.md`, `20-architecture/module-map.md`, `20-architecture/data-flow.md`, and `40-domain/business-rules.md`. - - Proposal: state that a Device Package Skill with a non-empty standard `scripts/` subtree is executable code requiring preview disclosure and later-turn confirmation even when `kind` remains `skill-only`; parent worker/Agent Server environments expose the non-overridable application Node path through `MAKELORE_NODE_EXECUTABLE`. - - Evidence: `device-package-format.ts`, `device-package-manager.ts`, Plugin Details UI/tests, both Pi process tests, real package prepare/commit test, and Windows Git Bash quoting smoke. - - Future impact: keeps permission messaging accurate for script-backed Skills and gives portable Skills an application-owned runtime without PATH fallback. - - Semantic conflicts: current canonical wording mentions executable Pi extensions only. Existing rule that child workers receive no Device Package resources remains unchanged. - - Human confirmation required: no for promotion after integration; actual packaged platform claims still require the release smokes in Follow-ups. -- **Release obligation** - - Target canonical document: `.project-docs/80-commitments/commitments.md`. - - Proposal: fold this plugin's actual packaged Windows/macOS/Linux execution and Device Package lifecycle trial into the existing client release commitment instead of creating a parallel release gate. - - Evidence: workspace Windows Git Bash and real release-builder smokes are green; immutable tag, installed-app execution, macOS, and Linux evidence are absent. - - Future impact: prevents workspace-only evidence from being mistaken for a distributable cross-platform release. - - Semantic conflicts: the existing commitment already warns that workspace prepare tests do not replace final packaged proof; preserve that stricter rule. - - Human confirmation required: release owner confirmation is required before marking the commitment complete or choosing the public distribution location. diff --git a/.project-docs/30-worklog/tasks/20260904-project-scaffold-integration-client-4f2a8c71.md b/.project-docs/30-worklog/tasks/20260904-project-scaffold-integration-client-4f2a8c71.md new file mode 100644 index 0000000..95d925d --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260904-project-scaffold-integration-client-4f2a8c71.md @@ -0,0 +1,50 @@ +# Task: Integrate official project scaffold plugin + +## Identity + +- Task ID: 20260904-project-scaffold-integration-client-4f2a8c71 +- Mode: Integration +- Branch: codex/20260904-project-scaffold-integration-client-4f2a8c71-project-scaffold-integration-client +- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260904-project-scaffold-integration-client-4f2a8c71 +- Base commit: 336e0bb0caf24537b7b0f350aba3e04a37f5544c +- Owner: codex +- Status: Ready for Integration + +## Scope + +- Integrate the four-commit interactive-AI-application scaffold chain ending at `ddb678b46ff10a28e04beeafcfc00c8c8a23ff9f` onto the committed `main` frontier `336e0bb0caf24537b7b0f350aba3e04a37f5544c`. +- Reconcile ADR-008 and the canonical architecture/current-state records with the final official Marketplace delivery model. +- Verify the merged client tree and prepare it for safe default-branch promotion without touching the unowned dirty primary checkout. + +## Intent And Constraints + +- Preserve normal Git ancestry; do not rebase, squash, rewrite history, or resolve semantic conflicts by choosing a side mechanically. +- The executable `.mjs` authority belongs only to the fixed code-owned plugin bundled in the signed MakeLore client. Downloadable Marketplace artifacts retain the text/image-only P0 policy. +- Preserve `interactive_ai_app` as the canonical new type and `mini_game` / `mini_program` only as read compatibility aliases. +- Do not package, install, publish, deploy, push, or modify the unknown files in the primary `main` checkout. + +## Outcome + +- Merged the four-commit source chain ending at `ddb678b46ff10a28e04beeafcfc00c8c8a23ff9f` with a normal `--no-ff` merge at `2bc3e4420852388ce46841e05c1cbf49e80b250c`. +- Reconciled ADR-008 and the canonical architecture, domain, success-criteria, current-state, and history records to describe `makelore.project-scaffold` as a code-owned official bundled Marketplace plugin. +- Preserved the narrow execution boundary: the fixed bundled resource root may contain and run `scaffold.mjs`; downloadable Marketplace artifact ingestion remains text/image-only and rejects `.mjs`. +- Kept `interactive_ai_app` canonical while retaining `mini_game` and `mini_program` only as read-compatibility aliases. +- Excluded source-task-owned records from the integrated tree; they remain immutable on their source branches and reachable through the recorded source commits. + +## Verification + +- `validate_plugin.py resources/coding-plugins/project-scaffold` passed. +- `quick_validate.py resources/coding-plugins/project-scaffold/skills/makelore-project-scaffold` passed. +- Focused Vitest integration set: 6 files, 88 tests passed. +- Scaffold Node test suite: 12 tests passed. +- `pnpm typecheck` passed. +- `git diff --check`, `check_project_docs.py`, and the task-aware documentation drift check passed after reconciliation. + +## Follow-ups + +- Promote this integration branch to `main` only after the unowned dirty primary checkout is made clean or explicitly adopted by its owner; this task did not touch those files. +- Packaging, deployment, pushing, and live Marketplace publication remain separate authorized operations. + +## Promotion Candidates + +- None. Accepted project-memory changes were applied directly under the Integration Gate. diff --git a/.project-docs/30-worklog/tasks/20260904-reconcile-project-scaffold-f7b4d2a9.md b/.project-docs/30-worklog/tasks/20260904-reconcile-project-scaffold-f7b4d2a9.md deleted file mode 100644 index ce73b4f..0000000 --- a/.project-docs/30-worklog/tasks/20260904-reconcile-project-scaffold-f7b4d2a9.md +++ /dev/null @@ -1,76 +0,0 @@ -# Task: Reconcile interactive AI app scaffold Skill - -## Identity - -- Task ID: 20260904-reconcile-project-scaffold-f7b4d2a9 -- Mode: Integration -- Branch: codex/20260904-integrate-project-scaffold-b6d3e8a1-integrate-project-scaffold -- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260904-integrate-project-scaffold-b6d3e8a1 -- Base commit: 4bc3e0ea5331a7d3f3576768c0119c02c0f0f952 -- Owner: codex -- Status: Ready for Integration - -## Scope - -- Promote the reviewed and already-merged scaffold/type behavior from base commit - `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952` into a client ADR, - canonical architecture/domain memory, current state, history, and commitments. -- Record one `interactive_ai_app` product type, explicit Scaffold Skill ownership, - executable Skill-script disclosure, and remaining installed-build release gates. - -## Intent And Constraints - -- Project creation owns only project metadata and `knowledge/`; the Skill must be - explicit and non-overwriting and may not duplicate build/upload/review authority. -- Historical types normalize without a batch rewrite; `custom` remains - non-publishable. -- Main retains fixed npm/Vite build/preflight/package/upload authority and Works - Square retains validation and review authority. -- Source task records/proposals and the primary checkout's unrelated files remain - untouched. - -## Outcome - -- Added ADR-008 and reconciled canonical brief, architecture, domain, current-state, - history, and release commitments with the reviewed source already present at the - task base. -- Established `interactive_ai_app` as the only new publishable product type and kept - `mini_game` / `mini_program` solely as non-rewriting historical read aliases. -- Recorded the three-owner boundary: Project Service creates metadata and `knowledge/`; - the explicit Device Package Skill creates the fixed starter and explains readiness; - Main/Works Square remain the sole build, upload, validation, Release, and approval - authorities. -- Recorded non-empty Skill `scripts/` as executable code requiring disclosure and later - confirmation, with `MAKELORE_NODE_EXECUTABLE` as the application-owned runtime path. -- Folded immutable distribution and installed Windows/signed macOS/native Linux proof - into the existing release commitments. No plugin publication, deployment, production - submission, approval, or remote push was performed. - -## Verification - -- Exact integration tree `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952`: - scaffold Node suite 12/12; focused project/device/publish Vitest suite 123/123; - `pnpm run typecheck`; scoped ESLint; and `pnpm run build:vite` all passed. -- Source task evidence retained: project-configuration Electron E2E 1/1, real - scaffold → fixed npm 11.6.2 → locked Vite build, plugin creator validation, - Skill creator validation, and real Device Package prepare → confirm → commit → - resource reads passed. -- `git diff --check`: passed. -- `check_project_docs.py --target .`: passed. -- `check_doc_drift.py --target . --task-id - 20260904-reconcile-project-scaffold-f7b4d2a9`: passed; only Integration-owned - canonical memory and this task record are changed. -- Canonical consistency scan found only intentional compatibility statements and - preserved historical task/current-state entries for the superseded dual-type model. - -## Follow-ups - -- Distribute the scaffold plugin from an immutable SemVer/Git source and run the - already-recorded installed-package proofs before claiming platform support. -- Deploy the matching server before the client, then run the real-account - create → scaffold → build → submit → approve → CDN/App playback chain. - -## Promotion Candidates - -- None. This Integration task promoted the accepted source candidates directly into - canonical project memory. diff --git a/.project-docs/40-domain/business-rules.md b/.project-docs/40-domain/business-rules.md index d08e4cd..a5ba2f2 100644 --- a/.project-docs/40-domain/business-rules.md +++ b/.project-docs/40-domain/business-rules.md @@ -63,8 +63,14 @@ unified `/plugins` workspace and never enter Account Library, Marketplace Package Store, Release, Channel, Admission, project enablement, Agent assignment, or server billing state. +- Code-owned official bundled Plugins may be `platform_hosted` or `skill_only`. + `makelore.project-scaffold` retains Account Library, project enablement, Agent + assignment, Release, and Admission state while its exact Skill/templates/`.mjs` + ship only in the signed client. Downloadable Marketplace artifacts remain P0 + text/image-only and must reject `.mjs`; official bundled authority is not inferred + from provider metadata or an uploaded ZIP. - 面向用户的 AI 编程新建流程必须在 `interactive_ai_app`(“交互式 AI 应用”)和 `custom` 中选择;`ProjectType` 是产品类型,创建后不能通过 UI 或 Host API 修改。历史 `mini_game` / `mini_program` 仅在读取边界归一为 `interactive_ai_app`,读取本身不改写配置;未传类型的兼容 API 调用按 `custom` 处理。 -- 新建项目只原子生成 `.makelore/project.json` 和 `knowledge/`。交互式 AI 应用的固定六文件 Vite 起步树只能由用户明确调用 `makelore-project-scaffold` Skill 生成;脚本必须先预检全部目标、不得覆盖已有路径,受控失败只回滚本次创建内容,且不得安装依赖、访问网络、构建、上传或提交审核。 +- 新建项目只原子生成 `.makelore/project.json` 和 `knowledge/`。交互式 AI 应用的固定六文件 Vite 起步树只能由用户明确调用官方 bundled `makelore.project-scaffold` Plugin 中的 `makelore-project-scaffold` Skill 生成;脚本必须先预检全部目标、不得覆盖已有路径,受控失败只回滚本次创建内容,且不得安装依赖、访问网络、构建、上传或提交审核。 - `ProjectType` 不等于 `BuildPreset` 或 Scaffold 状态:规范可发布类型映射到内部受控 Vite preset;本地 `projectType` 和 Skill 检测结果都不是授权边界,Main-owned 安全打包、Host API 和服务端包体校验仍必须执行。 - 非专业用户只执行一次“提交审核”;构建通过后由运营审核,审核通过即直接发布。 - 创建者发布唯一链路是项目配置“一键提交审核” → Main 本地 npm/Vite 构建 → 最终 built snapshot 的客户端 UX 预检 → source+built+artifact contract 上传 → 服务端校验/固化 → 运营审核;不恢复独立发布上传页、云部署工作台、Compose/deploy-check、自动 watcher/arm/upload 或手工 ZIP 入口。 diff --git a/.project-docs/40-domain/glossary.md b/.project-docs/40-domain/glossary.md index d9ae43f..471cd0b 100644 --- a/.project-docs/40-domain/glossary.md +++ b/.project-docs/40-domain/glossary.md @@ -4,7 +4,7 @@ |---|---|---| | `ProjectType` | 创建项目时选择且之后不可变的产品类型 | 规范值为 `interactive_ai_app`、`custom`;历史 `mini_game` / `mini_program` 读取时归一为前者,缺少字段按 `custom` 处理 | | `BuildPreset` | 平台内部用于构建和验收项目包的受控实现 | 不等于 `ProjectType` 或 Scaffold 状态;交互式 AI 应用使用固定 Vite preset | -| Project Scaffold Skill | 用户明确调用、独立版本化的起步文件生成与发布准备度指导 | 不覆盖路径、不安装/构建/上传/提审;项目创建服务和 Main/Works 发布权威不属于该 Skill | +| Project Scaffold Skill | 官方 bundled Marketplace Plugin `makelore.project-scaffold` 中由用户明确调用、独立版本化的起步文件生成与发布准备度指导 | `.mjs` 只来自固定客户端资源;不覆盖路径、不安装/构建/上传/提审;项目创建服务和 Main/Works 发布权威不属于该 Skill | | Main-owned Release Build | Electron Main 对安全源码快照执行固定 npm 与项目 lockfile Vite 的本地构建 | Vite config/plugins 以桌面用户权限执行,不是 sandbox;Renderer 不获得路径、归档或 origin | | Artifact Contract | 与 source/built 双归档一并上传的严格版本化清单 | 服务端把三者视为不可信输入并独立逐字节重算、校验 | | Built Artifact Preflight | 上传前对最终 built snapshot 的同一内存字节执行桌面/移动 Electron WebContents/CDP 检查 | 可绕过 UX fail-fast;无可信 receipt,不复刻生产 opaque-origin |