日期:2026-09-16 · 证据:E2 构建与静态契约 · 状态:implemented · partial
在 Build 57 验证与现场测试中,单 CoreProfile 连续采集成功解决了启动完成后的丢帧与首值延迟问题,但随着测试时长增加,core-profile-chunks.bin 以持续数十 MiB/s 写入,5 分钟会话膨胀至约 10 GiB,导致严重磁盘 I/O 压力并触发系统卡顿。Build 58 正式实施两级存储策略:
derivedOnly(产品默认):不预先创建、不落盘 core-profile-chunks.bin。会话落盘开销从 ~10 GiB 彻底收敛至数百 MiB 级。内存中保留原始 chunk 用于实时解码器(LaunchTraceDecoder / FrameDecoder)即时解码衍生指标;raw-events.jsonl 记录 {"chunkRetention": "not-retained", "observedChunkByteLength": len} 审计信息;Manifest 诚实置空 blob 路径与 SHA-256。full(研发调试可选):显式开启,保留外部 byte-exact blob 契约,用于离线回放与深度问题复现。full 模式下若发生写错误、磁盘配额超限或低磁盘空间,异常在 RawSessionRecorder 内部消化并标记 retention_status = "truncated"、retention_reason = "writer-error"、replay_capability = "partial",绝不抛出异常破坏 SessionWriter.append()。derivedOnly 会话在离线 candidate finalize 时明确抛出 ReplayValidationError("core-profile-raw-replay-unavailable"),禁止伪装全量回放保真度。storagePolicy 与 retention 绝不进入 CapturePlan.hash、CollectorReadiness 或 prewarmGeneration,确保预热与就绪状态绝对稳定。| 验证项 | 指标 / 结果 | 状态 |
|---|---|---|
| Python Sidecar 测试套件 | 407/407 通过(新增 8 项存储策略专项单测,覆盖真值表、非落盘、降级容错、历史兼容与回放防御) | 通过 |
| Swift 客户端测试套件 | 149/149 通过(新增 4 项 SessionStoragePolicy 单测,含 Rule 0 哈希稳定性与 Schema 1/2/3 兼容,3 项显式基准跳过,0 失败) | 通过 |
| 冻结 Sidecar Core 探针 | ready=true,63 Metric Contracts,9 Source Families,pymobiledevice3 11.3.1 | 通过 |
| 站点知识库门禁与构建 | 63 项 Registry 契约校验通过,VitePress 0 报错 0 死链 | 通过 |
| 序号 | 测试用例 | 验证要点 | 耗时 |
|---|---|---|---|
| 1 | test_storage_policy_resolution_truth_table | 解析真值表:wire > env > legacy-fallback | <0.01s |
| 2 | test_derived_only_does_not_create_or_write_core_profile_blob | derivedOnly 下 core-profile-chunks.bin 物理文件永不创建 | <0.05s |
| 3 | test_full_retention_persists_raw_chunks_and_manifest | full 模式下完整落盘 blob 并产出正确的 SHA256 与字节统计 | <0.05s |
| 4 | test_derived_only_chunk_decoding_identity_with_full | derivedOnly 与 full 模式内存解码出的 frame 事件完全相同 | <0.05s |
| 5 | test_derived_only_session_fails_offline_candidate_replay | derivedOnly 会话执行离线 finalize 时触发严格防御报错 | <0.05s |
| 6 | test_historical_session_compatibility | 无 retention 字段的历史会话安全解析为 historical-full 契约 | <0.05s |
| 7 | test_full_retention_writer_error_degrades_gracefully | 写入异常被内部消化并标记 truncated,SessionWriter 正常工作 | <0.05s |
| 8 | test_live_stop_does_not_require_raw_core_profile_replay | 实时会话结束交付不走离线 candidate 回放,derivedOnly 正常归档 | <0.05s |
| 9 | testRule0HashStability | Rule 0 验证:不同 storagePolicy 绝不影响 CapturePlan.hash | <0.01s |
| 10 | testDecodeHistoricalPlanWithoutStoragePolicy | 旧 schema 1/2 会话 plan 自动兼容解码为 historicalFull | <0.01s |
Build 58 测试安装包已完成生成与严格校验:
/Users/itreenewbee/工作/代码/perfowl/MacApp/dist/Perfowl.app(CFBundleVersion=58,Developer ID Application: Jiacheng Li (76J692XB5C) 签名,Hardened Runtime 开启,时间戳有效,codesign --verify --deep --strict 通过)。/Users/itreenewbee/工作/代码/perfowl/MacApp/dist/Perfowl-internal-test-Build58-x86_64.zip5f4d47fe8e1fa5f3c73cdb3d8db49213ad39efcc9617f91ecd828b7eb87dc4a3codesign --verify --deep --strict 通过。
/Users/itreenewbee/工作/代码/perfowl/MacApp/dist/Perfowl-internal-test-Build58-x86_64.dmg6d82479f4a6da0ca452f36adfadca1eb9f9d3eca72dd9cfade63b274cc5b0240hdiutil verify 通过,独立挂载卷内 App 严格签名校验通过。
fa574c5e2294a28108bbedfa93288743b7c0fb8928d5e2a3e98001485c21f477(6,638,160 bytes)。本机未配置 Apple Notary Service Keychain Profile,公证与 ticket stapling 门禁仍开放;GPL-3.0 法务评估门禁仍开放;当前测试包仅供内部联调与真机长测复测,交付状态标记为 partial。