Files
Workspace/Assets/ShrinkInspection/README.md
T
cneicy 08246ddb01
Validate ShrinkSDK Workspace / catalog (push) Successful in 5s
Validate ShrinkSDK Workspace / unity (push) Successful in 3m20s
feat: integrate performance upgrade and agent inspection tooling
2026-09-29 10:16:02 +08:00

24 lines
2.1 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.
# Shrink Inspection
可选诊断接入包,提供 Unity 编译输入导出和跨 Unity/Godot/.NET 的按需绑定快照。它依赖被观察模块,不进入它们的热路径。
Unity 安装本目录的 UPM 包后,使用 `Tools/ShrinkSDK/Inspection` 导出编译输入和运行快照。结果位于项目的 `Artifacts/Inspection`。在命令行使用:
```text
shrink inspect flow command:execute --compilation Artifacts/Inspection/compilation.json --snapshot Artifacts/Inspection/runtime.json
```
编辑器默认只捕获默认 Context 与命名 EventBus。宿主持有的独立实例通过 `ShrinkInspectionExport.CaptureHostState` 按需加入;宿主退出时取消该委托,避免诊断代码持有已退役对象。`AddContext` 可同时传入 Loader,记录最近事务的阶段和恢复结果。
Godot/.NET 使用 `ShrinkSDK.Inspection` 和相同的 `ShrinkInspectionSnapshot` API。宿主在所属线程创建快照,调用 `AddContext`、`AddNetwork`、`AddEventBus`、`AddCommands`,再写入 `ToJson()`。构建标识由明确的程序集名集合计算;必须与编译输入的程序集集合和 MVID 一致。未知构建不能通过手写相同字符串伪装为已验证关联。
捕获时暂停同一实例的注册、退役和组合修改。快照只含符号、状态和计数;不含消息正文、会话令牌、存档内容及异常文本。它记录快照时刻的绑定,不提供完整调用时序。不同 scope 的绑定不能拼成已经确认的端到端调用。
<!-- shrink:capabilities -->
Capability: 导出真实编译输入、Context/provider 状态、EventBus/Network/Command 当前绑定及队列指标
Aliases: 导航 调试 诊断 快照 inspect snapshot 调用链
Limits: 按需快照,不是调用时序追踪;只覆盖显式加入的实例;过期或不同构建不能合并
Extension: 宿主在所属线程调用 AddContext/AddNetwork/AddEventBus/AddCommands,Unity 使用 CaptureHostState
Evidence: [快照 API](Runtime/ShrinkInspectionSnapshot.cs); [Unity 导出](Editor/ShrinkInspectionExport.cs)
<!-- /shrink:capabilities -->