Merge Code workbench styling with server-distributed consultations
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-24 13:21:41 +08:00
48 changed files with 870 additions and 715 deletions

View File

@@ -4,6 +4,11 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- 2026-09-24:将客户端源 `8a157be4f62d073744164318e02185aebeaadc09` 从 `eb3dc85a2f0ed8457b7f24684c2da3ab192c2e46` 无冲突快进合入本地 `main`,包括预算修复 `de72b1cd945df373d09402a1cf3a0e9b34832f03` 及其源记录 `248776d8550d67de7ce30802a9f827d432c42a99`。
咨询统一使用运营下发的智能体,移除固定老师/朋友角色、本地人设与按名称限制工具的逻辑;名称、头像、简介、欢迎语和推荐问题取自发布定义。旧合成朋友话题与草稿只读保留,不自动绑定或提交;项目级草稿、已发布版本、学生计费和现有讨论/主动跟进保持。
输入预算区分近似模型 Token 与完整 JSON query 字节,固定配置超限单独提示,修复短问题被错误拦截。源覆盖 323 项相关用例,类型/lint/生产构建、2 项 Electron 交互和 13 项布局测试通过;预算源另有 289 项相关测试。扩展 Main 仍为基线 66 项诊断,无新增。合并未改产品实现,沿用源验证;未推送、打包、安装或做真实付费模型验收。
见[统一智能体源任务](tasks/20260924-cloud-consultation-agents-82a6cd19.md)、[预算源任务](tasks/20260924-teacher-context-budget-3a9e6c81.md)和[本地集成记录](tasks/20260923-merge-yuxi-teachers-ml-9d623c5f.md)。本条更新当前咨询规则,旧条目保留为历史;集成文档门禁收尾状态以集成记录为准。
- 2026-09-23:任务 `20260923-merge-yuxi-teachers-ml-9d623c5f` 经用户确认交接主目录,将 `d20c818fe79bc5833cef15d99974b699dde71c6d` 从 `1f2ad3fb3a71b8b35fabb5b319cd3b54b4c2ebbe` 无冲突快进合入本地 `main`。配套三端已统一为 Yuxi 原生老师、WS 运营选择下发/同步/默认/启停、Main 三个项目/Pi 只读工具及学生账号付费;个人 Agents 保持创建者付费。MakeLore `d20c818` 已关闭 Yuxi 源记录中的子线程正文路由待办。
源验证:51 项相关测试、typecheck、lint 和生产构建通过;原 Electron 老师选择/带回草稿流程通过。子线程正文混入先复现失败再修复,回归覆盖两种事件格式及断线游标。 产品文件与源一致,未重写实现;完整生产拓扑及真实供应商计费仍待发布验收。原有 3 份外来文档保持未提交原样,未推送或部署,无本次新增迁移。
本条取代早期 Main 独立运行/不保存云端老师消息/运营重复编辑配置的现状说明,旧条目保留为历史。见[本次集成](tasks/20260923-merge-yuxi-teachers-ml-9d623c5f.md)和[源任务](tasks/20260923-yuxi-teachers-client-53ba33e2.md)。

View File

@@ -8,7 +8,7 @@
- Worktree: D:\Datas\OthersProjects\makelore
- Base commit: 1f2ad3fb3a71b8b35fabb5b319cd3b54b4c2ebbe
- Owner: codex
- Status: Ready for Integration
- Status: Blocked
## Scope
@@ -42,3 +42,18 @@
## Promotion Candidates
- Applied the accepted source promotion candidates in integration mode. User confirmation already covers native Yuxi teachers, local read tools and student billing; no unresolved product decision remains.
## 2026-09-24 Consultation Follow-up Integration
- User requests merging the completed context-budget and server-agent unification follow-ups; explicitly declines the additional Yuxi tool explanation UI. Continue this Yuxi-teacher integration in its existing primary ownership. Current main starts at eb3dc85a2f0ed8457b7f24684c2da3ab192c2e46; exact source is 8a157be4f62d073744164318e02185aebeaadc09, including budget source 248776d8550d67de7ce30802a9f827d432c42a99 / product de72b1cd945df373d09402a1cf3a0e9b34832f03.
- Project Context Loaded: official check/start/status passed with unchanged Identity, primary main ownership and exclusive integration lock. Read entry/planning gate, memory index, own and both source records, positioning, teacher ADR/decision index, system/module/data-flow, business rules/glossary/success criteria, current state, evidence/reflection/commitment/stale indexes. Compared all 110 owners with the prior source gate: only this integrator and the completed unification source changed; those records reread. Historical placeholder peer scopes remain unknown/read-only, with no concrete dependency. No new owners or conflicting decisions.
- Main owns local access/history; Yuxi/Works own published personas and student billing. The user's explicit removal of fixed teacher/friend categories supersedes earlier fixed personas. Existing cloud contracts, version pins, scoped reads and generic structured discussion remain. Positioning templates are supplemented by README/AGENTS/verified code; old consultation statements are updated only for this accepted scope.
- Planning and Integration Gates Passed. Plan: fast-forward the verified source, reconcile accepted canonical consultation/budget facts, prove source ancestry and product equality, run official documentation checks, commit and complete. Preserve all three previously adopted foreign documents byte-for-byte and exclude them from commits; source records stay read-only. No subagents, extra Yuxi UI, cloud changes, paid provider calls, push, packaging or deployment.
### Follow-up Outcome And Verification
- Fast-forwarded main from eb3dc85 to 8a157be without conflicts. Both completed source tips are ancestors; no product or test implementation was changed during integration. Exact source code comparison passes. README corrects one remaining old teacher/friend entry description. Canonical decisions, architecture, rules, glossary, evidence and integrated snapshot now state the user-approved server-agent and budget behavior. Source records are unchanged.
- Reuse exact source verification: unification covers 323 relevant unit cases, standard typecheck, scoped lint, production build, 2 Electron interactions and 13 layouts; budget source covers 289 relevant cases. Expanded Main remains 66 baseline diagnostics with no additions. No new production/provider/installed-app validation is claimed. Whitespace check and referenced source-document existence pass. Three pre-existing untracked documents remain unchanged and excluded from this checkpoint.
- Documentation completion is BLOCKED, not passed: the resumed integrator's original 1f2ad3f base predates later cross-machine main integration. Official check_doc_drift attributes six existing historical task records in that prior first-parent range to this task. All six predate this follow-up and are identical to eb3dc85. Five name source branches not retained locally; one records main, so the unchanged-source import rule cannot prove it. Neither source records nor the official checker are rewritten to suppress this result.
- Retain this as an incomplete integration checkpoint. Proposed recovery requires explicit human approval: release this primary ownership with official release --force (required only because the three known foreign documents remain untracked), start a fresh integration task at the current committed main with --adopt-existing for exactly those unchanged documents, then run its full gates to close this merge. This records the true new integration boundary without changing old task bases, branch history or user files. No cleanup, reset, stash or automatic force release.
- Both just-integrated managed source worktrees remain retained pending the separate cleanup decision after documentation closure: 20260924-teacher-context-budget-3a9e6c81 and 20260924-cloud-consultation-agents-82a6cd19. Branches and all source commits must remain preserved.

View File

@@ -0,0 +1,46 @@
# Task: Unify coding consultation around distributed agents
## Identity
- Task ID: 20260924-cloud-consultation-agents-82a6cd19
- Mode: Feature
- Branch: codex/20260924-cloud-consultation-agents-82a6cd19-cloud-consultation-agents
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260924-cloud-consultation-agents-82a6cd19
- Base commit: 248776d8550d67de7ce30802a9f827d432c42a99
- Owner: codex
- Status: Ready for Integration
## Scope
- Unify Code consultations around the distributed agent catalog. Remove built-in teacher/friend persona creation, fixed avatars and identity-based tool restrictions. Preserve server versions, student billing, read-only project context and useful discussion presentation. Keep historical synthetic-friend conversations readable without silently rebinding their identity.
## Intent And Constraints
- Concurrent and Planning Gates Passed in the isolated worktree above. Base includes the completed context-budget fix (248776d). Read current task, startup/context/teacher ADR and relevant architecture, domain and evidence; assessed previous 108 peer scopes with unchanged registry timestamps, plus completed budget follow-up. Historical placeholder scopes remain unknown/read-only with no concrete dependency. User explicitly supersedes the fixed-role product behavior.
- Main owns access/context; Yuxi/Works Square own published agent definitions. No subagents without further consent. Do not mutate main, other tasks, user data or cloud configurations. Backend route identifiers and historical storage names may remain for supported compatibility; no new role taxonomy or automatic rebinding.
- Implement client catalog selection, generic identity/prompt/tool handling and old-history behavior; validate focused service/Renderer tests, typecheck, lint, production build and existing Electron interaction seam. Promote architectural facts only at Integration Gate.
## Outcome
- Unified Code consultations around the existing published catalog. The header has one agent entry; a new topic uses the chosen published agent or Operations default. Name, avatar, description, greeting and suggested questions come from the server. Existing topics remain pinned to their original definition/version.
- Removed locally generated friend identity, local teaching persona and name/role-based read-tool restrictions. All distributed agents use their published prompt/skills and the same account/project/source-scoped read-only tools. Generic structured discussion instructions and the existing student billing, cloud resume and proactive follow-up protocol remain.
- Added the local `/agent-topics` route with existing protocol aliases retained. Historical synthetic-friend conversations remain in their original store, appear as read-only history and cannot receive new turns or background check-ins. Original project drafts retain their storage key; old friend drafts have a read-only viewer and are never rebound or submitted automatically.
- Updated README and focused unit/Electron/layout coverage. No backend/Yuxi change was needed because the existing catalog already distributes arbitrary published agents. No canonical memory, live cloud settings, installed application or other task worktree was changed.
## Verification
- Covered 323 relevant unit cases across service, Renderer, cloud/local execution, read tools, guidance and discussion state. The 10-file suite passed at 322 tests; after adding draft-preservation coverage the final affected UI subset passed all 75 tests (one new case). Covers server-defined personas/skills, real service/HTTP boundaries, arbitrary agent names including `朋友`, published versions, historical read-only behavior, preserved drafts, disabled-agent Enter handling and selected-agent greetings.
- Final `pnpm run typecheck`, scoped ESLint, production Renderer/Main/Preload/utility build and `git diff --check` passed. Expanded Main TypeScript comparison reported 66 baseline and 66 current diagnostics, with no added diagnostics; this is not a claim that expanded Main typechecking is clean.
- Final rebuilt Electron interaction tests passed 2/2: switching consultation/work preserves student drafts and does not submit advice; catalog-selected agent `朋友` appears in the header and receives proactive messages. Fixtures exercise built Electron without a paid model provider.
- Browser layout/interaction coverage passed 13/13 with Edge: five discussion modes at 319/508 px and preview layouts at 1440x900, 1180x720 and 1000x640. Inspected the server-selected agent screenshot. The final draft-only addition is covered by the final UI/Electron runs.
- Test/build output is in local temporary logs (`unified-agents-verified-tests.log`, `unified-agents-final-ui.log`, `unified-agents-layout.log`, `unified-agents-release-build.log`, `unified-agents-release-e2e.log`, `unified-agents-main-types.log`), not versioned product files. Task-aware document drift passed before commit/completion.
## Follow-ups
- Integrate this branch and its already included context-budget fix only when merge is requested. Packaging/installation, real-provider billing and live deployed-server validation were not performed. No cloud change or data migration is required by this feature.
- Retain this worktree/branch for review and integration; no cleanup is authorized or needed now.
## Promotion Candidates
- Targets: `10-decisions/ADR-2026-09-22-coding-teacher.md`, `20-architecture/module-map.md`, `20-architecture/data-flow.md`, `40-domain/business-rules.md`, `40-domain/glossary.md` and `30-worklog/current-state.md`. Proposal: current consultations are published server agents without a built-in teacher/friend taxonomy or local persona overlay; all receive the same scoped project tools. Operations selects/defaults/distributes Yuxi agents, and topics pin published versions. Evidence: this task's explicit user direction, implementation and regression results. Future impact: future personas need no client role branch; generic UI protocols do not define personality. Semantic conflict: supersedes any integrated fixed teacher/friend behavior. Human confirmation: already supplied by the user's explicit request; promotion remains Integration Gate work.
- Same targets where relevant: retain legacy synthetic-friend history and drafts for read-only access without rebinding identity; retain existing cloud contract/storage identifiers as implementation compatibility. Evidence: service/UI tests and Electron validation. Future impact: upgrades preserve user text/history without maintaining a second live role. No unresolved semantic conflict or additional human decision.

View File

@@ -68,3 +68,14 @@
- Merge dd96a7b7b43f915b530190e97c1e41d5b5240d4e was pushed to origin/main and verified against the actual remote reference. Both selected source tips remain ancestors; backup/20260924-main-consensus still points to 342f3e58. Main was rebuilt successfully from this pushed merge.
- Restarted only Makelore Teacher Trial (bundle cn.makelore.teacher-presence.trial), replacing PID 92884 with PID 717. It now loads /Users/chillishark/Makelore 麦洛/makelore/dist-electron/main/index.js, preserving /var/folders/mx/ltbgwsks5_n8zllj69p_wbcw0000gn/T/makelore-trial-tdq_nuah/user-data and Host API port 54599. Exact process command and port ownership were checked; OPTIONS /api/app/runtime-info returned 204.
- Native window inspection confirmed the module selection screen loaded from the main checkout's dist/index.html. No live teacher message, credential change or user-data reset was performed. Subsequent task-record-only commits do not change these verified runtime artifacts.
## Workspace Style Follow-up
- User again requested integrating the latest delivery of task 01a0cc32-40cf-7503-983e-ca70eb688599 and pushing main. Source is 2191c51467029a67e82bc9af0ff9fabc958b4709 on codex/20260924-workspace-style-6f2e84b9-workspace-style; it includes main's committed e657a7d prompt refinement. Source worktree is clean and Ready for Integration. The task API exposes the latest completed turns but no item bodies; branch and task-record provenance identify the completed style delivery.
- Project Context Loaded: same task ID, feature mode, branch, worktree and base as Identity; start/status ownership matches. Existing project context remains applicable; refreshed entry/planning gate, memory index, positioning, current state, decisions, architecture, domain/success criteria, evidence/reflection/commitments/stale indexes, and the new style/focus peer records. Other registered classroom/presence/discussion/integration tasks remain completed sources. Source owns Renderer styling; upstream origin/main owns the newer consultation runtime. No canonical documents are authored here. Gate passed for code integration, scoped verification and remote push.
- Plan: combine the style source with fetched origin/main 0a8fce6, resolve overlaps without reverting current runtime semantics, run relevant tests/typecheck/lint/build and isolated interaction checks, then fast-forward clean main and push.
- Resolved README, consultation header, responsive CSS and modify/delete conflicts. Preserved source navigation/cards/tab/composer styling and added its header/avatar classes to the remote generic-agent panel. Preserved remote removal of built-in teacher/friend personas and behavior-prompt.ts, server-distributed agent identities, read-only legacy friend history/drafts, source binding and token-versus-byte budgeting. e657a7d remains in ancestry; its removed runtime prompt is retained in Git history, not re-injected into server-owned persona configuration.
- The source task's native trial currently uses the workspace-style checkout; retain that worktree. This follow-up requests merge/push and does not restart the trial or send live messages.
- Verification of the combined tree: 16 related unit suites / 362 tests, 13 browser layout checks, 2 isolated Electron conversation-navigation/draft-preservation checks, standard typecheck, scoped TSX ESLint, production Renderer/Main/Preload/utility build and diff whitespace checks passed. Independent final review found no blocker; all runtime/API/shared code is byte-identical to origin/main, with only five presentation files and the README appearance note differing outside task records.
- check_project_docs passed. The drift checker flags 22 foreign/protected documents imported since the older registered task base; exact Git-blob checks confirm every one matches either source 2191c51 or origin/main 0a8fce6. Only this task's record is authored here. No canonical or peer-record edits; the checker itself is not reported as passing.
- Verified main is clean and source/remote refs remain unchanged before delivery. Ready for the user-authorized fast-forward of main and ordinary push to origin/main; retain source branches and the active-trial worktree.

View File

@@ -0,0 +1,52 @@
# Task: Fix teacher context budget rejection
## Identity
- Task ID: 20260924-teacher-context-budget-3a9e6c81
- Mode: Feature
- Branch: codex/20260924-teacher-context-budget-3a9e6c81-teacher-context-budget
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260924-teacher-context-budget-3a9e6c81
- Base commit: eb3dc85a2f0ed8457b7f24684c2da3ab192c2e46
- Owner: codex
- Status: Ready for Integration
## Scope
- Diagnose and fix teacher context-budget rejection for a short question, preserving published configuration, student billing, cloud/legacy execution and current read-only tool boundaries. Own client context budgeting, runner integration, focused regressions, README and this record.
## Intent And Constraints
- Official check/start/status passed in the isolated feature worktree above. Read entry, own record, relevant teacher decisions/architecture/domain/evidence/reflection/commitments and 108 peer records. Completed teacher/packaging scopes overlap historically; historical placeholder records remain unknown/read-only with no concrete dependency. Planning Gate Passed; canonical memory, other tasks, main and user project files stay read-only.
- Apply diagnosing-bugs: establish a red runner test, inspect only relevant local topic metadata, reproduce the actual legacy configuration, then correct the budgeting seam and test real preparation/compilation/submission. No subagents, paid model calls, deployment, installation or automatic topic migration.
- Confirmed local metadata: current 方法老师 topic has no runtime=yuxi, no requests or discussion, input budget 8000, output 1500, system prompt 2751 UTF-8 bytes. No user conversation text or secret was printed or copied. The screenshot is a legacy local-topic preflight failure, not proof of a cloud model limit.
## Outcome
- Fixed native token budgeting: text, reasoning, tool schemas and calls share an explicit approximate 2 UTF-8 bytes/token estimate; tool-result limits convert back to bytes under the existing 2400-byte cap. Published token ceilings, model limits, student billing and final provider authority remain intact; no configuration or topic migration.
- Context compaction now measures the selected runner's complete envelope. Cloud compilation uses exact JSON query bytes instead of a fixed 256-byte escaping reserve, so ordinary code quotes/newlines cannot pass compilation then fail submission. Excerpts preserve head/tail and source IDs without mutating original read-tool material.
- Fixed configuration/current-discussion overflow is distinguished from oversized questions/references. Teacher behavior, current question, explicit references and discussion instructions remain complete. Updated README explains the approximate native versus exact transport boundary.
- No Renderer workflow changed. Before: a short first question could be rejected with advice to shorten it or start a topic. After: the same 8000-budget legacy shape and cloud long-code case submit successfully; truly oversized fixed inputs identify configuration as the cause.
- Follow-up source audit: teacher availability/default, catalog and published versions are fetched from Works Square (`/api/coding-teacher/config`, `/teachers`, `/versions/{version}`). Main stores each topic's definition/version; the Renderer restores that snapshot for existing topics. Teacher prompts also include client teaching behavior and discussion instructions, so behavioral content is not wholly cloud-owned.
- Friend is not an independently distributed server/Yuxi agent: `consultationDefinition(..., 'friend')` inherits the published teacher definition's model, limits, runtime and version while replacing its name/persona/welcome/questions and clearing text Skills locally. Friend cloud calls retain the same teacher version and expose no project read tools. Runtime=yuxi uses the Yuxi teacher transport; legacy snapshots use Main's student-model gateway runner. No product behavior or live configuration changed during this audit.
- Reproduced two reachable failures before changing product code: legacy model preparation plus empty-source first discussion needs 9013 byte-based estimated units but allows only 4456 after tool reserves (synthetic 2700-byte prompt matching observed shape); cloud compilation accepts long ordinary quoted code then JSON serialization exceeds its byte budget.
## Verification
- Green: 9 focused teacher/context/read/model/structured-discussion/Renderer files, 289 tests passed. Includes actual CodingTeacherService + native runner + real temporary project-file read/continuation at the existing 8000 budget with a 2700-byte prompt and long source; actual service + cloud transport compaction; escaped-code cloud envelope and unchanged protocol; negative fixed-config overflow; six read rounds, cancellation, request identity and scope remain covered.
- pnpm 10.33.4 frozen offline install, standard pnpm run typecheck and scoped ESLint passed. Production Vite build passed for Renderer/Main/Preload/utility. Expanded Main tsc reports 66 diagnostics; a CompilerHost replay substituting exact base versions of all changed Electron files also reports the same 66, with zero new diagnostics. No full-suite or real-model success is claimed.
- Existing Electron UI fixtures replace the Host API and bypass this budget seam; this Main-only change is covered at real service/runner boundaries instead of treating a mocked UI pass as reproduction evidence. No installed application, live Yuxi instance or user topic was modified.
- Follow-up verification: resumed official ownership, checked all 108 peer registry timestamps against the prior scope audit (unchanged), and traced config-client, consultation-role, service creation/send, Renderer restore, cloud-runner and context assembly. This was a source-only clarification; no new runtime tests or paid calls were needed. Previous fix remains unmerged/unpackaged.
- Red loops: pnpm exec vitest run tests/unit/coding-teacher-model.test.ts -t 'existing 8000 budget' --maxWorkers=1; pnpm exec vitest run tests/unit/coding-teacher-cloud.test.ts -t 'long code context' --maxWorkers=1. Both fail with the exact screenshot message at their respective real preflight seam. Empty-source cloud question with the discussion protocol passes.
- Native model limits are tokens; existing implementation equates them to UTF-8 bytes, unlike model tokenization. DeepSeek documentation distinguishes character estimates and actual usage (https://api-docs.deepseek.com/zh-cn/quick_start/token_usage/). Keep native token estimates explicitly approximate and model/usage authoritative; retain the separate exact cloud query byte guard.
## Follow-ups
- Merge, rebuilt installer and installed-app verification remain pending. The observed 方法老师 topic is still a legacy definition; selecting/publishing a Yuxi teacher is a separate Operations action and existing topic versions remain fixed.
## Promotion Candidates
- Target: teacher architecture/domain/current-state at Integration Gate. Proposal: record distinct approximate native token and exact cloud JSON-byte budgeting, with source excerpt fitting and configuration-specific errors. Evidence: red/green runner cases, 289 tests, type/lint/build and unchanged actual-topic metadata. Future impact: new prompt/protocol content must use the runner's measurement at compilation; no silent topic migration or budget override. No semantic conflict or further product-policy approval identified; feature mode does not promote canonical documents.