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

@@ -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.