Skip to content

新增:导演实时生产流程图 + 修复英文书名/章节标题语言跟随(#333) - #334

Open
ExplosiveCoderflome wants to merge 10 commits into
betafrom
feat/production-flow-graph-and-issue-333
Open

ExplosiveCoderflome wants to merge 10 commits into
betafrom
feat/production-flow-graph-and-issue-333

Conversation

@ExplosiveCoderflome

Copy link
Copy Markdown
Owner

将 feat/production-flow-graph-and-issue-333 合入 beta,包含两部分:

1. 新版导演实时生产流程图

  • 新增导演生产流程图(live production flow graph):步骤节点、步骤输出、横向进度流(serpentine editorial flow river)
  • 节点检查器改为右侧宽幅抽屉(portal inspector),与 Prompt Workbench 风格对齐

2. 修复 #333:英文创作时书名与章节标题仍为中文

  • 书名与章节标题生成跟随作品语言(writingLanguage),并按语言口径校验
  • 背景:英文全流程真实 UI 测试(2026-12-05)发现正文全英文但标题层仍为中文

Closes #333

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

A paused auto-director run renders as idle in the new production flow graph: every paused branch keys off cursorStepId, which the control transition clears on pause.

Approach: sound — the graph is a read-only server projection over run control, artifacts and invocation records, reusing the Prompt Workbench flow definitions instead of maintaining a second copy, and the title fix moves language-specific limits out of static Zod schemas into postValidate so English and Chinese each keep their own rules.

Reviewed changes — the full 47-file diff: the new production-flow projection and route plus its client canvas, inspector and output tab; the English book/chapter-title language plumbing across prompts, schemas and repair paths; and the supporting i18n, docs, release notes and tests.

  • Production flow projection — new projectDirectorProductionFlow / readDirectorProductionFlow and GET /director-next/novels/:novelId/production-flow, deriving per-step status from run control, artifacts, live batch phase and LlmInvocationUsageRecord.
  • Production flow UI — lazily loaded canvas/layout reusing Prompt Workbench flow definitions, right-edge inspector drawer with output/prompts/executions tabs, chapter scoping and 8s polling.
  • English title language — language-aware limits and validation in titleGeneration.shared, both title prompts, chapterTitleDiversity, chapter-list prompt/repair, and writingLanguage resolution through the volume and director call chains.
  • Supporting — Prompt Workbench ?promptId=&version= deep links, i18n keys, wiki pages, release notes and two new test files.

Non-blocking

  • The flow header's token count is not a book total. readDirectorProductionFlow sums summary.totalTokens / totalInvocations over the take: 400 invocation window (productionFlow.ts#L842), but the header presents it as the book total (ProductionFlowView.tsx#L185). For a full-length book with more than 400 calls the figure silently under-reports; use a separate aggregate query or label it as recent activity.
  • Chinese chapter summaries lost their 240-character schema cap. volumeGenerationSchemas raises summary to 420 and title to 80 for every language (volumeGenerationSchemas.ts#L400); the English-specific rules live in postValidate, but no Chinese summary limit was added there, so the wiki's "Chinese rules unchanged" claim does not hold for summaries.
  • Flow node subtitles are Chinese-only. The new statusReason / outputSummary strings are hardcoded Chinese (productionFlow.ts#L392) and the client renders them directly, so an English-writing novel sees Chinese subtitles inside an otherwise localized view.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

if (control?.status === "running" && control.cursorStepId === cursorId) {
return { status: "running", reason: opts.runningReason ?? "正在执行本步骤", reviewRoute: null };
}
if (control?.status === "paused" && control.cursorStepId === cursorId) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 pause clears cursorStepId in applyControlEvent (server/src/modules/director/domain/control.ts), so control.cursorStepId === cursorId is never true while the run is paused. This branch, the paused branch in resolveActiveStepId, and missionPaused / batchPaused can never fire, so a paused run renders as idle and productionFlowStatusPaused (plus the paused CSS states) is unreachable UI.

Technical details
# Paused/failed runs have no node state in the production flow projection

## Affected sites
- `server/src/app/director/workspace/productionFlow.ts:414` — paused check in `liveStatus` never matches.
- `server/src/app/director/workspace/productionFlow.ts:267` — `resolveActiveStepId` paused branch switches on a null cursor.
- `server/src/app/director/workspace/productionFlow.ts:554` and `:598` — `missionPaused` / `batchPaused` require the cleared cursor.
- `server/src/modules/director/domain/control.ts:131` — `pause` sets `cursorStepId = null`; `fail` does the same.

## Required outcome
- A paused run must surface which step is paused (or at least a paused run state) in the flow graph.
- `productionFlowStatusPaused` and the paused node styling should only ship if they are reachable.

## Suggested approach (optional)
- Derive the paused step from `control.pause` plus the last `step_started` event, or map the paused chapter job's `currentStage` the way `readProductionProjection` does for running runs.

## Open questions for the human (optional)
- Should the flow graph represent `failed` runs at all, or is failure intentionally left to the task center?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant