From 6540560c13e2826260896ba4f5fb3a22defb0b81 Mon Sep 17 00:00:00 2001 From: Joywayer Date: Wed, 29 Jul 2026 14:48:19 +0800 Subject: [PATCH] =?UTF-8?q?docs(enemy):=20=E8=AE=A1=E5=88=92=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E2=80=94=E2=80=94=E6=9C=AA=E9=85=8D=E7=BD=AE=E9=85=8D?= =?UTF-8?q?=E6=96=B9=E5=BA=94=E6=98=BE=E5=BC=8F=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E9=9D=9E"=E9=BB=98=E8=AE=A4=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E5=8F=AF=E5=BB=BA=E5=9B=BE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit T13 执行中发现原稿的 DefaultModules_ProduceValidGraph 断言了一条不成立的契约: 建资产到配好模块之间没有任何东西会调 GetOrBuildGraph(),它只在 EnemyAiBrain.Start() 运行时被调,所以"新建资产即报错"的场景不存在。 按该断言把默认改成零配置可建图的模块,会把"必然响亮报错"换成 "建图成功但敌人永不出手、零报错"——方向与第 6 条相反。改为钉相反契约。 Co-Authored-By: Claude Opus 5 (1M context) --- .../plans/2026-07-29-enemy-ai-composable-modules.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Docs_Dev/superpowers/plans/2026-07-29-enemy-ai-composable-modules.md b/Docs_Dev/superpowers/plans/2026-07-29-enemy-ai-composable-modules.md index a5c17c3f..086113f7 100644 --- a/Docs_Dev/superpowers/plans/2026-07-29-enemy-ai-composable-modules.md +++ b/Docs_Dev/superpowers/plans/2026-07-29-enemy-ai-composable-modules.md @@ -2219,6 +2219,19 @@ namespace BaseGames.Tests.EditMode.AI Object.DestroyImmediate(so); } + [Test] + public void UnconfiguredRecipe_ThrowsClearError_NotSilentlyInert() + { + // 新建的空配方默认用 RushEngagement 但尚未配能力。建图时必须**显式报错**, + // 而不是静默产出一张"永远不会出手"的图——第 6 条:暴露问题,不掩盖。 + // 注:策划建完资产到配好模块之间没有任何东西会调 GetOrBuildGraph(), + // 它只在 EnemyAiBrain.Start() 运行时被调,所以这里报错不影响编辑期体验。 + var so = ScriptableObject.CreateInstance(); + var ex = Assert.Throws(() => so.GetOrBuildGraph()); + StringAssert.Contains("RushEngagement", ex.Message); + Object.DestroyImmediate(so); + } + [Test] public void Graph_BehavesLikeE001() {