Build58 CoreProfile 存储策略与原始分块持久化分级验收

日期:2026-09-16 · 证据:E2 构建与静态契约 · 状态:implemented · partial

背景与核心设计(FTI-003 / FTI-004)

在 Build 57 验证与现场测试中,单 CoreProfile 连续采集成功解决了启动完成后的丢帧与首值延迟问题,但随着测试时长增加,core-profile-chunks.bin 以持续数十 MiB/s 写入,5 分钟会话膨胀至约 10 GiB,导致严重磁盘 I/O 压力并触发系统卡顿。Build 58 正式实施两级存储策略:

  1. 分级策略(Storage Policy):
  2. 内部容错与防崩降级(Rule 0 硬边界):

E2 验证结果

验证项指标 / 结果状态
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 死链通过

专项测试矩阵(test_storage_policy.py & SessionStoragePolicyTests.swift)

序号测试用例验证要点耗时
1test_storage_policy_resolution_truth_table解析真值表:wire > env > legacy-fallback<0.01s
2test_derived_only_does_not_create_or_write_core_profile_blobderivedOnly 下 core-profile-chunks.bin 物理文件永不创建<0.05s
3test_full_retention_persists_raw_chunks_and_manifestfull 模式下完整落盘 blob 并产出正确的 SHA256 与字节统计<0.05s
4test_derived_only_chunk_decoding_identity_with_fullderivedOnly 与 full 模式内存解码出的 frame 事件完全相同<0.05s
5test_derived_only_session_fails_offline_candidate_replayderivedOnly 会话执行离线 finalize 时触发严格防御报错<0.05s
6test_historical_session_compatibility无 retention 字段的历史会话安全解析为 historical-full 契约<0.05s
7test_full_retention_writer_error_degrades_gracefully写入异常被内部消化并标记 truncated,SessionWriter 正常工作<0.05s
8test_live_stop_does_not_require_raw_core_profile_replay实时会话结束交付不走离线 candidate 回放,derivedOnly 正常归档<0.05s
9testRule0HashStabilityRule 0 验证:不同 storagePolicy 绝不影响 CapturePlan.hash<0.01s
10testDecodeHistoricalPlanWithoutStoragePolicy旧 schema 1/2 会话 plan 自动兼容解码为 historicalFull<0.01s

测试分发包与签名校验

Build 58 测试安装包已完成生成与严格校验:

证据边界与未关门门禁

本机未配置 Apple Notary Service Keychain Profile,公证与 ticket stapling 门禁仍开放;GPL-3.0 法务评估门禁仍开放;当前测试包仅供内部联调与真机长测复测,交付状态标记为 partial。