docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]

This commit is contained in:
2026-11-16 17:52:11 +08:00
parent 30829eeb86
commit 1090591503
123 changed files with 1279 additions and 3 deletions
+10
View File
@@ -1,3 +1,4 @@
// AI 规划纯算法回归,覆盖传播范围、拓扑汇合、内容冻结与嵌套端口解析,不调用真实模型。
package platform
import (
@@ -6,6 +7,7 @@ import (
"testing"
)
// aiPlanFixture 从边对建立节点与执行开关,可指定一个未配置 AI 的中间节点来验证传播停止。
func aiPlanFixture(edges [][2]string, disabled map[string]bool, unconfigured string) map[string]canvasSnapshot {
ids := map[string]bool{"a": true}
for _, e := range edges {
@@ -28,6 +30,8 @@ func aiPlanFixture(edges [][2]string, disabled map[string]bool, unconfigured str
raw, _ := json.Marshal(map[string]any{"schema_version": 2, "nodes": nodes, "edges": values, "viewport": map[string]any{"x": 0, "y": 0, "zoom": 1}})
return map[string]canvasSnapshot{"board": {BoardID: "board", Version: 4, Document: raw}}
}
// TestAIPlanDiamondAndPropagationBoundaries 验证菱形末端只执行一次且等待两前驱,关闭传播/禁用边/无配置可截断遍历,环必须拒绝。
func TestAIPlanDiamondAndPropagationBoundaries(t *testing.T) {
graph := aiPlanFixture([][2]string{{"a", "b"}, {"a", "c"}, {"b", "d"}, {"c", "d"}}, nil, "")
plan, err := buildCanvasAIPlan(graph, "board", "a", true)
@@ -59,6 +63,9 @@ func TestAIPlanDiamondAndPropagationBoundaries(t *testing.T) {
t.Fatal("cycle accepted")
}
}
// TestAITargetFingerprintIgnoresVisualEdits 检查标题/样式不改指纹,正文或计划来源 board 改变则改指纹;JSON 键顺序不影响摘要。
// 同时覆盖超长提示和图标不允许 AI 配置,不把该用例视为 canonical owner 移动验证。
func TestAITargetFingerprintIgnoresVisualEdits(t *testing.T) {
data := map[string]any{"kind": "text", "text": "original", "title": "Title", "rotation": 0, "ai": map[string]any{"modelId": "fixture", "prompt": "prompt", "enabled": true}}
original := canvasTargetFingerprint("board", "node", data)
@@ -90,6 +97,7 @@ func TestAITargetFingerprintIgnoresVisualEdits(t *testing.T) {
}
}
// TestAIPlanFreezesAdditionalStaticInputs 从 x→a→b 的 a 启动,x 只作为冻结静态来源,不倒向执行;关闭传播仍保留输入。
func TestAIPlanFreezesAdditionalStaticInputs(t *testing.T) {
graph := aiPlanFixture([][2]string{{"x", "a"}, {"a", "b"}}, nil, "")
plan, err := buildCanvasAIPlan(graph, "board", "a", true)
@@ -111,6 +119,8 @@ func TestAIPlanFreezesAdditionalStaticInputs(t *testing.T) {
t.Fatal("static input not supplied to model")
}
}
// TestAIPlanLeavesChildThroughNestedPortChain 解析两层 frame port 到同一真实 deep 节点,边可有两条但目标步骤不重复,祖先版本也冻结。
func TestAIPlanLeavesChildThroughNestedPortChain(t *testing.T) {
raw := memberFixture(t)
child := "11111111-1111-4111-8111-111111111111"