feat(design): integrate agent activity timeline

This commit is contained in:
2026-09-07 12:21:40 +08:00
parent 81b524a02c
commit 7bdb42f26c
12 changed files with 243 additions and 133 deletions

View File

@@ -4,6 +4,23 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- AI Design operation activity source
`81b524a02c2cf51304090afa8fb89d27c72c5d2b` from task
`20260907-design-agent-activity-client-b6d913e4` is integrated by task
`20260907-integrate-design-agent-activity-b7d3f1a8`. Electron Main now
normalizes the server's four closed public stages into fixed youth-safe copy;
Renderer attaches one transient, update-in-place `AI 处理过程` panel to the exact
optimistic user message and collapses completed work without creating a chat Turn
or duplicating the right-side Current Specification. Workspace, Direction,
operation, pre-command turn sequence, connection generation, cursor, and terminal
events keep replay and stale results scoped; unknown outcomes retain the original
identity. Integration review additionally preserves prior completed/unknown activity
when a later chat starts and keeps each pending user's activity and provisional
reply together in visual order. Final committed assistant text continues through
the existing provisional assistant bubble and canonical Turn replacement. Focused verification passed 69
tests, TypeScript, changed-file ESLint, and all Vite production targets. No server,
database, billing, Quote/Task, navigation, package, deployment, publication, or paid
Provider call changed.
- Coding project setup UX source `8042d2be265e40288e628fcdc755e9f29151306b`
from task `20260906-project-setup-ux-90fe6cf2` is integrated onto local `main`
by task `20260906-integrate-project-setup-ux-4b7d2e91`. A Coding Conversation is
@@ -719,7 +736,7 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
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 已移除。
新提交的 Design chat 会立即从现有 pending operation 投影为带“发送中”或“正在确认”的临时用户气泡,服务端确认的 canonical turn 到达后再替换它;确定失败时原草稿重新出现在输入框。`design.assistant.delta` 只作为内部传输与收敛状态,不显示原始片段,也不在对话区生成独立整理进度栏;右侧 Current Specification 摘要继续承担“AI 当前听懂的内容”。重复连接和事件按 connection generation 与 `chunkIndex` 收敛。
新提交的 Design chat 会立即从现有 pending operation 投影为带“发送中”或“正在确认”的临时用户气泡,服务端确认的 canonical turn 到达后再替换它;确定失败时原草稿重新出现在输入框。`design.assistant.progress` 经 Main 归一为固定通俗阶段,只在对应用户气泡下形成可更新、可折叠的“AI 处理过程”,不成为对话消息、右侧摘要或模型思考过程。`design.assistant.delta` 仅把已验证并提交的回复临时绘制为同一 operation 的未完成助手气泡,随后由 canonical turn 替换;不生成独立全局整理栏。右侧 Current Specification 摘要继续承担“AI 当前听懂的内容”。重复连接和事件按 connection generation、operation identity 与 `chunkIndex` 收敛。
Canvas 侧栏提供“获取灵感”进入 Prompt Museum。列表、筛选、分页、详情、作者/来源/许可证和图片地址全部由服务端经 Main-owned Host API 提供,客户端不打包静态数据集;服务端相对媒体只允许固定 `/api/image-prompt-museum/{entry}/media/{thumbnail|number}` 形状,并由 Main 注入 Works Bearer、执行一次 401 刷新、可信 raster MIME 与 10 MiB 上限后转为 Renderer data URL;credential-free HTTPS CDN 图片保持直连。图片失败只显示卡片内占位,不阻断卡片或详情;缺少来源 URL 时显示纯文本。“使用此 Prompt”只把原文带回当前 Canvas 输入框,不自动发送。该模块不是投稿、点赞、评论或排行榜社区。客户端契约已就绪,但不据此宣称 Works Square 内容后台和生产数据已经部署。`pnpm run dev` 现在默认使用云端 Canvas 适配器,本地适配器只能通过显式开发命令启用;产品 UI 只保留中文。
@@ -872,4 +889,4 @@ Robot 绑定设备默认先显示“引导配网 / 已有激活码”路径选
## Last Updated
2026-09-06
2026-09-07

View File

@@ -1,103 +0,0 @@
# Task: Render AI Design agent activity progress
## Identity
- Task ID: 20260907-design-agent-activity-client-b6d913e4
- Mode: Feature
- Branch: codex/20260907-design-agent-activity-client-b6d913e4-design-agent-activity-client
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260907-design-agent-activity-client-b6d913e4
- Base commit: da29294979da4ce041edf992b590ee6ea170a44f
- Owner: codex-root
- Status: Ready for Integration
## Scope
- Consume operation-scoped AI Design activity events through the existing Main-owned
Works Square transport.
- Render one transient activity area attached to the optimistic user message, update
meaningful steps in place, and settle it correctly on final reply or terminal error.
- Cover reconnect/replay, transport-unknown, stale-operation, and compact responsive
presentation without duplicating the right-side Design summary.
## Intent And Constraints
- User messages remain immediately visible and final assistant replies remain normal
conversation content.
- Activity is presentation state, not canonical Design state or a durable chat bubble.
- Show at most a few youth-safe phase/action/outcome lines; never render raw reasoning,
tool arguments, prompts, provider output, or technical error details.
- Preserve stable operation identity across uncertain transport outcomes and ignore
progress that belongs to another Workspace/direction/operation.
## Project Context Loaded
- Project goal: a youth-friendly desktop creation flow with Electron Main as the only
network authority and server-owned Design Specification semantics.
- Current integrated focus: Living Form V2 and immediate optimistic user messages are
integrated; the experimental `050d78d` progress UI is not assumed present.
- Decisions: ADR-007 keeps Renderer drafts temporary and Gateway operations stable;
the activity view may observe events but cannot become another authority.
- Evidence/commitments: real paid Design production smoke remains separate and is not
claimed by this client presentation task.
- Relevant peers: the Enter-key E2E task is test-only; older generic-error tasks have
undefined scope. No semantic conflict was found.
- Likely modules: Main Workspace adapter/DTO mapping, Renderer store event reduction,
Design conversation pane, and focused unit/Electron E2E tests.
- Unknowns to resolve in source: current stream event DTO shape and the best existing
operation-to-optimistic-message association seam.
- Gate result: Passed.
## Outcome
- Added a dedicated `AI 处理过程` panel beneath the optimistic user message. Active
steps update in place; completed processing collapses into a compact, user-toggleable
summary while the final assistant reply continues to stream as normal conversation.
- Added Main-owned normalization for the four public progress stages. Main maps stages
to fixed youth-safe copy instead of trusting arbitrary server/provider text.
- Preserved exact operation association across optimistic, streaming, canonical, and
transport-unknown states by recording the pre-command turn sequence and matching the
earliest exact canonical user turn after that boundary.
- Added Gateway command terminal-event handling so accepted commands converge after a
polling disconnect. WebSocket-terminal-first races remain authoritative, stale
connections cannot mutate current state, duplicate chunks advance the replay cursor,
and late results from another Workspace cannot replace the active Workspace.
- Activity remains transient presentation state: it is filtered by Workspace and
direction, never becomes a chat message or right-side Design authority, and contains
no raw model reasoning, prompts, tool arguments, or technical provider output.
## Verification
- `pnpm exec vitest run tests/unit/image-workspace-store.test.ts
tests/unit/image-canvas-page.test.tsx
tests/unit/works-square-design-workspace.test.ts
tests/unit/image-workspace-route.test.ts` — 67 passed.
- `pnpm exec tsc --noEmit` — passed.
- Focused ESLint across all eight changed TypeScript/TSX files — passed.
- `pnpm run build:vite` — passed; only existing chunk-size, dynamic-import, and stale
Browserslist-data warnings were reported.
- `git diff --check` — passed.
- Independent client and lifecycle reviews were repeated after the terminal-race,
exact-turn-association, and Workspace A→B→A fixes — PASS; no reachable P1/P2
remained.
## Follow-ups
- Add an explicit snapshot/cursor reseed contract for a Gateway `cursor expired`
response in a separate transport-resilience task. That pre-existing recovery gap is
broader than the AI activity presentation slice.
## Promotion Candidates
- Target canonical documents: ADR-007 and the client/Main transport architecture.
- Proposal: document operation-scoped AI activity as transient Renderer state fed by
Main-normalized public Gateway events; generic Gateway terminal events must settle
uncertain writes without changing operation identity.
- Evidence: fixed public stage projection, exact turn association, terminal/poll race
tests, stale-source and cross-Workspace tests, 67 passing focused tests, typecheck,
lint, and production build.
- Future impact: future Agents SDK lifecycle hooks can reuse the same UI seam, while
canonical Design state continues to come only from Workspace snapshots/events.
- Semantic conflicts: none identified; this preserves ADR-007's Main ownership and
temporary Renderer-state boundaries.
- Human confirmation required: yes, during a future integration-mode promotion to
canonical architecture documentation.

View File

@@ -0,0 +1,64 @@
# Task: Integrate AI Design agent activity UI
## Identity
- Task ID: 20260907-integrate-design-agent-activity-b7d3f1a8
- Mode: Integration
- Branch: codex/20260907-integrate-design-agent-activity-b7d3f1a8-integrate-design-agent-activity
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260907-integrate-design-agent-activity-b7d3f1a8
- Base commit: da29294979da4ce041edf992b590ee6ea170a44f
- Owner: codex-root
- Status: Ready for Integration
## Scope
- Integrate client source commit `81b524a02c2cf51304090afa8fb89d27c72c5d2b` from exact base `da29294979da4ce041edf992b590ee6ea170a44f`.
- Promote the operation-scoped AI Design activity projection into canonical client memory.
- Verify Main event normalization, Renderer reconciliation, conversation rendering, and existing Design streaming behavior.
## Intent And Constraints
- Render only the server's fixed public lifecycle stages beneath the matching optimistic user message.
- Keep `design.assistant.delta` as the single provisional assistant-text stream and the right-side Living Form as the Current Specification projection.
- Never render raw chain-of-thought, prompt/provider/tool payloads, or a duplicate global “整理进度” banner.
- Preserve stable operation identity and existing unknown-result reconciliation.
- Do not touch or adopt unrelated changes in the root worktree.
## Outcome
- Fast-forwarded the exact source commit from the recorded base without conflict.
- Integrated Main-normalized public Design activity, operation-scoped Renderer
reconciliation, terminal-event convergence, and the conversation-attached activity
panel while preserving optimistic user messages and canonical assistant replacement.
- Fixed two integration-review findings: a later chat no longer erases earlier
completed/unknown activity, and each pending operation now renders its user message,
activity, and provisional assistant stream as one ordered group.
- Promoted the accepted transient-activity boundary into ADR-007, architecture maps,
data flow, domain rules, and current integrated state.
- No server contract, database, billing, Quote/Task, navigation, package, deployment,
publication, or Provider behavior changed.
## Verification
- `pnpm exec vitest run tests/unit/image-workspace-store.test.ts
tests/unit/image-canvas-page.test.tsx
tests/unit/works-square-design-workspace.test.ts
tests/unit/image-workspace-route.test.ts` — 69 passed.
- `pnpm exec tsc --noEmit` — passed.
- Focused ESLint across all eight changed TypeScript/TSX files — passed.
- `pnpm run build:vite` — passed; only existing chunk-size, dynamic-import, and
stale Browserslist-data warnings were emitted.
- `git diff --check` — passed.
- Independent integration review — PASS after the two multi-operation findings were
fixed and covered.
## Follow-ups
- Add an explicit snapshot/cursor reseed contract for a Gateway `cursor expired`
response in a separate transport-resilience task.
## Promotion Candidates
- Applied: ADR-007, system overview, module map, data flow, domain rules, and current
integrated state now define operation-scoped public activity as transient
presentation rather than Design authority or model reasoning.