docs: record Design chat generation client integration
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-08 08:45:40 +08:00
parent 7defe46de2
commit 323f4caa50
4 changed files with 119 additions and 93 deletions

View File

@@ -38,7 +38,7 @@
| 设计有限请求生命周期 | Renderer Workspace JSON 调用 / shared Works token refresh | Main deadline → Electron transport → safe-read-only Node fallback → Host API timeout envelope | 包括取凭据、请求头和响应 body 的完整生命周期最多 30 秒;超时 abort transport 并稳定返回 `504 DESIGN_WORKSPACE_REQUEST_TIMEOUT`;透明 fallback 只允许 `GET`/`HEAD`/`OPTIONS`mutation 不隐式重放 |
| Design Asset binding | 当前 Workspace 已完成图片 / 本地上传 | canonical Asset → typed `asset_binding` input → Current Specification revision | 图片/视频用途由 Specification medium 和 binding role 决定;只提交真实 Workspace Asset identity不使用本地路径或自然语言占位 |
| Design reference alias editing | Active plan 的 final Prompt 与 binding-only reference row | `@图片N` token/add/replace/remove → typed field/collection operations → Current Specification revision | Prompt 决定图片如何参与生成row 只管理稳定 reference/Asset identity。未绑定 alias 定点要求上传并阻止 Quote删除时原子移除 binding 并重排后续 alias既有 alias 不重复插入 |
| Design Quote and confirmation | 当前 exact Specification revision | `design.quote.request` → immutable public Quote projection → `design.generation.confirm` with Quote ID | Renderer 只展示 output summary、warnings、expiry、Token PointsProvider Prompt/model/route/storage/internal billing 不下发或编辑 |
| Design Quote and confirmation | 当前 exact Specification revision,或同一 accepted chat Run 中服务端识别出的显式完成意图 | `design.quote.request` → immutable public Quote projection → `design.generation.confirm` with Quote ID | 服务端可在同一 chat operation 下先发送 committed chat Direction projection再发送 offered Quote projectionStore 依次收敛两者Renderer 不发第二个 mutation。Renderer 只展示 output summary、warnings、expiry、Token PointsProvider Prompt/model/route/storage/internal billing 不下发或编辑,且只有用户显式确认 Quote ID 才授权创建 Task |
| Design Task and Asset sync | Direction event stream / Workspace resource events / explicit refresh | Renderer Task/Asset projections | Task/Asset events独立于 Living Formtransport order 和 progress 不改写 Specification也不授权新生成操作 |
| 设计项目删除 | Canvas 侧栏精确项目名确认 | Renderer → Main Host API → Works Square Workspace DELETE | 删除成功后清理当前 Workspace/Direction/resources 并选择最近更新的剩余项目;结算与软删除语义由服务端负责 |
| 历史 Prompt Museum URL | `/image-prompts/*` | App replace-redirect → `/image-canvas` | 当前 Canvas 无“获取灵感”入口App 不挂载或 lazy-load Museum 页面;保留的 Main API/auth/media 与 shared DTO 是 dormant 兼容/安全基础设施 |

View File

@@ -4,6 +4,17 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- AI Design chat-to-Quote client regression source commit
`6b1e3937d709b74d407379c210a4bf09e8f4b158` from task
`20260907-design-chat-generation-handoff-client-7d3a9c41` is integrated as merge
`7defe46de2d4c693a620ca0be10201a18ccd910e` by task
`20260908-integrate-design-chat-generation-client-7d3a9c42`. The existing Store
contract now has regression coverage for one accepted chat operation receiving its
committed chat Direction projection immediately followed by the offered immutable
Quote projection. The optimistic user message and activity settle once, while the
Quote remains visible without a second Renderer mutation. No client product code,
DTO, route, automatic confirmation, Task authorization, package, or deployment
changed; generation still begins only after explicit Quote-ID confirmation.
- Native text context-menu source frontier
`6fbb9c077ecda23e2ee6472631fe374527c49cb7` from task
`20260907-input-context-menu-a7c31e` is fast-forwarded onto local `main` by

View File

@@ -1,92 +0,0 @@
# Task: Handle AI Design chat generation handoff
## Identity
- Task ID: 20260907-design-chat-generation-handoff-client-7d3a9c41
- Mode: Feature
- Branch: codex/20260907-design-chat-generation-handoff-client-7d3a9c41-design-chat-generation-handoff
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260907-design-chat-generation-handoff-client-7d3a9c41
- Base commit: bce20d9e4dad99565714bd2c0ca1ef4806426f57
- Owner: codex-root
- Status: Ready for Integration
## Scope
- Verify that the existing client event contract can consume a server-owned
`开始生成` handoff without introducing a second Renderer command or public DTO.
- Preserve the original optimistic user message, activity/reply settlement, stable
operation identity, and the offered Quote created immediately after the committed
chat event.
- Add focused Store coverage for two consecutive Direction projections belonging to
the same accepted chat command.
## Intent And Constraints
- Electron Main remains the only network authority. Source inspection showed that no
new Renderer orchestration is needed: the server can emit the committed chat and
subsequent Quote as two existing `design.direction.updated` events in one Run.
- Never infer generation intent from assistant prose or duplicate phrase matching in
the client. The server owns interpretation and the Quote transaction.
- Keep Quote and generation confirmation separate: automatic handoff may create an
immutable Quote, but only explicit user confirmation may create a Task or reserve
Token Points.
- Derive a stable follow-up operation identity from the committed chat Interaction,
and do not replay an already accepted/unknown mutation under a new identity.
## Project Context Loaded
- Task context: feature task `20260907-design-chat-generation-handoff-client-7d3a9c41`
owns this managed linked worktree at base `bce20d9e…`.
- Read: agent-entry and planning-gate docs, memory index, project positioning,
integrated current state, decision index/system overview, ADR-007, architecture
module/data-flow maps, domain/success criteria, evidence/reflection/commitment/stale
indexes, and the recent Design activity and repeated-turn peer task records.
- Project goal: a youth-friendly Canvas whose Current Specification, immutable Quote,
and confirmed Task remain server-authoritative.
- Current integrated focus: optimistic chat, operation-scoped activity and committed
assistant streaming are already present; repeated identical user text is valid.
- Decisions affecting this task: ADR-007 requires stable operation identity, Main-owned
transport, immutable Quote display, and explicit Quote-ID confirmation.
- Evidence and commitments: production logs show an input Run completed without any
Quote/Task command; the real paid confirmation smoke remains separately pending.
- Likely modules: `shared/image-workspace.ts`, the Works Square adapter, Renderer
image-workspace Store, and their focused tests.
- Unknowns/conflicts: source inspection must identify the narrowest post-commit event
seam and ensure reconnect/replay cannot create duplicate Quote requests. The root
worktree's unrelated untracked records are outside this isolated task. No active
peer has a conflicting Design scope.
- Gate result: Passed.
## Outcome
- Confirmed that Main maps every Gateway `design.direction.updated` event
independently and the Store applies canonical form projections even after the
original optimistic operation has settled.
- Added a Store regression for the real sequence: committed `chat` projection,
immediately followed by `quote_request` with the same client operation identity.
The test proves the draft/pending chat settles once, the completed activity remains
bound to its Turn, and the offered Quote remains visible.
- No client product code, shared contract, routing, or UI change was necessary.
## Verification
- `pnpm exec vitest run tests/unit/image-workspace-store.test.ts --maxWorkers=1`
passed (33 tests).
- `pnpm exec eslint tests/unit/image-workspace-store.test.ts` passed.
- `pnpm run typecheck` passed.
- `git diff --check` passed.
## Follow-ups
- Integrate and deploy with server task
`20260907-design-chat-generation-intent-4f8c2a91`, then perform the recorded real
Quote/confirmation smoke.
## Promotion Candidates
- Target: `.project-docs/20-architecture/data-flow.md` and integrated current state.
Proposal: record that one accepted Design chat Run may carry a committed chat
Direction projection followed by an immutable Quote projection under the same
client command identity; the Store converges both without issuing a second
mutation. Evidence is the 33-test Store suite and the cross-repository server task.
This is compatible with ADR-007 and needs no separate product-direction decision.

View File

@@ -0,0 +1,107 @@
# Task: Integrate Design chat generation handoff client
## Identity
- Task ID: 20260908-integrate-design-chat-generation-client-7d3a9c42
- Mode: Integration
- Branch: codex/20260908-integrate-design-chat-generation-client-7d3a9c42-integrate-design-chat-generation-client
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260908-integrate-design-chat-generation-client-7d3a9c42
- Base commit: bce20d9e4dad99565714bd2c0ca1ef4806426f57
- Owner: codex-root
- Status: Ready for Integration
## Scope
- Integrate exact source commit `6b1e3937d709b74d407379c210a4bf09e8f4b158`
from task `20260907-design-chat-generation-handoff-client-7d3a9c41` onto exact local
`main` base `bce20d9e4dad99565714bd2c0ca1ef4806426f57`.
- Preserve the existing client behavior for two consecutive canonical Direction
projections under one accepted chat operation and land the source regression without
introducing a second Renderer mutation or phrase recognizer.
- Reconcile the accepted implementation fact into canonical current state/data flow,
verify the integration tree, and advance local `main` while preserving the three
unrelated untracked root task records.
## Intent And Constraints
- Electron Main remains the only network authority; generation intent and Quote
creation remain server-owned.
- One accepted chat Run may settle its optimistic Turn and then expose an immutable
Quote under the same client operation identity. The Store must converge both events
without duplicating the chat or sending another mutation.
- Quote display is not generation authorization. Only explicit Quote-ID confirmation
may create a Task or reserve Token Points.
- Do not modify, stage, delete, move, stash, reset, or clean the root worktree's
untracked `package-122`, `package-123`, or `client-hang-diagnosis` task records.
- Source task records remain immutable on their source branches. The integration line
owns only this task record and canonical reconciliation.
## Project Context Loaded
- Task context: integration task
`20260908-integrate-design-chat-generation-client-7d3a9c42` owns the isolated
worktree and the sole client Integration lock at base
`bce20d9e4dad99565714bd2c0ca1ef4806426f57`.
- Read: agent-entry and Planning Gate docs, memory index, project positioning/current
state, decision index/system overview, module/data-flow maps, business rules/success
criteria, evidence/reflection/commitment/stale indexes, ADR-007, the source task
record, and recent activity/repeated-turn peer task records.
- Project goal and current focus: a youth-friendly Canvas whose conversation is the
primary input while the Current Specification, immutable Quote, confirmed Task, and
Assets remain server-authoritative; optimistic chat and operation-scoped activity/
assistant projections are already integrated.
- Active constraints and decisions: stable operation identity, Main-owned transport,
one provisional message per operation, canonical Direction convergence, immutable
Quote display, and explicit Quote-ID confirmation.
- Evidence, reflections, or commitments: production showed a completed chat Run with
no Quote/Task; paired deployed-client confirmation and paid generation remain a
separate smoke. The integration workflow must not copy source task records into the
final canonical tree.
- Likely modules: `tests/unit/image-workspace-store.test.ts`, canonical
`current-state.md`, and `data-flow.md`; no client product module changes are expected.
- Other active local tasks: the activity task is an integrated predecessor; the
repeated-turn task explicitly made no product change; package tasks are isolated and
do not overlap this source. No current peer owns this integration slice.
- Unknowns, stale docs, or conflicts: template placeholders in project positioning are
longstanding canonical debt, not authority for this change. No semantic conflict was
found; production deployment remains outside this integration.
- Gate result: Passed.
## Outcome
- Merged exact source commit `6b1e3937d709b74d407379c210a4bf09e8f4b158`
without conflict as two-parent integration merge
`7defe46de2d4c693a620ca0be10201a18ccd910e`.
- Retained the existing product implementation and added its focused regression:
one accepted chat operation may settle the optimistic Turn and then apply a second
canonical Direction projection containing the offered immutable Quote. The Store
preserves that Quote without issuing another Renderer mutation.
- No client product code, shared DTO, route, phrase parser, automatic confirmation,
Task authorization, package, deployment, or publication behavior changed.
- Promoted the accepted fact into canonical `current-state.md` and `data-flow.md`.
Removed only the merged copy of the source task record from the integration tree;
the source branch/commit retains its complete immutable record.
## Verification
- Source task reported the focused Store suite (`33 passed`), ESLint, TypeScript, and
diff checks passing.
- On integration merge `7defe46de2d4c693a620ca0be10201a18ccd910e` plus canonical
reconciliation:
`pnpm exec vitest run tests/unit/image-workspace-store.test.ts --maxWorkers=1`
-> `33 passed`.
- `pnpm exec eslint tests/unit/image-workspace-store.test.ts` -> passed.
- `pnpm run typecheck` -> passed.
- Paired Works Square integration verification is recorded in task
`20260908-integrate-design-chat-generation-8f4c2a71`.
## Follow-ups
- Deploy only with the matching server integration, then run the explicit
Quote/confirmation/single-Task smoke recorded by the server task.
## Promotion Candidates
- Promoted: canonical client state/data flow now record consecutive committed-chat and
offered-Quote Direction projections under one accepted operation, without a second
Renderer command or implicit generation authorization.