# PU8 U9–U12 独立 flag 脚手架 测试报告 ## 一、 测试背景 (Background) P5 覆盖授权后需为 U9–U12 提供分项独立 flag 与最小端口脚手架。默认必须 OFF,且不得升 `MULTI_INTENT_PLAN_TIER`;flag off 行为等于当前 legacy。 ## 二、 测试目标 (Test Objectives) - 四 flag 默认 off;env 开启互不耦合 PlanTier - U9:默认 disabled;开启后 malformed/timeout/越界 fail closed;正常路径不 panic - U10–U12:默认不注册 adapters;开启后 dry-run/revision 门禁可用且不 panic - 既有 intentflow 回归仍 PASS ## 三、 测试方案与环境 (Test Plan & Environment) | 项 | 值 | |----|----| | OS | linux | | 分支 | `feature/pu8-u9-u12-flags`(自 `origin/dev@776b2b5`) | | Go | `go test` 单元层 | | 后端 | stub dry-run(无真实 LLM / 无领域写副作用) | | 证据 | `.doc/test-reports/assets/2026-09-16-pu8-u9-u12-flags/` | ## 四、 预期结果 (Expected Results) | 场景 | 预期 | |------|------| | 空 env | 四 flag false;PlanTier=legacy | | U9 off | `SEGMENT_PROPOSAL_DISABLED` | | U9 on + 坏 schema / 超时 / 越界 | fail closed | | U10–U12 off | `BuildOwnerMux` 不挂 Mutate/DocGov/RunControl | | U10–U12 on | dry-run Execute 成功;缺 revision → `PLAN_ACTION_VERSION_CONFLICT` | | 开 flag | PlanTier 仍为 legacy | ## 五、 实际测试结果与判定 (Actual Results & Evaluation) ### 5.1 Expansion flags / segment / dry-run - **测试输入**:`go test ./internal/app/intentflow -run 'TestExpansion|TestActiveSegment|TestStubSegment|TestBuildOwner|TestDryRun|TestPlanTierIndependentOfExpansion' -count=1 -v` - **实际输出**:见 [expansion-flags.txt](./assets/2026-09-16-pu8-u9-u12-flags/expansion-flags.txt)。8 用例全部 PASS。 - **评价判定**:PASS - **性能与耗时**:约 9ms ### 5.2 intentflow 全包回归 - **测试输入**:`go test ./internal/app/intentflow -count=1` - **实际输出**:`ok`(见 [intentflow-summary.txt](./assets/2026-09-16-pu8-u9-u12-flags/intentflow-summary.txt)) - **评价判定**:PASS - **性能与耗时**:约 13ms ### 5.3 app 包(含 BuildOwnerMux 接线) - **测试输入**:`go test -short ./internal/app -count=1` - **实际输出**:`ok`(见 [app-short.txt](./assets/2026-09-16-pu8-u9-u12-flags/app-short.txt)) - **评价判定**:PASS - **性能与耗时**:约 16ms ## 六、 自动化测试套件汇总 (Test Suite Execution) | 命令 | 结果 | |------|------| | `go test ./internal/app/intentflow -count=1` | PASS | | `go test -short ./internal/app -count=1` | PASS | | `go vet ./internal/app/intentflow ./internal/app` | PASS(无输出) | 本轮为 flag/端口脚手架验收,使用 stub dry-run;未升 tier,未 rebuild `:8080`,未跑真实 PI。 ## 七、 测试结论与后续优化建议 (Conclusion & Next Steps) 脚手架达到分支交付标准(push `feature/pu8-u9-u12-flags`,**不合 `dev`**)。后续:U9 真实 PI eval;U10–U12 分项 live adapter + 授权负例;仍禁止默认升 `MULTI_INTENT_PLAN_TIER=full`。