Files
ft/CodexOutput/upserver/阶段4B1交付与验收矩阵-2026-09-23.md

77 lines
8.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 阶段4B1交付与验收矩阵
日期:2026-09-23。**4B1独立实施复核及主会话逐条裁决完成,正式关闭;4B2/4B3未启动。** 受审hash核对、实施复核三条P3及B1-01~B1-16裁决见[关闭裁决](阶段4B1实施复核裁决与关闭-2026-09-23.md)。原方案三条P3裁决见[实施批准](阶段4B1方案裁决与实施批准-2026-09-23.md)。下方保留原技术交付证据;独立复跑23组全部通过,断言数差异和Unity复核证据口径见关闭裁决。游戏仍走原存档路径,不代表整个4B或G4完成。
## 1. 可观察行为与范围
- 新context拥有一次认证session,按认证→4A Bridge Open/Get→安全快照执行;不公开session/Cookie/写句柄,不初始化业务、不写KV。
- Prepare单实例单任务,首token定义生命期;关闭同步撤销,真正排水后再Dispose session。失败等待清理;清理失败保留原原因、引用和任务,不假成功。
- 历史Prepared快照保持不可变,关闭/过期后IsCurrent=false;成功空字典明确IsEmpty,不授权建档。外部归属委托抛异常自动启动安全收尾。
- 正式地址固定 `http://s101.local:18080/`;所有实际测试传输为替身。没有访问正式服、没有PlayMode、没有打包。
## 2. 文件与版本
生产路径为 `Client/Assets/Scripts/Services/PlayerData/`:
| 新文件 | SHA256 |
|---|---|
| PlayerKVLoginContext.cs | 7552C331BCD7B5B51A9726085D25319E9D77653E5519EE76D7772EEB4B757A29 |
| PlayerKVLoginPrepareResult.cs | 108CA361C7153D19A08CD348B8325538019A86C426BDD80B907528399F22B290 |
两份meta及新测试Program/csproj的完整hash一并见[final-source-hashes.json](KVLoginContextTests/final-source-hashes.json)。
[scope-hash-check.json](KVLoginContextTests/scope-hash-check.json)核对68项既有源码/meta/测试Program/csproj,全部未变。UserService、PlayFabMgr、DataCenter、Stages、4A/3A/3B及账户源码没有修改。没有旧测试项目差异需补审。
## 3. 实际命令、退出码与证据
工作目录 `C:/projects/ft`。以下路径均相对 `KVLoginContextTests/`。新项目restore先因用户NuGet配置访问限制失败(两次),提权读取后离线恢复成功;原日志保留。指定配置的packageSources为空,没有下载包。
| 命令 | 结果 | 证据 |
|---|---|---|
| dotnet run --no-restore --project CodexOutput/upserver/KVLoginContextTests | 最终退出0;23组/0失败,报告内274断言+末尾5脱敏检查,总279 | test-20260923164048.log及.exit.json;runs/20260923084050_c538423869dd467598f4514c6f523f38/result.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVGameBridgeTests | 退出0;18组、226总断言、0失败 | stage4a-20260923163915.log及.exit.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVContractTests | 退出0;42/42 | stage2-20260923163915.log及.exit.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVSyncTests | 退出0;86/86 | stage3a-20260923163916.log及.exit.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVSyncCoordinatorTests | 退出0;29/29 | stage3b-20260923163916.log及.exit.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVSyncCoordinatorReviewTests | 退出0;独立回归通过 | stage3b-review-20260923163917.log及.exit.json |
| dotnet run --no-restore --project CodexOutput/upserver/KVStage3CTests -- --offline | 退出0;8/8 | stage3c-offline-20260923163918.log及.exit.json |
| dotnet build --no-restore CodexOutput/upserver/KVLiveTests/KVLiveTests.csproj | 最终退出0;0错误/0警告,仅构建未运行 | live-build-final-20260923164111.log及.exit.json |
| uloop get-version --project-path C:/projects/ft/Client | 退出0;2022.3.62f2c1、Loop2.2.0、C盘Assets | unity-version.json、unity-exit.json |
| uloop execute-dynamic-code --project-path C:/projects/ft/Client --code 'return UnityEditor.EditorApplication.isPlaying;' | Success=true,Result=False;编译前确认编辑状态 | 本会话工具输出;未启动游戏 |
| uloop compile --project-path C:/projects/ft/Client --wait-for-domain-reload true | 退出0,Success=true,0错误/274其他文件警告,新模块警告0 | unity-compile.log、unity-compile-summary.json、unity-exit.json |
原回归项目使用显式Compile、不包含本轮新context,所以自审补强新context后不重复未受影响回归;新宿主、会包含新文件的KVLiveTests通配符构建、Unity编译均对应最终源码。
历史尝试不覆盖:首轮run `20260923083801_751f90f371fb4a159573ff83afc09afd` 为21组/1失败(夹具注册token错误,详见自审);修正后 `20260923083859_0010f4e6d45d4d79b9556f4318e912e1` 为21组/0失败;最终补强后23组/0失败。对应test日志全部保留。
## 4. B1-01~B1-16逐项矩阵
以下保留原技术验证结果;外部实施复核完成后,主会话已在[关闭裁决](阶段4B1实施复核裁决与关闭-2026-09-23.md)逐项接受。
| 编号 | 实际覆盖与观察 | 技术结论 |
|---|---|---|
| B1-01 | normal-immutable-cookie-order:认证结束才Get,完全同一Cookie容器;Get结束→Bridge Dispose→session Dispose;成功身份字段与状态准确 | 通过 |
| B1-02 | validation-cancel-stale-zero-transport:非法ID/盘符相对/根相对路径、null委托、提前取消/过期0factory;00101规范为101 | 通过 |
| B1-03 | authentication-errors-retain-evidence:HTTP401、JSON损坏、登录拒绝、网络与超时保留AccountError;0 Get、session释放 | 通过 |
| B1-04 | initial-get-busy-corrupt-storage、conflict-unknown-pending、storage-failure-before-read:初始失败释放槽位,Busy/RecoveryRequired/StorageError不伪空档,Conflict/Unknown/Data=null | 通过 |
| B1-05 | empty-is-not-new-game:newCreate=false/true均成功空快照IsEmpty=true;0变更请求,无初始化或默认值路径 | 通过 |
| B1-06 | first-token-only:重复任务引用一致,第二token取消不起效,有调试计数;首token取消立即撤销,登录/Get各一次 | 通过 |
| B1-07 | auth-ignores-cancel-drains:取消已观察但真实认证闸门未释放时,Prepare/Close均未完成、session未Dispose;放行后失败清理 | 通过 |
| B1-08 | get-ignores-cancel-then-switch:旧Get闸门未放行不提前关Owner/session;排水完成才开102,新账号独立Cookie/空快照 | 通过 |
| B1-09 | read-boundary-epoch-invalidated覆盖句柄发布后的4个校验边界;same-account-new-epoch确认同号新epoch、新Owner/Cookie;旧IsCurrent=false | 通过 |
| B1-10 | failure-and-close-no-cycle:Get失败与Close竞争,公开Prepare及Close均完成,无循环等待 | 通过 |
| B1-11 | close-before-prepare-and-reentry、old-snapshot-no-authority、parallel-prepare-close:先Close零请求、同任务、真实取消回调重入、24轮竞争;历史快照仍可读却无授权 | 通过 |
| B1-12 | bridge-close-failure-keeps-session、create-cleanup-failure-preserves-error、session-dispose-failure、throwing-cancellation-still-drains:错误可见、原原因保留、Close任务保留;Bridge失败不提前Dispose session,取消异常不跳过排水 | 通过 |
| B1-13 | current-and-factory-exceptions、prepared-callback-exception-closes:初始/读中/准备后委托异常及session/bridge工厂异常有结构化失败/安全收尾;准备后归属不可复活 | 通过 |
| B1-14 | conflict-unknown-pending:pending本地合并只读;Unknown拒读,Get仅一次、0变更/重试;原状态机不改 | 通过 |
| B1-15 | 快照不可改/与远端字典脱离;默认公开构造固定s101但未Prepare;无公共传输注入/资源外泄;最终result敏感字段/值标记0命中 | 通过 |
| B1-16 | 既有回归、仅构建、Unity编译及68项hash范围验证全部完成;274警告来自其他文件,新模块0 | 通过 |
## 5. 输出、限制与下一步
[artifact-and-transport-check.json](KVLoginContextTests/artifact-and-transport-check.json)限定扫描最终result.json的敏感JSON字段名、合成密钥/值和用户路径标记,0命中;测试名中的cookie/token文字不是凭据。原始restore和失败构建日志可能包含本机路径,保留本地诊断用途,不能当作已脱敏对外产物。accessedFormalServer=false来自所有实际Send路径强制替身及默认实例未Prepare的事实,不是网络抓包证明。
[限定代码自审](阶段4B1限定代码自审-2026-09-23.md)、外部独立实施复核及[主会话关闭裁决](阶段4B1实施复核裁决与关闭-2026-09-23.md)已完成。仍保留:历史KVSyncTests偶发失败根因未定;无真实游戏schema/初始化/保存接线;跨context先Close成功再开新实例由未来调用者负责;取消可无限等待真实传输、Close失败无自动恢复。
4B1现已正式关闭;[外部实施复核提示词](其他AI审查提示词-4B1实施-2026-09-23.md)保留为本轮审查记录。下一步先完成4B2完整方案及独立评审,明确裁决后才能编码;不能直接启用正式业务KV。