docs: integrate project conversations and coding teacher
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-09-22 13:59:36 +08:00
parent 00ad84c094
commit e5d271bc45
9 changed files with 110 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
# ADR: 官方编程老师与项目会话导航
- Status: Accepted / implemented
- Date: 2026-09-22
- Approval: 用户确认详细设计、实施及合入主分支。
## Decision
- 新项目直接创建一个内部默认编程 Agent 并保存 defaultAgentId移除创建 Agent 的产品流程。会话直接列在项目下,项目打开不自动创建会话,首次发送或显式新建才创建。旧 Agent ID、配置和 Pi 会话绑定保留;归档、改名、未读与运行状态延续原合同。
- Works Square 运营端配置一个官方编程老师,包括提示词、顺序启用的纯文本 Skills、模型及原生思考选项、展示信息和上下文/输出预算。草稿、不可变发布版本、启停和操作记录分离;版本写入使用 expected_revision。初始化停用发布与启用必须显式操作。
- MakeLore Main 使用当前登录账号的受管模型网关运行独立答疑,不启动 Pi、不提供工具、不执行 Skill 脚本。老师只读取当前来源会话活动分支中已完成的用户/助手文本、用户显式引用和本话题历史不自动读取其他会话、文件、thinking 或工具参数。
- 本机老师话题按账号、项目和来源会话隔离并固定发布版本;每次新问题检查在线启停,云端不保存学生老师聊天。先持久化请求身份再执行;重试读取原请求,取消和重启中断可见,来源会话删除时清理相关话题。
- “问老师”位于编程右侧面板;带回建议只追加主输入草稿,不自动提交。运营桌面试聊要求 admin 和精确已保存 draft_revision使用示例上下文。
- 个人云智能体、Code/Pi 执行、现有网关付款规则和项目 Plugin 生命周期保持独立。本次不增加多老师管理、跨设备老师历史或长期记忆框架。
## Evidence And Release Boundary
- Server source: 93ece7c6aa5c61f1f20b5fe3fe98bb86bb57b6f7
- Client source: 9242a40d874984159d71494ac6510f3a248e89c0
- 合并不代表部署。目标 PostgreSQL 需升级至 20260922_0095运营需配置、试聊、发布并启用真实模型与点数计费仍需发布验收。

View File

@@ -1,8 +1,8 @@
# ADR-008: 交互式 AI 应用 Scaffold 与官方项目插件采用项目级激活
- Status: Accepted / implemented, amended 2026-09-07
- Status: Accepted / implemented, amended 2026-09-22
- Date: 2026-09-04
- Last amended: 2026-09-07
- Last amended: 2026-09-22
- Applies to: Project creation, `ProjectType`, code-owned official project Plugins, scaffold Skill, release readiness
## Context
@@ -31,7 +31,7 @@
## Consequences
- 模板可随官方 Plugin 版本演进,不再扩大项目创建服务的职责,也不需要把脚本上传为 Marketplace artifact。
- 普通用户从目录选择直接进入 `/chat`没有 Agent 时显示非阻塞空状态并提供创建首个 Agent 的入口。Project Configuration 处理真正无效的 metadata,但不再承担初始化仪式
- 普通用户从目录选择直接进入 `/chat`Main 在项目配置中直接创建内部默认 Agent 并保存 defaultAgentId不展示手动 Agent 创建步骤。会话列于项目下,打开项目不创建空会话;首次发送或显式新建才创建。历史 Agent ID、配置与 Pi 绑定保留。Project Configuration 继续处理真正无效的 metadata。
- 旧项目无需批量迁移即可继续打开、生成脚手架和发布;普通新写入使用内部默认 `interactive_ai_app`,既有 `custom` 与历史类型保持兼容。
- 发布规则在 Skill 中可被 Agent 解释和预检,但权威执行仍只有 Main 与 Works Square避免形成第二套发布实现。
- 这三个代码所有官方身份的既有 Agent assignment 数据不再参与有效资源计算,可以原样保留;账号移除(适用时)或项目禁用仍会阻止新父 Agent 获得资源,运行中的 generation 仍按既有冻结边界切换。
@@ -66,3 +66,7 @@
- Simplified-creation source commit: `af13aca`
- Simplified-creation integration merge: `39d7b7e`
- Simplified-creation source task: `20260906-remove-project-gate-7c31`
## 2026-09-22 Amendment
用户明确批准并实施项目默认 Agent、项目下会话和独立官方编程老师取代旧首个 Agent 创建入口及 Agent 分组导航。项目文件生成与发布边界不变。详见[编程老师决定](ADR-2026-09-22-coding-teacher.md)。

View File

@@ -1,5 +1,7 @@
# Decision Index
- [官方编程老师与项目会话导航](ADR-2026-09-22-coding-teacher.md)2026-09-22 accepted / implemented项目默认 Agent、项目下会话、运营版本化教师定义和 Main 独立无工具答疑。
## Active Decisions
- [永久词元点数账户](../40-domain/business-rules.md#permanent-token-points)2026-09-22 用户确认 / 客户端已集成;移除会员、订阅、周额度与重置卡,新注册一次赠 100 点旧权益取消且不补送、不折算1 元兑 50 点且永不过期。本人余额与其他付款方可用性分开,云智能体及 Plugin 原有付款边界保持;依据源 `a1cce42` 与对应集成记录。

View File

@@ -1,5 +1,11 @@
# Data Flow
## Project conversations and teacher chat
目录式创建 → Main 保存项目与 defaultAgentId → 项目直接列出会话 → 首次发送或显式新建创建 Conversation → 原 Pi 执行链。历史会话继续使用原 Agent 绑定;切换项目丢弃旧读取。
问老师/显式引用 → Main 读取 WS 已发布定义与当前来源分支的已完成文本 → 固定话题版本并持久化 requestId → 当前账号模型网关 → Host SSE/本机话题存储 → 右侧面板。取消、重启中断和结果恢复以持久请求为准;关闭面板不取消模型。带回回答只追加主草稿,运营精确草稿版本试聊只用示例上下文。见[老师决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)。
## Permanent wallet and recharge
账号菜单 / PointWallet → `src/lib/works-billing.ts` → Main 固定 `/api/works/billing/*` 路由 → Works Square 账务 API。Main 持有认证与账号绑定,通过 `shared/works-billing.ts` 的公开 DTO 投影余额、产品、订单及流水;充值沿用 Renderer capabilityRenderer 不传付款人、价格、Token 或任意上游地址。账号切换后 Main 与账号绑定的 UI 丢弃迟到结果,打开菜单和窗口 focus 刷新当前账号。

View File

@@ -4,6 +4,8 @@
| Path | Responsibility | Owner Notes |
|---|---|---|
| `electron/coding-teacher/**`, `electron/api/routes/coding-teacher.ts`, `shared/coding-teacher.ts`, and `src/pages/Chat/Teacher*.tsx` | Main-owned 云配置、来源上下文、本机话题、模型调用、Host API/SSE、独立右侧答疑与运营试聊 | 无 Pi worker 或工具;固定发布版本,账号/项目/来源会话隔离。见 [teacher ADR](../10-decisions/ADR-2026-09-22-coding-teacher.md)。 |
| `electron/coding-projects/project-config.ts`, `src/pages/Chat/CodingProjectConversations.tsx`, and `src/components/layout/Sidebar.tsx` | 内部默认 Agent 与项目下会话导航 | 旧绑定保留;首次发送或显式新建创建会话,打开项目不创建。 |
| `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, Game Audio 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. |
| `shared/coding-plugins.ts`, `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 | The shared project-wide predicate covers `makelore.data-service`, `makelore.game-resource`, `makelore.game-audio`, and `makelore.project-scaffold`: after their existing delivery/acquisition requirement and project enablement, all parent Agents receive their Skills/tools without assignment. Trusted Marketplace artifacts that require assignment and immutable local Device Package generations retain their distinct authorities. Child workers remain empty; active threads retain frozen resources until settlement/disposal. |

View File

@@ -1,5 +1,7 @@
# System Overview
官方编程老师由 Works Square 运营维护一个版本化定义MakeLore Main 按账号/项目/来源会话运行独立无工具答疑并持久化本机话题Code 项目自动建立内部默认 Agent、会话直接列于项目下。该能力与个人云智能体及 Pi 执行独立。详见[已接受决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)。
## Current Architecture
知识文档上传、附件导入与替换后由客户端自动衔接既有解析索引接口Main 保留处理 Task、可用性与替换关系。Renderer 每 5 秒串行刷新已加载页面,以服务端持久 Task 与实际分块显示阶段、失败原因及可用于回答的文档;请求未确认时保留同一操作意图,观察到新 Task 后才解除本地不确定状态。替换失败及清理重试保留旧可用内容,零分块不显示可用。见[知识处理交互规则](../10-decisions/ADR-2026-09-11-personal-cloud-agents.md#知识文档处理与可用状态)。

View File

@@ -4,6 +4,12 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- 2026-09-22集成任务 `20260922-merge-coding-teacher-client-b80c376f``00ad84c` 合入教师源 `9242a40d874984159d71494ac6510f3a248e89c0`,保留当前永久点数钱包。
项目自动创建默认 Agent会话直接位于项目下右侧老师按云端发布配置独立答疑回答可追加主草稿。
唯一 Sidebar 引用冲突保留项目切换引用及主线钱包行为;合并代码 112 项相关单测、Renderer typecheck、Vite 全目标构建与 3 项 Electron 流程通过。
ADR-008 的旧创建入口已按用户批准方案修订,采用[老师决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)。
三份外部任务文档原样保留;未推送/部署。真实模型计费仍待发布验收;扩展 Main 类型检查的既有 66 项诊断见源记录。见[集成记录](tasks/20260922-merge-coding-teacher-client-b80c376f.md)。
- 2026-09-22任务 `20260922-integrate-permanent-points-client-38f5b921` 经用户授权交接主目录登记,
将永久词元点数客户端源 `a1cce428afcca9b7e32ef043705a25a4685fbbdd``2f82b9f` 无冲突快进合入本地 `main`
账号菜单改为个人余额、充值、订单及点数流水,移除会员、订阅、周额度与重置卡。

View File

@@ -0,0 +1,55 @@
# Task: Merge cloud coding teacher into main
## Identity
- Task ID: 20260922-merge-coding-teacher-client-b80c376f
- Mode: Integration
- Branch: main
- Worktree: D:\Datas\OthersProjects\makelore
- Base commit: 0cf67befb5922b9cb24dbdca6fb47d06efe31902
- Owner: codex
- Status: Ready for Integration
## Scope
- Integrate approved coding teacher source 9242a40d874984159d71494ac6510f3a248e89c0 into the local primary branch and reconcile canonical memory; preserve unrelated dirty documents.
## Intent And Constraints
- User explicitly approved merge and takeover of both completed primary integration owners; five foreign documents are adopted unchanged and excluded from commits. No subagents, remote push, deployment or paid model calls.
- Project Context Loaded: Concurrent Task Gate Passed. Official start/status match this task ID, integration mode, branch and absolute worktree in Identity, base 0cf67befb5922b9cb24dbdca6fb47d06efe31902, exclusive integration lock and task reservation.
- Read: read-before-planning, planning-gate, memory-index, own record, positioning, current-state, decision-index, system-overview, module-map/data-flow, business-rules/success-criteria, evidence/reflection/commitment/stale indexes, source outcomes and promotion candidates; MakeLore ADR-006/008 supply relevant accepted behavior.
- Project goal: MakeLore is an Electron client: Main owns runtime/auth/storage; Renderer owns interaction. Current integrated focus: permanent Token Points; active scope: approved default coding Agent, project conversation navigation and official teacher chat/configuration.
- Other local tasks: 122 records read; 17 peer placeholder scopes unknown. Defective/placeholder records remain unknown, read-only coordination context; no concrete conflicting dependency affects these exact completed sources. Existing personal cloud Agents, Canvas/Robot, Pi execution, billing and plugin contracts remain.
- Decisions: user-approved teacher proposal supersedes manual Agent creation and Agent-grouped navigation. ADR-008 still describes the old first-Agent entry and will be amended in client integration; client positioning is a template, so README, accepted ADRs and executable code supply facts.
- Evidence/commitments: source focused tests and build passed; Main extended strict typing retains 66 pre-existing diagnostics. Real external model billing, PostgreSQL deployment and release acceptance remain unverified.
- Files: source feature files, own integration record and canonical teacher architecture/domain/decision/current-state. Main wallet Sidebar conflict preserves current wallet behavior and the projectEntryIntentRef addition.
- Planning Gate Passed. Plan: merge exact source; resolve the bounded Sidebar conflict; promote approved facts; verify relevant merged behavior and documentation boundaries; commit and complete. Offer source worktree cleanup separately.
## Outcome
- Merged source 9242a40d874984159d71494ac6510f3a248e89c0 into main in 00ad84c, preserving main permanent wallet source a1cce42. Only conflict was Sidebar refs: retain projectEntryIntentRef, do not reintroduce removed tokenPointRequestIdRef/resetCardRequestIdRef. README auto-merge retains both features.
- Promoted accepted project/default-Agent/teacher contracts; amended ADR-008 old first-Agent entry using the already-approved product decision. Source task record imported unchanged.
- User authorized old wallet recovery: renamed the invalid residual directory to D:/Datas/OthersProjects/.codex-worktrees/makelore/20260922-permanent-points-client-7f4c9a2e-recovery-backup, preserving all contents and its node_modules junction. Official release-missing cleared the exact stale reservation; integration claim then succeeded.
- User explicitly approved cleanup of both teacher source checkouts. Server retire succeeded. Client official retire failed with Directory not empty after removing its Git marker and registration. Applied the same session-approved preservation/recovery approach within that cleanup scope: renamed remaining files to D:/Datas/OthersProjects/.codex-worktrees/makelore/20260922-coding-teacher-client-4b901ae7-recovery-backup and ran official release-missing successfully. No manual registry edits or force deletion; branch and 9242a40 remain.
- Three original foreign task documents and primary node_modules remain unchanged.
## Verification
- Primary pnpm typecheck initially failed because tsc was absent from the existing primary dependency directory; no product diagnostic ran there.
- Copied the resolved merged Git index to C:/Users/7brot/AppData/Local/Temp/teacher-merge-client-20260922-b80c376f, linked source-verified dependencies, then completed all checks before source cleanup: 112 relevant unit tests (teacher service/UI, workspace/project entry/schema/conversation store, wallet/sidebar/billing client/routes), pnpm run typecheck and pnpm run build:vite passed.
- Three real Electron scenarios passed on that merged build: teacher answer appends the main draft without submission; first PI Conversation editable under 500 ms and submits before Snapshot; wallet reopens unpaid frozen order and refreshes only after confirmed credit. Controlled local responses, no real payment/model charge.
- Extra Main strict typing was not rerun: source documented 66 pre-existing diagnostics vs baseline 67. Renderer/build success is not a claim that the full Main strict check passes.
- Staged product diff and whitespace checked; source latest HEAD ancestry, source cleanliness and committed Ready for Integration status verified before cleanup.
- Task Documentation Gate: reviewed working and committed changes from recorded base; task-aware drift passed, including exact unchanged foreign-document states. Approved canonical facts and source provenance are recorded.
## Follow-ups
- No remote push, installer or deployment. Pair with server 93ece7c6; migrate 0095 then configure/test/publish/enable teacher and verify real gateway billing.
- Keep both client recovery-backup directories. The teacher checkout cleanup is partial: its registered worktree is released, residual backup retained. Removing backup bytes is not claimed as completed.
- Existing primary dependency directory is incomplete; validation used isolated dependencies. Reinstalling the primary development environment is separate work.
## Promotion Candidates
- Applied the user-approved source candidates in integration mode; no unresolved teacher product decision remains.

View File

@@ -1,5 +1,15 @@
# Business Rules
## Project conversations and official teacher
- 每个新项目创建内部默认 Agent普通界面无 Agent 创建步骤或分组列。defaultAgentId 选取已存默认、置顶或首个可用 Agent历史 Agent 与会话绑定不重写,不重新启用停用/归档 Agent。
- 项目直接显示会话并保留归档、改名、未读、运行状态;打开项目不创建空会话。首次发送或显式新建才创建。项目设置编辑默认配置,历史会话仍能定位原绑定配置。
- 老师为独立无工具文字答疑Skills 不执行代码;读取仅限当前来源活动分支已完成用户/助手文本、显式引用及本话题历史。话题本机隔离、固定发布版本,每次新问题检查在线启停。
- 同 requestId 相同输入读取已有请求结果,不同输入冲突;重启中的请求标记中断,账号退出中止,来源删除清理相关话题。带回回答追加草稿且不自动发送;已归档来源必须先恢复。
- 运营试聊要求 admin 与精确已保存草稿版本,只使用示例上下文。个人云智能体和现有付款边界独立。
依据:[老师决定](../10-decisions/ADR-2026-09-22-coding-teacher.md)及 [ADR-008](../10-decisions/adr-008-interactive-ai-app-scaffold.md)。
## Permanent Token Points
- 账号不再具有会员或订阅等级、周额度或重置卡。真实新注册一次赠送 100 点;旧账号不补送、不折算,存量旧权益直接取消。充值 1 元人民币兑换 50 点,点数永不过期。所有资格、价格、余额、赠送和入账以 Works Square 为权威,客户端不以首次登录推测新注册或自行补点。