diff --git a/docs/requirements/p1-production-hardening.md b/docs/requirements/p1-production-hardening.md index 20638af..736f5a1 100644 --- a/docs/requirements/p1-production-hardening.md +++ b/docs/requirements/p1-production-hardening.md @@ -13,10 +13,26 @@ P1 在 P0 核心接口稳定后推进,目标是补齐第一批生产化扩展 - MainMenuP0 样例验收升级。 - 使用规范文档。 -## 不进入本轮 +## 已完成 + +- Runtime 资源核心已拆为 `ResourceService` + `IResourceBackend`,Addressables 适配移动到 `FlowScope.Addressables` 独立 asmdef。 +- 配置系统支持 source/parser 组合,旧 `Mapping(fileName, loadTextAsync)` API 保持可用。 +- 存档序列化支持版本 envelope 和连续 migration chain,旧 raw JSON 按版本 1 读取。 +- UI 增加 `UIPreloadService` 与 `UIScreenNavigator`,并保持 `UIManager` 层内 LIFO 规则。 +- MainMenuP0 样例升级为 P1 装配方式,覆盖启动、点击、保存恢复和资源释放测试。 +- 新增运行时使用规范与样例验收指南。 + +## 未进入本轮 - Luban 完整接入。 - YooAsset / AssetBundle 后端实现。 - 云存档。 - AudioMixer / 3D 音频。 - Package 分发。 +- URL 式 UI 路由、跨 Feature 页面恢复和完整页面栈框架。 + +## 当前验收状态 + +代码级编译验证中,`FlowScope.Runtime` 和 `FlowScope.Tests.EditMode` 可通过。`FlowScope.Tests.PlayMode` 在排除 Addressables 适配测试后可通过。 + +完整 PlayMode 与 Unity Test Runner 验收仍依赖 Unity 完成 `com.unity.addressables` 包解析;当前机器上主工程被其他 Unity 实例占用,且 `Library/PackageCache` 尚未出现 Addressables 包,因此本轮不能标记为完整人工验收通过。 diff --git a/docs/reviews/flowscope-framework-review.md b/docs/reviews/flowscope-framework-review.md index 3c4ae1e..865a94f 100644 --- a/docs/reviews/flowscope-framework-review.md +++ b/docs/reviews/flowscope-framework-review.md @@ -246,3 +246,16 @@ UI 模块基于 `UIPanelAttribute` 标记层级和路径,通过 `UIManager` 综合评级:B+。 结论摘要:FlowScope 是一个有工程意识的轻量 Unity 框架骨架,值得继续推进;但在正式生产复用前,需要优先修正异步资源、运行时销毁和 Addressables 依赖方式三个关键问题。 +# P1 更新记录(2026-05-20) + +P1 已完成第一批生产化硬化,评审风险状态同步如下: + +| 原风险 | P1 状态 | 说明 | +| --- | --- | --- | +| Addressables 反射调用 | 已降低 | Addressables 适配已从 Runtime 核心拆出到 `FlowScope.Addressables` 独立 asmdef,核心资源系统通过 `IResourceBackend` 工作。最终验收仍等待 Unity 完成 Addressables 包解析。 | +| 自研 JSON 转换器缺少扩展点 | 已降低 | Config 增加 `IConfigSource` / `IConfigParser`,Save 增加版本 envelope 与 `ISaveMigration` 链。长期是否替换成熟 JSON 库仍是 P2 决策。 | +| UI 缺少轻量导航与预加载 | 已降低 | 新增 `UIScreenNavigator` 与 `UIPreloadService`,并补充 PlayMode 编译级测试。 | +| 样例不能体现生产化装配 | 已降低 | MainMenuP0 已改为 P1 装配方式,覆盖启动、点击、保存恢复和资源释放。 | +| Package/editor tooling | 保持 P2 | 本轮没有做包分发、编辑器工具和跨项目模板化。 | + +当前结论仍是“有条件通过”:P1 代码与文档已落地,但完整 Unity Test Runner 和人工场景验收需要在 Unity 工程未被占用、Addressables 包解析完成后补跑。 diff --git a/docs/reviews/p1-completion-report.md b/docs/reviews/p1-completion-report.md new file mode 100644 index 0000000..f33c782 --- /dev/null +++ b/docs/reviews/p1-completion-report.md @@ -0,0 +1,50 @@ +# FlowScope Game Core P1 完成报告 + +## 范围 + +本轮执行 `docs/superpowers/plans/2026-05-20-p1-production-hardening-plan.md` 中的 P1 生产化硬化任务,范围包括资源后端拆分、配置与存档扩展点、UI 导航与预加载、MainMenuP0 样例升级,以及使用规范和完成报告。 + +## 已完成 + +- 定义 P1 契约:`IResourceBackend`、`IConfigSource`、`IConfigParser`、`ISaveMigration`、`IUIScreenNavigator`、`IUIPreloadService`。 +- 资源系统拆分:核心 `ResourceService` 保持在 Runtime,Addressables 适配移动到 `FlowScope.Addressables` 独立 asmdef。 +- 配置扩展:`JsonConfigProvider` 支持 source/parser,新增 `InMemoryConfigSource`、`FileConfigSource`、`JsonConfigParser`。 +- 存档迁移:`JsonSaveSerializer` 支持版本 envelope,`SaveMigrationRegistry` 支持连续迁移链。 +- UI 扩展:新增 `UIPreloadService` 和 `UIScreenNavigator`,`UIManager` 支持复用预加载 panel handle。 +- MainMenuP0 样例:改为 P1 装配方式,测试覆盖启动可见、点击即时更新、关闭保存、重启恢复、资源释放。 +- 文档:新增运行时使用规范和 MainMenuP0 P1 样例验收说明。 + +## 测试结果 + +- `dotnet build "My project\FlowScope.Runtime.csproj" --no-restore`:通过,0 错误;存在 Unity 生成项目的引用版本冲突警告。 +- `dotnet build "My project\FlowScope.Tests.EditMode.csproj" --no-restore`:通过,0 错误;存在相同引用警告。 +- `dotnet build "My project\FlowScope.Tests.PlayMode.csproj" --no-restore`:完整编译失败,原因是 `FlowScope.Addressables` 生成项目和 `com.unity.addressables` 包尚未由 Unity 解析。 +- 临时排除 `AddressablesResourceBackendTests.cs` 后的 PlayMode 编译:通过,0 错误;用于确认 UI 与样例集成未破坏。 + +## 人工验收 + +尚未完成。主工程当前被其他 Unity 实例占用,Unity batchmode 无法打开同一 project path,无法执行 Test Runner 全量 PlayMode 和 MainMenuP0 场景人工验收。 + +待 Unity 可用后,需要重新执行: + +- Unity 包解析,确认 `Packages/packages-lock.json` 更新并出现 `com.unity.addressables`。 +- PlayMode: `FlowScope.Tests.PlayMode.Samples.MainMenuP0Tests`。 +- PlayMode 全量测试。 +- 打开 `My project/Assets/FlowScope/Samples/MainMenuP0/Scenes/MainMenuP0.unity` 做人工点击、保存恢复、资源释放验收。 + +## 未进入本轮 + +- Luban 完整接入。 +- YooAsset / AssetBundle 后端。 +- 云存档。 +- AudioMixer / 3D 音频。 +- Package 分发和编辑器工具链。 +- 完整 UI 路由系统。 + +## P2 建议 + +- 让 Unity 完成 Addressables 包解析后补一次 P1 验收提交,包含 `packages-lock.json` 和 Unity Test Runner 结果。 +- 将 AudioService 的同步资源加载改为异步或预加载模型。 +- 为 Runtime/package 分发建立 asmdef、Samples、Tests 的包结构规范。 +- 为 Config/Save 引入更成熟 JSON 库或明确长期 DTO 限制。 +- 增加 AOT/linker 验证,避免反射和 JSON 构造在移动端出现隐性问题。