Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

refactor (#21875)

Jin Hai2fb37b43f7dc
diff --git a/internal/deepdoc/parser/pdf/table/table_span_inject_test.go b/internal/deepdoc/parser/pdf/table/table_span_inject_test.go
index 1ea4cc1d3d..ed29f2eb05 100644
--- a/internal/deepdoc/parser/pdf/table/table_span_inject_test.go
+++ b/internal/deepdoc/parser/pdf/table/table_span_inject_test.go
@@ -10,18 +10,18 @@ import (
)
// TestGroupCellsInjectsSpanning verifies that GroupCells propagates EVERY TSR
-// "table spanning cell" label into the assembled grid — both the wide col-span
-// header and the tall row-span header cell — instead of dropping a span whose
+// "table spanning cell" label into the assembled grid both the wide col-span
+// header and the tall row-span header cell instead of dropping a span whose
// box only reaches one row/column center.
//
-// Repro from real_pdfs/1.pdf table 0 (tsr_raw coordinates, raw PDF points —
+// Repro from real_pdfs/1.pdf table 0 (tsr_raw coordinates, raw PDF points
// GroupCells only compares relative positions, so no crop/scale mapping is
// needed here):
// - colspan spanning cell #17: x0=209.3 y0=112.2 x1=446.8 y1=138.0
// - rowspan spanning cell #18: x0=210.3 y0=135.3 x1=249.7 y1=229.7
//
// The real PDF cell "名称" spans TWO rows (rowspan=2); TSR only emits a span
-// box that reaches row1's center (rowspan=1) — a known TSR-model limitation
+// box that reaches row1's center (rowspan=1) a known TSR-model limitation
// tracked separately. Go must still faithfully label BOTH TSR span boxes so
// the recognition is not lost; restoring the true rowspan=2 is the TSR model's
// job, not Go's. The previous code used `len(covered) < 2` to skip a span that
@@ -74,7 +74,7 @@ func TestGroupCellsInjectsSpanning(t *testing.T) {
t.Errorf("expected BOTH TSR spanning cells (#17 colspan header + #18 rowspan '名称') "+
"to be labelled in the grid, got %d (positions=%v). "+
"GroupCells must not drop a span whose box only reaches one "+
- "row/column center — the TSR recognition must be preserved "+
+ "row/column center the TSR recognition must be preserved "+
"(restoring the true rowspan=2 is the TSR model's job).",
spanCount, spanPositions)
}
diff --git a/internal/harness/graph/checkpoint/nats.go b/internal/harness/graph/checkpoint/nats.go
index 1f43d88a93..86b296c1ff 100644
--- a/internal/harness/graph/checkpoint/nats.go
+++ b/internal/harness/graph/checkpoint/nats.go
@@ -260,21 +260,6 @@ func (s *NATSSaver) List(ctx context.Context, config map[string]interface{}, lim
return results, nil
}
-// ---- Garbage Collection ----
-//
-// GC原理:
-//
-// 每个 key 对应一个 graph instance(一个执行线程)。
-// 活跃的 graph 会持续写入 checkpoint,其 key 永远不会变"冷"。
-// 当一个 graph 执行完毕(正常结束、被中断、或崩溃),其 key 不再更新。
-//
-// GC 定期扫描所有 key,检查最新 checkpoint 的创建时间。
-// 如果超过 MaxGraphIdle 没有新 checkpoint,说明该 graph instance 已经结束,
-// GC 会删除该 key 的所有历史版本。这样就实现了"每个 graph 结束后自动清理"。
-//
-// NATS KV 的 History=N 在 GC 之上提供了一层增量保护:
-// 活跃 graph 的超旧版本会被 NATS 自动丢弃,防止单个 key 无限膨胀。
-
// runGC periodically scans for completed graph instances and purges them.
func (s *NATSSaver) runGC(interval time.Duration) {
defer s.wg.Done()
@@ -318,9 +303,8 @@ func (s *NATSSaver) collectGarbage() {
continue
}
- // 最新 checkpoint 的创建时间超过 MaxGraphIdle → graph instance 已结束
if entry.Created().Before(cutoff) {
- if err := s.kv.Delete(ctx, key); err == nil {
+ if err = s.kv.Delete(ctx, key); err == nil {
purged++
}
}
diff --git a/internal/harness/graph/pregel/pregel_pressure_test.go b/internal/harness/graph/pregel/pregel_pressure_test.go
index 4fec4d5cb7..994c7eb541 100644
--- a/internal/harness/graph/pregel/pregel_pressure_test.go
+++ b/internal/harness/graph/pregel/pregel_pressure_test.go
@@ -27,10 +27,6 @@ func safeMap(state any) map[string]any {
return m
}
-// ============================================================
-// P1: 多步循环图 — 条件路由循环 10 轮
-// ============================================================
-
func newLoopGraph(t *testing.T, maxIter int) types.StateGraph {
t.Helper()
sg := graph.NewStateGraph(map[string]any{
@@ -112,10 +108,6 @@ func TestEngine_Loop100Iterations(t *testing.T) {
}
}
-// ============================================================
-// P2: 50 节点顺序链 — 线性图可靠性
-// ============================================================
-
func newChainGraph(t *testing.T, n int) types.StateGraph {
t.Helper()
sg := graph.NewStateGraph(map[string]any{"idx": 0})
@@ -155,10 +147,6 @@ func TestEngine_Chain50Nodes(t *testing.T) {
}
}
-// ============================================================
-// P3: 10 路扇出 + DAG 汇聚 — AllPredecessor 模式
-// ============================================================
-
func TestEngine_FanOut10_FanInDAG(t *testing.T) {
sg := graph.NewStateGraph(map[string]any{"count": 0, "value": ""})
sg.SetNodeTriggerMode(types.NodeTriggerAllPredecessor)
@@ -213,10 +201,6 @@ func TestEngine_FanOut10_FanInDAG(t *testing.T) {
}
}
-// ============================================================
-// P4: 并发安全 — 50 个 goroutine 同时 Invoke 同一个 Engine
-// ============================================================
-
func TestEngine_Concurrent50SameGraph(t *testing.T) {
// Create the graph once, then a new Engine per goroutine (Engine is not designed for concurrent RunSync).
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -249,10 +233,6 @@ func TestEngine_Concurrent50SameGraph(t *testing.T) {
}
}
-// ============================================================
-// P5: 50 个独立 Engine 同时运行 — 多租户模拟
-// ============================================================
-
func TestEngine_MultiTenant50Engines(t *testing.T) {
var wg sync.WaitGroup
errs := make(chan error, 50)
@@ -283,10 +263,6 @@ func TestEngine_MultiTenant50Engines(t *testing.T) {
}
}
-// ============================================================
-// P6: BinaryOperatorAggregate channel 类型
-// ============================================================
-
func TestEngine_BinaryOperatorAggregate(t *testing.T) {
sg := graph.NewStateGraph(map[string]any{"total": 0})
sg.SetNodeTriggerMode(types.NodeTriggerAllPredecessor)
@@ -327,10 +303,6 @@ func TestEngine_BinaryOperatorAggregate(t *testing.T) {
}
}
-// ============================================================
-// P7: 超时取消 — 超长节点被上下文取消
-// ============================================================
-
func TestEngine_TimeoutCancel(t *testing.T) {
sg := graph.NewStateGraph(map[string]any{"val": ""})
sg.AddChannel("val", channels.NewLastValue(""))
@@ -352,10 +324,6 @@ func TestEngine_TimeoutCancel(t *testing.T) {
t.Logf("got expected error: %v", err)
}
-// ============================================================
-// P8: 递归限制 — 超过 recursionLimit 报错
-// ============================================================
-
func TestEngine_RecursionLimitExceeded(t *testing.T) {
sg := newLoopGraph(t, 50)
engine := NewEngine(sg, WithRecursionLimit(10))
@@ -366,14 +334,6 @@ func TestEngine_RecursionLimitExceeded(t *testing.T) {
t.Logf("got expected error: %v", err)
}
-// ============================================================
-// P0 — 核心稳定性缺口
-// ============================================================
-
-// ============================================================
-// P0-1: 节点 panic 恢复
-// ============================================================
-
func TestEngine_NodePanicRecovery(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -397,10 +357,6 @@ func TestEngine_NodePanicRecovery(t *testing.T) {
t.Logf("engine correctly recovered panic: %v", err)
}
-// ============================================================
-// P0-2: 错误传播 — 单节点失败
-// ============================================================
-
func TestEngine_NodeErrorPropagation(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -428,10 +384,6 @@ func TestEngine_NodeErrorPropagation(t *testing.T) {
t.Logf("error correctly propagated: %v", err)
}
-// ============================================================
-// P0-3: 多节点并发执行时部分节点失败
-// ============================================================
-
func TestEngine_PartialNodeFailureInFanOut(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"count": 0, "value": ""})
@@ -487,10 +439,6 @@ func TestEngine_PartialNodeFailureInFanOut(t *testing.T) {
}
}
-// ============================================================
-// P0-4: 节点执行过程中 context 取消 — 资源清理
-// ============================================================
-
func TestEngine_ContextCancellationMidExecution(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -524,14 +472,6 @@ func TestEngine_ContextCancellationMidExecution(t *testing.T) {
}
}
-// ============================================================
-// P1 — 重要场景
-// ============================================================
-
-// ============================================================
-// P1-1: 混合模式 — 同一个 Graph 同时包含 BSP 和 DAG 边
-// ============================================================
-
func TestEngine_MixedBSPAndDAG(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"counter": 0, "merged": ""})
@@ -609,10 +549,6 @@ func TestEngine_MixedBSPAndDAG(t *testing.T) {
t.Logf("mixed BSP/DAG complete: counter=%d, merged=%s", c, v)
}
-// ============================================================
-// P1-2: 条件边 + DAG 组合
-// ============================================================
-
func TestEngine_ConditionalEdgesWithDAG(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"route": "", "result": ""})
@@ -666,10 +602,6 @@ func TestEngine_ConditionalEdgesWithDAG(t *testing.T) {
t.Logf("conditional+DAG complete: result=%s", r)
}
-// ============================================================
-// P1-3: Large fan-in — 100+ 入边汇聚到单一节点
-// ============================================================
-
func TestEngine_LargeFanIn100(t *testing.T) {
t.Parallel()
const n = 100
@@ -722,10 +654,6 @@ func TestEngine_LargeFanIn100(t *testing.T) {
}
}
-// ============================================================
-// P1-4: Large fan-out — 100+ 出边
-// ============================================================
-
func TestEngine_LargeFanOut100(t *testing.T) {
t.Parallel()
const n = 100
@@ -775,10 +703,6 @@ func TestEngine_LargeFanOut100(t *testing.T) {
t.Logf("large fan-out complete: aggregated=%d", c)
}
-// ============================================================
-// P1-5: 中断 + 恢复 + 循环边组合
-// ============================================================
-
func TestEngine_InterruptAndLoop(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"counter": 0, "value": ""})
@@ -843,10 +767,6 @@ func TestEngine_InterruptAndLoop(t *testing.T) {
}
}
-// ============================================================
-// P1-6: 空节点执行 — 节点返回 nil/空结果
-// ============================================================
-
func TestEngine_EmptyNodeExecution(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -884,10 +804,6 @@ func TestEngine_EmptyNodeExecution(t *testing.T) {
}
}
-// ============================================================
-// P1-7: 同一个 Node 对象被多个 Engine 并发 Run — Node 复用安全
-// ============================================================
-
func TestEngine_NodeReuseConcurrentRun(t *testing.T) {
t.Parallel()
// Build a reusable node function
@@ -931,14 +847,6 @@ func TestEngine_NodeReuseConcurrentRun(t *testing.T) {
}
}
-// ============================================================
-// P2 — 边缘情况
-// ============================================================
-
-// ============================================================
-// P2-1: Durability 模式组合
-// ============================================================
-
func TestEngine_DurabilityModes(t *testing.T) {
t.Parallel()
@@ -976,10 +884,6 @@ func TestEngine_DurabilityModes(t *testing.T) {
}
}
-// ============================================================
-// P2-12: Channel 写入冲突 — LastValue 多写入报错 vs BinaryOperator 合并
-// ============================================================
-
func TestEngine_ChannelWriteConflict(t *testing.T) {
t.Parallel()
@@ -1058,10 +962,6 @@ func TestEngine_ChannelWriteConflict(t *testing.T) {
})
}
-// ============================================================
-// P2-13: State 数据竞争 — 高压并发 state 读写
-// ============================================================
-
func TestEngine_StateConcurrentHighPressure(t *testing.T) {
t.Parallel()
const concurrency = 30
@@ -1121,10 +1021,6 @@ func TestEngine_StateConcurrentHighPressure(t *testing.T) {
}
}
-// ============================================================
-// P2-14: MaxIterations 耗尽 vs 条件边自然终止
-// ============================================================
-
func TestEngine_MaxIterationsVsConditionStable(t *testing.T) {
t.Parallel()
@@ -1208,10 +1104,6 @@ func TestEngine_MaxIterationsVsConditionStable(t *testing.T) {
})
}
-// ============================================================
-// P2-15: Channel 类型组合 — SendUnique + BinaryOperator + Ephemeral
-// ============================================================
-
func TestEngine_ChannelTypeCombinations(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": "", "total": 0})
@@ -1267,10 +1159,6 @@ func TestEngine_ChannelTypeCombinations(t *testing.T) {
t.Logf("channel combination: val=%s, total=%d", val, total)
}
-// ============================================================
-// P2-16: 动态边 — 条件边根据运行时 state 动态路由
-// ============================================================
-
func TestEngine_DynamicConditionalRouting(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"counter": 0, "history": ""})
@@ -1345,10 +1233,6 @@ func TestEngine_DynamicConditionalRouting(t *testing.T) {
t.Logf("dynamic routing: counter=%d, history=%s", c, hist)
}
-// ============================================================
-// P2-17: Checkpoint + BSP Pregel 混合 — 每步 checkpoint 验证
-// ============================================================
-
func TestEngine_CheckpointWithBSPLoop(t *testing.T) {
t.Parallel()
cp := checkpoint.NewMemorySaver()
@@ -1384,10 +1268,6 @@ func TestEngine_CheckpointWithBSPLoop(t *testing.T) {
}
}
-// ============================================================
-// P2-18: 重复节点 ID — AddNode 同名覆盖
-// ============================================================
-
func TestEngine_DuplicateNodeID(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -1422,10 +1302,6 @@ func TestEngine_DuplicateNodeID(t *testing.T) {
t.Logf("duplicate node: second AddNode correctly overwrote first")
}
-// ============================================================
-// P2-2: 极端配置值
-// ============================================================
-
func TestEngine_ExtremeConfigValues(t *testing.T) {
t.Parallel()
@@ -1473,10 +1349,6 @@ func TestEngine_ExtremeConfigValues(t *testing.T) {
})
}
-// ============================================================
-// P2-3: 多 Entry Point — 多个 Start 节点
-// ============================================================
-
func TestEngine_MultipleEntryPoints(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val_a": "", "val_b": ""})
@@ -1513,10 +1385,6 @@ func TestEngine_MultipleEntryPoints(t *testing.T) {
t.Logf("multi-entry result: %v", m)
}
-// ============================================================
-// P2-4: 节点同时有 BSP 边和条件边
-// ============================================================
-
func TestEngine_NodeWithBothEdgeAndConditionalEdge(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"counter": 0, "value": ""})
@@ -1570,10 +1438,6 @@ func TestEngine_NodeWithBothEdgeAndConditionalEdge(t *testing.T) {
t.Logf("node with both edges: %v", m)
}
-// ============================================================
-// P2-5: 长时间运行节点超时
-// ============================================================
-
func TestEngine_NodeTimeout(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"val": ""})
@@ -1603,10 +1467,6 @@ func TestEngine_NodeTimeout(t *testing.T) {
}
}
-// ============================================================
-// P2-6: 多个 fan-in 在同一 DAG 中
-// ============================================================
-
func TestEngine_MultipleFanInNodes(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"a": 0, "b": 0, "result": ""})
@@ -1691,10 +1551,6 @@ func TestEngine_MultipleFanInNodes(t *testing.T) {
t.Logf("multiple fan-in: a=%d, b=%d, result=%s", a, b, r)
}
-// ============================================================
-// P2-7: 节点返回 Overwrite 包装值
-// ============================================================
-
func TestEngine_OverwriteValue(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"value": ""})
@@ -1723,10 +1579,6 @@ func TestEngine_OverwriteValue(t *testing.T) {
t.Logf("overwrite value: %s", v)
}
-// ============================================================
-// P2-8: 空图(仅 Start → End)
-// ============================================================
-
func TestEngine_TrivialEmptyGraph(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"x": ""})
@@ -1742,10 +1594,6 @@ func TestEngine_TrivialEmptyGraph(t *testing.T) {
t.Logf("trivial graph result: %v", result)
}
-// ============================================================
-// P2-9: 节点 Pregel 模式 + 自定义 channel 读写
-// ============================================================
-
func TestEngine_PregelWithCustomChannels(t *testing.T) {
t.Parallel()
sg := graph.NewStateGraph(map[string]any{"total": 0, "value": ""})
@@ -1782,10 +1630,6 @@ func TestEngine_PregelWithCustomChannels(t *testing.T) {
t.Logf("custom channel state: total=%d", total)
}
-// ============================================================
-// P2-10: 大迭代数循环 — 在 BSP 模式下验证状态累积正确
-// ============================================================
-
func TestEngine_LargeLoopBSP(t *testing.T) {
t.Parallel()
const iterations = 50
@@ -1811,10 +1655,6 @@ func TestEngine_LargeLoopBSP(t *testing.T) {
t.Logf("large BSP loop complete: counter=%d, value=%s", c, v)
}
-// ============================================================
-// P2-11: 单节点图 — 直线执行
-// ============================================================
-
func TestEngine_SingleNodeGraph(t *testing.T) {
t.Parallel()
for _, mode := range []types.NodeTriggerMode{
@@ -1850,9 +1690,3 @@ func TestEngine_SingleNodeGraph(t *testing.T) {
})
}
}
-
-// ============================================================
-
-// ============================================================
-// #2: Channel 写入冲突 — LastValue 多写入报错 vs BinaryOperator 合并
-// ============================================================
diff --git a/internal/ingestion/component/chunker/image_upload.go b/internal/ingestion/component/chunker/image_upload.go
index f43f345e08..8b3e673f72 100644
--- a/internal/ingestion/component/chunker/image_upload.go
+++ b/internal/ingestion/component/chunker/image_upload.go
@@ -59,7 +59,7 @@ func imageUploadConcurrency() int {
// - media_ref only → materialize one image from the run media cache.
// - otherwise → decode the image, upload the bytes via
// uploadOneImage at key=ck["id"], set img_id="<kb_id>-<chunk_id>", and
-// delete the raw image field (用完即弃).
+// delete the raw image field.
//
// Materializing inside the loop keeps peak memory at one image instead of the
// whole document. Every cache, integrity, scope, or transport failure aborts
diff --git a/internal/ingestion/task/pipeline_executor.go b/internal/ingestion/task/pipeline_executor.go
index 769b879e74..d46f96a106 100644
--- a/internal/ingestion/task/pipeline_executor.go
+++ b/internal/ingestion/task/pipeline_executor.go
@@ -881,8 +881,7 @@ var ErrMissingRunIdentity = errors.New("pipeline log id is required")
// ErrPipelineVersionMissing is the single multi-version Missing sentinel. It is
// defined once in the dao package (dao.ErrPipelineVersionMissing) and re-exported
// here so the service and task layers share one identity (review: merge the
-// duplicate service/task sentinels into one implementation). The wrapped message
-// still carries the user-facing hint "pipeline 版本不存在,请重新选择版本".
+// duplicate service/task sentinels into one implementation).
var ErrPipelineVersionMissing = dao.ErrPipelineVersionMissing
// RecordPipelineLog persists a pipeline operation log without requiring
diff --git a/internal/service/dataset/pipeline_version_binding_test.go b/internal/service/dataset/pipeline_version_binding_test.go
index af333b6b83..0ec6626ba6 100644
--- a/internal/service/dataset/pipeline_version_binding_test.go
+++ b/internal/service/dataset/pipeline_version_binding_test.go
@@ -473,7 +473,7 @@ func TestUpdateDataset_VersionChangeResetsParserConfigToNewVersionDefault(t *tes
if kb.PipelineVersionID == nil || *kb.PipelineVersionID != verNew {
t.Fatalf("PipelineVersionID = %v, want re-pinned %s", kb.PipelineVersionID, verNew)
}
- // C3 (full reset, design A3 整体重置): the pre-switch marker must be gone
+ // C3 (full reset): the pre-switch marker must be gone
// (not merged), and the resolved config must come from the NEW version.
if v, ok := kb.ParserConfig["__c3_marker__"]; ok && v == "OLD" {
t.Fatalf("parser_config still holds pre-switch marker; C3 reset did not run: %v", kb.ParserConfig)
diff --git a/internal/service/dataset/update.go b/internal/service/dataset/update.go
index 909211fe61..6e03cd2d58 100644
--- a/internal/service/dataset/update.go
+++ b/internal/service/dataset/update.go
@@ -376,7 +376,7 @@ func (d *DatasetService) UpdateDataset(ctx context.Context, datasetID, userID st
// Design C5/G3: an empty pipeline_version_id in Pipeline mode is REJECTED
// (no longer silently cleared or auto-backfilled to the canvas latest).
// The Save fails with ErrPipelineVersionEmpty so the UI can show the red
- // Missing badge and the "版本信息缺失" error. BuiltIn mode (no canvas
+ // Missing badge and the "mission version info" error. BuiltIn mode (no canvas
// bound) is exempt and may carry an empty version.
isEffPipeline := canvasCtx != nil && strings.TrimSpace(*canvasCtx) != ""
if req.PipelineVersionID != nil {
diff --git a/internal/service/document/document_test.go b/internal/service/document/document_test.go
index 5fb1e1ef54..c66786c1dc 100644
--- a/internal/service/document/document_test.go
+++ b/internal/service/document/document_test.go
@@ -4481,7 +4481,7 @@ func TestUpdateDatasetDocumentParentChildConfigReachesCanvasChunker(t *testing.T
seedDocVersion(t, db, pipelineID, "v-pcc-0001", 0)
// Bind the document to the pipeline first, so the update below is a plain
// parser_config patch on an already-canvas document. A pipeline switch must
- // reset parser_config to the canvas DSL defaults (design A3 整体重置), so the
+ // reset parser_config to the canvas DSL defaults, so the
// submitted parent_child would be dropped on a switch; this test verifies the
// config reaches the canvas chunker when no switch occurs.
bindDocCanvas(t, db, "kb-1", "doc-1", pipelineID, "v-pcc-0001")
diff --git a/internal/service/document/document_version_pin_pipeline_change_test.go b/internal/service/document/document_version_pin_pipeline_change_test.go
index d404a1f372..8b776ef585 100644
--- a/internal/service/document/document_version_pin_pipeline_change_test.go
+++ b/internal/service/document/document_version_pin_pipeline_change_test.go
@@ -25,8 +25,7 @@ import (
// TestUpdateDatasetDocument_PipelineChangeWithoutVersionRejected verifies the C5/G3
// contract: switching a document to a different dataflow canvas WITHOUT supplying a
// concrete pipeline_version_id is REJECTED (design section 3: empty version is no
-// longer silently backfilled to the canvas latest). The UI must surface the red
-// Missing badge and the "版本信息缺失" error instead.
+// longer silently backfilled to the canvas latest).
func TestUpdateDatasetDocument_PipelineChangeWithoutVersionRejected(t *testing.T) {
db := setupServiceTestDB(t)
pushServiceDB(t, db)
diff --git a/internal/service/document/document_version_pin_update_test.go b/internal/service/document/document_version_pin_update_test.go
index 503a9e8f24..d244d16f97 100644
--- a/internal/service/document/document_version_pin_update_test.go
+++ b/internal/service/document/document_version_pin_update_test.go
@@ -258,7 +258,7 @@ func TestUpdateDatasetDocument_CleansParserConfigWithNewVersion(t *testing.T) {
// T26/C3 (document): switching the pinned version of a pipeline document WITHOUT
// supplying parser_config resets the document's component params to the new
-// version default (design section 5 + T26/A3 整体重置). The previous config must
+// version default. The previous config must
// not be merged in.
func TestUpdateDatasetDocument_VersionSwitchResetsParserConfigToNewDefault(t *testing.T) {
db := setupServiceTestDB(t)