docs(config): 添加AI代理编码规范和配置系统集成测试

- 创建AGENTS.md文档定义AI代理编码行为规则
- 包含环境能力清单、注释规则、代码风格要求
- 定义测试要求、安全规则和文档规范
- 添加端到端集成测试验证生成配置消费者功能
- 实现跨域配置表加载和强类型访问验证
- 添加按域、表名和自定义谓词过滤注册支持
- 提供完整的测试验证命令和执行期望说明
This commit is contained in:
GeWuYou 2026-04-06 17:24:04 +08:00
parent 92eb365dc7
commit 975f556ab0
2 changed files with 17 additions and 0 deletions

View File

@ -123,6 +123,8 @@ All generated or modified code MUST include clear and meaningful comments where
- Every non-trivial feature, bug fix, or behavior change MUST include tests or an explicit justification for why a test
is not practical.
- Public API changes must be covered by unit or integration tests.
- When a public API defines multiple contract branches, tests MUST cover the meaningful variants, including null,
empty, default, and filtered inputs when those branches change behavior.
- Regression fixes should include a test that fails before the fix and passes after it.
### Test Organization

View File

@ -138,6 +138,16 @@ public class GeneratedConfigConsumerIntegrationTests
});
await tableNameLoader.LoadAsync(tableNameRegistry);
var emptyAllowListRegistry = new ConfigRegistry();
var emptyAllowListLoader = new YamlConfigLoader(_rootPath)
.RegisterAllGeneratedConfigTables(
new GeneratedConfigRegistrationOptions
{
IncludedConfigDomains = Array.Empty<string>(),
IncludedTableNames = Array.Empty<string>()
});
await emptyAllowListLoader.LoadAsync(emptyAllowListRegistry);
var monsterDomain = MonsterConfigBindings.ConfigDomain;
var predicateRegistry = new ConfigRegistry();
var predicateLoader = new YamlConfigLoader(_rootPath)
@ -151,6 +161,11 @@ public class GeneratedConfigConsumerIntegrationTests
Assert.Multiple(() =>
{
Assert.That(emptyAllowListRegistry.TryGetMonsterTable(out var emptyAllowListMonsterTable), Is.True);
Assert.That(emptyAllowListMonsterTable, Is.Not.Null);
Assert.That(emptyAllowListRegistry.TryGetItemTable(out var emptyAllowListItemTable), Is.True);
Assert.That(emptyAllowListItemTable, Is.Not.Null);
Assert.That(domainRegistry.TryGetMonsterTable(out var domainMonsterTable), Is.True);
Assert.That(domainMonsterTable, Is.Not.Null);
Assert.That(domainRegistry.TryGetItemTable(out _), Is.False);