## 1. 基础设施搭建 - [x] 1.1 创建 `src/server/checker/utils.ts`,将 `size.ts` 的 `parseSize` 和 `config-loader.ts` 的 `parseDuration` 及 `DURATION_REGEX` 迁入 - [x] 1.2 创建 `src/server/checker/expect/` 目录,创建 `expect/types.ts` 放置 `ExpectResult` 等共享类型 - [x] 1.3 将 `runner/shared/operator.ts` 迁入为 `expect/operator.ts` - [x] 1.4 将 `runner/shared/failure.ts` 迁入为 `expect/failure.ts` - [x] 1.5 将 `runner/shared/duration.ts` 迁入为 `expect/duration.ts`(`ExpectResult` 类型提取到 `expect/types.ts`) - [x] 1.6 从 `runner/shared/validate.ts` 中提取 `validateOperatorObject`、`isJsonValue`、`validateOperatorValue`、`isPlainRecord` 到 `expect/validate-operator.ts` ## 2. Schema 目录重组 - [x] 2.1 将 `config-contract/` 目录重命名为 `schema/` - [x] 2.2 将 `schema/schema.ts` 重命名为 `schema/builder.ts` - [x] 2.3 更新 `schema/` 内部文件的相互引用路径 - [x] 2.4 更新外部对 `config-contract/` 的所有 import 路径(config-loader.ts、runner/shared/validate.ts 等) ## 3. 类型系统重构 - [x] 3.1 在顶层 `types.ts` 中创建 `ResolvedTargetBase` 和 `RawTargetConfig` base interface - [x] 3.2 将 HTTP 专属类型(`HttpTargetConfig`、`ResolvedHttpTarget`、`HttpExpectConfig`、`HttpDefaultsConfig`、`ResolvedHttpConfig`、`BodyRule`、`CssRule`、`JsonRule`、`XpathRule`、`HeaderExpect`)迁入 `runner/http/types.ts` - [x] 3.3 将 Command 专属类型(`CommandTargetConfig`、`ResolvedCommandTarget`、`CommandExpectConfig`、`CommandDefaultsConfig`、`ResolvedCommandConfig`)迁入 `runner/command/types.ts` - [x] 3.4 删除顶层 `types.ts` 中的 `ResolvedTarget` 联合类型和 `TargetConfig` 联合类型,将 `TextRule` 迁入 command/types.ts - [x] 3.5 将 `DefaultsConfig` 改为宽松 base 形式(仅保留 `interval?`、`timeout?` + index signature),将 `CommandDefaultsConfig` 迁入 command/types.ts,将 `HttpDefaultsConfig` 迁入 http/types.ts - [x] 3.6 更新 `runner/types.ts` 中 `CheckerDefinition` 接口签名,使用 `RawTargetConfig` 和 `ResolvedTargetBase` - [x] 3.7 更新 `engine.ts`、`store.ts`、`config-loader.ts` 的类型引用为 `ResolvedTargetBase` 和 `RawTargetConfig` ## 4. HTTP Checker 内聚化 - [x] 4.1 将 `runner/http/runner.ts` 重命名为 `runner/http/execute.ts` - [x] 4.2 将 `runner/http/contract.ts` 重命名为 `runner/http/schema.ts` - [x] 4.3 将 `runner/shared/body.ts` 迁入 `runner/http/body.ts` - [x] 4.4 将 `runner/shared/validate.ts` 中的 `validateBodyRules`、`validateCssRule`、`validateJsonRule`、`validateXpathRule`、`validateRegexRule`、`validateSingleBodyRule`、`validateJsonPath` 合并到 `runner/http/validate.ts` - [x] 4.5 创建 `runner/http/index.ts`,re-export `HttpChecker` - [x] 4.6 更新 `runner/http/` 内所有文件的 import 路径 ## 5. Command Checker 内聚化 - [x] 5.1 将 `runner/command/runner.ts` 重命名为 `runner/command/execute.ts` - [x] 5.2 将 `runner/command/contract.ts` 重命名为 `runner/command/schema.ts` - [x] 5.3 将 `runner/shared/text.ts` 迁入 `runner/command/text.ts` - [x] 5.4 将 `runner/shared/validate.ts` 中的 `validateTextRules` 合并到 `runner/command/validate.ts` - [x] 5.5 创建 `runner/command/index.ts`,re-export `CommandChecker` - [x] 5.6 更新 `runner/command/` 内所有文件的 import 路径 ## 6. 注册入口改造 - [x] 6.1 重写 `runner/index.ts` 为显式列表注册模式(import 列表 + checker 数组 + 循环注册) - [x] 6.2 删除 `runner/shared/` 目录(确认所有内容已迁移完毕) - [x] 6.3 删除 `src/server/checker/size.ts`(已迁入 utils.ts) ## 7. 测试与质量保障 - [x] 7.1 更新所有测试文件的 import 路径 - [x] 7.2 执行完整测试套件,确保所有测试通过 - [x] 7.3 执行 lint 和格式检查,确保代码质量 - [x] 7.4 确认新增 checker 只需一个目录 + 一行注册