S7-10 · 进阶S7-10 · Advanced

DAG 工作流 · 依赖决定并行,成环就不能保存DAG Workflow · Dependencies Create Parallelism; Cycles Block Saving

drag node → connect dependency → reject cycle → recompute parallel starts + critical path

有向无环工作流(DAG Workflow)用无环依赖图组织可并行、可汇合的确定性任务步骤。它适合结构稳定的流程,并与开放式循环形成对照。A directed acyclic graph (DAG) workflow organizes deterministic steps that can run in parallel and later join. It suits stable process structure and contrasts with open-ended loops.

01 · 两个同事互等,项目还能开工吗01 · If two people wait on each other, can work begin?

分析与法务都只依赖取数,本可同时开始;如果又画一条“发送完成后才能取数”的回边,整个计划还有合法起点吗?Analysis and legal review both depend only on data collection, so they can start together. Add a back edge from sending to collection—does the plan still have a valid starting point?

02拖节点连线,观察独立节点并行、关键路径换色与成环拒绝保存Drag Nodes to Connect Them; Watch Parallel Starts, Critical Path, and Cycle Rejection

可拖连线 · 关键路径drag-to-connect · critical path
状态 AMetric A
状态 BMetric B
状态 CMetric C

所有概率、成本、成功率与输出均为固定种子的教学模拟,不代表真实模型输出。把主变量拖回即可复核结论。All probabilities, costs, success rates, and outputs are fixed-seed teaching simulations, not real model output. Move the main variable back to verify the conclusion.

03把刚才的变化拆成 4 个零件Break the Change into Four Parts

DAG Workflow
NODE

确定步骤Deterministic step

每个节点有明确输入、输出与工期。Each node has explicit inputs, outputs, and duration.

EDGE

依赖边Dependency edge

A→B 表示 B 必须等待 A,不表示自然语言里的相关。A→B means B must wait for A; it is not mere semantic association.

PARALLEL

自动并行Automatic parallelism

没有互相依赖的就绪节点可在同一时刻启动。Ready nodes without mutual dependencies can start together.

CRITICAL

关键路径Critical path

最长依赖链决定最短完工时间,改边后必须重算。The longest dependency chain sets minimum completion time and must be recomputed after edge changes.

04最小机制:主交互能逐项验证Minimal Mechanism: Verify Each Link in the Interaction

MECHANISM
finish(v) = duration(v) + maxu→v finish(u)
主交互按最长前置完工时间计算每个节点;若拓扑排序无法覆盖全部节点,就检测到环并禁止保存。The interaction computes each node from the latest predecessor finish. If topological sorting cannot cover every node, it detects a cycle and blocks saving.
连依赖Connect拖一个节点到另一个drag one node to another
拓扑校验Validate环路立即拒绝reject cycles immediately
调度重算Schedule并行组 + 关键路径parallel groups + critical path

05把最后节点拖回第一个节点形成闭环Drag the Final Node Back to the First and Form a Cycle

主动制造失败Create a failure

边界实验Boundary experiment

DAG 没有“等一会儿也许能跑”的环。成环时不存在合法拓扑顺序,保存动作必须被阻止。A DAG cannot wait its way out of a cycle. A cycle has no valid topological order, so saving must be blocked.

尚未执行。先在主交互中观察正常机制。Not run yet. Observe the normal mechanism in the main interaction first.
相关步骤都要串行连接。Related steps must be serialized.→ ✓ 只有真实依赖才连边;独立步骤自动并行。Connect only real dependencies; independent steps run in parallel.
画出流程图就一定是 DAG。Any flowchart is a DAG.→ ✓ 每次改边都要机械检测是否成环。Every edge change requires a mechanical cycle check.
DAG 与状态机只是两种画法。A DAG and state machine are merely two drawings.→ ✓ DAG 编排任务依赖;状态机约束单对象的合法转移。A DAG schedules task dependencies; a state machine constrains legal transitions of one object.
06 · 一句话带走06 · One line to keep

DAG 只连接真实依赖,让独立节点自动并行;最长依赖链成为关键路径,而任何成环连线都必须阻止保存。A DAG connects only real dependencies so independent nodes run in parallel. The longest chain is critical, and any cycle must block saving.