From 22078060386e38dd5f12af4717dc6c6e3378c2df Mon Sep 17 00:00:00 2001 From: brother7 <7brother7@gmail.com> Date: Fri, 4 Sep 2026 21:09:55 +0800 Subject: [PATCH] docs: reconcile interactive AI app scaffold boundary --- .project-docs/00-brief/success-criteria.md | 5 +- .../adr-008-interactive-ai-app-scaffold.md | 39 ++++++++++ .project-docs/10-decisions/decision-index.md | 1 + .project-docs/20-architecture/data-flow.md | 11 +-- .project-docs/20-architecture/module-map.md | 8 +- .../20-architecture/system-overview.md | 13 ++-- .project-docs/30-worklog/current-state.md | 24 +++++- .project-docs/30-worklog/task-history.md | 1 + ...904-reconcile-project-scaffold-f7b4d2a9.md | 76 +++++++++++++++++++ .project-docs/40-domain/business-rules.md | 15 ++-- .project-docs/40-domain/glossary.md | 6 +- .project-docs/80-commitments/commitments.md | 4 +- 12 files changed, 174 insertions(+), 29 deletions(-) create mode 100644 .project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md create mode 100644 .project-docs/30-worklog/tasks/20260904-reconcile-project-scaffold-f7b4d2a9.md diff --git a/.project-docs/00-brief/success-criteria.md b/.project-docs/00-brief/success-criteria.md index 711821a..0d84260 100644 --- a/.project-docs/00-brief/success-criteria.md +++ b/.project-docs/00-brief/success-criteria.md @@ -6,7 +6,8 @@ ## Task Completion Standard -- 可发布小游戏/小程序的一键提交必须由 Electron Main 对安全源码快照执行固定 npm 11.6.2 的 `npm ci --ignore-scripts`,并调用项目 `package-lock.json` 锁定的 Vite 生成静态产物。 +- 可发布交互式 AI 应用的一键提交必须由 Electron Main 对安全源码快照执行固定 npm 11.6.2 的 `npm ci --ignore-scripts`,并调用项目 `package-lock.json` 锁定的 Vite 生成静态产物。 +- Project Scaffold Skill 可生成固定起步文件并只读说明发布要求、禁止项和证据缺口,但不得安装依赖、构建、上传、提审或把静态检查表述为平台批准。 - Electron 双视口预检必须检查与最终 `built_archive` 相同的内存文件字节;预检失败不得上传,预检成功不得被表述为可信审核凭据。 - 上传协议必须同时携带源码归档、构建归档和严格版本化 artifact contract;服务端独立重算摘要、校验合同并固化不可变 Release。 - Renderer 不得获得发布凭据、归档、临时目录、构建 origin 或任意本地路径;旧客户端和旧 sandbox/browser 任务必须提示升级后重新构建提交。 @@ -37,4 +38,4 @@ ## Last Reviewed -2026-08-31 +2026-09-04 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 new file mode 100644 index 0000000..f80ae7c --- /dev/null +++ b/.project-docs/10-decisions/adr-008-interactive-ai-app-scaffold.md @@ -0,0 +1,39 @@ +# ADR-008: 交互式 AI 应用使用显式 Scaffold Skill + +- Status: Accepted / implemented +- Date: 2026-09-04 +- Applies to: Project creation, `ProjectType`, Device Packages, scaffold Skill, release readiness + +## Context + +历史客户端把 `mini_game` 和 `mini_program` 作为两个可发布产品类型,并在创建项目时自动生成两套业务模板。这把项目身份、起步文件和发布规则绑定在同一次创建操作中,使模板演进和平台发布约束难以独立维护。 + +项目服务当前已经只负责 `.makelore/project.json` 与 `knowledge/`。用户确认将小游戏和小程序合并为一个“交互式 AI 应用”类型,并把生成文件、目录以及提交审批要求放进可独立分发的 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 应用起步文件;写入前预检全部目标,不覆盖已有路径,受控失败时只回滚本次创建的文件和目录。 +- Scaffold Skill 不安装依赖、不访问网络、不执行构建、不上传、不提交审核,也不提供 `--force`、类型覆盖或模板迁移状态。Main 继续独占固定 npm/Vite 构建、同字节预检、打包和上传;Works Square 继续独占服务端校验、不可变 Release 与运营审核。 +- 非空标准 Skill `scripts/` 目录属于可执行代码,即使 Device Package 仍为 `skill-only`,也必须在预览和独立后续确认中披露文件、网络、进程及桌面用户权限。应用通过不可覆盖的 `MAKELORE_NODE_EXECUTABLE` 向父 Pi worker/Agent Server 提供自身 Node;不得回退系统 Node。 +- Skill 的发布检查只是只读准备度指导:区分确定阻断、源码包排除影响、运行时/平台待确认项和静态已满足项,并引用项目相对证据。它不能宣称构建、上传、审核或生产发布成功。 + +## Consequences + +- 模板可随独立插件版本演进,不再扩大项目创建服务的职责。 +- 旧项目无需批量迁移即可继续打开、生成脚手架和发布;新写入只使用规范类型。 +- 发布规则在 Skill 中可被 Agent 解释和预检,但权威执行仍只有 Main 与 Works Square,避免形成第二套发布实现。 +- 对外分发仍需不可变 SemVer/Git 版本、真实 Device Package 安装链和已安装 Windows、签名 macOS、native Linux 运行证据;工作区测试不能替代这些发布门禁。 + +## Supersedes + +本决定取代 2026-08-09 的双可发布类型与创建时自动生成模板行为;固定 Vite 构建、artifact contract、运营审核与公共播放边界保持不变。 + +## Related Evidence + +- Source commit: `959b633` +- Integration merge: `4bc3e0ea5331a7d3f3576768c0119c02c0f0f952` +- Source task: `20260904-project-scaffold-implementation-7e4c2a91` +- 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 f98edc2..8c5fe12 100644 --- a/.project-docs/10-decisions/decision-index.md +++ b/.project-docs/10-decisions/decision-index.md @@ -4,6 +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-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/20-architecture/data-flow.md b/.project-docs/20-architecture/data-flow.md index cd6a2d4..e49ae7d 100644 --- a/.project-docs/20-architecture/data-flow.md +++ b/.project-docs/20-architecture/data-flow.md @@ -8,13 +8,14 @@ | 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. | | 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. Confirmation explicitly states that Pi extensions execute with desktop-user authority. Active workers retain their frozen generation until the turn settles; child workers remain empty. | +| 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. | | Hosted Game Resource operation | Eligible parent `makelore.game-resource` tool call plus explicit confirmation | frozen Plugin adapter → capability Registry → Main `GameResourceClient` → fixed Works Square game-resource route → provider-neutral receipt/result | Server policy owns pricing, payer, Admission and receipt state. Stable logical operation identity survives response loss/Main restart; `submission_unknown` is not replayed as a fresh request. Result saving uses a bounded project-relative path and the existing project write lease. | | 桌面认证生命周期 | 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 项目初始化 | 创建时固定 `ProjectType`;小游戏/小程序原子生成受控模板,自定义只生成项目空间 | -| 一键提交 | `ProjectPublishAction` | Renderer capability → Host API → Main 本地 npm/Vite build → built snapshot preflight → source+built+contract 上传 | 只对小游戏/小程序开放;首次 create 通过单一 multipart 合同原子提交文字资料与必选 PNG/JPEG/WebP 封面,创建失败或冲突不上传版本;已有 draft/published 只提交版本并沿用云端资料/封面,不做无条件 metadata PATCH | +| 项目创建 | 新建项目对话框 | Host API → Main 项目初始化 | 固定 `interactive_ai_app` 或 `custom`,只生成 `.makelore/project.json` 与 `knowledge/`;历史双类型在读取边界归一,不因读取改写 | +| 显式项目脚手架 | 用户在交互式 AI 应用 Conversation 中要求初始化 | Pi `bash` + 项目 write lease → `MAKELORE_NODE_EXECUTABLE` → `makelore-project-scaffold` 脚本 | 固定六文件目标;全量预检、不覆盖、受控失败只回滚本次路径;不安装依赖、不联网、不构建、不上传、不提审 | +| 一键提交 | `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;落盘失败返回固定告警但不反转提交 | | 运营发布 | Works Square 审核与交付 | 公共 `play_url` | 客户端只消费服务端发布结果;真实合同校验 → OSS/CDN 生产链仍待整链验收 | @@ -42,7 +43,7 @@ ## State Ownership - Main 持有刷新凭据、发布 Token、固定 npm runtime、源码/构建归档、临时目录、幂等键和 submission binding v2;Renderer 不持有归档路径、构建 origin 或自动部署状态。 -- 项目内 `.makelore/project.json` 是 `ProjectType`、Agent 与 Coding 项目配置的唯一权威;Main 在配置写入和目录复用时保持 `ProjectType` 不可变,并在打包时重新读取校验。 +- 项目内 `.makelore/project.json` 是 `ProjectType`、Agent 与 Coding 项目配置的唯一权威;Main 在配置写入和目录复用时保持 `ProjectType` 不可变,并在打包时重新读取校验。历史 `mini_game` / `mini_program` 只在内存中归一为 `interactive_ai_app`,读取和脚手架运行不改写原文件。 - Renderer 仅持有短效公开会话状态和提交展示状态。 - Renderer 可持久化当前账号的四布尔模块入口策略,但不持有原始 Works profile 或 Token。新账号不继承上一账号缓存;网络/暂时上游失败可保留同会话已知策略,终止性 `401` 不得回退到默认开启。 - 本地构建临时目录、HTTP origin 和预检 WebContents/partition 只属于一次调用;预检读取与 `built_archive` 相同的内存字节,但结果不写为可信上传 receipt,也不覆盖生产 opaque-origin。 @@ -80,4 +81,4 @@ ## Last Updated -2026-09-03 +2026-09-04 diff --git a/.project-docs/20-architecture/module-map.md b/.project-docs/20-architecture/module-map.md index 5b9fc8c..4afc58d 100644 --- a/.project-docs/20-architecture/module-map.md +++ b/.project-docs/20-architecture/module-map.md @@ -8,10 +8,12 @@ | `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. | -| `electron/coding-packages/**`, `electron/api/routes/device-packages.ts`, `shared/device-packages.ts`, and `src/stores/device-packages.ts` | Main-owned conversation install preview/confirmation/commit, immutable local package generations, safe Renderer projection, and parent-worker refresh | Sources are npm, Git, absolute local Plugin directories, or loose `SKILL.md`. Lifecycle scripts are disabled; executable extensions run with desktop-user authority after explicit confirmation. Every generation projects all explicitly installed and currently enabled Skills/extensions; Device Packages never join Account Library, Marketplace Package Store, Release, Channel, or Admission state. | +| `electron/coding-packages/**`, `electron/api/routes/device-packages.ts`, `shared/device-packages.ts`, and `src/stores/device-packages.ts` | Main-owned conversation install preview/confirmation/commit, immutable local package generations, safe Renderer projection, and parent-worker refresh | Sources are npm, Git, absolute local Plugin directories, or loose `SKILL.md`. Lifecycle scripts are disabled; executable extensions and non-empty Skill `scripts/` run with desktop-user authority after disclosure and explicit confirmation. Every generation projects all explicitly installed and currently enabled Skills/extensions; Device Packages never join Account Library, Marketplace Package Store, Release, Channel, or Admission state. | | `electron/coding-plugins/adapters/game-resource.ts` and `electron/services/game-resource-client.ts` | Provider-neutral `makelore.game-resource` hosted tool adapter and Main-owned Works Square transport | Tools materialize only from an eligible frozen `platform_hosted` parent snapshot. Metered mutations require explicit confirmation and stable logical operation identity; Renderer/Pi never receive Provider URLs, credentials, balances, raw responses, or Provider job IDs. | | `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 实现 | | `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 以桌面用户权限执行 | @@ -59,7 +61,7 @@ - Plugin sidebar/legacy links → canonical `/plugins` projection → existing Renderer stores → bounded Main Marketplace and Device Package routes. Compatibility routes replace-redirect into deterministic filters and do not create a second lifecycle. - Hosted Plugin parent tool → frozen Registry adapter → Main `GameResourceClient` → fixed Works Square game-resource routes. Stable logical operation identity survives response loss and Main restart; ambiguous submission remains reviewable and is never converted into an automatic fresh mutation. Saving a result uses the existing bounded project path and project write lease. - AI 编程 Renderer product Snapshot/commands → typed `/api/coding/*` Host API → Main Coding composition → target `CodingConversationRuntime` → shared Agent Server 内的目标 Pi 逻辑线程;Pi Provider 请求再经 Main AI proxy 访问模型上游。Renderer 不持有 Pi wire、凭据或本地 runtime URL。 -- Project configuration 决定产品分流;Main release builder 生成 source/built/contract,服务端独立重算和校验决定发布安全,本地 `ProjectType` 不是授权结论。 +- Project configuration 只决定产品身份与分流;用户显式调用 Scaffold Skill 才生成固定起步文件;Main release builder 生成 source/built/contract,服务端独立重算和校验决定发布安全。本地 `ProjectType` 或 Skill 准备度结论都不是授权结论。 - Built artifact preflight 检查最终上传的同字节快照,但客户端可被绕过且不产生可信 receipt;服务端仍是合同、摘要和不可变 Release 安全权威。 - Robot Renderer → typed AI hardware API → Main Host route → Robot Hotspot Module → Windows/macOS Adapter。云端 Binding 仍由 Main 代理;热点选择/连接移入页面,但家庭 Wi-Fi 凭据输入仍只留在固件 Portal,系统 Wi-Fi 保留为兜底。 - Prompt Museum Renderer → typed Host API facade → Main fixed list/detail route → Works Square。Museum 只把用户明确选择的 Prompt 原文暂存到进程内 Store 并导航回当前 Canvas;不会直接触发 Agent 命令或生成任务。 @@ -91,4 +93,4 @@ ## Last Updated -2026-09-03 +2026-09-04 diff --git a/.project-docs/20-architecture/system-overview.md b/.project-docs/20-architecture/system-overview.md index 588e5d1..15ad4e8 100644 --- a/.project-docs/20-architecture/system-overview.md +++ b/.project-docs/20-architecture/system-overview.md @@ -10,7 +10,8 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 |---|---|---| | Renderer | 项目配置、一键提交状态 | 不接触账号 Token、ZIP、幂等键或本地绝对路径 | | Host API | 校验本地项目请求并投影安全响应 | 发布 mutation 还必须通过 Renderer capability;Host token/base 不能单独触发发布 | -| Project Configuration & Template | 保存不可变 `ProjectType`,原子生成新项目骨架 | 小游戏/小程序生成受控 Vite 模板;自定义保持最小项目空间 | +| Project Configuration | 保存不可变 `ProjectType`,原子创建最小项目空间 | 只生成 `.makelore/project.json` 与 `knowledge/`;规范类型为 `interactive_ai_app` / `custom`,历史双类型只在读取边界归一 | +| Project Scaffold Skill | 显式生成固定版本的交互式 AI 应用起步文件,并提供发布准备度指导 | 独立 Device Package;完整预检、不覆盖、受控回滚,不安装依赖、不联网、不构建、不上传、不提审 | | 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 +25,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 | 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 不再进入当前客户端。 | -| 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 拥有桌面用户权限且生命周期脚本禁用。每个 generation 包含所有显式安装且当前启用的 Skill/extension;新/idle parent 自动刷新,active parent 在 turn settled 后刷新,child 始终为空。 | +| 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 的一个未完成助手气泡中临时绘制且不生成独立整理进度栏 | | AI Design Gateway Routing | Main-owned Works Square V2 adapter 与 Direction event stream | Main 持有 Works Token、stream ticket、WebSocket、重试分类和错误脱敏;事件顺序与 Task progress 不构成 Specification 真值 | @@ -59,6 +60,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 - accepted/uncertain Coding mutation 不得自动重放;RPC confirmation timeout 后仍保留 target run permit、process ownership 和 background lease,直到迟到 success/failure/exit/abort 权威收敛。其他 Conversation 必须继续可用。 - Main 发出 `lifecycle:sleep` 时 Coding 页面必须关闭旧事件流;编程视图挂载、项目上下文变化、页面重新可见或窗口 focus 时必须从 Main 静默刷新已选 Conversation 的权威 Snapshot。该只读收敛不得转化为 prompt/interaction 的自动重放。隐藏 Conversation 红点只代表新的 pending interaction 或新的 completed/failed/aborted terminal transition。 - 正式包中的 Agent Server 必须以显式 staged `pi-runtime` 的 manifest/root 解析 Pi 依赖,校验导入入口未逃逸对应包目录;不得依赖脚本相邻目录、应用 `node_modules` 或系统包解析作为 fallback。 +- 父 Pi worker 与 Agent Server 必须获得应用选择且不可被 worker overlay 覆盖的 `MAKELORE_NODE_EXECUTABLE`。包含脚本的 Device Package Skill 只能显式使用该 Node 路径,不得依赖系统 PATH。 - selected Provider credential 只投影到目标父逻辑线程的内存 credential store 或目标 child 进程;跨账号模型变化必须重建目标逻辑线程。确定性 Works user-context 缺失是 Provider-auth failure:失效缓存 credential、fail fast、固定脱敏提示,不得归类为 Pi crash。 - Works 下发的 per-model reasoning capability 是可选 Main-owned metadata,不是 Renderer 或 one-api 的权威。存在时只接受受支持的安全形状并覆盖目标模型的 @@ -76,8 +78,9 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 - release builder 对 Main-owned 安全快照运行安装包内固定 npm 11.6.2 的 `ci --ignore-scripts`,并显式调用项目 `package-lock.json` 锁定的 Vite。不得使用全局 PATH、预存 `node_modules` 或 Renderer 提供的路径/origin。项目 Vite config/plugins 以桌面用户权限执行,该边界不是 sandbox。 - `preflightStaticArtifact` 以临时 HTTP loopback origin 提供最终 `built_archive` 的同一内存文件快照,并用 fresh 非持久、未挂载的 Electron WebContents/CDP 检查桌面/移动视口、错误、白屏及外域访问;不安装/调用 Playwright。 - 客户端预检是可绕过的 UX fail-fast:没有可信 receipt,也不复刻生产 opaque-origin。服务端不执行项目 Vite,而是独立重算和校验 source/built/contract 字节、固化不可变 Release;人工审核仍不可绕过。未来若要求 runtime 强门禁,需由可信 verifier 绑定精确构建产物。 -- `ProjectType` 由创建请求写入项目配置,UI 与 Host API 不提供类型变更;缺少类型的旧配置归一为 `custom`。 -- 本地 `projectType` 只选择产品路径和内部构建 preset,不是可信授权声明;Main 仍需安全打包,服务端仍需独立校验清单和包体。 +- `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 校验与审核。 +- 本地 `projectType` 只选择显式脚手架和内部构建路径,不是可信授权声明;Main 仍需安全打包,服务端仍需独立校验清单和包体。 - 云端确认上传成功后,本机 submission binding 失败只能产生固定、无路径的 `binding_warning`,不能把请求改判为失败;Renderer 仍继续轮询服务端校验与 Release 固化状态。 - 公共播放投影只有在上游 `playable === true`、版本名非空且 URL 通过同源 HTTPS、无 userinfo/loopback、长度、精确路径和无 query/fragment 校验时才可播放;不可信数据 fail closed。 - Renderer 只能获得安全状态字段和安全投影的公共播放 URL,不得持有发布凭据、归档路径或自动部署状态。 @@ -99,7 +102,7 @@ Makelore 是 Electron 桌面客户端。Renderer 负责项目操作与状态展 ## Related Decisions -- 当前长期边界记录于 README、ADR-002 至 ADR-007(ADR-001 已由 ADR-007 supersede)及各 Integration Gate;后续如改变唯一入口、凭据所有权、构建执行边界、Living Form/Specification 状态归属、Pi 单 runtime/worker/lease 边界、Learning/Marketplace/Web Search 分发边界、Robot 配网边界或重新引入客户端部署协调器,应新增 ADR。 +- 当前长期边界记录于 README、ADR-002 至 ADR-008(ADR-001 已由 ADR-007 supersede)及各 Integration Gate;后续如改变唯一入口、项目创建/Scaffold Skill/发布权威、凭据所有权、构建执行边界、Living Form/Specification 状态归属、Pi 单 runtime/worker/lease 边界、Learning/Marketplace/Web Search 分发边界、Robot 配网边界或重新引入客户端部署协调器,应新增 ADR。 ## Last Updated diff --git a/.project-docs/30-worklog/current-state.md b/.project-docs/30-worklog/current-state.md index 2404612..978e579 100644 --- a/.project-docs/30-worklog/current-state.md +++ b/.project-docs/30-worklog/current-state.md @@ -4,6 +4,24 @@ 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_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, + 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. - AI Design streamed-reply diagnosis `229b1b1ce39b7f1541a93ea3c980ab82b6d6266c` and client fix `23f96a523eb37d8397bb3766ce95a59d56e59225` from tasks @@ -587,7 +605,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre ## Current Focus -客户端面向非专业用户提供“创建小游戏或小程序 → 项目配置中一键提交 → Main 本地 npm/Vite 构建 → Electron 双视口预检最终产物 → 上传 source+built 双归档与 contract → 运营审核”的唯一创建者链路。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;人工审核仍不可绕过。自定义和缺少类型字段的旧项目不提供该入口。已发布作品优先使用安全投影后的 `play_url`,`runtime_url` 仅保留一个客户端版本的兼容回退。 +客户端面向非专业用户提供“创建交互式 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 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 已移除。 @@ -700,7 +718,7 @@ Robot 绑定设备默认先显示“引导配网 / 已有激活码”路径选 ## In Progress -- 成组集成服务端 source+built+contract 校验、OSS immutable Release、CDN/Edge 与 App 消费链后,使用真实账号和生产配置执行客户端提交到作品播放的整链验收。 +- 先部署支持规范 `interactive_ai_app` 与历史别名的服务端,再安装匹配客户端;随后成组验证显式 Scaffold Skill、source+built+contract 校验、OSS immutable Release、运营审核、CDN/Edge 与 App 消费链。 ## Next Recommended Steps @@ -726,7 +744,7 @@ Robot 绑定设备默认先显示“引导配网 / 已有激活码”路径选 - `/api/works/projects/publish-source` 必须在读取凭据和项目文件前校验 Renderer capability;Host token/base 不能替代该 UI 边界。 - `works-cloud-deploy.json` 仅是已安装数据的兼容文件名,不代表客户端仍拥有自动部署协调器;旧中间态不得恢复为后台任务。 - 刷新凭据、发布 Token、ZIP、幂等键和重试只能由 Electron Main 持有。 -- 本地 `projectType` 只决定产品分流和模板选择,不得作为授权依据或替代 Main/服务端的包体校验。 +- 本地 `projectType` 只决定产品分流和显式 Scaffold Skill 选择,Skill 的静态检测也只提供准备度证据;两者都不得作为授权依据或替代 Main/服务端的构建、包体校验和审核。 - 本地构建必须使用安装版 Electron Node、固定 npm 11.6.2 和项目 `package-lock.json` 锁定的 Vite,不得回退到全局 PATH、已有 `node_modules` 或未验证的 npm 闭包;依赖安装需要网络。 - 项目 Vite config/plugins 以桌面用户权限执行,不能称为 sandbox;此风险边界必须在发布说明中保留。 - AI Design 的 Current Specification 是唯一语义权威。Direction events 必须按 Workspace/Direction/revision/operation identity 收敛;assistant delta、event cursor、Task progress 和 Asset updates 不得改写 Living Form。 diff --git a/.project-docs/30-worklog/task-history.md b/.project-docs/30-worklog/task-history.md index dae2b34..be9301a 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 | 交互式 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 | | 2026-08-08 | 项目真机预览 | 待审 Owner preview 与精确已发布 Runtime | README、architecture、domain | 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 new file mode 100644 index 0000000..ce73b4f --- /dev/null +++ b/.project-docs/30-worklog/tasks/20260904-reconcile-project-scaffold-f7b4d2a9.md @@ -0,0 +1,76 @@ +# 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 df5de0e..d08e4cd 100644 --- a/.project-docs/40-domain/business-rules.md +++ b/.project-docs/40-domain/business-rules.md @@ -53,16 +53,19 @@ Inspect/preview and a distinct later confirmation precede commit; there is no visible install/source-picker UI. Accepted npm, Git, absolute local Plugin-directory, and loose `SKILL.md` sources become immutable generations and default enabled. Lifecycle scripts - never run. Pi extensions execute with desktop-user authority after that fact is shown - in confirmation. New and idle parent workers refresh automatically, active parents - switch only after settlement, and child workers never inherit Device Package resources. + never run. Pi extensions and non-empty standard Skill `scripts/` subtrees are executable + code and execute with desktop-user authority only after that fact is disclosed and + confirmed. Parent Pi workers and the shared Agent Server receive the non-overridable + application Node path as `MAKELORE_NODE_EXECUTABLE`; portable Skills must not fall back + to system Node. New and idle parent workers refresh automatically, active parents switch + only after settlement, and child workers never inherit Device Package resources. - Device Packages appear as a separate `本机` source beside Official Plugins in the unified `/plugins` workspace and never enter Account Library, Marketplace Package Store, Release, Channel, Admission, project enablement, Agent assignment, or server billing state. -- 面向用户的 AI 编程新建流程必须在 `mini_game`、`mini_program`、`custom` 中选择;`ProjectType` 是产品类型,创建后不能通过 UI 或 Host API 修改,未传类型的兼容 API 调用按 `custom` 处理。 -- 新建小游戏和小程序会生成平台固定版本的受控 Vite 发布模板,并可使用项目配置中的单一“提交审核”入口;`custom` 和缺少类型字段的旧项目不提供一键发布。 -- `ProjectType` 不等于 `BuildPreset`:第一期两个可发布产品类型都映射到内部受控 Vite preset;本地 `projectType` 不是授权边界,Main-owned 安全打包、Host API 和服务端包体校验仍必须执行。 +- 面向用户的 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 生成;脚本必须先预检全部目标、不得覆盖已有路径,受控失败只回滚本次创建内容,且不得安装依赖、访问网络、构建、上传或提交审核。 +- `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 入口。 - 本地构建必须由 Main 对安全源码快照使用安装版 Electron Node 和固定 npm 11.6.2 执行 `npm ci --ignore-scripts`,再显式调用项目 `package-lock.json` 安装的 Vite;不得依赖全局 PATH、既有 `node_modules` 或 Renderer 提供的任意路径/origin。 diff --git a/.project-docs/40-domain/glossary.md b/.project-docs/40-domain/glossary.md index 5075c50..d9ae43f 100644 --- a/.project-docs/40-domain/glossary.md +++ b/.project-docs/40-domain/glossary.md @@ -2,9 +2,9 @@ | Term | Meaning | Notes | |---|---|---| -| `ProjectType` | 创建项目时选择且之后不可变的产品类型 | 当前值为 `mini_game`、`mini_program`、`custom`;缺少字段的旧配置按 `custom` 处理 | -| `BuildPreset` | 平台内部用于构建和验收项目包的受控实现 | 不等于 `ProjectType`;第一期小游戏和小程序都使用 Vite preset | -| 受控发布模板 | Main 在新建可发布项目时生成的固定依赖、锁文件和可运行示例 | 保障一键提交的结构基线,但本地模板和 `projectType` 本身都不是授权边界 | +| `ProjectType` | 创建项目时选择且之后不可变的产品类型 | 规范值为 `interactive_ai_app`、`custom`;历史 `mini_game` / `mini_program` 读取时归一为前者,缺少字段按 `custom` 处理 | +| `BuildPreset` | 平台内部用于构建和验收项目包的受控实现 | 不等于 `ProjectType` 或 Scaffold 状态;交互式 AI 应用使用固定 Vite preset | +| Project Scaffold Skill | 用户明确调用、独立版本化的起步文件生成与发布准备度指导 | 不覆盖路径、不安装/构建/上传/提审;项目创建服务和 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 | diff --git a/.project-docs/80-commitments/commitments.md b/.project-docs/80-commitments/commitments.md index a9d5e47..8d90e8a 100644 --- a/.project-docs/80-commitments/commitments.md +++ b/.project-docs/80-commitments/commitments.md @@ -12,8 +12,8 @@ Track future-facing memory: promised follow-ups, unfinished loops, timed checks, | 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` 回滚并记录支持矩阵 | -| 2026-08-10 | 完成客户端提交到 App `play_url` 播放的真实生产整链验收 | source+built+contract 服务端协议、OSS immutable Release、CDN/Edge 与 App 消费链成组集成后 | 客户端/服务端集成 | Pending | 使用真实账号执行小游戏和小程序创建、客户端本地构建与同字节预检、双归档提交、服务端逐字节校验/不可变 Release 固化、运营批准、CDN 发布、App 播放与监控核对;如需不可绕过 runtime gate,另行设计可信 verifier | -| 2026-08-12 | Windows/macOS 发布流水线保留固定 npm/Pi 运行时与 Device Package 产物门禁 | 每次生成正式 Windows 或 macOS 安装器时 | 客户端发布 | Partial / Pending | 运行目标平台的 publish-runtime、artifact、Pi 与 final packaged proof;启动最终 Agent Server 并确认它从 staged `pi-runtime` manifest/root 初始化,再用安装后的首个 Conversation 确认不出现 runtime-unavailable 投影。安装 exact-main 客户端后,还需完成至少一个 npm/Git/loose-Skill prepare→confirm 流程,并以包含两个 extension 的已启用 Device Package generation 验证首个 Makelore bridge 与所有附加 extension/Skill 均生效、禁用项不加载、新/idle parent 刷新且 child 为空。源 `5d7a235` 已通过本地未签名 macOS arm64 DMG 的 read-only mounted-image initialize/shutdown,DMG SHA-256 为 `6d0216da6c30f7fed537041b37c69811b8e025af3e9cccf85a64c690e29ecb7b`;当前安装的 1.2.6 客户端早于 `5a2f0eb` / `17664c5` 修复。仍需签名/公证、完整 process proof、实际替换安装与首个 Conversation、新 Windows artifact 及安装后 Device Package activation;不得以 prepare-only 或 workspace real-process 测试替代。 | +| 2026-08-10 | 完成客户端提交到 App `play_url` 播放的真实生产整链验收 | source+built+contract 服务端协议、OSS immutable Release、CDN/Edge 与 App 消费链成组集成后 | 客户端/服务端集成 | Pending | 服务端先部署支持规范 `interactive_ai_app` 和历史别名的合同,再安装匹配客户端;使用真实账号执行交互式 AI 应用创建、显式 Scaffold Skill 初始化、客户端本地构建与同字节预检、双归档提交、服务端逐字节校验/不可变 Release 固化、运营批准、CDN 发布、App 播放与监控核对。旧 `mini_game` / `mini_program` 只验证兼容读取,不作为新建选项;如需不可绕过 runtime gate,另行设计可信 verifier | +| 2026-08-12 | Windows/macOS 发布流水线保留固定 npm/Pi 运行时与 Device Package 产物门禁 | 每次生成正式 Windows 或 macOS 安装器时 | 客户端发布 | Partial / Pending | 运行目标平台的 publish-runtime、artifact、Pi 与 final packaged proof;启动最终 Agent Server 并确认它从 staged `pi-runtime` manifest/root 初始化,再用安装后的首个 Conversation 确认不出现 runtime-unavailable 投影。安装 exact-main 客户端后,还需完成至少一个 npm/Git/loose-Skill prepare→confirm 流程,并以包含两个 extension 的已启用 Device Package generation 验证首个 Makelore bridge 与所有附加 extension/Skill 均生效、禁用项不加载、新/idle parent 刷新且 child 为空;同时完成 `makelore-project-scaffold` prepare→confirm→install→initialize,验证非空 Skill `scripts/` 披露、应用 Node 路径、既有文件不覆盖以及卸载不删除项目文件。源 `5d7a235` 已通过本地未签名 macOS arm64 DMG 的 read-only mounted-image initialize/shutdown,DMG SHA-256 为 `6d0216da6c30f7fed537041b37c69811b8e025af3e9cccf85a64c690e29ecb7b`;当前安装的 1.2.6 客户端早于 `5a2f0eb` / `17664c5` 修复。仍需签名/公证、完整 process proof、实际替换安装与首个 Conversation、新 Windows artifact,以及签名 macOS 和 native Linux 的脚手架 Skill 运行证据;不得以 prepare-only 或 workspace real-process 测试替代。 | | 2026-08-10 | 删除客户端 `runtime_url` 兼容回退 | 一个客户端兼容版本结束,且服务端与存量数据稳定提供 `play_url` | 客户端 | Pending | 删除类型字段、读取分支和对应回归测试 | | 2026-08-11 | 部署并验收 AI 绘画多 Conversation 服务端契约 | 发布包含多会话客户端之前 | 客户端/服务端集成 | Pending | 确认迁移 `0033`、Conversation list/create/read/turn/confirm API、持久 Agent Session 与事件字段已上线 | | 2026-08-12 | 复核 AI 编程 Provider 错误与重试投影 | 升级 Pi、Works gateway 或上游 Provider 错误格式时 | 客户端/Pi/provider 集成 | Pending | 重新验证确定性 Works user-context 缺失仍会 expire credential、非重试 fail fast、固定脱敏为 `CODING_PROVIDER_AUTH_REQUIRED`,并且不会被后续 `agent_settled` 改写为 completed;不得把其他 401/429/5xx 扩大归类。 |